lm49453.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) | lm49453.c (54b5927067dd79b58032a4938ee13b233f1a368c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * lm49453.c - LM49453 ALSA Soc Audio driver 4 * 5 * Copyright (c) 2012 Texas Instruments, Inc 6 * 7 * Initially based on sound/soc/codecs/wm8350.c 8 */ --- 1204 unchanged lines hidden (view full) --- 1213 return -EINVAL; 1214 } 1215 1216 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, BIT(4), pll_clk); 1217 1218 return 0; 1219} 1220 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * lm49453.c - LM49453 ALSA Soc Audio driver 4 * 5 * Copyright (c) 2012 Texas Instruments, Inc 6 * 7 * Initially based on sound/soc/codecs/wm8350.c 8 */ --- 1204 unchanged lines hidden (view full) --- 1213 return -EINVAL; 1214 } 1215 1216 snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, BIT(4), pll_clk); 1217 1218 return 0; 1219} 1220 |
1221static int lm49453_hp_mute(struct snd_soc_dai *dai, int mute) | 1221static int lm49453_hp_mute(struct snd_soc_dai *dai, int mute, int direction) |
1222{ 1223 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(1)|BIT(0), 1224 (mute ? (BIT(1)|BIT(0)) : 0)); 1225 return 0; 1226} 1227 | 1222{ 1223 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(1)|BIT(0), 1224 (mute ? (BIT(1)|BIT(0)) : 0)); 1225 return 0; 1226} 1227 |
1228static int lm49453_lo_mute(struct snd_soc_dai *dai, int mute) | 1228static int lm49453_lo_mute(struct snd_soc_dai *dai, int mute, int direction) |
1229{ 1230 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(3)|BIT(2), 1231 (mute ? (BIT(3)|BIT(2)) : 0)); 1232 return 0; 1233} 1234 | 1229{ 1230 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(3)|BIT(2), 1231 (mute ? (BIT(3)|BIT(2)) : 0)); 1232 return 0; 1233} 1234 |
1235static int lm49453_ls_mute(struct snd_soc_dai *dai, int mute) | 1235static int lm49453_ls_mute(struct snd_soc_dai *dai, int mute, int direction) |
1236{ 1237 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(5)|BIT(4), 1238 (mute ? (BIT(5)|BIT(4)) : 0)); 1239 return 0; 1240} 1241 | 1236{ 1237 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(5)|BIT(4), 1238 (mute ? (BIT(5)|BIT(4)) : 0)); 1239 return 0; 1240} 1241 |
1242static int lm49453_ep_mute(struct snd_soc_dai *dai, int mute) | 1242static int lm49453_ep_mute(struct snd_soc_dai *dai, int mute, int direction) |
1243{ 1244 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(4), 1245 (mute ? BIT(4) : 0)); 1246 return 0; 1247} 1248 | 1243{ 1244 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(4), 1245 (mute ? BIT(4) : 0)); 1246 return 0; 1247} 1248 |
1249static int lm49453_ha_mute(struct snd_soc_dai *dai, int mute) | 1249static int lm49453_ha_mute(struct snd_soc_dai *dai, int mute, int direction) |
1250{ 1251 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(7)|BIT(6), 1252 (mute ? (BIT(7)|BIT(6)) : 0)); 1253 return 0; 1254} 1255 1256static int lm49453_set_bias_level(struct snd_soc_component *component, 1257 enum snd_soc_bias_level level) --- 25 unchanged lines hidden (view full) --- 1283/* Formates supported by LM49453 driver. */ 1284#define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1285 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 1286 1287static const struct snd_soc_dai_ops lm49453_headset_dai_ops = { 1288 .hw_params = lm49453_hw_params, 1289 .set_sysclk = lm49453_set_dai_sysclk, 1290 .set_fmt = lm49453_set_dai_fmt, | 1250{ 1251 snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(7)|BIT(6), 1252 (mute ? (BIT(7)|BIT(6)) : 0)); 1253 return 0; 1254} 1255 1256static int lm49453_set_bias_level(struct snd_soc_component *component, 1257 enum snd_soc_bias_level level) --- 25 unchanged lines hidden (view full) --- 1283/* Formates supported by LM49453 driver. */ 1284#define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1285 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) 1286 1287static const struct snd_soc_dai_ops lm49453_headset_dai_ops = { 1288 .hw_params = lm49453_hw_params, 1289 .set_sysclk = lm49453_set_dai_sysclk, 1290 .set_fmt = lm49453_set_dai_fmt, |
1291 .digital_mute = lm49453_hp_mute, | 1291 .mute_stream = lm49453_hp_mute, 1292 .no_capture_mute = 1, |
1292}; 1293 1294static const struct snd_soc_dai_ops lm49453_speaker_dai_ops = { 1295 .hw_params = lm49453_hw_params, 1296 .set_sysclk = lm49453_set_dai_sysclk, 1297 .set_fmt = lm49453_set_dai_fmt, | 1293}; 1294 1295static const struct snd_soc_dai_ops lm49453_speaker_dai_ops = { 1296 .hw_params = lm49453_hw_params, 1297 .set_sysclk = lm49453_set_dai_sysclk, 1298 .set_fmt = lm49453_set_dai_fmt, |
1298 .digital_mute = lm49453_ls_mute, | 1299 .mute_stream = lm49453_ls_mute, 1300 .no_capture_mute = 1, |
1299}; 1300 1301static const struct snd_soc_dai_ops lm49453_haptic_dai_ops = { 1302 .hw_params = lm49453_hw_params, 1303 .set_sysclk = lm49453_set_dai_sysclk, 1304 .set_fmt = lm49453_set_dai_fmt, | 1301}; 1302 1303static const struct snd_soc_dai_ops lm49453_haptic_dai_ops = { 1304 .hw_params = lm49453_hw_params, 1305 .set_sysclk = lm49453_set_dai_sysclk, 1306 .set_fmt = lm49453_set_dai_fmt, |
1305 .digital_mute = lm49453_ha_mute, | 1307 .mute_stream = lm49453_ha_mute, 1308 .no_capture_mute = 1, |
1306}; 1307 1308static const struct snd_soc_dai_ops lm49453_ep_dai_ops = { 1309 .hw_params = lm49453_hw_params, 1310 .set_sysclk = lm49453_set_dai_sysclk, 1311 .set_fmt = lm49453_set_dai_fmt, | 1309}; 1310 1311static const struct snd_soc_dai_ops lm49453_ep_dai_ops = { 1312 .hw_params = lm49453_hw_params, 1313 .set_sysclk = lm49453_set_dai_sysclk, 1314 .set_fmt = lm49453_set_dai_fmt, |
1312 .digital_mute = lm49453_ep_mute, | 1315 .mute_stream = lm49453_ep_mute, 1316 .no_capture_mute = 1, |
1313}; 1314 1315static const struct snd_soc_dai_ops lm49453_lineout_dai_ops = { 1316 .hw_params = lm49453_hw_params, 1317 .set_sysclk = lm49453_set_dai_sysclk, 1318 .set_fmt = lm49453_set_dai_fmt, | 1317}; 1318 1319static const struct snd_soc_dai_ops lm49453_lineout_dai_ops = { 1320 .hw_params = lm49453_hw_params, 1321 .set_sysclk = lm49453_set_dai_sysclk, 1322 .set_fmt = lm49453_set_dai_fmt, |
1319 .digital_mute = lm49453_lo_mute, | 1323 .mute_stream = lm49453_lo_mute, 1324 .no_capture_mute = 1, |
1320}; 1321 1322/* LM49453 dai structure. */ 1323static struct snd_soc_dai_driver lm49453_dai[] = { 1324 { 1325 .name = "LM49453 Headset", 1326 .playback = { 1327 .stream_name = "Headset", --- 140 unchanged lines hidden --- | 1325}; 1326 1327/* LM49453 dai structure. */ 1328static struct snd_soc_dai_driver lm49453_dai[] = { 1329 { 1330 .name = "LM49453 Headset", 1331 .playback = { 1332 .stream_name = "Headset", --- 140 unchanged lines hidden --- |