.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * DA9055 ALSA Soc codec driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Tested on (Samsung SMDK6410 board + DA9055 EVB) using I2S and I2C |
---|
7 | 8 | * Written by David Chen <david.chen@diasemi.com> and |
---|
8 | 9 | * Ashish Chavan <ashish.chavan@kpitcummins.com> |
---|
9 | | - * |
---|
10 | | - * This program is free software; you can redistribute it and/or modify it |
---|
11 | | - * under the terms of the GNU General Public License as published by the |
---|
12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
13 | | - * option) any later version. |
---|
14 | 10 | */ |
---|
15 | 11 | |
---|
16 | 12 | #include <linux/delay.h> |
---|
.. | .. |
---|
465 | 461 | /* Select middle 8 bits for read back from data register */ |
---|
466 | 462 | snd_soc_component_write(component, DA9055_ALC_CIC_OP_LVL_CTRL, |
---|
467 | 463 | reg_val | DA9055_ALC_DATA_MIDDLE); |
---|
468 | | - mid_data = snd_soc_component_read32(component, DA9055_ALC_CIC_OP_LVL_DATA); |
---|
| 464 | + mid_data = snd_soc_component_read(component, DA9055_ALC_CIC_OP_LVL_DATA); |
---|
469 | 465 | |
---|
470 | 466 | /* Select top 8 bits for read back from data register */ |
---|
471 | 467 | snd_soc_component_write(component, DA9055_ALC_CIC_OP_LVL_CTRL, |
---|
472 | 468 | reg_val | DA9055_ALC_DATA_TOP); |
---|
473 | | - top_data = snd_soc_component_read32(component, DA9055_ALC_CIC_OP_LVL_DATA); |
---|
| 469 | + top_data = snd_soc_component_read(component, DA9055_ALC_CIC_OP_LVL_DATA); |
---|
474 | 470 | |
---|
475 | 471 | sum += ((mid_data << 8) | (top_data << 16)); |
---|
476 | 472 | } |
---|
.. | .. |
---|
492 | 488 | */ |
---|
493 | 489 | |
---|
494 | 490 | /* Save current values from Mic control registers */ |
---|
495 | | - mic_left = snd_soc_component_read32(component, DA9055_MIC_L_CTRL); |
---|
496 | | - mic_right = snd_soc_component_read32(component, DA9055_MIC_R_CTRL); |
---|
| 491 | + mic_left = snd_soc_component_read(component, DA9055_MIC_L_CTRL); |
---|
| 492 | + mic_right = snd_soc_component_read(component, DA9055_MIC_R_CTRL); |
---|
497 | 493 | |
---|
498 | 494 | /* Mute Mic PGA Left and Right */ |
---|
499 | 495 | snd_soc_component_update_bits(component, DA9055_MIC_L_CTRL, |
---|
.. | .. |
---|
502 | 498 | DA9055_MIC_R_MUTE_EN, DA9055_MIC_R_MUTE_EN); |
---|
503 | 499 | |
---|
504 | 500 | /* Save current values from ADC control registers */ |
---|
505 | | - adc_left = snd_soc_component_read32(component, DA9055_ADC_L_CTRL); |
---|
506 | | - adc_right = snd_soc_component_read32(component, DA9055_ADC_R_CTRL); |
---|
| 501 | + adc_left = snd_soc_component_read(component, DA9055_ADC_L_CTRL); |
---|
| 502 | + adc_right = snd_soc_component_read(component, DA9055_ADC_R_CTRL); |
---|
507 | 503 | |
---|
508 | 504 | /* Enable ADC Left and Right */ |
---|
509 | 505 | snd_soc_component_update_bits(component, DA9055_ADC_L_CTRL, |
---|
.. | .. |
---|
1180 | 1176 | } |
---|
1181 | 1177 | |
---|
1182 | 1178 | /* Don't allow change of mode if PLL is enabled */ |
---|
1183 | | - if ((snd_soc_component_read32(component, DA9055_PLL_CTRL) & DA9055_PLL_EN) && |
---|
| 1179 | + if ((snd_soc_component_read(component, DA9055_PLL_CTRL) & DA9055_PLL_EN) && |
---|
1184 | 1180 | (da9055->master != mode)) |
---|
1185 | 1181 | return -EINVAL; |
---|
1186 | 1182 | |
---|
.. | .. |
---|
1215 | 1211 | return 0; |
---|
1216 | 1212 | } |
---|
1217 | 1213 | |
---|
1218 | | -static int da9055_mute(struct snd_soc_dai *dai, int mute) |
---|
| 1214 | +static int da9055_mute(struct snd_soc_dai *dai, int mute, int direction) |
---|
1219 | 1215 | { |
---|
1220 | 1216 | struct snd_soc_component *component = dai->component; |
---|
1221 | 1217 | |
---|
.. | .. |
---|
1328 | 1324 | .set_fmt = da9055_set_dai_fmt, |
---|
1329 | 1325 | .set_sysclk = da9055_set_dai_sysclk, |
---|
1330 | 1326 | .set_pll = da9055_set_dai_pll, |
---|
1331 | | - .digital_mute = da9055_mute, |
---|
| 1327 | + .mute_stream = da9055_mute, |
---|
| 1328 | + .no_capture_mute = 1, |
---|
1332 | 1329 | }; |
---|
1333 | 1330 | |
---|
1334 | 1331 | static struct snd_soc_dai_driver da9055_dai = { |
---|