Lines Matching +full:off +full:- +full:codec

1 // SPDX-License-Identifier:     GPL-2.0+
25 * 0db~-95db,0.375db/step,for example:
27 * 0x0a: -3.75dB
28 * 0x7d: -46dB
29 * 0xff: -95dB
64 struct udevice *codec = priv->dev->parent; in rk817_reset() local
66 snd_soc_write(codec, RK817_CODEC_DTOP_LPT_SRST, 0x40); in rk817_reset()
67 snd_soc_write(codec, RK817_CODEC_DDAC_POPD_DACST, 0x02); in rk817_reset()
115 struct udevice *codec = rk817->dev->parent; in rk817_codec_power_up() local
124 snd_soc_update_bits(codec, RK817_CODEC_DTOP_DIGEN_CLKE, in rk817_codec_power_up()
127 snd_soc_write(codec, playback_power_up_list[i].reg, in rk817_codec_power_up()
137 struct udevice *codec = rk817->dev->parent; in rk817_codec_power_down() local
148 snd_soc_update_bits(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, in rk817_codec_power_down()
154 snd_soc_write(codec, playback_power_down_list[i].reg, in rk817_codec_power_down()
157 snd_soc_update_bits(codec, RK817_CODEC_DTOP_DIGEN_CLKE, in rk817_codec_power_down()
163 snd_soc_write(codec, playback_power_down_list[i].reg, in rk817_codec_power_down()
166 snd_soc_write(codec, RK817_CODEC_DTOP_DIGEN_CLKE, 0x00); in rk817_codec_power_down()
167 snd_soc_write(codec, RK817_CODEC_APLL_CFG5, 0x01); in rk817_codec_power_down()
168 snd_soc_write(codec, RK817_CODEC_AREF_RTCFG1, 0x06); in rk817_codec_power_down()
176 struct udevice *codec = rk817->dev->parent; in rk817_playback_path_put() local
179 if (rk817->playback_path == path) { in rk817_playback_path_put()
184 pre_path = rk817->playback_path; in rk817_playback_path_put()
185 rk817->playback_path = path; in rk817_playback_path_put()
188 __func__, rk817->playback_path, pre_path); in rk817_playback_path_put()
190 switch (rk817->playback_path) { in rk817_playback_path_put()
191 case OFF: in rk817_playback_path_put()
197 if (pre_path == OFF) in rk817_playback_path_put()
199 if (!rk817->use_ext_amplifier) { in rk817_playback_path_put()
201 snd_soc_write(codec, RK817_CODEC_ADAC_CFG1, in rk817_playback_path_put()
205 snd_soc_write(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, 0x10); in rk817_playback_path_put()
207 snd_soc_write(codec, RK817_CODEC_ACLASSD_CFG1, 0xa5); in rk817_playback_path_put()
209 snd_soc_write(codec, RK817_CODEC_ACLASSD_CFG2, 0xc4); in rk817_playback_path_put()
212 snd_soc_write(codec, RK817_CODEC_AHP_CP, 0x11); in rk817_playback_path_put()
214 snd_soc_write(codec, RK817_CODEC_AHP_CFG0, 0x80); in rk817_playback_path_put()
216 snd_soc_write(codec, RK817_CODEC_ADAC_CFG1, in rk817_playback_path_put()
219 snd_soc_update_bits(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, in rk817_playback_path_put()
222 snd_soc_write(codec, RK817_CODEC_DDAC_VOLL, rk817->spk_volume); in rk817_playback_path_put()
223 snd_soc_write(codec, RK817_CODEC_DDAC_VOLR, rk817->spk_volume); in rk817_playback_path_put()
229 if (pre_path == OFF) in rk817_playback_path_put()
232 snd_soc_write(codec, RK817_CODEC_AHP_CP, 0x11); in rk817_playback_path_put()
234 snd_soc_write(codec, RK817_CODEC_AHP_CFG0, 0x80); in rk817_playback_path_put()
236 snd_soc_write(codec, RK817_CODEC_ADAC_CFG1, in rk817_playback_path_put()
239 snd_soc_update_bits(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, in rk817_playback_path_put()
242 snd_soc_write(codec, RK817_CODEC_DDAC_VOLL, rk817->hp_volume); in rk817_playback_path_put()
243 snd_soc_write(codec, RK817_CODEC_DDAC_VOLR, rk817->hp_volume); in rk817_playback_path_put()
249 if (pre_path == OFF) in rk817_playback_path_put()
253 snd_soc_write(codec, RK817_CODEC_AHP_CP, 0x11); in rk817_playback_path_put()
255 snd_soc_write(codec, RK817_CODEC_AHP_CFG0, 0x80); in rk817_playback_path_put()
258 snd_soc_write(codec, RK817_CODEC_ADAC_CFG1, in rk817_playback_path_put()
262 if (!rk817->use_ext_amplifier) { in rk817_playback_path_put()
264 snd_soc_write(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, 0x10); in rk817_playback_path_put()
266 snd_soc_write(codec, RK817_CODEC_ACLASSD_CFG1, 0xa5); in rk817_playback_path_put()
268 snd_soc_write(codec, RK817_CODEC_ACLASSD_CFG2, 0xc4); in rk817_playback_path_put()
271 snd_soc_write(codec, RK817_CODEC_DDAC_VOLL, rk817->hp_volume); in rk817_playback_path_put()
272 snd_soc_write(codec, RK817_CODEC_DDAC_VOLR, rk817->hp_volume); in rk817_playback_path_put()
275 return -EINVAL; in rk817_playback_path_put()
285 struct udevice *codec = rk817->dev->parent; in rk817_hw_params() local
287 snd_soc_update_bits(codec, RK817_CODEC_DI2S_CKM, in rk817_hw_params()
289 snd_soc_write(codec, RK817_CODEC_DI2S_RXCR2, VDW_RX_16BITS); in rk817_hw_params()
290 snd_soc_write(codec, RK817_CODEC_DI2S_TXCR2, VDW_TX_16BITS); in rk817_hw_params()
297 struct udevice *codec = rk817->dev->parent; in rk817_digital_mute() local
300 snd_soc_update_bits(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, in rk817_digital_mute()
303 snd_soc_update_bits(codec, RK817_CODEC_DDAC_MUTE_MIXCTL, in rk817_digital_mute()
326 struct rk8xx_priv *rk817 = dev_get_priv(dev->parent); in rk817_codec_probe()
331 return -EINVAL; in rk817_codec_probe()
334 switch (rk817->variant) { in rk817_codec_probe()
339 return -EINVAL; in rk817_codec_probe()
342 rk817_codec->dev = dev; in rk817_codec_probe()
343 rk817_codec->hp_volume = INITIAL_VOLUME; in rk817_codec_probe()
344 rk817_codec->spk_volume = INITIAL_VOLUME; in rk817_codec_probe()
345 rk817_codec->playback_path = OFF; in rk817_codec_probe()
352 { .compatible = "rockchip,rk817-codec" },
365 UCLASS_DRIVER(codec) = {
367 .name = "codec",