Lines Matching refs:val

155 #define	CODEC_WRITE(sc, reg, val)	bus_write_4((sc)->res[0], (reg), (val))  argument
179 uint32_t val; in sun8i_codec_attach() local
214 val = CODEC_READ(sc, SYSCLK_CTL); in sun8i_codec_attach()
215 val |= AIF1CLK_ENA; in sun8i_codec_attach()
216 val &= ~AIF1CLK_SRC_MASK; in sun8i_codec_attach()
217 val |= AIF1CLK_SRC_PLL; in sun8i_codec_attach()
218 val |= SYSCLK_ENA; in sun8i_codec_attach()
219 val &= ~SYSCLK_SRC; in sun8i_codec_attach()
220 CODEC_WRITE(sc, SYSCLK_CTL, val); in sun8i_codec_attach()
229 val = CODEC_READ(sc, SYS_SR_CTRL); in sun8i_codec_attach()
230 val &= ~AIF1_FS_MASK; in sun8i_codec_attach()
231 val |= AIF_FS_48KHZ; in sun8i_codec_attach()
232 CODEC_WRITE(sc, SYS_SR_CTRL, val); in sun8i_codec_attach()
235 val = CODEC_READ(sc, AIF1CLK_CTRL); in sun8i_codec_attach()
236 val &= ~AIF1_WORD_SIZ_MASK; in sun8i_codec_attach()
237 val |= AIF1_WORD_SIZ_16; in sun8i_codec_attach()
238 CODEC_WRITE(sc, AIF1CLK_CTRL, val); in sun8i_codec_attach()
241 val = CODEC_READ(sc, AIF1_DACDAT_CTRL); in sun8i_codec_attach()
242 val |= AIF1_DAC0L_ENA; in sun8i_codec_attach()
243 val |= AIF1_DAC0R_ENA; in sun8i_codec_attach()
244 CODEC_WRITE(sc, AIF1_DACDAT_CTRL, val); in sun8i_codec_attach()
247 val = CODEC_READ(sc, AIF1_ADCDAT_CTRL); in sun8i_codec_attach()
248 val |= AIF1_ADC0L_ENA; in sun8i_codec_attach()
249 val |= AIF1_ADC0R_ENA; in sun8i_codec_attach()
250 CODEC_WRITE(sc, AIF1_ADCDAT_CTRL, val); in sun8i_codec_attach()
253 val = CODEC_READ(sc, DAC_MXR_SRC); in sun8i_codec_attach()
254 val &= ~DACL_MXR_SRC_MASK; in sun8i_codec_attach()
255 val |= DACL_MXR_SRC_AIF1_DAC0L; in sun8i_codec_attach()
256 val &= ~DACR_MXR_SRC_MASK; in sun8i_codec_attach()
257 val |= DACR_MXR_SRC_AIF1_DAC0R; in sun8i_codec_attach()
258 CODEC_WRITE(sc, DAC_MXR_SRC, val); in sun8i_codec_attach()
261 val = CODEC_READ(sc, AIF1_MXR_SRC); in sun8i_codec_attach()
262 val &= ~AIF1L_MXR_SRC_MASK; in sun8i_codec_attach()
263 val |= AIF1L_MXR_SRC_ADC; in sun8i_codec_attach()
264 val &= ~AIF1R_MXR_SRC_MASK; in sun8i_codec_attach()
265 val |= AIF1R_MXR_SRC_ADC; in sun8i_codec_attach()
266 CODEC_WRITE(sc, AIF1_MXR_SRC, val); in sun8i_codec_attach()
313 uint32_t val; in sun8i_codec_dai_init() local
321 val = CODEC_READ(sc, AIF1CLK_CTRL); in sun8i_codec_dai_init()
323 val &= ~AIF1_DATA_FMT_MASK; in sun8i_codec_dai_init()
326 val |= AIF1_DATA_FMT_I2S; in sun8i_codec_dai_init()
329 val |= AIF1_DATA_FMT_RJ; in sun8i_codec_dai_init()
332 val |= AIF1_DATA_FMT_LJ; in sun8i_codec_dai_init()
336 val |= AIF1_DATA_FMT_DSP; in sun8i_codec_dai_init()
342 val &= ~(AIF1_BCLK_INV|AIF1_LRCK_INV); in sun8i_codec_dai_init()
345 val |= AIF1_LRCK_INV; in sun8i_codec_dai_init()
347 val |= AIF1_BCLK_INV; in sun8i_codec_dai_init()
351 val &= ~AIF1_MSTR_MOD; /* codec is master */ in sun8i_codec_dai_init()
354 val |= AIF1_MSTR_MOD; /* codec is slave */ in sun8i_codec_dai_init()
360 val &= ~AIF1_LRCK_DIV_MASK; in sun8i_codec_dai_init()
361 val |= AIF1_LRCK_DIV_64; in sun8i_codec_dai_init()
363 val &= ~AIF1_BCLK_DIV_MASK; in sun8i_codec_dai_init()
364 val |= AIF1_BCLK_DIV_16; in sun8i_codec_dai_init()
366 CODEC_WRITE(sc, AIF1CLK_CTRL, val); in sun8i_codec_dai_init()