diff options
Diffstat (limited to 'sound/soc/codecs')
112 files changed, 8415 insertions, 7600 deletions
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index 5ca122e5118..9fd3b6827bb 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c | |||
@@ -861,7 +861,7 @@ static const struct snd_soc_dapm_widget pm860x_dapm_widgets[] = { | |||
861 | PM860X_DAPM_OUTPUT("RSYNC", pm860x_rsync_event), | 861 | PM860X_DAPM_OUTPUT("RSYNC", pm860x_rsync_event), |
862 | }; | 862 | }; |
863 | 863 | ||
864 | static const struct snd_soc_dapm_route audio_map[] = { | 864 | static const struct snd_soc_dapm_route pm860x_dapm_routes[] = { |
865 | /* supply */ | 865 | /* supply */ |
866 | {"Left DAC", NULL, "VCODEC"}, | 866 | {"Left DAC", NULL, "VCODEC"}, |
867 | {"Right DAC", NULL, "VCODEC"}, | 867 | {"Right DAC", NULL, "VCODEC"}, |
@@ -1198,14 +1198,14 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec, | |||
1198 | return 0; | 1198 | return 0; |
1199 | } | 1199 | } |
1200 | 1200 | ||
1201 | static struct snd_soc_dai_ops pm860x_pcm_dai_ops = { | 1201 | static const struct snd_soc_dai_ops pm860x_pcm_dai_ops = { |
1202 | .digital_mute = pm860x_digital_mute, | 1202 | .digital_mute = pm860x_digital_mute, |
1203 | .hw_params = pm860x_pcm_hw_params, | 1203 | .hw_params = pm860x_pcm_hw_params, |
1204 | .set_fmt = pm860x_pcm_set_dai_fmt, | 1204 | .set_fmt = pm860x_pcm_set_dai_fmt, |
1205 | .set_sysclk = pm860x_set_dai_sysclk, | 1205 | .set_sysclk = pm860x_set_dai_sysclk, |
1206 | }; | 1206 | }; |
1207 | 1207 | ||
1208 | static struct snd_soc_dai_ops pm860x_i2s_dai_ops = { | 1208 | static const struct snd_soc_dai_ops pm860x_i2s_dai_ops = { |
1209 | .digital_mute = pm860x_digital_mute, | 1209 | .digital_mute = pm860x_digital_mute, |
1210 | .hw_params = pm860x_i2s_hw_params, | 1210 | .hw_params = pm860x_i2s_hw_params, |
1211 | .set_fmt = pm860x_i2s_set_dai_fmt, | 1211 | .set_fmt = pm860x_i2s_set_dai_fmt, |
@@ -1361,7 +1361,6 @@ EXPORT_SYMBOL_GPL(pm860x_mic_jack_detect); | |||
1361 | static int pm860x_probe(struct snd_soc_codec *codec) | 1361 | static int pm860x_probe(struct snd_soc_codec *codec) |
1362 | { | 1362 | { |
1363 | struct pm860x_priv *pm860x = snd_soc_codec_get_drvdata(codec); | 1363 | struct pm860x_priv *pm860x = snd_soc_codec_get_drvdata(codec); |
1364 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
1365 | int i, ret; | 1364 | int i, ret; |
1366 | 1365 | ||
1367 | pm860x->codec = codec; | 1366 | pm860x->codec = codec; |
@@ -1388,11 +1387,6 @@ static int pm860x_probe(struct snd_soc_codec *codec) | |||
1388 | goto out; | 1387 | goto out; |
1389 | } | 1388 | } |
1390 | 1389 | ||
1391 | snd_soc_add_controls(codec, pm860x_snd_controls, | ||
1392 | ARRAY_SIZE(pm860x_snd_controls)); | ||
1393 | snd_soc_dapm_new_controls(dapm, pm860x_dapm_widgets, | ||
1394 | ARRAY_SIZE(pm860x_dapm_widgets)); | ||
1395 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
1396 | return 0; | 1390 | return 0; |
1397 | 1391 | ||
1398 | out: | 1392 | out: |
@@ -1420,6 +1414,13 @@ static struct snd_soc_codec_driver soc_codec_dev_pm860x = { | |||
1420 | .reg_cache_size = REG_CACHE_SIZE, | 1414 | .reg_cache_size = REG_CACHE_SIZE, |
1421 | .reg_word_size = sizeof(u8), | 1415 | .reg_word_size = sizeof(u8), |
1422 | .set_bias_level = pm860x_set_bias_level, | 1416 | .set_bias_level = pm860x_set_bias_level, |
1417 | |||
1418 | .controls = pm860x_snd_controls, | ||
1419 | .num_controls = ARRAY_SIZE(pm860x_snd_controls), | ||
1420 | .dapm_widgets = pm860x_dapm_widgets, | ||
1421 | .num_dapm_widgets = ARRAY_SIZE(pm860x_dapm_widgets), | ||
1422 | .dapm_routes = pm860x_dapm_routes, | ||
1423 | .num_dapm_routes = ARRAY_SIZE(pm860x_dapm_routes), | ||
1423 | }; | 1424 | }; |
1424 | 1425 | ||
1425 | static int __devinit pm860x_codec_probe(struct platform_device *pdev) | 1426 | static int __devinit pm860x_codec_probe(struct platform_device *pdev) |
@@ -1429,7 +1430,8 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev) | |||
1429 | struct resource *res; | 1430 | struct resource *res; |
1430 | int i, ret; | 1431 | int i, ret; |
1431 | 1432 | ||
1432 | pm860x = kzalloc(sizeof(struct pm860x_priv), GFP_KERNEL); | 1433 | pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv), |
1434 | GFP_KERNEL); | ||
1433 | if (pm860x == NULL) | 1435 | if (pm860x == NULL) |
1434 | return -ENOMEM; | 1436 | return -ENOMEM; |
1435 | 1437 | ||
@@ -1458,17 +1460,13 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev) | |||
1458 | 1460 | ||
1459 | out: | 1461 | out: |
1460 | platform_set_drvdata(pdev, NULL); | 1462 | platform_set_drvdata(pdev, NULL); |
1461 | kfree(pm860x); | ||
1462 | return -EINVAL; | 1463 | return -EINVAL; |
1463 | } | 1464 | } |
1464 | 1465 | ||
1465 | static int __devexit pm860x_codec_remove(struct platform_device *pdev) | 1466 | static int __devexit pm860x_codec_remove(struct platform_device *pdev) |
1466 | { | 1467 | { |
1467 | struct pm860x_priv *pm860x = platform_get_drvdata(pdev); | ||
1468 | |||
1469 | snd_soc_unregister_codec(&pdev->dev); | 1468 | snd_soc_unregister_codec(&pdev->dev); |
1470 | platform_set_drvdata(pdev, NULL); | 1469 | platform_set_drvdata(pdev, NULL); |
1471 | kfree(pm860x); | ||
1472 | return 0; | 1470 | return 0; |
1473 | } | 1471 | } |
1474 | 1472 | ||
@@ -1481,17 +1479,7 @@ static struct platform_driver pm860x_codec_driver = { | |||
1481 | .remove = __devexit_p(pm860x_codec_remove), | 1479 | .remove = __devexit_p(pm860x_codec_remove), |
1482 | }; | 1480 | }; |
1483 | 1481 | ||
1484 | static __init int pm860x_init(void) | 1482 | module_platform_driver(pm860x_codec_driver); |
1485 | { | ||
1486 | return platform_driver_register(&pm860x_codec_driver); | ||
1487 | } | ||
1488 | module_init(pm860x_init); | ||
1489 | |||
1490 | static __exit void pm860x_exit(void) | ||
1491 | { | ||
1492 | platform_driver_unregister(&pm860x_codec_driver); | ||
1493 | } | ||
1494 | module_exit(pm860x_exit); | ||
1495 | 1483 | ||
1496 | MODULE_DESCRIPTION("ASoC 88PM860x driver"); | 1484 | MODULE_DESCRIPTION("ASoC 88PM860x driver"); |
1497 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | 1485 | MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); |
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 4584514d93d..7c205e77d83 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -26,14 +26,16 @@ config SND_SOC_ALL_CODECS | |||
26 | select SND_SOC_AK4642 if I2C | 26 | select SND_SOC_AK4642 if I2C |
27 | select SND_SOC_AK4671 if I2C | 27 | select SND_SOC_AK4671 if I2C |
28 | select SND_SOC_ALC5623 if I2C | 28 | select SND_SOC_ALC5623 if I2C |
29 | select SND_SOC_ALC5632 if I2C | ||
29 | select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC | 30 | select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC |
30 | select SND_SOC_CS42L51 if I2C | 31 | select SND_SOC_CS42L51 if I2C |
32 | select SND_SOC_CS42L73 if I2C | ||
31 | select SND_SOC_CS4270 if I2C | 33 | select SND_SOC_CS4270 if I2C |
32 | select SND_SOC_CS4271 if SND_SOC_I2C_AND_SPI | 34 | select SND_SOC_CS4271 if SND_SOC_I2C_AND_SPI |
33 | select SND_SOC_CX20442 | 35 | select SND_SOC_CX20442 |
34 | select SND_SOC_DA7210 if I2C | 36 | select SND_SOC_DA7210 if I2C |
35 | select SND_SOC_DFBMCS320 | 37 | select SND_SOC_DFBMCS320 |
36 | select SND_SOC_JZ4740_CODEC if SOC_JZ4740 | 38 | select SND_SOC_JZ4740_CODEC |
37 | select SND_SOC_LM4857 if I2C | 39 | select SND_SOC_LM4857 if I2C |
38 | select SND_SOC_MAX98088 if I2C | 40 | select SND_SOC_MAX98088 if I2C |
39 | select SND_SOC_MAX98095 if I2C | 41 | select SND_SOC_MAX98095 if I2C |
@@ -139,7 +141,7 @@ config SND_SOC_AD73311 | |||
139 | tristate | 141 | tristate |
140 | 142 | ||
141 | config SND_SOC_ADAU1701 | 143 | config SND_SOC_ADAU1701 |
142 | select SIGMA | 144 | select SND_SOC_SIGMADSP |
143 | tristate | 145 | tristate |
144 | 146 | ||
145 | config SND_SOC_ADAU1373 | 147 | config SND_SOC_ADAU1373 |
@@ -168,6 +170,8 @@ config SND_SOC_AK4671 | |||
168 | 170 | ||
169 | config SND_SOC_ALC5623 | 171 | config SND_SOC_ALC5623 |
170 | tristate | 172 | tristate |
173 | config SND_SOC_ALC5632 | ||
174 | tristate | ||
171 | 175 | ||
172 | config SND_SOC_CQ0093VC | 176 | config SND_SOC_CQ0093VC |
173 | tristate | 177 | tristate |
@@ -175,6 +179,9 @@ config SND_SOC_CQ0093VC | |||
175 | config SND_SOC_CS42L51 | 179 | config SND_SOC_CS42L51 |
176 | tristate | 180 | tristate |
177 | 181 | ||
182 | config SND_SOC_CS42L73 | ||
183 | tristate | ||
184 | |||
178 | # Cirrus Logic CS4270 Codec | 185 | # Cirrus Logic CS4270 Codec |
179 | config SND_SOC_CS4270 | 186 | config SND_SOC_CS4270 |
180 | tristate | 187 | tristate |
@@ -227,6 +234,10 @@ config SND_SOC_RT5631 | |||
227 | config SND_SOC_SGTL5000 | 234 | config SND_SOC_SGTL5000 |
228 | tristate | 235 | tristate |
229 | 236 | ||
237 | config SND_SOC_SIGMADSP | ||
238 | tristate | ||
239 | select CRC32 | ||
240 | |||
230 | config SND_SOC_SN95031 | 241 | config SND_SOC_SN95031 |
231 | tristate | 242 | tristate |
232 | 243 | ||
@@ -278,6 +289,9 @@ config SND_SOC_WL1273 | |||
278 | config SND_SOC_WM1250_EV1 | 289 | config SND_SOC_WM1250_EV1 |
279 | tristate | 290 | tristate |
280 | 291 | ||
292 | config SND_SOC_WM2000 | ||
293 | tristate | ||
294 | |||
281 | config SND_SOC_WM5100 | 295 | config SND_SOC_WM5100 |
282 | tristate | 296 | tristate |
283 | 297 | ||
@@ -395,6 +409,9 @@ config SND_SOC_WM8996 | |||
395 | config SND_SOC_WM9081 | 409 | config SND_SOC_WM9081 |
396 | tristate | 410 | tristate |
397 | 411 | ||
412 | config SND_SOC_WM9090 | ||
413 | tristate | ||
414 | |||
398 | config SND_SOC_WM9705 | 415 | config SND_SOC_WM9705 |
399 | tristate | 416 | tristate |
400 | 417 | ||
@@ -413,9 +430,3 @@ config SND_SOC_MAX9877 | |||
413 | 430 | ||
414 | config SND_SOC_TPA6130A2 | 431 | config SND_SOC_TPA6130A2 |
415 | tristate | 432 | tristate |
416 | |||
417 | config SND_SOC_WM2000 | ||
418 | tristate | ||
419 | |||
420 | config SND_SOC_WM9090 | ||
421 | tristate | ||
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index a2c7842e357..de8078178f8 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile | |||
@@ -15,13 +15,16 @@ snd-soc-ak4642-objs := ak4642.o | |||
15 | snd-soc-ak4671-objs := ak4671.o | 15 | snd-soc-ak4671-objs := ak4671.o |
16 | snd-soc-cq93vc-objs := cq93vc.o | 16 | snd-soc-cq93vc-objs := cq93vc.o |
17 | snd-soc-cs42l51-objs := cs42l51.o | 17 | snd-soc-cs42l51-objs := cs42l51.o |
18 | snd-soc-cs42l73-objs := cs42l73.o | ||
18 | snd-soc-cs4270-objs := cs4270.o | 19 | snd-soc-cs4270-objs := cs4270.o |
19 | snd-soc-cs4271-objs := cs4271.o | 20 | snd-soc-cs4271-objs := cs4271.o |
20 | snd-soc-cx20442-objs := cx20442.o | 21 | snd-soc-cx20442-objs := cx20442.o |
21 | snd-soc-da7210-objs := da7210.o | 22 | snd-soc-da7210-objs := da7210.o |
22 | snd-soc-dfbmcs320-objs := dfbmcs320.o | 23 | snd-soc-dfbmcs320-objs := dfbmcs320.o |
23 | snd-soc-dmic-objs := dmic.o | 24 | snd-soc-dmic-objs := dmic.o |
25 | snd-soc-jz4740-codec-objs := jz4740.o | ||
24 | snd-soc-l3-objs := l3.o | 26 | snd-soc-l3-objs := l3.o |
27 | snd-soc-lm4857-objs := lm4857.o | ||
25 | snd-soc-max98088-objs := max98088.o | 28 | snd-soc-max98088-objs := max98088.o |
26 | snd-soc-max98095-objs := max98095.o | 29 | snd-soc-max98095-objs := max98095.o |
27 | snd-soc-max9850-objs := max9850.o | 30 | snd-soc-max9850-objs := max9850.o |
@@ -29,6 +32,8 @@ snd-soc-pcm3008-objs := pcm3008.o | |||
29 | snd-soc-rt5631-objs := rt5631.o | 32 | snd-soc-rt5631-objs := rt5631.o |
30 | snd-soc-sgtl5000-objs := sgtl5000.o | 33 | snd-soc-sgtl5000-objs := sgtl5000.o |
31 | snd-soc-alc5623-objs := alc5623.o | 34 | snd-soc-alc5623-objs := alc5623.o |
35 | snd-soc-alc5632-objs := alc5632.o | ||
36 | snd-soc-sigmadsp-objs := sigmadsp.o | ||
32 | snd-soc-sn95031-objs := sn95031.o | 37 | snd-soc-sn95031-objs := sn95031.o |
33 | snd-soc-spdif-objs := spdif_transciever.o | 38 | snd-soc-spdif-objs := spdif_transciever.o |
34 | snd-soc-ssm2602-objs := ssm2602.o | 39 | snd-soc-ssm2602-objs := ssm2602.o |
@@ -45,6 +50,7 @@ snd-soc-uda134x-objs := uda134x.o | |||
45 | snd-soc-uda1380-objs := uda1380.o | 50 | snd-soc-uda1380-objs := uda1380.o |
46 | snd-soc-wl1273-objs := wl1273.o | 51 | snd-soc-wl1273-objs := wl1273.o |
47 | snd-soc-wm1250-ev1-objs := wm1250-ev1.o | 52 | snd-soc-wm1250-ev1-objs := wm1250-ev1.o |
53 | snd-soc-wm2000-objs := wm2000.o | ||
48 | snd-soc-wm5100-objs := wm5100.o wm5100-tables.o | 54 | snd-soc-wm5100-objs := wm5100.o wm5100-tables.o |
49 | snd-soc-wm8350-objs := wm8350.o | 55 | snd-soc-wm8350-objs := wm8350.o |
50 | snd-soc-wm8400-objs := wm8400.o | 56 | snd-soc-wm8400-objs := wm8400.o |
@@ -81,21 +87,18 @@ snd-soc-wm8988-objs := wm8988.o | |||
81 | snd-soc-wm8990-objs := wm8990.o | 87 | snd-soc-wm8990-objs := wm8990.o |
82 | snd-soc-wm8991-objs := wm8991.o | 88 | snd-soc-wm8991-objs := wm8991.o |
83 | snd-soc-wm8993-objs := wm8993.o | 89 | snd-soc-wm8993-objs := wm8993.o |
84 | snd-soc-wm8994-objs := wm8994.o wm8994-tables.o wm8958-dsp2.o | 90 | snd-soc-wm8994-objs := wm8994.o wm8958-dsp2.o |
85 | snd-soc-wm8995-objs := wm8995.o | 91 | snd-soc-wm8995-objs := wm8995.o |
86 | snd-soc-wm9081-objs := wm9081.o | 92 | snd-soc-wm9081-objs := wm9081.o |
93 | snd-soc-wm9090-objs := wm9090.o | ||
87 | snd-soc-wm9705-objs := wm9705.o | 94 | snd-soc-wm9705-objs := wm9705.o |
88 | snd-soc-wm9712-objs := wm9712.o | 95 | snd-soc-wm9712-objs := wm9712.o |
89 | snd-soc-wm9713-objs := wm9713.o | 96 | snd-soc-wm9713-objs := wm9713.o |
90 | snd-soc-wm-hubs-objs := wm_hubs.o | 97 | snd-soc-wm-hubs-objs := wm_hubs.o |
91 | snd-soc-jz4740-codec-objs := jz4740.o | ||
92 | 98 | ||
93 | # Amp | 99 | # Amp |
94 | snd-soc-lm4857-objs := lm4857.o | ||
95 | snd-soc-max9877-objs := max9877.o | 100 | snd-soc-max9877-objs := max9877.o |
96 | snd-soc-tpa6130a2-objs := tpa6130a2.o | 101 | snd-soc-tpa6130a2-objs := tpa6130a2.o |
97 | snd-soc-wm2000-objs := wm2000.o | ||
98 | snd-soc-wm9090-objs := wm9090.o | ||
99 | 102 | ||
100 | obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o | 103 | obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o |
101 | obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o | 104 | obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o |
@@ -113,8 +116,10 @@ obj-$(CONFIG_SND_SOC_AK4641) += snd-soc-ak4641.o | |||
113 | obj-$(CONFIG_SND_SOC_AK4642) += snd-soc-ak4642.o | 116 | obj-$(CONFIG_SND_SOC_AK4642) += snd-soc-ak4642.o |
114 | obj-$(CONFIG_SND_SOC_AK4671) += snd-soc-ak4671.o | 117 | obj-$(CONFIG_SND_SOC_AK4671) += snd-soc-ak4671.o |
115 | obj-$(CONFIG_SND_SOC_ALC5623) += snd-soc-alc5623.o | 118 | obj-$(CONFIG_SND_SOC_ALC5623) += snd-soc-alc5623.o |
119 | obj-$(CONFIG_SND_SOC_ALC5632) += snd-soc-alc5632.o | ||
116 | obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o | 120 | obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o |
117 | obj-$(CONFIG_SND_SOC_CS42L51) += snd-soc-cs42l51.o | 121 | obj-$(CONFIG_SND_SOC_CS42L51) += snd-soc-cs42l51.o |
122 | obj-$(CONFIG_SND_SOC_CS42L73) += snd-soc-cs42l73.o | ||
118 | obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o | 123 | obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o |
119 | obj-$(CONFIG_SND_SOC_CS4271) += snd-soc-cs4271.o | 124 | obj-$(CONFIG_SND_SOC_CS4271) += snd-soc-cs4271.o |
120 | obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o | 125 | obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o |
@@ -122,6 +127,7 @@ obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o | |||
122 | obj-$(CONFIG_SND_SOC_DFBMCS320) += snd-soc-dfbmcs320.o | 127 | obj-$(CONFIG_SND_SOC_DFBMCS320) += snd-soc-dfbmcs320.o |
123 | obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o | 128 | obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o |
124 | obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o | 129 | obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o |
130 | obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o | ||
125 | obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o | 131 | obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o |
126 | obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o | 132 | obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o |
127 | obj-$(CONFIG_SND_SOC_MAX98095) += snd-soc-max98095.o | 133 | obj-$(CONFIG_SND_SOC_MAX98095) += snd-soc-max98095.o |
@@ -129,6 +135,7 @@ obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o | |||
129 | obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o | 135 | obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o |
130 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o | 136 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o |
131 | obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o | 137 | obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o |
138 | obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o | ||
132 | obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o | 139 | obj-$(CONFIG_SND_SOC_SN95031) +=snd-soc-sn95031.o |
133 | obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif.o | 140 | obj-$(CONFIG_SND_SOC_SPDIF) += snd-soc-spdif.o |
134 | obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o | 141 | obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o |
@@ -145,6 +152,7 @@ obj-$(CONFIG_SND_SOC_UDA134X) += snd-soc-uda134x.o | |||
145 | obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o | 152 | obj-$(CONFIG_SND_SOC_UDA1380) += snd-soc-uda1380.o |
146 | obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o | 153 | obj-$(CONFIG_SND_SOC_WL1273) += snd-soc-wl1273.o |
147 | obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o | 154 | obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o |
155 | obj-$(CONFIG_SND_SOC_WM2000) += snd-soc-wm2000.o | ||
148 | obj-$(CONFIG_SND_SOC_WM5100) += snd-soc-wm5100.o | 156 | obj-$(CONFIG_SND_SOC_WM5100) += snd-soc-wm5100.o |
149 | obj-$(CONFIG_SND_SOC_WM8350) += snd-soc-wm8350.o | 157 | obj-$(CONFIG_SND_SOC_WM8350) += snd-soc-wm8350.o |
150 | obj-$(CONFIG_SND_SOC_WM8400) += snd-soc-wm8400.o | 158 | obj-$(CONFIG_SND_SOC_WM8400) += snd-soc-wm8400.o |
@@ -184,14 +192,12 @@ obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o | |||
184 | obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o | 192 | obj-$(CONFIG_SND_SOC_WM8994) += snd-soc-wm8994.o |
185 | obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o | 193 | obj-$(CONFIG_SND_SOC_WM8995) += snd-soc-wm8995.o |
186 | obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o | 194 | obj-$(CONFIG_SND_SOC_WM9081) += snd-soc-wm9081.o |
195 | obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o | ||
187 | obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o | 196 | obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o |
188 | obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o | 197 | obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o |
189 | obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o | 198 | obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o |
190 | obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o | 199 | obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o |
191 | 200 | ||
192 | # Amp | 201 | # Amp |
193 | obj-$(CONFIG_SND_SOC_LM4857) += snd-soc-lm4857.o | ||
194 | obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o | 202 | obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o |
195 | obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o | 203 | obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o |
196 | obj-$(CONFIG_SND_SOC_WM2000) += snd-soc-wm2000.o | ||
197 | obj-$(CONFIG_SND_SOC_WM9090) += snd-soc-wm9090.o | ||
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index e715186b430..1bbad4c16d2 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c | |||
@@ -39,7 +39,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, | |||
39 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ | 39 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ |
40 | SNDRV_PCM_RATE_48000) | 40 | SNDRV_PCM_RATE_48000) |
41 | 41 | ||
42 | static struct snd_soc_dai_ops ac97_dai_ops = { | 42 | static const struct snd_soc_dai_ops ac97_dai_ops = { |
43 | .prepare = ac97_prepare, | 43 | .prepare = ac97_prepare, |
44 | }; | 44 | }; |
45 | 45 | ||
@@ -99,7 +99,7 @@ static int ac97_soc_remove(struct snd_soc_codec *codec) | |||
99 | } | 99 | } |
100 | 100 | ||
101 | #ifdef CONFIG_PM | 101 | #ifdef CONFIG_PM |
102 | static int ac97_soc_suspend(struct snd_soc_codec *codec, pm_message_t msg) | 102 | static int ac97_soc_suspend(struct snd_soc_codec *codec) |
103 | { | 103 | { |
104 | snd_ac97_suspend(codec->ac97); | 104 | snd_ac97_suspend(codec->ac97); |
105 | 105 | ||
@@ -148,17 +148,7 @@ static struct platform_driver ac97_codec_driver = { | |||
148 | .remove = __devexit_p(ac97_remove), | 148 | .remove = __devexit_p(ac97_remove), |
149 | }; | 149 | }; |
150 | 150 | ||
151 | static int __init ac97_init(void) | 151 | module_platform_driver(ac97_codec_driver); |
152 | { | ||
153 | return platform_driver_register(&ac97_codec_driver); | ||
154 | } | ||
155 | module_init(ac97_init); | ||
156 | |||
157 | static void __exit ac97_exit(void) | ||
158 | { | ||
159 | platform_driver_unregister(&ac97_codec_driver); | ||
160 | } | ||
161 | module_exit(ac97_exit); | ||
162 | 152 | ||
163 | MODULE_DESCRIPTION("Soc Generic AC97 driver"); | 153 | MODULE_DESCRIPTION("Soc Generic AC97 driver"); |
164 | MODULE_AUTHOR("Liam Girdwood"); | 154 | MODULE_AUTHOR("Liam Girdwood"); |
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 4e5c5726366..982d201c2e8 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c | |||
@@ -189,7 +189,7 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream, | |||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | 191 | ||
192 | static struct snd_soc_dai_ops ad1836_dai_ops = { | 192 | static const struct snd_soc_dai_ops ad1836_dai_ops = { |
193 | .hw_params = ad1836_hw_params, | 193 | .hw_params = ad1836_hw_params, |
194 | .set_fmt = ad1836_set_dai_fmt, | 194 | .set_fmt = ad1836_set_dai_fmt, |
195 | }; | 195 | }; |
@@ -223,7 +223,7 @@ static struct snd_soc_dai_driver ad183x_dais[] = { | |||
223 | }; | 223 | }; |
224 | 224 | ||
225 | #ifdef CONFIG_PM | 225 | #ifdef CONFIG_PM |
226 | static int ad1836_suspend(struct snd_soc_codec *codec, pm_message_t state) | 226 | static int ad1836_suspend(struct snd_soc_codec *codec) |
227 | { | 227 | { |
228 | /* reset clock control mode */ | 228 | /* reset clock control mode */ |
229 | return snd_soc_update_bits(codec, AD1836_ADC_CTRL2, | 229 | return snd_soc_update_bits(codec, AD1836_ADC_CTRL2, |
@@ -341,7 +341,8 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi) | |||
341 | struct ad1836_priv *ad1836; | 341 | struct ad1836_priv *ad1836; |
342 | int ret; | 342 | int ret; |
343 | 343 | ||
344 | ad1836 = kzalloc(sizeof(struct ad1836_priv), GFP_KERNEL); | 344 | ad1836 = devm_kzalloc(&spi->dev, sizeof(struct ad1836_priv), |
345 | GFP_KERNEL); | ||
345 | if (ad1836 == NULL) | 346 | if (ad1836 == NULL) |
346 | return -ENOMEM; | 347 | return -ENOMEM; |
347 | 348 | ||
@@ -351,17 +352,15 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi) | |||
351 | 352 | ||
352 | ret = snd_soc_register_codec(&spi->dev, | 353 | ret = snd_soc_register_codec(&spi->dev, |
353 | &soc_codec_dev_ad1836, &ad183x_dais[ad1836->type], 1); | 354 | &soc_codec_dev_ad1836, &ad183x_dais[ad1836->type], 1); |
354 | if (ret < 0) | ||
355 | kfree(ad1836); | ||
356 | return ret; | 355 | return ret; |
357 | } | 356 | } |
358 | 357 | ||
359 | static int __devexit ad1836_spi_remove(struct spi_device *spi) | 358 | static int __devexit ad1836_spi_remove(struct spi_device *spi) |
360 | { | 359 | { |
361 | snd_soc_unregister_codec(&spi->dev); | 360 | snd_soc_unregister_codec(&spi->dev); |
362 | kfree(spi_get_drvdata(spi)); | ||
363 | return 0; | 361 | return 0; |
364 | } | 362 | } |
363 | |||
365 | static const struct spi_device_id ad1836_ids[] = { | 364 | static const struct spi_device_id ad1836_ids[] = { |
366 | { "ad1835", AD1835 }, | 365 | { "ad1835", AD1835 }, |
367 | { "ad1836", AD1836 }, | 366 | { "ad1836", AD1836 }, |
diff --git a/sound/soc/codecs/ad1836.h b/sound/soc/codecs/ad1836.h index 444747f0db2..dd7be0dbbc5 100644 --- a/sound/soc/codecs/ad1836.h +++ b/sound/soc/codecs/ad1836.h | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define AD1836_ADC_CTRL2 13 | 35 | #define AD1836_ADC_CTRL2 13 |
36 | #define AD1836_ADC_WORD_LEN_MASK 0x30 | 36 | #define AD1836_ADC_WORD_LEN_MASK 0x30 |
37 | #define AD1836_ADC_WORD_OFFSET 5 | 37 | #define AD1836_ADC_WORD_OFFSET 4 |
38 | #define AD1836_ADC_SERFMT_MASK (7 << 6) | 38 | #define AD1836_ADC_SERFMT_MASK (7 << 6) |
39 | #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) | 39 | #define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) |
40 | #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) | 40 | #define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) |
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 120602130b5..a4a6bef2c0b 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c | |||
@@ -30,21 +30,23 @@ struct ad193x_priv { | |||
30 | /* | 30 | /* |
31 | * AD193X volume/mute/de-emphasis etc. controls | 31 | * AD193X volume/mute/de-emphasis etc. controls |
32 | */ | 32 | */ |
33 | static const char *ad193x_deemp[] = {"None", "48kHz", "44.1kHz", "32kHz"}; | 33 | static const char * const ad193x_deemp[] = {"None", "48kHz", "44.1kHz", "32kHz"}; |
34 | 34 | ||
35 | static const struct soc_enum ad193x_deemp_enum = | 35 | static const struct soc_enum ad193x_deemp_enum = |
36 | SOC_ENUM_SINGLE(AD193X_DAC_CTRL2, 1, 4, ad193x_deemp); | 36 | SOC_ENUM_SINGLE(AD193X_DAC_CTRL2, 1, 4, ad193x_deemp); |
37 | 37 | ||
38 | static const DECLARE_TLV_DB_MINMAX(adau193x_tlv, -9563, 0); | ||
39 | |||
38 | static const struct snd_kcontrol_new ad193x_snd_controls[] = { | 40 | static const struct snd_kcontrol_new ad193x_snd_controls[] = { |
39 | /* DAC volume control */ | 41 | /* DAC volume control */ |
40 | SOC_DOUBLE_R("DAC1 Volume", AD193X_DAC_L1_VOL, | 42 | SOC_DOUBLE_R_TLV("DAC1 Volume", AD193X_DAC_L1_VOL, |
41 | AD193X_DAC_R1_VOL, 0, 0xFF, 1), | 43 | AD193X_DAC_R1_VOL, 0, 0xFF, 1, adau193x_tlv), |
42 | SOC_DOUBLE_R("DAC2 Volume", AD193X_DAC_L2_VOL, | 44 | SOC_DOUBLE_R_TLV("DAC2 Volume", AD193X_DAC_L2_VOL, |
43 | AD193X_DAC_R2_VOL, 0, 0xFF, 1), | 45 | AD193X_DAC_R2_VOL, 0, 0xFF, 1, adau193x_tlv), |
44 | SOC_DOUBLE_R("DAC3 Volume", AD193X_DAC_L3_VOL, | 46 | SOC_DOUBLE_R_TLV("DAC3 Volume", AD193X_DAC_L3_VOL, |
45 | AD193X_DAC_R3_VOL, 0, 0xFF, 1), | 47 | AD193X_DAC_R3_VOL, 0, 0xFF, 1, adau193x_tlv), |
46 | SOC_DOUBLE_R("DAC4 Volume", AD193X_DAC_L4_VOL, | 48 | SOC_DOUBLE_R_TLV("DAC4 Volume", AD193X_DAC_L4_VOL, |
47 | AD193X_DAC_R4_VOL, 0, 0xFF, 1), | 49 | AD193X_DAC_R4_VOL, 0, 0xFF, 1, adau193x_tlv), |
48 | 50 | ||
49 | /* ADC switch control */ | 51 | /* ADC switch control */ |
50 | SOC_DOUBLE("ADC1 Switch", AD193X_ADC_CTRL0, AD193X_ADCL1_MUTE, | 52 | SOC_DOUBLE("ADC1 Switch", AD193X_ADC_CTRL0, AD193X_ADCL1_MUTE, |
@@ -75,6 +77,7 @@ static const struct snd_soc_dapm_widget ad193x_dapm_widgets[] = { | |||
75 | SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0), | 77 | SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0), |
76 | SND_SOC_DAPM_SUPPLY("PLL_PWR", AD193X_PLL_CLK_CTRL0, 0, 1, NULL, 0), | 78 | SND_SOC_DAPM_SUPPLY("PLL_PWR", AD193X_PLL_CLK_CTRL0, 0, 1, NULL, 0), |
77 | SND_SOC_DAPM_SUPPLY("ADC_PWR", AD193X_ADC_CTRL0, 0, 1, NULL, 0), | 79 | SND_SOC_DAPM_SUPPLY("ADC_PWR", AD193X_ADC_CTRL0, 0, 1, NULL, 0), |
80 | SND_SOC_DAPM_SUPPLY("SYSCLK", AD193X_PLL_CLK_CTRL0, 7, 0, NULL, 0), | ||
78 | SND_SOC_DAPM_OUTPUT("DAC1OUT"), | 81 | SND_SOC_DAPM_OUTPUT("DAC1OUT"), |
79 | SND_SOC_DAPM_OUTPUT("DAC2OUT"), | 82 | SND_SOC_DAPM_OUTPUT("DAC2OUT"), |
80 | SND_SOC_DAPM_OUTPUT("DAC3OUT"), | 83 | SND_SOC_DAPM_OUTPUT("DAC3OUT"), |
@@ -84,16 +87,17 @@ static const struct snd_soc_dapm_widget ad193x_dapm_widgets[] = { | |||
84 | }; | 87 | }; |
85 | 88 | ||
86 | static const struct snd_soc_dapm_route audio_paths[] = { | 89 | static const struct snd_soc_dapm_route audio_paths[] = { |
87 | { "DAC", NULL, "PLL_PWR" }, | 90 | { "DAC", NULL, "SYSCLK" }, |
88 | { "ADC", NULL, "PLL_PWR" }, | 91 | { "ADC", NULL, "SYSCLK" }, |
89 | { "DAC", NULL, "ADC_PWR" }, | 92 | { "DAC", NULL, "ADC_PWR" }, |
90 | { "ADC", NULL, "ADC_PWR" }, | 93 | { "ADC", NULL, "ADC_PWR" }, |
91 | { "DAC1OUT", "DAC1 Switch", "DAC" }, | 94 | { "DAC1OUT", NULL, "DAC" }, |
92 | { "DAC2OUT", "DAC2 Switch", "DAC" }, | 95 | { "DAC2OUT", NULL, "DAC" }, |
93 | { "DAC3OUT", "DAC3 Switch", "DAC" }, | 96 | { "DAC3OUT", NULL, "DAC" }, |
94 | { "DAC4OUT", "DAC4 Switch", "DAC" }, | 97 | { "DAC4OUT", NULL, "DAC" }, |
95 | { "ADC", "ADC1 Switch", "ADC1IN" }, | 98 | { "ADC", NULL, "ADC1IN" }, |
96 | { "ADC", "ADC2 Switch", "ADC2IN" }, | 99 | { "ADC", NULL, "ADC2IN" }, |
100 | { "SYSCLK", NULL, "PLL_PWR" }, | ||
97 | }; | 101 | }; |
98 | 102 | ||
99 | /* | 103 | /* |
@@ -102,14 +106,14 @@ static const struct snd_soc_dapm_route audio_paths[] = { | |||
102 | 106 | ||
103 | static int ad193x_mute(struct snd_soc_dai *dai, int mute) | 107 | static int ad193x_mute(struct snd_soc_dai *dai, int mute) |
104 | { | 108 | { |
105 | struct snd_soc_codec *codec = dai->codec; | 109 | struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(dai->codec); |
106 | 110 | ||
107 | if (mute) | 111 | if (mute) |
108 | snd_soc_update_bits(codec, AD193X_DAC_CTRL2, | 112 | regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, |
109 | AD193X_DAC_MASTER_MUTE, | 113 | AD193X_DAC_MASTER_MUTE, |
110 | AD193X_DAC_MASTER_MUTE); | 114 | AD193X_DAC_MASTER_MUTE); |
111 | else | 115 | else |
112 | snd_soc_update_bits(codec, AD193X_DAC_CTRL2, | 116 | regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, |
113 | AD193X_DAC_MASTER_MUTE, 0); | 117 | AD193X_DAC_MASTER_MUTE, 0); |
114 | 118 | ||
115 | return 0; | 119 | return 0; |
@@ -118,36 +122,30 @@ static int ad193x_mute(struct snd_soc_dai *dai, int mute) | |||
118 | static int ad193x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, | 122 | static int ad193x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, |
119 | unsigned int rx_mask, int slots, int width) | 123 | unsigned int rx_mask, int slots, int width) |
120 | { | 124 | { |
121 | struct snd_soc_codec *codec = dai->codec; | 125 | struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(dai->codec); |
122 | int dac_reg = snd_soc_read(codec, AD193X_DAC_CTRL1); | 126 | unsigned int channels; |
123 | int adc_reg = snd_soc_read(codec, AD193X_ADC_CTRL2); | ||
124 | |||
125 | dac_reg &= ~AD193X_DAC_CHAN_MASK; | ||
126 | adc_reg &= ~AD193X_ADC_CHAN_MASK; | ||
127 | 127 | ||
128 | switch (slots) { | 128 | switch (slots) { |
129 | case 2: | 129 | case 2: |
130 | dac_reg |= AD193X_DAC_2_CHANNELS << AD193X_DAC_CHAN_SHFT; | 130 | channels = AD193X_2_CHANNELS; |
131 | adc_reg |= AD193X_ADC_2_CHANNELS << AD193X_ADC_CHAN_SHFT; | ||
132 | break; | 131 | break; |
133 | case 4: | 132 | case 4: |
134 | dac_reg |= AD193X_DAC_4_CHANNELS << AD193X_DAC_CHAN_SHFT; | 133 | channels = AD193X_4_CHANNELS; |
135 | adc_reg |= AD193X_ADC_4_CHANNELS << AD193X_ADC_CHAN_SHFT; | ||
136 | break; | 134 | break; |
137 | case 8: | 135 | case 8: |
138 | dac_reg |= AD193X_DAC_8_CHANNELS << AD193X_DAC_CHAN_SHFT; | 136 | channels = AD193X_8_CHANNELS; |
139 | adc_reg |= AD193X_ADC_8_CHANNELS << AD193X_ADC_CHAN_SHFT; | ||
140 | break; | 137 | break; |
141 | case 16: | 138 | case 16: |
142 | dac_reg |= AD193X_DAC_16_CHANNELS << AD193X_DAC_CHAN_SHFT; | 139 | channels = AD193X_16_CHANNELS; |
143 | adc_reg |= AD193X_ADC_16_CHANNELS << AD193X_ADC_CHAN_SHFT; | ||
144 | break; | 140 | break; |
145 | default: | 141 | default: |
146 | return -EINVAL; | 142 | return -EINVAL; |
147 | } | 143 | } |
148 | 144 | ||
149 | snd_soc_write(codec, AD193X_DAC_CTRL1, dac_reg); | 145 | regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1, |
150 | snd_soc_write(codec, AD193X_ADC_CTRL2, adc_reg); | 146 | AD193X_DAC_CHAN_MASK, channels << AD193X_DAC_CHAN_SHFT); |
147 | regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2, | ||
148 | AD193X_ADC_CHAN_MASK, channels << AD193X_ADC_CHAN_SHFT); | ||
151 | 149 | ||
152 | return 0; | 150 | return 0; |
153 | } | 151 | } |
@@ -155,24 +153,20 @@ static int ad193x_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, | |||
155 | static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, | 153 | static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, |
156 | unsigned int fmt) | 154 | unsigned int fmt) |
157 | { | 155 | { |
158 | struct snd_soc_codec *codec = codec_dai->codec; | 156 | struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec_dai->codec); |
159 | int adc_reg1, adc_reg2, dac_reg; | 157 | unsigned int adc_serfmt = 0; |
160 | 158 | unsigned int adc_fmt = 0; | |
161 | adc_reg1 = snd_soc_read(codec, AD193X_ADC_CTRL1); | 159 | unsigned int dac_fmt = 0; |
162 | adc_reg2 = snd_soc_read(codec, AD193X_ADC_CTRL2); | ||
163 | dac_reg = snd_soc_read(codec, AD193X_DAC_CTRL1); | ||
164 | 160 | ||
165 | /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S | 161 | /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S |
166 | * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) | 162 | * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) |
167 | */ | 163 | */ |
168 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | 164 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { |
169 | case SND_SOC_DAIFMT_I2S: | 165 | case SND_SOC_DAIFMT_I2S: |
170 | adc_reg1 &= ~AD193X_ADC_SERFMT_MASK; | 166 | adc_serfmt |= AD193X_ADC_SERFMT_TDM; |
171 | adc_reg1 |= AD193X_ADC_SERFMT_TDM; | ||
172 | break; | 167 | break; |
173 | case SND_SOC_DAIFMT_DSP_A: | 168 | case SND_SOC_DAIFMT_DSP_A: |
174 | adc_reg1 &= ~AD193X_ADC_SERFMT_MASK; | 169 | adc_serfmt |= AD193X_ADC_SERFMT_AUX; |
175 | adc_reg1 |= AD193X_ADC_SERFMT_AUX; | ||
176 | break; | 170 | break; |
177 | default: | 171 | default: |
178 | return -EINVAL; | 172 | return -EINVAL; |
@@ -180,29 +174,20 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
180 | 174 | ||
181 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { | 175 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { |
182 | case SND_SOC_DAIFMT_NB_NF: /* normal bit clock + frame */ | 176 | case SND_SOC_DAIFMT_NB_NF: /* normal bit clock + frame */ |
183 | adc_reg2 &= ~AD193X_ADC_LEFT_HIGH; | ||
184 | adc_reg2 &= ~AD193X_ADC_BCLK_INV; | ||
185 | dac_reg &= ~AD193X_DAC_LEFT_HIGH; | ||
186 | dac_reg &= ~AD193X_DAC_BCLK_INV; | ||
187 | break; | 177 | break; |
188 | case SND_SOC_DAIFMT_NB_IF: /* normal bclk + invert frm */ | 178 | case SND_SOC_DAIFMT_NB_IF: /* normal bclk + invert frm */ |
189 | adc_reg2 |= AD193X_ADC_LEFT_HIGH; | 179 | adc_fmt |= AD193X_ADC_LEFT_HIGH; |
190 | adc_reg2 &= ~AD193X_ADC_BCLK_INV; | 180 | dac_fmt |= AD193X_DAC_LEFT_HIGH; |
191 | dac_reg |= AD193X_DAC_LEFT_HIGH; | ||
192 | dac_reg &= ~AD193X_DAC_BCLK_INV; | ||
193 | break; | 181 | break; |
194 | case SND_SOC_DAIFMT_IB_NF: /* invert bclk + normal frm */ | 182 | case SND_SOC_DAIFMT_IB_NF: /* invert bclk + normal frm */ |
195 | adc_reg2 &= ~AD193X_ADC_LEFT_HIGH; | 183 | adc_fmt |= AD193X_ADC_BCLK_INV; |
196 | adc_reg2 |= AD193X_ADC_BCLK_INV; | 184 | dac_fmt |= AD193X_DAC_BCLK_INV; |
197 | dac_reg &= ~AD193X_DAC_LEFT_HIGH; | ||
198 | dac_reg |= AD193X_DAC_BCLK_INV; | ||
199 | break; | 185 | break; |
200 | |||
201 | case SND_SOC_DAIFMT_IB_IF: /* invert bclk + frm */ | 186 | case SND_SOC_DAIFMT_IB_IF: /* invert bclk + frm */ |
202 | adc_reg2 |= AD193X_ADC_LEFT_HIGH; | 187 | adc_fmt |= AD193X_ADC_LEFT_HIGH; |
203 | adc_reg2 |= AD193X_ADC_BCLK_INV; | 188 | adc_fmt |= AD193X_ADC_BCLK_INV; |
204 | dac_reg |= AD193X_DAC_LEFT_HIGH; | 189 | dac_fmt |= AD193X_DAC_LEFT_HIGH; |
205 | dac_reg |= AD193X_DAC_BCLK_INV; | 190 | dac_fmt |= AD193X_DAC_BCLK_INV; |
206 | break; | 191 | break; |
207 | default: | 192 | default: |
208 | return -EINVAL; | 193 | return -EINVAL; |
@@ -210,36 +195,31 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
210 | 195 | ||
211 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 196 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
212 | case SND_SOC_DAIFMT_CBM_CFM: /* codec clk & frm master */ | 197 | case SND_SOC_DAIFMT_CBM_CFM: /* codec clk & frm master */ |
213 | adc_reg2 |= AD193X_ADC_LCR_MASTER; | 198 | adc_fmt |= AD193X_ADC_LCR_MASTER; |
214 | adc_reg2 |= AD193X_ADC_BCLK_MASTER; | 199 | adc_fmt |= AD193X_ADC_BCLK_MASTER; |
215 | dac_reg |= AD193X_DAC_LCR_MASTER; | 200 | dac_fmt |= AD193X_DAC_LCR_MASTER; |
216 | dac_reg |= AD193X_DAC_BCLK_MASTER; | 201 | dac_fmt |= AD193X_DAC_BCLK_MASTER; |
217 | break; | 202 | break; |
218 | case SND_SOC_DAIFMT_CBS_CFM: /* codec clk slave & frm master */ | 203 | case SND_SOC_DAIFMT_CBS_CFM: /* codec clk slave & frm master */ |
219 | adc_reg2 |= AD193X_ADC_LCR_MASTER; | 204 | adc_fmt |= AD193X_ADC_LCR_MASTER; |
220 | adc_reg2 &= ~AD193X_ADC_BCLK_MASTER; | 205 | dac_fmt |= AD193X_DAC_LCR_MASTER; |
221 | dac_reg |= AD193X_DAC_LCR_MASTER; | ||
222 | dac_reg &= ~AD193X_DAC_BCLK_MASTER; | ||
223 | break; | 206 | break; |
224 | case SND_SOC_DAIFMT_CBM_CFS: /* codec clk master & frame slave */ | 207 | case SND_SOC_DAIFMT_CBM_CFS: /* codec clk master & frame slave */ |
225 | adc_reg2 &= ~AD193X_ADC_LCR_MASTER; | 208 | adc_fmt |= AD193X_ADC_BCLK_MASTER; |
226 | adc_reg2 |= AD193X_ADC_BCLK_MASTER; | 209 | dac_fmt |= AD193X_DAC_BCLK_MASTER; |
227 | dac_reg &= ~AD193X_DAC_LCR_MASTER; | ||
228 | dac_reg |= AD193X_DAC_BCLK_MASTER; | ||
229 | break; | 210 | break; |
230 | case SND_SOC_DAIFMT_CBS_CFS: /* codec clk & frm slave */ | 211 | case SND_SOC_DAIFMT_CBS_CFS: /* codec clk & frm slave */ |
231 | adc_reg2 &= ~AD193X_ADC_LCR_MASTER; | ||
232 | adc_reg2 &= ~AD193X_ADC_BCLK_MASTER; | ||
233 | dac_reg &= ~AD193X_DAC_LCR_MASTER; | ||
234 | dac_reg &= ~AD193X_DAC_BCLK_MASTER; | ||
235 | break; | 212 | break; |
236 | default: | 213 | default: |
237 | return -EINVAL; | 214 | return -EINVAL; |
238 | } | 215 | } |
239 | 216 | ||
240 | snd_soc_write(codec, AD193X_ADC_CTRL1, adc_reg1); | 217 | regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL1, |
241 | snd_soc_write(codec, AD193X_ADC_CTRL2, adc_reg2); | 218 | AD193X_ADC_SERFMT_MASK, adc_serfmt); |
242 | snd_soc_write(codec, AD193X_DAC_CTRL1, dac_reg); | 219 | regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2, |
220 | AD193X_ADC_FMT_MASK, adc_fmt); | ||
221 | regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1, | ||
222 | AD193X_DAC_FMT_MASK, dac_fmt); | ||
243 | 223 | ||
244 | return 0; | 224 | return 0; |
245 | } | 225 | } |
@@ -299,20 +279,20 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, | |||
299 | break; | 279 | break; |
300 | } | 280 | } |
301 | 281 | ||
302 | snd_soc_update_bits(codec, AD193X_PLL_CLK_CTRL0, | 282 | regmap_update_bits(ad193x->regmap, AD193X_PLL_CLK_CTRL0, |
303 | AD193X_PLL_INPUT_MASK, master_rate); | 283 | AD193X_PLL_INPUT_MASK, master_rate); |
304 | 284 | ||
305 | snd_soc_update_bits(codec, AD193X_DAC_CTRL2, | 285 | regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, |
306 | AD193X_DAC_WORD_LEN_MASK, | 286 | AD193X_DAC_WORD_LEN_MASK, |
307 | word_len << AD193X_DAC_WORD_LEN_SHFT); | 287 | word_len << AD193X_DAC_WORD_LEN_SHFT); |
308 | 288 | ||
309 | snd_soc_update_bits(codec, AD193X_ADC_CTRL1, | 289 | regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL1, |
310 | AD193X_ADC_WORD_LEN_MASK, word_len); | 290 | AD193X_ADC_WORD_LEN_MASK, word_len); |
311 | 291 | ||
312 | return 0; | 292 | return 0; |
313 | } | 293 | } |
314 | 294 | ||
315 | static struct snd_soc_dai_ops ad193x_dai_ops = { | 295 | static const struct snd_soc_dai_ops ad193x_dai_ops = { |
316 | .hw_params = ad193x_hw_params, | 296 | .hw_params = ad193x_hw_params, |
317 | .digital_mute = ad193x_mute, | 297 | .digital_mute = ad193x_mute, |
318 | .set_tdm_slot = ad193x_set_tdm_slot, | 298 | .set_tdm_slot = ad193x_set_tdm_slot, |
@@ -345,7 +325,6 @@ static struct snd_soc_dai_driver ad193x_dai = { | |||
345 | static int ad193x_probe(struct snd_soc_codec *codec) | 325 | static int ad193x_probe(struct snd_soc_codec *codec) |
346 | { | 326 | { |
347 | struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); | 327 | struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); |
348 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
349 | int ret; | 328 | int ret; |
350 | 329 | ||
351 | codec->control_data = ad193x->regmap; | 330 | codec->control_data = ad193x->regmap; |
@@ -358,32 +337,37 @@ static int ad193x_probe(struct snd_soc_codec *codec) | |||
358 | /* default setting for ad193x */ | 337 | /* default setting for ad193x */ |
359 | 338 | ||
360 | /* unmute dac channels */ | 339 | /* unmute dac channels */ |
361 | snd_soc_write(codec, AD193X_DAC_CHNL_MUTE, 0x0); | 340 | regmap_write(ad193x->regmap, AD193X_DAC_CHNL_MUTE, 0x0); |
362 | /* de-emphasis: 48kHz, powedown dac */ | 341 | /* de-emphasis: 48kHz, powedown dac */ |
363 | snd_soc_write(codec, AD193X_DAC_CTRL2, 0x1A); | 342 | regmap_write(ad193x->regmap, AD193X_DAC_CTRL2, 0x1A); |
364 | /* powerdown dac, dac in tdm mode */ | 343 | /* powerdown dac, dac in tdm mode */ |
365 | snd_soc_write(codec, AD193X_DAC_CTRL0, 0x41); | 344 | regmap_write(ad193x->regmap, AD193X_DAC_CTRL0, 0x41); |
366 | /* high-pass filter enable */ | 345 | /* high-pass filter enable */ |
367 | snd_soc_write(codec, AD193X_ADC_CTRL0, 0x3); | 346 | regmap_write(ad193x->regmap, AD193X_ADC_CTRL0, 0x3); |
368 | /* sata delay=1, adc aux mode */ | 347 | /* sata delay=1, adc aux mode */ |
369 | snd_soc_write(codec, AD193X_ADC_CTRL1, 0x43); | 348 | regmap_write(ad193x->regmap, AD193X_ADC_CTRL1, 0x43); |
370 | /* pll input: mclki/xi */ | 349 | /* pll input: mclki/xi */ |
371 | snd_soc_write(codec, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */ | 350 | regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */ |
372 | snd_soc_write(codec, AD193X_PLL_CLK_CTRL1, 0x04); | 351 | regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04); |
373 | |||
374 | snd_soc_add_controls(codec, ad193x_snd_controls, | ||
375 | ARRAY_SIZE(ad193x_snd_controls)); | ||
376 | snd_soc_dapm_new_controls(dapm, ad193x_dapm_widgets, | ||
377 | ARRAY_SIZE(ad193x_dapm_widgets)); | ||
378 | snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths)); | ||
379 | 352 | ||
380 | return ret; | 353 | return ret; |
381 | } | 354 | } |
382 | 355 | ||
383 | static struct snd_soc_codec_driver soc_codec_dev_ad193x = { | 356 | static struct snd_soc_codec_driver soc_codec_dev_ad193x = { |
384 | .probe = ad193x_probe, | 357 | .probe = ad193x_probe, |
358 | .controls = ad193x_snd_controls, | ||
359 | .num_controls = ARRAY_SIZE(ad193x_snd_controls), | ||
360 | .dapm_widgets = ad193x_dapm_widgets, | ||
361 | .num_dapm_widgets = ARRAY_SIZE(ad193x_dapm_widgets), | ||
362 | .dapm_routes = audio_paths, | ||
363 | .num_dapm_routes = ARRAY_SIZE(audio_paths), | ||
385 | }; | 364 | }; |
386 | 365 | ||
366 | static bool adau193x_reg_volatile(struct device *dev, unsigned int reg) | ||
367 | { | ||
368 | return false; | ||
369 | } | ||
370 | |||
387 | #if defined(CONFIG_SPI_MASTER) | 371 | #if defined(CONFIG_SPI_MASTER) |
388 | 372 | ||
389 | static const struct regmap_config ad193x_spi_regmap_config = { | 373 | static const struct regmap_config ad193x_spi_regmap_config = { |
@@ -391,6 +375,9 @@ static const struct regmap_config ad193x_spi_regmap_config = { | |||
391 | .reg_bits = 16, | 375 | .reg_bits = 16, |
392 | .read_flag_mask = 0x09, | 376 | .read_flag_mask = 0x09, |
393 | .write_flag_mask = 0x08, | 377 | .write_flag_mask = 0x08, |
378 | |||
379 | .max_register = AD193X_NUM_REGS - 1, | ||
380 | .volatile_reg = adau193x_reg_volatile, | ||
394 | }; | 381 | }; |
395 | 382 | ||
396 | static int __devinit ad193x_spi_probe(struct spi_device *spi) | 383 | static int __devinit ad193x_spi_probe(struct spi_device *spi) |
@@ -398,14 +385,15 @@ static int __devinit ad193x_spi_probe(struct spi_device *spi) | |||
398 | struct ad193x_priv *ad193x; | 385 | struct ad193x_priv *ad193x; |
399 | int ret; | 386 | int ret; |
400 | 387 | ||
401 | ad193x = kzalloc(sizeof(struct ad193x_priv), GFP_KERNEL); | 388 | ad193x = devm_kzalloc(&spi->dev, sizeof(struct ad193x_priv), |
389 | GFP_KERNEL); | ||
402 | if (ad193x == NULL) | 390 | if (ad193x == NULL) |
403 | return -ENOMEM; | 391 | return -ENOMEM; |
404 | 392 | ||
405 | ad193x->regmap = regmap_init_spi(spi, &ad193x_spi_regmap_config); | 393 | ad193x->regmap = regmap_init_spi(spi, &ad193x_spi_regmap_config); |
406 | if (IS_ERR(ad193x->regmap)) { | 394 | if (IS_ERR(ad193x->regmap)) { |
407 | ret = PTR_ERR(ad193x->regmap); | 395 | ret = PTR_ERR(ad193x->regmap); |
408 | goto err_free; | 396 | goto err_out; |
409 | } | 397 | } |
410 | 398 | ||
411 | spi_set_drvdata(spi, ad193x); | 399 | spi_set_drvdata(spi, ad193x); |
@@ -419,9 +407,7 @@ static int __devinit ad193x_spi_probe(struct spi_device *spi) | |||
419 | 407 | ||
420 | err_regmap_exit: | 408 | err_regmap_exit: |
421 | regmap_exit(ad193x->regmap); | 409 | regmap_exit(ad193x->regmap); |
422 | err_free: | 410 | err_out: |
423 | kfree(ad193x); | ||
424 | |||
425 | return ret; | 411 | return ret; |
426 | } | 412 | } |
427 | 413 | ||
@@ -431,7 +417,6 @@ static int __devexit ad193x_spi_remove(struct spi_device *spi) | |||
431 | 417 | ||
432 | snd_soc_unregister_codec(&spi->dev); | 418 | snd_soc_unregister_codec(&spi->dev); |
433 | regmap_exit(ad193x->regmap); | 419 | regmap_exit(ad193x->regmap); |
434 | kfree(ad193x); | ||
435 | return 0; | 420 | return 0; |
436 | } | 421 | } |
437 | 422 | ||
@@ -450,6 +435,9 @@ static struct spi_driver ad193x_spi_driver = { | |||
450 | static const struct regmap_config ad193x_i2c_regmap_config = { | 435 | static const struct regmap_config ad193x_i2c_regmap_config = { |
451 | .val_bits = 8, | 436 | .val_bits = 8, |
452 | .reg_bits = 8, | 437 | .reg_bits = 8, |
438 | |||
439 | .max_register = AD193X_NUM_REGS - 1, | ||
440 | .volatile_reg = adau193x_reg_volatile, | ||
453 | }; | 441 | }; |
454 | 442 | ||
455 | static const struct i2c_device_id ad193x_id[] = { | 443 | static const struct i2c_device_id ad193x_id[] = { |
@@ -465,14 +453,15 @@ static int __devinit ad193x_i2c_probe(struct i2c_client *client, | |||
465 | struct ad193x_priv *ad193x; | 453 | struct ad193x_priv *ad193x; |
466 | int ret; | 454 | int ret; |
467 | 455 | ||
468 | ad193x = kzalloc(sizeof(struct ad193x_priv), GFP_KERNEL); | 456 | ad193x = devm_kzalloc(&client->dev, sizeof(struct ad193x_priv), |
457 | GFP_KERNEL); | ||
469 | if (ad193x == NULL) | 458 | if (ad193x == NULL) |
470 | return -ENOMEM; | 459 | return -ENOMEM; |
471 | 460 | ||
472 | ad193x->regmap = regmap_init_i2c(client, &ad193x_i2c_regmap_config); | 461 | ad193x->regmap = regmap_init_i2c(client, &ad193x_i2c_regmap_config); |
473 | if (IS_ERR(ad193x->regmap)) { | 462 | if (IS_ERR(ad193x->regmap)) { |
474 | ret = PTR_ERR(ad193x->regmap); | 463 | ret = PTR_ERR(ad193x->regmap); |
475 | goto err_free; | 464 | goto err_out; |
476 | } | 465 | } |
477 | 466 | ||
478 | i2c_set_clientdata(client, ad193x); | 467 | i2c_set_clientdata(client, ad193x); |
@@ -486,8 +475,7 @@ static int __devinit ad193x_i2c_probe(struct i2c_client *client, | |||
486 | 475 | ||
487 | err_regmap_exit: | 476 | err_regmap_exit: |
488 | regmap_exit(ad193x->regmap); | 477 | regmap_exit(ad193x->regmap); |
489 | err_free: | 478 | err_out: |
490 | kfree(ad193x); | ||
491 | return ret; | 479 | return ret; |
492 | } | 480 | } |
493 | 481 | ||
@@ -497,7 +485,6 @@ static int __devexit ad193x_i2c_remove(struct i2c_client *client) | |||
497 | 485 | ||
498 | snd_soc_unregister_codec(&client->dev); | 486 | snd_soc_unregister_codec(&client->dev); |
499 | regmap_exit(ad193x->regmap); | 487 | regmap_exit(ad193x->regmap); |
500 | kfree(ad193x); | ||
501 | return 0; | 488 | return 0; |
502 | } | 489 | } |
503 | 490 | ||
diff --git a/sound/soc/codecs/ad193x.h b/sound/soc/codecs/ad193x.h index 1507eaa425a..47338804999 100644 --- a/sound/soc/codecs/ad193x.h +++ b/sound/soc/codecs/ad193x.h | |||
@@ -23,16 +23,14 @@ | |||
23 | #define AD193X_DAC_SERFMT_STEREO (0 << 6) | 23 | #define AD193X_DAC_SERFMT_STEREO (0 << 6) |
24 | #define AD193X_DAC_SERFMT_TDM (1 << 6) | 24 | #define AD193X_DAC_SERFMT_TDM (1 << 6) |
25 | #define AD193X_DAC_CTRL1 0x03 | 25 | #define AD193X_DAC_CTRL1 0x03 |
26 | #define AD193X_DAC_2_CHANNELS 0 | ||
27 | #define AD193X_DAC_4_CHANNELS 1 | ||
28 | #define AD193X_DAC_8_CHANNELS 2 | ||
29 | #define AD193X_DAC_16_CHANNELS 3 | ||
30 | #define AD193X_DAC_CHAN_SHFT 1 | 26 | #define AD193X_DAC_CHAN_SHFT 1 |
31 | #define AD193X_DAC_CHAN_MASK (3 << AD193X_DAC_CHAN_SHFT) | 27 | #define AD193X_DAC_CHAN_MASK (3 << AD193X_DAC_CHAN_SHFT) |
32 | #define AD193X_DAC_LCR_MASTER (1 << 4) | 28 | #define AD193X_DAC_LCR_MASTER (1 << 4) |
33 | #define AD193X_DAC_BCLK_MASTER (1 << 5) | 29 | #define AD193X_DAC_BCLK_MASTER (1 << 5) |
34 | #define AD193X_DAC_LEFT_HIGH (1 << 3) | 30 | #define AD193X_DAC_LEFT_HIGH (1 << 3) |
35 | #define AD193X_DAC_BCLK_INV (1 << 7) | 31 | #define AD193X_DAC_BCLK_INV (1 << 7) |
32 | #define AD193X_DAC_FMT_MASK (AD193X_DAC_LCR_MASTER | \ | ||
33 | AD193X_DAC_BCLK_MASTER | AD193X_DAC_LEFT_HIGH | AD193X_DAC_BCLK_INV) | ||
36 | #define AD193X_DAC_CTRL2 0x04 | 34 | #define AD193X_DAC_CTRL2 0x04 |
37 | #define AD193X_DAC_WORD_LEN_SHFT 3 | 35 | #define AD193X_DAC_WORD_LEN_SHFT 3 |
38 | #define AD193X_DAC_WORD_LEN_MASK 0x18 | 36 | #define AD193X_DAC_WORD_LEN_MASK 0x18 |
@@ -68,16 +66,19 @@ | |||
68 | #define AD193X_ADC_SERFMT_AUX (2 << 5) | 66 | #define AD193X_ADC_SERFMT_AUX (2 << 5) |
69 | #define AD193X_ADC_WORD_LEN_MASK 0x3 | 67 | #define AD193X_ADC_WORD_LEN_MASK 0x3 |
70 | #define AD193X_ADC_CTRL2 0x10 | 68 | #define AD193X_ADC_CTRL2 0x10 |
71 | #define AD193X_ADC_2_CHANNELS 0 | ||
72 | #define AD193X_ADC_4_CHANNELS 1 | ||
73 | #define AD193X_ADC_8_CHANNELS 2 | ||
74 | #define AD193X_ADC_16_CHANNELS 3 | ||
75 | #define AD193X_ADC_CHAN_SHFT 4 | 69 | #define AD193X_ADC_CHAN_SHFT 4 |
76 | #define AD193X_ADC_CHAN_MASK (3 << AD193X_ADC_CHAN_SHFT) | 70 | #define AD193X_ADC_CHAN_MASK (3 << AD193X_ADC_CHAN_SHFT) |
77 | #define AD193X_ADC_LCR_MASTER (1 << 3) | 71 | #define AD193X_ADC_LCR_MASTER (1 << 3) |
78 | #define AD193X_ADC_BCLK_MASTER (1 << 6) | 72 | #define AD193X_ADC_BCLK_MASTER (1 << 6) |
79 | #define AD193X_ADC_LEFT_HIGH (1 << 2) | 73 | #define AD193X_ADC_LEFT_HIGH (1 << 2) |
80 | #define AD193X_ADC_BCLK_INV (1 << 1) | 74 | #define AD193X_ADC_BCLK_INV (1 << 1) |
75 | #define AD193X_ADC_FMT_MASK (AD193X_ADC_LCR_MASTER | \ | ||
76 | AD193X_ADC_BCLK_MASTER | AD193X_ADC_LEFT_HIGH | AD193X_ADC_BCLK_INV) | ||
77 | |||
78 | #define AD193X_2_CHANNELS 0 | ||
79 | #define AD193X_4_CHANNELS 1 | ||
80 | #define AD193X_8_CHANNELS 2 | ||
81 | #define AD193X_16_CHANNELS 3 | ||
81 | 82 | ||
82 | #define AD193X_NUM_REGS 17 | 83 | #define AD193X_NUM_REGS 17 |
83 | 84 | ||
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c index e3931cc5e66..9bba7f84946 100644 --- a/sound/soc/codecs/ad1980.c +++ b/sound/soc/codecs/ad1980.c | |||
@@ -277,17 +277,7 @@ static struct platform_driver ad1980_codec_driver = { | |||
277 | .remove = __devexit_p(ad1980_remove), | 277 | .remove = __devexit_p(ad1980_remove), |
278 | }; | 278 | }; |
279 | 279 | ||
280 | static int __init ad1980_init(void) | 280 | module_platform_driver(ad1980_codec_driver); |
281 | { | ||
282 | return platform_driver_register(&ad1980_codec_driver); | ||
283 | } | ||
284 | module_init(ad1980_init); | ||
285 | |||
286 | static void __exit ad1980_exit(void) | ||
287 | { | ||
288 | platform_driver_unregister(&ad1980_codec_driver); | ||
289 | } | ||
290 | module_exit(ad1980_exit); | ||
291 | 281 | ||
292 | MODULE_DESCRIPTION("ASoC ad1980 driver (Obsolete)"); | 282 | MODULE_DESCRIPTION("ASoC ad1980 driver (Obsolete)"); |
293 | MODULE_AUTHOR("Roy Huang, Cliff Cai"); | 283 | MODULE_AUTHOR("Roy Huang, Cliff Cai"); |
diff --git a/sound/soc/codecs/ad73311.c b/sound/soc/codecs/ad73311.c index 8d793e993e9..ee7a68dcefd 100644 --- a/sound/soc/codecs/ad73311.c +++ b/sound/soc/codecs/ad73311.c | |||
@@ -63,17 +63,7 @@ static struct platform_driver ad73311_codec_driver = { | |||
63 | .remove = __devexit_p(ad73311_remove), | 63 | .remove = __devexit_p(ad73311_remove), |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static int __init ad73311_init(void) | 66 | module_platform_driver(ad73311_codec_driver); |
67 | { | ||
68 | return platform_driver_register(&ad73311_codec_driver); | ||
69 | } | ||
70 | module_init(ad73311_init); | ||
71 | |||
72 | static void __exit ad73311_exit(void) | ||
73 | { | ||
74 | platform_driver_unregister(&ad73311_codec_driver); | ||
75 | } | ||
76 | module_exit(ad73311_exit); | ||
77 | 67 | ||
78 | MODULE_DESCRIPTION("ASoC ad73311 driver"); | 68 | MODULE_DESCRIPTION("ASoC ad73311 driver"); |
79 | MODULE_AUTHOR("Cliff Cai "); | 69 | MODULE_AUTHOR("Cliff Cai "); |
diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c index 45c63028b40..971ba452917 100644 --- a/sound/soc/codecs/adau1373.c +++ b/sound/soc/codecs/adau1373.c | |||
@@ -1321,7 +1321,7 @@ static int adau1373_remove(struct snd_soc_codec *codec) | |||
1321 | return 0; | 1321 | return 0; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | static int adau1373_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1324 | static int adau1373_suspend(struct snd_soc_codec *codec) |
1325 | { | 1325 | { |
1326 | return adau1373_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1326 | return adau1373_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1327 | } | 1327 | } |
@@ -1360,7 +1360,7 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, | |||
1360 | struct adau1373 *adau1373; | 1360 | struct adau1373 *adau1373; |
1361 | int ret; | 1361 | int ret; |
1362 | 1362 | ||
1363 | adau1373 = kzalloc(sizeof(*adau1373), GFP_KERNEL); | 1363 | adau1373 = devm_kzalloc(&client->dev, sizeof(*adau1373), GFP_KERNEL); |
1364 | if (!adau1373) | 1364 | if (!adau1373) |
1365 | return -ENOMEM; | 1365 | return -ENOMEM; |
1366 | 1366 | ||
@@ -1368,16 +1368,12 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, | |||
1368 | 1368 | ||
1369 | ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver, | 1369 | ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver, |
1370 | adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver)); | 1370 | adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver)); |
1371 | if (ret < 0) | ||
1372 | kfree(adau1373); | ||
1373 | |||
1374 | return ret; | 1371 | return ret; |
1375 | } | 1372 | } |
1376 | 1373 | ||
1377 | static int __devexit adau1373_i2c_remove(struct i2c_client *client) | 1374 | static int __devexit adau1373_i2c_remove(struct i2c_client *client) |
1378 | { | 1375 | { |
1379 | snd_soc_unregister_codec(&client->dev); | 1376 | snd_soc_unregister_codec(&client->dev); |
1380 | kfree(dev_get_drvdata(&client->dev)); | ||
1381 | return 0; | 1377 | return 0; |
1382 | } | 1378 | } |
1383 | 1379 | ||
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 8b7e1c50d6e..6b325ea0386 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c | |||
@@ -12,13 +12,13 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/sigma.h> | ||
16 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
17 | #include <sound/core.h> | 16 | #include <sound/core.h> |
18 | #include <sound/pcm.h> | 17 | #include <sound/pcm.h> |
19 | #include <sound/pcm_params.h> | 18 | #include <sound/pcm_params.h> |
20 | #include <sound/soc.h> | 19 | #include <sound/soc.h> |
21 | 20 | ||
21 | #include "sigmadsp.h" | ||
22 | #include "adau1701.h" | 22 | #include "adau1701.h" |
23 | 23 | ||
24 | #define ADAU1701_DSPCTRL 0x1c | 24 | #define ADAU1701_DSPCTRL 0x1c |
@@ -496,23 +496,19 @@ static __devinit int adau1701_i2c_probe(struct i2c_client *client, | |||
496 | struct adau1701 *adau1701; | 496 | struct adau1701 *adau1701; |
497 | int ret; | 497 | int ret; |
498 | 498 | ||
499 | adau1701 = kzalloc(sizeof(*adau1701), GFP_KERNEL); | 499 | adau1701 = devm_kzalloc(&client->dev, sizeof(*adau1701), GFP_KERNEL); |
500 | if (!adau1701) | 500 | if (!adau1701) |
501 | return -ENOMEM; | 501 | return -ENOMEM; |
502 | 502 | ||
503 | i2c_set_clientdata(client, adau1701); | 503 | i2c_set_clientdata(client, adau1701); |
504 | ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, | 504 | ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, |
505 | &adau1701_dai, 1); | 505 | &adau1701_dai, 1); |
506 | if (ret < 0) | ||
507 | kfree(adau1701); | ||
508 | |||
509 | return ret; | 506 | return ret; |
510 | } | 507 | } |
511 | 508 | ||
512 | static __devexit int adau1701_i2c_remove(struct i2c_client *client) | 509 | static __devexit int adau1701_i2c_remove(struct i2c_client *client) |
513 | { | 510 | { |
514 | snd_soc_unregister_codec(&client->dev); | 511 | snd_soc_unregister_codec(&client->dev); |
515 | kfree(i2c_get_clientdata(client)); | ||
516 | return 0; | 512 | return 0; |
517 | } | 513 | } |
518 | 514 | ||
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index f9f08948e5e..ebd7b37b902 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c | |||
@@ -798,7 +798,7 @@ static int adav80x_probe(struct snd_soc_codec *codec) | |||
798 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 798 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
799 | } | 799 | } |
800 | 800 | ||
801 | static int adav80x_suspend(struct snd_soc_codec *codec, pm_message_t state) | 801 | static int adav80x_suspend(struct snd_soc_codec *codec) |
802 | { | 802 | { |
803 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_OFF); | 803 | return adav80x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
804 | } | 804 | } |
diff --git a/sound/soc/codecs/ads117x.c b/sound/soc/codecs/ads117x.c index 9082e0f729f..8103b938b8c 100644 --- a/sound/soc/codecs/ads117x.c +++ b/sound/soc/codecs/ads117x.c | |||
@@ -58,17 +58,7 @@ static struct platform_driver ads117x_codec_driver = { | |||
58 | .remove = __devexit_p(ads117x_remove), | 58 | .remove = __devexit_p(ads117x_remove), |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static int __init ads117x_init(void) | 61 | module_platform_driver(ads117x_codec_driver); |
62 | { | ||
63 | return platform_driver_register(&ads117x_codec_driver); | ||
64 | } | ||
65 | module_init(ads117x_init); | ||
66 | |||
67 | static void __exit ads117x_exit(void) | ||
68 | { | ||
69 | platform_driver_unregister(&ads117x_codec_driver); | ||
70 | } | ||
71 | module_exit(ads117x_exit); | ||
72 | 62 | ||
73 | MODULE_DESCRIPTION("ASoC ads117x driver"); | 63 | MODULE_DESCRIPTION("ASoC ads117x driver"); |
74 | MODULE_AUTHOR("Graeme Gregory"); | 64 | MODULE_AUTHOR("Graeme Gregory"); |
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c index d3b29dce6ed..d27b5e4cce9 100644 --- a/sound/soc/codecs/ak4104.c +++ b/sound/soc/codecs/ak4104.c | |||
@@ -170,7 +170,7 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream, | |||
170 | return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val); | 170 | return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val); |
171 | } | 171 | } |
172 | 172 | ||
173 | static struct snd_soc_dai_ops ak4101_dai_ops = { | 173 | static const struct snd_soc_dai_ops ak4101_dai_ops = { |
174 | .hw_params = ak4104_hw_params, | 174 | .hw_params = ak4104_hw_params, |
175 | .set_fmt = ak4104_set_dai_fmt, | 175 | .set_fmt = ak4104_set_dai_fmt, |
176 | }; | 176 | }; |
@@ -261,7 +261,8 @@ static int ak4104_spi_probe(struct spi_device *spi) | |||
261 | if (ret < 0) | 261 | if (ret < 0) |
262 | return ret; | 262 | return ret; |
263 | 263 | ||
264 | ak4104 = kzalloc(sizeof(struct ak4104_private), GFP_KERNEL); | 264 | ak4104 = devm_kzalloc(&spi->dev, sizeof(struct ak4104_private), |
265 | GFP_KERNEL); | ||
265 | if (ak4104 == NULL) | 266 | if (ak4104 == NULL) |
266 | return -ENOMEM; | 267 | return -ENOMEM; |
267 | 268 | ||
@@ -271,15 +272,12 @@ static int ak4104_spi_probe(struct spi_device *spi) | |||
271 | 272 | ||
272 | ret = snd_soc_register_codec(&spi->dev, | 273 | ret = snd_soc_register_codec(&spi->dev, |
273 | &soc_codec_device_ak4104, &ak4104_dai, 1); | 274 | &soc_codec_device_ak4104, &ak4104_dai, 1); |
274 | if (ret < 0) | ||
275 | kfree(ak4104); | ||
276 | return ret; | 275 | return ret; |
277 | } | 276 | } |
278 | 277 | ||
279 | static int __devexit ak4104_spi_remove(struct spi_device *spi) | 278 | static int __devexit ak4104_spi_remove(struct spi_device *spi) |
280 | { | 279 | { |
281 | snd_soc_unregister_codec(&spi->dev); | 280 | snd_soc_unregister_codec(&spi->dev); |
282 | kfree(spi_get_drvdata(spi)); | ||
283 | return 0; | 281 | return 0; |
284 | } | 282 | } |
285 | 283 | ||
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index 95d782d86e7..9e809e05d06 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -331,7 +330,7 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec, | |||
331 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 330 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
332 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 331 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
333 | 332 | ||
334 | static struct snd_soc_dai_ops ak4535_dai_ops = { | 333 | static const struct snd_soc_dai_ops ak4535_dai_ops = { |
335 | .hw_params = ak4535_hw_params, | 334 | .hw_params = ak4535_hw_params, |
336 | .set_fmt = ak4535_set_dai_fmt, | 335 | .set_fmt = ak4535_set_dai_fmt, |
337 | .digital_mute = ak4535_mute, | 336 | .digital_mute = ak4535_mute, |
@@ -355,7 +354,7 @@ static struct snd_soc_dai_driver ak4535_dai = { | |||
355 | .ops = &ak4535_dai_ops, | 354 | .ops = &ak4535_dai_ops, |
356 | }; | 355 | }; |
357 | 356 | ||
358 | static int ak4535_suspend(struct snd_soc_codec *codec, pm_message_t state) | 357 | static int ak4535_suspend(struct snd_soc_codec *codec) |
359 | { | 358 | { |
360 | ak4535_set_bias_level(codec, SND_SOC_BIAS_OFF); | 359 | ak4535_set_bias_level(codec, SND_SOC_BIAS_OFF); |
361 | return 0; | 360 | return 0; |
@@ -417,7 +416,8 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c, | |||
417 | struct ak4535_priv *ak4535; | 416 | struct ak4535_priv *ak4535; |
418 | int ret; | 417 | int ret; |
419 | 418 | ||
420 | ak4535 = kzalloc(sizeof(struct ak4535_priv), GFP_KERNEL); | 419 | ak4535 = devm_kzalloc(&i2c->dev, sizeof(struct ak4535_priv), |
420 | GFP_KERNEL); | ||
421 | if (ak4535 == NULL) | 421 | if (ak4535 == NULL) |
422 | return -ENOMEM; | 422 | return -ENOMEM; |
423 | 423 | ||
@@ -426,15 +426,12 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c, | |||
426 | 426 | ||
427 | ret = snd_soc_register_codec(&i2c->dev, | 427 | ret = snd_soc_register_codec(&i2c->dev, |
428 | &soc_codec_dev_ak4535, &ak4535_dai, 1); | 428 | &soc_codec_dev_ak4535, &ak4535_dai, 1); |
429 | if (ret < 0) | ||
430 | kfree(ak4535); | ||
431 | return ret; | 429 | return ret; |
432 | } | 430 | } |
433 | 431 | ||
434 | static __devexit int ak4535_i2c_remove(struct i2c_client *client) | 432 | static __devexit int ak4535_i2c_remove(struct i2c_client *client) |
435 | { | 433 | { |
436 | snd_soc_unregister_codec(&client->dev); | 434 | snd_soc_unregister_codec(&client->dev); |
437 | kfree(i2c_get_clientdata(client)); | ||
438 | return 0; | 435 | return 0; |
439 | } | 436 | } |
440 | 437 | ||
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index 77838586f35..c4d165a4bdd 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -340,6 +339,7 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
340 | { | 339 | { |
341 | struct snd_soc_codec *codec = codec_dai->codec; | 340 | struct snd_soc_codec *codec = codec_dai->codec; |
342 | u8 btif; | 341 | u8 btif; |
342 | int ret; | ||
343 | 343 | ||
344 | /* interface format */ | 344 | /* interface format */ |
345 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | 345 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { |
@@ -359,7 +359,11 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
359 | return -EINVAL; | 359 | return -EINVAL; |
360 | } | 360 | } |
361 | 361 | ||
362 | return snd_soc_update_bits(codec, AK4641_BTIF, (0x3 << 5), btif); | 362 | ret = snd_soc_update_bits(codec, AK4641_BTIF, (0x3 << 5), btif); |
363 | if (ret < 0) | ||
364 | return ret; | ||
365 | |||
366 | return 0; | ||
363 | } | 367 | } |
364 | 368 | ||
365 | static int ak4641_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai, | 369 | static int ak4641_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai, |
@@ -442,14 +446,14 @@ static int ak4641_set_bias_level(struct snd_soc_codec *codec, | |||
442 | SNDRV_PCM_RATE_16000) | 446 | SNDRV_PCM_RATE_16000) |
443 | #define AK4641_FORMATS (SNDRV_PCM_FMTBIT_S16_LE) | 447 | #define AK4641_FORMATS (SNDRV_PCM_FMTBIT_S16_LE) |
444 | 448 | ||
445 | static struct snd_soc_dai_ops ak4641_i2s_dai_ops = { | 449 | static const struct snd_soc_dai_ops ak4641_i2s_dai_ops = { |
446 | .hw_params = ak4641_i2s_hw_params, | 450 | .hw_params = ak4641_i2s_hw_params, |
447 | .set_fmt = ak4641_i2s_set_dai_fmt, | 451 | .set_fmt = ak4641_i2s_set_dai_fmt, |
448 | .digital_mute = ak4641_mute, | 452 | .digital_mute = ak4641_mute, |
449 | .set_sysclk = ak4641_set_dai_sysclk, | 453 | .set_sysclk = ak4641_set_dai_sysclk, |
450 | }; | 454 | }; |
451 | 455 | ||
452 | static struct snd_soc_dai_ops ak4641_pcm_dai_ops = { | 456 | static const struct snd_soc_dai_ops ak4641_pcm_dai_ops = { |
453 | .hw_params = NULL, /* rates are controlled by BT chip */ | 457 | .hw_params = NULL, /* rates are controlled by BT chip */ |
454 | .set_fmt = ak4641_pcm_set_dai_fmt, | 458 | .set_fmt = ak4641_pcm_set_dai_fmt, |
455 | .digital_mute = ak4641_mute, | 459 | .digital_mute = ak4641_mute, |
@@ -499,7 +503,7 @@ static struct snd_soc_dai_driver ak4641_dai[] = { | |||
499 | }, | 503 | }, |
500 | }; | 504 | }; |
501 | 505 | ||
502 | static int ak4641_suspend(struct snd_soc_codec *codec, pm_message_t state) | 506 | static int ak4641_suspend(struct snd_soc_codec *codec) |
503 | { | 507 | { |
504 | ak4641_set_bias_level(codec, SND_SOC_BIAS_OFF); | 508 | ak4641_set_bias_level(codec, SND_SOC_BIAS_OFF); |
505 | return 0; | 509 | return 0; |
@@ -603,7 +607,8 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, | |||
603 | struct ak4641_priv *ak4641; | 607 | struct ak4641_priv *ak4641; |
604 | int ret; | 608 | int ret; |
605 | 609 | ||
606 | ak4641 = kzalloc(sizeof(struct ak4641_priv), GFP_KERNEL); | 610 | ak4641 = devm_kzalloc(&i2c->dev, sizeof(struct ak4641_priv), |
611 | GFP_KERNEL); | ||
607 | if (!ak4641) | 612 | if (!ak4641) |
608 | return -ENOMEM; | 613 | return -ENOMEM; |
609 | 614 | ||
@@ -611,16 +616,12 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, | |||
611 | 616 | ||
612 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, | 617 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, |
613 | ak4641_dai, ARRAY_SIZE(ak4641_dai)); | 618 | ak4641_dai, ARRAY_SIZE(ak4641_dai)); |
614 | if (ret < 0) | ||
615 | kfree(ak4641); | ||
616 | |||
617 | return ret; | 619 | return ret; |
618 | } | 620 | } |
619 | 621 | ||
620 | static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) | 622 | static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) |
621 | { | 623 | { |
622 | snd_soc_unregister_codec(&i2c->dev); | 624 | snd_soc_unregister_codec(&i2c->dev); |
623 | kfree(i2c_get_clientdata(i2c)); | ||
624 | return 0; | 625 | return 0; |
625 | } | 626 | } |
626 | 627 | ||
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 12c1bdef673..5ef70b5d27e 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -18,21 +18,19 @@ | |||
18 | * This is very simple driver. | 18 | * This is very simple driver. |
19 | * It can use headphone output / stereo input only | 19 | * It can use headphone output / stereo input only |
20 | * | 20 | * |
21 | * AK4642 is not tested. | 21 | * AK4642 is tested. |
22 | * AK4643 is tested. | 22 | * AK4643 is tested. |
23 | * AK4648 is tested. | ||
23 | */ | 24 | */ |
24 | 25 | ||
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
26 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <sound/soc.h> | 30 | #include <sound/soc.h> |
31 | #include <sound/initval.h> | 31 | #include <sound/initval.h> |
32 | #include <sound/tlv.h> | 32 | #include <sound/tlv.h> |
33 | 33 | ||
34 | #define AK4642_VERSION "0.0.1" | ||
35 | |||
36 | #define PW_MGMT1 0x00 | 34 | #define PW_MGMT1 0x00 |
37 | #define PW_MGMT2 0x01 | 35 | #define PW_MGMT2 0x01 |
38 | #define SG_SL1 0x02 | 36 | #define SG_SL1 0x02 |
@@ -71,8 +69,6 @@ | |||
71 | #define HP_MS 0x23 | 69 | #define HP_MS 0x23 |
72 | #define SPK_MS 0x24 | 70 | #define SPK_MS 0x24 |
73 | 71 | ||
74 | #define AK4642_CACHEREGNUM 0x25 | ||
75 | |||
76 | /* PW_MGMT1*/ | 72 | /* PW_MGMT1*/ |
77 | #define PMVCM (1 << 6) /* VCOM Power Management */ | 73 | #define PMVCM (1 << 6) /* VCOM Power Management */ |
78 | #define PMMIN (1 << 5) /* MIN Input Power Management */ | 74 | #define PMMIN (1 << 5) /* MIN Input Power Management */ |
@@ -150,8 +146,52 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = { | |||
150 | 146 | ||
151 | SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC, | 147 | SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC, |
152 | 0, 0xFF, 1, out_tlv), | 148 | 0, 0xFF, 1, out_tlv), |
149 | |||
150 | SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0), | ||
151 | }; | ||
152 | |||
153 | static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = { | ||
154 | SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0), | ||
155 | }; | ||
156 | |||
157 | static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = { | ||
158 | SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0), | ||
159 | }; | ||
160 | |||
161 | static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = { | ||
162 | |||
163 | /* Outputs */ | ||
164 | SND_SOC_DAPM_OUTPUT("HPOUTL"), | ||
165 | SND_SOC_DAPM_OUTPUT("HPOUTR"), | ||
166 | SND_SOC_DAPM_OUTPUT("LINEOUT"), | ||
167 | |||
168 | SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0, | ||
169 | &ak4642_hpout_mixer_controls[0], | ||
170 | ARRAY_SIZE(ak4642_hpout_mixer_controls)), | ||
171 | |||
172 | SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0, | ||
173 | &ak4642_hpout_mixer_controls[0], | ||
174 | ARRAY_SIZE(ak4642_hpout_mixer_controls)), | ||
175 | |||
176 | SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0, | ||
177 | &ak4642_lout_mixer_controls[0], | ||
178 | ARRAY_SIZE(ak4642_lout_mixer_controls)), | ||
179 | |||
180 | /* DAC */ | ||
181 | SND_SOC_DAPM_DAC("DAC", "HiFi Playback", PW_MGMT1, 2, 0), | ||
153 | }; | 182 | }; |
154 | 183 | ||
184 | static const struct snd_soc_dapm_route ak4642_intercon[] = { | ||
185 | |||
186 | /* Outputs */ | ||
187 | {"HPOUTL", NULL, "HPOUTL Mixer"}, | ||
188 | {"HPOUTR", NULL, "HPOUTR Mixer"}, | ||
189 | {"LINEOUT", NULL, "LINEOUT Mixer"}, | ||
190 | |||
191 | {"HPOUTL Mixer", "DACH", "DAC"}, | ||
192 | {"HPOUTR Mixer", "DACH", "DAC"}, | ||
193 | {"LINEOUT Mixer", "DACL", "DAC"}, | ||
194 | }; | ||
155 | 195 | ||
156 | /* codec private data */ | 196 | /* codec private data */ |
157 | struct ak4642_priv { | 197 | struct ak4642_priv { |
@@ -162,7 +202,7 @@ struct ak4642_priv { | |||
162 | /* | 202 | /* |
163 | * ak4642 register cache | 203 | * ak4642 register cache |
164 | */ | 204 | */ |
165 | static const u8 ak4642_reg[AK4642_CACHEREGNUM] = { | 205 | static const u8 ak4642_reg[] = { |
166 | 0x00, 0x00, 0x01, 0x00, | 206 | 0x00, 0x00, 0x01, 0x00, |
167 | 0x02, 0x00, 0x00, 0x00, | 207 | 0x02, 0x00, 0x00, 0x00, |
168 | 0xe1, 0xe1, 0x18, 0x00, | 208 | 0xe1, 0xe1, 0x18, 0x00, |
@@ -175,6 +215,19 @@ static const u8 ak4642_reg[AK4642_CACHEREGNUM] = { | |||
175 | 0x00, | 215 | 0x00, |
176 | }; | 216 | }; |
177 | 217 | ||
218 | static const u8 ak4648_reg[] = { | ||
219 | 0x00, 0x00, 0x01, 0x00, | ||
220 | 0x02, 0x00, 0x00, 0x00, | ||
221 | 0xe1, 0xe1, 0x18, 0x00, | ||
222 | 0xe1, 0x18, 0x11, 0xb8, | ||
223 | 0x00, 0x00, 0x00, 0x00, | ||
224 | 0x00, 0x00, 0x00, 0x00, | ||
225 | 0x00, 0x00, 0x00, 0x00, | ||
226 | 0x00, 0x00, 0x00, 0x00, | ||
227 | 0x00, 0x00, 0x00, 0x00, | ||
228 | 0x00, 0x88, 0x88, 0x08, | ||
229 | }; | ||
230 | |||
178 | static int ak4642_dai_startup(struct snd_pcm_substream *substream, | 231 | static int ak4642_dai_startup(struct snd_pcm_substream *substream, |
179 | struct snd_soc_dai *dai) | 232 | struct snd_soc_dai *dai) |
180 | { | 233 | { |
@@ -192,14 +245,8 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream, | |||
192 | * This operation came from example code of | 245 | * This operation came from example code of |
193 | * "ASAHI KASEI AK4642" (japanese) manual p97. | 246 | * "ASAHI KASEI AK4642" (japanese) manual p97. |
194 | */ | 247 | */ |
195 | snd_soc_update_bits(codec, MD_CTL4, DACH, DACH); | ||
196 | snd_soc_update_bits(codec, MD_CTL3, BST1, BST1); | ||
197 | snd_soc_write(codec, L_IVC, 0x91); /* volume */ | 248 | snd_soc_write(codec, L_IVC, 0x91); /* volume */ |
198 | snd_soc_write(codec, R_IVC, 0x91); /* volume */ | 249 | snd_soc_write(codec, R_IVC, 0x91); /* volume */ |
199 | snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMMIN | PMDAC, | ||
200 | PMVCM | PMMIN | PMDAC); | ||
201 | snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, PMHP); | ||
202 | snd_soc_update_bits(codec, PW_MGMT2, HPMTN, HPMTN); | ||
203 | } else { | 250 | } else { |
204 | /* | 251 | /* |
205 | * start stereo input | 252 | * start stereo input |
@@ -217,8 +264,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream, | |||
217 | snd_soc_write(codec, SG_SL1, PMMP | MGAIN0); | 264 | snd_soc_write(codec, SG_SL1, PMMP | MGAIN0); |
218 | snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3)); | 265 | snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3)); |
219 | snd_soc_write(codec, ALC_CTL1, ALC | LMTH0); | 266 | snd_soc_write(codec, ALC_CTL1, ALC | LMTH0); |
220 | snd_soc_update_bits(codec, PW_MGMT1, PMVCM | PMADL, | 267 | snd_soc_update_bits(codec, PW_MGMT1, PMADL, PMADL); |
221 | PMVCM | PMADL); | ||
222 | snd_soc_update_bits(codec, PW_MGMT3, PMADR, PMADR); | 268 | snd_soc_update_bits(codec, PW_MGMT3, PMADR, PMADR); |
223 | } | 269 | } |
224 | 270 | ||
@@ -232,12 +278,6 @@ static void ak4642_dai_shutdown(struct snd_pcm_substream *substream, | |||
232 | struct snd_soc_codec *codec = dai->codec; | 278 | struct snd_soc_codec *codec = dai->codec; |
233 | 279 | ||
234 | if (is_play) { | 280 | if (is_play) { |
235 | /* stop headphone output */ | ||
236 | snd_soc_update_bits(codec, PW_MGMT2, HPMTN, 0); | ||
237 | snd_soc_update_bits(codec, PW_MGMT2, PMHP_MASK, 0); | ||
238 | snd_soc_update_bits(codec, PW_MGMT1, PMMIN | PMDAC, 0); | ||
239 | snd_soc_update_bits(codec, MD_CTL3, BST1, 0); | ||
240 | snd_soc_update_bits(codec, MD_CTL4, DACH, 0); | ||
241 | } else { | 281 | } else { |
242 | /* stop stereo input */ | 282 | /* stop stereo input */ |
243 | snd_soc_update_bits(codec, PW_MGMT1, PMADL, 0); | 283 | snd_soc_update_bits(codec, PW_MGMT1, PMADL, 0); |
@@ -376,7 +416,23 @@ static int ak4642_dai_hw_params(struct snd_pcm_substream *substream, | |||
376 | return 0; | 416 | return 0; |
377 | } | 417 | } |
378 | 418 | ||
379 | static struct snd_soc_dai_ops ak4642_dai_ops = { | 419 | static int ak4642_set_bias_level(struct snd_soc_codec *codec, |
420 | enum snd_soc_bias_level level) | ||
421 | { | ||
422 | switch (level) { | ||
423 | case SND_SOC_BIAS_OFF: | ||
424 | snd_soc_write(codec, PW_MGMT1, 0x00); | ||
425 | break; | ||
426 | default: | ||
427 | snd_soc_update_bits(codec, PW_MGMT1, PMVCM, PMVCM); | ||
428 | break; | ||
429 | } | ||
430 | codec->dapm.bias_level = level; | ||
431 | |||
432 | return 0; | ||
433 | } | ||
434 | |||
435 | static const struct snd_soc_dai_ops ak4642_dai_ops = { | ||
380 | .startup = ak4642_dai_startup, | 436 | .startup = ak4642_dai_startup, |
381 | .shutdown = ak4642_dai_shutdown, | 437 | .shutdown = ak4642_dai_shutdown, |
382 | .set_sysclk = ak4642_dai_set_sysclk, | 438 | .set_sysclk = ak4642_dai_set_sysclk, |
@@ -414,8 +470,6 @@ static int ak4642_probe(struct snd_soc_codec *codec) | |||
414 | struct ak4642_priv *ak4642 = snd_soc_codec_get_drvdata(codec); | 470 | struct ak4642_priv *ak4642 = snd_soc_codec_get_drvdata(codec); |
415 | int ret; | 471 | int ret; |
416 | 472 | ||
417 | dev_info(codec->dev, "AK4642 Audio Codec %s", AK4642_VERSION); | ||
418 | |||
419 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, ak4642->control_type); | 473 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, ak4642->control_type); |
420 | if (ret < 0) { | 474 | if (ret < 0) { |
421 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 475 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
@@ -425,15 +479,43 @@ static int ak4642_probe(struct snd_soc_codec *codec) | |||
425 | snd_soc_add_controls(codec, ak4642_snd_controls, | 479 | snd_soc_add_controls(codec, ak4642_snd_controls, |
426 | ARRAY_SIZE(ak4642_snd_controls)); | 480 | ARRAY_SIZE(ak4642_snd_controls)); |
427 | 481 | ||
482 | ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
483 | |||
484 | return 0; | ||
485 | } | ||
486 | |||
487 | static int ak4642_remove(struct snd_soc_codec *codec) | ||
488 | { | ||
489 | ak4642_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
428 | return 0; | 490 | return 0; |
429 | } | 491 | } |
430 | 492 | ||
431 | static struct snd_soc_codec_driver soc_codec_dev_ak4642 = { | 493 | static struct snd_soc_codec_driver soc_codec_dev_ak4642 = { |
432 | .probe = ak4642_probe, | 494 | .probe = ak4642_probe, |
495 | .remove = ak4642_remove, | ||
496 | .resume = ak4642_resume, | ||
497 | .set_bias_level = ak4642_set_bias_level, | ||
498 | .reg_cache_default = ak4642_reg, /* ak4642 reg */ | ||
499 | .reg_cache_size = ARRAY_SIZE(ak4642_reg), /* ak4642 reg */ | ||
500 | .reg_word_size = sizeof(u8), | ||
501 | .dapm_widgets = ak4642_dapm_widgets, | ||
502 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), | ||
503 | .dapm_routes = ak4642_intercon, | ||
504 | .num_dapm_routes = ARRAY_SIZE(ak4642_intercon), | ||
505 | }; | ||
506 | |||
507 | static struct snd_soc_codec_driver soc_codec_dev_ak4648 = { | ||
508 | .probe = ak4642_probe, | ||
509 | .remove = ak4642_remove, | ||
433 | .resume = ak4642_resume, | 510 | .resume = ak4642_resume, |
434 | .reg_cache_size = ARRAY_SIZE(ak4642_reg), | 511 | .set_bias_level = ak4642_set_bias_level, |
512 | .reg_cache_default = ak4648_reg, /* ak4648 reg */ | ||
513 | .reg_cache_size = ARRAY_SIZE(ak4648_reg), /* ak4648 reg */ | ||
435 | .reg_word_size = sizeof(u8), | 514 | .reg_word_size = sizeof(u8), |
436 | .reg_cache_default = ak4642_reg, | 515 | .dapm_widgets = ak4642_dapm_widgets, |
516 | .num_dapm_widgets = ARRAY_SIZE(ak4642_dapm_widgets), | ||
517 | .dapm_routes = ak4642_intercon, | ||
518 | .num_dapm_routes = ARRAY_SIZE(ak4642_intercon), | ||
437 | }; | 519 | }; |
438 | 520 | ||
439 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 521 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
@@ -443,7 +525,8 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c, | |||
443 | struct ak4642_priv *ak4642; | 525 | struct ak4642_priv *ak4642; |
444 | int ret; | 526 | int ret; |
445 | 527 | ||
446 | ak4642 = kzalloc(sizeof(struct ak4642_priv), GFP_KERNEL); | 528 | ak4642 = devm_kzalloc(&i2c->dev, sizeof(struct ak4642_priv), |
529 | GFP_KERNEL); | ||
447 | if (!ak4642) | 530 | if (!ak4642) |
448 | return -ENOMEM; | 531 | return -ENOMEM; |
449 | 532 | ||
@@ -451,22 +534,21 @@ static __devinit int ak4642_i2c_probe(struct i2c_client *i2c, | |||
451 | ak4642->control_type = SND_SOC_I2C; | 534 | ak4642->control_type = SND_SOC_I2C; |
452 | 535 | ||
453 | ret = snd_soc_register_codec(&i2c->dev, | 536 | ret = snd_soc_register_codec(&i2c->dev, |
454 | &soc_codec_dev_ak4642, &ak4642_dai, 1); | 537 | (struct snd_soc_codec_driver *)id->driver_data, |
455 | if (ret < 0) | 538 | &ak4642_dai, 1); |
456 | kfree(ak4642); | ||
457 | return ret; | 539 | return ret; |
458 | } | 540 | } |
459 | 541 | ||
460 | static __devexit int ak4642_i2c_remove(struct i2c_client *client) | 542 | static __devexit int ak4642_i2c_remove(struct i2c_client *client) |
461 | { | 543 | { |
462 | snd_soc_unregister_codec(&client->dev); | 544 | snd_soc_unregister_codec(&client->dev); |
463 | kfree(i2c_get_clientdata(client)); | ||
464 | return 0; | 545 | return 0; |
465 | } | 546 | } |
466 | 547 | ||
467 | static const struct i2c_device_id ak4642_i2c_id[] = { | 548 | static const struct i2c_device_id ak4642_i2c_id[] = { |
468 | { "ak4642", 0 }, | 549 | { "ak4642", (kernel_ulong_t)&soc_codec_dev_ak4642 }, |
469 | { "ak4643", 0 }, | 550 | { "ak4643", (kernel_ulong_t)&soc_codec_dev_ak4642 }, |
551 | { "ak4648", (kernel_ulong_t)&soc_codec_dev_ak4648 }, | ||
470 | { } | 552 | { } |
471 | }; | 553 | }; |
472 | MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id); | 554 | MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id); |
diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c index de9ff66d372..a53b152e6a0 100644 --- a/sound/soc/codecs/ak4671.c +++ b/sound/soc/codecs/ak4671.c | |||
@@ -594,7 +594,7 @@ static int ak4671_set_bias_level(struct snd_soc_codec *codec, | |||
594 | 594 | ||
595 | #define AK4671_FORMATS SNDRV_PCM_FMTBIT_S16_LE | 595 | #define AK4671_FORMATS SNDRV_PCM_FMTBIT_S16_LE |
596 | 596 | ||
597 | static struct snd_soc_dai_ops ak4671_dai_ops = { | 597 | static const struct snd_soc_dai_ops ak4671_dai_ops = { |
598 | .hw_params = ak4671_hw_params, | 598 | .hw_params = ak4671_hw_params, |
599 | .set_sysclk = ak4671_set_dai_sysclk, | 599 | .set_sysclk = ak4671_set_dai_sysclk, |
600 | .set_fmt = ak4671_set_dai_fmt, | 600 | .set_fmt = ak4671_set_dai_fmt, |
@@ -661,7 +661,8 @@ static int __devinit ak4671_i2c_probe(struct i2c_client *client, | |||
661 | struct ak4671_priv *ak4671; | 661 | struct ak4671_priv *ak4671; |
662 | int ret; | 662 | int ret; |
663 | 663 | ||
664 | ak4671 = kzalloc(sizeof(struct ak4671_priv), GFP_KERNEL); | 664 | ak4671 = devm_kzalloc(&client->dev, sizeof(struct ak4671_priv), |
665 | GFP_KERNEL); | ||
665 | if (ak4671 == NULL) | 666 | if (ak4671 == NULL) |
666 | return -ENOMEM; | 667 | return -ENOMEM; |
667 | 668 | ||
@@ -670,15 +671,12 @@ static int __devinit ak4671_i2c_probe(struct i2c_client *client, | |||
670 | 671 | ||
671 | ret = snd_soc_register_codec(&client->dev, | 672 | ret = snd_soc_register_codec(&client->dev, |
672 | &soc_codec_dev_ak4671, &ak4671_dai, 1); | 673 | &soc_codec_dev_ak4671, &ak4671_dai, 1); |
673 | if (ret < 0) | ||
674 | kfree(ak4671); | ||
675 | return ret; | 674 | return ret; |
676 | } | 675 | } |
677 | 676 | ||
678 | static __devexit int ak4671_i2c_remove(struct i2c_client *client) | 677 | static __devexit int ak4671_i2c_remove(struct i2c_client *client) |
679 | { | 678 | { |
680 | snd_soc_unregister_codec(&client->dev); | 679 | snd_soc_unregister_codec(&client->dev); |
681 | kfree(i2c_get_clientdata(client)); | ||
682 | return 0; | 680 | return 0; |
683 | } | 681 | } |
684 | 682 | ||
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index 984b14bcb60..3feee569cee 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/platform_device.h> | ||
26 | #include <sound/core.h> | 25 | #include <sound/core.h> |
27 | #include <sound/pcm.h> | 26 | #include <sound/pcm.h> |
28 | #include <sound/pcm_params.h> | 27 | #include <sound/pcm_params.h> |
@@ -100,7 +99,7 @@ static const unsigned int boost_tlv[] = { | |||
100 | }; | 99 | }; |
101 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); | 100 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); |
102 | 101 | ||
103 | static const struct snd_kcontrol_new rt5621_vol_snd_controls[] = { | 102 | static const struct snd_kcontrol_new alc5621_vol_snd_controls[] = { |
104 | SOC_DOUBLE_TLV("Speaker Playback Volume", | 103 | SOC_DOUBLE_TLV("Speaker Playback Volume", |
105 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 104 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
106 | SOC_DOUBLE("Speaker Playback Switch", | 105 | SOC_DOUBLE("Speaker Playback Switch", |
@@ -111,7 +110,7 @@ static const struct snd_kcontrol_new rt5621_vol_snd_controls[] = { | |||
111 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), | 110 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), |
112 | }; | 111 | }; |
113 | 112 | ||
114 | static const struct snd_kcontrol_new rt5622_vol_snd_controls[] = { | 113 | static const struct snd_kcontrol_new alc5622_vol_snd_controls[] = { |
115 | SOC_DOUBLE_TLV("Speaker Playback Volume", | 114 | SOC_DOUBLE_TLV("Speaker Playback Volume", |
116 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 115 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
117 | SOC_DOUBLE("Speaker Playback Switch", | 116 | SOC_DOUBLE("Speaker Playback Switch", |
@@ -839,7 +838,7 @@ static int alc5623_set_bias_level(struct snd_soc_codec *codec, | |||
839 | | SNDRV_PCM_FMTBIT_S24_LE \ | 838 | | SNDRV_PCM_FMTBIT_S24_LE \ |
840 | | SNDRV_PCM_FMTBIT_S32_LE) | 839 | | SNDRV_PCM_FMTBIT_S32_LE) |
841 | 840 | ||
842 | static struct snd_soc_dai_ops alc5623_dai_ops = { | 841 | static const struct snd_soc_dai_ops alc5623_dai_ops = { |
843 | .hw_params = alc5623_pcm_hw_params, | 842 | .hw_params = alc5623_pcm_hw_params, |
844 | .digital_mute = alc5623_mute, | 843 | .digital_mute = alc5623_mute, |
845 | .set_fmt = alc5623_set_dai_fmt, | 844 | .set_fmt = alc5623_set_dai_fmt, |
@@ -869,7 +868,7 @@ static struct snd_soc_dai_driver alc5623_dai = { | |||
869 | .ops = &alc5623_dai_ops, | 868 | .ops = &alc5623_dai_ops, |
870 | }; | 869 | }; |
871 | 870 | ||
872 | static int alc5623_suspend(struct snd_soc_codec *codec, pm_message_t mesg) | 871 | static int alc5623_suspend(struct snd_soc_codec *codec) |
873 | { | 872 | { |
874 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); | 873 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); |
875 | return 0; | 874 | return 0; |
@@ -926,12 +925,12 @@ static int alc5623_probe(struct snd_soc_codec *codec) | |||
926 | 925 | ||
927 | switch (alc5623->id) { | 926 | switch (alc5623->id) { |
928 | case 0x21: | 927 | case 0x21: |
929 | snd_soc_add_controls(codec, rt5621_vol_snd_controls, | 928 | snd_soc_add_controls(codec, alc5621_vol_snd_controls, |
930 | ARRAY_SIZE(rt5621_vol_snd_controls)); | 929 | ARRAY_SIZE(alc5621_vol_snd_controls)); |
931 | break; | 930 | break; |
932 | case 0x22: | 931 | case 0x22: |
933 | snd_soc_add_controls(codec, rt5622_vol_snd_controls, | 932 | snd_soc_add_controls(codec, alc5622_vol_snd_controls, |
934 | ARRAY_SIZE(rt5622_vol_snd_controls)); | 933 | ARRAY_SIZE(alc5622_vol_snd_controls)); |
935 | break; | 934 | break; |
936 | case 0x23: | 935 | case 0x23: |
937 | snd_soc_add_controls(codec, alc5623_vol_snd_controls, | 936 | snd_soc_add_controls(codec, alc5623_vol_snd_controls, |
@@ -1023,7 +1022,8 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1023 | 1022 | ||
1024 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); | 1023 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); |
1025 | 1024 | ||
1026 | alc5623 = kzalloc(sizeof(struct alc5623_priv), GFP_KERNEL); | 1025 | alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv), |
1026 | GFP_KERNEL); | ||
1027 | if (alc5623 == NULL) | 1027 | if (alc5623 == NULL) |
1028 | return -ENOMEM; | 1028 | return -ENOMEM; |
1029 | 1029 | ||
@@ -1045,7 +1045,6 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1045 | alc5623_dai.name = "alc5623-hifi"; | 1045 | alc5623_dai.name = "alc5623-hifi"; |
1046 | break; | 1046 | break; |
1047 | default: | 1047 | default: |
1048 | kfree(alc5623); | ||
1049 | return -EINVAL; | 1048 | return -EINVAL; |
1050 | } | 1049 | } |
1051 | 1050 | ||
@@ -1054,20 +1053,15 @@ static int alc5623_i2c_probe(struct i2c_client *client, | |||
1054 | 1053 | ||
1055 | ret = snd_soc_register_codec(&client->dev, | 1054 | ret = snd_soc_register_codec(&client->dev, |
1056 | &soc_codec_device_alc5623, &alc5623_dai, 1); | 1055 | &soc_codec_device_alc5623, &alc5623_dai, 1); |
1057 | if (ret != 0) { | 1056 | if (ret != 0) |
1058 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | 1057 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); |
1059 | kfree(alc5623); | ||
1060 | } | ||
1061 | 1058 | ||
1062 | return ret; | 1059 | return ret; |
1063 | } | 1060 | } |
1064 | 1061 | ||
1065 | static int alc5623_i2c_remove(struct i2c_client *client) | 1062 | static int alc5623_i2c_remove(struct i2c_client *client) |
1066 | { | 1063 | { |
1067 | struct alc5623_priv *alc5623 = i2c_get_clientdata(client); | ||
1068 | |||
1069 | snd_soc_unregister_codec(&client->dev); | 1064 | snd_soc_unregister_codec(&client->dev); |
1070 | kfree(alc5623); | ||
1071 | return 0; | 1065 | return 0; |
1072 | } | 1066 | } |
1073 | 1067 | ||
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c new file mode 100644 index 00000000000..390e437d7c5 --- /dev/null +++ b/sound/soc/codecs/alc5632.c | |||
@@ -0,0 +1,1159 @@ | |||
1 | /* | ||
2 | * alc5632.c -- ALC5632 ALSA SoC Audio Codec | ||
3 | * | ||
4 | * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net> | ||
5 | * | ||
6 | * Authors: Leon Romanovsky <leon@leon.nu> | ||
7 | * Andrey Danin <danindrey@mail.ru> | ||
8 | * Ilya Petrov <ilya.muromec@gmail.com> | ||
9 | * Marc Dietrich <marvin24@gmx.de> | ||
10 | * | ||
11 | * Based on alc5623.c by Arnaud Patard | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #include <linux/module.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/delay.h> | ||
22 | #include <linux/pm.h> | ||
23 | #include <linux/i2c.h> | ||
24 | #include <linux/slab.h> | ||
25 | #include <linux/regmap.h> | ||
26 | #include <sound/core.h> | ||
27 | #include <sound/pcm.h> | ||
28 | #include <sound/pcm_params.h> | ||
29 | #include <sound/tlv.h> | ||
30 | #include <sound/soc.h> | ||
31 | #include <sound/initval.h> | ||
32 | |||
33 | #include "alc5632.h" | ||
34 | |||
35 | /* | ||
36 | * ALC5632 register cache | ||
37 | */ | ||
38 | static struct reg_default alc5632_reg_defaults[] = { | ||
39 | { 2, 0x8080 }, /* R2 - Speaker Output Volume */ | ||
40 | { 4, 0x8080 }, /* R4 - Headphone Output Volume */ | ||
41 | { 6, 0x8080 }, /* R6 - AUXOUT Volume */ | ||
42 | { 8, 0xC800 }, /* R8 - Phone Input */ | ||
43 | { 10, 0xE808 }, /* R10 - LINE_IN Volume */ | ||
44 | { 12, 0x1010 }, /* R12 - STEREO DAC Input Volume */ | ||
45 | { 14, 0x0808 }, /* R14 - MIC Input Volume */ | ||
46 | { 16, 0xEE0F }, /* R16 - Stereo DAC and MIC Routing Control */ | ||
47 | { 18, 0xCBCB }, /* R18 - ADC Record Gain */ | ||
48 | { 20, 0x7F7F }, /* R20 - ADC Record Mixer Control */ | ||
49 | { 24, 0xE010 }, /* R24 - Voice DAC Volume */ | ||
50 | { 28, 0x8008 }, /* R28 - Output Mixer Control */ | ||
51 | { 34, 0x0000 }, /* R34 - Microphone Control */ | ||
52 | { 36, 0x00C0 }, /* R36 - Codec Digital MIC/Digital Boost | ||
53 | Control */ | ||
54 | { 46, 0x0000 }, /* R46 - Stereo DAC/Voice DAC/Stereo ADC | ||
55 | Function Select */ | ||
56 | { 52, 0x8000 }, /* R52 - Main Serial Data Port Control | ||
57 | (Stereo I2S) */ | ||
58 | { 54, 0x0000 }, /* R54 - Extend Serial Data Port Control | ||
59 | (VoDAC_I2S/PCM) */ | ||
60 | { 58, 0x0000 }, /* R58 - Power Management Addition 1 */ | ||
61 | { 60, 0x0000 }, /* R60 - Power Management Addition 2 */ | ||
62 | { 62, 0x8000 }, /* R62 - Power Management Addition 3 */ | ||
63 | { 64, 0x0C0A }, /* R64 - General Purpose Control Register 1 */ | ||
64 | { 66, 0x0000 }, /* R66 - General Purpose Control Register 2 */ | ||
65 | { 68, 0x0000 }, /* R68 - PLL1 Control */ | ||
66 | { 70, 0x0000 }, /* R70 - PLL2 Control */ | ||
67 | { 76, 0xBE3E }, /* R76 - GPIO Pin Configuration */ | ||
68 | { 78, 0xBE3E }, /* R78 - GPIO Pin Polarity */ | ||
69 | { 80, 0x0000 }, /* R80 - GPIO Pin Sticky */ | ||
70 | { 82, 0x0000 }, /* R82 - GPIO Pin Wake Up */ | ||
71 | { 86, 0x0000 }, /* R86 - Pin Sharing */ | ||
72 | { 90, 0x0009 }, /* R90 - Soft Volume Control Setting */ | ||
73 | { 92, 0x0000 }, /* R92 - GPIO_Output Pin Control */ | ||
74 | { 94, 0x3000 }, /* R94 - MISC Control */ | ||
75 | { 96, 0x3075 }, /* R96 - Stereo DAC Clock Control_1 */ | ||
76 | { 98, 0x1010 }, /* R98 - Stereo DAC Clock Control_2 */ | ||
77 | { 100, 0x3110 }, /* R100 - VoDAC_PCM Clock Control_1 */ | ||
78 | { 104, 0x0553 }, /* R104 - Pseudo Stereo and Spatial Effect | ||
79 | Block Control */ | ||
80 | { 106, 0x0000 }, /* R106 - Private Register Address */ | ||
81 | }; | ||
82 | |||
83 | /* codec private data */ | ||
84 | struct alc5632_priv { | ||
85 | struct regmap *regmap; | ||
86 | u8 id; | ||
87 | unsigned int sysclk; | ||
88 | }; | ||
89 | |||
90 | static bool alc5632_volatile_register(struct device *dev, | ||
91 | unsigned int reg) | ||
92 | { | ||
93 | switch (reg) { | ||
94 | case ALC5632_RESET: | ||
95 | case ALC5632_PWR_DOWN_CTRL_STATUS: | ||
96 | case ALC5632_GPIO_PIN_STATUS: | ||
97 | case ALC5632_OVER_CURR_STATUS: | ||
98 | case ALC5632_HID_CTRL_DATA: | ||
99 | case ALC5632_EQ_CTRL: | ||
100 | case ALC5632_VENDOR_ID1: | ||
101 | case ALC5632_VENDOR_ID2: | ||
102 | return true; | ||
103 | |||
104 | default: | ||
105 | break; | ||
106 | } | ||
107 | |||
108 | return false; | ||
109 | } | ||
110 | |||
111 | static inline int alc5632_reset(struct regmap *map) | ||
112 | { | ||
113 | return regmap_write(map, ALC5632_RESET, 0x59B4); | ||
114 | } | ||
115 | |||
116 | static int amp_mixer_event(struct snd_soc_dapm_widget *w, | ||
117 | struct snd_kcontrol *kcontrol, int event) | ||
118 | { | ||
119 | /* to power-on/off class-d amp generators/speaker */ | ||
120 | /* need to write to 'index-46h' register : */ | ||
121 | /* so write index num (here 0x46) to reg 0x6a */ | ||
122 | /* and then 0xffff/0 to reg 0x6c */ | ||
123 | snd_soc_write(w->codec, ALC5632_HID_CTRL_INDEX, 0x46); | ||
124 | |||
125 | switch (event) { | ||
126 | case SND_SOC_DAPM_PRE_PMU: | ||
127 | snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0xFFFF); | ||
128 | break; | ||
129 | case SND_SOC_DAPM_POST_PMD: | ||
130 | snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0); | ||
131 | break; | ||
132 | } | ||
133 | |||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | /* | ||
138 | * ALC5632 Controls | ||
139 | */ | ||
140 | |||
141 | /* -34.5db min scale, 1.5db steps, no mute */ | ||
142 | static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0); | ||
143 | /* -46.5db min scale, 1.5db steps, no mute */ | ||
144 | static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0); | ||
145 | /* -16.5db min scale, 1.5db steps, no mute */ | ||
146 | static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); | ||
147 | static const unsigned int boost_tlv[] = { | ||
148 | TLV_DB_RANGE_HEAD(3), | ||
149 | 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), | ||
150 | 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), | ||
151 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), | ||
152 | }; | ||
153 | /* 0db min scale, 6 db steps, no mute */ | ||
154 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); | ||
155 | /* 0db min scalem 0.75db steps, no mute */ | ||
156 | static const DECLARE_TLV_DB_SCALE(vdac_tlv, -3525, 075, 0); | ||
157 | |||
158 | static const struct snd_kcontrol_new alc5632_vol_snd_controls[] = { | ||
159 | /* left starts at bit 8, right at bit 0 */ | ||
160 | /* 31 steps (5 bit), -46.5db scale */ | ||
161 | SOC_DOUBLE_TLV("Speaker Playback Volume", | ||
162 | ALC5632_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | ||
163 | /* bit 15 mutes left, bit 7 right */ | ||
164 | SOC_DOUBLE("Speaker Playback Switch", | ||
165 | ALC5632_SPK_OUT_VOL, 15, 7, 1, 1), | ||
166 | SOC_DOUBLE_TLV("Headphone Playback Volume", | ||
167 | ALC5632_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), | ||
168 | SOC_DOUBLE("Headphone Playback Switch", | ||
169 | ALC5632_HP_OUT_VOL, 15, 7, 1, 1), | ||
170 | }; | ||
171 | |||
172 | static const struct snd_kcontrol_new alc5632_snd_controls[] = { | ||
173 | SOC_DOUBLE_TLV("Auxout Playback Volume", | ||
174 | ALC5632_AUX_OUT_VOL, 8, 0, 31, 1, hp_tlv), | ||
175 | SOC_DOUBLE("Auxout Playback Switch", | ||
176 | ALC5632_AUX_OUT_VOL, 15, 7, 1, 1), | ||
177 | SOC_SINGLE_TLV("Voice DAC Playback Volume", | ||
178 | ALC5632_VOICE_DAC_VOL, 0, 63, 0, vdac_tlv), | ||
179 | SOC_SINGLE_TLV("Phone Capture Volume", | ||
180 | ALC5632_PHONE_IN_VOL, 8, 31, 1, vol_tlv), | ||
181 | SOC_DOUBLE_TLV("LineIn Capture Volume", | ||
182 | ALC5632_LINE_IN_VOL, 8, 0, 31, 1, vol_tlv), | ||
183 | SOC_DOUBLE_TLV("Master Playback Volume", | ||
184 | ALC5632_STEREO_DAC_IN_VOL, 8, 0, 63, 1, vdac_tlv), | ||
185 | SOC_DOUBLE("Master Playback Switch", | ||
186 | ALC5632_STEREO_DAC_IN_VOL, 15, 7, 1, 1), | ||
187 | SOC_SINGLE_TLV("Mic1 Capture Volume", | ||
188 | ALC5632_MIC_VOL, 8, 31, 1, vol_tlv), | ||
189 | SOC_SINGLE_TLV("Mic2 Capture Volume", | ||
190 | ALC5632_MIC_VOL, 0, 31, 1, vol_tlv), | ||
191 | SOC_DOUBLE_TLV("Rec Capture Volume", | ||
192 | ALC5632_ADC_REC_GAIN, 8, 0, 31, 0, adc_rec_tlv), | ||
193 | SOC_SINGLE_TLV("Mic 1 Boost Volume", | ||
194 | ALC5632_MIC_CTRL, 10, 2, 0, boost_tlv), | ||
195 | SOC_SINGLE_TLV("Mic 2 Boost Volume", | ||
196 | ALC5632_MIC_CTRL, 8, 2, 0, boost_tlv), | ||
197 | SOC_SINGLE_TLV("Digital Boost Volume", | ||
198 | ALC5632_DIGI_BOOST_CTRL, 0, 7, 0, dig_tlv), | ||
199 | }; | ||
200 | |||
201 | /* | ||
202 | * DAPM Controls | ||
203 | */ | ||
204 | static const struct snd_kcontrol_new alc5632_hp_mixer_controls[] = { | ||
205 | SOC_DAPM_SINGLE("LI2HP Playback Switch", ALC5632_LINE_IN_VOL, 15, 1, 1), | ||
206 | SOC_DAPM_SINGLE("PHONE2HP Playback Switch", ALC5632_PHONE_IN_VOL, 15, 1, 1), | ||
207 | SOC_DAPM_SINGLE("MIC12HP Playback Switch", ALC5632_MIC_ROUTING_CTRL, 15, 1, 1), | ||
208 | SOC_DAPM_SINGLE("MIC22HP Playback Switch", ALC5632_MIC_ROUTING_CTRL, 11, 1, 1), | ||
209 | SOC_DAPM_SINGLE("VOICE2HP Playback Switch", ALC5632_VOICE_DAC_VOL, 15, 1, 1), | ||
210 | }; | ||
211 | |||
212 | static const struct snd_kcontrol_new alc5632_hpl_mixer_controls[] = { | ||
213 | SOC_DAPM_SINGLE("ADC2HP_L Playback Switch", ALC5632_ADC_REC_GAIN, 15, 1, 1), | ||
214 | SOC_DAPM_SINGLE("DACL2HP Playback Switch", ALC5632_MIC_ROUTING_CTRL, 3, 1, 1), | ||
215 | }; | ||
216 | |||
217 | static const struct snd_kcontrol_new alc5632_hpr_mixer_controls[] = { | ||
218 | SOC_DAPM_SINGLE("ADC2HP_R Playback Switch", ALC5632_ADC_REC_GAIN, 7, 1, 1), | ||
219 | SOC_DAPM_SINGLE("DACR2HP Playback Switch", ALC5632_MIC_ROUTING_CTRL, 2, 1, 1), | ||
220 | }; | ||
221 | |||
222 | static const struct snd_kcontrol_new alc5632_mono_mixer_controls[] = { | ||
223 | SOC_DAPM_SINGLE("ADC2MONO_L Playback Switch", ALC5632_ADC_REC_GAIN, 14, 1, 1), | ||
224 | SOC_DAPM_SINGLE("ADC2MONO_R Playback Switch", ALC5632_ADC_REC_GAIN, 6, 1, 1), | ||
225 | SOC_DAPM_SINGLE("LI2MONO Playback Switch", ALC5632_LINE_IN_VOL, 13, 1, 1), | ||
226 | SOC_DAPM_SINGLE("MIC12MONO Playback Switch", | ||
227 | ALC5632_MIC_ROUTING_CTRL, 13, 1, 1), | ||
228 | SOC_DAPM_SINGLE("MIC22MONO Playback Switch", | ||
229 | ALC5632_MIC_ROUTING_CTRL, 9, 1, 1), | ||
230 | SOC_DAPM_SINGLE("DAC2MONO Playback Switch", ALC5632_MIC_ROUTING_CTRL, 0, 1, 1), | ||
231 | SOC_DAPM_SINGLE("VOICE2MONO Playback Switch", ALC5632_VOICE_DAC_VOL, 13, 1, 1), | ||
232 | }; | ||
233 | |||
234 | static const struct snd_kcontrol_new alc5632_speaker_mixer_controls[] = { | ||
235 | SOC_DAPM_SINGLE("LI2SPK Playback Switch", ALC5632_LINE_IN_VOL, 14, 1, 1), | ||
236 | SOC_DAPM_SINGLE("PHONE2SPK Playback Switch", ALC5632_PHONE_IN_VOL, 14, 1, 1), | ||
237 | SOC_DAPM_SINGLE("MIC12SPK Playback Switch", | ||
238 | ALC5632_MIC_ROUTING_CTRL, 14, 1, 1), | ||
239 | SOC_DAPM_SINGLE("MIC22SPK Playback Switch", | ||
240 | ALC5632_MIC_ROUTING_CTRL, 10, 1, 1), | ||
241 | SOC_DAPM_SINGLE("DAC2SPK Playback Switch", ALC5632_MIC_ROUTING_CTRL, 1, 1, 1), | ||
242 | SOC_DAPM_SINGLE("VOICE2SPK Playback Switch", ALC5632_VOICE_DAC_VOL, 14, 1, 1), | ||
243 | }; | ||
244 | |||
245 | /* Left Record Mixer */ | ||
246 | static const struct snd_kcontrol_new alc5632_captureL_mixer_controls[] = { | ||
247 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5632_ADC_REC_MIXER, 14, 1, 1), | ||
248 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5632_ADC_REC_MIXER, 13, 1, 1), | ||
249 | SOC_DAPM_SINGLE("LineInL Capture Switch", ALC5632_ADC_REC_MIXER, 12, 1, 1), | ||
250 | SOC_DAPM_SINGLE("Left Phone Capture Switch", ALC5632_ADC_REC_MIXER, 11, 1, 1), | ||
251 | SOC_DAPM_SINGLE("HPMixerL Capture Switch", ALC5632_ADC_REC_MIXER, 10, 1, 1), | ||
252 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5632_ADC_REC_MIXER, 9, 1, 1), | ||
253 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5632_ADC_REC_MIXER, 8, 1, 1), | ||
254 | }; | ||
255 | |||
256 | /* Right Record Mixer */ | ||
257 | static const struct snd_kcontrol_new alc5632_captureR_mixer_controls[] = { | ||
258 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5632_ADC_REC_MIXER, 6, 1, 1), | ||
259 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5632_ADC_REC_MIXER, 5, 1, 1), | ||
260 | SOC_DAPM_SINGLE("LineInR Capture Switch", ALC5632_ADC_REC_MIXER, 4, 1, 1), | ||
261 | SOC_DAPM_SINGLE("Right Phone Capture Switch", ALC5632_ADC_REC_MIXER, 3, 1, 1), | ||
262 | SOC_DAPM_SINGLE("HPMixerR Capture Switch", ALC5632_ADC_REC_MIXER, 2, 1, 1), | ||
263 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5632_ADC_REC_MIXER, 1, 1, 1), | ||
264 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5632_ADC_REC_MIXER, 0, 1, 1), | ||
265 | }; | ||
266 | |||
267 | static const char *alc5632_spk_n_sour_sel[] = { | ||
268 | "RN/-R", "RP/+R", "LN/-R", "Mute"}; | ||
269 | static const char *alc5632_hpl_out_input_sel[] = { | ||
270 | "Vmid", "HP Left Mix"}; | ||
271 | static const char *alc5632_hpr_out_input_sel[] = { | ||
272 | "Vmid", "HP Right Mix"}; | ||
273 | static const char *alc5632_spkout_input_sel[] = { | ||
274 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | ||
275 | static const char *alc5632_aux_out_input_sel[] = { | ||
276 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | ||
277 | |||
278 | /* auxout output mux */ | ||
279 | static const struct soc_enum alc5632_aux_out_input_enum = | ||
280 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 6, 4, alc5632_aux_out_input_sel); | ||
281 | static const struct snd_kcontrol_new alc5632_auxout_mux_controls = | ||
282 | SOC_DAPM_ENUM("AuxOut Mux", alc5632_aux_out_input_enum); | ||
283 | |||
284 | /* speaker output mux */ | ||
285 | static const struct soc_enum alc5632_spkout_input_enum = | ||
286 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 10, 4, alc5632_spkout_input_sel); | ||
287 | static const struct snd_kcontrol_new alc5632_spkout_mux_controls = | ||
288 | SOC_DAPM_ENUM("SpeakerOut Mux", alc5632_spkout_input_enum); | ||
289 | |||
290 | /* headphone left output mux */ | ||
291 | static const struct soc_enum alc5632_hpl_out_input_enum = | ||
292 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 9, 2, alc5632_hpl_out_input_sel); | ||
293 | static const struct snd_kcontrol_new alc5632_hpl_out_mux_controls = | ||
294 | SOC_DAPM_ENUM("Left Headphone Mux", alc5632_hpl_out_input_enum); | ||
295 | |||
296 | /* headphone right output mux */ | ||
297 | static const struct soc_enum alc5632_hpr_out_input_enum = | ||
298 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 8, 2, alc5632_hpr_out_input_sel); | ||
299 | static const struct snd_kcontrol_new alc5632_hpr_out_mux_controls = | ||
300 | SOC_DAPM_ENUM("Right Headphone Mux", alc5632_hpr_out_input_enum); | ||
301 | |||
302 | /* speaker output N select */ | ||
303 | static const struct soc_enum alc5632_spk_n_sour_enum = | ||
304 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 14, 4, alc5632_spk_n_sour_sel); | ||
305 | static const struct snd_kcontrol_new alc5632_spkoutn_mux_controls = | ||
306 | SOC_DAPM_ENUM("SpeakerOut N Mux", alc5632_spk_n_sour_enum); | ||
307 | |||
308 | /* speaker amplifier */ | ||
309 | static const char *alc5632_amp_names[] = {"AB Amp", "D Amp"}; | ||
310 | static const struct soc_enum alc5632_amp_enum = | ||
311 | SOC_ENUM_SINGLE(ALC5632_OUTPUT_MIXER_CTRL, 13, 2, alc5632_amp_names); | ||
312 | static const struct snd_kcontrol_new alc5632_amp_mux_controls = | ||
313 | SOC_DAPM_ENUM("AB-D Amp Mux", alc5632_amp_enum); | ||
314 | |||
315 | |||
316 | static const struct snd_soc_dapm_widget alc5632_dapm_widgets[] = { | ||
317 | /* Muxes */ | ||
318 | SND_SOC_DAPM_MUX("AuxOut Mux", SND_SOC_NOPM, 0, 0, | ||
319 | &alc5632_auxout_mux_controls), | ||
320 | SND_SOC_DAPM_MUX("SpeakerOut Mux", SND_SOC_NOPM, 0, 0, | ||
321 | &alc5632_spkout_mux_controls), | ||
322 | SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, | ||
323 | &alc5632_hpl_out_mux_controls), | ||
324 | SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, | ||
325 | &alc5632_hpr_out_mux_controls), | ||
326 | SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, | ||
327 | &alc5632_spkoutn_mux_controls), | ||
328 | |||
329 | /* output mixers */ | ||
330 | SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0, | ||
331 | &alc5632_hp_mixer_controls[0], | ||
332 | ARRAY_SIZE(alc5632_hp_mixer_controls)), | ||
333 | SND_SOC_DAPM_MIXER("HPR Mix", ALC5632_PWR_MANAG_ADD2, 4, 0, | ||
334 | &alc5632_hpr_mixer_controls[0], | ||
335 | ARRAY_SIZE(alc5632_hpr_mixer_controls)), | ||
336 | SND_SOC_DAPM_MIXER("HPL Mix", ALC5632_PWR_MANAG_ADD2, 5, 0, | ||
337 | &alc5632_hpl_mixer_controls[0], | ||
338 | ARRAY_SIZE(alc5632_hpl_mixer_controls)), | ||
339 | SND_SOC_DAPM_MIXER("HPOut Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
340 | SND_SOC_DAPM_MIXER("Mono Mix", ALC5632_PWR_MANAG_ADD2, 2, 0, | ||
341 | &alc5632_mono_mixer_controls[0], | ||
342 | ARRAY_SIZE(alc5632_mono_mixer_controls)), | ||
343 | SND_SOC_DAPM_MIXER("Speaker Mix", ALC5632_PWR_MANAG_ADD2, 3, 0, | ||
344 | &alc5632_speaker_mixer_controls[0], | ||
345 | ARRAY_SIZE(alc5632_speaker_mixer_controls)), | ||
346 | |||
347 | /* input mixers */ | ||
348 | SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5632_PWR_MANAG_ADD2, 1, 0, | ||
349 | &alc5632_captureL_mixer_controls[0], | ||
350 | ARRAY_SIZE(alc5632_captureL_mixer_controls)), | ||
351 | SND_SOC_DAPM_MIXER("Right Capture Mix", ALC5632_PWR_MANAG_ADD2, 0, 0, | ||
352 | &alc5632_captureR_mixer_controls[0], | ||
353 | ARRAY_SIZE(alc5632_captureR_mixer_controls)), | ||
354 | |||
355 | SND_SOC_DAPM_DAC("Left DAC", "HiFi Playback", | ||
356 | ALC5632_PWR_MANAG_ADD2, 9, 0), | ||
357 | SND_SOC_DAPM_DAC("Right DAC", "HiFi Playback", | ||
358 | ALC5632_PWR_MANAG_ADD2, 8, 0), | ||
359 | SND_SOC_DAPM_MIXER("DAC Left Channel", ALC5632_PWR_MANAG_ADD1, 15, 0, NULL, 0), | ||
360 | SND_SOC_DAPM_MIXER("DAC Right Channel", | ||
361 | ALC5632_PWR_MANAG_ADD1, 14, 0, NULL, 0), | ||
362 | SND_SOC_DAPM_MIXER("I2S Mix", ALC5632_PWR_MANAG_ADD1, 11, 0, NULL, 0), | ||
363 | SND_SOC_DAPM_MIXER("Phone Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
364 | SND_SOC_DAPM_MIXER("Line Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
365 | SND_SOC_DAPM_ADC("Left ADC", "HiFi Capture", | ||
366 | ALC5632_PWR_MANAG_ADD2, 7, 0), | ||
367 | SND_SOC_DAPM_ADC("Right ADC", "HiFi Capture", | ||
368 | ALC5632_PWR_MANAG_ADD2, 6, 0), | ||
369 | SND_SOC_DAPM_PGA("Left Headphone", ALC5632_PWR_MANAG_ADD3, 11, 0, NULL, 0), | ||
370 | SND_SOC_DAPM_PGA("Right Headphone", ALC5632_PWR_MANAG_ADD3, 10, 0, NULL, 0), | ||
371 | SND_SOC_DAPM_PGA("Left Speaker", ALC5632_PWR_MANAG_ADD3, 13, 0, NULL, 0), | ||
372 | SND_SOC_DAPM_PGA("Right Speaker", ALC5632_PWR_MANAG_ADD3, 12, 0, NULL, 0), | ||
373 | SND_SOC_DAPM_PGA("Aux Out", ALC5632_PWR_MANAG_ADD3, 14, 0, NULL, 0), | ||
374 | SND_SOC_DAPM_PGA("Left LineIn", ALC5632_PWR_MANAG_ADD3, 7, 0, NULL, 0), | ||
375 | SND_SOC_DAPM_PGA("Right LineIn", ALC5632_PWR_MANAG_ADD3, 6, 0, NULL, 0), | ||
376 | SND_SOC_DAPM_PGA("Phone", ALC5632_PWR_MANAG_ADD3, 5, 0, NULL, 0), | ||
377 | SND_SOC_DAPM_PGA("Phone ADMix", ALC5632_PWR_MANAG_ADD3, 4, 0, NULL, 0), | ||
378 | SND_SOC_DAPM_PGA("MIC1 PGA", ALC5632_PWR_MANAG_ADD3, 3, 0, NULL, 0), | ||
379 | SND_SOC_DAPM_PGA("MIC2 PGA", ALC5632_PWR_MANAG_ADD3, 2, 0, NULL, 0), | ||
380 | SND_SOC_DAPM_PGA("MIC1 Pre Amp", ALC5632_PWR_MANAG_ADD3, 1, 0, NULL, 0), | ||
381 | SND_SOC_DAPM_PGA("MIC2 Pre Amp", ALC5632_PWR_MANAG_ADD3, 0, 0, NULL, 0), | ||
382 | SND_SOC_DAPM_SUPPLY("MICBIAS1", ALC5632_PWR_MANAG_ADD1, 3, 0, NULL, 0), | ||
383 | SND_SOC_DAPM_SUPPLY("MICBIAS2", ALC5632_PWR_MANAG_ADD1, 2, 0, NULL, 0), | ||
384 | |||
385 | SND_SOC_DAPM_PGA_E("D Amp", ALC5632_PWR_MANAG_ADD2, 14, 0, NULL, 0, | ||
386 | amp_mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | ||
387 | SND_SOC_DAPM_PGA("AB Amp", ALC5632_PWR_MANAG_ADD2, 15, 0, NULL, 0), | ||
388 | SND_SOC_DAPM_MUX("AB-D Amp Mux", ALC5632_PWR_MANAG_ADD1, 10, 0, | ||
389 | &alc5632_amp_mux_controls), | ||
390 | |||
391 | SND_SOC_DAPM_OUTPUT("AUXOUT"), | ||
392 | SND_SOC_DAPM_OUTPUT("HPL"), | ||
393 | SND_SOC_DAPM_OUTPUT("HPR"), | ||
394 | SND_SOC_DAPM_OUTPUT("SPKOUT"), | ||
395 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | ||
396 | SND_SOC_DAPM_INPUT("LINEINL"), | ||
397 | SND_SOC_DAPM_INPUT("LINEINR"), | ||
398 | SND_SOC_DAPM_INPUT("PHONEP"), | ||
399 | SND_SOC_DAPM_INPUT("PHONEN"), | ||
400 | SND_SOC_DAPM_INPUT("MIC1"), | ||
401 | SND_SOC_DAPM_INPUT("MIC2"), | ||
402 | SND_SOC_DAPM_VMID("Vmid"), | ||
403 | }; | ||
404 | |||
405 | |||
406 | static const struct snd_soc_dapm_route alc5632_dapm_routes[] = { | ||
407 | /* virtual mixer - mixes left & right channels */ | ||
408 | {"I2S Mix", NULL, "Left DAC"}, | ||
409 | {"I2S Mix", NULL, "Right DAC"}, | ||
410 | {"Line Mix", NULL, "Right LineIn"}, | ||
411 | {"Line Mix", NULL, "Left LineIn"}, | ||
412 | {"Phone Mix", NULL, "Phone"}, | ||
413 | {"Phone Mix", NULL, "Phone ADMix"}, | ||
414 | {"AUXOUT", NULL, "Aux Out"}, | ||
415 | |||
416 | /* DAC */ | ||
417 | {"DAC Right Channel", NULL, "I2S Mix"}, | ||
418 | {"DAC Left Channel", NULL, "I2S Mix"}, | ||
419 | |||
420 | /* HP mixer */ | ||
421 | {"HPL Mix", "ADC2HP_L Playback Switch", "Left Capture Mix"}, | ||
422 | {"HPL Mix", NULL, "HP Mix"}, | ||
423 | {"HPR Mix", "ADC2HP_R Playback Switch", "Right Capture Mix"}, | ||
424 | {"HPR Mix", NULL, "HP Mix"}, | ||
425 | {"HP Mix", "LI2HP Playback Switch", "Line Mix"}, | ||
426 | {"HP Mix", "PHONE2HP Playback Switch", "Phone Mix"}, | ||
427 | {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, | ||
428 | {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, | ||
429 | |||
430 | {"HPR Mix", "DACR2HP Playback Switch", "DAC Right Channel"}, | ||
431 | {"HPL Mix", "DACL2HP Playback Switch", "DAC Left Channel"}, | ||
432 | |||
433 | /* speaker mixer */ | ||
434 | {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"}, | ||
435 | {"Speaker Mix", "PHONE2SPK Playback Switch", "Phone Mix"}, | ||
436 | {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, | ||
437 | {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, | ||
438 | {"Speaker Mix", "DAC2SPK Playback Switch", "DAC Left Channel"}, | ||
439 | |||
440 | |||
441 | |||
442 | /* mono mixer */ | ||
443 | {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, | ||
444 | {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, | ||
445 | {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, | ||
446 | {"Mono Mix", "VOICE2MONO Playback Switch", "Phone Mix"}, | ||
447 | {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, | ||
448 | {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, | ||
449 | {"Mono Mix", "DAC2MONO Playback Switch", "DAC Left Channel"}, | ||
450 | |||
451 | /* Left record mixer */ | ||
452 | {"Left Capture Mix", "LineInL Capture Switch", "LINEINL"}, | ||
453 | {"Left Capture Mix", "Left Phone Capture Switch", "PHONEN"}, | ||
454 | {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | ||
455 | {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | ||
456 | {"Left Capture Mix", "HPMixerL Capture Switch", "HPL Mix"}, | ||
457 | {"Left Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | ||
458 | {"Left Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | ||
459 | |||
460 | /*Right record mixer */ | ||
461 | {"Right Capture Mix", "LineInR Capture Switch", "LINEINR"}, | ||
462 | {"Right Capture Mix", "Right Phone Capture Switch", "PHONEP"}, | ||
463 | {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | ||
464 | {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | ||
465 | {"Right Capture Mix", "HPMixerR Capture Switch", "HPR Mix"}, | ||
466 | {"Right Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | ||
467 | {"Right Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | ||
468 | |||
469 | /* headphone left mux */ | ||
470 | {"Left Headphone Mux", "HP Left Mix", "HPL Mix"}, | ||
471 | {"Left Headphone Mux", "Vmid", "Vmid"}, | ||
472 | |||
473 | /* headphone right mux */ | ||
474 | {"Right Headphone Mux", "HP Right Mix", "HPR Mix"}, | ||
475 | {"Right Headphone Mux", "Vmid", "Vmid"}, | ||
476 | |||
477 | /* speaker out mux */ | ||
478 | {"SpeakerOut Mux", "Vmid", "Vmid"}, | ||
479 | {"SpeakerOut Mux", "HPOut Mix", "HPOut Mix"}, | ||
480 | {"SpeakerOut Mux", "Speaker Mix", "Speaker Mix"}, | ||
481 | {"SpeakerOut Mux", "Mono Mix", "Mono Mix"}, | ||
482 | |||
483 | /* Mono/Aux Out mux */ | ||
484 | {"AuxOut Mux", "Vmid", "Vmid"}, | ||
485 | {"AuxOut Mux", "HPOut Mix", "HPOut Mix"}, | ||
486 | {"AuxOut Mux", "Speaker Mix", "Speaker Mix"}, | ||
487 | {"AuxOut Mux", "Mono Mix", "Mono Mix"}, | ||
488 | |||
489 | /* output pga */ | ||
490 | {"HPL", NULL, "Left Headphone"}, | ||
491 | {"Left Headphone", NULL, "Left Headphone Mux"}, | ||
492 | {"HPR", NULL, "Right Headphone"}, | ||
493 | {"Right Headphone", NULL, "Right Headphone Mux"}, | ||
494 | {"Aux Out", NULL, "AuxOut Mux"}, | ||
495 | |||
496 | /* input pga */ | ||
497 | {"Left LineIn", NULL, "LINEINL"}, | ||
498 | {"Right LineIn", NULL, "LINEINR"}, | ||
499 | {"Phone", NULL, "PHONEP"}, | ||
500 | {"MIC1 Pre Amp", NULL, "MIC1"}, | ||
501 | {"MIC2 Pre Amp", NULL, "MIC2"}, | ||
502 | {"MIC1 PGA", NULL, "MIC1 Pre Amp"}, | ||
503 | {"MIC2 PGA", NULL, "MIC2 Pre Amp"}, | ||
504 | |||
505 | /* left ADC */ | ||
506 | {"Left ADC", NULL, "Left Capture Mix"}, | ||
507 | |||
508 | /* right ADC */ | ||
509 | {"Right ADC", NULL, "Right Capture Mix"}, | ||
510 | |||
511 | {"SpeakerOut N Mux", "RN/-R", "Left Speaker"}, | ||
512 | {"SpeakerOut N Mux", "RP/+R", "Left Speaker"}, | ||
513 | {"SpeakerOut N Mux", "LN/-R", "Left Speaker"}, | ||
514 | {"SpeakerOut N Mux", "Mute", "Vmid"}, | ||
515 | |||
516 | {"SpeakerOut N Mux", "RN/-R", "Right Speaker"}, | ||
517 | {"SpeakerOut N Mux", "RP/+R", "Right Speaker"}, | ||
518 | {"SpeakerOut N Mux", "LN/-R", "Right Speaker"}, | ||
519 | {"SpeakerOut N Mux", "Mute", "Vmid"}, | ||
520 | |||
521 | {"AB Amp", NULL, "SpeakerOut Mux"}, | ||
522 | {"D Amp", NULL, "SpeakerOut Mux"}, | ||
523 | {"AB-D Amp Mux", "AB Amp", "AB Amp"}, | ||
524 | {"AB-D Amp Mux", "D Amp", "D Amp"}, | ||
525 | {"Left Speaker", NULL, "AB-D Amp Mux"}, | ||
526 | {"Right Speaker", NULL, "AB-D Amp Mux"}, | ||
527 | |||
528 | {"SPKOUT", NULL, "Left Speaker"}, | ||
529 | {"SPKOUT", NULL, "Right Speaker"}, | ||
530 | |||
531 | {"SPKOUTN", NULL, "SpeakerOut N Mux"}, | ||
532 | |||
533 | }; | ||
534 | |||
535 | /* PLL divisors */ | ||
536 | struct _pll_div { | ||
537 | u32 pll_in; | ||
538 | u32 pll_out; | ||
539 | u16 regvalue; | ||
540 | }; | ||
541 | |||
542 | /* Note : pll code from original alc5632 driver. Not sure of how good it is */ | ||
543 | /* usefull only for master mode */ | ||
544 | static const struct _pll_div codec_master_pll_div[] = { | ||
545 | |||
546 | { 2048000, 8192000, 0x0ea0}, | ||
547 | { 3686400, 8192000, 0x4e27}, | ||
548 | { 12000000, 8192000, 0x456b}, | ||
549 | { 13000000, 8192000, 0x495f}, | ||
550 | { 13100000, 8192000, 0x0320}, | ||
551 | { 2048000, 11289600, 0xf637}, | ||
552 | { 3686400, 11289600, 0x2f22}, | ||
553 | { 12000000, 11289600, 0x3e2f}, | ||
554 | { 13000000, 11289600, 0x4d5b}, | ||
555 | { 13100000, 11289600, 0x363b}, | ||
556 | { 2048000, 16384000, 0x1ea0}, | ||
557 | { 3686400, 16384000, 0x9e27}, | ||
558 | { 12000000, 16384000, 0x452b}, | ||
559 | { 13000000, 16384000, 0x542f}, | ||
560 | { 13100000, 16384000, 0x03a0}, | ||
561 | { 2048000, 16934400, 0xe625}, | ||
562 | { 3686400, 16934400, 0x9126}, | ||
563 | { 12000000, 16934400, 0x4d2c}, | ||
564 | { 13000000, 16934400, 0x742f}, | ||
565 | { 13100000, 16934400, 0x3c27}, | ||
566 | { 2048000, 22579200, 0x2aa0}, | ||
567 | { 3686400, 22579200, 0x2f20}, | ||
568 | { 12000000, 22579200, 0x7e2f}, | ||
569 | { 13000000, 22579200, 0x742f}, | ||
570 | { 13100000, 22579200, 0x3c27}, | ||
571 | { 2048000, 24576000, 0x2ea0}, | ||
572 | { 3686400, 24576000, 0xee27}, | ||
573 | { 12000000, 24576000, 0x2915}, | ||
574 | { 13000000, 24576000, 0x772e}, | ||
575 | { 13100000, 24576000, 0x0d20}, | ||
576 | }; | ||
577 | |||
578 | /* FOUT = MCLK*(N+2)/((M+2)*(K+2)) | ||
579 | N: bit 15:8 (div 2 .. div 257) | ||
580 | K: bit 6:4 typical 2 | ||
581 | M: bit 3:0 (div 2 .. div 17) | ||
582 | |||
583 | same as for 5623 - thanks! | ||
584 | */ | ||
585 | |||
586 | static const struct _pll_div codec_slave_pll_div[] = { | ||
587 | |||
588 | { 1024000, 16384000, 0x3ea0}, | ||
589 | { 1411200, 22579200, 0x3ea0}, | ||
590 | { 1536000, 24576000, 0x3ea0}, | ||
591 | { 2048000, 16384000, 0x1ea0}, | ||
592 | { 2822400, 22579200, 0x1ea0}, | ||
593 | { 3072000, 24576000, 0x1ea0}, | ||
594 | |||
595 | }; | ||
596 | |||
597 | static int alc5632_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | ||
598 | int source, unsigned int freq_in, unsigned int freq_out) | ||
599 | { | ||
600 | int i; | ||
601 | struct snd_soc_codec *codec = codec_dai->codec; | ||
602 | int gbl_clk = 0, pll_div = 0; | ||
603 | u16 reg; | ||
604 | |||
605 | if (pll_id < ALC5632_PLL_FR_MCLK || pll_id > ALC5632_PLL_FR_VBCLK) | ||
606 | return -EINVAL; | ||
607 | |||
608 | /* Disable PLL power */ | ||
609 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
610 | ALC5632_PWR_ADD2_PLL1, | ||
611 | 0); | ||
612 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
613 | ALC5632_PWR_ADD2_PLL2, | ||
614 | 0); | ||
615 | |||
616 | /* pll is not used in slave mode */ | ||
617 | reg = snd_soc_read(codec, ALC5632_DAI_CONTROL); | ||
618 | if (reg & ALC5632_DAI_SDP_SLAVE_MODE) | ||
619 | return 0; | ||
620 | |||
621 | if (!freq_in || !freq_out) | ||
622 | return 0; | ||
623 | |||
624 | switch (pll_id) { | ||
625 | case ALC5632_PLL_FR_MCLK: | ||
626 | for (i = 0; i < ARRAY_SIZE(codec_master_pll_div); i++) { | ||
627 | if (codec_master_pll_div[i].pll_in == freq_in | ||
628 | && codec_master_pll_div[i].pll_out == freq_out) { | ||
629 | /* PLL source from MCLK */ | ||
630 | pll_div = codec_master_pll_div[i].regvalue; | ||
631 | break; | ||
632 | } | ||
633 | } | ||
634 | break; | ||
635 | case ALC5632_PLL_FR_BCLK: | ||
636 | for (i = 0; i < ARRAY_SIZE(codec_slave_pll_div); i++) { | ||
637 | if (codec_slave_pll_div[i].pll_in == freq_in | ||
638 | && codec_slave_pll_div[i].pll_out == freq_out) { | ||
639 | /* PLL source from Bitclk */ | ||
640 | gbl_clk = ALC5632_PLL_FR_BCLK; | ||
641 | pll_div = codec_slave_pll_div[i].regvalue; | ||
642 | break; | ||
643 | } | ||
644 | } | ||
645 | break; | ||
646 | case ALC5632_PLL_FR_VBCLK: | ||
647 | for (i = 0; i < ARRAY_SIZE(codec_slave_pll_div); i++) { | ||
648 | if (codec_slave_pll_div[i].pll_in == freq_in | ||
649 | && codec_slave_pll_div[i].pll_out == freq_out) { | ||
650 | /* PLL source from voice clock */ | ||
651 | gbl_clk = ALC5632_PLL_FR_VBCLK; | ||
652 | pll_div = codec_slave_pll_div[i].regvalue; | ||
653 | break; | ||
654 | } | ||
655 | } | ||
656 | break; | ||
657 | default: | ||
658 | return -EINVAL; | ||
659 | } | ||
660 | |||
661 | if (!pll_div) | ||
662 | return -EINVAL; | ||
663 | |||
664 | /* choose MCLK/BCLK/VBCLK */ | ||
665 | snd_soc_write(codec, ALC5632_GPCR2, gbl_clk); | ||
666 | /* choose PLL1 clock rate */ | ||
667 | snd_soc_write(codec, ALC5632_PLL1_CTRL, pll_div); | ||
668 | /* enable PLL1 */ | ||
669 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
670 | ALC5632_PWR_ADD2_PLL1, | ||
671 | ALC5632_PWR_ADD2_PLL1); | ||
672 | /* enable PLL2 */ | ||
673 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
674 | ALC5632_PWR_ADD2_PLL2, | ||
675 | ALC5632_PWR_ADD2_PLL2); | ||
676 | /* use PLL1 as main SYSCLK */ | ||
677 | snd_soc_update_bits(codec, ALC5632_GPCR1, | ||
678 | ALC5632_GPCR1_CLK_SYS_SRC_SEL_PLL1, | ||
679 | ALC5632_GPCR1_CLK_SYS_SRC_SEL_PLL1); | ||
680 | |||
681 | return 0; | ||
682 | } | ||
683 | |||
684 | struct _coeff_div { | ||
685 | u16 fs; | ||
686 | u16 regvalue; | ||
687 | }; | ||
688 | |||
689 | /* codec hifi mclk (after PLL) clock divider coefficients */ | ||
690 | /* values inspired from column BCLK=32Fs of Appendix A table */ | ||
691 | static const struct _coeff_div coeff_div[] = { | ||
692 | {512*1, 0x3075}, | ||
693 | }; | ||
694 | |||
695 | static int get_coeff(struct snd_soc_codec *codec, int rate) | ||
696 | { | ||
697 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | ||
698 | int i; | ||
699 | |||
700 | for (i = 0; i < ARRAY_SIZE(coeff_div); i++) { | ||
701 | if (coeff_div[i].fs * rate == alc5632->sysclk) | ||
702 | return i; | ||
703 | } | ||
704 | return -EINVAL; | ||
705 | } | ||
706 | |||
707 | /* | ||
708 | * Clock after PLL and dividers | ||
709 | */ | ||
710 | static int alc5632_set_dai_sysclk(struct snd_soc_dai *codec_dai, | ||
711 | int clk_id, unsigned int freq, int dir) | ||
712 | { | ||
713 | struct snd_soc_codec *codec = codec_dai->codec; | ||
714 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | ||
715 | |||
716 | switch (freq) { | ||
717 | case 8192000: | ||
718 | case 11289600: | ||
719 | case 12288000: | ||
720 | case 16384000: | ||
721 | case 16934400: | ||
722 | case 18432000: | ||
723 | case 22579200: | ||
724 | case 24576000: | ||
725 | alc5632->sysclk = freq; | ||
726 | return 0; | ||
727 | } | ||
728 | return -EINVAL; | ||
729 | } | ||
730 | |||
731 | static int alc5632_set_dai_fmt(struct snd_soc_dai *codec_dai, | ||
732 | unsigned int fmt) | ||
733 | { | ||
734 | struct snd_soc_codec *codec = codec_dai->codec; | ||
735 | u16 iface = 0; | ||
736 | |||
737 | /* set master/slave audio interface */ | ||
738 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | ||
739 | case SND_SOC_DAIFMT_CBM_CFM: | ||
740 | iface = ALC5632_DAI_SDP_MASTER_MODE; | ||
741 | break; | ||
742 | case SND_SOC_DAIFMT_CBS_CFS: | ||
743 | iface = ALC5632_DAI_SDP_SLAVE_MODE; | ||
744 | break; | ||
745 | default: | ||
746 | return -EINVAL; | ||
747 | } | ||
748 | |||
749 | /* interface format */ | ||
750 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | ||
751 | case SND_SOC_DAIFMT_I2S: | ||
752 | iface |= ALC5632_DAI_I2S_DF_I2S; | ||
753 | break; | ||
754 | case SND_SOC_DAIFMT_LEFT_J: | ||
755 | iface |= ALC5632_DAI_I2S_DF_LEFT; | ||
756 | break; | ||
757 | case SND_SOC_DAIFMT_DSP_A: | ||
758 | iface |= ALC5632_DAI_I2S_DF_PCM_A; | ||
759 | break; | ||
760 | case SND_SOC_DAIFMT_DSP_B: | ||
761 | iface |= ALC5632_DAI_I2S_DF_PCM_B; | ||
762 | break; | ||
763 | default: | ||
764 | return -EINVAL; | ||
765 | } | ||
766 | |||
767 | /* clock inversion */ | ||
768 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { | ||
769 | case SND_SOC_DAIFMT_NB_NF: | ||
770 | break; | ||
771 | case SND_SOC_DAIFMT_IB_IF: | ||
772 | iface |= ALC5632_DAI_MAIN_I2S_BCLK_POL_CTRL; | ||
773 | break; | ||
774 | case SND_SOC_DAIFMT_IB_NF: | ||
775 | iface |= ALC5632_DAI_MAIN_I2S_BCLK_POL_CTRL; | ||
776 | break; | ||
777 | case SND_SOC_DAIFMT_NB_IF: | ||
778 | break; | ||
779 | default: | ||
780 | return -EINVAL; | ||
781 | } | ||
782 | |||
783 | return snd_soc_write(codec, ALC5632_DAI_CONTROL, iface); | ||
784 | } | ||
785 | |||
786 | static int alc5632_pcm_hw_params(struct snd_pcm_substream *substream, | ||
787 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) | ||
788 | { | ||
789 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
790 | struct snd_soc_codec *codec = rtd->codec; | ||
791 | int coeff, rate; | ||
792 | u16 iface; | ||
793 | |||
794 | iface = snd_soc_read(codec, ALC5632_DAI_CONTROL); | ||
795 | iface &= ~ALC5632_DAI_I2S_DL_MASK; | ||
796 | |||
797 | /* bit size */ | ||
798 | switch (params_format(params)) { | ||
799 | case SNDRV_PCM_FORMAT_S16_LE: | ||
800 | iface |= ALC5632_DAI_I2S_DL_16; | ||
801 | break; | ||
802 | case SNDRV_PCM_FORMAT_S20_3LE: | ||
803 | iface |= ALC5632_DAI_I2S_DL_20; | ||
804 | break; | ||
805 | case SNDRV_PCM_FORMAT_S24_LE: | ||
806 | iface |= ALC5632_DAI_I2S_DL_24; | ||
807 | break; | ||
808 | default: | ||
809 | return -EINVAL; | ||
810 | } | ||
811 | |||
812 | /* set iface & srate */ | ||
813 | snd_soc_write(codec, ALC5632_DAI_CONTROL, iface); | ||
814 | rate = params_rate(params); | ||
815 | coeff = get_coeff(codec, rate); | ||
816 | if (coeff < 0) | ||
817 | return -EINVAL; | ||
818 | |||
819 | coeff = coeff_div[coeff].regvalue; | ||
820 | snd_soc_write(codec, ALC5632_DAC_CLK_CTRL1, coeff); | ||
821 | |||
822 | return 0; | ||
823 | } | ||
824 | |||
825 | static int alc5632_mute(struct snd_soc_dai *dai, int mute) | ||
826 | { | ||
827 | struct snd_soc_codec *codec = dai->codec; | ||
828 | u16 hp_mute = ALC5632_MISC_HP_DEPOP_MUTE_L | ||
829 | |ALC5632_MISC_HP_DEPOP_MUTE_R; | ||
830 | u16 mute_reg = snd_soc_read(codec, ALC5632_MISC_CTRL) & ~hp_mute; | ||
831 | |||
832 | if (mute) | ||
833 | mute_reg |= hp_mute; | ||
834 | |||
835 | return snd_soc_write(codec, ALC5632_MISC_CTRL, mute_reg); | ||
836 | } | ||
837 | |||
838 | #define ALC5632_ADD2_POWER_EN (ALC5632_PWR_ADD2_VREF) | ||
839 | |||
840 | #define ALC5632_ADD3_POWER_EN (ALC5632_PWR_ADD3_MIC1_BOOST_AD) | ||
841 | |||
842 | #define ALC5632_ADD1_POWER_EN \ | ||
843 | (ALC5632_PWR_ADD1_DAC_REF \ | ||
844 | | ALC5632_PWR_ADD1_SOFTGEN_EN \ | ||
845 | | ALC5632_PWR_ADD1_HP_OUT_AMP \ | ||
846 | | ALC5632_PWR_ADD1_HP_OUT_ENH_AMP \ | ||
847 | | ALC5632_PWR_ADD1_MAIN_BIAS) | ||
848 | |||
849 | static void enable_power_depop(struct snd_soc_codec *codec) | ||
850 | { | ||
851 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD1, | ||
852 | ALC5632_PWR_ADD1_SOFTGEN_EN, | ||
853 | ALC5632_PWR_ADD1_SOFTGEN_EN); | ||
854 | |||
855 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD3, | ||
856 | ALC5632_ADD3_POWER_EN, | ||
857 | ALC5632_ADD3_POWER_EN); | ||
858 | |||
859 | snd_soc_update_bits(codec, ALC5632_MISC_CTRL, | ||
860 | ALC5632_MISC_HP_DEPOP_MODE2_EN, | ||
861 | ALC5632_MISC_HP_DEPOP_MODE2_EN); | ||
862 | |||
863 | /* "normal" mode: 0 @ 26 */ | ||
864 | /* set all PR0-7 mixers to 0 */ | ||
865 | snd_soc_update_bits(codec, ALC5632_PWR_DOWN_CTRL_STATUS, | ||
866 | ALC5632_PWR_DOWN_CTRL_STATUS_MASK, | ||
867 | 0); | ||
868 | |||
869 | msleep(500); | ||
870 | |||
871 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
872 | ALC5632_ADD2_POWER_EN, | ||
873 | ALC5632_ADD2_POWER_EN); | ||
874 | |||
875 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD1, | ||
876 | ALC5632_ADD1_POWER_EN, | ||
877 | ALC5632_ADD1_POWER_EN); | ||
878 | |||
879 | /* disable HP Depop2 */ | ||
880 | snd_soc_update_bits(codec, ALC5632_MISC_CTRL, | ||
881 | ALC5632_MISC_HP_DEPOP_MODE2_EN, | ||
882 | 0); | ||
883 | |||
884 | } | ||
885 | |||
886 | static int alc5632_set_bias_level(struct snd_soc_codec *codec, | ||
887 | enum snd_soc_bias_level level) | ||
888 | { | ||
889 | switch (level) { | ||
890 | case SND_SOC_BIAS_ON: | ||
891 | enable_power_depop(codec); | ||
892 | break; | ||
893 | case SND_SOC_BIAS_PREPARE: | ||
894 | break; | ||
895 | case SND_SOC_BIAS_STANDBY: | ||
896 | /* everything off except vref/vmid, */ | ||
897 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD1, | ||
898 | ALC5632_PWR_MANAG_ADD1_MASK, | ||
899 | ALC5632_PWR_ADD1_MAIN_BIAS); | ||
900 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
901 | ALC5632_PWR_MANAG_ADD2_MASK, | ||
902 | ALC5632_PWR_ADD2_VREF); | ||
903 | /* "normal" mode: 0 @ 26 */ | ||
904 | snd_soc_update_bits(codec, ALC5632_PWR_DOWN_CTRL_STATUS, | ||
905 | ALC5632_PWR_DOWN_CTRL_STATUS_MASK, | ||
906 | 0xffff ^ (ALC5632_PWR_VREF_PR3 | ||
907 | | ALC5632_PWR_VREF_PR2)); | ||
908 | break; | ||
909 | case SND_SOC_BIAS_OFF: | ||
910 | /* everything off, dac mute, inactive */ | ||
911 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD2, | ||
912 | ALC5632_PWR_MANAG_ADD2_MASK, 0); | ||
913 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD3, | ||
914 | ALC5632_PWR_MANAG_ADD3_MASK, 0); | ||
915 | snd_soc_update_bits(codec, ALC5632_PWR_MANAG_ADD1, | ||
916 | ALC5632_PWR_MANAG_ADD1_MASK, 0); | ||
917 | break; | ||
918 | } | ||
919 | codec->dapm.bias_level = level; | ||
920 | return 0; | ||
921 | } | ||
922 | |||
923 | #define ALC5632_FORMATS (SNDRV_PCM_FMTBIT_S16_LE \ | ||
924 | | SNDRV_PCM_FMTBIT_S24_LE \ | ||
925 | | SNDRV_PCM_FMTBIT_S32_LE) | ||
926 | |||
927 | static const struct snd_soc_dai_ops alc5632_dai_ops = { | ||
928 | .hw_params = alc5632_pcm_hw_params, | ||
929 | .digital_mute = alc5632_mute, | ||
930 | .set_fmt = alc5632_set_dai_fmt, | ||
931 | .set_sysclk = alc5632_set_dai_sysclk, | ||
932 | .set_pll = alc5632_set_dai_pll, | ||
933 | }; | ||
934 | |||
935 | static struct snd_soc_dai_driver alc5632_dai = { | ||
936 | .name = "alc5632-hifi", | ||
937 | .playback = { | ||
938 | .stream_name = "HiFi Playback", | ||
939 | .channels_min = 1, | ||
940 | .channels_max = 2, | ||
941 | .rate_min = 8000, | ||
942 | .rate_max = 48000, | ||
943 | .rates = SNDRV_PCM_RATE_8000_48000, | ||
944 | .formats = ALC5632_FORMATS,}, | ||
945 | .capture = { | ||
946 | .stream_name = "HiFi Capture", | ||
947 | .channels_min = 1, | ||
948 | .channels_max = 2, | ||
949 | .rate_min = 8000, | ||
950 | .rate_max = 48000, | ||
951 | .rates = SNDRV_PCM_RATE_8000_48000, | ||
952 | .formats = ALC5632_FORMATS,}, | ||
953 | |||
954 | .ops = &alc5632_dai_ops, | ||
955 | .symmetric_rates = 1, | ||
956 | }; | ||
957 | |||
958 | #ifdef CONFIG_PM | ||
959 | static int alc5632_suspend(struct snd_soc_codec *codec) | ||
960 | { | ||
961 | alc5632_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
962 | return 0; | ||
963 | } | ||
964 | |||
965 | static int alc5632_resume(struct snd_soc_codec *codec) | ||
966 | { | ||
967 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | ||
968 | |||
969 | regcache_sync(alc5632->regmap); | ||
970 | |||
971 | alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
972 | return 0; | ||
973 | } | ||
974 | #else | ||
975 | #define alc5632_suspend NULL | ||
976 | #define alc5632_resume NULL | ||
977 | #endif | ||
978 | |||
979 | static int alc5632_probe(struct snd_soc_codec *codec) | ||
980 | { | ||
981 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | ||
982 | int ret; | ||
983 | |||
984 | codec->control_data = alc5632->regmap; | ||
985 | |||
986 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP); | ||
987 | if (ret != 0) { | ||
988 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | ||
989 | return ret; | ||
990 | } | ||
991 | |||
992 | /* power on device */ | ||
993 | alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
994 | |||
995 | switch (alc5632->id) { | ||
996 | case 0x5c: | ||
997 | snd_soc_add_controls(codec, alc5632_vol_snd_controls, | ||
998 | ARRAY_SIZE(alc5632_vol_snd_controls)); | ||
999 | break; | ||
1000 | default: | ||
1001 | return -EINVAL; | ||
1002 | } | ||
1003 | |||
1004 | return ret; | ||
1005 | } | ||
1006 | |||
1007 | /* power down chip */ | ||
1008 | static int alc5632_remove(struct snd_soc_codec *codec) | ||
1009 | { | ||
1010 | alc5632_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1011 | return 0; | ||
1012 | } | ||
1013 | |||
1014 | static struct snd_soc_codec_driver soc_codec_device_alc5632 = { | ||
1015 | .probe = alc5632_probe, | ||
1016 | .remove = alc5632_remove, | ||
1017 | .suspend = alc5632_suspend, | ||
1018 | .resume = alc5632_resume, | ||
1019 | .set_bias_level = alc5632_set_bias_level, | ||
1020 | .controls = alc5632_snd_controls, | ||
1021 | .num_controls = ARRAY_SIZE(alc5632_snd_controls), | ||
1022 | .dapm_widgets = alc5632_dapm_widgets, | ||
1023 | .num_dapm_widgets = ARRAY_SIZE(alc5632_dapm_widgets), | ||
1024 | .dapm_routes = alc5632_dapm_routes, | ||
1025 | .num_dapm_routes = ARRAY_SIZE(alc5632_dapm_routes), | ||
1026 | }; | ||
1027 | |||
1028 | static struct regmap_config alc5632_regmap = { | ||
1029 | .reg_bits = 8, | ||
1030 | .val_bits = 16, | ||
1031 | |||
1032 | .max_register = ALC5632_MAX_REGISTER, | ||
1033 | .reg_defaults = alc5632_reg_defaults, | ||
1034 | .num_reg_defaults = ARRAY_SIZE(alc5632_reg_defaults), | ||
1035 | .volatile_reg = alc5632_volatile_register, | ||
1036 | .cache_type = REGCACHE_RBTREE, | ||
1037 | }; | ||
1038 | |||
1039 | /* | ||
1040 | * alc5632 2 wire address is determined by A1 pin | ||
1041 | * state during powerup. | ||
1042 | * low = 0x1a | ||
1043 | * high = 0x1b | ||
1044 | */ | ||
1045 | static __devinit int alc5632_i2c_probe(struct i2c_client *client, | ||
1046 | const struct i2c_device_id *id) | ||
1047 | { | ||
1048 | struct alc5632_priv *alc5632; | ||
1049 | int ret, ret1, ret2; | ||
1050 | unsigned int vid1, vid2; | ||
1051 | |||
1052 | alc5632 = devm_kzalloc(&client->dev, | ||
1053 | sizeof(struct alc5632_priv), GFP_KERNEL); | ||
1054 | if (alc5632 == NULL) | ||
1055 | return -ENOMEM; | ||
1056 | |||
1057 | i2c_set_clientdata(client, alc5632); | ||
1058 | |||
1059 | alc5632->regmap = regmap_init_i2c(client, &alc5632_regmap); | ||
1060 | if (IS_ERR(alc5632->regmap)) { | ||
1061 | ret = PTR_ERR(alc5632->regmap); | ||
1062 | dev_err(&client->dev, "regmap_init() failed: %d\n", ret); | ||
1063 | return ret; | ||
1064 | } | ||
1065 | |||
1066 | ret1 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID1, &vid1); | ||
1067 | ret2 = regmap_read(alc5632->regmap, ALC5632_VENDOR_ID2, &vid2); | ||
1068 | if (ret1 != 0 || ret2 != 0) { | ||
1069 | dev_err(&client->dev, | ||
1070 | "Failed to read chip ID: ret1=%d, ret2=%d\n", ret1, ret2); | ||
1071 | regmap_exit(alc5632->regmap); | ||
1072 | return -EIO; | ||
1073 | } | ||
1074 | |||
1075 | vid2 >>= 8; | ||
1076 | |||
1077 | if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) { | ||
1078 | dev_err(&client->dev, | ||
1079 | "Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2); | ||
1080 | regmap_exit(alc5632->regmap); | ||
1081 | return -EINVAL; | ||
1082 | } | ||
1083 | |||
1084 | ret = alc5632_reset(alc5632->regmap); | ||
1085 | if (ret < 0) { | ||
1086 | dev_err(&client->dev, "Failed to issue reset\n"); | ||
1087 | regmap_exit(alc5632->regmap); | ||
1088 | return ret; | ||
1089 | } | ||
1090 | |||
1091 | alc5632->id = vid2; | ||
1092 | switch (alc5632->id) { | ||
1093 | case 0x5c: | ||
1094 | alc5632_dai.name = "alc5632-hifi"; | ||
1095 | break; | ||
1096 | default: | ||
1097 | return -EINVAL; | ||
1098 | } | ||
1099 | |||
1100 | ret = snd_soc_register_codec(&client->dev, | ||
1101 | &soc_codec_device_alc5632, &alc5632_dai, 1); | ||
1102 | |||
1103 | if (ret < 0) { | ||
1104 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | ||
1105 | regmap_exit(alc5632->regmap); | ||
1106 | return ret; | ||
1107 | } | ||
1108 | |||
1109 | return ret; | ||
1110 | } | ||
1111 | |||
1112 | static int alc5632_i2c_remove(struct i2c_client *client) | ||
1113 | { | ||
1114 | struct alc5632_priv *alc5632 = i2c_get_clientdata(client); | ||
1115 | snd_soc_unregister_codec(&client->dev); | ||
1116 | regmap_exit(alc5632->regmap); | ||
1117 | return 0; | ||
1118 | } | ||
1119 | |||
1120 | static const struct i2c_device_id alc5632_i2c_table[] = { | ||
1121 | {"alc5632", 0x5c}, | ||
1122 | {} | ||
1123 | }; | ||
1124 | MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); | ||
1125 | |||
1126 | /* i2c codec control layer */ | ||
1127 | static struct i2c_driver alc5632_i2c_driver = { | ||
1128 | .driver = { | ||
1129 | .name = "alc5632", | ||
1130 | .owner = THIS_MODULE, | ||
1131 | }, | ||
1132 | .probe = alc5632_i2c_probe, | ||
1133 | .remove = __devexit_p(alc5632_i2c_remove), | ||
1134 | .id_table = alc5632_i2c_table, | ||
1135 | }; | ||
1136 | |||
1137 | static int __init alc5632_modinit(void) | ||
1138 | { | ||
1139 | int ret; | ||
1140 | |||
1141 | ret = i2c_add_driver(&alc5632_i2c_driver); | ||
1142 | if (ret != 0) { | ||
1143 | printk(KERN_ERR "%s: can't add i2c driver", __func__); | ||
1144 | return ret; | ||
1145 | } | ||
1146 | |||
1147 | return ret; | ||
1148 | } | ||
1149 | module_init(alc5632_modinit); | ||
1150 | |||
1151 | static void __exit alc5632_modexit(void) | ||
1152 | { | ||
1153 | i2c_del_driver(&alc5632_i2c_driver); | ||
1154 | } | ||
1155 | module_exit(alc5632_modexit); | ||
1156 | |||
1157 | MODULE_DESCRIPTION("ASoC ALC5632 driver"); | ||
1158 | MODULE_AUTHOR("Leon Romanovsky <leon@leon.nu>"); | ||
1159 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/alc5632.h b/sound/soc/codecs/alc5632.h new file mode 100644 index 00000000000..357651ec074 --- /dev/null +++ b/sound/soc/codecs/alc5632.h | |||
@@ -0,0 +1,251 @@ | |||
1 | /* | ||
2 | * alc5632.h -- ALC5632 ALSA SoC Audio Codec | ||
3 | * | ||
4 | * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net> | ||
5 | * | ||
6 | * Authors: Leon Romanovsky <leon@leon.nu> | ||
7 | * Andrey Danin <danindrey@mail.ru> | ||
8 | * Ilya Petrov <ilya.muromec@gmail.com> | ||
9 | * Marc Dietrich <marvin24@gmx.de> | ||
10 | * | ||
11 | * Based on alc5623.h by Arnaud Patard | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #ifndef _ALC5632_H | ||
19 | #define _ALC5632_H | ||
20 | |||
21 | #define ALC5632_RESET 0x00 | ||
22 | /* speaker output vol 2 2 */ | ||
23 | /* line output vol 4 2 */ | ||
24 | /* HP output vol 4 0 4 */ | ||
25 | #define ALC5632_SPK_OUT_VOL 0x02 /* spe out vol */ | ||
26 | #define ALC5632_SPK_OUT_VOL_STEP 1.5 | ||
27 | #define ALC5632_HP_OUT_VOL 0x04 /* hp out vol */ | ||
28 | #define ALC5632_AUX_OUT_VOL 0x06 /* aux out vol */ | ||
29 | #define ALC5632_PHONE_IN_VOL 0x08 /* phone in vol */ | ||
30 | #define ALC5632_LINE_IN_VOL 0x0A /* line in vol */ | ||
31 | #define ALC5632_STEREO_DAC_IN_VOL 0x0C /* stereo dac in vol */ | ||
32 | #define ALC5632_MIC_VOL 0x0E /* mic in vol */ | ||
33 | /* stero dac/mic routing */ | ||
34 | #define ALC5632_MIC_ROUTING_CTRL 0x10 | ||
35 | #define ALC5632_MIC_ROUTE_MONOMIX (1 << 0) | ||
36 | #define ALC5632_MIC_ROUTE_SPK (1 << 1) | ||
37 | #define ALC5632_MIC_ROUTE_HP (1 << 2) | ||
38 | |||
39 | #define ALC5632_ADC_REC_GAIN 0x12 /* rec gain */ | ||
40 | #define ALC5632_ADC_REC_GAIN_RANGE 0x1F1F | ||
41 | #define ALC5632_ADC_REC_GAIN_BASE (-16.5) | ||
42 | #define ALC5632_ADC_REC_GAIN_STEP 1.5 | ||
43 | |||
44 | #define ALC5632_ADC_REC_MIXER 0x14 /* mixer control */ | ||
45 | #define ALC5632_ADC_REC_MIC1 (1 << 6) | ||
46 | #define ALC5632_ADC_REC_MIC2 (1 << 5) | ||
47 | #define ALC5632_ADC_REC_LINE_IN (1 << 4) | ||
48 | #define ALC5632_ADC_REC_AUX (1 << 3) | ||
49 | #define ALC5632_ADC_REC_HP (1 << 2) | ||
50 | #define ALC5632_ADC_REC_SPK (1 << 1) | ||
51 | #define ALC5632_ADC_REC_MONOMIX (1 << 0) | ||
52 | |||
53 | #define ALC5632_VOICE_DAC_VOL 0x18 /* voice dac vol */ | ||
54 | /* ALC5632_OUTPUT_MIXER_CTRL : */ | ||
55 | /* same remark as for reg 2 line vs speaker */ | ||
56 | #define ALC5632_OUTPUT_MIXER_CTRL 0x1C /* out mix ctrl */ | ||
57 | #define ALC5632_OUTPUT_MIXER_RP (1 << 14) | ||
58 | #define ALC5632_OUTPUT_MIXER_WEEK (1 << 12) | ||
59 | #define ALC5632_OUTPUT_MIXER_HP (1 << 10) | ||
60 | #define ALC5632_OUTPUT_MIXER_AUX_SPK (2 << 6) | ||
61 | #define ALC5632_OUTPUT_MIXER_AUX_HP_LR (1 << 6) | ||
62 | #define ALC5632_OUTPUT_MIXER_HP_R (1 << 8) | ||
63 | #define ALC5632_OUTPUT_MIXER_HP_L (1 << 9) | ||
64 | |||
65 | #define ALC5632_MIC_CTRL 0x22 /* mic phone ctrl */ | ||
66 | #define ALC5632_MIC_BOOST_BYPASS 0 | ||
67 | #define ALC5632_MIC_BOOST_20DB 1 | ||
68 | #define ALC5632_MIC_BOOST_30DB 2 | ||
69 | #define ALC5632_MIC_BOOST_40DB 3 | ||
70 | |||
71 | #define ALC5632_DIGI_BOOST_CTRL 0x24 /* digi mic / bost ctl */ | ||
72 | #define ALC5632_MIC_BOOST_RANGE 7 | ||
73 | #define ALC5632_MIC_BOOST_STEP 6 | ||
74 | #define ALC5632_PWR_DOWN_CTRL_STATUS 0x26 | ||
75 | #define ALC5632_PWR_DOWN_CTRL_STATUS_MASK 0xEF00 | ||
76 | #define ALC5632_PWR_VREF_PR3 (1 << 11) | ||
77 | #define ALC5632_PWR_VREF_PR2 (1 << 10) | ||
78 | #define ALC5632_PWR_VREF_STATUS (1 << 3) | ||
79 | #define ALC5632_PWR_AMIX_STATUS (1 << 2) | ||
80 | #define ALC5632_PWR_DAC_STATUS (1 << 1) | ||
81 | #define ALC5632_PWR_ADC_STATUS (1 << 0) | ||
82 | /* stereo/voice DAC / stereo adc func ctrl */ | ||
83 | #define ALC5632_DAC_FUNC_SELECT 0x2E | ||
84 | |||
85 | /* Main serial data port ctrl (i2s) */ | ||
86 | #define ALC5632_DAI_CONTROL 0x34 | ||
87 | |||
88 | #define ALC5632_DAI_SDP_MASTER_MODE (0 << 15) | ||
89 | #define ALC5632_DAI_SDP_SLAVE_MODE (1 << 15) | ||
90 | #define ALC5632_DAI_SADLRCK_MODE (1 << 14) | ||
91 | /* 0:voice, 1:main */ | ||
92 | #define ALC5632_DAI_MAIN_I2S_SYSCLK_SEL (1 << 8) | ||
93 | #define ALC5632_DAI_MAIN_I2S_BCLK_POL_CTRL (1 << 7) | ||
94 | /* 0:normal, 1:invert */ | ||
95 | #define ALC5632_DAI_MAIN_I2S_LRCK_INV (1 << 6) | ||
96 | #define ALC5632_DAI_I2S_DL_MASK (3 << 2) | ||
97 | #define ALC5632_DAI_I2S_DL_8 (3 << 2) | ||
98 | #define ALC5632_DAI_I2S_DL_24 (2 << 2) | ||
99 | #define ALC5632_DAI_I2S_DL_20 (1 << 2) | ||
100 | #define ALC5632_DAI_I2S_DL_16 (0 << 2) | ||
101 | #define ALC5632_DAI_I2S_DF_MASK (3 << 0) | ||
102 | #define ALC5632_DAI_I2S_DF_PCM_B (3 << 0) | ||
103 | #define ALC5632_DAI_I2S_DF_PCM_A (2 << 0) | ||
104 | #define ALC5632_DAI_I2S_DF_LEFT (1 << 0) | ||
105 | #define ALC5632_DAI_I2S_DF_I2S (0 << 0) | ||
106 | /* extend serial data port control (VoDAC_i2c/pcm) */ | ||
107 | #define ALC5632_DAI_CONTROL2 0x36 | ||
108 | /* 0:gpio func, 1:voice pcm */ | ||
109 | #define ALC5632_DAI_VOICE_PCM_ENABLE (1 << 15) | ||
110 | /* 0:master, 1:slave */ | ||
111 | #define ALC5632_DAI_VOICE_MODE_SEL (1 << 14) | ||
112 | /* 0:disable, 1:enable */ | ||
113 | #define ALC5632_DAI_HPF_CLK_CTRL (1 << 13) | ||
114 | /* 0:main, 1:voice */ | ||
115 | #define ALC5632_DAI_VOICE_I2S_SYSCLK_SEL (1 << 8) | ||
116 | /* 0:normal, 1:invert */ | ||
117 | #define ALC5632_DAI_VOICE_VBCLK_SYSCLK_SEL (1 << 7) | ||
118 | /* 0:normal, 1:invert */ | ||
119 | #define ALC5632_DAI_VOICE_I2S_LR_INV (1 << 6) | ||
120 | #define ALC5632_DAI_VOICE_DL_MASK (3 << 2) | ||
121 | #define ALC5632_DAI_VOICE_DL_16 (0 << 2) | ||
122 | #define ALC5632_DAI_VOICE_DL_20 (1 << 2) | ||
123 | #define ALC5632_DAI_VOICE_DL_24 (2 << 2) | ||
124 | #define ALC5632_DAI_VOICE_DL_8 (3 << 2) | ||
125 | #define ALC5632_DAI_VOICE_DF_MASK (3 << 0) | ||
126 | #define ALC5632_DAI_VOICE_DF_I2S (0 << 0) | ||
127 | #define ALC5632_DAI_VOICE_DF_LEFT (1 << 0) | ||
128 | #define ALC5632_DAI_VOICE_DF_PCM_A (2 << 0) | ||
129 | #define ALC5632_DAI_VOICE_DF_PCM_B (3 << 0) | ||
130 | |||
131 | #define ALC5632_PWR_MANAG_ADD1 0x3A | ||
132 | #define ALC5632_PWR_MANAG_ADD1_MASK 0xEFFF | ||
133 | #define ALC5632_PWR_ADD1_DAC_L_EN (1 << 15) | ||
134 | #define ALC5632_PWR_ADD1_DAC_R_EN (1 << 14) | ||
135 | #define ALC5632_PWR_ADD1_ZERO_CROSS (1 << 13) | ||
136 | #define ALC5632_PWR_ADD1_MAIN_I2S_EN (1 << 11) | ||
137 | #define ALC5632_PWR_ADD1_SPK_AMP_EN (1 << 10) | ||
138 | #define ALC5632_PWR_ADD1_HP_OUT_AMP (1 << 9) | ||
139 | #define ALC5632_PWR_ADD1_HP_OUT_ENH_AMP (1 << 8) | ||
140 | #define ALC5632_PWR_ADD1_VOICE_DAC_MIX (1 << 7) | ||
141 | #define ALC5632_PWR_ADD1_SOFTGEN_EN (1 << 6) | ||
142 | #define ALC5632_PWR_ADD1_MIC1_SHORT_CURR (1 << 5) | ||
143 | #define ALC5632_PWR_ADD1_MIC2_SHORT_CURR (1 << 4) | ||
144 | #define ALC5632_PWR_ADD1_MIC1_EN (1 << 3) | ||
145 | #define ALC5632_PWR_ADD1_MIC2_EN (1 << 2) | ||
146 | #define ALC5632_PWR_ADD1_MAIN_BIAS (1 << 1) | ||
147 | #define ALC5632_PWR_ADD1_DAC_REF (1 << 0) | ||
148 | |||
149 | #define ALC5632_PWR_MANAG_ADD2 0x3C | ||
150 | #define ALC5632_PWR_MANAG_ADD2_MASK 0x7FFF | ||
151 | #define ALC5632_PWR_ADD2_PLL1 (1 << 15) | ||
152 | #define ALC5632_PWR_ADD2_PLL2 (1 << 14) | ||
153 | #define ALC5632_PWR_ADD2_VREF (1 << 13) | ||
154 | #define ALC5632_PWR_ADD2_OVT_DET (1 << 12) | ||
155 | #define ALC5632_PWR_ADD2_VOICE_DAC (1 << 10) | ||
156 | #define ALC5632_PWR_ADD2_L_DAC_CLK (1 << 9) | ||
157 | #define ALC5632_PWR_ADD2_R_DAC_CLK (1 << 8) | ||
158 | #define ALC5632_PWR_ADD2_L_ADC_CLK_GAIN (1 << 7) | ||
159 | #define ALC5632_PWR_ADD2_R_ADC_CLK_GAIN (1 << 6) | ||
160 | #define ALC5632_PWR_ADD2_L_HP_MIXER (1 << 5) | ||
161 | #define ALC5632_PWR_ADD2_R_HP_MIXER (1 << 4) | ||
162 | #define ALC5632_PWR_ADD2_SPK_MIXER (1 << 3) | ||
163 | #define ALC5632_PWR_ADD2_MONO_MIXER (1 << 2) | ||
164 | #define ALC5632_PWR_ADD2_L_ADC_REC_MIXER (1 << 1) | ||
165 | #define ALC5632_PWR_ADD2_R_ADC_REC_MIXER (1 << 0) | ||
166 | |||
167 | #define ALC5632_PWR_MANAG_ADD3 0x3E | ||
168 | #define ALC5632_PWR_MANAG_ADD3_MASK 0x7CFF | ||
169 | #define ALC5632_PWR_ADD3_AUXOUT_VOL (1 << 14) | ||
170 | #define ALC5632_PWR_ADD3_SPK_L_OUT (1 << 13) | ||
171 | #define ALC5632_PWR_ADD3_SPK_R_OUT (1 << 12) | ||
172 | #define ALC5632_PWR_ADD3_HP_L_OUT_VOL (1 << 11) | ||
173 | #define ALC5632_PWR_ADD3_HP_R_OUT_VOL (1 << 10) | ||
174 | #define ALC5632_PWR_ADD3_LINEIN_L_VOL (1 << 7) | ||
175 | #define ALC5632_PWR_ADD3_LINEIN_R_VOL (1 << 6) | ||
176 | #define ALC5632_PWR_ADD3_AUXIN_VOL (1 << 5) | ||
177 | #define ALC5632_PWR_ADD3_AUXIN_MIX (1 << 4) | ||
178 | #define ALC5632_PWR_ADD3_MIC1_VOL (1 << 3) | ||
179 | #define ALC5632_PWR_ADD3_MIC2_VOL (1 << 2) | ||
180 | #define ALC5632_PWR_ADD3_MIC1_BOOST_AD (1 << 1) | ||
181 | #define ALC5632_PWR_ADD3_MIC2_BOOST_AD (1 << 0) | ||
182 | |||
183 | #define ALC5632_GPCR1 0x40 | ||
184 | #define ALC5632_GPCR1_CLK_SYS_SRC_SEL_PLL1 (1 << 15) | ||
185 | #define ALC5632_GPCR1_CLK_SYS_SRC_SEL_MCLK (0 << 15) | ||
186 | #define ALC5632_GPCR1_DAC_HI_FLT_EN (1 << 10) | ||
187 | #define ALC5632_GPCR1_SPK_AMP_CTRL (7 << 1) | ||
188 | #define ALC5632_GPCR1_VDD_100 (5 << 1) | ||
189 | #define ALC5632_GPCR1_VDD_125 (4 << 1) | ||
190 | #define ALC5632_GPCR1_VDD_150 (3 << 1) | ||
191 | #define ALC5632_GPCR1_VDD_175 (2 << 1) | ||
192 | #define ALC5632_GPCR1_VDD_200 (1 << 1) | ||
193 | #define ALC5632_GPCR1_VDD_225 (0 << 1) | ||
194 | |||
195 | #define ALC5632_GPCR2 0x42 | ||
196 | #define ALC5632_GPCR2_PLL1_SOUR_SEL (3 << 12) | ||
197 | #define ALC5632_PLL_FR_MCLK (0 << 12) | ||
198 | #define ALC5632_PLL_FR_BCLK (2 << 12) | ||
199 | #define ALC5632_PLL_FR_VBCLK (3 << 12) | ||
200 | #define ALC5632_GPCR2_CLK_PLL_PRE_DIV1 (0 << 0) | ||
201 | |||
202 | #define ALC5632_PLL1_CTRL 0x44 | ||
203 | #define ALC5632_PLL1_CTRL_N_VAL(n) (((n) & 0x0f) << 8) | ||
204 | #define ALC5632_PLL1_M_BYPASS (1 << 7) | ||
205 | #define ALC5632_PLL1_CTRL_K_VAL(k) (((k) & 0x07) << 4) | ||
206 | #define ALC5632_PLL1_CTRL_M_VAL(m) (((m) & 0x0f) << 0) | ||
207 | |||
208 | #define ALC5632_PLL2_CTRL 0x46 | ||
209 | #define ALC5632_PLL2_EN (1 << 15) | ||
210 | #define ALC5632_PLL2_RATIO (0 << 15) | ||
211 | |||
212 | #define ALC5632_GPIO_PIN_CONFIG 0x4C | ||
213 | #define ALC5632_GPIO_PIN_POLARITY 0x4E | ||
214 | #define ALC5632_GPIO_PIN_STICKY 0x50 | ||
215 | #define ALC5632_GPIO_PIN_WAKEUP 0x52 | ||
216 | #define ALC5632_GPIO_PIN_STATUS 0x54 | ||
217 | #define ALC5632_GPIO_PIN_SHARING 0x56 | ||
218 | #define ALC5632_OVER_CURR_STATUS 0x58 | ||
219 | #define ALC5632_SOFTVOL_CTRL 0x5A | ||
220 | #define ALC5632_GPIO_OUPUT_PIN_CTRL 0x5C | ||
221 | |||
222 | #define ALC5632_MISC_CTRL 0x5E | ||
223 | #define ALC5632_MISC_DISABLE_FAST_VREG (1 << 15) | ||
224 | #define ALC5632_MISC_AVC_TRGT_SEL (3 << 12) | ||
225 | #define ALC5632_MISC_AVC_TRGT_RIGHT (1 << 12) | ||
226 | #define ALC5632_MISC_AVC_TRGT_LEFT (2 << 12) | ||
227 | #define ALC5632_MISC_AVC_TRGT_BOTH (3 << 12) | ||
228 | #define ALC5632_MISC_HP_DEPOP_MODE1_EN (1 << 9) | ||
229 | #define ALC5632_MISC_HP_DEPOP_MODE2_EN (1 << 8) | ||
230 | #define ALC5632_MISC_HP_DEPOP_MUTE_L (1 << 7) | ||
231 | #define ALC5632_MISC_HP_DEPOP_MUTE_R (1 << 6) | ||
232 | #define ALC5632_MISC_HP_DEPOP_MUTE (1 << 5) | ||
233 | #define ALC5632_MISC_GPIO_WAKEUP_CTRL (1 << 1) | ||
234 | #define ALC5632_MISC_IRQOUT_INV_CTRL (1 << 0) | ||
235 | |||
236 | #define ALC5632_DAC_CLK_CTRL1 0x60 | ||
237 | #define ALC5632_DAC_CLK_CTRL2 0x62 | ||
238 | #define ALC5632_DAC_CLK_CTRL2_DIV1_2 (1 << 0) | ||
239 | #define ALC5632_VOICE_DAC_PCM_CLK_CTRL1 0x64 | ||
240 | #define ALC5632_PSEUDO_SPATIAL_CTRL 0x68 | ||
241 | #define ALC5632_HID_CTRL_INDEX 0x6A | ||
242 | #define ALC5632_HID_CTRL_DATA 0x6C | ||
243 | #define ALC5632_EQ_CTRL 0x6E | ||
244 | |||
245 | /* undocumented */ | ||
246 | #define ALC5632_VENDOR_ID1 0x7C | ||
247 | #define ALC5632_VENDOR_ID2 0x7E | ||
248 | |||
249 | #define ALC5632_MAX_REGISTER 0x7E | ||
250 | |||
251 | #endif | ||
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 46dbfd067f7..4854b472d5f 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c | |||
@@ -122,7 +122,7 @@ static int cq93vc_set_bias_level(struct snd_soc_codec *codec, | |||
122 | #define CQ93VC_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000) | 122 | #define CQ93VC_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000) |
123 | #define CQ93VC_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE) | 123 | #define CQ93VC_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE) |
124 | 124 | ||
125 | static struct snd_soc_dai_ops cq93vc_dai_ops = { | 125 | static const struct snd_soc_dai_ops cq93vc_dai_ops = { |
126 | .digital_mute = cq93vc_mute, | 126 | .digital_mute = cq93vc_mute, |
127 | .set_sysclk = cq93vc_set_dai_sysclk, | 127 | .set_sysclk = cq93vc_set_dai_sysclk, |
128 | }; | 128 | }; |
@@ -206,17 +206,7 @@ static struct platform_driver cq93vc_codec_driver = { | |||
206 | .remove = __devexit_p(cq93vc_platform_remove), | 206 | .remove = __devexit_p(cq93vc_platform_remove), |
207 | }; | 207 | }; |
208 | 208 | ||
209 | static int __init cq93vc_init(void) | 209 | module_platform_driver(cq93vc_codec_driver); |
210 | { | ||
211 | return platform_driver_register(&cq93vc_codec_driver); | ||
212 | } | ||
213 | module_init(cq93vc_init); | ||
214 | |||
215 | static void __exit cq93vc_exit(void) | ||
216 | { | ||
217 | platform_driver_unregister(&cq93vc_codec_driver); | ||
218 | } | ||
219 | module_exit(cq93vc_exit); | ||
220 | 210 | ||
221 | MODULE_DESCRIPTION("Texas Instruments DaVinci ASoC CQ0093 Voice Codec Driver"); | 211 | MODULE_DESCRIPTION("Texas Instruments DaVinci ASoC CQ0093 Voice Codec Driver"); |
222 | MODULE_AUTHOR("Miguel Aguilar"); | 212 | MODULE_AUTHOR("Miguel Aguilar"); |
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index f1f237ecec2..055536645da 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c | |||
@@ -22,7 +22,6 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
27 | #include <sound/core.h> | 26 | #include <sound/core.h> |
28 | #include <sound/soc.h> | 27 | #include <sound/soc.h> |
@@ -447,7 +446,7 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = { | |||
447 | snd_soc_get_volsw, cs4270_soc_put_mute), | 446 | snd_soc_get_volsw, cs4270_soc_put_mute), |
448 | }; | 447 | }; |
449 | 448 | ||
450 | static struct snd_soc_dai_ops cs4270_dai_ops = { | 449 | static const struct snd_soc_dai_ops cs4270_dai_ops = { |
451 | .hw_params = cs4270_hw_params, | 450 | .hw_params = cs4270_hw_params, |
452 | .set_sysclk = cs4270_set_dai_sysclk, | 451 | .set_sysclk = cs4270_set_dai_sysclk, |
453 | .set_fmt = cs4270_set_dai_fmt, | 452 | .set_fmt = cs4270_set_dai_fmt, |
@@ -579,7 +578,7 @@ static int cs4270_remove(struct snd_soc_codec *codec) | |||
579 | * and all registers are written back to the hardware when resuming. | 578 | * and all registers are written back to the hardware when resuming. |
580 | */ | 579 | */ |
581 | 580 | ||
582 | static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) | 581 | static int cs4270_soc_suspend(struct snd_soc_codec *codec) |
583 | { | 582 | { |
584 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); | 583 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); |
585 | int reg, ret; | 584 | int reg, ret; |
@@ -601,7 +600,6 @@ static int cs4270_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) | |||
601 | static int cs4270_soc_resume(struct snd_soc_codec *codec) | 600 | static int cs4270_soc_resume(struct snd_soc_codec *codec) |
602 | { | 601 | { |
603 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); | 602 | struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec); |
604 | struct i2c_client *i2c_client = to_i2c_client(codec->dev); | ||
605 | int reg; | 603 | int reg; |
606 | 604 | ||
607 | regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies), | 605 | regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies), |
@@ -612,14 +610,7 @@ static int cs4270_soc_resume(struct snd_soc_codec *codec) | |||
612 | ndelay(500); | 610 | ndelay(500); |
613 | 611 | ||
614 | /* first restore the entire register cache ... */ | 612 | /* first restore the entire register cache ... */ |
615 | for (reg = CS4270_FIRSTREG; reg <= CS4270_LASTREG; reg++) { | 613 | snd_soc_cache_sync(codec); |
616 | u8 val = snd_soc_read(codec, reg); | ||
617 | |||
618 | if (i2c_smbus_write_byte_data(i2c_client, reg, val)) { | ||
619 | dev_err(codec->dev, "i2c write failed\n"); | ||
620 | return -EIO; | ||
621 | } | ||
622 | } | ||
623 | 614 | ||
624 | /* ... then disable the power-down bits */ | 615 | /* ... then disable the power-down bits */ |
625 | reg = snd_soc_read(codec, CS4270_PWRCTL); | 616 | reg = snd_soc_read(codec, CS4270_PWRCTL); |
@@ -680,7 +671,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, | |||
680 | i2c_client->addr); | 671 | i2c_client->addr); |
681 | dev_info(&i2c_client->dev, "hardware revision %X\n", ret & 0xF); | 672 | dev_info(&i2c_client->dev, "hardware revision %X\n", ret & 0xF); |
682 | 673 | ||
683 | cs4270 = kzalloc(sizeof(struct cs4270_private), GFP_KERNEL); | 674 | cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), |
675 | GFP_KERNEL); | ||
684 | if (!cs4270) { | 676 | if (!cs4270) { |
685 | dev_err(&i2c_client->dev, "could not allocate codec\n"); | 677 | dev_err(&i2c_client->dev, "could not allocate codec\n"); |
686 | return -ENOMEM; | 678 | return -ENOMEM; |
@@ -691,8 +683,6 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, | |||
691 | 683 | ||
692 | ret = snd_soc_register_codec(&i2c_client->dev, | 684 | ret = snd_soc_register_codec(&i2c_client->dev, |
693 | &soc_codec_device_cs4270, &cs4270_dai, 1); | 685 | &soc_codec_device_cs4270, &cs4270_dai, 1); |
694 | if (ret < 0) | ||
695 | kfree(cs4270); | ||
696 | return ret; | 686 | return ret; |
697 | } | 687 | } |
698 | 688 | ||
@@ -705,7 +695,6 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, | |||
705 | static int cs4270_i2c_remove(struct i2c_client *i2c_client) | 695 | static int cs4270_i2c_remove(struct i2c_client *i2c_client) |
706 | { | 696 | { |
707 | snd_soc_unregister_codec(&i2c_client->dev); | 697 | snd_soc_unregister_codec(&i2c_client->dev); |
708 | kfree(i2c_get_clientdata(i2c_client)); | ||
709 | return 0; | 698 | return 0; |
710 | } | 699 | } |
711 | 700 | ||
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 69fde1506fe..f6fe846b6a6 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c | |||
@@ -402,7 +402,7 @@ static const struct snd_kcontrol_new cs4271_snd_controls[] = { | |||
402 | 7, 1, 1), | 402 | 7, 1, 1), |
403 | }; | 403 | }; |
404 | 404 | ||
405 | static struct snd_soc_dai_ops cs4271_dai_ops = { | 405 | static const struct snd_soc_dai_ops cs4271_dai_ops = { |
406 | .hw_params = cs4271_hw_params, | 406 | .hw_params = cs4271_hw_params, |
407 | .set_sysclk = cs4271_set_dai_sysclk, | 407 | .set_sysclk = cs4271_set_dai_sysclk, |
408 | .set_fmt = cs4271_set_dai_fmt, | 408 | .set_fmt = cs4271_set_dai_fmt, |
@@ -430,7 +430,7 @@ static struct snd_soc_dai_driver cs4271_dai = { | |||
430 | }; | 430 | }; |
431 | 431 | ||
432 | #ifdef CONFIG_PM | 432 | #ifdef CONFIG_PM |
433 | static int cs4271_soc_suspend(struct snd_soc_codec *codec, pm_message_t mesg) | 433 | static int cs4271_soc_suspend(struct snd_soc_codec *codec) |
434 | { | 434 | { |
435 | int ret; | 435 | int ret; |
436 | /* Set power-down bit */ | 436 | /* Set power-down bit */ |
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 8c3c8205d19..a8bf588e874 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c | |||
@@ -22,7 +22,6 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
27 | #include <sound/core.h> | 26 | #include <sound/core.h> |
28 | #include <sound/soc.h> | 27 | #include <sound/soc.h> |
@@ -175,21 +174,18 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = { | |||
175 | static int cs42l51_pdn_event(struct snd_soc_dapm_widget *w, | 174 | static int cs42l51_pdn_event(struct snd_soc_dapm_widget *w, |
176 | struct snd_kcontrol *kcontrol, int event) | 175 | struct snd_kcontrol *kcontrol, int event) |
177 | { | 176 | { |
178 | unsigned long value; | ||
179 | |||
180 | value = snd_soc_read(w->codec, CS42L51_POWER_CTL1); | ||
181 | value &= ~CS42L51_POWER_CTL1_PDN; | ||
182 | |||
183 | switch (event) { | 177 | switch (event) { |
184 | case SND_SOC_DAPM_PRE_PMD: | 178 | case SND_SOC_DAPM_PRE_PMD: |
185 | value |= CS42L51_POWER_CTL1_PDN; | 179 | snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, |
180 | CS42L51_POWER_CTL1_PDN, | ||
181 | CS42L51_POWER_CTL1_PDN); | ||
186 | break; | 182 | break; |
187 | default: | 183 | default: |
188 | case SND_SOC_DAPM_POST_PMD: | 184 | case SND_SOC_DAPM_POST_PMD: |
185 | snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, | ||
186 | CS42L51_POWER_CTL1_PDN, 0); | ||
189 | break; | 187 | break; |
190 | } | 188 | } |
191 | snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1, | ||
192 | CS42L51_POWER_CTL1_PDN, value); | ||
193 | 189 | ||
194 | return 0; | 190 | return 0; |
195 | } | 191 | } |
@@ -486,7 +482,7 @@ static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute) | |||
486 | return snd_soc_write(codec, CS42L51_DAC_OUT_CTL, reg); | 482 | return snd_soc_write(codec, CS42L51_DAC_OUT_CTL, reg); |
487 | } | 483 | } |
488 | 484 | ||
489 | static struct snd_soc_dai_ops cs42l51_dai_ops = { | 485 | static const struct snd_soc_dai_ops cs42l51_dai_ops = { |
490 | .hw_params = cs42l51_hw_params, | 486 | .hw_params = cs42l51_hw_params, |
491 | .set_sysclk = cs42l51_set_dai_sysclk, | 487 | .set_sysclk = cs42l51_set_dai_sysclk, |
492 | .set_fmt = cs42l51_set_dai_fmt, | 488 | .set_fmt = cs42l51_set_dai_fmt, |
@@ -515,7 +511,6 @@ static struct snd_soc_dai_driver cs42l51_dai = { | |||
515 | static int cs42l51_probe(struct snd_soc_codec *codec) | 511 | static int cs42l51_probe(struct snd_soc_codec *codec) |
516 | { | 512 | { |
517 | struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec); | 513 | struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec); |
518 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
519 | int ret, reg; | 514 | int ret, reg; |
520 | 515 | ||
521 | ret = cs42l51_fill_cache(codec); | 516 | ret = cs42l51_fill_cache(codec); |
@@ -543,20 +538,20 @@ static int cs42l51_probe(struct snd_soc_codec *codec) | |||
543 | if (ret < 0) | 538 | if (ret < 0) |
544 | return ret; | 539 | return ret; |
545 | 540 | ||
546 | snd_soc_add_controls(codec, cs42l51_snd_controls, | ||
547 | ARRAY_SIZE(cs42l51_snd_controls)); | ||
548 | snd_soc_dapm_new_controls(dapm, cs42l51_dapm_widgets, | ||
549 | ARRAY_SIZE(cs42l51_dapm_widgets)); | ||
550 | snd_soc_dapm_add_routes(dapm, cs42l51_routes, | ||
551 | ARRAY_SIZE(cs42l51_routes)); | ||
552 | |||
553 | return 0; | 541 | return 0; |
554 | } | 542 | } |
555 | 543 | ||
556 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { | 544 | static struct snd_soc_codec_driver soc_codec_device_cs42l51 = { |
557 | .probe = cs42l51_probe, | 545 | .probe = cs42l51_probe, |
558 | .reg_cache_size = CS42L51_NUMREGS, | 546 | .reg_cache_size = CS42L51_NUMREGS + 1, |
559 | .reg_word_size = sizeof(u8), | 547 | .reg_word_size = sizeof(u8), |
548 | |||
549 | .controls = cs42l51_snd_controls, | ||
550 | .num_controls = ARRAY_SIZE(cs42l51_snd_controls), | ||
551 | .dapm_widgets = cs42l51_dapm_widgets, | ||
552 | .num_dapm_widgets = ARRAY_SIZE(cs42l51_dapm_widgets), | ||
553 | .dapm_routes = cs42l51_routes, | ||
554 | .num_dapm_routes = ARRAY_SIZE(cs42l51_routes), | ||
560 | }; | 555 | }; |
561 | 556 | ||
562 | static int cs42l51_i2c_probe(struct i2c_client *i2c_client, | 557 | static int cs42l51_i2c_probe(struct i2c_client *i2c_client, |
@@ -582,7 +577,8 @@ static int cs42l51_i2c_probe(struct i2c_client *i2c_client, | |||
582 | dev_info(&i2c_client->dev, "found device cs42l51 rev %d\n", | 577 | dev_info(&i2c_client->dev, "found device cs42l51 rev %d\n", |
583 | ret & 7); | 578 | ret & 7); |
584 | 579 | ||
585 | cs42l51 = kzalloc(sizeof(struct cs42l51_private), GFP_KERNEL); | 580 | cs42l51 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l51_private), |
581 | GFP_KERNEL); | ||
586 | if (!cs42l51) { | 582 | if (!cs42l51) { |
587 | dev_err(&i2c_client->dev, "could not allocate codec\n"); | 583 | dev_err(&i2c_client->dev, "could not allocate codec\n"); |
588 | return -ENOMEM; | 584 | return -ENOMEM; |
@@ -593,18 +589,13 @@ static int cs42l51_i2c_probe(struct i2c_client *i2c_client, | |||
593 | 589 | ||
594 | ret = snd_soc_register_codec(&i2c_client->dev, | 590 | ret = snd_soc_register_codec(&i2c_client->dev, |
595 | &soc_codec_device_cs42l51, &cs42l51_dai, 1); | 591 | &soc_codec_device_cs42l51, &cs42l51_dai, 1); |
596 | if (ret < 0) | ||
597 | kfree(cs42l51); | ||
598 | error: | 592 | error: |
599 | return ret; | 593 | return ret; |
600 | } | 594 | } |
601 | 595 | ||
602 | static int cs42l51_i2c_remove(struct i2c_client *client) | 596 | static int cs42l51_i2c_remove(struct i2c_client *client) |
603 | { | 597 | { |
604 | struct cs42l51_private *cs42l51 = i2c_get_clientdata(client); | ||
605 | |||
606 | snd_soc_unregister_codec(&client->dev); | 598 | snd_soc_unregister_codec(&client->dev); |
607 | kfree(cs42l51); | ||
608 | return 0; | 599 | return 0; |
609 | } | 600 | } |
610 | 601 | ||
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c new file mode 100644 index 00000000000..9d38db8f191 --- /dev/null +++ b/sound/soc/codecs/cs42l73.c | |||
@@ -0,0 +1,1453 @@ | |||
1 | /* | ||
2 | * cs42l73.c -- CS42L73 ALSA Soc Audio driver | ||
3 | * | ||
4 | * Copyright 2011 Cirrus Logic, Inc. | ||
5 | * | ||
6 | * Authors: Georgi Vlaev, Nucleus Systems Ltd, <joe@nucleusys.com> | ||
7 | * Brian Austin, Cirrus Logic Inc, <brian.austin@cirrus.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/moduleparam.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/pm.h> | ||
21 | #include <linux/i2c.h> | ||
22 | #include <linux/regmap.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <sound/core.h> | ||
25 | #include <sound/pcm.h> | ||
26 | #include <sound/pcm_params.h> | ||
27 | #include <sound/soc.h> | ||
28 | #include <sound/soc-dapm.h> | ||
29 | #include <sound/initval.h> | ||
30 | #include <sound/tlv.h> | ||
31 | #include "cs42l73.h" | ||
32 | |||
33 | struct sp_config { | ||
34 | u8 spc, mmcc, spfs; | ||
35 | u32 srate; | ||
36 | }; | ||
37 | struct cs42l73_private { | ||
38 | struct sp_config config[3]; | ||
39 | struct regmap *regmap; | ||
40 | u32 sysclk; | ||
41 | u8 mclksel; | ||
42 | u32 mclk; | ||
43 | }; | ||
44 | |||
45 | static const struct reg_default cs42l73_reg_defaults[] = { | ||
46 | { 1, 0x42 }, /* r01 - Device ID A&B */ | ||
47 | { 2, 0xA7 }, /* r02 - Device ID C&D */ | ||
48 | { 3, 0x30 }, /* r03 - Device ID E */ | ||
49 | { 6, 0xF1 }, /* r06 - Power Ctl 1 */ | ||
50 | { 7, 0xDF }, /* r07 - Power Ctl 2 */ | ||
51 | { 8, 0x3F }, /* r08 - Power Ctl 3 */ | ||
52 | { 9, 0x50 }, /* r09 - Charge Pump Freq */ | ||
53 | { 10, 0x53 }, /* r0A - Output Load MicBias Short Detect */ | ||
54 | { 11, 0x00 }, /* r0B - DMIC Master Clock Ctl */ | ||
55 | { 12, 0x00 }, /* r0C - Aux PCM Ctl */ | ||
56 | { 13, 0x15 }, /* r0D - Aux PCM Master Clock Ctl */ | ||
57 | { 14, 0x00 }, /* r0E - Audio PCM Ctl */ | ||
58 | { 15, 0x15 }, /* r0F - Audio PCM Master Clock Ctl */ | ||
59 | { 16, 0x00 }, /* r10 - Voice PCM Ctl */ | ||
60 | { 17, 0x15 }, /* r11 - Voice PCM Master Clock Ctl */ | ||
61 | { 18, 0x00 }, /* r12 - Voice/Aux Sample Rate */ | ||
62 | { 19, 0x06 }, /* r13 - Misc I/O Path Ctl */ | ||
63 | { 20, 0x00 }, /* r14 - ADC Input Path Ctl */ | ||
64 | { 21, 0x00 }, /* r15 - MICA Preamp, PGA Volume */ | ||
65 | { 22, 0x00 }, /* r16 - MICB Preamp, PGA Volume */ | ||
66 | { 23, 0x00 }, /* r17 - Input Path A Digital Volume */ | ||
67 | { 24, 0x00 }, /* r18 - Input Path B Digital Volume */ | ||
68 | { 25, 0x00 }, /* r19 - Playback Digital Ctl */ | ||
69 | { 26, 0x00 }, /* r1A - HP/LO Left Digital Volume */ | ||
70 | { 27, 0x00 }, /* r1B - HP/LO Right Digital Volume */ | ||
71 | { 28, 0x00 }, /* r1C - Speakerphone Digital Volume */ | ||
72 | { 29, 0x00 }, /* r1D - Ear/SPKLO Digital Volume */ | ||
73 | { 30, 0x00 }, /* r1E - HP Left Analog Volume */ | ||
74 | { 31, 0x00 }, /* r1F - HP Right Analog Volume */ | ||
75 | { 32, 0x00 }, /* r20 - LO Left Analog Volume */ | ||
76 | { 33, 0x00 }, /* r21 - LO Right Analog Volume */ | ||
77 | { 34, 0x00 }, /* r22 - Stereo Input Path Advisory Volume */ | ||
78 | { 35, 0x00 }, /* r23 - Aux PCM Input Advisory Volume */ | ||
79 | { 36, 0x00 }, /* r24 - Audio PCM Input Advisory Volume */ | ||
80 | { 37, 0x00 }, /* r25 - Voice PCM Input Advisory Volume */ | ||
81 | { 38, 0x00 }, /* r26 - Limiter Attack Rate HP/LO */ | ||
82 | { 39, 0x7F }, /* r27 - Limter Ctl, Release Rate HP/LO */ | ||
83 | { 40, 0x00 }, /* r28 - Limter Threshold HP/LO */ | ||
84 | { 41, 0x00 }, /* r29 - Limiter Attack Rate Speakerphone */ | ||
85 | { 42, 0x3F }, /* r2A - Limter Ctl, Release Rate Speakerphone */ | ||
86 | { 43, 0x00 }, /* r2B - Limter Threshold Speakerphone */ | ||
87 | { 44, 0x00 }, /* r2C - Limiter Attack Rate Ear/SPKLO */ | ||
88 | { 45, 0x3F }, /* r2D - Limter Ctl, Release Rate Ear/SPKLO */ | ||
89 | { 46, 0x00 }, /* r2E - Limter Threshold Ear/SPKLO */ | ||
90 | { 47, 0x00 }, /* r2F - ALC Enable, Attack Rate Left/Right */ | ||
91 | { 48, 0x3F }, /* r30 - ALC Release Rate Left/Right */ | ||
92 | { 49, 0x00 }, /* r31 - ALC Threshold Left/Right */ | ||
93 | { 50, 0x00 }, /* r32 - Noise Gate Ctl Left/Right */ | ||
94 | { 51, 0x00 }, /* r33 - ALC/NG Misc Ctl */ | ||
95 | { 52, 0x18 }, /* r34 - Mixer Ctl */ | ||
96 | { 53, 0x3F }, /* r35 - HP/LO Left Mixer Input Path Volume */ | ||
97 | { 54, 0x3F }, /* r36 - HP/LO Right Mixer Input Path Volume */ | ||
98 | { 55, 0x3F }, /* r37 - HP/LO Left Mixer Aux PCM Volume */ | ||
99 | { 56, 0x3F }, /* r38 - HP/LO Right Mixer Aux PCM Volume */ | ||
100 | { 57, 0x3F }, /* r39 - HP/LO Left Mixer Audio PCM Volume */ | ||
101 | { 58, 0x3F }, /* r3A - HP/LO Right Mixer Audio PCM Volume */ | ||
102 | { 59, 0x3F }, /* r3B - HP/LO Left Mixer Voice PCM Mono Volume */ | ||
103 | { 60, 0x3F }, /* r3C - HP/LO Right Mixer Voice PCM Mono Volume */ | ||
104 | { 61, 0x3F }, /* r3D - Aux PCM Left Mixer Input Path Volume */ | ||
105 | { 62, 0x3F }, /* r3E - Aux PCM Right Mixer Input Path Volume */ | ||
106 | { 63, 0x3F }, /* r3F - Aux PCM Left Mixer Volume */ | ||
107 | { 64, 0x3F }, /* r40 - Aux PCM Left Mixer Volume */ | ||
108 | { 65, 0x3F }, /* r41 - Aux PCM Left Mixer Audio PCM L Volume */ | ||
109 | { 66, 0x3F }, /* r42 - Aux PCM Right Mixer Audio PCM R Volume */ | ||
110 | { 67, 0x3F }, /* r43 - Aux PCM Left Mixer Voice PCM Volume */ | ||
111 | { 68, 0x3F }, /* r44 - Aux PCM Right Mixer Voice PCM Volume */ | ||
112 | { 69, 0x3F }, /* r45 - Audio PCM Left Input Path Volume */ | ||
113 | { 70, 0x3F }, /* r46 - Audio PCM Right Input Path Volume */ | ||
114 | { 71, 0x3F }, /* r47 - Audio PCM Left Mixer Aux PCM L Volume */ | ||
115 | { 72, 0x3F }, /* r48 - Audio PCM Right Mixer Aux PCM R Volume */ | ||
116 | { 73, 0x3F }, /* r49 - Audio PCM Left Mixer Volume */ | ||
117 | { 74, 0x3F }, /* r4A - Audio PCM Right Mixer Volume */ | ||
118 | { 75, 0x3F }, /* r4B - Audio PCM Left Mixer Voice PCM Volume */ | ||
119 | { 76, 0x3F }, /* r4C - Audio PCM Right Mixer Voice PCM Volume */ | ||
120 | { 77, 0x3F }, /* r4D - Voice PCM Left Input Path Volume */ | ||
121 | { 78, 0x3F }, /* r4E - Voice PCM Right Input Path Volume */ | ||
122 | { 79, 0x3F }, /* r4F - Voice PCM Left Mixer Aux PCM L Volume */ | ||
123 | { 80, 0x3F }, /* r50 - Voice PCM Right Mixer Aux PCM R Volume */ | ||
124 | { 81, 0x3F }, /* r51 - Voice PCM Left Mixer Audio PCM L Volume */ | ||
125 | { 82, 0x3F }, /* r52 - Voice PCM Right Mixer Audio PCM R Volume */ | ||
126 | { 83, 0x3F }, /* r53 - Voice PCM Left Mixer Voice PCM Volume */ | ||
127 | { 84, 0x3F }, /* r54 - Voice PCM Right Mixer Voice PCM Volume */ | ||
128 | { 85, 0xAA }, /* r55 - Mono Mixer Ctl */ | ||
129 | { 86, 0x3F }, /* r56 - SPK Mono Mixer Input Path Volume */ | ||
130 | { 87, 0x3F }, /* r57 - SPK Mono Mixer Aux PCM Mono/L/R Volume */ | ||
131 | { 88, 0x3F }, /* r58 - SPK Mono Mixer Audio PCM Mono/L/R Volume */ | ||
132 | { 89, 0x3F }, /* r59 - SPK Mono Mixer Voice PCM Mono Volume */ | ||
133 | { 90, 0x3F }, /* r5A - SPKLO Mono Mixer Input Path Mono Volume */ | ||
134 | { 91, 0x3F }, /* r5B - SPKLO Mono Mixer Aux Mono/L/R Volume */ | ||
135 | { 92, 0x3F }, /* r5C - SPKLO Mono Mixer Audio Mono/L/R Volume */ | ||
136 | { 93, 0x3F }, /* r5D - SPKLO Mono Mixer Voice Mono Volume */ | ||
137 | { 94, 0x00 }, /* r5E - Interrupt Mask 1 */ | ||
138 | { 95, 0x00 }, /* r5F - Interrupt Mask 2 */ | ||
139 | }; | ||
140 | |||
141 | static bool cs42l73_volatile_register(struct device *dev, unsigned int reg) | ||
142 | { | ||
143 | switch (reg) { | ||
144 | case CS42L73_IS1: | ||
145 | case CS42L73_IS2: | ||
146 | return true; | ||
147 | default: | ||
148 | return false; | ||
149 | } | ||
150 | } | ||
151 | |||
152 | static bool cs42l73_readable_register(struct device *dev, unsigned int reg) | ||
153 | { | ||
154 | switch (reg) { | ||
155 | case CS42L73_DEVID_AB: | ||
156 | case CS42L73_DEVID_CD: | ||
157 | case CS42L73_DEVID_E: | ||
158 | case CS42L73_REVID: | ||
159 | case CS42L73_PWRCTL1: | ||
160 | case CS42L73_PWRCTL2: | ||
161 | case CS42L73_PWRCTL3: | ||
162 | case CS42L73_CPFCHC: | ||
163 | case CS42L73_OLMBMSDC: | ||
164 | case CS42L73_DMMCC: | ||
165 | case CS42L73_XSPC: | ||
166 | case CS42L73_XSPMMCC: | ||
167 | case CS42L73_ASPC: | ||
168 | case CS42L73_ASPMMCC: | ||
169 | case CS42L73_VSPC: | ||
170 | case CS42L73_VSPMMCC: | ||
171 | case CS42L73_VXSPFS: | ||
172 | case CS42L73_MIOPC: | ||
173 | case CS42L73_ADCIPC: | ||
174 | case CS42L73_MICAPREPGAAVOL: | ||
175 | case CS42L73_MICBPREPGABVOL: | ||
176 | case CS42L73_IPADVOL: | ||
177 | case CS42L73_IPBDVOL: | ||
178 | case CS42L73_PBDC: | ||
179 | case CS42L73_HLADVOL: | ||
180 | case CS42L73_HLBDVOL: | ||
181 | case CS42L73_SPKDVOL: | ||
182 | case CS42L73_ESLDVOL: | ||
183 | case CS42L73_HPAAVOL: | ||
184 | case CS42L73_HPBAVOL: | ||
185 | case CS42L73_LOAAVOL: | ||
186 | case CS42L73_LOBAVOL: | ||
187 | case CS42L73_STRINV: | ||
188 | case CS42L73_XSPINV: | ||
189 | case CS42L73_ASPINV: | ||
190 | case CS42L73_VSPINV: | ||
191 | case CS42L73_LIMARATEHL: | ||
192 | case CS42L73_LIMRRATEHL: | ||
193 | case CS42L73_LMAXHL: | ||
194 | case CS42L73_LIMARATESPK: | ||
195 | case CS42L73_LIMRRATESPK: | ||
196 | case CS42L73_LMAXSPK: | ||
197 | case CS42L73_LIMARATEESL: | ||
198 | case CS42L73_LIMRRATEESL: | ||
199 | case CS42L73_LMAXESL: | ||
200 | case CS42L73_ALCARATE: | ||
201 | case CS42L73_ALCRRATE: | ||
202 | case CS42L73_ALCMINMAX: | ||
203 | case CS42L73_NGCAB: | ||
204 | case CS42L73_ALCNGMC: | ||
205 | case CS42L73_MIXERCTL: | ||
206 | case CS42L73_HLAIPAA: | ||
207 | case CS42L73_HLBIPBA: | ||
208 | case CS42L73_HLAXSPAA: | ||
209 | case CS42L73_HLBXSPBA: | ||
210 | case CS42L73_HLAASPAA: | ||
211 | case CS42L73_HLBASPBA: | ||
212 | case CS42L73_HLAVSPMA: | ||
213 | case CS42L73_HLBVSPMA: | ||
214 | case CS42L73_XSPAIPAA: | ||
215 | case CS42L73_XSPBIPBA: | ||
216 | case CS42L73_XSPAXSPAA: | ||
217 | case CS42L73_XSPBXSPBA: | ||
218 | case CS42L73_XSPAASPAA: | ||
219 | case CS42L73_XSPAASPBA: | ||
220 | case CS42L73_XSPAVSPMA: | ||
221 | case CS42L73_XSPBVSPMA: | ||
222 | case CS42L73_ASPAIPAA: | ||
223 | case CS42L73_ASPBIPBA: | ||
224 | case CS42L73_ASPAXSPAA: | ||
225 | case CS42L73_ASPBXSPBA: | ||
226 | case CS42L73_ASPAASPAA: | ||
227 | case CS42L73_ASPBASPBA: | ||
228 | case CS42L73_ASPAVSPMA: | ||
229 | case CS42L73_ASPBVSPMA: | ||
230 | case CS42L73_VSPAIPAA: | ||
231 | case CS42L73_VSPBIPBA: | ||
232 | case CS42L73_VSPAXSPAA: | ||
233 | case CS42L73_VSPBXSPBA: | ||
234 | case CS42L73_VSPAASPAA: | ||
235 | case CS42L73_VSPBASPBA: | ||
236 | case CS42L73_VSPAVSPMA: | ||
237 | case CS42L73_VSPBVSPMA: | ||
238 | case CS42L73_MMIXCTL: | ||
239 | case CS42L73_SPKMIPMA: | ||
240 | case CS42L73_SPKMXSPA: | ||
241 | case CS42L73_SPKMASPA: | ||
242 | case CS42L73_SPKMVSPMA: | ||
243 | case CS42L73_ESLMIPMA: | ||
244 | case CS42L73_ESLMXSPA: | ||
245 | case CS42L73_ESLMASPA: | ||
246 | case CS42L73_ESLMVSPMA: | ||
247 | case CS42L73_IM1: | ||
248 | case CS42L73_IM2: | ||
249 | return true; | ||
250 | default: | ||
251 | return false; | ||
252 | } | ||
253 | } | ||
254 | |||
255 | static const unsigned int hpaloa_tlv[] = { | ||
256 | TLV_DB_RANGE_HEAD(2), | ||
257 | 0, 13, TLV_DB_SCALE_ITEM(-7600, 200, 0), | ||
258 | 14, 75, TLV_DB_SCALE_ITEM(-4900, 100, 0), | ||
259 | }; | ||
260 | |||
261 | static DECLARE_TLV_DB_SCALE(adc_boost_tlv, 0, 2500, 0); | ||
262 | |||
263 | static DECLARE_TLV_DB_SCALE(hl_tlv, -10200, 50, 0); | ||
264 | |||
265 | static DECLARE_TLV_DB_SCALE(ipd_tlv, -9600, 100, 0); | ||
266 | |||
267 | static DECLARE_TLV_DB_SCALE(micpga_tlv, -600, 50, 0); | ||
268 | |||
269 | static const unsigned int limiter_tlv[] = { | ||
270 | TLV_DB_RANGE_HEAD(2), | ||
271 | 0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0), | ||
272 | 3, 7, TLV_DB_SCALE_ITEM(-1200, 300, 0), | ||
273 | }; | ||
274 | |||
275 | static const DECLARE_TLV_DB_SCALE(attn_tlv, -6300, 100, 1); | ||
276 | |||
277 | static const char * const cs42l73_pgaa_text[] = { "Line A", "Mic 1" }; | ||
278 | static const char * const cs42l73_pgab_text[] = { "Line B", "Mic 2" }; | ||
279 | |||
280 | static const struct soc_enum pgaa_enum = | ||
281 | SOC_ENUM_SINGLE(CS42L73_ADCIPC, 3, | ||
282 | ARRAY_SIZE(cs42l73_pgaa_text), cs42l73_pgaa_text); | ||
283 | |||
284 | static const struct soc_enum pgab_enum = | ||
285 | SOC_ENUM_SINGLE(CS42L73_ADCIPC, 7, | ||
286 | ARRAY_SIZE(cs42l73_pgab_text), cs42l73_pgab_text); | ||
287 | |||
288 | static const struct snd_kcontrol_new pgaa_mux = | ||
289 | SOC_DAPM_ENUM("Left Analog Input Capture Mux", pgaa_enum); | ||
290 | |||
291 | static const struct snd_kcontrol_new pgab_mux = | ||
292 | SOC_DAPM_ENUM("Right Analog Input Capture Mux", pgab_enum); | ||
293 | |||
294 | static const struct snd_kcontrol_new input_left_mixer[] = { | ||
295 | SOC_DAPM_SINGLE("ADC Left Input", CS42L73_PWRCTL1, | ||
296 | 5, 1, 1), | ||
297 | SOC_DAPM_SINGLE("DMIC Left Input", CS42L73_PWRCTL1, | ||
298 | 4, 1, 1), | ||
299 | }; | ||
300 | |||
301 | static const struct snd_kcontrol_new input_right_mixer[] = { | ||
302 | SOC_DAPM_SINGLE("ADC Right Input", CS42L73_PWRCTL1, | ||
303 | 7, 1, 1), | ||
304 | SOC_DAPM_SINGLE("DMIC Right Input", CS42L73_PWRCTL1, | ||
305 | 6, 1, 1), | ||
306 | }; | ||
307 | |||
308 | static const char * const cs42l73_ng_delay_text[] = { | ||
309 | "50ms", "100ms", "150ms", "200ms" }; | ||
310 | |||
311 | static const struct soc_enum ng_delay_enum = | ||
312 | SOC_ENUM_SINGLE(CS42L73_NGCAB, 0, | ||
313 | ARRAY_SIZE(cs42l73_ng_delay_text), cs42l73_ng_delay_text); | ||
314 | |||
315 | static const char * const charge_pump_freq_text[] = { | ||
316 | "0", "1", "2", "3", "4", | ||
317 | "5", "6", "7", "8", "9", | ||
318 | "10", "11", "12", "13", "14", "15" }; | ||
319 | |||
320 | static const struct soc_enum charge_pump_enum = | ||
321 | SOC_ENUM_SINGLE(CS42L73_CPFCHC, 4, | ||
322 | ARRAY_SIZE(charge_pump_freq_text), charge_pump_freq_text); | ||
323 | |||
324 | static const char * const cs42l73_mono_mix_texts[] = { | ||
325 | "Left", "Right", "Mono Mix"}; | ||
326 | |||
327 | static const unsigned int cs42l73_mono_mix_values[] = { 0, 1, 2 }; | ||
328 | |||
329 | static const struct soc_enum spk_asp_enum = | ||
330 | SOC_VALUE_ENUM_SINGLE(CS42L73_MMIXCTL, 6, 1, | ||
331 | ARRAY_SIZE(cs42l73_mono_mix_texts), | ||
332 | cs42l73_mono_mix_texts, | ||
333 | cs42l73_mono_mix_values); | ||
334 | |||
335 | static const struct snd_kcontrol_new spk_asp_mixer = | ||
336 | SOC_DAPM_ENUM("Route", spk_asp_enum); | ||
337 | |||
338 | static const struct soc_enum spk_xsp_enum = | ||
339 | SOC_VALUE_ENUM_SINGLE(CS42L73_MMIXCTL, 4, 3, | ||
340 | ARRAY_SIZE(cs42l73_mono_mix_texts), | ||
341 | cs42l73_mono_mix_texts, | ||
342 | cs42l73_mono_mix_values); | ||
343 | |||
344 | static const struct snd_kcontrol_new spk_xsp_mixer = | ||
345 | SOC_DAPM_ENUM("Route", spk_xsp_enum); | ||
346 | |||
347 | static const struct soc_enum esl_asp_enum = | ||
348 | SOC_VALUE_ENUM_SINGLE(CS42L73_MMIXCTL, 2, 5, | ||
349 | ARRAY_SIZE(cs42l73_mono_mix_texts), | ||
350 | cs42l73_mono_mix_texts, | ||
351 | cs42l73_mono_mix_values); | ||
352 | |||
353 | static const struct snd_kcontrol_new esl_asp_mixer = | ||
354 | SOC_DAPM_ENUM("Route", esl_asp_enum); | ||
355 | |||
356 | static const struct soc_enum esl_xsp_enum = | ||
357 | SOC_VALUE_ENUM_SINGLE(CS42L73_MMIXCTL, 0, 7, | ||
358 | ARRAY_SIZE(cs42l73_mono_mix_texts), | ||
359 | cs42l73_mono_mix_texts, | ||
360 | cs42l73_mono_mix_values); | ||
361 | |||
362 | static const struct snd_kcontrol_new esl_xsp_mixer = | ||
363 | SOC_DAPM_ENUM("Route", esl_xsp_enum); | ||
364 | |||
365 | static const char * const cs42l73_ip_swap_text[] = { | ||
366 | "Stereo", "Mono A", "Mono B", "Swap A-B"}; | ||
367 | |||
368 | static const struct soc_enum ip_swap_enum = | ||
369 | SOC_ENUM_SINGLE(CS42L73_MIOPC, 6, | ||
370 | ARRAY_SIZE(cs42l73_ip_swap_text), cs42l73_ip_swap_text); | ||
371 | |||
372 | static const char * const cs42l73_spo_mixer_text[] = {"Mono", "Stereo"}; | ||
373 | |||
374 | static const struct soc_enum vsp_output_mux_enum = | ||
375 | SOC_ENUM_SINGLE(CS42L73_MIXERCTL, 5, | ||
376 | ARRAY_SIZE(cs42l73_spo_mixer_text), cs42l73_spo_mixer_text); | ||
377 | |||
378 | static const struct soc_enum xsp_output_mux_enum = | ||
379 | SOC_ENUM_SINGLE(CS42L73_MIXERCTL, 4, | ||
380 | ARRAY_SIZE(cs42l73_spo_mixer_text), cs42l73_spo_mixer_text); | ||
381 | |||
382 | static const struct snd_kcontrol_new vsp_output_mux = | ||
383 | SOC_DAPM_ENUM("Route", vsp_output_mux_enum); | ||
384 | |||
385 | static const struct snd_kcontrol_new xsp_output_mux = | ||
386 | SOC_DAPM_ENUM("Route", xsp_output_mux_enum); | ||
387 | |||
388 | static const struct snd_kcontrol_new hp_amp_ctl = | ||
389 | SOC_DAPM_SINGLE("Switch", CS42L73_PWRCTL3, 0, 1, 1); | ||
390 | |||
391 | static const struct snd_kcontrol_new lo_amp_ctl = | ||
392 | SOC_DAPM_SINGLE("Switch", CS42L73_PWRCTL3, 1, 1, 1); | ||
393 | |||
394 | static const struct snd_kcontrol_new spk_amp_ctl = | ||
395 | SOC_DAPM_SINGLE("Switch", CS42L73_PWRCTL3, 2, 1, 1); | ||
396 | |||
397 | static const struct snd_kcontrol_new spklo_amp_ctl = | ||
398 | SOC_DAPM_SINGLE("Switch", CS42L73_PWRCTL3, 4, 1, 1); | ||
399 | |||
400 | static const struct snd_kcontrol_new ear_amp_ctl = | ||
401 | SOC_DAPM_SINGLE("Switch", CS42L73_PWRCTL3, 3, 1, 1); | ||
402 | |||
403 | static const struct snd_kcontrol_new cs42l73_snd_controls[] = { | ||
404 | SOC_DOUBLE_R_SX_TLV("Headphone Analog Playback Volume", | ||
405 | CS42L73_HPAAVOL, CS42L73_HPBAVOL, 7, | ||
406 | 0xffffffC1, 0x0C, hpaloa_tlv), | ||
407 | |||
408 | SOC_DOUBLE_R_SX_TLV("LineOut Analog Playback Volume", CS42L73_LOAAVOL, | ||
409 | CS42L73_LOBAVOL, 7, 0xffffffC1, 0x0C, hpaloa_tlv), | ||
410 | |||
411 | SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL, | ||
412 | CS42L73_MICBPREPGABVOL, 5, 0xffffff35, | ||
413 | 0x34, micpga_tlv), | ||
414 | |||
415 | SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL, | ||
416 | CS42L73_MICBPREPGABVOL, 6, 1, 1), | ||
417 | |||
418 | SOC_DOUBLE_R_SX_TLV("Input Path Digital Volume", CS42L73_IPADVOL, | ||
419 | CS42L73_IPBDVOL, 7, 0xffffffA0, 0xA0, ipd_tlv), | ||
420 | |||
421 | SOC_DOUBLE_R_SX_TLV("HL Digital Playback Volume", | ||
422 | CS42L73_HLADVOL, CS42L73_HLBDVOL, 7, 0xffffffE5, | ||
423 | 0xE4, hl_tlv), | ||
424 | |||
425 | SOC_SINGLE_TLV("ADC A Boost Volume", | ||
426 | CS42L73_ADCIPC, 2, 0x01, 1, adc_boost_tlv), | ||
427 | |||
428 | SOC_SINGLE_TLV("ADC B Boost Volume", | ||
429 | CS42L73_ADCIPC, 6, 0x01, 1, adc_boost_tlv), | ||
430 | |||
431 | SOC_SINGLE_TLV("Speakerphone Digital Playback Volume", | ||
432 | CS42L73_SPKDVOL, 0, 0xE4, 1, hl_tlv), | ||
433 | |||
434 | SOC_SINGLE_TLV("Ear Speaker Digital Playback Volume", | ||
435 | CS42L73_ESLDVOL, 0, 0xE4, 1, hl_tlv), | ||
436 | |||
437 | SOC_DOUBLE_R("Headphone Analog Playback Switch", CS42L73_HPAAVOL, | ||
438 | CS42L73_HPBAVOL, 7, 1, 1), | ||
439 | |||
440 | SOC_DOUBLE_R("LineOut Analog Playback Switch", CS42L73_LOAAVOL, | ||
441 | CS42L73_LOBAVOL, 7, 1, 1), | ||
442 | SOC_DOUBLE("Input Path Digital Switch", CS42L73_ADCIPC, 0, 4, 1, 1), | ||
443 | SOC_DOUBLE("HL Digital Playback Switch", CS42L73_PBDC, 0, | ||
444 | 1, 1, 1), | ||
445 | SOC_SINGLE("Speakerphone Digital Playback Switch", CS42L73_PBDC, 2, 1, | ||
446 | 1), | ||
447 | SOC_SINGLE("Ear Speaker Digital Playback Switch", CS42L73_PBDC, 3, 1, | ||
448 | 1), | ||
449 | |||
450 | SOC_SINGLE("PGA Soft-Ramp Switch", CS42L73_MIOPC, 3, 1, 0), | ||
451 | SOC_SINGLE("Analog Zero Cross Switch", CS42L73_MIOPC, 2, 1, 0), | ||
452 | SOC_SINGLE("Digital Soft-Ramp Switch", CS42L73_MIOPC, 1, 1, 0), | ||
453 | SOC_SINGLE("Analog Output Soft-Ramp Switch", CS42L73_MIOPC, 0, 1, 0), | ||
454 | |||
455 | SOC_DOUBLE("ADC Signal Polarity Switch", CS42L73_ADCIPC, 1, 5, 1, | ||
456 | 0), | ||
457 | |||
458 | SOC_SINGLE("HL Limiter Attack Rate", CS42L73_LIMARATEHL, 0, 0x3F, | ||
459 | 0), | ||
460 | SOC_SINGLE("HL Limiter Release Rate", CS42L73_LIMRRATEHL, 0, | ||
461 | 0x3F, 0), | ||
462 | |||
463 | |||
464 | SOC_SINGLE("HL Limiter Switch", CS42L73_LIMRRATEHL, 7, 1, 0), | ||
465 | SOC_SINGLE("HL Limiter All Channels Switch", CS42L73_LIMRRATEHL, 6, 1, | ||
466 | 0), | ||
467 | |||
468 | SOC_SINGLE_TLV("HL Limiter Max Threshold Volume", CS42L73_LMAXHL, 5, 7, | ||
469 | 1, limiter_tlv), | ||
470 | |||
471 | SOC_SINGLE_TLV("HL Limiter Cushion Volume", CS42L73_LMAXHL, 2, 7, 1, | ||
472 | limiter_tlv), | ||
473 | |||
474 | SOC_SINGLE("SPK Limiter Attack Rate Volume", CS42L73_LIMARATESPK, 0, | ||
475 | 0x3F, 0), | ||
476 | SOC_SINGLE("SPK Limiter Release Rate Volume", CS42L73_LIMRRATESPK, 0, | ||
477 | 0x3F, 0), | ||
478 | SOC_SINGLE("SPK Limiter Switch", CS42L73_LIMRRATESPK, 7, 1, 0), | ||
479 | SOC_SINGLE("SPK Limiter All Channels Switch", CS42L73_LIMRRATESPK, | ||
480 | 6, 1, 0), | ||
481 | SOC_SINGLE_TLV("SPK Limiter Max Threshold Volume", CS42L73_LMAXSPK, 5, | ||
482 | 7, 1, limiter_tlv), | ||
483 | |||
484 | SOC_SINGLE_TLV("SPK Limiter Cushion Volume", CS42L73_LMAXSPK, 2, 7, 1, | ||
485 | limiter_tlv), | ||
486 | |||
487 | SOC_SINGLE("ESL Limiter Attack Rate Volume", CS42L73_LIMARATEESL, 0, | ||
488 | 0x3F, 0), | ||
489 | SOC_SINGLE("ESL Limiter Release Rate Volume", CS42L73_LIMRRATEESL, 0, | ||
490 | 0x3F, 0), | ||
491 | SOC_SINGLE("ESL Limiter Switch", CS42L73_LIMRRATEESL, 7, 1, 0), | ||
492 | SOC_SINGLE_TLV("ESL Limiter Max Threshold Volume", CS42L73_LMAXESL, 5, | ||
493 | 7, 1, limiter_tlv), | ||
494 | |||
495 | SOC_SINGLE_TLV("ESL Limiter Cushion Volume", CS42L73_LMAXESL, 2, 7, 1, | ||
496 | limiter_tlv), | ||
497 | |||
498 | SOC_SINGLE("ALC Attack Rate Volume", CS42L73_ALCARATE, 0, 0x3F, 0), | ||
499 | SOC_SINGLE("ALC Release Rate Volume", CS42L73_ALCRRATE, 0, 0x3F, 0), | ||
500 | SOC_DOUBLE("ALC Switch", CS42L73_ALCARATE, 6, 7, 1, 0), | ||
501 | SOC_SINGLE_TLV("ALC Max Threshold Volume", CS42L73_ALCMINMAX, 5, 7, 0, | ||
502 | limiter_tlv), | ||
503 | SOC_SINGLE_TLV("ALC Min Threshold Volume", CS42L73_ALCMINMAX, 2, 7, 0, | ||
504 | limiter_tlv), | ||
505 | |||
506 | SOC_DOUBLE("NG Enable Switch", CS42L73_NGCAB, 6, 7, 1, 0), | ||
507 | SOC_SINGLE("NG Boost Switch", CS42L73_NGCAB, 5, 1, 0), | ||
508 | /* | ||
509 | NG Threshold depends on NG_BOOTSAB, which selects | ||
510 | between two threshold scales in decibels. | ||
511 | Set linear values for now .. | ||
512 | */ | ||
513 | SOC_SINGLE("NG Threshold", CS42L73_NGCAB, 2, 7, 0), | ||
514 | SOC_ENUM("NG Delay", ng_delay_enum), | ||
515 | |||
516 | SOC_ENUM("Charge Pump Frequency", charge_pump_enum), | ||
517 | |||
518 | SOC_DOUBLE_R_TLV("XSP-IP Volume", | ||
519 | CS42L73_XSPAIPAA, CS42L73_XSPBIPBA, 0, 0x3F, 1, | ||
520 | attn_tlv), | ||
521 | SOC_DOUBLE_R_TLV("XSP-XSP Volume", | ||
522 | CS42L73_XSPAXSPAA, CS42L73_XSPBXSPBA, 0, 0x3F, 1, | ||
523 | attn_tlv), | ||
524 | SOC_DOUBLE_R_TLV("XSP-ASP Volume", | ||
525 | CS42L73_XSPAASPAA, CS42L73_XSPAASPBA, 0, 0x3F, 1, | ||
526 | attn_tlv), | ||
527 | SOC_DOUBLE_R_TLV("XSP-VSP Volume", | ||
528 | CS42L73_XSPAVSPMA, CS42L73_XSPBVSPMA, 0, 0x3F, 1, | ||
529 | attn_tlv), | ||
530 | |||
531 | SOC_DOUBLE_R_TLV("ASP-IP Volume", | ||
532 | CS42L73_ASPAIPAA, CS42L73_ASPBIPBA, 0, 0x3F, 1, | ||
533 | attn_tlv), | ||
534 | SOC_DOUBLE_R_TLV("ASP-XSP Volume", | ||
535 | CS42L73_ASPAXSPAA, CS42L73_ASPBXSPBA, 0, 0x3F, 1, | ||
536 | attn_tlv), | ||
537 | SOC_DOUBLE_R_TLV("ASP-ASP Volume", | ||
538 | CS42L73_ASPAASPAA, CS42L73_ASPBASPBA, 0, 0x3F, 1, | ||
539 | attn_tlv), | ||
540 | SOC_DOUBLE_R_TLV("ASP-VSP Volume", | ||
541 | CS42L73_ASPAVSPMA, CS42L73_ASPBVSPMA, 0, 0x3F, 1, | ||
542 | attn_tlv), | ||
543 | |||
544 | SOC_DOUBLE_R_TLV("VSP-IP Volume", | ||
545 | CS42L73_VSPAIPAA, CS42L73_VSPBIPBA, 0, 0x3F, 1, | ||
546 | attn_tlv), | ||
547 | SOC_DOUBLE_R_TLV("VSP-XSP Volume", | ||
548 | CS42L73_VSPAXSPAA, CS42L73_VSPBXSPBA, 0, 0x3F, 1, | ||
549 | attn_tlv), | ||
550 | SOC_DOUBLE_R_TLV("VSP-ASP Volume", | ||
551 | CS42L73_VSPAASPAA, CS42L73_VSPBASPBA, 0, 0x3F, 1, | ||
552 | attn_tlv), | ||
553 | SOC_DOUBLE_R_TLV("VSP-VSP Volume", | ||
554 | CS42L73_VSPAVSPMA, CS42L73_VSPBVSPMA, 0, 0x3F, 1, | ||
555 | attn_tlv), | ||
556 | |||
557 | SOC_DOUBLE_R_TLV("HL-IP Volume", | ||
558 | CS42L73_HLAIPAA, CS42L73_HLBIPBA, 0, 0x3F, 1, | ||
559 | attn_tlv), | ||
560 | SOC_DOUBLE_R_TLV("HL-XSP Volume", | ||
561 | CS42L73_HLAXSPAA, CS42L73_HLBXSPBA, 0, 0x3F, 1, | ||
562 | attn_tlv), | ||
563 | SOC_DOUBLE_R_TLV("HL-ASP Volume", | ||
564 | CS42L73_HLAASPAA, CS42L73_HLBASPBA, 0, 0x3F, 1, | ||
565 | attn_tlv), | ||
566 | SOC_DOUBLE_R_TLV("HL-VSP Volume", | ||
567 | CS42L73_HLAVSPMA, CS42L73_HLBVSPMA, 0, 0x3F, 1, | ||
568 | attn_tlv), | ||
569 | |||
570 | SOC_SINGLE_TLV("SPK-IP Mono Volume", | ||
571 | CS42L73_SPKMIPMA, 0, 0x3E, 1, attn_tlv), | ||
572 | SOC_SINGLE_TLV("SPK-XSP Mono Volume", | ||
573 | CS42L73_SPKMXSPA, 0, 0x3E, 1, attn_tlv), | ||
574 | SOC_SINGLE_TLV("SPK-ASP Mono Volume", | ||
575 | CS42L73_SPKMASPA, 0, 0x3E, 1, attn_tlv), | ||
576 | SOC_SINGLE_TLV("SPK-VSP Mono Volume", | ||
577 | CS42L73_SPKMVSPMA, 0, 0x3E, 1, attn_tlv), | ||
578 | |||
579 | SOC_SINGLE_TLV("ESL-IP Mono Volume", | ||
580 | CS42L73_ESLMIPMA, 0, 0x3E, 1, attn_tlv), | ||
581 | SOC_SINGLE_TLV("ESL-XSP Mono Volume", | ||
582 | CS42L73_ESLMXSPA, 0, 0x3E, 1, attn_tlv), | ||
583 | SOC_SINGLE_TLV("ESL-ASP Mono Volume", | ||
584 | CS42L73_ESLMASPA, 0, 0x3E, 1, attn_tlv), | ||
585 | SOC_SINGLE_TLV("ESL-VSP Mono Volume", | ||
586 | CS42L73_ESLMVSPMA, 0, 0x3E, 1, attn_tlv), | ||
587 | |||
588 | SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), | ||
589 | |||
590 | SOC_ENUM("VSPOUT Mono/Stereo Select", vsp_output_mux_enum), | ||
591 | SOC_ENUM("XSPOUT Mono/Stereo Select", xsp_output_mux_enum), | ||
592 | }; | ||
593 | |||
594 | static const struct snd_soc_dapm_widget cs42l73_dapm_widgets[] = { | ||
595 | SND_SOC_DAPM_INPUT("LINEINA"), | ||
596 | SND_SOC_DAPM_INPUT("LINEINB"), | ||
597 | SND_SOC_DAPM_INPUT("MIC1"), | ||
598 | SND_SOC_DAPM_SUPPLY("MIC1 Bias", CS42L73_PWRCTL2, 6, 1, NULL, 0), | ||
599 | SND_SOC_DAPM_INPUT("MIC2"), | ||
600 | SND_SOC_DAPM_SUPPLY("MIC2 Bias", CS42L73_PWRCTL2, 7, 1, NULL, 0), | ||
601 | |||
602 | SND_SOC_DAPM_AIF_OUT("XSPOUTL", "XSP Capture", 0, | ||
603 | CS42L73_PWRCTL2, 1, 1), | ||
604 | SND_SOC_DAPM_AIF_OUT("XSPOUTR", "XSP Capture", 0, | ||
605 | CS42L73_PWRCTL2, 1, 1), | ||
606 | SND_SOC_DAPM_AIF_OUT("ASPOUTL", "ASP Capture", 0, | ||
607 | CS42L73_PWRCTL2, 3, 1), | ||
608 | SND_SOC_DAPM_AIF_OUT("ASPOUTR", "ASP Capture", 0, | ||
609 | CS42L73_PWRCTL2, 3, 1), | ||
610 | SND_SOC_DAPM_AIF_OUT("VSPOUTL", "VSP Capture", 0, | ||
611 | CS42L73_PWRCTL2, 4, 1), | ||
612 | SND_SOC_DAPM_AIF_OUT("VSPOUTR", "VSP Capture", 0, | ||
613 | CS42L73_PWRCTL2, 4, 1), | ||
614 | |||
615 | SND_SOC_DAPM_PGA("PGA Left", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
616 | SND_SOC_DAPM_PGA("PGA Right", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
617 | |||
618 | SND_SOC_DAPM_MUX("PGA Left Mux", SND_SOC_NOPM, 0, 0, &pgaa_mux), | ||
619 | SND_SOC_DAPM_MUX("PGA Right Mux", SND_SOC_NOPM, 0, 0, &pgab_mux), | ||
620 | |||
621 | SND_SOC_DAPM_ADC("ADC Left", NULL, CS42L73_PWRCTL1, 7, 1), | ||
622 | SND_SOC_DAPM_ADC("ADC Right", NULL, CS42L73_PWRCTL1, 5, 1), | ||
623 | SND_SOC_DAPM_ADC("DMIC Left", NULL, CS42L73_PWRCTL1, 6, 1), | ||
624 | SND_SOC_DAPM_ADC("DMIC Right", NULL, CS42L73_PWRCTL1, 4, 1), | ||
625 | |||
626 | SND_SOC_DAPM_MIXER_NAMED_CTL("Input Left Capture", SND_SOC_NOPM, | ||
627 | 0, 0, input_left_mixer, | ||
628 | ARRAY_SIZE(input_left_mixer)), | ||
629 | |||
630 | SND_SOC_DAPM_MIXER_NAMED_CTL("Input Right Capture", SND_SOC_NOPM, | ||
631 | 0, 0, input_right_mixer, | ||
632 | ARRAY_SIZE(input_right_mixer)), | ||
633 | |||
634 | SND_SOC_DAPM_MIXER("ASPL Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
635 | SND_SOC_DAPM_MIXER("ASPR Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
636 | SND_SOC_DAPM_MIXER("XSPL Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
637 | SND_SOC_DAPM_MIXER("XSPR Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
638 | SND_SOC_DAPM_MIXER("VSPL Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
639 | SND_SOC_DAPM_MIXER("VSPR Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
640 | |||
641 | SND_SOC_DAPM_AIF_IN("XSPINL", "XSP Playback", 0, | ||
642 | CS42L73_PWRCTL2, 0, 1), | ||
643 | SND_SOC_DAPM_AIF_IN("XSPINR", "XSP Playback", 0, | ||
644 | CS42L73_PWRCTL2, 0, 1), | ||
645 | SND_SOC_DAPM_AIF_IN("XSPINM", "XSP Playback", 0, | ||
646 | CS42L73_PWRCTL2, 0, 1), | ||
647 | |||
648 | SND_SOC_DAPM_AIF_IN("ASPINL", "ASP Playback", 0, | ||
649 | CS42L73_PWRCTL2, 2, 1), | ||
650 | SND_SOC_DAPM_AIF_IN("ASPINR", "ASP Playback", 0, | ||
651 | CS42L73_PWRCTL2, 2, 1), | ||
652 | SND_SOC_DAPM_AIF_IN("ASPINM", "ASP Playback", 0, | ||
653 | CS42L73_PWRCTL2, 2, 1), | ||
654 | |||
655 | SND_SOC_DAPM_AIF_IN("VSPIN", "VSP Playback", 0, | ||
656 | CS42L73_PWRCTL2, 4, 1), | ||
657 | |||
658 | SND_SOC_DAPM_MIXER("HL Left Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
659 | SND_SOC_DAPM_MIXER("HL Right Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
660 | SND_SOC_DAPM_MIXER("SPK Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
661 | SND_SOC_DAPM_MIXER("ESL Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
662 | |||
663 | SND_SOC_DAPM_MUX("ESL-XSP Mux", SND_SOC_NOPM, | ||
664 | 0, 0, &esl_xsp_mixer), | ||
665 | |||
666 | SND_SOC_DAPM_MUX("ESL-ASP Mux", SND_SOC_NOPM, | ||
667 | 0, 0, &esl_asp_mixer), | ||
668 | |||
669 | SND_SOC_DAPM_MUX("SPK-ASP Mux", SND_SOC_NOPM, | ||
670 | 0, 0, &spk_asp_mixer), | ||
671 | |||
672 | SND_SOC_DAPM_MUX("SPK-XSP Mux", SND_SOC_NOPM, | ||
673 | 0, 0, &spk_xsp_mixer), | ||
674 | |||
675 | SND_SOC_DAPM_PGA("HL Left DAC", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
676 | SND_SOC_DAPM_PGA("HL Right DAC", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
677 | SND_SOC_DAPM_PGA("SPK DAC", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
678 | SND_SOC_DAPM_PGA("ESL DAC", SND_SOC_NOPM, 0, 0, NULL, 0), | ||
679 | |||
680 | SND_SOC_DAPM_SWITCH("HP Amp", CS42L73_PWRCTL3, 0, 1, | ||
681 | &hp_amp_ctl), | ||
682 | SND_SOC_DAPM_SWITCH("LO Amp", CS42L73_PWRCTL3, 1, 1, | ||
683 | &lo_amp_ctl), | ||
684 | SND_SOC_DAPM_SWITCH("SPK Amp", CS42L73_PWRCTL3, 2, 1, | ||
685 | &spk_amp_ctl), | ||
686 | SND_SOC_DAPM_SWITCH("EAR Amp", CS42L73_PWRCTL3, 3, 1, | ||
687 | &ear_amp_ctl), | ||
688 | SND_SOC_DAPM_SWITCH("SPKLO Amp", CS42L73_PWRCTL3, 4, 1, | ||
689 | &spklo_amp_ctl), | ||
690 | |||
691 | SND_SOC_DAPM_OUTPUT("HPOUTA"), | ||
692 | SND_SOC_DAPM_OUTPUT("HPOUTB"), | ||
693 | SND_SOC_DAPM_OUTPUT("LINEOUTA"), | ||
694 | SND_SOC_DAPM_OUTPUT("LINEOUTB"), | ||
695 | SND_SOC_DAPM_OUTPUT("EAROUT"), | ||
696 | SND_SOC_DAPM_OUTPUT("SPKOUT"), | ||
697 | SND_SOC_DAPM_OUTPUT("SPKLINEOUT"), | ||
698 | }; | ||
699 | |||
700 | static const struct snd_soc_dapm_route cs42l73_audio_map[] = { | ||
701 | |||
702 | /* SPKLO EARSPK Paths */ | ||
703 | {"EAROUT", NULL, "EAR Amp"}, | ||
704 | {"SPKLINEOUT", NULL, "SPKLO Amp"}, | ||
705 | |||
706 | {"EAR Amp", "Switch", "ESL DAC"}, | ||
707 | {"SPKLO Amp", "Switch", "ESL DAC"}, | ||
708 | |||
709 | {"ESL DAC", "ESL-ASP Mono Volume", "ESL Mixer"}, | ||
710 | {"ESL DAC", "ESL-XSP Mono Volume", "ESL Mixer"}, | ||
711 | {"ESL DAC", "ESL-VSP Mono Volume", "VSPIN"}, | ||
712 | /* Loopback */ | ||
713 | {"ESL DAC", "ESL-IP Mono Volume", "Input Left Capture"}, | ||
714 | {"ESL DAC", "ESL-IP Mono Volume", "Input Right Capture"}, | ||
715 | |||
716 | {"ESL Mixer", NULL, "ESL-ASP Mux"}, | ||
717 | {"ESL Mixer", NULL, "ESL-XSP Mux"}, | ||
718 | |||
719 | {"ESL-ASP Mux", "Left", "ASPINL"}, | ||
720 | {"ESL-ASP Mux", "Right", "ASPINR"}, | ||
721 | {"ESL-ASP Mux", "Mono Mix", "ASPINM"}, | ||
722 | |||
723 | {"ESL-XSP Mux", "Left", "XSPINL"}, | ||
724 | {"ESL-XSP Mux", "Right", "XSPINR"}, | ||
725 | {"ESL-XSP Mux", "Mono Mix", "XSPINM"}, | ||
726 | |||
727 | /* Speakerphone Paths */ | ||
728 | {"SPKOUT", NULL, "SPK Amp"}, | ||
729 | {"SPK Amp", "Switch", "SPK DAC"}, | ||
730 | |||
731 | {"SPK DAC", "SPK-ASP Mono Volume", "SPK Mixer"}, | ||
732 | {"SPK DAC", "SPK-XSP Mono Volume", "SPK Mixer"}, | ||
733 | {"SPK DAC", "SPK-VSP Mono Volume", "VSPIN"}, | ||
734 | /* Loopback */ | ||
735 | {"SPK DAC", "SPK-IP Mono Volume", "Input Left Capture"}, | ||
736 | {"SPK DAC", "SPK-IP Mono Volume", "Input Right Capture"}, | ||
737 | |||
738 | {"SPK Mixer", NULL, "SPK-ASP Mux"}, | ||
739 | {"SPK Mixer", NULL, "SPK-XSP Mux"}, | ||
740 | |||
741 | {"SPK-ASP Mux", "Left", "ASPINL"}, | ||
742 | {"SPK-ASP Mux", "Mono Mix", "ASPINM"}, | ||
743 | {"SPK-ASP Mux", "Right", "ASPINR"}, | ||
744 | |||
745 | {"SPK-XSP Mux", "Left", "XSPINL"}, | ||
746 | {"SPK-XSP Mux", "Mono Mix", "XSPINM"}, | ||
747 | {"SPK-XSP Mux", "Right", "XSPINR"}, | ||
748 | |||
749 | /* HP LineOUT Paths */ | ||
750 | {"HPOUTA", NULL, "HP Amp"}, | ||
751 | {"HPOUTB", NULL, "HP Amp"}, | ||
752 | {"LINEOUTA", NULL, "LO Amp"}, | ||
753 | {"LINEOUTB", NULL, "LO Amp"}, | ||
754 | |||
755 | {"HP Amp", "Switch", "HL Left DAC"}, | ||
756 | {"HP Amp", "Switch", "HL Right DAC"}, | ||
757 | {"LO Amp", "Switch", "HL Left DAC"}, | ||
758 | {"LO Amp", "Switch", "HL Right DAC"}, | ||
759 | |||
760 | {"HL Left DAC", "HL-XSP Volume", "HL Left Mixer"}, | ||
761 | {"HL Right DAC", "HL-XSP Volume", "HL Right Mixer"}, | ||
762 | {"HL Left DAC", "HL-ASP Volume", "HL Left Mixer"}, | ||
763 | {"HL Right DAC", "HL-ASP Volume", "HL Right Mixer"}, | ||
764 | {"HL Left DAC", "HL-VSP Volume", "HL Left Mixer"}, | ||
765 | {"HL Right DAC", "HL-VSP Volume", "HL Right Mixer"}, | ||
766 | /* Loopback */ | ||
767 | {"HL Left DAC", "HL-IP Volume", "HL Left Mixer"}, | ||
768 | {"HL Right DAC", "HL-IP Volume", "HL Right Mixer"}, | ||
769 | {"HL Left Mixer", NULL, "Input Left Capture"}, | ||
770 | {"HL Right Mixer", NULL, "Input Right Capture"}, | ||
771 | |||
772 | {"HL Left Mixer", NULL, "ASPINL"}, | ||
773 | {"HL Right Mixer", NULL, "ASPINR"}, | ||
774 | {"HL Left Mixer", NULL, "XSPINL"}, | ||
775 | {"HL Right Mixer", NULL, "XSPINR"}, | ||
776 | {"HL Left Mixer", NULL, "VSPIN"}, | ||
777 | {"HL Right Mixer", NULL, "VSPIN"}, | ||
778 | |||
779 | /* Capture Paths */ | ||
780 | {"MIC1", NULL, "MIC1 Bias"}, | ||
781 | {"PGA Left Mux", "Mic 1", "MIC1"}, | ||
782 | {"MIC2", NULL, "MIC2 Bias"}, | ||
783 | {"PGA Right Mux", "Mic 2", "MIC2"}, | ||
784 | |||
785 | {"PGA Left Mux", "Line A", "LINEINA"}, | ||
786 | {"PGA Right Mux", "Line B", "LINEINB"}, | ||
787 | |||
788 | {"PGA Left", NULL, "PGA Left Mux"}, | ||
789 | {"PGA Right", NULL, "PGA Right Mux"}, | ||
790 | |||
791 | {"ADC Left", NULL, "PGA Left"}, | ||
792 | {"ADC Right", NULL, "PGA Right"}, | ||
793 | |||
794 | {"Input Left Capture", "ADC Left Input", "ADC Left"}, | ||
795 | {"Input Right Capture", "ADC Right Input", "ADC Right"}, | ||
796 | {"Input Left Capture", "DMIC Left Input", "DMIC Left"}, | ||
797 | {"Input Right Capture", "DMIC Right Input", "DMIC Right"}, | ||
798 | |||
799 | /* Audio Capture */ | ||
800 | {"ASPL Output Mixer", NULL, "Input Left Capture"}, | ||
801 | {"ASPR Output Mixer", NULL, "Input Right Capture"}, | ||
802 | |||
803 | {"ASPOUTL", "ASP-IP Volume", "ASPL Output Mixer"}, | ||
804 | {"ASPOUTR", "ASP-IP Volume", "ASPR Output Mixer"}, | ||
805 | |||
806 | /* Auxillary Capture */ | ||
807 | {"XSPL Output Mixer", NULL, "Input Left Capture"}, | ||
808 | {"XSPR Output Mixer", NULL, "Input Right Capture"}, | ||
809 | |||
810 | {"XSPOUTL", "XSP-IP Volume", "XSPL Output Mixer"}, | ||
811 | {"XSPOUTR", "XSP-IP Volume", "XSPR Output Mixer"}, | ||
812 | |||
813 | {"XSPOUTL", NULL, "XSPL Output Mixer"}, | ||
814 | {"XSPOUTR", NULL, "XSPR Output Mixer"}, | ||
815 | |||
816 | /* Voice Capture */ | ||
817 | {"VSPL Output Mixer", NULL, "Input Left Capture"}, | ||
818 | {"VSPR Output Mixer", NULL, "Input Left Capture"}, | ||
819 | |||
820 | {"VSPOUTL", "VSP-IP Volume", "VSPL Output Mixer"}, | ||
821 | {"VSPOUTR", "VSP-IP Volume", "VSPR Output Mixer"}, | ||
822 | |||
823 | {"VSPOUTL", NULL, "VSPL Output Mixer"}, | ||
824 | {"VSPOUTR", NULL, "VSPR Output Mixer"}, | ||
825 | }; | ||
826 | |||
827 | struct cs42l73_mclk_div { | ||
828 | u32 mclk; | ||
829 | u32 srate; | ||
830 | u8 mmcc; | ||
831 | }; | ||
832 | |||
833 | static struct cs42l73_mclk_div cs42l73_mclk_coeffs[] = { | ||
834 | /* MCLK, Sample Rate, xMMCC[5:0] */ | ||
835 | {5644800, 11025, 0x30}, | ||
836 | {5644800, 22050, 0x20}, | ||
837 | {5644800, 44100, 0x10}, | ||
838 | |||
839 | {6000000, 8000, 0x39}, | ||
840 | {6000000, 11025, 0x33}, | ||
841 | {6000000, 12000, 0x31}, | ||
842 | {6000000, 16000, 0x29}, | ||
843 | {6000000, 22050, 0x23}, | ||
844 | {6000000, 24000, 0x21}, | ||
845 | {6000000, 32000, 0x19}, | ||
846 | {6000000, 44100, 0x13}, | ||
847 | {6000000, 48000, 0x11}, | ||
848 | |||
849 | {6144000, 8000, 0x38}, | ||
850 | {6144000, 12000, 0x30}, | ||
851 | {6144000, 16000, 0x28}, | ||
852 | {6144000, 24000, 0x20}, | ||
853 | {6144000, 32000, 0x18}, | ||
854 | {6144000, 48000, 0x10}, | ||
855 | |||
856 | {6500000, 8000, 0x3C}, | ||
857 | {6500000, 11025, 0x35}, | ||
858 | {6500000, 12000, 0x34}, | ||
859 | {6500000, 16000, 0x2C}, | ||
860 | {6500000, 22050, 0x25}, | ||
861 | {6500000, 24000, 0x24}, | ||
862 | {6500000, 32000, 0x1C}, | ||
863 | {6500000, 44100, 0x15}, | ||
864 | {6500000, 48000, 0x14}, | ||
865 | |||
866 | {6400000, 8000, 0x3E}, | ||
867 | {6400000, 11025, 0x37}, | ||
868 | {6400000, 12000, 0x36}, | ||
869 | {6400000, 16000, 0x2E}, | ||
870 | {6400000, 22050, 0x27}, | ||
871 | {6400000, 24000, 0x26}, | ||
872 | {6400000, 32000, 0x1E}, | ||
873 | {6400000, 44100, 0x17}, | ||
874 | {6400000, 48000, 0x16}, | ||
875 | }; | ||
876 | |||
877 | struct cs42l73_mclkx_div { | ||
878 | u32 mclkx; | ||
879 | u8 ratio; | ||
880 | u8 mclkdiv; | ||
881 | }; | ||
882 | |||
883 | static struct cs42l73_mclkx_div cs42l73_mclkx_coeffs[] = { | ||
884 | {5644800, 1, 0}, /* 5644800 */ | ||
885 | {6000000, 1, 0}, /* 6000000 */ | ||
886 | {6144000, 1, 0}, /* 6144000 */ | ||
887 | {11289600, 2, 2}, /* 5644800 */ | ||
888 | {12288000, 2, 2}, /* 6144000 */ | ||
889 | {12000000, 2, 2}, /* 6000000 */ | ||
890 | {13000000, 2, 2}, /* 6500000 */ | ||
891 | {19200000, 3, 3}, /* 6400000 */ | ||
892 | {24000000, 4, 4}, /* 6000000 */ | ||
893 | {26000000, 4, 4}, /* 6500000 */ | ||
894 | {38400000, 6, 5} /* 6400000 */ | ||
895 | }; | ||
896 | |||
897 | static int cs42l73_get_mclkx_coeff(int mclkx) | ||
898 | { | ||
899 | int i; | ||
900 | |||
901 | for (i = 0; i < ARRAY_SIZE(cs42l73_mclkx_coeffs); i++) { | ||
902 | if (cs42l73_mclkx_coeffs[i].mclkx == mclkx) | ||
903 | return i; | ||
904 | } | ||
905 | return -EINVAL; | ||
906 | } | ||
907 | |||
908 | static int cs42l73_get_mclk_coeff(int mclk, int srate) | ||
909 | { | ||
910 | int i; | ||
911 | |||
912 | for (i = 0; i < ARRAY_SIZE(cs42l73_mclk_coeffs); i++) { | ||
913 | if (cs42l73_mclk_coeffs[i].mclk == mclk && | ||
914 | cs42l73_mclk_coeffs[i].srate == srate) | ||
915 | return i; | ||
916 | } | ||
917 | return -EINVAL; | ||
918 | |||
919 | } | ||
920 | |||
921 | static int cs42l73_set_mclk(struct snd_soc_dai *dai, unsigned int freq) | ||
922 | { | ||
923 | struct snd_soc_codec *codec = dai->codec; | ||
924 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); | ||
925 | |||
926 | int mclkx_coeff; | ||
927 | u32 mclk = 0; | ||
928 | u8 dmmcc = 0; | ||
929 | |||
930 | /* MCLKX -> MCLK */ | ||
931 | mclkx_coeff = cs42l73_get_mclkx_coeff(freq); | ||
932 | |||
933 | mclk = cs42l73_mclkx_coeffs[mclkx_coeff].mclkx / | ||
934 | cs42l73_mclkx_coeffs[mclkx_coeff].ratio; | ||
935 | |||
936 | dev_dbg(codec->dev, "MCLK%u %u <-> internal MCLK %u\n", | ||
937 | priv->mclksel + 1, cs42l73_mclkx_coeffs[mclkx_coeff].mclkx, | ||
938 | mclk); | ||
939 | |||
940 | dmmcc = (priv->mclksel << 4) | | ||
941 | (cs42l73_mclkx_coeffs[mclkx_coeff].mclkdiv << 1); | ||
942 | |||
943 | snd_soc_write(codec, CS42L73_DMMCC, dmmcc); | ||
944 | |||
945 | priv->sysclk = mclkx_coeff; | ||
946 | priv->mclk = mclk; | ||
947 | |||
948 | return 0; | ||
949 | } | ||
950 | |||
951 | static int cs42l73_set_sysclk(struct snd_soc_dai *dai, | ||
952 | int clk_id, unsigned int freq, int dir) | ||
953 | { | ||
954 | struct snd_soc_codec *codec = dai->codec; | ||
955 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); | ||
956 | |||
957 | switch (clk_id) { | ||
958 | case CS42L73_CLKID_MCLK1: | ||
959 | break; | ||
960 | case CS42L73_CLKID_MCLK2: | ||
961 | break; | ||
962 | default: | ||
963 | return -EINVAL; | ||
964 | } | ||
965 | |||
966 | if ((cs42l73_set_mclk(dai, freq)) < 0) { | ||
967 | dev_err(codec->dev, "Unable to set MCLK for dai %s\n", | ||
968 | dai->name); | ||
969 | return -EINVAL; | ||
970 | } | ||
971 | |||
972 | priv->mclksel = clk_id; | ||
973 | |||
974 | return 0; | ||
975 | } | ||
976 | |||
977 | static int cs42l73_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | ||
978 | { | ||
979 | struct snd_soc_codec *codec = codec_dai->codec; | ||
980 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); | ||
981 | u8 id = codec_dai->id; | ||
982 | unsigned int inv, format; | ||
983 | u8 spc, mmcc; | ||
984 | |||
985 | spc = snd_soc_read(codec, CS42L73_SPC(id)); | ||
986 | mmcc = snd_soc_read(codec, CS42L73_MMCC(id)); | ||
987 | |||
988 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | ||
989 | case SND_SOC_DAIFMT_CBM_CFM: | ||
990 | mmcc |= MS_MASTER; | ||
991 | break; | ||
992 | |||
993 | case SND_SOC_DAIFMT_CBS_CFS: | ||
994 | mmcc &= ~MS_MASTER; | ||
995 | break; | ||
996 | |||
997 | default: | ||
998 | return -EINVAL; | ||
999 | } | ||
1000 | |||
1001 | format = (fmt & SND_SOC_DAIFMT_FORMAT_MASK); | ||
1002 | inv = (fmt & SND_SOC_DAIFMT_INV_MASK); | ||
1003 | |||
1004 | switch (format) { | ||
1005 | case SND_SOC_DAIFMT_I2S: | ||
1006 | spc &= ~SPDIF_PCM; | ||
1007 | break; | ||
1008 | case SND_SOC_DAIFMT_DSP_A: | ||
1009 | case SND_SOC_DAIFMT_DSP_B: | ||
1010 | if (mmcc & MS_MASTER) { | ||
1011 | dev_err(codec->dev, | ||
1012 | "PCM format in slave mode only\n"); | ||
1013 | return -EINVAL; | ||
1014 | } | ||
1015 | if (id == CS42L73_ASP) { | ||
1016 | dev_err(codec->dev, | ||
1017 | "PCM format is not supported on ASP port\n"); | ||
1018 | return -EINVAL; | ||
1019 | } | ||
1020 | spc |= SPDIF_PCM; | ||
1021 | break; | ||
1022 | default: | ||
1023 | return -EINVAL; | ||
1024 | } | ||
1025 | |||
1026 | if (spc & SPDIF_PCM) { | ||
1027 | /* Clear PCM mode, clear PCM_BIT_ORDER bit for MSB->LSB */ | ||
1028 | spc &= ~(PCM_MODE_MASK | PCM_BIT_ORDER); | ||
1029 | switch (format) { | ||
1030 | case SND_SOC_DAIFMT_DSP_B: | ||
1031 | if (inv == SND_SOC_DAIFMT_IB_IF) | ||
1032 | spc |= PCM_MODE0; | ||
1033 | if (inv == SND_SOC_DAIFMT_IB_NF) | ||
1034 | spc |= PCM_MODE1; | ||
1035 | break; | ||
1036 | case SND_SOC_DAIFMT_DSP_A: | ||
1037 | if (inv == SND_SOC_DAIFMT_IB_IF) | ||
1038 | spc |= PCM_MODE1; | ||
1039 | break; | ||
1040 | default: | ||
1041 | return -EINVAL; | ||
1042 | } | ||
1043 | } | ||
1044 | |||
1045 | priv->config[id].spc = spc; | ||
1046 | priv->config[id].mmcc = mmcc; | ||
1047 | |||
1048 | return 0; | ||
1049 | } | ||
1050 | |||
1051 | static u32 cs42l73_asrc_rates[] = { | ||
1052 | 8000, 11025, 12000, 16000, 22050, | ||
1053 | 24000, 32000, 44100, 48000 | ||
1054 | }; | ||
1055 | |||
1056 | static unsigned int cs42l73_get_xspfs_coeff(u32 rate) | ||
1057 | { | ||
1058 | int i; | ||
1059 | for (i = 0; i < ARRAY_SIZE(cs42l73_asrc_rates); i++) { | ||
1060 | if (cs42l73_asrc_rates[i] == rate) | ||
1061 | return i + 1; | ||
1062 | } | ||
1063 | return 0; /* 0 = Don't know */ | ||
1064 | } | ||
1065 | |||
1066 | static void cs42l73_update_asrc(struct snd_soc_codec *codec, int id, int srate) | ||
1067 | { | ||
1068 | u8 spfs = 0; | ||
1069 | |||
1070 | if (srate > 0) | ||
1071 | spfs = cs42l73_get_xspfs_coeff(srate); | ||
1072 | |||
1073 | switch (id) { | ||
1074 | case CS42L73_XSP: | ||
1075 | snd_soc_update_bits(codec, CS42L73_VXSPFS, 0x0f, spfs); | ||
1076 | break; | ||
1077 | case CS42L73_ASP: | ||
1078 | snd_soc_update_bits(codec, CS42L73_ASPC, 0x3c, spfs << 2); | ||
1079 | break; | ||
1080 | case CS42L73_VSP: | ||
1081 | snd_soc_update_bits(codec, CS42L73_VXSPFS, 0xf0, spfs << 4); | ||
1082 | break; | ||
1083 | default: | ||
1084 | break; | ||
1085 | } | ||
1086 | } | ||
1087 | |||
1088 | static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream, | ||
1089 | struct snd_pcm_hw_params *params, | ||
1090 | struct snd_soc_dai *dai) | ||
1091 | { | ||
1092 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
1093 | struct snd_soc_codec *codec = rtd->codec; | ||
1094 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); | ||
1095 | int id = dai->id; | ||
1096 | int mclk_coeff; | ||
1097 | int srate = params_rate(params); | ||
1098 | |||
1099 | if (priv->config[id].mmcc & MS_MASTER) { | ||
1100 | /* CS42L73 Master */ | ||
1101 | /* MCLK -> srate */ | ||
1102 | mclk_coeff = | ||
1103 | cs42l73_get_mclk_coeff(priv->mclk, srate); | ||
1104 | |||
1105 | if (mclk_coeff < 0) | ||
1106 | return -EINVAL; | ||
1107 | |||
1108 | dev_dbg(codec->dev, | ||
1109 | "DAI[%d]: MCLK %u, srate %u, MMCC[5:0] = %x\n", | ||
1110 | id, priv->mclk, srate, | ||
1111 | cs42l73_mclk_coeffs[mclk_coeff].mmcc); | ||
1112 | |||
1113 | priv->config[id].mmcc &= 0xC0; | ||
1114 | priv->config[id].mmcc |= cs42l73_mclk_coeffs[mclk_coeff].mmcc; | ||
1115 | priv->config[id].spc &= 0xFC; | ||
1116 | priv->config[id].spc &= MCK_SCLK_64FS; | ||
1117 | } else { | ||
1118 | /* CS42L73 Slave */ | ||
1119 | priv->config[id].spc &= 0xFC; | ||
1120 | priv->config[id].spc |= MCK_SCLK_64FS; | ||
1121 | } | ||
1122 | /* Update ASRCs */ | ||
1123 | priv->config[id].srate = srate; | ||
1124 | |||
1125 | snd_soc_write(codec, CS42L73_SPC(id), priv->config[id].spc); | ||
1126 | snd_soc_write(codec, CS42L73_MMCC(id), priv->config[id].mmcc); | ||
1127 | |||
1128 | cs42l73_update_asrc(codec, id, srate); | ||
1129 | |||
1130 | return 0; | ||
1131 | } | ||
1132 | |||
1133 | static int cs42l73_set_bias_level(struct snd_soc_codec *codec, | ||
1134 | enum snd_soc_bias_level level) | ||
1135 | { | ||
1136 | struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec); | ||
1137 | |||
1138 | switch (level) { | ||
1139 | case SND_SOC_BIAS_ON: | ||
1140 | snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 0); | ||
1141 | snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 0); | ||
1142 | break; | ||
1143 | |||
1144 | case SND_SOC_BIAS_PREPARE: | ||
1145 | break; | ||
1146 | |||
1147 | case SND_SOC_BIAS_STANDBY: | ||
1148 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | ||
1149 | regcache_cache_only(cs42l73->regmap, false); | ||
1150 | regcache_sync(cs42l73->regmap); | ||
1151 | } | ||
1152 | snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 1); | ||
1153 | break; | ||
1154 | |||
1155 | case SND_SOC_BIAS_OFF: | ||
1156 | snd_soc_update_bits(codec, CS42L73_PWRCTL1, PDN, 1); | ||
1157 | snd_soc_update_bits(codec, CS42L73_DMMCC, MCLKDIS, 1); | ||
1158 | break; | ||
1159 | } | ||
1160 | codec->dapm.bias_level = level; | ||
1161 | return 0; | ||
1162 | } | ||
1163 | |||
1164 | static int cs42l73_set_tristate(struct snd_soc_dai *dai, int tristate) | ||
1165 | { | ||
1166 | struct snd_soc_codec *codec = dai->codec; | ||
1167 | int id = dai->id; | ||
1168 | |||
1169 | return snd_soc_update_bits(codec, CS42L73_SPC(id), | ||
1170 | 0x7F, tristate << 7); | ||
1171 | } | ||
1172 | |||
1173 | static struct snd_pcm_hw_constraint_list constraints_12_24 = { | ||
1174 | .count = ARRAY_SIZE(cs42l73_asrc_rates), | ||
1175 | .list = cs42l73_asrc_rates, | ||
1176 | }; | ||
1177 | |||
1178 | static int cs42l73_pcm_startup(struct snd_pcm_substream *substream, | ||
1179 | struct snd_soc_dai *dai) | ||
1180 | { | ||
1181 | snd_pcm_hw_constraint_list(substream->runtime, 0, | ||
1182 | SNDRV_PCM_HW_PARAM_RATE, | ||
1183 | &constraints_12_24); | ||
1184 | return 0; | ||
1185 | } | ||
1186 | |||
1187 | /* SNDRV_PCM_RATE_KNOT -> 12000, 24000 Hz, limit with constraint list */ | ||
1188 | #define CS42L73_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT) | ||
1189 | |||
1190 | |||
1191 | #define CS42L73_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
1192 | SNDRV_PCM_FMTBIT_S24_LE) | ||
1193 | |||
1194 | static const struct snd_soc_dai_ops cs42l73_ops = { | ||
1195 | .startup = cs42l73_pcm_startup, | ||
1196 | .hw_params = cs42l73_pcm_hw_params, | ||
1197 | .set_fmt = cs42l73_set_dai_fmt, | ||
1198 | .set_sysclk = cs42l73_set_sysclk, | ||
1199 | .set_tristate = cs42l73_set_tristate, | ||
1200 | }; | ||
1201 | |||
1202 | static struct snd_soc_dai_driver cs42l73_dai[] = { | ||
1203 | { | ||
1204 | .name = "cs42l73-xsp", | ||
1205 | .id = CS42L73_XSP, | ||
1206 | .playback = { | ||
1207 | .stream_name = "XSP Playback", | ||
1208 | .channels_min = 1, | ||
1209 | .channels_max = 2, | ||
1210 | .rates = CS42L73_RATES, | ||
1211 | .formats = CS42L73_FORMATS, | ||
1212 | }, | ||
1213 | .capture = { | ||
1214 | .stream_name = "XSP Capture", | ||
1215 | .channels_min = 1, | ||
1216 | .channels_max = 2, | ||
1217 | .rates = CS42L73_RATES, | ||
1218 | .formats = CS42L73_FORMATS, | ||
1219 | }, | ||
1220 | .ops = &cs42l73_ops, | ||
1221 | .symmetric_rates = 1, | ||
1222 | }, | ||
1223 | { | ||
1224 | .name = "cs42l73-asp", | ||
1225 | .id = CS42L73_ASP, | ||
1226 | .playback = { | ||
1227 | .stream_name = "ASP Playback", | ||
1228 | .channels_min = 2, | ||
1229 | .channels_max = 2, | ||
1230 | .rates = CS42L73_RATES, | ||
1231 | .formats = CS42L73_FORMATS, | ||
1232 | }, | ||
1233 | .capture = { | ||
1234 | .stream_name = "ASP Capture", | ||
1235 | .channels_min = 2, | ||
1236 | .channels_max = 2, | ||
1237 | .rates = CS42L73_RATES, | ||
1238 | .formats = CS42L73_FORMATS, | ||
1239 | }, | ||
1240 | .ops = &cs42l73_ops, | ||
1241 | .symmetric_rates = 1, | ||
1242 | }, | ||
1243 | { | ||
1244 | .name = "cs42l73-vsp", | ||
1245 | .id = CS42L73_VSP, | ||
1246 | .playback = { | ||
1247 | .stream_name = "VSP Playback", | ||
1248 | .channels_min = 1, | ||
1249 | .channels_max = 2, | ||
1250 | .rates = CS42L73_RATES, | ||
1251 | .formats = CS42L73_FORMATS, | ||
1252 | }, | ||
1253 | .capture = { | ||
1254 | .stream_name = "VSP Capture", | ||
1255 | .channels_min = 1, | ||
1256 | .channels_max = 2, | ||
1257 | .rates = CS42L73_RATES, | ||
1258 | .formats = CS42L73_FORMATS, | ||
1259 | }, | ||
1260 | .ops = &cs42l73_ops, | ||
1261 | .symmetric_rates = 1, | ||
1262 | } | ||
1263 | }; | ||
1264 | |||
1265 | static int cs42l73_suspend(struct snd_soc_codec *codec) | ||
1266 | { | ||
1267 | cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1268 | |||
1269 | return 0; | ||
1270 | } | ||
1271 | |||
1272 | static int cs42l73_resume(struct snd_soc_codec *codec) | ||
1273 | { | ||
1274 | cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1275 | return 0; | ||
1276 | } | ||
1277 | |||
1278 | static int cs42l73_probe(struct snd_soc_codec *codec) | ||
1279 | { | ||
1280 | int ret; | ||
1281 | struct cs42l73_private *cs42l73 = snd_soc_codec_get_drvdata(codec); | ||
1282 | |||
1283 | codec->control_data = cs42l73->regmap; | ||
1284 | |||
1285 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP); | ||
1286 | if (ret < 0) { | ||
1287 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | ||
1288 | return ret; | ||
1289 | } | ||
1290 | |||
1291 | regcache_cache_only(cs42l73->regmap, true); | ||
1292 | |||
1293 | cs42l73_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1294 | |||
1295 | cs42l73->mclksel = CS42L73_CLKID_MCLK1; /* MCLK1 as master clk */ | ||
1296 | cs42l73->mclk = 0; | ||
1297 | |||
1298 | return ret; | ||
1299 | } | ||
1300 | |||
1301 | static int cs42l73_remove(struct snd_soc_codec *codec) | ||
1302 | { | ||
1303 | cs42l73_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1304 | return 0; | ||
1305 | } | ||
1306 | |||
1307 | static struct snd_soc_codec_driver soc_codec_dev_cs42l73 = { | ||
1308 | .probe = cs42l73_probe, | ||
1309 | .remove = cs42l73_remove, | ||
1310 | .suspend = cs42l73_suspend, | ||
1311 | .resume = cs42l73_resume, | ||
1312 | .set_bias_level = cs42l73_set_bias_level, | ||
1313 | |||
1314 | .dapm_widgets = cs42l73_dapm_widgets, | ||
1315 | .num_dapm_widgets = ARRAY_SIZE(cs42l73_dapm_widgets), | ||
1316 | .dapm_routes = cs42l73_audio_map, | ||
1317 | .num_dapm_routes = ARRAY_SIZE(cs42l73_audio_map), | ||
1318 | |||
1319 | .controls = cs42l73_snd_controls, | ||
1320 | .num_controls = ARRAY_SIZE(cs42l73_snd_controls), | ||
1321 | }; | ||
1322 | |||
1323 | static struct regmap_config cs42l73_regmap = { | ||
1324 | .reg_bits = 8, | ||
1325 | .val_bits = 8, | ||
1326 | |||
1327 | .max_register = CS42L73_MAX_REGISTER, | ||
1328 | .reg_defaults = cs42l73_reg_defaults, | ||
1329 | .num_reg_defaults = ARRAY_SIZE(cs42l73_reg_defaults), | ||
1330 | .volatile_reg = cs42l73_volatile_register, | ||
1331 | .readable_reg = cs42l73_readable_register, | ||
1332 | .cache_type = REGCACHE_RBTREE, | ||
1333 | }; | ||
1334 | |||
1335 | static __devinit int cs42l73_i2c_probe(struct i2c_client *i2c_client, | ||
1336 | const struct i2c_device_id *id) | ||
1337 | { | ||
1338 | struct cs42l73_private *cs42l73; | ||
1339 | int ret; | ||
1340 | unsigned int devid = 0; | ||
1341 | unsigned int reg; | ||
1342 | |||
1343 | cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private), | ||
1344 | GFP_KERNEL); | ||
1345 | if (!cs42l73) { | ||
1346 | dev_err(&i2c_client->dev, "could not allocate codec\n"); | ||
1347 | return -ENOMEM; | ||
1348 | } | ||
1349 | |||
1350 | i2c_set_clientdata(i2c_client, cs42l73); | ||
1351 | |||
1352 | cs42l73->regmap = regmap_init_i2c(i2c_client, &cs42l73_regmap); | ||
1353 | if (IS_ERR(cs42l73->regmap)) { | ||
1354 | ret = PTR_ERR(cs42l73->regmap); | ||
1355 | dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret); | ||
1356 | goto err; | ||
1357 | } | ||
1358 | /* initialize codec */ | ||
1359 | ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_AB, ®); | ||
1360 | devid = (reg & 0xFF) << 12; | ||
1361 | |||
1362 | ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_CD, ®); | ||
1363 | devid |= (reg & 0xFF) << 4; | ||
1364 | |||
1365 | ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_E, ®); | ||
1366 | devid |= (reg & 0xF0) >> 4; | ||
1367 | |||
1368 | |||
1369 | if (devid != CS42L73_DEVID) { | ||
1370 | ret = -ENODEV; | ||
1371 | dev_err(&i2c_client->dev, | ||
1372 | "CS42L73 Device ID (%X). Expected %X\n", | ||
1373 | devid, CS42L73_DEVID); | ||
1374 | goto err_regmap; | ||
1375 | } | ||
1376 | |||
1377 | ret = regmap_read(cs42l73->regmap, CS42L73_REVID, ®); | ||
1378 | if (ret < 0) { | ||
1379 | dev_err(&i2c_client->dev, "Get Revision ID failed\n"); | ||
1380 | goto err_regmap; | ||
1381 | } | ||
1382 | |||
1383 | dev_info(&i2c_client->dev, | ||
1384 | "Cirrus Logic CS42L73, Revision: %02X\n", reg & 0xFF); | ||
1385 | |||
1386 | regcache_cache_only(cs42l73->regmap, true); | ||
1387 | |||
1388 | ret = snd_soc_register_codec(&i2c_client->dev, | ||
1389 | &soc_codec_dev_cs42l73, cs42l73_dai, | ||
1390 | ARRAY_SIZE(cs42l73_dai)); | ||
1391 | if (ret < 0) | ||
1392 | goto err_regmap; | ||
1393 | return 0; | ||
1394 | |||
1395 | err_regmap: | ||
1396 | regmap_exit(cs42l73->regmap); | ||
1397 | |||
1398 | err: | ||
1399 | return ret; | ||
1400 | } | ||
1401 | |||
1402 | static __devexit int cs42l73_i2c_remove(struct i2c_client *client) | ||
1403 | { | ||
1404 | struct cs42l73_private *cs42l73 = i2c_get_clientdata(client); | ||
1405 | |||
1406 | snd_soc_unregister_codec(&client->dev); | ||
1407 | regmap_exit(cs42l73->regmap); | ||
1408 | |||
1409 | return 0; | ||
1410 | } | ||
1411 | |||
1412 | static const struct i2c_device_id cs42l73_id[] = { | ||
1413 | {"cs42l73", 0}, | ||
1414 | {} | ||
1415 | }; | ||
1416 | |||
1417 | MODULE_DEVICE_TABLE(i2c, cs42l73_id); | ||
1418 | |||
1419 | static struct i2c_driver cs42l73_i2c_driver = { | ||
1420 | .driver = { | ||
1421 | .name = "cs42l73", | ||
1422 | .owner = THIS_MODULE, | ||
1423 | }, | ||
1424 | .id_table = cs42l73_id, | ||
1425 | .probe = cs42l73_i2c_probe, | ||
1426 | .remove = __devexit_p(cs42l73_i2c_remove), | ||
1427 | |||
1428 | }; | ||
1429 | |||
1430 | static int __init cs42l73_modinit(void) | ||
1431 | { | ||
1432 | int ret; | ||
1433 | ret = i2c_add_driver(&cs42l73_i2c_driver); | ||
1434 | if (ret != 0) { | ||
1435 | pr_err("Failed to register CS42L73 I2C driver: %d\n", ret); | ||
1436 | return ret; | ||
1437 | } | ||
1438 | return 0; | ||
1439 | } | ||
1440 | |||
1441 | module_init(cs42l73_modinit); | ||
1442 | |||
1443 | static void __exit cs42l73_exit(void) | ||
1444 | { | ||
1445 | i2c_del_driver(&cs42l73_i2c_driver); | ||
1446 | } | ||
1447 | |||
1448 | module_exit(cs42l73_exit); | ||
1449 | |||
1450 | MODULE_DESCRIPTION("ASoC CS42L73 driver"); | ||
1451 | MODULE_AUTHOR("Georgi Vlaev, Nucleus Systems Ltd, <joe@nucleusys.com>"); | ||
1452 | MODULE_AUTHOR("Brian Austin, Cirrus Logic Inc, <brian.austin@cirrus.com>"); | ||
1453 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/cs42l73.h b/sound/soc/codecs/cs42l73.h new file mode 100644 index 00000000000..f30a4c4d62e --- /dev/null +++ b/sound/soc/codecs/cs42l73.h | |||
@@ -0,0 +1,227 @@ | |||
1 | /* | ||
2 | * ALSA SoC CS42L73 codec driver | ||
3 | * | ||
4 | * Copyright 2011 Cirrus Logic, Inc. | ||
5 | * | ||
6 | * Author: Georgi Vlaev <joe@nucleusys.com> | ||
7 | * Brian Austin <brian.austin@cirrus.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
21 | * 02110-1301 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __CS42L73_H__ | ||
26 | #define __CS42L73_H__ | ||
27 | |||
28 | /* I2C Registers */ | ||
29 | /* I2C Address: 1001010[R/W] - 10010100 = 0x94(Write); 10010101 = 0x95(Read) */ | ||
30 | #define CS42L73_CHIP_ID 0x4a | ||
31 | #define CS42L73_DEVID_AB 0x01 /* Device ID A & B [RO]. */ | ||
32 | #define CS42L73_DEVID_CD 0x02 /* Device ID C & D [RO]. */ | ||
33 | #define CS42L73_DEVID_E 0x03 /* Device ID E [RO]. */ | ||
34 | #define CS42L73_REVID 0x05 /* Revision ID [RO]. */ | ||
35 | #define CS42L73_PWRCTL1 0x06 /* Power Control 1. */ | ||
36 | #define CS42L73_PWRCTL2 0x07 /* Power Control 2. */ | ||
37 | #define CS42L73_PWRCTL3 0x08 /* Power Control 3. */ | ||
38 | #define CS42L73_CPFCHC 0x09 /* Charge Pump Freq. Class H Ctl. */ | ||
39 | #define CS42L73_OLMBMSDC 0x0A /* Output Load, MIC Bias, MIC2 SDT */ | ||
40 | #define CS42L73_DMMCC 0x0B /* Digital MIC & Master Clock Ctl. */ | ||
41 | #define CS42L73_XSPC 0x0C /* Auxiliary Serial Port (XSP) Ctl. */ | ||
42 | #define CS42L73_XSPMMCC 0x0D /* XSP Master Mode Clocking Control. */ | ||
43 | #define CS42L73_ASPC 0x0E /* Audio Serial Port (ASP) Control. */ | ||
44 | #define CS42L73_ASPMMCC 0x0F /* ASP Master Mode Clocking Control. */ | ||
45 | #define CS42L73_VSPC 0x10 /* Voice Serial Port (VSP) Control. */ | ||
46 | #define CS42L73_VSPMMCC 0x11 /* VSP Master Mode Clocking Control. */ | ||
47 | #define CS42L73_VXSPFS 0x12 /* VSP & XSP Sample Rate. */ | ||
48 | #define CS42L73_MIOPC 0x13 /* Misc. Input & Output Path Control. */ | ||
49 | #define CS42L73_ADCIPC 0x14 /* ADC/IP Control. */ | ||
50 | #define CS42L73_MICAPREPGAAVOL 0x15 /* MIC 1 [A] PreAmp, PGAA Vol. */ | ||
51 | #define CS42L73_MICBPREPGABVOL 0x16 /* MIC 2 [B] PreAmp, PGAB Vol. */ | ||
52 | #define CS42L73_IPADVOL 0x17 /* Input Pat7h A Digital Volume. */ | ||
53 | #define CS42L73_IPBDVOL 0x18 /* Input Path B Digital Volume. */ | ||
54 | #define CS42L73_PBDC 0x19 /* Playback Digital Control. */ | ||
55 | #define CS42L73_HLADVOL 0x1A /* HP/Line A Out Digital Vol. */ | ||
56 | #define CS42L73_HLBDVOL 0x1B /* HP/Line B Out Digital Vol. */ | ||
57 | #define CS42L73_SPKDVOL 0x1C /* Spkphone Out [A] Digital Vol. */ | ||
58 | #define CS42L73_ESLDVOL 0x1D /* Ear/Spkphone LO [B] Digital */ | ||
59 | #define CS42L73_HPAAVOL 0x1E /* HP A Analog Volume. */ | ||
60 | #define CS42L73_HPBAVOL 0x1F /* HP B Analog Volume. */ | ||
61 | #define CS42L73_LOAAVOL 0x20 /* Line Out A Analog Volume. */ | ||
62 | #define CS42L73_LOBAVOL 0x21 /* Line Out B Analog Volume. */ | ||
63 | #define CS42L73_STRINV 0x22 /* Stereo Input Path Adv. Vol. */ | ||
64 | #define CS42L73_XSPINV 0x23 /* Auxiliary Port Input Advisory Vol. */ | ||
65 | #define CS42L73_ASPINV 0x24 /* Audio Port Input Advisory Vol. */ | ||
66 | #define CS42L73_VSPINV 0x25 /* Voice Port Input Advisory Vol. */ | ||
67 | #define CS42L73_LIMARATEHL 0x26 /* Lmtr Attack Rate HP/Line. */ | ||
68 | #define CS42L73_LIMRRATEHL 0x27 /* Lmtr Ctl, Rel.Rate HP/Line. */ | ||
69 | #define CS42L73_LMAXHL 0x28 /* Lmtr Thresholds HP/Line. */ | ||
70 | #define CS42L73_LIMARATESPK 0x29 /* Lmtr Attack Rate Spkphone [A]. */ | ||
71 | #define CS42L73_LIMRRATESPK 0x2A /* Lmtr Ctl,Release Rate Spk. [A]. */ | ||
72 | #define CS42L73_LMAXSPK 0x2B /* Lmtr Thresholds Spkphone [A]. */ | ||
73 | #define CS42L73_LIMARATEESL 0x2C /* Lmtr Attack Rate */ | ||
74 | #define CS42L73_LIMRRATEESL 0x2D /* Lmtr Ctl,Release Rate */ | ||
75 | #define CS42L73_LMAXESL 0x2E /* Lmtr Thresholds */ | ||
76 | #define CS42L73_ALCARATE 0x2F /* ALC Enable, Attack Rate AB. */ | ||
77 | #define CS42L73_ALCRRATE 0x30 /* ALC Release Rate AB. */ | ||
78 | #define CS42L73_ALCMINMAX 0x31 /* ALC Thresholds AB. */ | ||
79 | #define CS42L73_NGCAB 0x32 /* Noise Gate Ctl AB. */ | ||
80 | #define CS42L73_ALCNGMC 0x33 /* ALC & Noise Gate Misc Ctl. */ | ||
81 | #define CS42L73_MIXERCTL 0x34 /* Mixer Control. */ | ||
82 | #define CS42L73_HLAIPAA 0x35 /* HP/LO Left Mixer: L. */ | ||
83 | #define CS42L73_HLBIPBA 0x36 /* HP/LO Right Mixer: R. */ | ||
84 | #define CS42L73_HLAXSPAA 0x37 /* HP/LO Left Mixer: XSP L */ | ||
85 | #define CS42L73_HLBXSPBA 0x38 /* HP/LO Right Mixer: XSP R */ | ||
86 | #define CS42L73_HLAASPAA 0x39 /* HP/LO Left Mixer: ASP L */ | ||
87 | #define CS42L73_HLBASPBA 0x3A /* HP/LO Right Mixer: ASP R */ | ||
88 | #define CS42L73_HLAVSPMA 0x3B /* HP/LO Left Mixer: VSP. */ | ||
89 | #define CS42L73_HLBVSPMA 0x3C /* HP/LO Right Mixer: VSP */ | ||
90 | #define CS42L73_XSPAIPAA 0x3D /* XSP Left Mixer: Left */ | ||
91 | #define CS42L73_XSPBIPBA 0x3E /* XSP Rt. Mixer: Right */ | ||
92 | #define CS42L73_XSPAXSPAA 0x3F /* XSP Left Mixer: XSP L */ | ||
93 | #define CS42L73_XSPBXSPBA 0x40 /* XSP Rt. Mixer: XSP R */ | ||
94 | #define CS42L73_XSPAASPAA 0x41 /* XSP Left Mixer: ASP L */ | ||
95 | #define CS42L73_XSPAASPBA 0x42 /* XSP Rt. Mixer: ASP R */ | ||
96 | #define CS42L73_XSPAVSPMA 0x43 /* XSP Left Mixer: VSP */ | ||
97 | #define CS42L73_XSPBVSPMA 0x44 /* XSP Rt. Mixer: VSP */ | ||
98 | #define CS42L73_ASPAIPAA 0x45 /* ASP Left Mixer: Left */ | ||
99 | #define CS42L73_ASPBIPBA 0x46 /* ASP Rt. Mixer: Right */ | ||
100 | #define CS42L73_ASPAXSPAA 0x47 /* ASP Left Mixer: XSP L */ | ||
101 | #define CS42L73_ASPBXSPBA 0x48 /* ASP Rt. Mixer: XSP R */ | ||
102 | #define CS42L73_ASPAASPAA 0x49 /* ASP Left Mixer: ASP L */ | ||
103 | #define CS42L73_ASPBASPBA 0x4A /* ASP Rt. Mixer: ASP R */ | ||
104 | #define CS42L73_ASPAVSPMA 0x4B /* ASP Left Mixer: VSP */ | ||
105 | #define CS42L73_ASPBVSPMA 0x4C /* ASP Rt. Mixer: VSP */ | ||
106 | #define CS42L73_VSPAIPAA 0x4D /* VSP Left Mixer: Left */ | ||
107 | #define CS42L73_VSPBIPBA 0x4E /* VSP Rt. Mixer: Right */ | ||
108 | #define CS42L73_VSPAXSPAA 0x4F /* VSP Left Mixer: XSP L */ | ||
109 | #define CS42L73_VSPBXSPBA 0x50 /* VSP Rt. Mixer: XSP R */ | ||
110 | #define CS42L73_VSPAASPAA 0x51 /* VSP Left Mixer: ASP Left */ | ||
111 | #define CS42L73_VSPBASPBA 0x52 /* VSP Rt. Mixer: ASP Right */ | ||
112 | #define CS42L73_VSPAVSPMA 0x53 /* VSP Left Mixer: VSP */ | ||
113 | #define CS42L73_VSPBVSPMA 0x54 /* VSP Rt. Mixer: VSP */ | ||
114 | #define CS42L73_MMIXCTL 0x55 /* Mono Mixer Controls. */ | ||
115 | #define CS42L73_SPKMIPMA 0x56 /* SPK Mono Mixer: In. Path */ | ||
116 | #define CS42L73_SPKMXSPA 0x57 /* SPK Mono Mixer: XSP Mono/L/R Att. */ | ||
117 | #define CS42L73_SPKMASPA 0x58 /* SPK Mono Mixer: ASP Mono/L/R Att. */ | ||
118 | #define CS42L73_SPKMVSPMA 0x59 /* SPK Mono Mixer: VSP Mono Atten. */ | ||
119 | #define CS42L73_ESLMIPMA 0x5A /* Ear/SpLO Mono Mixer: */ | ||
120 | #define CS42L73_ESLMXSPA 0x5B /* Ear/SpLO Mono Mixer: XSP */ | ||
121 | #define CS42L73_ESLMASPA 0x5C /* Ear/SpLO Mono Mixer: ASP */ | ||
122 | #define CS42L73_ESLMVSPMA 0x5D /* Ear/SpLO Mono Mixer: VSP */ | ||
123 | #define CS42L73_IM1 0x5E /* Interrupt Mask 1. */ | ||
124 | #define CS42L73_IM2 0x5F /* Interrupt Mask 2. */ | ||
125 | #define CS42L73_IS1 0x60 /* Interrupt Status 1 [RO]. */ | ||
126 | #define CS42L73_IS2 0x61 /* Interrupt Status 2 [RO]. */ | ||
127 | #define CS42L73_MAX_REGISTER 0x61 /* Total Registers */ | ||
128 | /* Bitfield Definitions */ | ||
129 | |||
130 | /* CS42L73_PWRCTL1 */ | ||
131 | #define PDN_ADCB (1 << 7) | ||
132 | #define PDN_DMICB (1 << 6) | ||
133 | #define PDN_ADCA (1 << 5) | ||
134 | #define PDN_DMICA (1 << 4) | ||
135 | #define PDN_LDO (1 << 2) | ||
136 | #define DISCHG_FILT (1 << 1) | ||
137 | #define PDN (1 << 0) | ||
138 | |||
139 | /* CS42L73_PWRCTL2 */ | ||
140 | #define PDN_MIC2_BIAS (1 << 7) | ||
141 | #define PDN_MIC1_BIAS (1 << 6) | ||
142 | #define PDN_VSP (1 << 4) | ||
143 | #define PDN_ASP_SDOUT (1 << 3) | ||
144 | #define PDN_ASP_SDIN (1 << 2) | ||
145 | #define PDN_XSP_SDOUT (1 << 1) | ||
146 | #define PDN_XSP_SDIN (1 << 0) | ||
147 | |||
148 | /* CS42L73_PWRCTL3 */ | ||
149 | #define PDN_THMS (1 << 5) | ||
150 | #define PDN_SPKLO (1 << 4) | ||
151 | #define PDN_EAR (1 << 3) | ||
152 | #define PDN_SPK (1 << 2) | ||
153 | #define PDN_LO (1 << 1) | ||
154 | #define PDN_HP (1 << 0) | ||
155 | |||
156 | /* Thermal Overload Detect. Requires interrupt ... */ | ||
157 | #define THMOVLD_150C 0 | ||
158 | #define THMOVLD_132C 1 | ||
159 | #define THMOVLD_115C 2 | ||
160 | #define THMOVLD_098C 3 | ||
161 | |||
162 | |||
163 | /* CS42L73_ASPC, CS42L73_XSPC, CS42L73_VSPC */ | ||
164 | #define SP_3ST (1 << 7) | ||
165 | #define SPDIF_I2S (0 << 6) | ||
166 | #define SPDIF_PCM (1 << 6) | ||
167 | #define PCM_MODE0 (0 << 4) | ||
168 | #define PCM_MODE1 (1 << 4) | ||
169 | #define PCM_MODE2 (2 << 4) | ||
170 | #define PCM_MODE_MASK (3 << 4) | ||
171 | #define PCM_BIT_ORDER (1 << 3) | ||
172 | #define MCK_SCLK_64FS (0 << 0) | ||
173 | #define MCK_SCLK_MCLK (2 << 0) | ||
174 | #define MCK_SCLK_PREMCLK (3 << 0) | ||
175 | |||
176 | /* CS42L73_xSPMMCC */ | ||
177 | #define MS_MASTER (1 << 7) | ||
178 | |||
179 | |||
180 | /* CS42L73_DMMCC */ | ||
181 | #define MCLKDIS (1 << 0) | ||
182 | #define MCLKSEL_MCLK2 (1 << 4) | ||
183 | #define MCLKSEL_MCLK1 (0 << 4) | ||
184 | |||
185 | /* CS42L73 MCLK derived from MCLK1 or MCLK2 */ | ||
186 | #define CS42L73_CLKID_MCLK1 0 | ||
187 | #define CS42L73_CLKID_MCLK2 1 | ||
188 | |||
189 | #define CS42L73_MCLKXDIV 0 | ||
190 | #define CS42L73_MMCCDIV 1 | ||
191 | |||
192 | #define CS42L73_XSP 0 | ||
193 | #define CS42L73_ASP 1 | ||
194 | #define CS42L73_VSP 2 | ||
195 | |||
196 | /* IS1, IM1 */ | ||
197 | #define MIC2_SDET (1 << 6) | ||
198 | #define THMOVLD (1 << 4) | ||
199 | #define DIGMIXOVFL (1 << 3) | ||
200 | #define IPBOVFL (1 << 1) | ||
201 | #define IPAOVFL (1 << 0) | ||
202 | |||
203 | /* Analog Softramp */ | ||
204 | #define ANLGOSFT (1 << 0) | ||
205 | |||
206 | /* HP A/B Analog Mute */ | ||
207 | #define HPA_MUTE (1 << 7) | ||
208 | /* LO A/B Analog Mute */ | ||
209 | #define LOA_MUTE (1 << 7) | ||
210 | /* Digital Mute */ | ||
211 | #define HLAD_MUTE (1 << 0) | ||
212 | #define HLBD_MUTE (1 << 1) | ||
213 | #define SPKD_MUTE (1 << 2) | ||
214 | #define ESLD_MUTE (1 << 3) | ||
215 | |||
216 | /* Misc defines for codec */ | ||
217 | #define CS42L73_RESET_GPIO 143 | ||
218 | |||
219 | #define CS42L73_DEVID 0x00042A73 | ||
220 | #define CS42L73_MCLKX_MIN 5644800 | ||
221 | #define CS42L73_MCLKX_MAX 38400000 | ||
222 | |||
223 | #define CS42L73_SPC(id) (CS42L73_XSPC + (id << 1)) | ||
224 | #define CS42L73_MMCC(id) (CS42L73_XSPMMCC + (id << 1)) | ||
225 | #define CS42L73_SPFS(id) ((id == CS42L73_ASP) ? CS42L73_ASPC : CS42L73_VXSPFS) | ||
226 | |||
227 | #endif /* __CS42L73_H__ */ | ||
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index bc7067db8ae..d5fd00a6474 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/tty.h> | 16 | #include <linux/tty.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/regulator/consumer.h> | ||
19 | 20 | ||
20 | #include <sound/core.h> | 21 | #include <sound/core.h> |
21 | #include <sound/initval.h> | 22 | #include <sound/initval.h> |
@@ -25,8 +26,8 @@ | |||
25 | 26 | ||
26 | 27 | ||
27 | struct cx20442_priv { | 28 | struct cx20442_priv { |
28 | enum snd_soc_control_type control_type; | ||
29 | void *control_data; | 29 | void *control_data; |
30 | struct regulator *por; | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | #define CX20442_PM 0x0 | 33 | #define CX20442_PM 0x0 |
@@ -324,6 +325,38 @@ static struct snd_soc_dai_driver cx20442_dai = { | |||
324 | }, | 325 | }, |
325 | }; | 326 | }; |
326 | 327 | ||
328 | static int cx20442_set_bias_level(struct snd_soc_codec *codec, | ||
329 | enum snd_soc_bias_level level) | ||
330 | { | ||
331 | struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec); | ||
332 | int err = 0; | ||
333 | |||
334 | switch (level) { | ||
335 | case SND_SOC_BIAS_PREPARE: | ||
336 | if (codec->dapm.bias_level != SND_SOC_BIAS_STANDBY) | ||
337 | break; | ||
338 | if (IS_ERR(cx20442->por)) | ||
339 | err = PTR_ERR(cx20442->por); | ||
340 | else | ||
341 | err = regulator_enable(cx20442->por); | ||
342 | break; | ||
343 | case SND_SOC_BIAS_STANDBY: | ||
344 | if (codec->dapm.bias_level != SND_SOC_BIAS_PREPARE) | ||
345 | break; | ||
346 | if (IS_ERR(cx20442->por)) | ||
347 | err = PTR_ERR(cx20442->por); | ||
348 | else | ||
349 | err = regulator_disable(cx20442->por); | ||
350 | break; | ||
351 | default: | ||
352 | break; | ||
353 | } | ||
354 | if (!err) | ||
355 | codec->dapm.bias_level = level; | ||
356 | |||
357 | return err; | ||
358 | } | ||
359 | |||
327 | static int cx20442_codec_probe(struct snd_soc_codec *codec) | 360 | static int cx20442_codec_probe(struct snd_soc_codec *codec) |
328 | { | 361 | { |
329 | struct cx20442_priv *cx20442; | 362 | struct cx20442_priv *cx20442; |
@@ -331,9 +364,13 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) | |||
331 | cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL); | 364 | cx20442 = kzalloc(sizeof(struct cx20442_priv), GFP_KERNEL); |
332 | if (cx20442 == NULL) | 365 | if (cx20442 == NULL) |
333 | return -ENOMEM; | 366 | return -ENOMEM; |
334 | snd_soc_codec_set_drvdata(codec, cx20442); | ||
335 | 367 | ||
368 | cx20442->por = regulator_get(codec->dev, "POR"); | ||
369 | if (IS_ERR(cx20442->por)) | ||
370 | dev_warn(codec->dev, "failed to get the regulator"); | ||
336 | cx20442->control_data = NULL; | 371 | cx20442->control_data = NULL; |
372 | |||
373 | snd_soc_codec_set_drvdata(codec, cx20442); | ||
337 | codec->hw_write = NULL; | 374 | codec->hw_write = NULL; |
338 | codec->card->pop_time = 0; | 375 | codec->card->pop_time = 0; |
339 | 376 | ||
@@ -350,6 +387,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
350 | tty_hangup(tty); | 387 | tty_hangup(tty); |
351 | } | 388 | } |
352 | 389 | ||
390 | if (!IS_ERR(cx20442->por)) { | ||
391 | /* should be already in STANDBY, hence disabled */ | ||
392 | regulator_put(cx20442->por); | ||
393 | } | ||
394 | |||
395 | snd_soc_codec_set_drvdata(codec, NULL); | ||
353 | kfree(cx20442); | 396 | kfree(cx20442); |
354 | return 0; | 397 | return 0; |
355 | } | 398 | } |
@@ -359,6 +402,7 @@ static const u8 cx20442_reg; | |||
359 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 402 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
360 | .probe = cx20442_codec_probe, | 403 | .probe = cx20442_codec_probe, |
361 | .remove = cx20442_codec_remove, | 404 | .remove = cx20442_codec_remove, |
405 | .set_bias_level = cx20442_set_bias_level, | ||
362 | .reg_cache_default = &cx20442_reg, | 406 | .reg_cache_default = &cx20442_reg, |
363 | .reg_cache_size = 1, | 407 | .reg_cache_size = 1, |
364 | .reg_word_size = sizeof(u8), | 408 | .reg_word_size = sizeof(u8), |
@@ -391,17 +435,7 @@ static struct platform_driver cx20442_platform_driver = { | |||
391 | .remove = __exit_p(cx20442_platform_remove), | 435 | .remove = __exit_p(cx20442_platform_remove), |
392 | }; | 436 | }; |
393 | 437 | ||
394 | static int __init cx20442_init(void) | 438 | module_platform_driver(cx20442_platform_driver); |
395 | { | ||
396 | return platform_driver_register(&cx20442_platform_driver); | ||
397 | } | ||
398 | module_init(cx20442_init); | ||
399 | |||
400 | static void __exit cx20442_exit(void) | ||
401 | { | ||
402 | platform_driver_unregister(&cx20442_platform_driver); | ||
403 | } | ||
404 | module_exit(cx20442_exit); | ||
405 | 439 | ||
406 | MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver"); | 440 | MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver"); |
407 | MODULE_AUTHOR("Janusz Krzysztofik"); | 441 | MODULE_AUTHOR("Janusz Krzysztofik"); |
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index b545b7d3722..ab38e93c354 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <linux/module.h> | 21 | #include <linux/module.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -182,9 +181,14 @@ | |||
182 | 181 | ||
183 | /* AUX1_L bit fields */ | 182 | /* AUX1_L bit fields */ |
184 | #define DA7210_AUX1_L_VOL (0x3F << 0) | 183 | #define DA7210_AUX1_L_VOL (0x3F << 0) |
184 | #define DA7210_AUX1_L_EN (1 << 7) | ||
185 | 185 | ||
186 | /* AUX1_R bit fields */ | 186 | /* AUX1_R bit fields */ |
187 | #define DA7210_AUX1_R_VOL (0x3F << 0) | 187 | #define DA7210_AUX1_R_VOL (0x3F << 0) |
188 | #define DA7210_AUX1_R_EN (1 << 7) | ||
189 | |||
190 | /* AUX2 bit fields */ | ||
191 | #define DA7210_AUX2_EN (1 << 3) | ||
188 | 192 | ||
189 | /* Minimum INPGA and AUX1 volume to enable noise suppression */ | 193 | /* Minimum INPGA and AUX1 volume to enable noise suppression */ |
190 | #define DA7210_INPGA_MIN_VOL_NS 0x0A /* 10.5dB */ | 194 | #define DA7210_INPGA_MIN_VOL_NS 0x0A /* 10.5dB */ |
@@ -235,12 +239,22 @@ static const unsigned int mono_vol_tlv[] = { | |||
235 | 0x3, 0x7, TLV_DB_SCALE_ITEM(-1800, 600, 0) | 239 | 0x3, 0x7, TLV_DB_SCALE_ITEM(-1800, 600, 0) |
236 | }; | 240 | }; |
237 | 241 | ||
242 | static const unsigned int aux1_vol_tlv[] = { | ||
243 | TLV_DB_RANGE_HEAD(2), | ||
244 | 0x0, 0x10, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1), | ||
245 | /* -48dB to 21dB */ | ||
246 | 0x11, 0x3f, TLV_DB_SCALE_ITEM(-4800, 150, 0) | ||
247 | }; | ||
248 | |||
238 | static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0); | 249 | static const DECLARE_TLV_DB_SCALE(eq_gain_tlv, -1050, 150, 0); |
239 | static const DECLARE_TLV_DB_SCALE(adc_eq_master_gain_tlv, -1800, 600, 1); | 250 | static const DECLARE_TLV_DB_SCALE(adc_eq_master_gain_tlv, -1800, 600, 1); |
240 | static const DECLARE_TLV_DB_SCALE(dac_gain_tlv, -7725, 75, 0); | 251 | static const DECLARE_TLV_DB_SCALE(dac_gain_tlv, -7725, 75, 0); |
252 | static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, -600, 600, 0); | ||
253 | static const DECLARE_TLV_DB_SCALE(aux2_vol_tlv, -600, 600, 0); | ||
254 | static const DECLARE_TLV_DB_SCALE(inpga_gain_tlv, -450, 150, 0); | ||
241 | 255 | ||
242 | /* ADC and DAC high pass filter f0 value */ | 256 | /* ADC and DAC high pass filter f0 value */ |
243 | static const char const *da7210_hpf_cutoff_txt[] = { | 257 | static const char * const da7210_hpf_cutoff_txt[] = { |
244 | "Fs/8192*pi", "Fs/4096*pi", "Fs/2048*pi", "Fs/1024*pi" | 258 | "Fs/8192*pi", "Fs/4096*pi", "Fs/2048*pi", "Fs/1024*pi" |
245 | }; | 259 | }; |
246 | 260 | ||
@@ -251,7 +265,7 @@ static const struct soc_enum da7210_adc_hpf_cutoff = | |||
251 | SOC_ENUM_SINGLE(DA7210_ADC_HPF, 0, 4, da7210_hpf_cutoff_txt); | 265 | SOC_ENUM_SINGLE(DA7210_ADC_HPF, 0, 4, da7210_hpf_cutoff_txt); |
252 | 266 | ||
253 | /* ADC and DAC voice (8kHz) high pass cutoff value */ | 267 | /* ADC and DAC voice (8kHz) high pass cutoff value */ |
254 | static const char const *da7210_vf_cutoff_txt[] = { | 268 | static const char * const da7210_vf_cutoff_txt[] = { |
255 | "2.5Hz", "25Hz", "50Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz" | 269 | "2.5Hz", "25Hz", "50Hz", "100Hz", "150Hz", "200Hz", "300Hz", "400Hz" |
256 | }; | 270 | }; |
257 | 271 | ||
@@ -345,6 +359,17 @@ static const struct snd_kcontrol_new da7210_snd_controls[] = { | |||
345 | SOC_SINGLE_TLV("Mono Playback Volume", DA7210_OUT2, 0, 0x7, 0, | 359 | SOC_SINGLE_TLV("Mono Playback Volume", DA7210_OUT2, 0, 0x7, 0, |
346 | mono_vol_tlv), | 360 | mono_vol_tlv), |
347 | 361 | ||
362 | SOC_DOUBLE_R_TLV("Mic Capture Volume", | ||
363 | DA7210_MIC_L, DA7210_MIC_R, | ||
364 | 0, 0x5, 0, mic_vol_tlv), | ||
365 | SOC_DOUBLE_R_TLV("Aux1 Capture Volume", | ||
366 | DA7210_AUX1_L, DA7210_AUX1_R, | ||
367 | 0, 0x3f, 0, aux1_vol_tlv), | ||
368 | SOC_SINGLE_TLV("Aux2 Capture Volume", DA7210_AUX2, 0, 0x3, 0, | ||
369 | aux2_vol_tlv), | ||
370 | SOC_DOUBLE_TLV("In PGA Capture Volume", DA7210_IN_GAIN, 0, 4, 0xF, 0, | ||
371 | inpga_gain_tlv), | ||
372 | |||
348 | /* DAC Equalizer controls */ | 373 | /* DAC Equalizer controls */ |
349 | SOC_SINGLE("DAC EQ Switch", DA7210_DAC_EQ5, 7, 1, 0), | 374 | SOC_SINGLE("DAC EQ Switch", DA7210_DAC_EQ5, 7, 1, 0), |
350 | SOC_SINGLE_TLV("DAC EQ1 Volume", DA7210_DAC_EQ1_2, 0, 0xf, 1, | 375 | SOC_SINGLE_TLV("DAC EQ1 Volume", DA7210_DAC_EQ1_2, 0, 0xf, 1, |
@@ -422,26 +447,42 @@ static const struct snd_kcontrol_new da7210_snd_controls[] = { | |||
422 | static const struct snd_kcontrol_new da7210_dapm_inmixl_controls[] = { | 447 | static const struct snd_kcontrol_new da7210_dapm_inmixl_controls[] = { |
423 | SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_L, 0, 1, 0), | 448 | SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_L, 0, 1, 0), |
424 | SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_L, 1, 1, 0), | 449 | SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_L, 1, 1, 0), |
450 | SOC_DAPM_SINGLE("Aux1 Left Switch", DA7210_INMIX_L, 2, 1, 0), | ||
451 | SOC_DAPM_SINGLE("Aux2 Switch", DA7210_INMIX_L, 3, 1, 0), | ||
452 | SOC_DAPM_SINGLE("Outmix Left Switch", DA7210_INMIX_L, 4, 1, 0), | ||
425 | }; | 453 | }; |
426 | 454 | ||
427 | /* In Mixer Right */ | 455 | /* In Mixer Right */ |
428 | static const struct snd_kcontrol_new da7210_dapm_inmixr_controls[] = { | 456 | static const struct snd_kcontrol_new da7210_dapm_inmixr_controls[] = { |
429 | SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_R, 0, 1, 0), | 457 | SOC_DAPM_SINGLE("Mic Right Switch", DA7210_INMIX_R, 0, 1, 0), |
430 | SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_R, 1, 1, 0), | 458 | SOC_DAPM_SINGLE("Mic Left Switch", DA7210_INMIX_R, 1, 1, 0), |
459 | SOC_DAPM_SINGLE("Aux1 Right Switch", DA7210_INMIX_R, 2, 1, 0), | ||
460 | SOC_DAPM_SINGLE("Aux2 Switch", DA7210_INMIX_R, 3, 1, 0), | ||
461 | SOC_DAPM_SINGLE("Outmix Right Switch", DA7210_INMIX_R, 4, 1, 0), | ||
431 | }; | 462 | }; |
432 | 463 | ||
433 | /* Out Mixer Left */ | 464 | /* Out Mixer Left */ |
434 | static const struct snd_kcontrol_new da7210_dapm_outmixl_controls[] = { | 465 | static const struct snd_kcontrol_new da7210_dapm_outmixl_controls[] = { |
466 | SOC_DAPM_SINGLE("Aux1 Left Switch", DA7210_OUTMIX_L, 0, 1, 0), | ||
467 | SOC_DAPM_SINGLE("Aux2 Switch", DA7210_OUTMIX_L, 1, 1, 0), | ||
468 | SOC_DAPM_SINGLE("INPGA Left Switch", DA7210_OUTMIX_L, 2, 1, 0), | ||
469 | SOC_DAPM_SINGLE("INPGA Right Switch", DA7210_OUTMIX_L, 3, 1, 0), | ||
435 | SOC_DAPM_SINGLE("DAC Left Switch", DA7210_OUTMIX_L, 4, 1, 0), | 470 | SOC_DAPM_SINGLE("DAC Left Switch", DA7210_OUTMIX_L, 4, 1, 0), |
436 | }; | 471 | }; |
437 | 472 | ||
438 | /* Out Mixer Right */ | 473 | /* Out Mixer Right */ |
439 | static const struct snd_kcontrol_new da7210_dapm_outmixr_controls[] = { | 474 | static const struct snd_kcontrol_new da7210_dapm_outmixr_controls[] = { |
475 | SOC_DAPM_SINGLE("Aux1 Right Switch", DA7210_OUTMIX_R, 0, 1, 0), | ||
476 | SOC_DAPM_SINGLE("Aux2 Switch", DA7210_OUTMIX_R, 1, 1, 0), | ||
477 | SOC_DAPM_SINGLE("INPGA Left Switch", DA7210_OUTMIX_R, 2, 1, 0), | ||
478 | SOC_DAPM_SINGLE("INPGA Right Switch", DA7210_OUTMIX_R, 3, 1, 0), | ||
440 | SOC_DAPM_SINGLE("DAC Right Switch", DA7210_OUTMIX_R, 4, 1, 0), | 479 | SOC_DAPM_SINGLE("DAC Right Switch", DA7210_OUTMIX_R, 4, 1, 0), |
441 | }; | 480 | }; |
442 | 481 | ||
443 | /* Mono Mixer */ | 482 | /* Mono Mixer */ |
444 | static const struct snd_kcontrol_new da7210_dapm_monomix_controls[] = { | 483 | static const struct snd_kcontrol_new da7210_dapm_monomix_controls[] = { |
484 | SOC_DAPM_SINGLE("INPGA Right Switch", DA7210_OUT2, 3, 1, 0), | ||
485 | SOC_DAPM_SINGLE("INPGA Left Switch", DA7210_OUT2, 4, 1, 0), | ||
445 | SOC_DAPM_SINGLE("Outmix Right Switch", DA7210_OUT2, 5, 1, 0), | 486 | SOC_DAPM_SINGLE("Outmix Right Switch", DA7210_OUT2, 5, 1, 0), |
446 | SOC_DAPM_SINGLE("Outmix Left Switch", DA7210_OUT2, 6, 1, 0), | 487 | SOC_DAPM_SINGLE("Outmix Left Switch", DA7210_OUT2, 6, 1, 0), |
447 | }; | 488 | }; |
@@ -452,14 +493,23 @@ static const struct snd_soc_dapm_widget da7210_dapm_widgets[] = { | |||
452 | /* Input Lines */ | 493 | /* Input Lines */ |
453 | SND_SOC_DAPM_INPUT("MICL"), | 494 | SND_SOC_DAPM_INPUT("MICL"), |
454 | SND_SOC_DAPM_INPUT("MICR"), | 495 | SND_SOC_DAPM_INPUT("MICR"), |
496 | SND_SOC_DAPM_INPUT("AUX1L"), | ||
497 | SND_SOC_DAPM_INPUT("AUX1R"), | ||
498 | SND_SOC_DAPM_INPUT("AUX2"), | ||
455 | 499 | ||
456 | /* Input PGAs */ | 500 | /* Input PGAs */ |
457 | SND_SOC_DAPM_PGA("Mic Left", DA7210_STARTUP3, 0, 1, NULL, 0), | 501 | SND_SOC_DAPM_PGA("Mic Left", DA7210_STARTUP3, 0, 1, NULL, 0), |
458 | SND_SOC_DAPM_PGA("Mic Right", DA7210_STARTUP3, 1, 1, NULL, 0), | 502 | SND_SOC_DAPM_PGA("Mic Right", DA7210_STARTUP3, 1, 1, NULL, 0), |
503 | SND_SOC_DAPM_PGA("Aux1 Left", DA7210_STARTUP3, 2, 1, NULL, 0), | ||
504 | SND_SOC_DAPM_PGA("Aux1 Right", DA7210_STARTUP3, 3, 1, NULL, 0), | ||
505 | SND_SOC_DAPM_PGA("Aux2 Mono", DA7210_STARTUP3, 4, 1, NULL, 0), | ||
459 | 506 | ||
460 | SND_SOC_DAPM_PGA("INPGA Left", DA7210_INMIX_L, 7, 0, NULL, 0), | 507 | SND_SOC_DAPM_PGA("INPGA Left", DA7210_INMIX_L, 7, 0, NULL, 0), |
461 | SND_SOC_DAPM_PGA("INPGA Right", DA7210_INMIX_R, 7, 0, NULL, 0), | 508 | SND_SOC_DAPM_PGA("INPGA Right", DA7210_INMIX_R, 7, 0, NULL, 0), |
462 | 509 | ||
510 | /* MICBIAS */ | ||
511 | SND_SOC_DAPM_SUPPLY("Mic Bias", DA7210_MIC_L, 6, 0, NULL, 0), | ||
512 | |||
463 | /* Input Mixers */ | 513 | /* Input Mixers */ |
464 | SND_SOC_DAPM_MIXER("In Mixer Left", SND_SOC_NOPM, 0, 0, | 514 | SND_SOC_DAPM_MIXER("In Mixer Left", SND_SOC_NOPM, 0, 0, |
465 | &da7210_dapm_inmixl_controls[0], | 515 | &da7210_dapm_inmixl_controls[0], |
@@ -515,12 +565,21 @@ static const struct snd_soc_dapm_route da7210_audio_map[] = { | |||
515 | /* Input path */ | 565 | /* Input path */ |
516 | {"Mic Left", NULL, "MICL"}, | 566 | {"Mic Left", NULL, "MICL"}, |
517 | {"Mic Right", NULL, "MICR"}, | 567 | {"Mic Right", NULL, "MICR"}, |
568 | {"Aux1 Left", NULL, "AUX1L"}, | ||
569 | {"Aux1 Right", NULL, "AUX1R"}, | ||
570 | {"Aux2 Mono", NULL, "AUX2"}, | ||
518 | 571 | ||
519 | {"In Mixer Left", "Mic Left Switch", "Mic Left"}, | 572 | {"In Mixer Left", "Mic Left Switch", "Mic Left"}, |
520 | {"In Mixer Left", "Mic Right Switch", "Mic Right"}, | 573 | {"In Mixer Left", "Mic Right Switch", "Mic Right"}, |
574 | {"In Mixer Left", "Aux1 Left Switch", "Aux1 Left"}, | ||
575 | {"In Mixer Left", "Aux2 Switch", "Aux2 Mono"}, | ||
576 | {"In Mixer Left", "Outmix Left Switch", "Out Mixer Left"}, | ||
521 | 577 | ||
522 | {"In Mixer Right", "Mic Right Switch", "Mic Right"}, | 578 | {"In Mixer Right", "Mic Right Switch", "Mic Right"}, |
523 | {"In Mixer Right", "Mic Left Switch", "Mic Left"}, | 579 | {"In Mixer Right", "Mic Left Switch", "Mic Left"}, |
580 | {"In Mixer Right", "Aux1 Right Switch", "Aux1 Right"}, | ||
581 | {"In Mixer Right", "Aux2 Switch", "Aux2 Mono"}, | ||
582 | {"In Mixer Right", "Outmix Right Switch", "Out Mixer Right"}, | ||
524 | 583 | ||
525 | {"INPGA Left", NULL, "In Mixer Left"}, | 584 | {"INPGA Left", NULL, "In Mixer Left"}, |
526 | {"ADC Left", NULL, "INPGA Left"}, | 585 | {"ADC Left", NULL, "INPGA Left"}, |
@@ -529,9 +588,20 @@ static const struct snd_soc_dapm_route da7210_audio_map[] = { | |||
529 | {"ADC Right", NULL, "INPGA Right"}, | 588 | {"ADC Right", NULL, "INPGA Right"}, |
530 | 589 | ||
531 | /* Output path */ | 590 | /* Output path */ |
591 | {"Out Mixer Left", "Aux1 Left Switch", "Aux1 Left"}, | ||
592 | {"Out Mixer Left", "Aux2 Switch", "Aux2 Mono"}, | ||
593 | {"Out Mixer Left", "INPGA Left Switch", "INPGA Left"}, | ||
594 | {"Out Mixer Left", "INPGA Right Switch", "INPGA Right"}, | ||
532 | {"Out Mixer Left", "DAC Left Switch", "DAC Left"}, | 595 | {"Out Mixer Left", "DAC Left Switch", "DAC Left"}, |
596 | |||
597 | {"Out Mixer Right", "Aux1 Right Switch", "Aux1 Right"}, | ||
598 | {"Out Mixer Right", "Aux2 Switch", "Aux2 Mono"}, | ||
599 | {"Out Mixer Right", "INPGA Right Switch", "INPGA Right"}, | ||
600 | {"Out Mixer Right", "INPGA Left Switch", "INPGA Left"}, | ||
533 | {"Out Mixer Right", "DAC Right Switch", "DAC Right"}, | 601 | {"Out Mixer Right", "DAC Right Switch", "DAC Right"}, |
534 | 602 | ||
603 | {"Mono Mixer", "INPGA Right Switch", "INPGA Right"}, | ||
604 | {"Mono Mixer", "INPGA Left Switch", "INPGA Left"}, | ||
535 | {"Mono Mixer", "Outmix Right Switch", "Out Mixer Right"}, | 605 | {"Mono Mixer", "Outmix Right Switch", "Out Mixer Right"}, |
536 | {"Mono Mixer", "Outmix Left Switch", "Out Mixer Left"}, | 606 | {"Mono Mixer", "Outmix Left Switch", "Out Mixer Left"}, |
537 | 607 | ||
@@ -761,7 +831,7 @@ static int da7210_mute(struct snd_soc_dai *dai, int mute) | |||
761 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 831 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
762 | 832 | ||
763 | /* DAI operations */ | 833 | /* DAI operations */ |
764 | static struct snd_soc_dai_ops da7210_dai_ops = { | 834 | static const struct snd_soc_dai_ops da7210_dai_ops = { |
765 | .hw_params = da7210_hw_params, | 835 | .hw_params = da7210_hw_params, |
766 | .set_fmt = da7210_set_dai_fmt, | 836 | .set_fmt = da7210_set_dai_fmt, |
767 | .digital_mute = da7210_mute, | 837 | .digital_mute = da7210_mute, |
@@ -888,6 +958,12 @@ static int da7210_probe(struct snd_soc_codec *codec) | |||
888 | snd_soc_write(codec, DA7210_OUT2, DA7210_OUT2_EN | | 958 | snd_soc_write(codec, DA7210_OUT2, DA7210_OUT2_EN | |
889 | DA7210_OUT2_OUTMIX_L | DA7210_OUT2_OUTMIX_R); | 959 | DA7210_OUT2_OUTMIX_L | DA7210_OUT2_OUTMIX_R); |
890 | 960 | ||
961 | /* Enable Aux1 */ | ||
962 | snd_soc_write(codec, DA7210_AUX1_L, DA7210_AUX1_L_EN); | ||
963 | snd_soc_write(codec, DA7210_AUX1_R, DA7210_AUX1_R_EN); | ||
964 | /* Enable Aux2 */ | ||
965 | snd_soc_write(codec, DA7210_AUX2, DA7210_AUX2_EN); | ||
966 | |||
891 | /* Diable PLL and bypass it */ | 967 | /* Diable PLL and bypass it */ |
892 | snd_soc_write(codec, DA7210_PLL, DA7210_PLL_FS_48000); | 968 | snd_soc_write(codec, DA7210_PLL, DA7210_PLL_FS_48000); |
893 | 969 | ||
@@ -945,7 +1021,8 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c, | |||
945 | struct da7210_priv *da7210; | 1021 | struct da7210_priv *da7210; |
946 | int ret; | 1022 | int ret; |
947 | 1023 | ||
948 | da7210 = kzalloc(sizeof(struct da7210_priv), GFP_KERNEL); | 1024 | da7210 = devm_kzalloc(&i2c->dev, sizeof(struct da7210_priv), |
1025 | GFP_KERNEL); | ||
949 | if (!da7210) | 1026 | if (!da7210) |
950 | return -ENOMEM; | 1027 | return -ENOMEM; |
951 | 1028 | ||
@@ -954,16 +1031,12 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c, | |||
954 | 1031 | ||
955 | ret = snd_soc_register_codec(&i2c->dev, | 1032 | ret = snd_soc_register_codec(&i2c->dev, |
956 | &soc_codec_dev_da7210, &da7210_dai, 1); | 1033 | &soc_codec_dev_da7210, &da7210_dai, 1); |
957 | if (ret < 0) | ||
958 | kfree(da7210); | ||
959 | |||
960 | return ret; | 1034 | return ret; |
961 | } | 1035 | } |
962 | 1036 | ||
963 | static int __devexit da7210_i2c_remove(struct i2c_client *client) | 1037 | static int __devexit da7210_i2c_remove(struct i2c_client *client) |
964 | { | 1038 | { |
965 | snd_soc_unregister_codec(&client->dev); | 1039 | snd_soc_unregister_codec(&client->dev); |
966 | kfree(i2c_get_clientdata(client)); | ||
967 | return 0; | 1040 | return 0; |
968 | } | 1041 | } |
969 | 1042 | ||
diff --git a/sound/soc/codecs/dfbmcs320.c b/sound/soc/codecs/dfbmcs320.c index 704bbde6573..bfe46aa9036 100644 --- a/sound/soc/codecs/dfbmcs320.c +++ b/sound/soc/codecs/dfbmcs320.c | |||
@@ -55,17 +55,7 @@ static struct platform_driver dfmcs320_driver = { | |||
55 | .remove = __devexit_p(dfbmcs320_remove), | 55 | .remove = __devexit_p(dfbmcs320_remove), |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static int __init dfbmcs320_init(void) | 58 | module_platform_driver(dfmcs320_driver); |
59 | { | ||
60 | return platform_driver_register(&dfmcs320_driver); | ||
61 | } | ||
62 | module_init(dfbmcs320_init); | ||
63 | |||
64 | static void __exit dfbmcs320_exit(void) | ||
65 | { | ||
66 | platform_driver_unregister(&dfmcs320_driver); | ||
67 | } | ||
68 | module_exit(dfbmcs320_exit); | ||
69 | 59 | ||
70 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | 60 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); |
71 | MODULE_DESCRIPTION("ASoC DFBM-CS320 bluethooth module driver"); | 61 | MODULE_DESCRIPTION("ASoC DFBM-CS320 bluethooth module driver"); |
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c index 6fae765e3ad..3e929f079a1 100644 --- a/sound/soc/codecs/dmic.c +++ b/sound/soc/codecs/dmic.c | |||
@@ -89,17 +89,7 @@ static struct platform_driver dmic_driver = { | |||
89 | .remove = __devexit_p(dmic_dev_remove), | 89 | .remove = __devexit_p(dmic_dev_remove), |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static int __init dmic_init(void) | 92 | module_platform_driver(dmic_driver); |
93 | { | ||
94 | return platform_driver_register(&dmic_driver); | ||
95 | } | ||
96 | module_init(dmic_init); | ||
97 | |||
98 | static void __exit dmic_exit(void) | ||
99 | { | ||
100 | platform_driver_unregister(&dmic_driver); | ||
101 | } | ||
102 | module_exit(dmic_exit); | ||
103 | 93 | ||
104 | MODULE_DESCRIPTION("Generic DMIC driver"); | 94 | MODULE_DESCRIPTION("Generic DMIC driver"); |
105 | MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>"); | 95 | MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>"); |
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c index e373f8f0690..4624e752a18 100644 --- a/sound/soc/codecs/jz4740.c +++ b/sound/soc/codecs/jz4740.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/io.h> | ||
18 | 19 | ||
19 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
20 | 21 | ||
@@ -206,7 +207,7 @@ static int jz4740_codec_hw_params(struct snd_pcm_substream *substream, | |||
206 | return 0; | 207 | return 0; |
207 | } | 208 | } |
208 | 209 | ||
209 | static struct snd_soc_dai_ops jz4740_codec_dai_ops = { | 210 | static const struct snd_soc_dai_ops jz4740_codec_dai_ops = { |
210 | .hw_params = jz4740_codec_hw_params, | 211 | .hw_params = jz4740_codec_hw_params, |
211 | }; | 212 | }; |
212 | 213 | ||
@@ -311,7 +312,7 @@ static int jz4740_codec_dev_remove(struct snd_soc_codec *codec) | |||
311 | 312 | ||
312 | #ifdef CONFIG_PM_SLEEP | 313 | #ifdef CONFIG_PM_SLEEP |
313 | 314 | ||
314 | static int jz4740_codec_suspend(struct snd_soc_codec *codec, pm_message_t state) | 315 | static int jz4740_codec_suspend(struct snd_soc_codec *codec) |
315 | { | 316 | { |
316 | return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF); | 317 | return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF); |
317 | } | 318 | } |
@@ -352,7 +353,8 @@ static int __devinit jz4740_codec_probe(struct platform_device *pdev) | |||
352 | struct jz4740_codec *jz4740_codec; | 353 | struct jz4740_codec *jz4740_codec; |
353 | struct resource *mem; | 354 | struct resource *mem; |
354 | 355 | ||
355 | jz4740_codec = kzalloc(sizeof(*jz4740_codec), GFP_KERNEL); | 356 | jz4740_codec = devm_kzalloc(&pdev->dev, sizeof(*jz4740_codec), |
357 | GFP_KERNEL); | ||
356 | if (!jz4740_codec) | 358 | if (!jz4740_codec) |
357 | return -ENOMEM; | 359 | return -ENOMEM; |
358 | 360 | ||
@@ -360,14 +362,14 @@ static int __devinit jz4740_codec_probe(struct platform_device *pdev) | |||
360 | if (!mem) { | 362 | if (!mem) { |
361 | dev_err(&pdev->dev, "Failed to get mmio memory resource\n"); | 363 | dev_err(&pdev->dev, "Failed to get mmio memory resource\n"); |
362 | ret = -ENOENT; | 364 | ret = -ENOENT; |
363 | goto err_free_codec; | 365 | goto err_out; |
364 | } | 366 | } |
365 | 367 | ||
366 | mem = request_mem_region(mem->start, resource_size(mem), pdev->name); | 368 | mem = request_mem_region(mem->start, resource_size(mem), pdev->name); |
367 | if (!mem) { | 369 | if (!mem) { |
368 | dev_err(&pdev->dev, "Failed to request mmio memory region\n"); | 370 | dev_err(&pdev->dev, "Failed to request mmio memory region\n"); |
369 | ret = -EBUSY; | 371 | ret = -EBUSY; |
370 | goto err_free_codec; | 372 | goto err_out; |
371 | } | 373 | } |
372 | 374 | ||
373 | jz4740_codec->base = ioremap(mem->start, resource_size(mem)); | 375 | jz4740_codec->base = ioremap(mem->start, resource_size(mem)); |
@@ -393,9 +395,7 @@ err_iounmap: | |||
393 | iounmap(jz4740_codec->base); | 395 | iounmap(jz4740_codec->base); |
394 | err_release_mem_region: | 396 | err_release_mem_region: |
395 | release_mem_region(mem->start, resource_size(mem)); | 397 | release_mem_region(mem->start, resource_size(mem)); |
396 | err_free_codec: | 398 | err_out: |
397 | kfree(jz4740_codec); | ||
398 | |||
399 | return ret; | 399 | return ret; |
400 | } | 400 | } |
401 | 401 | ||
@@ -410,7 +410,6 @@ static int __devexit jz4740_codec_remove(struct platform_device *pdev) | |||
410 | release_mem_region(mem->start, resource_size(mem)); | 410 | release_mem_region(mem->start, resource_size(mem)); |
411 | 411 | ||
412 | platform_set_drvdata(pdev, NULL); | 412 | platform_set_drvdata(pdev, NULL); |
413 | kfree(jz4740_codec); | ||
414 | 413 | ||
415 | return 0; | 414 | return 0; |
416 | } | 415 | } |
@@ -424,17 +423,7 @@ static struct platform_driver jz4740_codec_driver = { | |||
424 | }, | 423 | }, |
425 | }; | 424 | }; |
426 | 425 | ||
427 | static int __init jz4740_codec_init(void) | 426 | module_platform_driver(jz4740_codec_driver); |
428 | { | ||
429 | return platform_driver_register(&jz4740_codec_driver); | ||
430 | } | ||
431 | module_init(jz4740_codec_init); | ||
432 | |||
433 | static void __exit jz4740_codec_exit(void) | ||
434 | { | ||
435 | platform_driver_unregister(&jz4740_codec_driver); | ||
436 | } | ||
437 | module_exit(jz4740_codec_exit); | ||
438 | 427 | ||
439 | MODULE_DESCRIPTION("JZ4740 SoC internal codec driver"); | 428 | MODULE_DESCRIPTION("JZ4740 SoC internal codec driver"); |
440 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | 429 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); |
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c index c387dafc6ab..319039240e0 100644 --- a/sound/soc/codecs/lm4857.c +++ b/sound/soc/codecs/lm4857.c | |||
@@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, | |||
215 | struct lm4857 *lm4857; | 215 | struct lm4857 *lm4857; |
216 | int ret; | 216 | int ret; |
217 | 217 | ||
218 | lm4857 = kzalloc(sizeof(*lm4857), GFP_KERNEL); | 218 | lm4857 = devm_kzalloc(&i2c->dev, sizeof(*lm4857), GFP_KERNEL); |
219 | if (!lm4857) | 219 | if (!lm4857) |
220 | return -ENOMEM; | 220 | return -ENOMEM; |
221 | 221 | ||
@@ -225,21 +225,12 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, | |||
225 | 225 | ||
226 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0); | 226 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0); |
227 | 227 | ||
228 | if (ret) { | 228 | return ret; |
229 | kfree(lm4857); | ||
230 | return ret; | ||
231 | } | ||
232 | |||
233 | return 0; | ||
234 | } | 229 | } |
235 | 230 | ||
236 | static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) | 231 | static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) |
237 | { | 232 | { |
238 | struct lm4857 *lm4857 = i2c_get_clientdata(i2c); | ||
239 | |||
240 | snd_soc_unregister_codec(&i2c->dev); | 233 | snd_soc_unregister_codec(&i2c->dev); |
241 | kfree(lm4857); | ||
242 | |||
243 | return 0; | 234 | return 0; |
244 | } | 235 | } |
245 | 236 | ||
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index ebbf63c79c3..006efcfe6dd 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <sound/core.h> | 18 | #include <sound/core.h> |
20 | #include <sound/pcm.h> | 19 | #include <sound/pcm.h> |
21 | #include <sound/pcm_params.h> | 20 | #include <sound/pcm_params.h> |
@@ -1650,14 +1649,14 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec, | |||
1650 | #define MAX98088_RATES SNDRV_PCM_RATE_8000_96000 | 1649 | #define MAX98088_RATES SNDRV_PCM_RATE_8000_96000 |
1651 | #define MAX98088_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) | 1650 | #define MAX98088_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) |
1652 | 1651 | ||
1653 | static struct snd_soc_dai_ops max98088_dai1_ops = { | 1652 | static const struct snd_soc_dai_ops max98088_dai1_ops = { |
1654 | .set_sysclk = max98088_dai_set_sysclk, | 1653 | .set_sysclk = max98088_dai_set_sysclk, |
1655 | .set_fmt = max98088_dai1_set_fmt, | 1654 | .set_fmt = max98088_dai1_set_fmt, |
1656 | .hw_params = max98088_dai1_hw_params, | 1655 | .hw_params = max98088_dai1_hw_params, |
1657 | .digital_mute = max98088_dai1_digital_mute, | 1656 | .digital_mute = max98088_dai1_digital_mute, |
1658 | }; | 1657 | }; |
1659 | 1658 | ||
1660 | static struct snd_soc_dai_ops max98088_dai2_ops = { | 1659 | static const struct snd_soc_dai_ops max98088_dai2_ops = { |
1661 | .set_sysclk = max98088_dai_set_sysclk, | 1660 | .set_sysclk = max98088_dai_set_sysclk, |
1662 | .set_fmt = max98088_dai2_set_fmt, | 1661 | .set_fmt = max98088_dai2_set_fmt, |
1663 | .hw_params = max98088_dai2_hw_params, | 1662 | .hw_params = max98088_dai2_hw_params, |
@@ -1947,7 +1946,7 @@ static void max98088_handle_pdata(struct snd_soc_codec *codec) | |||
1947 | } | 1946 | } |
1948 | 1947 | ||
1949 | #ifdef CONFIG_PM | 1948 | #ifdef CONFIG_PM |
1950 | static int max98088_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1949 | static int max98088_suspend(struct snd_soc_codec *codec) |
1951 | { | 1950 | { |
1952 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1951 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1953 | 1952 | ||
@@ -2070,7 +2069,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2070 | struct max98088_priv *max98088; | 2069 | struct max98088_priv *max98088; |
2071 | int ret; | 2070 | int ret; |
2072 | 2071 | ||
2073 | max98088 = kzalloc(sizeof(struct max98088_priv), GFP_KERNEL); | 2072 | max98088 = devm_kzalloc(&i2c->dev, sizeof(struct max98088_priv), |
2073 | GFP_KERNEL); | ||
2074 | if (max98088 == NULL) | 2074 | if (max98088 == NULL) |
2075 | return -ENOMEM; | 2075 | return -ENOMEM; |
2076 | 2076 | ||
@@ -2081,15 +2081,12 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2081 | 2081 | ||
2082 | ret = snd_soc_register_codec(&i2c->dev, | 2082 | ret = snd_soc_register_codec(&i2c->dev, |
2083 | &soc_codec_dev_max98088, &max98088_dai[0], 2); | 2083 | &soc_codec_dev_max98088, &max98088_dai[0], 2); |
2084 | if (ret < 0) | ||
2085 | kfree(max98088); | ||
2086 | return ret; | 2084 | return ret; |
2087 | } | 2085 | } |
2088 | 2086 | ||
2089 | static int __devexit max98088_i2c_remove(struct i2c_client *client) | 2087 | static int __devexit max98088_i2c_remove(struct i2c_client *client) |
2090 | { | 2088 | { |
2091 | snd_soc_unregister_codec(&client->dev); | 2089 | snd_soc_unregister_codec(&client->dev); |
2092 | kfree(i2c_get_clientdata(client)); | ||
2093 | return 0; | 2090 | return 0; |
2094 | } | 2091 | } |
2095 | 2092 | ||
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 26d7b089fb9..fcfa7497d7b 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <sound/core.h> | 18 | #include <sound/core.h> |
20 | #include <sound/pcm.h> | 19 | #include <sound/pcm.h> |
21 | #include <sound/pcm_params.h> | 20 | #include <sound/pcm_params.h> |
@@ -1782,19 +1781,19 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec, | |||
1782 | #define MAX98095_RATES SNDRV_PCM_RATE_8000_96000 | 1781 | #define MAX98095_RATES SNDRV_PCM_RATE_8000_96000 |
1783 | #define MAX98095_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) | 1782 | #define MAX98095_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) |
1784 | 1783 | ||
1785 | static struct snd_soc_dai_ops max98095_dai1_ops = { | 1784 | static const struct snd_soc_dai_ops max98095_dai1_ops = { |
1786 | .set_sysclk = max98095_dai_set_sysclk, | 1785 | .set_sysclk = max98095_dai_set_sysclk, |
1787 | .set_fmt = max98095_dai1_set_fmt, | 1786 | .set_fmt = max98095_dai1_set_fmt, |
1788 | .hw_params = max98095_dai1_hw_params, | 1787 | .hw_params = max98095_dai1_hw_params, |
1789 | }; | 1788 | }; |
1790 | 1789 | ||
1791 | static struct snd_soc_dai_ops max98095_dai2_ops = { | 1790 | static const struct snd_soc_dai_ops max98095_dai2_ops = { |
1792 | .set_sysclk = max98095_dai_set_sysclk, | 1791 | .set_sysclk = max98095_dai_set_sysclk, |
1793 | .set_fmt = max98095_dai2_set_fmt, | 1792 | .set_fmt = max98095_dai2_set_fmt, |
1794 | .hw_params = max98095_dai2_hw_params, | 1793 | .hw_params = max98095_dai2_hw_params, |
1795 | }; | 1794 | }; |
1796 | 1795 | ||
1797 | static struct snd_soc_dai_ops max98095_dai3_ops = { | 1796 | static const struct snd_soc_dai_ops max98095_dai3_ops = { |
1798 | .set_sysclk = max98095_dai_set_sysclk, | 1797 | .set_sysclk = max98095_dai_set_sysclk, |
1799 | .set_fmt = max98095_dai3_set_fmt, | 1798 | .set_fmt = max98095_dai3_set_fmt, |
1800 | .hw_params = max98095_dai3_hw_params, | 1799 | .hw_params = max98095_dai3_hw_params, |
@@ -2175,7 +2174,7 @@ static void max98095_handle_pdata(struct snd_soc_codec *codec) | |||
2175 | } | 2174 | } |
2176 | 2175 | ||
2177 | #ifdef CONFIG_PM | 2176 | #ifdef CONFIG_PM |
2178 | static int max98095_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2177 | static int max98095_suspend(struct snd_soc_codec *codec) |
2179 | { | 2178 | { |
2180 | max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2179 | max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2181 | 2180 | ||
@@ -2341,7 +2340,8 @@ static int max98095_i2c_probe(struct i2c_client *i2c, | |||
2341 | struct max98095_priv *max98095; | 2340 | struct max98095_priv *max98095; |
2342 | int ret; | 2341 | int ret; |
2343 | 2342 | ||
2344 | max98095 = kzalloc(sizeof(struct max98095_priv), GFP_KERNEL); | 2343 | max98095 = devm_kzalloc(&i2c->dev, sizeof(struct max98095_priv), |
2344 | GFP_KERNEL); | ||
2345 | if (max98095 == NULL) | 2345 | if (max98095 == NULL) |
2346 | return -ENOMEM; | 2346 | return -ENOMEM; |
2347 | 2347 | ||
@@ -2351,16 +2351,12 @@ static int max98095_i2c_probe(struct i2c_client *i2c, | |||
2351 | 2351 | ||
2352 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095, | 2352 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095, |
2353 | max98095_dai, ARRAY_SIZE(max98095_dai)); | 2353 | max98095_dai, ARRAY_SIZE(max98095_dai)); |
2354 | if (ret < 0) | ||
2355 | kfree(max98095); | ||
2356 | return ret; | 2354 | return ret; |
2357 | } | 2355 | } |
2358 | 2356 | ||
2359 | static int __devexit max98095_i2c_remove(struct i2c_client *client) | 2357 | static int __devexit max98095_i2c_remove(struct i2c_client *client) |
2360 | { | 2358 | { |
2361 | snd_soc_unregister_codec(&client->dev); | 2359 | snd_soc_unregister_codec(&client->dev); |
2362 | kfree(i2c_get_clientdata(client)); | ||
2363 | |||
2364 | return 0; | 2360 | return 0; |
2365 | } | 2361 | } |
2366 | 2362 | ||
diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c index 208d2ee6185..a1913091f56 100644 --- a/sound/soc/codecs/max9850.c +++ b/sound/soc/codecs/max9850.c | |||
@@ -86,7 +86,7 @@ SND_SOC_DAPM_INPUT("INL"), | |||
86 | SND_SOC_DAPM_INPUT("INR"), | 86 | SND_SOC_DAPM_INPUT("INR"), |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static const struct snd_soc_dapm_route intercon[] = { | 89 | static const struct snd_soc_dapm_route max9850_dapm_routes[] = { |
90 | /* output mixer */ | 90 | /* output mixer */ |
91 | {"Output Mixer", NULL, "DAC"}, | 91 | {"Output Mixer", NULL, "DAC"}, |
92 | {"Output Mixer", "Line In Switch", "Line Input"}, | 92 | {"Output Mixer", "Line In Switch", "Line Input"}, |
@@ -254,7 +254,7 @@ static int max9850_set_bias_level(struct snd_soc_codec *codec, | |||
254 | #define MAX9850_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 254 | #define MAX9850_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
255 | SNDRV_PCM_FMTBIT_S24_LE) | 255 | SNDRV_PCM_FMTBIT_S24_LE) |
256 | 256 | ||
257 | static struct snd_soc_dai_ops max9850_dai_ops = { | 257 | static const struct snd_soc_dai_ops max9850_dai_ops = { |
258 | .hw_params = max9850_hw_params, | 258 | .hw_params = max9850_hw_params, |
259 | .set_sysclk = max9850_set_dai_sysclk, | 259 | .set_sysclk = max9850_set_dai_sysclk, |
260 | .set_fmt = max9850_set_dai_fmt, | 260 | .set_fmt = max9850_set_dai_fmt, |
@@ -273,7 +273,7 @@ static struct snd_soc_dai_driver max9850_dai = { | |||
273 | }; | 273 | }; |
274 | 274 | ||
275 | #ifdef CONFIG_PM | 275 | #ifdef CONFIG_PM |
276 | static int max9850_suspend(struct snd_soc_codec *codec, pm_message_t state) | 276 | static int max9850_suspend(struct snd_soc_codec *codec) |
277 | { | 277 | { |
278 | max9850_set_bias_level(codec, SND_SOC_BIAS_OFF); | 278 | max9850_set_bias_level(codec, SND_SOC_BIAS_OFF); |
279 | 279 | ||
@@ -293,7 +293,6 @@ static int max9850_resume(struct snd_soc_codec *codec) | |||
293 | 293 | ||
294 | static int max9850_probe(struct snd_soc_codec *codec) | 294 | static int max9850_probe(struct snd_soc_codec *codec) |
295 | { | 295 | { |
296 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
297 | int ret; | 296 | int ret; |
298 | 297 | ||
299 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); | 298 | ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C); |
@@ -309,13 +308,6 @@ static int max9850_probe(struct snd_soc_codec *codec) | |||
309 | /* set slew-rate 125ms */ | 308 | /* set slew-rate 125ms */ |
310 | snd_soc_update_bits(codec, MAX9850_CHARGE_PUMP, 0xff, 0xc0); | 309 | snd_soc_update_bits(codec, MAX9850_CHARGE_PUMP, 0xff, 0xc0); |
311 | 310 | ||
312 | snd_soc_dapm_new_controls(dapm, max9850_dapm_widgets, | ||
313 | ARRAY_SIZE(max9850_dapm_widgets)); | ||
314 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
315 | |||
316 | snd_soc_add_controls(codec, max9850_controls, | ||
317 | ARRAY_SIZE(max9850_controls)); | ||
318 | |||
319 | return 0; | 311 | return 0; |
320 | } | 312 | } |
321 | 313 | ||
@@ -328,6 +320,13 @@ static struct snd_soc_codec_driver soc_codec_dev_max9850 = { | |||
328 | .reg_word_size = sizeof(u8), | 320 | .reg_word_size = sizeof(u8), |
329 | .reg_cache_default = max9850_reg, | 321 | .reg_cache_default = max9850_reg, |
330 | .volatile_register = max9850_volatile_register, | 322 | .volatile_register = max9850_volatile_register, |
323 | |||
324 | .controls = max9850_controls, | ||
325 | .num_controls = ARRAY_SIZE(max9850_controls), | ||
326 | .dapm_widgets = max9850_dapm_widgets, | ||
327 | .num_dapm_widgets = ARRAY_SIZE(max9850_dapm_widgets), | ||
328 | .dapm_routes = max9850_dapm_routes, | ||
329 | .num_dapm_routes = ARRAY_SIZE(max9850_dapm_routes), | ||
331 | }; | 330 | }; |
332 | 331 | ||
333 | static int __devinit max9850_i2c_probe(struct i2c_client *i2c, | 332 | static int __devinit max9850_i2c_probe(struct i2c_client *i2c, |
@@ -336,7 +335,8 @@ static int __devinit max9850_i2c_probe(struct i2c_client *i2c, | |||
336 | struct max9850_priv *max9850; | 335 | struct max9850_priv *max9850; |
337 | int ret; | 336 | int ret; |
338 | 337 | ||
339 | max9850 = kzalloc(sizeof(struct max9850_priv), GFP_KERNEL); | 338 | max9850 = devm_kzalloc(&i2c->dev, sizeof(struct max9850_priv), |
339 | GFP_KERNEL); | ||
340 | if (max9850 == NULL) | 340 | if (max9850 == NULL) |
341 | return -ENOMEM; | 341 | return -ENOMEM; |
342 | 342 | ||
@@ -344,15 +344,12 @@ static int __devinit max9850_i2c_probe(struct i2c_client *i2c, | |||
344 | 344 | ||
345 | ret = snd_soc_register_codec(&i2c->dev, | 345 | ret = snd_soc_register_codec(&i2c->dev, |
346 | &soc_codec_dev_max9850, &max9850_dai, 1); | 346 | &soc_codec_dev_max9850, &max9850_dai, 1); |
347 | if (ret < 0) | ||
348 | kfree(max9850); | ||
349 | return ret; | 347 | return ret; |
350 | } | 348 | } |
351 | 349 | ||
352 | static __devexit int max9850_i2c_remove(struct i2c_client *client) | 350 | static __devexit int max9850_i2c_remove(struct i2c_client *client) |
353 | { | 351 | { |
354 | snd_soc_unregister_codec(&client->dev); | 352 | snd_soc_unregister_codec(&client->dev); |
355 | kfree(i2c_get_clientdata(client)); | ||
356 | return 0; | 353 | return 0; |
357 | } | 354 | } |
358 | 355 | ||
diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c index 9e7e964a5fa..dcf6f2a1600 100644 --- a/sound/soc/codecs/max9877.c +++ b/sound/soc/codecs/max9877.c | |||
@@ -106,13 +106,13 @@ static int max9877_set_2reg(struct snd_kcontrol *kcontrol, | |||
106 | unsigned int mask = mc->max; | 106 | unsigned int mask = mc->max; |
107 | unsigned int val = (ucontrol->value.integer.value[0] & mask); | 107 | unsigned int val = (ucontrol->value.integer.value[0] & mask); |
108 | unsigned int val2 = (ucontrol->value.integer.value[1] & mask); | 108 | unsigned int val2 = (ucontrol->value.integer.value[1] & mask); |
109 | unsigned int change = 1; | 109 | unsigned int change = 0; |
110 | 110 | ||
111 | if (((max9877_regs[reg] >> shift) & mask) == val) | 111 | if (((max9877_regs[reg] >> shift) & mask) != val) |
112 | change = 0; | 112 | change = 1; |
113 | 113 | ||
114 | if (((max9877_regs[reg2] >> shift) & mask) == val2) | 114 | if (((max9877_regs[reg2] >> shift) & mask) != val2) |
115 | change = 0; | 115 | change = 1; |
116 | 116 | ||
117 | if (change) { | 117 | if (change) { |
118 | max9877_regs[reg] &= ~(mask << shift); | 118 | max9877_regs[reg] &= ~(mask << shift); |
diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c index f7316519432..edcaa7ea548 100644 --- a/sound/soc/codecs/pcm3008.c +++ b/sound/soc/codecs/pcm3008.c | |||
@@ -118,7 +118,7 @@ static int pcm3008_soc_remove(struct snd_soc_codec *codec) | |||
118 | } | 118 | } |
119 | 119 | ||
120 | #ifdef CONFIG_PM | 120 | #ifdef CONFIG_PM |
121 | static int pcm3008_soc_suspend(struct snd_soc_codec *codec, pm_message_t msg) | 121 | static int pcm3008_soc_suspend(struct snd_soc_codec *codec) |
122 | { | 122 | { |
123 | struct pcm3008_setup_data *setup = codec->dev->platform_data; | 123 | struct pcm3008_setup_data *setup = codec->dev->platform_data; |
124 | 124 | ||
@@ -172,17 +172,7 @@ static struct platform_driver pcm3008_codec_driver = { | |||
172 | }, | 172 | }, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static int __init pcm3008_modinit(void) | 175 | module_platform_driver(pcm3008_codec_driver); |
176 | { | ||
177 | return platform_driver_register(&pcm3008_codec_driver); | ||
178 | } | ||
179 | module_init(pcm3008_modinit); | ||
180 | |||
181 | static void __exit pcm3008_exit(void) | ||
182 | { | ||
183 | platform_driver_unregister(&pcm3008_codec_driver); | ||
184 | } | ||
185 | module_exit(pcm3008_exit); | ||
186 | 176 | ||
187 | MODULE_DESCRIPTION("Soc PCM3008 driver"); | 177 | MODULE_DESCRIPTION("Soc PCM3008 driver"); |
188 | MODULE_AUTHOR("Hugo Villeneuve"); | 178 | MODULE_AUTHOR("Hugo Villeneuve"); |
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 4646e808b90..20c324c7c34 100644 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -1642,7 +1641,7 @@ static int rt5631_remove(struct snd_soc_codec *codec) | |||
1642 | } | 1641 | } |
1643 | 1642 | ||
1644 | #ifdef CONFIG_PM | 1643 | #ifdef CONFIG_PM |
1645 | static int rt5631_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1644 | static int rt5631_suspend(struct snd_soc_codec *codec) |
1646 | { | 1645 | { |
1647 | rt5631_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1646 | rt5631_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1648 | return 0; | 1647 | return 0; |
@@ -1664,7 +1663,7 @@ static int rt5631_resume(struct snd_soc_codec *codec) | |||
1664 | SNDRV_PCM_FMTBIT_S24_LE | \ | 1663 | SNDRV_PCM_FMTBIT_S24_LE | \ |
1665 | SNDRV_PCM_FMTBIT_S8) | 1664 | SNDRV_PCM_FMTBIT_S8) |
1666 | 1665 | ||
1667 | static struct snd_soc_dai_ops rt5631_ops = { | 1666 | static const struct snd_soc_dai_ops rt5631_ops = { |
1668 | .hw_params = rt5631_hifi_pcm_params, | 1667 | .hw_params = rt5631_hifi_pcm_params, |
1669 | .set_fmt = rt5631_hifi_codec_set_dai_fmt, | 1668 | .set_fmt = rt5631_hifi_codec_set_dai_fmt, |
1670 | .set_sysclk = rt5631_hifi_codec_set_dai_sysclk, | 1669 | .set_sysclk = rt5631_hifi_codec_set_dai_sysclk, |
@@ -1725,7 +1724,8 @@ static int rt5631_i2c_probe(struct i2c_client *i2c, | |||
1725 | struct rt5631_priv *rt5631; | 1724 | struct rt5631_priv *rt5631; |
1726 | int ret; | 1725 | int ret; |
1727 | 1726 | ||
1728 | rt5631 = kzalloc(sizeof(struct rt5631_priv), GFP_KERNEL); | 1727 | rt5631 = devm_kzalloc(&i2c->dev, sizeof(struct rt5631_priv), |
1728 | GFP_KERNEL); | ||
1729 | if (NULL == rt5631) | 1729 | if (NULL == rt5631) |
1730 | return -ENOMEM; | 1730 | return -ENOMEM; |
1731 | 1731 | ||
@@ -1733,16 +1733,12 @@ static int rt5631_i2c_probe(struct i2c_client *i2c, | |||
1733 | 1733 | ||
1734 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5631, | 1734 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5631, |
1735 | rt5631_dai, ARRAY_SIZE(rt5631_dai)); | 1735 | rt5631_dai, ARRAY_SIZE(rt5631_dai)); |
1736 | if (ret < 0) | ||
1737 | kfree(rt5631); | ||
1738 | |||
1739 | return ret; | 1736 | return ret; |
1740 | } | 1737 | } |
1741 | 1738 | ||
1742 | static __devexit int rt5631_i2c_remove(struct i2c_client *client) | 1739 | static __devexit int rt5631_i2c_remove(struct i2c_client *client) |
1743 | { | 1740 | { |
1744 | snd_soc_unregister_codec(&client->dev); | 1741 | snd_soc_unregister_codec(&client->dev); |
1745 | kfree(i2c_get_clientdata(client)); | ||
1746 | return 0; | 1742 | return 0; |
1747 | } | 1743 | } |
1748 | 1744 | ||
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index bbcf921166f..f8863ebb430 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/regulator/driver.h> | 19 | #include <linux/regulator/driver.h> |
21 | #include <linux/regulator/machine.h> | 20 | #include <linux/regulator/machine.h> |
22 | #include <linux/regulator/consumer.h> | 21 | #include <linux/regulator/consumer.h> |
@@ -833,7 +832,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec, | |||
833 | ldo->voltage = voltage; | 832 | ldo->voltage = voltage; |
834 | 833 | ||
835 | ldo->dev = regulator_register(&ldo->desc, codec->dev, | 834 | ldo->dev = regulator_register(&ldo->desc, codec->dev, |
836 | init_data, ldo); | 835 | init_data, ldo, NULL); |
837 | if (IS_ERR(ldo->dev)) { | 836 | if (IS_ERR(ldo->dev)) { |
838 | int ret = PTR_ERR(ldo->dev); | 837 | int ret = PTR_ERR(ldo->dev); |
839 | 838 | ||
@@ -923,7 +922,7 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec, | |||
923 | SNDRV_PCM_FMTBIT_S24_LE |\ | 922 | SNDRV_PCM_FMTBIT_S24_LE |\ |
924 | SNDRV_PCM_FMTBIT_S32_LE) | 923 | SNDRV_PCM_FMTBIT_S32_LE) |
925 | 924 | ||
926 | static struct snd_soc_dai_ops sgtl5000_ops = { | 925 | static const struct snd_soc_dai_ops sgtl5000_ops = { |
927 | .hw_params = sgtl5000_pcm_hw_params, | 926 | .hw_params = sgtl5000_pcm_hw_params, |
928 | .digital_mute = sgtl5000_digital_mute, | 927 | .digital_mute = sgtl5000_digital_mute, |
929 | .set_fmt = sgtl5000_set_dai_fmt, | 928 | .set_fmt = sgtl5000_set_dai_fmt, |
@@ -968,7 +967,7 @@ static int sgtl5000_volatile_register(struct snd_soc_codec *codec, | |||
968 | } | 967 | } |
969 | 968 | ||
970 | #ifdef CONFIG_SUSPEND | 969 | #ifdef CONFIG_SUSPEND |
971 | static int sgtl5000_suspend(struct snd_soc_codec *codec, pm_message_t state) | 970 | static int sgtl5000_suspend(struct snd_soc_codec *codec) |
972 | { | 971 | { |
973 | sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF); | 972 | sgtl5000_set_bias_level(codec, SND_SOC_BIAS_OFF); |
974 | 973 | ||
@@ -1077,7 +1076,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec) | |||
1077 | /* according to datasheet, maximum voltage of supplies */ | 1076 | /* according to datasheet, maximum voltage of supplies */ |
1078 | if (vdda > 3600 || vddio > 3600 || vddd > 1980) { | 1077 | if (vdda > 3600 || vddio > 3600 || vddd > 1980) { |
1079 | dev_err(codec->dev, | 1078 | dev_err(codec->dev, |
1080 | "exceed max voltage vdda %dmv vddio %dma vddd %dma\n", | 1079 | "exceed max voltage vdda %dmV vddio %dmV vddd %dmV\n", |
1081 | vdda, vddio, vddd); | 1080 | vdda, vddio, vddd); |
1082 | 1081 | ||
1083 | return -EINVAL; | 1082 | return -EINVAL; |
@@ -1402,7 +1401,8 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, | |||
1402 | struct sgtl5000_priv *sgtl5000; | 1401 | struct sgtl5000_priv *sgtl5000; |
1403 | int ret; | 1402 | int ret; |
1404 | 1403 | ||
1405 | sgtl5000 = kzalloc(sizeof(struct sgtl5000_priv), GFP_KERNEL); | 1404 | sgtl5000 = devm_kzalloc(&client->dev, sizeof(struct sgtl5000_priv), |
1405 | GFP_KERNEL); | ||
1406 | if (!sgtl5000) | 1406 | if (!sgtl5000) |
1407 | return -ENOMEM; | 1407 | return -ENOMEM; |
1408 | 1408 | ||
@@ -1410,22 +1410,13 @@ static __devinit int sgtl5000_i2c_probe(struct i2c_client *client, | |||
1410 | 1410 | ||
1411 | ret = snd_soc_register_codec(&client->dev, | 1411 | ret = snd_soc_register_codec(&client->dev, |
1412 | &sgtl5000_driver, &sgtl5000_dai, 1); | 1412 | &sgtl5000_driver, &sgtl5000_dai, 1); |
1413 | if (ret) { | 1413 | return ret; |
1414 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | ||
1415 | kfree(sgtl5000); | ||
1416 | return ret; | ||
1417 | } | ||
1418 | |||
1419 | return 0; | ||
1420 | } | 1414 | } |
1421 | 1415 | ||
1422 | static __devexit int sgtl5000_i2c_remove(struct i2c_client *client) | 1416 | static __devexit int sgtl5000_i2c_remove(struct i2c_client *client) |
1423 | { | 1417 | { |
1424 | struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client); | ||
1425 | |||
1426 | snd_soc_unregister_codec(&client->dev); | 1418 | snd_soc_unregister_codec(&client->dev); |
1427 | 1419 | ||
1428 | kfree(sgtl5000); | ||
1429 | return 0; | 1420 | return 0; |
1430 | } | 1421 | } |
1431 | 1422 | ||
@@ -1466,5 +1457,5 @@ static void __exit sgtl5000_exit(void) | |||
1466 | module_exit(sgtl5000_exit); | 1457 | module_exit(sgtl5000_exit); |
1467 | 1458 | ||
1468 | MODULE_DESCRIPTION("Freescale SGTL5000 ALSA SoC Codec Driver"); | 1459 | MODULE_DESCRIPTION("Freescale SGTL5000 ALSA SoC Codec Driver"); |
1469 | MODULE_AUTHOR("Zeng Zhaoming <zhaoming.zeng@freescale.com>"); | 1460 | MODULE_AUTHOR("Zeng Zhaoming <zengzm.kernel@gmail.com>"); |
1470 | MODULE_LICENSE("GPL"); | 1461 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c new file mode 100644 index 00000000000..5be42bf5699 --- /dev/null +++ b/sound/soc/codecs/sigmadsp.c | |||
@@ -0,0 +1,246 @@ | |||
1 | /* | ||
2 | * Load Analog Devices SigmaStudio firmware files | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/crc32.h> | ||
10 | #include <linux/delay.h> | ||
11 | #include <linux/firmware.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/regmap.h> | ||
15 | #include <linux/module.h> | ||
16 | |||
17 | #include "sigmadsp.h" | ||
18 | |||
19 | #define SIGMA_MAGIC "ADISIGM" | ||
20 | |||
21 | struct sigma_firmware_header { | ||
22 | unsigned char magic[7]; | ||
23 | u8 version; | ||
24 | __le32 crc; | ||
25 | } __packed; | ||
26 | |||
27 | enum { | ||
28 | SIGMA_ACTION_WRITEXBYTES = 0, | ||
29 | SIGMA_ACTION_WRITESINGLE, | ||
30 | SIGMA_ACTION_WRITESAFELOAD, | ||
31 | SIGMA_ACTION_DELAY, | ||
32 | SIGMA_ACTION_PLLWAIT, | ||
33 | SIGMA_ACTION_NOOP, | ||
34 | SIGMA_ACTION_END, | ||
35 | }; | ||
36 | |||
37 | struct sigma_action { | ||
38 | u8 instr; | ||
39 | u8 len_hi; | ||
40 | __le16 len; | ||
41 | __be16 addr; | ||
42 | unsigned char payload[]; | ||
43 | } __packed; | ||
44 | |||
45 | struct sigma_firmware { | ||
46 | const struct firmware *fw; | ||
47 | size_t pos; | ||
48 | |||
49 | void *control_data; | ||
50 | int (*write)(void *control_data, const struct sigma_action *sa, | ||
51 | size_t len); | ||
52 | }; | ||
53 | |||
54 | static inline u32 sigma_action_len(struct sigma_action *sa) | ||
55 | { | ||
56 | return (sa->len_hi << 16) | le16_to_cpu(sa->len); | ||
57 | } | ||
58 | |||
59 | static size_t sigma_action_size(struct sigma_action *sa) | ||
60 | { | ||
61 | size_t payload = 0; | ||
62 | |||
63 | switch (sa->instr) { | ||
64 | case SIGMA_ACTION_WRITEXBYTES: | ||
65 | case SIGMA_ACTION_WRITESINGLE: | ||
66 | case SIGMA_ACTION_WRITESAFELOAD: | ||
67 | payload = sigma_action_len(sa); | ||
68 | break; | ||
69 | default: | ||
70 | break; | ||
71 | } | ||
72 | |||
73 | payload = ALIGN(payload, 2); | ||
74 | |||
75 | return payload + sizeof(struct sigma_action); | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * Returns a negative error value in case of an error, 0 if processing of | ||
80 | * the firmware should be stopped after this action, 1 otherwise. | ||
81 | */ | ||
82 | static int | ||
83 | process_sigma_action(struct sigma_firmware *ssfw, struct sigma_action *sa) | ||
84 | { | ||
85 | size_t len = sigma_action_len(sa); | ||
86 | int ret; | ||
87 | |||
88 | pr_debug("%s: instr:%i addr:%#x len:%zu\n", __func__, | ||
89 | sa->instr, sa->addr, len); | ||
90 | |||
91 | switch (sa->instr) { | ||
92 | case SIGMA_ACTION_WRITEXBYTES: | ||
93 | case SIGMA_ACTION_WRITESINGLE: | ||
94 | case SIGMA_ACTION_WRITESAFELOAD: | ||
95 | ret = ssfw->write(ssfw->control_data, sa, len); | ||
96 | if (ret < 0) | ||
97 | return -EINVAL; | ||
98 | break; | ||
99 | case SIGMA_ACTION_DELAY: | ||
100 | udelay(len); | ||
101 | len = 0; | ||
102 | break; | ||
103 | case SIGMA_ACTION_END: | ||
104 | return 0; | ||
105 | default: | ||
106 | return -EINVAL; | ||
107 | } | ||
108 | |||
109 | return 1; | ||
110 | } | ||
111 | |||
112 | static int | ||
113 | process_sigma_actions(struct sigma_firmware *ssfw) | ||
114 | { | ||
115 | struct sigma_action *sa; | ||
116 | size_t size; | ||
117 | int ret; | ||
118 | |||
119 | while (ssfw->pos + sizeof(*sa) <= ssfw->fw->size) { | ||
120 | sa = (struct sigma_action *)(ssfw->fw->data + ssfw->pos); | ||
121 | |||
122 | size = sigma_action_size(sa); | ||
123 | ssfw->pos += size; | ||
124 | if (ssfw->pos > ssfw->fw->size || size == 0) | ||
125 | break; | ||
126 | |||
127 | ret = process_sigma_action(ssfw, sa); | ||
128 | |||
129 | pr_debug("%s: action returned %i\n", __func__, ret); | ||
130 | |||
131 | if (ret <= 0) | ||
132 | return ret; | ||
133 | } | ||
134 | |||
135 | if (ssfw->pos != ssfw->fw->size) | ||
136 | return -EINVAL; | ||
137 | |||
138 | return 0; | ||
139 | } | ||
140 | |||
141 | static int _process_sigma_firmware(struct device *dev, | ||
142 | struct sigma_firmware *ssfw, const char *name) | ||
143 | { | ||
144 | int ret; | ||
145 | struct sigma_firmware_header *ssfw_head; | ||
146 | const struct firmware *fw; | ||
147 | u32 crc; | ||
148 | |||
149 | pr_debug("%s: loading firmware %s\n", __func__, name); | ||
150 | |||
151 | /* first load the blob */ | ||
152 | ret = request_firmware(&fw, name, dev); | ||
153 | if (ret) { | ||
154 | pr_debug("%s: request_firmware() failed with %i\n", __func__, ret); | ||
155 | return ret; | ||
156 | } | ||
157 | ssfw->fw = fw; | ||
158 | |||
159 | /* then verify the header */ | ||
160 | ret = -EINVAL; | ||
161 | |||
162 | /* | ||
163 | * Reject too small or unreasonable large files. The upper limit has been | ||
164 | * chosen a bit arbitrarily, but it should be enough for all practical | ||
165 | * purposes and having the limit makes it easier to avoid integer | ||
166 | * overflows later in the loading process. | ||
167 | */ | ||
168 | if (fw->size < sizeof(*ssfw_head) || fw->size >= 0x4000000) { | ||
169 | dev_err(dev, "Failed to load firmware: Invalid size\n"); | ||
170 | goto done; | ||
171 | } | ||
172 | |||
173 | ssfw_head = (void *)fw->data; | ||
174 | if (memcmp(ssfw_head->magic, SIGMA_MAGIC, ARRAY_SIZE(ssfw_head->magic))) { | ||
175 | dev_err(dev, "Failed to load firmware: Invalid magic\n"); | ||
176 | goto done; | ||
177 | } | ||
178 | |||
179 | crc = crc32(0, fw->data + sizeof(*ssfw_head), | ||
180 | fw->size - sizeof(*ssfw_head)); | ||
181 | pr_debug("%s: crc=%x\n", __func__, crc); | ||
182 | if (crc != le32_to_cpu(ssfw_head->crc)) { | ||
183 | dev_err(dev, "Failed to load firmware: Wrong crc checksum: expected %x got %x\n", | ||
184 | le32_to_cpu(ssfw_head->crc), crc); | ||
185 | goto done; | ||
186 | } | ||
187 | |||
188 | ssfw->pos = sizeof(*ssfw_head); | ||
189 | |||
190 | /* finally process all of the actions */ | ||
191 | ret = process_sigma_actions(ssfw); | ||
192 | |||
193 | done: | ||
194 | release_firmware(fw); | ||
195 | |||
196 | pr_debug("%s: loaded %s\n", __func__, name); | ||
197 | |||
198 | return ret; | ||
199 | } | ||
200 | |||
201 | #if IS_ENABLED(CONFIG_I2C) | ||
202 | |||
203 | static int sigma_action_write_i2c(void *control_data, | ||
204 | const struct sigma_action *sa, size_t len) | ||
205 | { | ||
206 | return i2c_master_send(control_data, (const unsigned char *)&sa->addr, | ||
207 | len); | ||
208 | } | ||
209 | |||
210 | int process_sigma_firmware(struct i2c_client *client, const char *name) | ||
211 | { | ||
212 | struct sigma_firmware ssfw; | ||
213 | |||
214 | ssfw.control_data = client; | ||
215 | ssfw.write = sigma_action_write_i2c; | ||
216 | |||
217 | return _process_sigma_firmware(&client->dev, &ssfw, name); | ||
218 | } | ||
219 | EXPORT_SYMBOL(process_sigma_firmware); | ||
220 | |||
221 | #endif | ||
222 | |||
223 | #if IS_ENABLED(CONFIG_REGMAP) | ||
224 | |||
225 | static int sigma_action_write_regmap(void *control_data, | ||
226 | const struct sigma_action *sa, size_t len) | ||
227 | { | ||
228 | return regmap_raw_write(control_data, le16_to_cpu(sa->addr), | ||
229 | sa->payload, len - 2); | ||
230 | } | ||
231 | |||
232 | int process_sigma_firmware_regmap(struct device *dev, struct regmap *regmap, | ||
233 | const char *name) | ||
234 | { | ||
235 | struct sigma_firmware ssfw; | ||
236 | |||
237 | ssfw.control_data = regmap; | ||
238 | ssfw.write = sigma_action_write_regmap; | ||
239 | |||
240 | return _process_sigma_firmware(dev, &ssfw, name); | ||
241 | } | ||
242 | EXPORT_SYMBOL(process_sigma_firmware_regmap); | ||
243 | |||
244 | #endif | ||
245 | |||
246 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/sigmadsp.h b/sound/soc/codecs/sigmadsp.h new file mode 100644 index 00000000000..e439cbd7af7 --- /dev/null +++ b/sound/soc/codecs/sigmadsp.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Load firmware files from Analog Devices SigmaStudio | ||
3 | * | ||
4 | * Copyright 2009-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #ifndef __SIGMA_FIRMWARE_H__ | ||
10 | #define __SIGMA_FIRMWARE_H__ | ||
11 | |||
12 | #include <linux/device.h> | ||
13 | #include <linux/regmap.h> | ||
14 | |||
15 | struct i2c_client; | ||
16 | |||
17 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); | ||
18 | extern int process_sigma_firmware_regmap(struct device *dev, | ||
19 | struct regmap *regmap, const char *name); | ||
20 | |||
21 | #endif | ||
diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c index 887d618f4a6..f99baa0b8c3 100644 --- a/sound/soc/codecs/sn95031.c +++ b/sound/soc/codecs/sn95031.c | |||
@@ -698,21 +698,21 @@ static int sn95031_pcm_hw_params(struct snd_pcm_substream *substream, | |||
698 | } | 698 | } |
699 | 699 | ||
700 | /* Codec DAI section */ | 700 | /* Codec DAI section */ |
701 | static struct snd_soc_dai_ops sn95031_headset_dai_ops = { | 701 | static const struct snd_soc_dai_ops sn95031_headset_dai_ops = { |
702 | .digital_mute = sn95031_pcm_hs_mute, | 702 | .digital_mute = sn95031_pcm_hs_mute, |
703 | .hw_params = sn95031_pcm_hw_params, | 703 | .hw_params = sn95031_pcm_hw_params, |
704 | }; | 704 | }; |
705 | 705 | ||
706 | static struct snd_soc_dai_ops sn95031_speaker_dai_ops = { | 706 | static const struct snd_soc_dai_ops sn95031_speaker_dai_ops = { |
707 | .digital_mute = sn95031_pcm_spkr_mute, | 707 | .digital_mute = sn95031_pcm_spkr_mute, |
708 | .hw_params = sn95031_pcm_hw_params, | 708 | .hw_params = sn95031_pcm_hw_params, |
709 | }; | 709 | }; |
710 | 710 | ||
711 | static struct snd_soc_dai_ops sn95031_vib1_dai_ops = { | 711 | static const struct snd_soc_dai_ops sn95031_vib1_dai_ops = { |
712 | .hw_params = sn95031_pcm_hw_params, | 712 | .hw_params = sn95031_pcm_hw_params, |
713 | }; | 713 | }; |
714 | 714 | ||
715 | static struct snd_soc_dai_ops sn95031_vib2_dai_ops = { | 715 | static const struct snd_soc_dai_ops sn95031_vib2_dai_ops = { |
716 | .hw_params = sn95031_pcm_hw_params, | 716 | .hw_params = sn95031_pcm_hw_params, |
717 | }; | 717 | }; |
718 | 718 | ||
@@ -920,19 +920,7 @@ static struct platform_driver sn95031_codec_driver = { | |||
920 | .remove = __devexit_p(sn95031_device_remove), | 920 | .remove = __devexit_p(sn95031_device_remove), |
921 | }; | 921 | }; |
922 | 922 | ||
923 | static int __init sn95031_init(void) | 923 | module_platform_driver(sn95031_codec_driver); |
924 | { | ||
925 | pr_debug("driver init called\n"); | ||
926 | return platform_driver_register(&sn95031_codec_driver); | ||
927 | } | ||
928 | module_init(sn95031_init); | ||
929 | |||
930 | static void __exit sn95031_exit(void) | ||
931 | { | ||
932 | pr_debug("driver exit called\n"); | ||
933 | platform_driver_unregister(&sn95031_codec_driver); | ||
934 | } | ||
935 | module_exit(sn95031_exit); | ||
936 | 924 | ||
937 | MODULE_DESCRIPTION("ASoC TI SN95031 codec driver"); | 925 | MODULE_DESCRIPTION("ASoC TI SN95031 codec driver"); |
938 | MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>"); | 926 | MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>"); |
diff --git a/sound/soc/codecs/spdif_transciever.c b/sound/soc/codecs/spdif_transciever.c index 6a1a7e705cd..112a49d66e3 100644 --- a/sound/soc/codecs/spdif_transciever.c +++ b/sound/soc/codecs/spdif_transciever.c | |||
@@ -61,18 +61,7 @@ static struct platform_driver spdif_dit_driver = { | |||
61 | }, | 61 | }, |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static int __init dit_modinit(void) | 64 | module_platform_driver(spdif_dit_driver); |
65 | { | ||
66 | return platform_driver_register(&spdif_dit_driver); | ||
67 | } | ||
68 | |||
69 | static void __exit dit_exit(void) | ||
70 | { | ||
71 | platform_driver_unregister(&spdif_dit_driver); | ||
72 | } | ||
73 | |||
74 | module_init(dit_modinit); | ||
75 | module_exit(dit_exit); | ||
76 | 65 | ||
77 | MODULE_AUTHOR("Steve Chen <schen@mvista.com>"); | 66 | MODULE_AUTHOR("Steve Chen <schen@mvista.com>"); |
78 | MODULE_DESCRIPTION("SPDIF dummy codec driver"); | 67 | MODULE_DESCRIPTION("SPDIF dummy codec driver"); |
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 3cb3271c5fe..333dd98af39 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/pm.h> | 33 | #include <linux/pm.h> |
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
38 | #include <sound/core.h> | 37 | #include <sound/core.h> |
39 | #include <sound/pcm.h> | 38 | #include <sound/pcm.h> |
@@ -498,7 +497,7 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec, | |||
498 | #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 497 | #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
499 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 498 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
500 | 499 | ||
501 | static struct snd_soc_dai_ops ssm2602_dai_ops = { | 500 | static const struct snd_soc_dai_ops ssm2602_dai_ops = { |
502 | .startup = ssm2602_startup, | 501 | .startup = ssm2602_startup, |
503 | .hw_params = ssm2602_hw_params, | 502 | .hw_params = ssm2602_hw_params, |
504 | .shutdown = ssm2602_shutdown, | 503 | .shutdown = ssm2602_shutdown, |
@@ -524,7 +523,7 @@ static struct snd_soc_dai_driver ssm2602_dai = { | |||
524 | .ops = &ssm2602_dai_ops, | 523 | .ops = &ssm2602_dai_ops, |
525 | }; | 524 | }; |
526 | 525 | ||
527 | static int ssm2602_suspend(struct snd_soc_codec *codec, pm_message_t state) | 526 | static int ssm2602_suspend(struct snd_soc_codec *codec) |
528 | { | 527 | { |
529 | ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF); | 528 | ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF); |
530 | return 0; | 529 | return 0; |
@@ -653,7 +652,8 @@ static int __devinit ssm2602_spi_probe(struct spi_device *spi) | |||
653 | struct ssm2602_priv *ssm2602; | 652 | struct ssm2602_priv *ssm2602; |
654 | int ret; | 653 | int ret; |
655 | 654 | ||
656 | ssm2602 = kzalloc(sizeof(struct ssm2602_priv), GFP_KERNEL); | 655 | ssm2602 = devm_kzalloc(&spi->dev, sizeof(struct ssm2602_priv), |
656 | GFP_KERNEL); | ||
657 | if (ssm2602 == NULL) | 657 | if (ssm2602 == NULL) |
658 | return -ENOMEM; | 658 | return -ENOMEM; |
659 | 659 | ||
@@ -663,15 +663,12 @@ static int __devinit ssm2602_spi_probe(struct spi_device *spi) | |||
663 | 663 | ||
664 | ret = snd_soc_register_codec(&spi->dev, | 664 | ret = snd_soc_register_codec(&spi->dev, |
665 | &soc_codec_dev_ssm2602, &ssm2602_dai, 1); | 665 | &soc_codec_dev_ssm2602, &ssm2602_dai, 1); |
666 | if (ret < 0) | ||
667 | kfree(ssm2602); | ||
668 | return ret; | 666 | return ret; |
669 | } | 667 | } |
670 | 668 | ||
671 | static int __devexit ssm2602_spi_remove(struct spi_device *spi) | 669 | static int __devexit ssm2602_spi_remove(struct spi_device *spi) |
672 | { | 670 | { |
673 | snd_soc_unregister_codec(&spi->dev); | 671 | snd_soc_unregister_codec(&spi->dev); |
674 | kfree(spi_get_drvdata(spi)); | ||
675 | return 0; | 672 | return 0; |
676 | } | 673 | } |
677 | 674 | ||
@@ -698,7 +695,8 @@ static int __devinit ssm2602_i2c_probe(struct i2c_client *i2c, | |||
698 | struct ssm2602_priv *ssm2602; | 695 | struct ssm2602_priv *ssm2602; |
699 | int ret; | 696 | int ret; |
700 | 697 | ||
701 | ssm2602 = kzalloc(sizeof(struct ssm2602_priv), GFP_KERNEL); | 698 | ssm2602 = devm_kzalloc(&i2c->dev, sizeof(struct ssm2602_priv), |
699 | GFP_KERNEL); | ||
702 | if (ssm2602 == NULL) | 700 | if (ssm2602 == NULL) |
703 | return -ENOMEM; | 701 | return -ENOMEM; |
704 | 702 | ||
@@ -708,15 +706,12 @@ static int __devinit ssm2602_i2c_probe(struct i2c_client *i2c, | |||
708 | 706 | ||
709 | ret = snd_soc_register_codec(&i2c->dev, | 707 | ret = snd_soc_register_codec(&i2c->dev, |
710 | &soc_codec_dev_ssm2602, &ssm2602_dai, 1); | 708 | &soc_codec_dev_ssm2602, &ssm2602_dai, 1); |
711 | if (ret < 0) | ||
712 | kfree(ssm2602); | ||
713 | return ret; | 709 | return ret; |
714 | } | 710 | } |
715 | 711 | ||
716 | static int __devexit ssm2602_i2c_remove(struct i2c_client *client) | 712 | static int __devexit ssm2602_i2c_remove(struct i2c_client *client) |
717 | { | 713 | { |
718 | snd_soc_unregister_codec(&client->dev); | 714 | snd_soc_unregister_codec(&client->dev); |
719 | kfree(i2c_get_clientdata(client)); | ||
720 | return 0; | 715 | return 0; |
721 | } | 716 | } |
722 | 717 | ||
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index d2f37152f94..7db6fa51502 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
@@ -24,9 +24,9 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/regulator/consumer.h> | 27 | #include <linux/regulator/consumer.h> |
29 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/workqueue.h> | ||
30 | #include <sound/core.h> | 30 | #include <sound/core.h> |
31 | #include <sound/pcm.h> | 31 | #include <sound/pcm.h> |
32 | #include <sound/pcm_params.h> | 32 | #include <sound/pcm_params.h> |
@@ -35,6 +35,7 @@ | |||
35 | #include <sound/initval.h> | 35 | #include <sound/initval.h> |
36 | #include <sound/tlv.h> | 36 | #include <sound/tlv.h> |
37 | 37 | ||
38 | #include <sound/sta32x.h> | ||
38 | #include "sta32x.h" | 39 | #include "sta32x.h" |
39 | 40 | ||
40 | #define STA32X_RATES (SNDRV_PCM_RATE_32000 | \ | 41 | #define STA32X_RATES (SNDRV_PCM_RATE_32000 | \ |
@@ -73,11 +74,14 @@ static const char *sta32x_supply_names[] = { | |||
73 | struct sta32x_priv { | 74 | struct sta32x_priv { |
74 | struct regulator_bulk_data supplies[ARRAY_SIZE(sta32x_supply_names)]; | 75 | struct regulator_bulk_data supplies[ARRAY_SIZE(sta32x_supply_names)]; |
75 | struct snd_soc_codec *codec; | 76 | struct snd_soc_codec *codec; |
77 | struct sta32x_platform_data *pdata; | ||
76 | 78 | ||
77 | unsigned int mclk; | 79 | unsigned int mclk; |
78 | unsigned int format; | 80 | unsigned int format; |
79 | 81 | ||
80 | u32 coef_shadow[STA32X_COEF_COUNT]; | 82 | u32 coef_shadow[STA32X_COEF_COUNT]; |
83 | struct delayed_work watchdog_work; | ||
84 | int shutdown; | ||
81 | }; | 85 | }; |
82 | 86 | ||
83 | static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1); | 87 | static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12700, 50, 1); |
@@ -260,7 +264,7 @@ static int sta32x_coefficient_put(struct snd_kcontrol *kcontrol, | |||
260 | return 0; | 264 | return 0; |
261 | } | 265 | } |
262 | 266 | ||
263 | int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) | 267 | static int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) |
264 | { | 268 | { |
265 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); | 269 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
266 | unsigned int cfud; | 270 | unsigned int cfud; |
@@ -285,7 +289,7 @@ int sta32x_sync_coef_shadow(struct snd_soc_codec *codec) | |||
285 | return 0; | 289 | return 0; |
286 | } | 290 | } |
287 | 291 | ||
288 | int sta32x_cache_sync(struct snd_soc_codec *codec) | 292 | static int sta32x_cache_sync(struct snd_soc_codec *codec) |
289 | { | 293 | { |
290 | unsigned int mute; | 294 | unsigned int mute; |
291 | int rc; | 295 | int rc; |
@@ -302,6 +306,46 @@ int sta32x_cache_sync(struct snd_soc_codec *codec) | |||
302 | return rc; | 306 | return rc; |
303 | } | 307 | } |
304 | 308 | ||
309 | /* work around ESD issue where sta32x resets and loses all configuration */ | ||
310 | static void sta32x_watchdog(struct work_struct *work) | ||
311 | { | ||
312 | struct sta32x_priv *sta32x = container_of(work, struct sta32x_priv, | ||
313 | watchdog_work.work); | ||
314 | struct snd_soc_codec *codec = sta32x->codec; | ||
315 | unsigned int confa, confa_cached; | ||
316 | |||
317 | /* check if sta32x has reset itself */ | ||
318 | confa_cached = snd_soc_read(codec, STA32X_CONFA); | ||
319 | codec->cache_bypass = 1; | ||
320 | confa = snd_soc_read(codec, STA32X_CONFA); | ||
321 | codec->cache_bypass = 0; | ||
322 | if (confa != confa_cached) { | ||
323 | codec->cache_sync = 1; | ||
324 | sta32x_cache_sync(codec); | ||
325 | } | ||
326 | |||
327 | if (!sta32x->shutdown) | ||
328 | schedule_delayed_work(&sta32x->watchdog_work, | ||
329 | round_jiffies_relative(HZ)); | ||
330 | } | ||
331 | |||
332 | static void sta32x_watchdog_start(struct sta32x_priv *sta32x) | ||
333 | { | ||
334 | if (sta32x->pdata->needs_esd_watchdog) { | ||
335 | sta32x->shutdown = 0; | ||
336 | schedule_delayed_work(&sta32x->watchdog_work, | ||
337 | round_jiffies_relative(HZ)); | ||
338 | } | ||
339 | } | ||
340 | |||
341 | static void sta32x_watchdog_stop(struct sta32x_priv *sta32x) | ||
342 | { | ||
343 | if (sta32x->pdata->needs_esd_watchdog) { | ||
344 | sta32x->shutdown = 1; | ||
345 | cancel_delayed_work_sync(&sta32x->watchdog_work); | ||
346 | } | ||
347 | } | ||
348 | |||
305 | #define SINGLE_COEF(xname, index) \ | 349 | #define SINGLE_COEF(xname, index) \ |
306 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 350 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
307 | .info = sta32x_coefficient_info, \ | 351 | .info = sta32x_coefficient_info, \ |
@@ -478,6 +522,7 @@ static int sta32x_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
478 | rate_min = fs; | 522 | rate_min = fs; |
479 | if (fs > rate_max) | 523 | if (fs > rate_max) |
480 | rate_max = fs; | 524 | rate_max = fs; |
525 | break; | ||
481 | } | 526 | } |
482 | } | 527 | } |
483 | } | 528 | } |
@@ -712,6 +757,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec, | |||
712 | } | 757 | } |
713 | 758 | ||
714 | sta32x_cache_sync(codec); | 759 | sta32x_cache_sync(codec); |
760 | sta32x_watchdog_start(sta32x); | ||
715 | } | 761 | } |
716 | 762 | ||
717 | /* Power up to mute */ | 763 | /* Power up to mute */ |
@@ -728,7 +774,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec, | |||
728 | STA32X_CONFF_PWDN | STA32X_CONFF_EAPD, | 774 | STA32X_CONFF_PWDN | STA32X_CONFF_EAPD, |
729 | STA32X_CONFF_PWDN); | 775 | STA32X_CONFF_PWDN); |
730 | msleep(300); | 776 | msleep(300); |
731 | 777 | sta32x_watchdog_stop(sta32x); | |
732 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), | 778 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), |
733 | sta32x->supplies); | 779 | sta32x->supplies); |
734 | break; | 780 | break; |
@@ -737,7 +783,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec, | |||
737 | return 0; | 783 | return 0; |
738 | } | 784 | } |
739 | 785 | ||
740 | static struct snd_soc_dai_ops sta32x_dai_ops = { | 786 | static const struct snd_soc_dai_ops sta32x_dai_ops = { |
741 | .hw_params = sta32x_hw_params, | 787 | .hw_params = sta32x_hw_params, |
742 | .set_sysclk = sta32x_set_dai_sysclk, | 788 | .set_sysclk = sta32x_set_dai_sysclk, |
743 | .set_fmt = sta32x_set_dai_fmt, | 789 | .set_fmt = sta32x_set_dai_fmt, |
@@ -756,7 +802,7 @@ static struct snd_soc_dai_driver sta32x_dai = { | |||
756 | }; | 802 | }; |
757 | 803 | ||
758 | #ifdef CONFIG_PM | 804 | #ifdef CONFIG_PM |
759 | static int sta32x_suspend(struct snd_soc_codec *codec, pm_message_t state) | 805 | static int sta32x_suspend(struct snd_soc_codec *codec) |
760 | { | 806 | { |
761 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); | 807 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
762 | return 0; | 808 | return 0; |
@@ -775,9 +821,10 @@ static int sta32x_resume(struct snd_soc_codec *codec) | |||
775 | static int sta32x_probe(struct snd_soc_codec *codec) | 821 | static int sta32x_probe(struct snd_soc_codec *codec) |
776 | { | 822 | { |
777 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); | 823 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
778 | int i, ret = 0; | 824 | int i, ret = 0, thermal = 0; |
779 | 825 | ||
780 | sta32x->codec = codec; | 826 | sta32x->codec = codec; |
827 | sta32x->pdata = dev_get_platdata(codec->dev); | ||
781 | 828 | ||
782 | /* regulators */ | 829 | /* regulators */ |
783 | for (i = 0; i < ARRAY_SIZE(sta32x->supplies); i++) | 830 | for (i = 0; i < ARRAY_SIZE(sta32x->supplies); i++) |
@@ -820,25 +867,34 @@ static int sta32x_probe(struct snd_soc_codec *codec) | |||
820 | snd_soc_cache_write(codec, STA32X_AUTO3, 0x00); | 867 | snd_soc_cache_write(codec, STA32X_AUTO3, 0x00); |
821 | snd_soc_cache_write(codec, STA32X_C3CFG, 0x40); | 868 | snd_soc_cache_write(codec, STA32X_C3CFG, 0x40); |
822 | 869 | ||
823 | /* FIXME enable thermal warning adjustment and recovery */ | 870 | /* set thermal warning adjustment and recovery */ |
871 | if (!(sta32x->pdata->thermal_conf & STA32X_THERMAL_ADJUSTMENT_ENABLE)) | ||
872 | thermal |= STA32X_CONFA_TWAB; | ||
873 | if (!(sta32x->pdata->thermal_conf & STA32X_THERMAL_RECOVERY_ENABLE)) | ||
874 | thermal |= STA32X_CONFA_TWRB; | ||
824 | snd_soc_update_bits(codec, STA32X_CONFA, | 875 | snd_soc_update_bits(codec, STA32X_CONFA, |
825 | STA32X_CONFA_TWAB | STA32X_CONFA_TWRB, 0); | 876 | STA32X_CONFA_TWAB | STA32X_CONFA_TWRB, |
877 | thermal); | ||
826 | 878 | ||
827 | /* FIXME select 2.1 mode */ | 879 | /* select output configuration */ |
828 | snd_soc_update_bits(codec, STA32X_CONFF, | 880 | snd_soc_update_bits(codec, STA32X_CONFF, |
829 | STA32X_CONFF_OCFG_MASK, | 881 | STA32X_CONFF_OCFG_MASK, |
830 | 1 << STA32X_CONFF_OCFG_SHIFT); | 882 | sta32x->pdata->output_conf |
883 | << STA32X_CONFF_OCFG_SHIFT); | ||
831 | 884 | ||
832 | /* FIXME channel to output mapping */ | 885 | /* channel to output mapping */ |
833 | snd_soc_update_bits(codec, STA32X_C1CFG, | 886 | snd_soc_update_bits(codec, STA32X_C1CFG, |
834 | STA32X_CxCFG_OM_MASK, | 887 | STA32X_CxCFG_OM_MASK, |
835 | 0 << STA32X_CxCFG_OM_SHIFT); | 888 | sta32x->pdata->ch1_output_mapping |
889 | << STA32X_CxCFG_OM_SHIFT); | ||
836 | snd_soc_update_bits(codec, STA32X_C2CFG, | 890 | snd_soc_update_bits(codec, STA32X_C2CFG, |
837 | STA32X_CxCFG_OM_MASK, | 891 | STA32X_CxCFG_OM_MASK, |
838 | 1 << STA32X_CxCFG_OM_SHIFT); | 892 | sta32x->pdata->ch2_output_mapping |
893 | << STA32X_CxCFG_OM_SHIFT); | ||
839 | snd_soc_update_bits(codec, STA32X_C3CFG, | 894 | snd_soc_update_bits(codec, STA32X_C3CFG, |
840 | STA32X_CxCFG_OM_MASK, | 895 | STA32X_CxCFG_OM_MASK, |
841 | 2 << STA32X_CxCFG_OM_SHIFT); | 896 | sta32x->pdata->ch3_output_mapping |
897 | << STA32X_CxCFG_OM_SHIFT); | ||
842 | 898 | ||
843 | /* initialize coefficient shadow RAM with reset values */ | 899 | /* initialize coefficient shadow RAM with reset values */ |
844 | for (i = 4; i <= 49; i += 5) | 900 | for (i = 4; i <= 49; i += 5) |
@@ -851,6 +907,9 @@ static int sta32x_probe(struct snd_soc_codec *codec) | |||
851 | sta32x->coef_shadow[60] = 0x400000; | 907 | sta32x->coef_shadow[60] = 0x400000; |
852 | sta32x->coef_shadow[61] = 0x400000; | 908 | sta32x->coef_shadow[61] = 0x400000; |
853 | 909 | ||
910 | if (sta32x->pdata->needs_esd_watchdog) | ||
911 | INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog); | ||
912 | |||
854 | sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 913 | sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
855 | /* Bias level configuration will have done an extra enable */ | 914 | /* Bias level configuration will have done an extra enable */ |
856 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); | 915 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); |
@@ -867,6 +926,7 @@ static int sta32x_remove(struct snd_soc_codec *codec) | |||
867 | { | 926 | { |
868 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); | 927 | struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); |
869 | 928 | ||
929 | sta32x_watchdog_stop(sta32x); | ||
870 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); | 930 | sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
871 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); | 931 | regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); |
872 | regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); | 932 | regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); |
@@ -909,28 +969,23 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c, | |||
909 | struct sta32x_priv *sta32x; | 969 | struct sta32x_priv *sta32x; |
910 | int ret; | 970 | int ret; |
911 | 971 | ||
912 | sta32x = kzalloc(sizeof(struct sta32x_priv), GFP_KERNEL); | 972 | sta32x = devm_kzalloc(&i2c->dev, sizeof(struct sta32x_priv), |
973 | GFP_KERNEL); | ||
913 | if (!sta32x) | 974 | if (!sta32x) |
914 | return -ENOMEM; | 975 | return -ENOMEM; |
915 | 976 | ||
916 | i2c_set_clientdata(i2c, sta32x); | 977 | i2c_set_clientdata(i2c, sta32x); |
917 | 978 | ||
918 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); | 979 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); |
919 | if (ret != 0) { | 980 | if (ret != 0) |
920 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); | 981 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); |
921 | kfree(sta32x); | ||
922 | return ret; | ||
923 | } | ||
924 | 982 | ||
925 | return 0; | 983 | return ret; |
926 | } | 984 | } |
927 | 985 | ||
928 | static __devexit int sta32x_i2c_remove(struct i2c_client *client) | 986 | static __devexit int sta32x_i2c_remove(struct i2c_client *client) |
929 | { | 987 | { |
930 | struct sta32x_priv *sta32x = i2c_get_clientdata(client); | ||
931 | |||
932 | snd_soc_unregister_codec(&client->dev); | 988 | snd_soc_unregister_codec(&client->dev); |
933 | kfree(sta32x); | ||
934 | return 0; | 989 | return 0; |
935 | } | 990 | } |
936 | 991 | ||
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 78b2b50271e..cc0566c22ec 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c | |||
@@ -256,8 +256,7 @@ static int stac9766_reset(struct snd_soc_codec *codec, int try_warm) | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | static int stac9766_codec_suspend(struct snd_soc_codec *codec, | 259 | static int stac9766_codec_suspend(struct snd_soc_codec *codec) |
260 | pm_message_t state) | ||
261 | { | 260 | { |
262 | stac9766_set_bias_level(codec, SND_SOC_BIAS_OFF); | 261 | stac9766_set_bias_level(codec, SND_SOC_BIAS_OFF); |
263 | return 0; | 262 | return 0; |
@@ -286,11 +285,11 @@ reset: | |||
286 | return 0; | 285 | return 0; |
287 | } | 286 | } |
288 | 287 | ||
289 | static struct snd_soc_dai_ops stac9766_dai_ops_analog = { | 288 | static const struct snd_soc_dai_ops stac9766_dai_ops_analog = { |
290 | .prepare = ac97_analog_prepare, | 289 | .prepare = ac97_analog_prepare, |
291 | }; | 290 | }; |
292 | 291 | ||
293 | static struct snd_soc_dai_ops stac9766_dai_ops_digital = { | 292 | static const struct snd_soc_dai_ops stac9766_dai_ops_digital = { |
294 | .prepare = ac97_digital_prepare, | 293 | .prepare = ac97_digital_prepare, |
295 | }; | 294 | }; |
296 | 295 | ||
@@ -380,7 +379,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = { | |||
380 | .remove = stac9766_codec_remove, | 379 | .remove = stac9766_codec_remove, |
381 | .suspend = stac9766_codec_suspend, | 380 | .suspend = stac9766_codec_suspend, |
382 | .resume = stac9766_codec_resume, | 381 | .resume = stac9766_codec_resume, |
383 | .reg_cache_size = sizeof(stac9766_reg), | 382 | .reg_cache_size = ARRAY_SIZE(stac9766_reg), |
384 | .reg_word_size = sizeof(u16), | 383 | .reg_word_size = sizeof(u16), |
385 | .reg_cache_step = 2, | 384 | .reg_cache_step = 2, |
386 | .reg_cache_default = stac9766_reg, | 385 | .reg_cache_default = stac9766_reg, |
@@ -408,17 +407,7 @@ static struct platform_driver stac9766_codec_driver = { | |||
408 | .remove = __devexit_p(stac9766_remove), | 407 | .remove = __devexit_p(stac9766_remove), |
409 | }; | 408 | }; |
410 | 409 | ||
411 | static int __init stac9766_init(void) | 410 | module_platform_driver(stac9766_codec_driver); |
412 | { | ||
413 | return platform_driver_register(&stac9766_codec_driver); | ||
414 | } | ||
415 | module_init(stac9766_init); | ||
416 | |||
417 | static void __exit stac9766_exit(void) | ||
418 | { | ||
419 | platform_driver_unregister(&stac9766_codec_driver); | ||
420 | } | ||
421 | module_exit(stac9766_exit); | ||
422 | 411 | ||
423 | MODULE_DESCRIPTION("ASoC stac9766 driver"); | 412 | MODULE_DESCRIPTION("ASoC stac9766 driver"); |
424 | MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>"); | 413 | MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>"); |
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index 336de8f69a0..dfa41a96599 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
29 | #include <sound/core.h> | 28 | #include <sound/core.h> |
30 | #include <sound/pcm.h> | 29 | #include <sound/pcm.h> |
@@ -503,7 +502,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec, | |||
503 | #define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 502 | #define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
504 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) | 503 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) |
505 | 504 | ||
506 | static struct snd_soc_dai_ops tlv320aic23_dai_ops = { | 505 | static const struct snd_soc_dai_ops tlv320aic23_dai_ops = { |
507 | .prepare = tlv320aic23_pcm_prepare, | 506 | .prepare = tlv320aic23_pcm_prepare, |
508 | .hw_params = tlv320aic23_hw_params, | 507 | .hw_params = tlv320aic23_hw_params, |
509 | .shutdown = tlv320aic23_shutdown, | 508 | .shutdown = tlv320aic23_shutdown, |
@@ -529,8 +528,7 @@ static struct snd_soc_dai_driver tlv320aic23_dai = { | |||
529 | .ops = &tlv320aic23_dai_ops, | 528 | .ops = &tlv320aic23_dai_ops, |
530 | }; | 529 | }; |
531 | 530 | ||
532 | static int tlv320aic23_suspend(struct snd_soc_codec *codec, | 531 | static int tlv320aic23_suspend(struct snd_soc_codec *codec) |
533 | pm_message_t state) | ||
534 | { | 532 | { |
535 | tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_OFF); | 533 | tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_OFF); |
536 | 534 | ||
@@ -636,7 +634,7 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, | |||
636 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 634 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
637 | return -EINVAL; | 635 | return -EINVAL; |
638 | 636 | ||
639 | aic23 = kzalloc(sizeof(struct aic23), GFP_KERNEL); | 637 | aic23 = devm_kzalloc(&i2c->dev, sizeof(struct aic23), GFP_KERNEL); |
640 | if (aic23 == NULL) | 638 | if (aic23 == NULL) |
641 | return -ENOMEM; | 639 | return -ENOMEM; |
642 | 640 | ||
@@ -645,14 +643,11 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, | |||
645 | 643 | ||
646 | ret = snd_soc_register_codec(&i2c->dev, | 644 | ret = snd_soc_register_codec(&i2c->dev, |
647 | &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1); | 645 | &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1); |
648 | if (ret < 0) | ||
649 | kfree(aic23); | ||
650 | return ret; | 646 | return ret; |
651 | } | 647 | } |
652 | static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c) | 648 | static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c) |
653 | { | 649 | { |
654 | snd_soc_unregister_codec(&i2c->dev); | 650 | snd_soc_unregister_codec(&i2c->dev); |
655 | kfree(i2c_get_clientdata(i2c)); | ||
656 | return 0; | 651 | return 0; |
657 | } | 652 | } |
658 | 653 | ||
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 7859bdcc93d..a038daec682 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -275,7 +275,7 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
275 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ | 275 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ |
276 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) | 276 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) |
277 | 277 | ||
278 | static struct snd_soc_dai_ops aic26_dai_ops = { | 278 | static const struct snd_soc_dai_ops aic26_dai_ops = { |
279 | .hw_params = aic26_hw_params, | 279 | .hw_params = aic26_hw_params, |
280 | .digital_mute = aic26_mute, | 280 | .digital_mute = aic26_mute, |
281 | .set_sysclk = aic26_set_sysclk, | 281 | .set_sysclk = aic26_set_sysclk, |
@@ -416,7 +416,7 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
416 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); | 416 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); |
417 | 417 | ||
418 | /* Allocate driver data */ | 418 | /* Allocate driver data */ |
419 | aic26 = kzalloc(sizeof *aic26, GFP_KERNEL); | 419 | aic26 = devm_kzalloc(&spi->dev, sizeof *aic26, GFP_KERNEL); |
420 | if (!aic26) | 420 | if (!aic26) |
421 | return -ENOMEM; | 421 | return -ENOMEM; |
422 | 422 | ||
@@ -427,18 +427,12 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
427 | 427 | ||
428 | ret = snd_soc_register_codec(&spi->dev, | 428 | ret = snd_soc_register_codec(&spi->dev, |
429 | &aic26_soc_codec_dev, &aic26_dai, 1); | 429 | &aic26_soc_codec_dev, &aic26_dai, 1); |
430 | if (ret < 0) | ||
431 | kfree(aic26); | ||
432 | return ret; | 430 | return ret; |
433 | |||
434 | dev_dbg(&spi->dev, "SPI device initialized\n"); | ||
435 | return 0; | ||
436 | } | 431 | } |
437 | 432 | ||
438 | static int aic26_spi_remove(struct spi_device *spi) | 433 | static int aic26_spi_remove(struct spi_device *spi) |
439 | { | 434 | { |
440 | snd_soc_unregister_codec(&spi->dev); | 435 | snd_soc_unregister_codec(&spi->dev); |
441 | kfree(spi_get_drvdata(spi)); | ||
442 | return 0; | 436 | return 0; |
443 | } | 437 | } |
444 | 438 | ||
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index b21c610051c..eb401ef021f 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/pm.h> | 30 | #include <linux/pm.h> |
31 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/cdev.h> | 32 | #include <linux/cdev.h> |
34 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
35 | 34 | ||
@@ -597,7 +596,7 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec, | |||
597 | #define AIC32X4_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE \ | 596 | #define AIC32X4_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE \ |
598 | | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) | 597 | | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) |
599 | 598 | ||
600 | static struct snd_soc_dai_ops aic32x4_ops = { | 599 | static const struct snd_soc_dai_ops aic32x4_ops = { |
601 | .hw_params = aic32x4_hw_params, | 600 | .hw_params = aic32x4_hw_params, |
602 | .digital_mute = aic32x4_mute, | 601 | .digital_mute = aic32x4_mute, |
603 | .set_fmt = aic32x4_set_dai_fmt, | 602 | .set_fmt = aic32x4_set_dai_fmt, |
@@ -622,7 +621,7 @@ static struct snd_soc_dai_driver aic32x4_dai = { | |||
622 | .symmetric_rates = 1, | 621 | .symmetric_rates = 1, |
623 | }; | 622 | }; |
624 | 623 | ||
625 | static int aic32x4_suspend(struct snd_soc_codec *codec, pm_message_t state) | 624 | static int aic32x4_suspend(struct snd_soc_codec *codec) |
626 | { | 625 | { |
627 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_OFF); | 626 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_OFF); |
628 | return 0; | 627 | return 0; |
@@ -710,7 +709,8 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c, | |||
710 | struct aic32x4_priv *aic32x4; | 709 | struct aic32x4_priv *aic32x4; |
711 | int ret; | 710 | int ret; |
712 | 711 | ||
713 | aic32x4 = kzalloc(sizeof(struct aic32x4_priv), GFP_KERNEL); | 712 | aic32x4 = devm_kzalloc(&i2c->dev, sizeof(struct aic32x4_priv), |
713 | GFP_KERNEL); | ||
714 | if (aic32x4 == NULL) | 714 | if (aic32x4 == NULL) |
715 | return -ENOMEM; | 715 | return -ENOMEM; |
716 | 716 | ||
@@ -729,15 +729,12 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c, | |||
729 | 729 | ||
730 | ret = snd_soc_register_codec(&i2c->dev, | 730 | ret = snd_soc_register_codec(&i2c->dev, |
731 | &soc_codec_dev_aic32x4, &aic32x4_dai, 1); | 731 | &soc_codec_dev_aic32x4, &aic32x4_dai, 1); |
732 | if (ret < 0) | ||
733 | kfree(aic32x4); | ||
734 | return ret; | 732 | return ret; |
735 | } | 733 | } |
736 | 734 | ||
737 | static __devexit int aic32x4_i2c_remove(struct i2c_client *client) | 735 | static __devexit int aic32x4_i2c_remove(struct i2c_client *client) |
738 | { | 736 | { |
739 | snd_soc_unregister_codec(&client->dev); | 737 | snd_soc_unregister_codec(&client->dev); |
740 | kfree(i2c_get_clientdata(client)); | ||
741 | return 0; | 738 | return 0; |
742 | } | 739 | } |
743 | 740 | ||
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 87d5ef188e2..492f22f8a4d 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/gpio.h> | 41 | #include <linux/gpio.h> |
42 | #include <linux/regulator/consumer.h> | 42 | #include <linux/regulator/consumer.h> |
43 | #include <linux/platform_device.h> | ||
44 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
45 | #include <sound/core.h> | 44 | #include <sound/core.h> |
46 | #include <sound/pcm.h> | 45 | #include <sound/pcm.h> |
@@ -833,7 +832,6 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
833 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; | 832 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; |
834 | u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; | 833 | u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; |
835 | u16 d, pll_d = 1; | 834 | u16 d, pll_d = 1; |
836 | u8 reg; | ||
837 | int clk; | 835 | int clk; |
838 | 836 | ||
839 | /* select data word length */ | 837 | /* select data word length */ |
@@ -869,14 +867,13 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
869 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); | 867 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); |
870 | snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); | 868 | snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); |
871 | /* disable PLL if it is bypassed */ | 869 | /* disable PLL if it is bypassed */ |
872 | reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); | 870 | snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, PLL_ENABLE, 0); |
873 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); | ||
874 | 871 | ||
875 | } else { | 872 | } else { |
876 | snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); | 873 | snd_soc_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); |
877 | /* enable PLL when it is used */ | 874 | /* enable PLL when it is used */ |
878 | reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); | 875 | snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, |
879 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE); | 876 | PLL_ENABLE, PLL_ENABLE); |
880 | } | 877 | } |
881 | 878 | ||
882 | /* Route Left DAC to left channel input and | 879 | /* Route Left DAC to left channel input and |
@@ -1156,7 +1153,6 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, | |||
1156 | enum snd_soc_bias_level level) | 1153 | enum snd_soc_bias_level level) |
1157 | { | 1154 | { |
1158 | struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); | 1155 | struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); |
1159 | u8 reg; | ||
1160 | 1156 | ||
1161 | switch (level) { | 1157 | switch (level) { |
1162 | case SND_SOC_BIAS_ON: | 1158 | case SND_SOC_BIAS_ON: |
@@ -1165,9 +1161,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, | |||
1165 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY && | 1161 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY && |
1166 | aic3x->master) { | 1162 | aic3x->master) { |
1167 | /* enable pll */ | 1163 | /* enable pll */ |
1168 | reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); | 1164 | snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, |
1169 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, | 1165 | PLL_ENABLE, PLL_ENABLE); |
1170 | reg | PLL_ENABLE); | ||
1171 | } | 1166 | } |
1172 | break; | 1167 | break; |
1173 | case SND_SOC_BIAS_STANDBY: | 1168 | case SND_SOC_BIAS_STANDBY: |
@@ -1176,9 +1171,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, | |||
1176 | if (codec->dapm.bias_level == SND_SOC_BIAS_PREPARE && | 1171 | if (codec->dapm.bias_level == SND_SOC_BIAS_PREPARE && |
1177 | aic3x->master) { | 1172 | aic3x->master) { |
1178 | /* disable pll */ | 1173 | /* disable pll */ |
1179 | reg = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); | 1174 | snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, |
1180 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, | 1175 | PLL_ENABLE, 0); |
1181 | reg & ~PLL_ENABLE); | ||
1182 | } | 1176 | } |
1183 | break; | 1177 | break; |
1184 | case SND_SOC_BIAS_OFF: | 1178 | case SND_SOC_BIAS_OFF: |
@@ -1249,7 +1243,7 @@ EXPORT_SYMBOL_GPL(aic3x_button_pressed); | |||
1249 | #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 1243 | #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
1250 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) | 1244 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) |
1251 | 1245 | ||
1252 | static struct snd_soc_dai_ops aic3x_dai_ops = { | 1246 | static const struct snd_soc_dai_ops aic3x_dai_ops = { |
1253 | .hw_params = aic3x_hw_params, | 1247 | .hw_params = aic3x_hw_params, |
1254 | .digital_mute = aic3x_mute, | 1248 | .digital_mute = aic3x_mute, |
1255 | .set_sysclk = aic3x_set_dai_sysclk, | 1249 | .set_sysclk = aic3x_set_dai_sysclk, |
@@ -1274,7 +1268,7 @@ static struct snd_soc_dai_driver aic3x_dai = { | |||
1274 | .symmetric_rates = 1, | 1268 | .symmetric_rates = 1, |
1275 | }; | 1269 | }; |
1276 | 1270 | ||
1277 | static int aic3x_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1271 | static int aic3x_suspend(struct snd_soc_codec *codec) |
1278 | { | 1272 | { |
1279 | aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1273 | aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1280 | 1274 | ||
@@ -1295,7 +1289,6 @@ static int aic3x_resume(struct snd_soc_codec *codec) | |||
1295 | static int aic3x_init(struct snd_soc_codec *codec) | 1289 | static int aic3x_init(struct snd_soc_codec *codec) |
1296 | { | 1290 | { |
1297 | struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); | 1291 | struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); |
1298 | int reg; | ||
1299 | 1292 | ||
1300 | snd_soc_write(codec, AIC3X_PAGE_SELECT, PAGE0_SELECT); | 1293 | snd_soc_write(codec, AIC3X_PAGE_SELECT, PAGE0_SELECT); |
1301 | snd_soc_write(codec, AIC3X_RESET, SOFT_RESET); | 1294 | snd_soc_write(codec, AIC3X_RESET, SOFT_RESET); |
@@ -1317,20 +1310,13 @@ static int aic3x_init(struct snd_soc_codec *codec) | |||
1317 | snd_soc_write(codec, DACR1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON); | 1310 | snd_soc_write(codec, DACR1_2_MONOLOPM_VOL, DEFAULT_VOL | ROUTE_ON); |
1318 | 1311 | ||
1319 | /* unmute all outputs */ | 1312 | /* unmute all outputs */ |
1320 | reg = snd_soc_read(codec, LLOPM_CTRL); | 1313 | snd_soc_update_bits(codec, LLOPM_CTRL, UNMUTE, UNMUTE); |
1321 | snd_soc_write(codec, LLOPM_CTRL, reg | UNMUTE); | 1314 | snd_soc_update_bits(codec, RLOPM_CTRL, UNMUTE, UNMUTE); |
1322 | reg = snd_soc_read(codec, RLOPM_CTRL); | 1315 | snd_soc_update_bits(codec, MONOLOPM_CTRL, UNMUTE, UNMUTE); |
1323 | snd_soc_write(codec, RLOPM_CTRL, reg | UNMUTE); | 1316 | snd_soc_update_bits(codec, HPLOUT_CTRL, UNMUTE, UNMUTE); |
1324 | reg = snd_soc_read(codec, MONOLOPM_CTRL); | 1317 | snd_soc_update_bits(codec, HPROUT_CTRL, UNMUTE, UNMUTE); |
1325 | snd_soc_write(codec, MONOLOPM_CTRL, reg | UNMUTE); | 1318 | snd_soc_update_bits(codec, HPLCOM_CTRL, UNMUTE, UNMUTE); |
1326 | reg = snd_soc_read(codec, HPLOUT_CTRL); | 1319 | snd_soc_update_bits(codec, HPRCOM_CTRL, UNMUTE, UNMUTE); |
1327 | snd_soc_write(codec, HPLOUT_CTRL, reg | UNMUTE); | ||
1328 | reg = snd_soc_read(codec, HPROUT_CTRL); | ||
1329 | snd_soc_write(codec, HPROUT_CTRL, reg | UNMUTE); | ||
1330 | reg = snd_soc_read(codec, HPLCOM_CTRL); | ||
1331 | snd_soc_write(codec, HPLCOM_CTRL, reg | UNMUTE); | ||
1332 | reg = snd_soc_read(codec, HPRCOM_CTRL); | ||
1333 | snd_soc_write(codec, HPRCOM_CTRL, reg | UNMUTE); | ||
1334 | 1320 | ||
1335 | /* ADC default volume and unmute */ | 1321 | /* ADC default volume and unmute */ |
1336 | snd_soc_write(codec, LADC_VOL, DEFAULT_GAIN); | 1322 | snd_soc_write(codec, LADC_VOL, DEFAULT_GAIN); |
@@ -1494,7 +1480,6 @@ static struct snd_soc_codec_driver soc_codec_dev_aic3x = { | |||
1494 | .resume = aic3x_resume, | 1480 | .resume = aic3x_resume, |
1495 | }; | 1481 | }; |
1496 | 1482 | ||
1497 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1498 | /* | 1483 | /* |
1499 | * AIC3X 2 wire address can be up to 4 devices with device addresses | 1484 | * AIC3X 2 wire address can be up to 4 devices with device addresses |
1500 | * 0x18, 0x19, 0x1A, 0x1B | 1485 | * 0x18, 0x19, 0x1A, 0x1B |
@@ -1519,7 +1504,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, | |||
1519 | struct aic3x_priv *aic3x; | 1504 | struct aic3x_priv *aic3x; |
1520 | int ret; | 1505 | int ret; |
1521 | 1506 | ||
1522 | aic3x = kzalloc(sizeof(struct aic3x_priv), GFP_KERNEL); | 1507 | aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL); |
1523 | if (aic3x == NULL) { | 1508 | if (aic3x == NULL) { |
1524 | dev_err(&i2c->dev, "failed to create private data\n"); | 1509 | dev_err(&i2c->dev, "failed to create private data\n"); |
1525 | return -ENOMEM; | 1510 | return -ENOMEM; |
@@ -1539,15 +1524,12 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, | |||
1539 | 1524 | ||
1540 | ret = snd_soc_register_codec(&i2c->dev, | 1525 | ret = snd_soc_register_codec(&i2c->dev, |
1541 | &soc_codec_dev_aic3x, &aic3x_dai, 1); | 1526 | &soc_codec_dev_aic3x, &aic3x_dai, 1); |
1542 | if (ret < 0) | ||
1543 | kfree(aic3x); | ||
1544 | return ret; | 1527 | return ret; |
1545 | } | 1528 | } |
1546 | 1529 | ||
1547 | static int aic3x_i2c_remove(struct i2c_client *client) | 1530 | static int aic3x_i2c_remove(struct i2c_client *client) |
1548 | { | 1531 | { |
1549 | snd_soc_unregister_codec(&client->dev); | 1532 | snd_soc_unregister_codec(&client->dev); |
1550 | kfree(i2c_get_clientdata(client)); | ||
1551 | return 0; | 1533 | return 0; |
1552 | } | 1534 | } |
1553 | 1535 | ||
@@ -1561,27 +1543,22 @@ static struct i2c_driver aic3x_i2c_driver = { | |||
1561 | .remove = aic3x_i2c_remove, | 1543 | .remove = aic3x_i2c_remove, |
1562 | .id_table = aic3x_i2c_id, | 1544 | .id_table = aic3x_i2c_id, |
1563 | }; | 1545 | }; |
1564 | #endif | ||
1565 | 1546 | ||
1566 | static int __init aic3x_modinit(void) | 1547 | static int __init aic3x_modinit(void) |
1567 | { | 1548 | { |
1568 | int ret = 0; | 1549 | int ret = 0; |
1569 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1570 | ret = i2c_add_driver(&aic3x_i2c_driver); | 1550 | ret = i2c_add_driver(&aic3x_i2c_driver); |
1571 | if (ret != 0) { | 1551 | if (ret != 0) { |
1572 | printk(KERN_ERR "Failed to register TLV320AIC3x I2C driver: %d\n", | 1552 | printk(KERN_ERR "Failed to register TLV320AIC3x I2C driver: %d\n", |
1573 | ret); | 1553 | ret); |
1574 | } | 1554 | } |
1575 | #endif | ||
1576 | return ret; | 1555 | return ret; |
1577 | } | 1556 | } |
1578 | module_init(aic3x_modinit); | 1557 | module_init(aic3x_modinit); |
1579 | 1558 | ||
1580 | static void __exit aic3x_exit(void) | 1559 | static void __exit aic3x_exit(void) |
1581 | { | 1560 | { |
1582 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1583 | i2c_del_driver(&aic3x_i2c_driver); | 1561 | i2c_del_driver(&aic3x_i2c_driver); |
1584 | #endif | ||
1585 | } | 1562 | } |
1586 | module_exit(aic3x_exit); | 1563 | module_exit(aic3x_exit); |
1587 | 1564 | ||
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index dc8a2b2bdc1..f0aad26cdb3 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/pm.h> | 28 | #include <linux/pm.h> |
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | #include <linux/platform_device.h> | ||
31 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
32 | #include <linux/gpio.h> | 31 | #include <linux/gpio.h> |
33 | #include <linux/regulator/consumer.h> | 32 | #include <linux/regulator/consumer.h> |
@@ -1461,7 +1460,7 @@ static int dac33_soc_remove(struct snd_soc_codec *codec) | |||
1461 | return 0; | 1460 | return 0; |
1462 | } | 1461 | } |
1463 | 1462 | ||
1464 | static int dac33_soc_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1463 | static int dac33_soc_suspend(struct snd_soc_codec *codec) |
1465 | { | 1464 | { |
1466 | dac33_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1465 | dac33_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1467 | 1466 | ||
@@ -1499,7 +1498,7 @@ static struct snd_soc_codec_driver soc_codec_dev_tlv320dac33 = { | |||
1499 | SNDRV_PCM_RATE_48000) | 1498 | SNDRV_PCM_RATE_48000) |
1500 | #define DAC33_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) | 1499 | #define DAC33_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) |
1501 | 1500 | ||
1502 | static struct snd_soc_dai_ops dac33_dai_ops = { | 1501 | static const struct snd_soc_dai_ops dac33_dai_ops = { |
1503 | .startup = dac33_startup, | 1502 | .startup = dac33_startup, |
1504 | .shutdown = dac33_shutdown, | 1503 | .shutdown = dac33_shutdown, |
1505 | .hw_params = dac33_hw_params, | 1504 | .hw_params = dac33_hw_params, |
@@ -1533,7 +1532,8 @@ static int __devinit dac33_i2c_probe(struct i2c_client *client, | |||
1533 | } | 1532 | } |
1534 | pdata = client->dev.platform_data; | 1533 | pdata = client->dev.platform_data; |
1535 | 1534 | ||
1536 | dac33 = kzalloc(sizeof(struct tlv320dac33_priv), GFP_KERNEL); | 1535 | dac33 = devm_kzalloc(&client->dev, sizeof(struct tlv320dac33_priv), |
1536 | GFP_KERNEL); | ||
1537 | if (dac33 == NULL) | 1537 | if (dac33 == NULL) |
1538 | return -ENOMEM; | 1538 | return -ENOMEM; |
1539 | 1539 | ||
@@ -1588,7 +1588,6 @@ err_get: | |||
1588 | if (dac33->power_gpio >= 0) | 1588 | if (dac33->power_gpio >= 0) |
1589 | gpio_free(dac33->power_gpio); | 1589 | gpio_free(dac33->power_gpio); |
1590 | err_gpio: | 1590 | err_gpio: |
1591 | kfree(dac33); | ||
1592 | return ret; | 1591 | return ret; |
1593 | } | 1592 | } |
1594 | 1593 | ||
@@ -1605,8 +1604,6 @@ static int __devexit dac33_i2c_remove(struct i2c_client *client) | |||
1605 | regulator_bulk_free(ARRAY_SIZE(dac33->supplies), dac33->supplies); | 1604 | regulator_bulk_free(ARRAY_SIZE(dac33->supplies), dac33->supplies); |
1606 | 1605 | ||
1607 | snd_soc_unregister_codec(&client->dev); | 1606 | snd_soc_unregister_codec(&client->dev); |
1608 | kfree(dac33); | ||
1609 | |||
1610 | return 0; | 1607 | return 0; |
1611 | } | 1608 | } |
1612 | 1609 | ||
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 7eeca79d738..363b99dad8e 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c | |||
@@ -376,7 +376,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client, | |||
376 | return -ENODEV; | 376 | return -ENODEV; |
377 | } | 377 | } |
378 | 378 | ||
379 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 379 | data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); |
380 | if (data == NULL) { | 380 | if (data == NULL) { |
381 | dev_err(dev, "Can not allocate memory\n"); | 381 | dev_err(dev, "Can not allocate memory\n"); |
382 | return -ENOMEM; | 382 | return -ENOMEM; |
@@ -450,7 +450,6 @@ err_regulator: | |||
450 | if (data->power_gpio >= 0) | 450 | if (data->power_gpio >= 0) |
451 | gpio_free(data->power_gpio); | 451 | gpio_free(data->power_gpio); |
452 | err_gpio: | 452 | err_gpio: |
453 | kfree(data); | ||
454 | tpa6130a2_client = NULL; | 453 | tpa6130a2_client = NULL; |
455 | 454 | ||
456 | return ret; | 455 | return ret; |
@@ -466,8 +465,6 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client) | |||
466 | gpio_free(data->power_gpio); | 465 | gpio_free(data->power_gpio); |
467 | 466 | ||
468 | regulator_put(data->supply); | 467 | regulator_put(data->supply); |
469 | |||
470 | kfree(data); | ||
471 | tpa6130a2_client = NULL; | 468 | tpa6130a2_client = NULL; |
472 | 469 | ||
473 | return 0; | 470 | return 0; |
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index f798247ac1b..18e71014cc2 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -2149,7 +2149,7 @@ static int twl4030_voice_set_tristate(struct snd_soc_dai *dai, int tristate) | |||
2149 | #define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000) | 2149 | #define TWL4030_RATES (SNDRV_PCM_RATE_8000_48000) |
2150 | #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) | 2150 | #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) |
2151 | 2151 | ||
2152 | static struct snd_soc_dai_ops twl4030_dai_hifi_ops = { | 2152 | static const struct snd_soc_dai_ops twl4030_dai_hifi_ops = { |
2153 | .startup = twl4030_startup, | 2153 | .startup = twl4030_startup, |
2154 | .shutdown = twl4030_shutdown, | 2154 | .shutdown = twl4030_shutdown, |
2155 | .hw_params = twl4030_hw_params, | 2155 | .hw_params = twl4030_hw_params, |
@@ -2158,7 +2158,7 @@ static struct snd_soc_dai_ops twl4030_dai_hifi_ops = { | |||
2158 | .set_tristate = twl4030_set_tristate, | 2158 | .set_tristate = twl4030_set_tristate, |
2159 | }; | 2159 | }; |
2160 | 2160 | ||
2161 | static struct snd_soc_dai_ops twl4030_dai_voice_ops = { | 2161 | static const struct snd_soc_dai_ops twl4030_dai_voice_ops = { |
2162 | .startup = twl4030_voice_startup, | 2162 | .startup = twl4030_voice_startup, |
2163 | .shutdown = twl4030_voice_shutdown, | 2163 | .shutdown = twl4030_voice_shutdown, |
2164 | .hw_params = twl4030_voice_hw_params, | 2164 | .hw_params = twl4030_voice_hw_params, |
@@ -2202,7 +2202,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = { | |||
2202 | }, | 2202 | }, |
2203 | }; | 2203 | }; |
2204 | 2204 | ||
2205 | static int twl4030_soc_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2205 | static int twl4030_soc_suspend(struct snd_soc_codec *codec) |
2206 | { | 2206 | { |
2207 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2207 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2208 | return 0; | 2208 | return 0; |
@@ -2294,17 +2294,7 @@ static struct platform_driver twl4030_codec_driver = { | |||
2294 | }, | 2294 | }, |
2295 | }; | 2295 | }; |
2296 | 2296 | ||
2297 | static int __init twl4030_modinit(void) | 2297 | module_platform_driver(twl4030_codec_driver); |
2298 | { | ||
2299 | return platform_driver_register(&twl4030_codec_driver); | ||
2300 | } | ||
2301 | module_init(twl4030_modinit); | ||
2302 | |||
2303 | static void __exit twl4030_exit(void) | ||
2304 | { | ||
2305 | platform_driver_unregister(&twl4030_codec_driver); | ||
2306 | } | ||
2307 | module_exit(twl4030_exit); | ||
2308 | 2298 | ||
2309 | MODULE_DESCRIPTION("ASoC TWL4030 codec driver"); | 2299 | MODULE_DESCRIPTION("ASoC TWL4030 codec driver"); |
2310 | MODULE_AUTHOR("Steve Sakoman"); | 2300 | MODULE_AUTHOR("Steve Sakoman"); |
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 73e11f022de..5b9c79b6f65 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <sound/pcm.h> | 33 | #include <sound/pcm.h> |
34 | #include <sound/pcm_params.h> | 34 | #include <sound/pcm_params.h> |
35 | #include <sound/soc.h> | 35 | #include <sound/soc.h> |
36 | #include <sound/soc-dapm.h> | ||
36 | #include <sound/initval.h> | 37 | #include <sound/initval.h> |
37 | #include <sound/tlv.h> | 38 | #include <sound/tlv.h> |
38 | 39 | ||
@@ -1012,6 +1013,28 @@ static int twl6040_pll_put_enum(struct snd_kcontrol *kcontrol, | |||
1012 | return 0; | 1013 | return 0; |
1013 | } | 1014 | } |
1014 | 1015 | ||
1016 | int twl6040_get_dl1_gain(struct snd_soc_codec *codec) | ||
1017 | { | ||
1018 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
1019 | |||
1020 | if (snd_soc_dapm_get_pin_status(dapm, "EP")) | ||
1021 | return -1; /* -1dB */ | ||
1022 | |||
1023 | if (snd_soc_dapm_get_pin_status(dapm, "HSOR") || | ||
1024 | snd_soc_dapm_get_pin_status(dapm, "HSOL")) { | ||
1025 | |||
1026 | u8 val = snd_soc_read(codec, TWL6040_REG_HSLCTL); | ||
1027 | if (val & TWL6040_HSDACMODE) | ||
1028 | /* HSDACL in LP mode */ | ||
1029 | return -8; /* -8dB */ | ||
1030 | else | ||
1031 | /* HSDACL in HP mode */ | ||
1032 | return -1; /* -1dB */ | ||
1033 | } | ||
1034 | return 0; /* 0dB */ | ||
1035 | } | ||
1036 | EXPORT_SYMBOL_GPL(twl6040_get_dl1_gain); | ||
1037 | |||
1015 | int twl6040_get_clk_id(struct snd_soc_codec *codec) | 1038 | int twl6040_get_clk_id(struct snd_soc_codec *codec) |
1016 | { | 1039 | { |
1017 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); | 1040 | struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); |
@@ -1397,7 +1420,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
1397 | return 0; | 1420 | return 0; |
1398 | } | 1421 | } |
1399 | 1422 | ||
1400 | static struct snd_soc_dai_ops twl6040_dai_ops = { | 1423 | static const struct snd_soc_dai_ops twl6040_dai_ops = { |
1401 | .startup = twl6040_startup, | 1424 | .startup = twl6040_startup, |
1402 | .hw_params = twl6040_hw_params, | 1425 | .hw_params = twl6040_hw_params, |
1403 | .prepare = twl6040_prepare, | 1426 | .prepare = twl6040_prepare, |
@@ -1470,7 +1493,7 @@ static struct snd_soc_dai_driver twl6040_dai[] = { | |||
1470 | }; | 1493 | }; |
1471 | 1494 | ||
1472 | #ifdef CONFIG_PM | 1495 | #ifdef CONFIG_PM |
1473 | static int twl6040_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1496 | static int twl6040_suspend(struct snd_soc_codec *codec) |
1474 | { | 1497 | { |
1475 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1498 | twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1476 | 1499 | ||
@@ -1620,17 +1643,7 @@ static struct platform_driver twl6040_codec_driver = { | |||
1620 | .remove = __devexit_p(twl6040_codec_remove), | 1643 | .remove = __devexit_p(twl6040_codec_remove), |
1621 | }; | 1644 | }; |
1622 | 1645 | ||
1623 | static int __init twl6040_codec_init(void) | 1646 | module_platform_driver(twl6040_codec_driver); |
1624 | { | ||
1625 | return platform_driver_register(&twl6040_codec_driver); | ||
1626 | } | ||
1627 | module_init(twl6040_codec_init); | ||
1628 | |||
1629 | static void __exit twl6040_codec_exit(void) | ||
1630 | { | ||
1631 | platform_driver_unregister(&twl6040_codec_driver); | ||
1632 | } | ||
1633 | module_exit(twl6040_codec_exit); | ||
1634 | 1647 | ||
1635 | MODULE_DESCRIPTION("ASoC TWL6040 codec driver"); | 1648 | MODULE_DESCRIPTION("ASoC TWL6040 codec driver"); |
1636 | MODULE_AUTHOR("Misael Lopez Cruz"); | 1649 | MODULE_AUTHOR("Misael Lopez Cruz"); |
diff --git a/sound/soc/codecs/twl6040.h b/sound/soc/codecs/twl6040.h index a83277bdb85..ef273f1fac2 100644 --- a/sound/soc/codecs/twl6040.h +++ b/sound/soc/codecs/twl6040.h | |||
@@ -34,6 +34,7 @@ enum twl6040_trim { | |||
34 | #define TWL6040_HSF_TRIM_LEFT(x) (x & 0x0f) | 34 | #define TWL6040_HSF_TRIM_LEFT(x) (x & 0x0f) |
35 | #define TWL6040_HSF_TRIM_RIGHT(x) ((x >> 4) & 0x0f) | 35 | #define TWL6040_HSF_TRIM_RIGHT(x) ((x >> 4) & 0x0f) |
36 | 36 | ||
37 | int twl6040_get_dl1_gain(struct snd_soc_codec *codec); | ||
37 | void twl6040_hs_jack_detect(struct snd_soc_codec *codec, | 38 | void twl6040_hs_jack_detect(struct snd_soc_codec *codec, |
38 | struct snd_soc_jack *jack, int report); | 39 | struct snd_soc_jack *jack, int report); |
39 | int twl6040_get_clk_id(struct snd_soc_codec *codec); | 40 | int twl6040_get_clk_id(struct snd_soc_codec *codec); |
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index a7b8f301bad..8f4f469d641 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -452,7 +452,7 @@ SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]), | |||
452 | SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0), | 452 | SOC_SINGLE("DC Filter Enable Switch", UDA134X_STATUS0, 0, 1, 0), |
453 | }; | 453 | }; |
454 | 454 | ||
455 | static struct snd_soc_dai_ops uda134x_dai_ops = { | 455 | static const struct snd_soc_dai_ops uda134x_dai_ops = { |
456 | .startup = uda134x_startup, | 456 | .startup = uda134x_startup, |
457 | .shutdown = uda134x_shutdown, | 457 | .shutdown = uda134x_shutdown, |
458 | .hw_params = uda134x_hw_params, | 458 | .hw_params = uda134x_hw_params, |
@@ -571,8 +571,7 @@ static int uda134x_soc_remove(struct snd_soc_codec *codec) | |||
571 | } | 571 | } |
572 | 572 | ||
573 | #if defined(CONFIG_PM) | 573 | #if defined(CONFIG_PM) |
574 | static int uda134x_soc_suspend(struct snd_soc_codec *codec, | 574 | static int uda134x_soc_suspend(struct snd_soc_codec *codec) |
575 | pm_message_t state) | ||
576 | { | 575 | { |
577 | uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 576 | uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
578 | uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); | 577 | uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); |
@@ -625,17 +624,7 @@ static struct platform_driver uda134x_codec_driver = { | |||
625 | .remove = __devexit_p(uda134x_codec_remove), | 624 | .remove = __devexit_p(uda134x_codec_remove), |
626 | }; | 625 | }; |
627 | 626 | ||
628 | static int __init uda134x_codec_init(void) | 627 | module_platform_driver(uda134x_codec_driver); |
629 | { | ||
630 | return platform_driver_register(&uda134x_codec_driver); | ||
631 | } | ||
632 | module_init(uda134x_codec_init); | ||
633 | |||
634 | static void __exit uda134x_codec_exit(void) | ||
635 | { | ||
636 | platform_driver_unregister(&uda134x_codec_driver); | ||
637 | } | ||
638 | module_exit(uda134x_codec_exit); | ||
639 | 628 | ||
640 | MODULE_DESCRIPTION("UDA134X ALSA soc codec driver"); | 629 | MODULE_DESCRIPTION("UDA134X ALSA soc codec driver"); |
641 | MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>"); | 630 | MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>"); |
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index c5ca8cfea60..4f1b23d7e40 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -373,7 +373,7 @@ static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = { | |||
373 | SND_SOC_DAPM_PGA("HeadPhone Driver", UDA1380_PM, 13, 0, NULL, 0), | 373 | SND_SOC_DAPM_PGA("HeadPhone Driver", UDA1380_PM, 13, 0, NULL, 0), |
374 | }; | 374 | }; |
375 | 375 | ||
376 | static const struct snd_soc_dapm_route audio_map[] = { | 376 | static const struct snd_soc_dapm_route uda1380_dapm_routes[] = { |
377 | 377 | ||
378 | /* output mux */ | 378 | /* output mux */ |
379 | {"HeadPhone Driver", NULL, "Output Mux"}, | 379 | {"HeadPhone Driver", NULL, "Output Mux"}, |
@@ -410,17 +410,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
410 | {"Right PGA", NULL, "VINR"}, | 410 | {"Right PGA", NULL, "VINR"}, |
411 | }; | 411 | }; |
412 | 412 | ||
413 | static int uda1380_add_widgets(struct snd_soc_codec *codec) | ||
414 | { | ||
415 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
416 | |||
417 | snd_soc_dapm_new_controls(dapm, uda1380_dapm_widgets, | ||
418 | ARRAY_SIZE(uda1380_dapm_widgets)); | ||
419 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
420 | |||
421 | return 0; | ||
422 | } | ||
423 | |||
424 | static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai, | 413 | static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai, |
425 | unsigned int fmt) | 414 | unsigned int fmt) |
426 | { | 415 | { |
@@ -643,21 +632,21 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec, | |||
643 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ | 632 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ |
644 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | 633 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |
645 | 634 | ||
646 | static struct snd_soc_dai_ops uda1380_dai_ops = { | 635 | static const struct snd_soc_dai_ops uda1380_dai_ops = { |
647 | .hw_params = uda1380_pcm_hw_params, | 636 | .hw_params = uda1380_pcm_hw_params, |
648 | .shutdown = uda1380_pcm_shutdown, | 637 | .shutdown = uda1380_pcm_shutdown, |
649 | .trigger = uda1380_trigger, | 638 | .trigger = uda1380_trigger, |
650 | .set_fmt = uda1380_set_dai_fmt_both, | 639 | .set_fmt = uda1380_set_dai_fmt_both, |
651 | }; | 640 | }; |
652 | 641 | ||
653 | static struct snd_soc_dai_ops uda1380_dai_ops_playback = { | 642 | static const struct snd_soc_dai_ops uda1380_dai_ops_playback = { |
654 | .hw_params = uda1380_pcm_hw_params, | 643 | .hw_params = uda1380_pcm_hw_params, |
655 | .shutdown = uda1380_pcm_shutdown, | 644 | .shutdown = uda1380_pcm_shutdown, |
656 | .trigger = uda1380_trigger, | 645 | .trigger = uda1380_trigger, |
657 | .set_fmt = uda1380_set_dai_fmt_playback, | 646 | .set_fmt = uda1380_set_dai_fmt_playback, |
658 | }; | 647 | }; |
659 | 648 | ||
660 | static struct snd_soc_dai_ops uda1380_dai_ops_capture = { | 649 | static const struct snd_soc_dai_ops uda1380_dai_ops_capture = { |
661 | .hw_params = uda1380_pcm_hw_params, | 650 | .hw_params = uda1380_pcm_hw_params, |
662 | .shutdown = uda1380_pcm_shutdown, | 651 | .shutdown = uda1380_pcm_shutdown, |
663 | .trigger = uda1380_trigger, | 652 | .trigger = uda1380_trigger, |
@@ -705,7 +694,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = { | |||
705 | }, | 694 | }, |
706 | }; | 695 | }; |
707 | 696 | ||
708 | static int uda1380_suspend(struct snd_soc_codec *codec, pm_message_t state) | 697 | static int uda1380_suspend(struct snd_soc_codec *codec) |
709 | { | 698 | { |
710 | uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); | 699 | uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); |
711 | return 0; | 700 | return 0; |
@@ -732,27 +721,21 @@ static int uda1380_probe(struct snd_soc_codec *codec) | |||
732 | return -EINVAL; | 721 | return -EINVAL; |
733 | 722 | ||
734 | if (gpio_is_valid(pdata->gpio_reset)) { | 723 | if (gpio_is_valid(pdata->gpio_reset)) { |
735 | ret = gpio_request(pdata->gpio_reset, "uda1380 reset"); | 724 | ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_LOW, |
725 | "uda1380 reset"); | ||
736 | if (ret) | 726 | if (ret) |
737 | goto err_out; | 727 | goto err_out; |
738 | ret = gpio_direction_output(pdata->gpio_reset, 0); | ||
739 | if (ret) | ||
740 | goto err_gpio_reset_conf; | ||
741 | } | 728 | } |
742 | 729 | ||
743 | if (gpio_is_valid(pdata->gpio_power)) { | 730 | if (gpio_is_valid(pdata->gpio_power)) { |
744 | ret = gpio_request(pdata->gpio_power, "uda1380 power"); | 731 | ret = gpio_request_one(pdata->gpio_power, GPIOF_OUT_INIT_LOW, |
745 | if (ret) | 732 | "uda1380 power"); |
746 | goto err_gpio; | ||
747 | ret = gpio_direction_output(pdata->gpio_power, 0); | ||
748 | if (ret) | 733 | if (ret) |
749 | goto err_gpio_power_conf; | 734 | goto err_free_gpio; |
750 | } else { | 735 | } else { |
751 | ret = uda1380_reset(codec); | 736 | ret = uda1380_reset(codec); |
752 | if (ret) { | 737 | if (ret) |
753 | dev_err(codec->dev, "Failed to issue reset\n"); | 738 | goto err_free_gpio; |
754 | goto err_reset; | ||
755 | } | ||
756 | } | 739 | } |
757 | 740 | ||
758 | INIT_WORK(&uda1380->work, uda1380_flush_work); | 741 | INIT_WORK(&uda1380->work, uda1380_flush_work); |
@@ -770,19 +753,9 @@ static int uda1380_probe(struct snd_soc_codec *codec) | |||
770 | break; | 753 | break; |
771 | } | 754 | } |
772 | 755 | ||
773 | snd_soc_add_controls(codec, uda1380_snd_controls, | ||
774 | ARRAY_SIZE(uda1380_snd_controls)); | ||
775 | uda1380_add_widgets(codec); | ||
776 | |||
777 | return 0; | 756 | return 0; |
778 | 757 | ||
779 | err_reset: | 758 | err_free_gpio: |
780 | err_gpio_power_conf: | ||
781 | if (gpio_is_valid(pdata->gpio_power)) | ||
782 | gpio_free(pdata->gpio_power); | ||
783 | |||
784 | err_gpio_reset_conf: | ||
785 | err_gpio: | ||
786 | if (gpio_is_valid(pdata->gpio_reset)) | 759 | if (gpio_is_valid(pdata->gpio_reset)) |
787 | gpio_free(pdata->gpio_reset); | 760 | gpio_free(pdata->gpio_reset); |
788 | err_out: | 761 | err_out: |
@@ -814,6 +787,13 @@ static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { | |||
814 | .reg_word_size = sizeof(u16), | 787 | .reg_word_size = sizeof(u16), |
815 | .reg_cache_default = uda1380_reg, | 788 | .reg_cache_default = uda1380_reg, |
816 | .reg_cache_step = 1, | 789 | .reg_cache_step = 1, |
790 | |||
791 | .controls = uda1380_snd_controls, | ||
792 | .num_controls = ARRAY_SIZE(uda1380_snd_controls), | ||
793 | .dapm_widgets = uda1380_dapm_widgets, | ||
794 | .num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets), | ||
795 | .dapm_routes = uda1380_dapm_routes, | ||
796 | .num_dapm_routes = ARRAY_SIZE(uda1380_dapm_routes), | ||
817 | }; | 797 | }; |
818 | 798 | ||
819 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 799 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
@@ -823,7 +803,8 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c, | |||
823 | struct uda1380_priv *uda1380; | 803 | struct uda1380_priv *uda1380; |
824 | int ret; | 804 | int ret; |
825 | 805 | ||
826 | uda1380 = kzalloc(sizeof(struct uda1380_priv), GFP_KERNEL); | 806 | uda1380 = devm_kzalloc(&i2c->dev, sizeof(struct uda1380_priv), |
807 | GFP_KERNEL); | ||
827 | if (uda1380 == NULL) | 808 | if (uda1380 == NULL) |
828 | return -ENOMEM; | 809 | return -ENOMEM; |
829 | 810 | ||
@@ -832,15 +813,12 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c, | |||
832 | 813 | ||
833 | ret = snd_soc_register_codec(&i2c->dev, | 814 | ret = snd_soc_register_codec(&i2c->dev, |
834 | &soc_codec_dev_uda1380, uda1380_dai, ARRAY_SIZE(uda1380_dai)); | 815 | &soc_codec_dev_uda1380, uda1380_dai, ARRAY_SIZE(uda1380_dai)); |
835 | if (ret < 0) | ||
836 | kfree(uda1380); | ||
837 | return ret; | 816 | return ret; |
838 | } | 817 | } |
839 | 818 | ||
840 | static int __devexit uda1380_i2c_remove(struct i2c_client *i2c) | 819 | static int __devexit uda1380_i2c_remove(struct i2c_client *i2c) |
841 | { | 820 | { |
842 | snd_soc_unregister_codec(&i2c->dev); | 821 | snd_soc_unregister_codec(&i2c->dev); |
843 | kfree(i2c_get_clientdata(i2c)); | ||
844 | return 0; | 822 | return 0; |
845 | } | 823 | } |
846 | 824 | ||
@@ -863,13 +841,13 @@ static struct i2c_driver uda1380_i2c_driver = { | |||
863 | 841 | ||
864 | static int __init uda1380_modinit(void) | 842 | static int __init uda1380_modinit(void) |
865 | { | 843 | { |
866 | int ret; | 844 | int ret = 0; |
867 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 845 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
868 | ret = i2c_add_driver(&uda1380_i2c_driver); | 846 | ret = i2c_add_driver(&uda1380_i2c_driver); |
869 | if (ret != 0) | 847 | if (ret != 0) |
870 | pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); | 848 | pr_err("Failed to register UDA1380 I2C driver: %d\n", ret); |
871 | #endif | 849 | #endif |
872 | return 0; | 850 | return ret; |
873 | } | 851 | } |
874 | module_init(uda1380_modinit); | 852 | module_init(uda1380_modinit); |
875 | 853 | ||
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index a8549898299..44aacf927ba 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c | |||
@@ -386,7 +386,7 @@ static int wl1273_hw_params(struct snd_pcm_substream *substream, | |||
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | 388 | ||
389 | static struct snd_soc_dai_ops wl1273_dai_ops = { | 389 | static const struct snd_soc_dai_ops wl1273_dai_ops = { |
390 | .startup = wl1273_startup, | 390 | .startup = wl1273_startup, |
391 | .hw_params = wl1273_hw_params, | 391 | .hw_params = wl1273_hw_params, |
392 | }; | 392 | }; |
@@ -510,17 +510,7 @@ static struct platform_driver wl1273_platform_driver = { | |||
510 | .remove = __devexit_p(wl1273_platform_remove), | 510 | .remove = __devexit_p(wl1273_platform_remove), |
511 | }; | 511 | }; |
512 | 512 | ||
513 | static int __init wl1273_init(void) | 513 | module_platform_driver(wl1273_platform_driver); |
514 | { | ||
515 | return platform_driver_register(&wl1273_platform_driver); | ||
516 | } | ||
517 | module_init(wl1273_init); | ||
518 | |||
519 | static void __exit wl1273_exit(void) | ||
520 | { | ||
521 | platform_driver_unregister(&wl1273_platform_driver); | ||
522 | } | ||
523 | module_exit(wl1273_exit); | ||
524 | 514 | ||
525 | MODULE_AUTHOR("Matti Aaltonen <matti.j.aaltonen@nokia.com>"); | 515 | MODULE_AUTHOR("Matti Aaltonen <matti.j.aaltonen@nokia.com>"); |
526 | MODULE_DESCRIPTION("ASoC WL1273 codec driver"); | 516 | MODULE_DESCRIPTION("ASoC WL1273 codec driver"); |
diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c index cd0ec0fd1db..aefb4f89be0 100644 --- a/sound/soc/codecs/wm1250-ev1.c +++ b/sound/soc/codecs/wm1250-ev1.c | |||
@@ -116,7 +116,7 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c) | |||
116 | if (!pdata) | 116 | if (!pdata) |
117 | return 0; | 117 | return 0; |
118 | 118 | ||
119 | wm1250 = kzalloc(sizeof(*wm1250), GFP_KERNEL); | 119 | wm1250 = devm_kzalloc(&i2c->dev, sizeof(*wm1250), GFP_KERNEL); |
120 | if (!wm1250) { | 120 | if (!wm1250) { |
121 | dev_err(&i2c->dev, "Unable to allocate private data\n"); | 121 | dev_err(&i2c->dev, "Unable to allocate private data\n"); |
122 | ret = -ENOMEM; | 122 | ret = -ENOMEM; |
@@ -134,15 +134,13 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c) | |||
134 | ret = gpio_request_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); | 134 | ret = gpio_request_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); |
135 | if (ret != 0) { | 135 | if (ret != 0) { |
136 | dev_err(&i2c->dev, "Failed to get GPIOs: %d\n", ret); | 136 | dev_err(&i2c->dev, "Failed to get GPIOs: %d\n", ret); |
137 | goto err_alloc; | 137 | goto err; |
138 | } | 138 | } |
139 | 139 | ||
140 | dev_set_drvdata(&i2c->dev, wm1250); | 140 | dev_set_drvdata(&i2c->dev, wm1250); |
141 | 141 | ||
142 | return ret; | 142 | return ret; |
143 | 143 | ||
144 | err_alloc: | ||
145 | kfree(wm1250); | ||
146 | err: | 144 | err: |
147 | return ret; | 145 | return ret; |
148 | } | 146 | } |
@@ -151,10 +149,8 @@ static void wm1250_ev1_free(struct i2c_client *i2c) | |||
151 | { | 149 | { |
152 | struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev); | 150 | struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev); |
153 | 151 | ||
154 | if (wm1250) { | 152 | if (wm1250) |
155 | gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); | 153 | gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); |
156 | kfree(wm1250); | ||
157 | } | ||
158 | } | 154 | } |
159 | 155 | ||
160 | static int __devinit wm1250_ev1_probe(struct i2c_client *i2c, | 156 | static int __devinit wm1250_ev1_probe(struct i2c_client *i2c, |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index a3b9cbb20ee..c2880907fce 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/pm.h> | 30 | #include <linux/pm.h> |
31 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/regmap.h> |
33 | #include <linux/debugfs.h> | 33 | #include <linux/debugfs.h> |
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <sound/core.h> | 35 | #include <sound/core.h> |
@@ -52,6 +52,7 @@ enum wm2000_anc_mode { | |||
52 | 52 | ||
53 | struct wm2000_priv { | 53 | struct wm2000_priv { |
54 | struct i2c_client *i2c; | 54 | struct i2c_client *i2c; |
55 | struct regmap *regmap; | ||
55 | 56 | ||
56 | enum wm2000_anc_mode anc_mode; | 57 | enum wm2000_anc_mode anc_mode; |
57 | 58 | ||
@@ -66,59 +67,24 @@ struct wm2000_priv { | |||
66 | char *anc_download; | 67 | char *anc_download; |
67 | }; | 68 | }; |
68 | 69 | ||
69 | static struct i2c_client *wm2000_i2c; | ||
70 | |||
71 | static int wm2000_write(struct i2c_client *i2c, unsigned int reg, | 70 | static int wm2000_write(struct i2c_client *i2c, unsigned int reg, |
72 | unsigned int value) | 71 | unsigned int value) |
73 | { | 72 | { |
74 | u8 data[3]; | 73 | struct wm2000_priv *wm2000 = i2c_get_clientdata(i2c); |
75 | int ret; | 74 | return regmap_write(wm2000->regmap, reg, value); |
76 | |||
77 | data[0] = (reg >> 8) & 0xff; | ||
78 | data[1] = reg & 0xff; | ||
79 | data[2] = value & 0xff; | ||
80 | |||
81 | dev_vdbg(&i2c->dev, "write %x = %x\n", reg, value); | ||
82 | |||
83 | ret = i2c_master_send(i2c, data, 3); | ||
84 | if (ret == 3) | ||
85 | return 0; | ||
86 | if (ret < 0) | ||
87 | return ret; | ||
88 | else | ||
89 | return -EIO; | ||
90 | } | 75 | } |
91 | 76 | ||
92 | static unsigned int wm2000_read(struct i2c_client *i2c, unsigned int r) | 77 | static unsigned int wm2000_read(struct i2c_client *i2c, unsigned int r) |
93 | { | 78 | { |
94 | struct i2c_msg xfer[2]; | 79 | struct wm2000_priv *wm2000 = i2c_get_clientdata(i2c); |
95 | u8 reg[2]; | 80 | unsigned int val; |
96 | u8 data; | ||
97 | int ret; | 81 | int ret; |
98 | 82 | ||
99 | /* Write register */ | 83 | ret = regmap_read(wm2000->regmap, r, &val); |
100 | reg[0] = (r >> 8) & 0xff; | 84 | if (ret < 0) |
101 | reg[1] = r & 0xff; | 85 | return -1; |
102 | xfer[0].addr = i2c->addr; | ||
103 | xfer[0].flags = 0; | ||
104 | xfer[0].len = sizeof(reg); | ||
105 | xfer[0].buf = ®[0]; | ||
106 | |||
107 | /* Read data */ | ||
108 | xfer[1].addr = i2c->addr; | ||
109 | xfer[1].flags = I2C_M_RD; | ||
110 | xfer[1].len = 1; | ||
111 | xfer[1].buf = &data; | ||
112 | |||
113 | ret = i2c_transfer(i2c->adapter, xfer, 2); | ||
114 | if (ret != 2) { | ||
115 | dev_err(&i2c->dev, "i2c_transfer() returned %d\n", ret); | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | dev_vdbg(&i2c->dev, "read %x from %x\n", data, r); | ||
120 | 86 | ||
121 | return data; | 87 | return val; |
122 | } | 88 | } |
123 | 89 | ||
124 | static void wm2000_reset(struct wm2000_priv *wm2000) | 90 | static void wm2000_reset(struct wm2000_priv *wm2000) |
@@ -612,7 +578,8 @@ static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) | |||
612 | static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, | 578 | static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, |
613 | struct snd_ctl_elem_value *ucontrol) | 579 | struct snd_ctl_elem_value *ucontrol) |
614 | { | 580 | { |
615 | struct wm2000_priv *wm2000 = dev_get_drvdata(&wm2000_i2c->dev); | 581 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
582 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
616 | 583 | ||
617 | ucontrol->value.enumerated.item[0] = wm2000->anc_active; | 584 | ucontrol->value.enumerated.item[0] = wm2000->anc_active; |
618 | 585 | ||
@@ -622,7 +589,8 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, | |||
622 | static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, | 589 | static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, |
623 | struct snd_ctl_elem_value *ucontrol) | 590 | struct snd_ctl_elem_value *ucontrol) |
624 | { | 591 | { |
625 | struct wm2000_priv *wm2000 = dev_get_drvdata(&wm2000_i2c->dev); | 592 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
593 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
626 | int anc_active = ucontrol->value.enumerated.item[0]; | 594 | int anc_active = ucontrol->value.enumerated.item[0]; |
627 | 595 | ||
628 | if (anc_active > 1) | 596 | if (anc_active > 1) |
@@ -636,7 +604,8 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, | |||
636 | static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, | 604 | static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, |
637 | struct snd_ctl_elem_value *ucontrol) | 605 | struct snd_ctl_elem_value *ucontrol) |
638 | { | 606 | { |
639 | struct wm2000_priv *wm2000 = dev_get_drvdata(&wm2000_i2c->dev); | 607 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
608 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
640 | 609 | ||
641 | ucontrol->value.enumerated.item[0] = wm2000->spk_ena; | 610 | ucontrol->value.enumerated.item[0] = wm2000->spk_ena; |
642 | 611 | ||
@@ -646,7 +615,8 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, | |||
646 | static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, | 615 | static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, |
647 | struct snd_ctl_elem_value *ucontrol) | 616 | struct snd_ctl_elem_value *ucontrol) |
648 | { | 617 | { |
649 | struct wm2000_priv *wm2000 = dev_get_drvdata(&wm2000_i2c->dev); | 618 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
619 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
650 | int val = ucontrol->value.enumerated.item[0]; | 620 | int val = ucontrol->value.enumerated.item[0]; |
651 | 621 | ||
652 | if (val > 1) | 622 | if (val > 1) |
@@ -669,7 +639,8 @@ static const struct snd_kcontrol_new wm2000_controls[] = { | |||
669 | static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w, | 639 | static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w, |
670 | struct snd_kcontrol *kcontrol, int event) | 640 | struct snd_kcontrol *kcontrol, int event) |
671 | { | 641 | { |
672 | struct wm2000_priv *wm2000 = dev_get_drvdata(&wm2000_i2c->dev); | 642 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
643 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
673 | 644 | ||
674 | if (SND_SOC_DAPM_EVENT_ON(event)) | 645 | if (SND_SOC_DAPM_EVENT_ON(event)) |
675 | wm2000->anc_eng_ena = 1; | 646 | wm2000->anc_eng_ena = 1; |
@@ -682,11 +653,11 @@ static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w, | |||
682 | 653 | ||
683 | static const struct snd_soc_dapm_widget wm2000_dapm_widgets[] = { | 654 | static const struct snd_soc_dapm_widget wm2000_dapm_widgets[] = { |
684 | /* Externally visible pins */ | 655 | /* Externally visible pins */ |
685 | SND_SOC_DAPM_OUTPUT("WM2000 SPKN"), | 656 | SND_SOC_DAPM_OUTPUT("SPKN"), |
686 | SND_SOC_DAPM_OUTPUT("WM2000 SPKP"), | 657 | SND_SOC_DAPM_OUTPUT("SPKP"), |
687 | 658 | ||
688 | SND_SOC_DAPM_INPUT("WM2000 LINN"), | 659 | SND_SOC_DAPM_INPUT("LINN"), |
689 | SND_SOC_DAPM_INPUT("WM2000 LINP"), | 660 | SND_SOC_DAPM_INPUT("LINP"), |
690 | 661 | ||
691 | SND_SOC_DAPM_PGA_E("ANC Engine", SND_SOC_NOPM, 0, 0, NULL, 0, | 662 | SND_SOC_DAPM_PGA_E("ANC Engine", SND_SOC_NOPM, 0, 0, NULL, 0, |
692 | wm2000_anc_power_event, | 663 | wm2000_anc_power_event, |
@@ -694,37 +665,67 @@ SND_SOC_DAPM_PGA_E("ANC Engine", SND_SOC_NOPM, 0, 0, NULL, 0, | |||
694 | }; | 665 | }; |
695 | 666 | ||
696 | /* Target, Path, Source */ | 667 | /* Target, Path, Source */ |
697 | static const struct snd_soc_dapm_route audio_map[] = { | 668 | static const struct snd_soc_dapm_route wm2000_audio_map[] = { |
698 | { "WM2000 SPKN", NULL, "ANC Engine" }, | 669 | { "SPKN", NULL, "ANC Engine" }, |
699 | { "WM2000 SPKP", NULL, "ANC Engine" }, | 670 | { "SPKP", NULL, "ANC Engine" }, |
700 | { "ANC Engine", NULL, "WM2000 LINN" }, | 671 | { "ANC Engine", NULL, "LINN" }, |
701 | { "ANC Engine", NULL, "WM2000 LINP" }, | 672 | { "ANC Engine", NULL, "LINP" }, |
702 | }; | 673 | }; |
703 | 674 | ||
704 | /* Called from the machine driver */ | 675 | #ifdef CONFIG_PM |
705 | int wm2000_add_controls(struct snd_soc_codec *codec) | 676 | static int wm2000_suspend(struct snd_soc_codec *codec) |
706 | { | 677 | { |
707 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 678 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
708 | int ret; | ||
709 | 679 | ||
710 | if (!wm2000_i2c) { | 680 | return wm2000_anc_transition(wm2000, ANC_OFF); |
711 | pr_err("WM2000 not yet probed\n"); | 681 | } |
712 | return -ENODEV; | ||
713 | } | ||
714 | 682 | ||
715 | ret = snd_soc_dapm_new_controls(dapm, wm2000_dapm_widgets, | 683 | static int wm2000_resume(struct snd_soc_codec *codec) |
716 | ARRAY_SIZE(wm2000_dapm_widgets)); | 684 | { |
717 | if (ret < 0) | 685 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); |
718 | return ret; | ||
719 | 686 | ||
720 | ret = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | 687 | return wm2000_anc_set_mode(wm2000); |
721 | if (ret < 0) | 688 | } |
722 | return ret; | 689 | #else |
690 | #define wm2000_suspend NULL | ||
691 | #define wm2000_resume NULL | ||
692 | #endif | ||
693 | |||
694 | static const struct regmap_config wm2000_regmap = { | ||
695 | .reg_bits = 8, | ||
696 | .val_bits = 8, | ||
697 | }; | ||
698 | |||
699 | static int wm2000_probe(struct snd_soc_codec *codec) | ||
700 | { | ||
701 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
702 | |||
703 | /* This will trigger a transition to standby mode by default */ | ||
704 | wm2000_anc_set_mode(wm2000); | ||
705 | |||
706 | return 0; | ||
707 | } | ||
708 | |||
709 | static int wm2000_remove(struct snd_soc_codec *codec) | ||
710 | { | ||
711 | struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); | ||
723 | 712 | ||
724 | return snd_soc_add_controls(codec, wm2000_controls, | 713 | return wm2000_anc_transition(wm2000, ANC_OFF); |
725 | ARRAY_SIZE(wm2000_controls)); | ||
726 | } | 714 | } |
727 | EXPORT_SYMBOL_GPL(wm2000_add_controls); | 715 | |
716 | static struct snd_soc_codec_driver soc_codec_dev_wm2000 = { | ||
717 | .probe = wm2000_probe, | ||
718 | .remove = wm2000_remove, | ||
719 | .suspend = wm2000_suspend, | ||
720 | .resume = wm2000_resume, | ||
721 | |||
722 | .dapm_widgets = wm2000_dapm_widgets, | ||
723 | .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets), | ||
724 | .dapm_routes = wm2000_audio_map, | ||
725 | .num_dapm_routes = ARRAY_SIZE(wm2000_audio_map), | ||
726 | .controls = wm2000_controls, | ||
727 | .num_controls = ARRAY_SIZE(wm2000_controls), | ||
728 | }; | ||
728 | 729 | ||
729 | static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | 730 | static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, |
730 | const struct i2c_device_id *i2c_id) | 731 | const struct i2c_device_id *i2c_id) |
@@ -736,17 +737,23 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
736 | int reg, ret; | 737 | int reg, ret; |
737 | u16 id; | 738 | u16 id; |
738 | 739 | ||
739 | if (wm2000_i2c) { | 740 | wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv), |
740 | dev_err(&i2c->dev, "Another WM2000 is already registered\n"); | 741 | GFP_KERNEL); |
741 | return -EINVAL; | ||
742 | } | ||
743 | |||
744 | wm2000 = kzalloc(sizeof(struct wm2000_priv), GFP_KERNEL); | ||
745 | if (wm2000 == NULL) { | 742 | if (wm2000 == NULL) { |
746 | dev_err(&i2c->dev, "Unable to allocate private data\n"); | 743 | dev_err(&i2c->dev, "Unable to allocate private data\n"); |
747 | return -ENOMEM; | 744 | return -ENOMEM; |
748 | } | 745 | } |
749 | 746 | ||
747 | dev_set_drvdata(&i2c->dev, wm2000); | ||
748 | |||
749 | wm2000->regmap = regmap_init_i2c(i2c, &wm2000_regmap); | ||
750 | if (IS_ERR(wm2000->regmap)) { | ||
751 | ret = PTR_ERR(wm2000->regmap); | ||
752 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | ||
753 | ret); | ||
754 | goto err; | ||
755 | } | ||
756 | |||
750 | /* Verify that this is a WM2000 */ | 757 | /* Verify that this is a WM2000 */ |
751 | reg = wm2000_read(i2c, WM2000_REG_ID1); | 758 | reg = wm2000_read(i2c, WM2000_REG_ID1); |
752 | id = reg << 8; | 759 | id = reg << 8; |
@@ -756,7 +763,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
756 | if (id != 0x2000) { | 763 | if (id != 0x2000) { |
757 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); | 764 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); |
758 | ret = -ENODEV; | 765 | ret = -ENODEV; |
759 | goto err; | 766 | goto err_regmap; |
760 | } | 767 | } |
761 | 768 | ||
762 | reg = wm2000_read(i2c, WM2000_REG_REVISON); | 769 | reg = wm2000_read(i2c, WM2000_REG_REVISON); |
@@ -775,12 +782,14 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
775 | ret = request_firmware(&fw, filename, &i2c->dev); | 782 | ret = request_firmware(&fw, filename, &i2c->dev); |
776 | if (ret != 0) { | 783 | if (ret != 0) { |
777 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); | 784 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); |
778 | goto err; | 785 | goto err_regmap; |
779 | } | 786 | } |
780 | 787 | ||
781 | /* Pre-cook the concatenation of the register address onto the image */ | 788 | /* Pre-cook the concatenation of the register address onto the image */ |
782 | wm2000->anc_download_size = fw->size + 2; | 789 | wm2000->anc_download_size = fw->size + 2; |
783 | wm2000->anc_download = kmalloc(wm2000->anc_download_size, GFP_KERNEL); | 790 | wm2000->anc_download = devm_kzalloc(&i2c->dev, |
791 | wm2000->anc_download_size, | ||
792 | GFP_KERNEL); | ||
784 | if (wm2000->anc_download == NULL) { | 793 | if (wm2000->anc_download == NULL) { |
785 | dev_err(&i2c->dev, "Out of memory\n"); | 794 | dev_err(&i2c->dev, "Out of memory\n"); |
786 | ret = -ENOMEM; | 795 | ret = -ENOMEM; |
@@ -793,7 +802,6 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
793 | 802 | ||
794 | release_firmware(fw); | 803 | release_firmware(fw); |
795 | 804 | ||
796 | dev_set_drvdata(&i2c->dev, wm2000); | ||
797 | wm2000->anc_eng_ena = 1; | 805 | wm2000->anc_eng_ena = 1; |
798 | wm2000->anc_active = 1; | 806 | wm2000->anc_active = 1; |
799 | wm2000->spk_ena = 1; | 807 | wm2000->spk_ena = 1; |
@@ -801,17 +809,18 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
801 | 809 | ||
802 | wm2000_reset(wm2000); | 810 | wm2000_reset(wm2000); |
803 | 811 | ||
804 | /* This will trigger a transition to standby mode by default */ | 812 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000, |
805 | wm2000_anc_set_mode(wm2000); | 813 | NULL, 0); |
806 | 814 | if (ret != 0) | |
807 | wm2000_i2c = i2c; | 815 | goto err_fw; |
808 | 816 | ||
809 | return 0; | 817 | return 0; |
810 | 818 | ||
811 | err_fw: | 819 | err_fw: |
812 | release_firmware(fw); | 820 | release_firmware(fw); |
821 | err_regmap: | ||
822 | regmap_exit(wm2000->regmap); | ||
813 | err: | 823 | err: |
814 | kfree(wm2000); | ||
815 | return ret; | 824 | return ret; |
816 | } | 825 | } |
817 | 826 | ||
@@ -819,42 +828,12 @@ static __devexit int wm2000_i2c_remove(struct i2c_client *i2c) | |||
819 | { | 828 | { |
820 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | 829 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); |
821 | 830 | ||
822 | wm2000_anc_transition(wm2000, ANC_OFF); | 831 | snd_soc_unregister_codec(&i2c->dev); |
823 | 832 | regmap_exit(wm2000->regmap); | |
824 | wm2000_i2c = NULL; | ||
825 | kfree(wm2000->anc_download); | ||
826 | kfree(wm2000); | ||
827 | 833 | ||
828 | return 0; | 834 | return 0; |
829 | } | 835 | } |
830 | 836 | ||
831 | static void wm2000_i2c_shutdown(struct i2c_client *i2c) | ||
832 | { | ||
833 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | ||
834 | |||
835 | wm2000_anc_transition(wm2000, ANC_OFF); | ||
836 | } | ||
837 | |||
838 | #ifdef CONFIG_PM | ||
839 | static int wm2000_i2c_suspend(struct device *dev) | ||
840 | { | ||
841 | struct i2c_client *i2c = to_i2c_client(dev); | ||
842 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | ||
843 | |||
844 | return wm2000_anc_transition(wm2000, ANC_OFF); | ||
845 | } | ||
846 | |||
847 | static int wm2000_i2c_resume(struct device *dev) | ||
848 | { | ||
849 | struct i2c_client *i2c = to_i2c_client(dev); | ||
850 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | ||
851 | |||
852 | return wm2000_anc_set_mode(wm2000); | ||
853 | } | ||
854 | #endif | ||
855 | |||
856 | static SIMPLE_DEV_PM_OPS(wm2000_pm, wm2000_i2c_suspend, wm2000_i2c_resume); | ||
857 | |||
858 | static const struct i2c_device_id wm2000_i2c_id[] = { | 837 | static const struct i2c_device_id wm2000_i2c_id[] = { |
859 | { "wm2000", 0 }, | 838 | { "wm2000", 0 }, |
860 | { } | 839 | { } |
@@ -865,11 +844,9 @@ static struct i2c_driver wm2000_i2c_driver = { | |||
865 | .driver = { | 844 | .driver = { |
866 | .name = "wm2000", | 845 | .name = "wm2000", |
867 | .owner = THIS_MODULE, | 846 | .owner = THIS_MODULE, |
868 | .pm = &wm2000_pm, | ||
869 | }, | 847 | }, |
870 | .probe = wm2000_i2c_probe, | 848 | .probe = wm2000_i2c_probe, |
871 | .remove = __devexit_p(wm2000_i2c_remove), | 849 | .remove = __devexit_p(wm2000_i2c_remove), |
872 | .shutdown = wm2000_i2c_shutdown, | ||
873 | .id_table = wm2000_i2c_id, | 850 | .id_table = wm2000_i2c_id, |
874 | }; | 851 | }; |
875 | 852 | ||
diff --git a/sound/soc/codecs/wm2000.h b/sound/soc/codecs/wm2000.h index 0b6f056f73c..abcd82a9399 100644 --- a/sound/soc/codecs/wm2000.h +++ b/sound/soc/codecs/wm2000.h | |||
@@ -9,13 +9,6 @@ | |||
9 | #ifndef _WM2000_H | 9 | #ifndef _WM2000_H |
10 | #define _WM2000_H | 10 | #define _WM2000_H |
11 | 11 | ||
12 | struct wm2000_setup_data { | ||
13 | unsigned short i2c_address; | ||
14 | int mclk_div; /* Set to a non-zero value if MCLK_DIV_2 required */ | ||
15 | }; | ||
16 | |||
17 | extern int wm2000_add_controls(struct snd_soc_codec *codec); | ||
18 | |||
19 | #define WM2000_REG_SYS_START 0x8000 | 12 | #define WM2000_REG_SYS_START 0x8000 |
20 | #define WM2000_REG_SPEECH_CLARITY 0x8fef | 13 | #define WM2000_REG_SPEECH_CLARITY 0x8fef |
21 | #define WM2000_REG_SYS_WATCHDOG 0x8ff6 | 14 | #define WM2000_REG_SYS_WATCHDOG 0x8ff6 |
diff --git a/sound/soc/codecs/wm5100-tables.c b/sound/soc/codecs/wm5100-tables.c index e9ce81a57b8..9a18fae6820 100644 --- a/sound/soc/codecs/wm5100-tables.c +++ b/sound/soc/codecs/wm5100-tables.c | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include "wm5100.h" | 14 | #include "wm5100.h" |
15 | 15 | ||
16 | int wm5100_volatile_register(struct snd_soc_codec *codec, unsigned int reg) | 16 | bool wm5100_volatile_register(struct device *dev, unsigned int reg) |
17 | { | 17 | { |
18 | switch (reg) { | 18 | switch (reg) { |
19 | case WM5100_SOFTWARE_RESET: | 19 | case WM5100_SOFTWARE_RESET: |
@@ -36,7 +36,7 @@ int wm5100_volatile_register(struct snd_soc_codec *codec, unsigned int reg) | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | int wm5100_readable_register(struct snd_soc_codec *codec, unsigned int reg) | 39 | bool wm5100_readable_register(struct device *dev, unsigned int reg) |
40 | { | 40 | { |
41 | switch (reg) { | 41 | switch (reg) { |
42 | case WM5100_SOFTWARE_RESET: | 42 | case WM5100_SOFTWARE_RESET: |
@@ -85,6 +85,7 @@ int wm5100_readable_register(struct snd_soc_codec *codec, unsigned int reg) | |||
85 | case WM5100_MIC_DETECT_1: | 85 | case WM5100_MIC_DETECT_1: |
86 | case WM5100_MIC_DETECT_2: | 86 | case WM5100_MIC_DETECT_2: |
87 | case WM5100_MIC_DETECT_3: | 87 | case WM5100_MIC_DETECT_3: |
88 | case WM5100_MISC_CONTROL: | ||
88 | case WM5100_INPUT_ENABLES: | 89 | case WM5100_INPUT_ENABLES: |
89 | case WM5100_INPUT_ENABLES_STATUS: | 90 | case WM5100_INPUT_ENABLES_STATUS: |
90 | case WM5100_IN1L_CONTROL: | 91 | case WM5100_IN1L_CONTROL: |
@@ -696,836 +697,668 @@ int wm5100_readable_register(struct snd_soc_codec *codec, unsigned int reg) | |||
696 | case WM5100_HPLPF3_2: | 697 | case WM5100_HPLPF3_2: |
697 | case WM5100_HPLPF4_1: | 698 | case WM5100_HPLPF4_1: |
698 | case WM5100_HPLPF4_2: | 699 | case WM5100_HPLPF4_2: |
699 | case WM5100_DSP1_DM_0: | ||
700 | case WM5100_DSP1_DM_1: | ||
701 | case WM5100_DSP1_DM_2: | ||
702 | case WM5100_DSP1_DM_3: | ||
703 | case WM5100_DSP1_DM_508: | ||
704 | case WM5100_DSP1_DM_509: | ||
705 | case WM5100_DSP1_DM_510: | ||
706 | case WM5100_DSP1_DM_511: | ||
707 | case WM5100_DSP1_PM_0: | ||
708 | case WM5100_DSP1_PM_1: | ||
709 | case WM5100_DSP1_PM_2: | ||
710 | case WM5100_DSP1_PM_3: | ||
711 | case WM5100_DSP1_PM_4: | ||
712 | case WM5100_DSP1_PM_5: | ||
713 | case WM5100_DSP1_PM_1530: | ||
714 | case WM5100_DSP1_PM_1531: | ||
715 | case WM5100_DSP1_PM_1532: | ||
716 | case WM5100_DSP1_PM_1533: | ||
717 | case WM5100_DSP1_PM_1534: | ||
718 | case WM5100_DSP1_PM_1535: | ||
719 | case WM5100_DSP1_ZM_0: | ||
720 | case WM5100_DSP1_ZM_1: | ||
721 | case WM5100_DSP1_ZM_2: | ||
722 | case WM5100_DSP1_ZM_3: | ||
723 | case WM5100_DSP1_ZM_2044: | ||
724 | case WM5100_DSP1_ZM_2045: | ||
725 | case WM5100_DSP1_ZM_2046: | ||
726 | case WM5100_DSP1_ZM_2047: | ||
727 | case WM5100_DSP2_DM_0: | ||
728 | case WM5100_DSP2_DM_1: | ||
729 | case WM5100_DSP2_DM_2: | ||
730 | case WM5100_DSP2_DM_3: | ||
731 | case WM5100_DSP2_DM_508: | ||
732 | case WM5100_DSP2_DM_509: | ||
733 | case WM5100_DSP2_DM_510: | ||
734 | case WM5100_DSP2_DM_511: | ||
735 | case WM5100_DSP2_PM_0: | ||
736 | case WM5100_DSP2_PM_1: | ||
737 | case WM5100_DSP2_PM_2: | ||
738 | case WM5100_DSP2_PM_3: | ||
739 | case WM5100_DSP2_PM_4: | ||
740 | case WM5100_DSP2_PM_5: | ||
741 | case WM5100_DSP2_PM_1530: | ||
742 | case WM5100_DSP2_PM_1531: | ||
743 | case WM5100_DSP2_PM_1532: | ||
744 | case WM5100_DSP2_PM_1533: | ||
745 | case WM5100_DSP2_PM_1534: | ||
746 | case WM5100_DSP2_PM_1535: | ||
747 | case WM5100_DSP2_ZM_0: | ||
748 | case WM5100_DSP2_ZM_1: | ||
749 | case WM5100_DSP2_ZM_2: | ||
750 | case WM5100_DSP2_ZM_3: | ||
751 | case WM5100_DSP2_ZM_2044: | ||
752 | case WM5100_DSP2_ZM_2045: | ||
753 | case WM5100_DSP2_ZM_2046: | ||
754 | case WM5100_DSP2_ZM_2047: | ||
755 | case WM5100_DSP3_DM_0: | ||
756 | case WM5100_DSP3_DM_1: | ||
757 | case WM5100_DSP3_DM_2: | ||
758 | case WM5100_DSP3_DM_3: | ||
759 | case WM5100_DSP3_DM_508: | ||
760 | case WM5100_DSP3_DM_509: | ||
761 | case WM5100_DSP3_DM_510: | ||
762 | case WM5100_DSP3_DM_511: | ||
763 | case WM5100_DSP3_PM_0: | ||
764 | case WM5100_DSP3_PM_1: | ||
765 | case WM5100_DSP3_PM_2: | ||
766 | case WM5100_DSP3_PM_3: | ||
767 | case WM5100_DSP3_PM_4: | ||
768 | case WM5100_DSP3_PM_5: | ||
769 | case WM5100_DSP3_PM_1530: | ||
770 | case WM5100_DSP3_PM_1531: | ||
771 | case WM5100_DSP3_PM_1532: | ||
772 | case WM5100_DSP3_PM_1533: | ||
773 | case WM5100_DSP3_PM_1534: | ||
774 | case WM5100_DSP3_PM_1535: | ||
775 | case WM5100_DSP3_ZM_0: | ||
776 | case WM5100_DSP3_ZM_1: | ||
777 | case WM5100_DSP3_ZM_2: | ||
778 | case WM5100_DSP3_ZM_3: | ||
779 | case WM5100_DSP3_ZM_2044: | ||
780 | case WM5100_DSP3_ZM_2045: | ||
781 | case WM5100_DSP3_ZM_2046: | ||
782 | case WM5100_DSP3_ZM_2047: | ||
783 | return 1; | 700 | return 1; |
784 | default: | 701 | default: |
785 | return 0; | 702 | return 0; |
786 | } | 703 | } |
787 | } | 704 | } |
788 | 705 | ||
789 | u16 wm5100_reg_defaults[WM5100_MAX_REGISTER + 1] = { | 706 | struct reg_default wm5100_reg_defaults[WM5100_REGISTER_COUNT] = { |
790 | [0x0000] = 0x0000, /* R0 - software reset */ | 707 | { 0x0000, 0x0000 }, /* R0 - software reset */ |
791 | [0x0001] = 0x0000, /* R1 - Device Revision */ | 708 | { 0x0001, 0x0000 }, /* R1 - Device Revision */ |
792 | [0x0010] = 0x0801, /* R16 - Ctrl IF 1 */ | 709 | { 0x0010, 0x0801 }, /* R16 - Ctrl IF 1 */ |
793 | [0x0020] = 0x0000, /* R32 - Tone Generator 1 */ | 710 | { 0x0020, 0x0000 }, /* R32 - Tone Generator 1 */ |
794 | [0x0030] = 0x0000, /* R48 - PWM Drive 1 */ | 711 | { 0x0030, 0x0000 }, /* R48 - PWM Drive 1 */ |
795 | [0x0031] = 0x0100, /* R49 - PWM Drive 2 */ | 712 | { 0x0031, 0x0100 }, /* R49 - PWM Drive 2 */ |
796 | [0x0032] = 0x0100, /* R50 - PWM Drive 3 */ | 713 | { 0x0032, 0x0100 }, /* R50 - PWM Drive 3 */ |
797 | [0x0100] = 0x0002, /* R256 - Clocking 1 */ | 714 | { 0x0100, 0x0002 }, /* R256 - Clocking 1 */ |
798 | [0x0101] = 0x0000, /* R257 - Clocking 3 */ | 715 | { 0x0101, 0x0000 }, /* R257 - Clocking 3 */ |
799 | [0x0102] = 0x0011, /* R258 - Clocking 4 */ | 716 | { 0x0102, 0x0011 }, /* R258 - Clocking 4 */ |
800 | [0x0103] = 0x0011, /* R259 - Clocking 5 */ | 717 | { 0x0103, 0x0011 }, /* R259 - Clocking 5 */ |
801 | [0x0104] = 0x0011, /* R260 - Clocking 6 */ | 718 | { 0x0104, 0x0011 }, /* R260 - Clocking 6 */ |
802 | [0x0107] = 0x0000, /* R263 - Clocking 7 */ | 719 | { 0x0107, 0x0000 }, /* R263 - Clocking 7 */ |
803 | [0x0108] = 0x0000, /* R264 - Clocking 8 */ | 720 | { 0x0108, 0x0000 }, /* R264 - Clocking 8 */ |
804 | [0x0120] = 0x0000, /* R288 - ASRC_ENABLE */ | 721 | { 0x0120, 0x0000 }, /* R288 - ASRC_ENABLE */ |
805 | [0x0121] = 0x0000, /* R289 - ASRC_STATUS */ | 722 | { 0x0121, 0x0000 }, /* R289 - ASRC_STATUS */ |
806 | [0x0122] = 0x0000, /* R290 - ASRC_RATE1 */ | 723 | { 0x0122, 0x0000 }, /* R290 - ASRC_RATE1 */ |
807 | [0x0141] = 0x8000, /* R321 - ISRC 1 CTRL 1 */ | 724 | { 0x0141, 0x8000 }, /* R321 - ISRC 1 CTRL 1 */ |
808 | [0x0142] = 0x0000, /* R322 - ISRC 1 CTRL 2 */ | 725 | { 0x0142, 0x0000 }, /* R322 - ISRC 1 CTRL 2 */ |
809 | [0x0143] = 0x8000, /* R323 - ISRC 2 CTRL1 */ | 726 | { 0x0143, 0x8000 }, /* R323 - ISRC 2 CTRL1 */ |
810 | [0x0144] = 0x0000, /* R324 - ISRC 2 CTRL 2 */ | 727 | { 0x0144, 0x0000 }, /* R324 - ISRC 2 CTRL 2 */ |
811 | [0x0182] = 0x0000, /* R386 - FLL1 Control 1 */ | 728 | { 0x0182, 0x0000 }, /* R386 - FLL1 Control 1 */ |
812 | [0x0183] = 0x0000, /* R387 - FLL1 Control 2 */ | 729 | { 0x0183, 0x0000 }, /* R387 - FLL1 Control 2 */ |
813 | [0x0184] = 0x0000, /* R388 - FLL1 Control 3 */ | 730 | { 0x0184, 0x0000 }, /* R388 - FLL1 Control 3 */ |
814 | [0x0186] = 0x0177, /* R390 - FLL1 Control 5 */ | 731 | { 0x0186, 0x0177 }, /* R390 - FLL1 Control 5 */ |
815 | [0x0187] = 0x0001, /* R391 - FLL1 Control 6 */ | 732 | { 0x0187, 0x0001 }, /* R391 - FLL1 Control 6 */ |
816 | [0x0188] = 0x0000, /* R392 - FLL1 EFS 1 */ | 733 | { 0x0188, 0x0000 }, /* R392 - FLL1 EFS 1 */ |
817 | [0x01A2] = 0x0000, /* R418 - FLL2 Control 1 */ | 734 | { 0x01A2, 0x0000 }, /* R418 - FLL2 Control 1 */ |
818 | [0x01A3] = 0x0000, /* R419 - FLL2 Control 2 */ | 735 | { 0x01A3, 0x0000 }, /* R419 - FLL2 Control 2 */ |
819 | [0x01A4] = 0x0000, /* R420 - FLL2 Control 3 */ | 736 | { 0x01A4, 0x0000 }, /* R420 - FLL2 Control 3 */ |
820 | [0x01A6] = 0x0177, /* R422 - FLL2 Control 5 */ | 737 | { 0x01A6, 0x0177 }, /* R422 - FLL2 Control 5 */ |
821 | [0x01A7] = 0x0001, /* R423 - FLL2 Control 6 */ | 738 | { 0x01A7, 0x0001 }, /* R423 - FLL2 Control 6 */ |
822 | [0x01A8] = 0x0000, /* R424 - FLL2 EFS 1 */ | 739 | { 0x01A8, 0x0000 }, /* R424 - FLL2 EFS 1 */ |
823 | [0x0200] = 0x0020, /* R512 - Mic Charge Pump 1 */ | 740 | { 0x0200, 0x0020 }, /* R512 - Mic Charge Pump 1 */ |
824 | [0x0201] = 0xB084, /* R513 - Mic Charge Pump 2 */ | 741 | { 0x0201, 0xB084 }, /* R513 - Mic Charge Pump 2 */ |
825 | [0x0202] = 0xBBDE, /* R514 - HP Charge Pump 1 */ | 742 | { 0x0202, 0xBBDE }, /* R514 - HP Charge Pump 1 */ |
826 | [0x0211] = 0x20D4, /* R529 - LDO1 Control */ | 743 | { 0x0211, 0x20D4 }, /* R529 - LDO1 Control */ |
827 | [0x0215] = 0x0062, /* R533 - Mic Bias Ctrl 1 */ | 744 | { 0x0215, 0x0062 }, /* R533 - Mic Bias Ctrl 1 */ |
828 | [0x0216] = 0x0062, /* R534 - Mic Bias Ctrl 2 */ | 745 | { 0x0216, 0x0062 }, /* R534 - Mic Bias Ctrl 2 */ |
829 | [0x0217] = 0x0062, /* R535 - Mic Bias Ctrl 3 */ | 746 | { 0x0217, 0x0062 }, /* R535 - Mic Bias Ctrl 3 */ |
830 | [0x0280] = 0x0004, /* R640 - Accessory Detect Mode 1 */ | 747 | { 0x0280, 0x0004 }, /* R640 - Accessory Detect Mode 1 */ |
831 | [0x0288] = 0x0020, /* R648 - Headphone Detect 1 */ | 748 | { 0x0288, 0x0020 }, /* R648 - Headphone Detect 1 */ |
832 | [0x0289] = 0x0000, /* R649 - Headphone Detect 2 */ | 749 | { 0x0289, 0x0000 }, /* R649 - Headphone Detect 2 */ |
833 | [0x0290] = 0x1100, /* R656 - Mic Detect 1 */ | 750 | { 0x0290, 0x1100 }, /* R656 - Mic Detect 1 */ |
834 | [0x0291] = 0x009F, /* R657 - Mic Detect 2 */ | 751 | { 0x0291, 0x009F }, /* R657 - Mic Detect 2 */ |
835 | [0x0292] = 0x0000, /* R658 - Mic Detect 3 */ | 752 | { 0x0292, 0x0000 }, /* R658 - Mic Detect 3 */ |
836 | [0x0301] = 0x0000, /* R769 - Input Enables */ | 753 | { 0x0301, 0x0000 }, /* R769 - Input Enables */ |
837 | [0x0302] = 0x0000, /* R770 - Input Enables Status */ | 754 | { 0x0302, 0x0000 }, /* R770 - Input Enables Status */ |
838 | [0x0310] = 0x2280, /* R784 - Status */ | 755 | { 0x0310, 0x2280 }, /* R784 - Status */ |
839 | [0x0311] = 0x0080, /* R785 - IN1R Control */ | 756 | { 0x0311, 0x0080 }, /* R785 - IN1R Control */ |
840 | [0x0312] = 0x2280, /* R786 - IN2L Control */ | 757 | { 0x0312, 0x2280 }, /* R786 - IN2L Control */ |
841 | [0x0313] = 0x0080, /* R787 - IN2R Control */ | 758 | { 0x0313, 0x0080 }, /* R787 - IN2R Control */ |
842 | [0x0314] = 0x2280, /* R788 - IN3L Control */ | 759 | { 0x0314, 0x2280 }, /* R788 - IN3L Control */ |
843 | [0x0315] = 0x0080, /* R789 - IN3R Control */ | 760 | { 0x0315, 0x0080 }, /* R789 - IN3R Control */ |
844 | [0x0316] = 0x2280, /* R790 - IN4L Control */ | 761 | { 0x0316, 0x2280 }, /* R790 - IN4L Control */ |
845 | [0x0317] = 0x0080, /* R791 - IN4R Control */ | 762 | { 0x0317, 0x0080 }, /* R791 - IN4R Control */ |
846 | [0x0318] = 0x0000, /* R792 - RXANC_SRC */ | 763 | { 0x0318, 0x0000 }, /* R792 - RXANC_SRC */ |
847 | [0x0319] = 0x0022, /* R793 - Input Volume Ramp */ | 764 | { 0x0319, 0x0022 }, /* R793 - Input Volume Ramp */ |
848 | [0x0320] = 0x0180, /* R800 - ADC Digital Volume 1L */ | 765 | { 0x0320, 0x0180 }, /* R800 - ADC Digital Volume 1L */ |
849 | [0x0321] = 0x0180, /* R801 - ADC Digital Volume 1R */ | 766 | { 0x0321, 0x0180 }, /* R801 - ADC Digital Volume 1R */ |
850 | [0x0322] = 0x0180, /* R802 - ADC Digital Volume 2L */ | 767 | { 0x0322, 0x0180 }, /* R802 - ADC Digital Volume 2L */ |
851 | [0x0323] = 0x0180, /* R803 - ADC Digital Volume 2R */ | 768 | { 0x0323, 0x0180 }, /* R803 - ADC Digital Volume 2R */ |
852 | [0x0324] = 0x0180, /* R804 - ADC Digital Volume 3L */ | 769 | { 0x0324, 0x0180 }, /* R804 - ADC Digital Volume 3L */ |
853 | [0x0325] = 0x0180, /* R805 - ADC Digital Volume 3R */ | 770 | { 0x0325, 0x0180 }, /* R805 - ADC Digital Volume 3R */ |
854 | [0x0326] = 0x0180, /* R806 - ADC Digital Volume 4L */ | 771 | { 0x0326, 0x0180 }, /* R806 - ADC Digital Volume 4L */ |
855 | [0x0327] = 0x0180, /* R807 - ADC Digital Volume 4R */ | 772 | { 0x0327, 0x0180 }, /* R807 - ADC Digital Volume 4R */ |
856 | [0x0401] = 0x0000, /* R1025 - Output Enables 2 */ | 773 | { 0x0401, 0x0000 }, /* R1025 - Output Enables 2 */ |
857 | [0x0402] = 0x0000, /* R1026 - Output Status 1 */ | 774 | { 0x0402, 0x0000 }, /* R1026 - Output Status 1 */ |
858 | [0x0403] = 0x0000, /* R1027 - Output Status 2 */ | 775 | { 0x0403, 0x0000 }, /* R1027 - Output Status 2 */ |
859 | [0x0408] = 0x0000, /* R1032 - Channel Enables 1 */ | 776 | { 0x0408, 0x0000 }, /* R1032 - Channel Enables 1 */ |
860 | [0x0410] = 0x0080, /* R1040 - Out Volume 1L */ | 777 | { 0x0410, 0x0080 }, /* R1040 - Out Volume 1L */ |
861 | [0x0411] = 0x0080, /* R1041 - Out Volume 1R */ | 778 | { 0x0411, 0x0080 }, /* R1041 - Out Volume 1R */ |
862 | [0x0412] = 0x0080, /* R1042 - DAC Volume Limit 1L */ | 779 | { 0x0412, 0x0080 }, /* R1042 - DAC Volume Limit 1L */ |
863 | [0x0413] = 0x0080, /* R1043 - DAC Volume Limit 1R */ | 780 | { 0x0413, 0x0080 }, /* R1043 - DAC Volume Limit 1R */ |
864 | [0x0414] = 0x0080, /* R1044 - Out Volume 2L */ | 781 | { 0x0414, 0x0080 }, /* R1044 - Out Volume 2L */ |
865 | [0x0415] = 0x0080, /* R1045 - Out Volume 2R */ | 782 | { 0x0415, 0x0080 }, /* R1045 - Out Volume 2R */ |
866 | [0x0416] = 0x0080, /* R1046 - DAC Volume Limit 2L */ | 783 | { 0x0416, 0x0080 }, /* R1046 - DAC Volume Limit 2L */ |
867 | [0x0417] = 0x0080, /* R1047 - DAC Volume Limit 2R */ | 784 | { 0x0417, 0x0080 }, /* R1047 - DAC Volume Limit 2R */ |
868 | [0x0418] = 0x0080, /* R1048 - Out Volume 3L */ | 785 | { 0x0418, 0x0080 }, /* R1048 - Out Volume 3L */ |
869 | [0x0419] = 0x0080, /* R1049 - Out Volume 3R */ | 786 | { 0x0419, 0x0080 }, /* R1049 - Out Volume 3R */ |
870 | [0x041A] = 0x0080, /* R1050 - DAC Volume Limit 3L */ | 787 | { 0x041A, 0x0080 }, /* R1050 - DAC Volume Limit 3L */ |
871 | [0x041B] = 0x0080, /* R1051 - DAC Volume Limit 3R */ | 788 | { 0x041B, 0x0080 }, /* R1051 - DAC Volume Limit 3R */ |
872 | [0x041C] = 0x0080, /* R1052 - Out Volume 4L */ | 789 | { 0x041C, 0x0080 }, /* R1052 - Out Volume 4L */ |
873 | [0x041D] = 0x0080, /* R1053 - Out Volume 4R */ | 790 | { 0x041D, 0x0080 }, /* R1053 - Out Volume 4R */ |
874 | [0x041E] = 0x0080, /* R1054 - DAC Volume Limit 5L */ | 791 | { 0x041E, 0x0080 }, /* R1054 - DAC Volume Limit 5L */ |
875 | [0x041F] = 0x0080, /* R1055 - DAC Volume Limit 5R */ | 792 | { 0x041F, 0x0080 }, /* R1055 - DAC Volume Limit 5R */ |
876 | [0x0420] = 0x0080, /* R1056 - DAC Volume Limit 6L */ | 793 | { 0x0420, 0x0080 }, /* R1056 - DAC Volume Limit 6L */ |
877 | [0x0421] = 0x0080, /* R1057 - DAC Volume Limit 6R */ | 794 | { 0x0421, 0x0080 }, /* R1057 - DAC Volume Limit 6R */ |
878 | [0x0440] = 0x0000, /* R1088 - DAC AEC Control 1 */ | 795 | { 0x0440, 0x0000 }, /* R1088 - DAC AEC Control 1 */ |
879 | [0x0441] = 0x0022, /* R1089 - Output Volume Ramp */ | 796 | { 0x0441, 0x0022 }, /* R1089 - Output Volume Ramp */ |
880 | [0x0480] = 0x0180, /* R1152 - DAC Digital Volume 1L */ | 797 | { 0x0480, 0x0180 }, /* R1152 - DAC Digital Volume 1L */ |
881 | [0x0481] = 0x0180, /* R1153 - DAC Digital Volume 1R */ | 798 | { 0x0481, 0x0180 }, /* R1153 - DAC Digital Volume 1R */ |
882 | [0x0482] = 0x0180, /* R1154 - DAC Digital Volume 2L */ | 799 | { 0x0482, 0x0180 }, /* R1154 - DAC Digital Volume 2L */ |
883 | [0x0483] = 0x0180, /* R1155 - DAC Digital Volume 2R */ | 800 | { 0x0483, 0x0180 }, /* R1155 - DAC Digital Volume 2R */ |
884 | [0x0484] = 0x0180, /* R1156 - DAC Digital Volume 3L */ | 801 | { 0x0484, 0x0180 }, /* R1156 - DAC Digital Volume 3L */ |
885 | [0x0485] = 0x0180, /* R1157 - DAC Digital Volume 3R */ | 802 | { 0x0485, 0x0180 }, /* R1157 - DAC Digital Volume 3R */ |
886 | [0x0486] = 0x0180, /* R1158 - DAC Digital Volume 4L */ | 803 | { 0x0486, 0x0180 }, /* R1158 - DAC Digital Volume 4L */ |
887 | [0x0487] = 0x0180, /* R1159 - DAC Digital Volume 4R */ | 804 | { 0x0487, 0x0180 }, /* R1159 - DAC Digital Volume 4R */ |
888 | [0x0488] = 0x0180, /* R1160 - DAC Digital Volume 5L */ | 805 | { 0x0488, 0x0180 }, /* R1160 - DAC Digital Volume 5L */ |
889 | [0x0489] = 0x0180, /* R1161 - DAC Digital Volume 5R */ | 806 | { 0x0489, 0x0180 }, /* R1161 - DAC Digital Volume 5R */ |
890 | [0x048A] = 0x0180, /* R1162 - DAC Digital Volume 6L */ | 807 | { 0x048A, 0x0180 }, /* R1162 - DAC Digital Volume 6L */ |
891 | [0x048B] = 0x0180, /* R1163 - DAC Digital Volume 6R */ | 808 | { 0x048B, 0x0180 }, /* R1163 - DAC Digital Volume 6R */ |
892 | [0x04C0] = 0x0069, /* R1216 - PDM SPK1 CTRL 1 */ | 809 | { 0x04C0, 0x0069 }, /* R1216 - PDM SPK1 CTRL 1 */ |
893 | [0x04C1] = 0x0000, /* R1217 - PDM SPK1 CTRL 2 */ | 810 | { 0x04C1, 0x0000 }, /* R1217 - PDM SPK1 CTRL 2 */ |
894 | [0x04C2] = 0x0069, /* R1218 - PDM SPK2 CTRL 1 */ | 811 | { 0x04C2, 0x0069 }, /* R1218 - PDM SPK2 CTRL 1 */ |
895 | [0x04C3] = 0x0000, /* R1219 - PDM SPK2 CTRL 2 */ | 812 | { 0x04C3, 0x0000 }, /* R1219 - PDM SPK2 CTRL 2 */ |
896 | [0x0500] = 0x000C, /* R1280 - Audio IF 1_1 */ | 813 | { 0x0500, 0x000C }, /* R1280 - Audio IF 1_1 */ |
897 | [0x0501] = 0x0008, /* R1281 - Audio IF 1_2 */ | 814 | { 0x0501, 0x0008 }, /* R1281 - Audio IF 1_2 */ |
898 | [0x0502] = 0x0000, /* R1282 - Audio IF 1_3 */ | 815 | { 0x0502, 0x0000 }, /* R1282 - Audio IF 1_3 */ |
899 | [0x0503] = 0x0000, /* R1283 - Audio IF 1_4 */ | 816 | { 0x0503, 0x0000 }, /* R1283 - Audio IF 1_4 */ |
900 | [0x0504] = 0x0000, /* R1284 - Audio IF 1_5 */ | 817 | { 0x0504, 0x0000 }, /* R1284 - Audio IF 1_5 */ |
901 | [0x0505] = 0x0300, /* R1285 - Audio IF 1_6 */ | 818 | { 0x0505, 0x0300 }, /* R1285 - Audio IF 1_6 */ |
902 | [0x0506] = 0x0300, /* R1286 - Audio IF 1_7 */ | 819 | { 0x0506, 0x0300 }, /* R1286 - Audio IF 1_7 */ |
903 | [0x0507] = 0x1820, /* R1287 - Audio IF 1_8 */ | 820 | { 0x0507, 0x1820 }, /* R1287 - Audio IF 1_8 */ |
904 | [0x0508] = 0x1820, /* R1288 - Audio IF 1_9 */ | 821 | { 0x0508, 0x1820 }, /* R1288 - Audio IF 1_9 */ |
905 | [0x0509] = 0x0000, /* R1289 - Audio IF 1_10 */ | 822 | { 0x0509, 0x0000 }, /* R1289 - Audio IF 1_10 */ |
906 | [0x050A] = 0x0001, /* R1290 - Audio IF 1_11 */ | 823 | { 0x050A, 0x0001 }, /* R1290 - Audio IF 1_11 */ |
907 | [0x050B] = 0x0002, /* R1291 - Audio IF 1_12 */ | 824 | { 0x050B, 0x0002 }, /* R1291 - Audio IF 1_12 */ |
908 | [0x050C] = 0x0003, /* R1292 - Audio IF 1_13 */ | 825 | { 0x050C, 0x0003 }, /* R1292 - Audio IF 1_13 */ |
909 | [0x050D] = 0x0004, /* R1293 - Audio IF 1_14 */ | 826 | { 0x050D, 0x0004 }, /* R1293 - Audio IF 1_14 */ |
910 | [0x050E] = 0x0005, /* R1294 - Audio IF 1_15 */ | 827 | { 0x050E, 0x0005 }, /* R1294 - Audio IF 1_15 */ |
911 | [0x050F] = 0x0006, /* R1295 - Audio IF 1_16 */ | 828 | { 0x050F, 0x0006 }, /* R1295 - Audio IF 1_16 */ |
912 | [0x0510] = 0x0007, /* R1296 - Audio IF 1_17 */ | 829 | { 0x0510, 0x0007 }, /* R1296 - Audio IF 1_17 */ |
913 | [0x0511] = 0x0000, /* R1297 - Audio IF 1_18 */ | 830 | { 0x0511, 0x0000 }, /* R1297 - Audio IF 1_18 */ |
914 | [0x0512] = 0x0001, /* R1298 - Audio IF 1_19 */ | 831 | { 0x0512, 0x0001 }, /* R1298 - Audio IF 1_19 */ |
915 | [0x0513] = 0x0002, /* R1299 - Audio IF 1_20 */ | 832 | { 0x0513, 0x0002 }, /* R1299 - Audio IF 1_20 */ |
916 | [0x0514] = 0x0003, /* R1300 - Audio IF 1_21 */ | 833 | { 0x0514, 0x0003 }, /* R1300 - Audio IF 1_21 */ |
917 | [0x0515] = 0x0004, /* R1301 - Audio IF 1_22 */ | 834 | { 0x0515, 0x0004 }, /* R1301 - Audio IF 1_22 */ |
918 | [0x0516] = 0x0005, /* R1302 - Audio IF 1_23 */ | 835 | { 0x0516, 0x0005 }, /* R1302 - Audio IF 1_23 */ |
919 | [0x0517] = 0x0006, /* R1303 - Audio IF 1_24 */ | 836 | { 0x0517, 0x0006 }, /* R1303 - Audio IF 1_24 */ |
920 | [0x0518] = 0x0007, /* R1304 - Audio IF 1_25 */ | 837 | { 0x0518, 0x0007 }, /* R1304 - Audio IF 1_25 */ |
921 | [0x0519] = 0x0000, /* R1305 - Audio IF 1_26 */ | 838 | { 0x0519, 0x0000 }, /* R1305 - Audio IF 1_26 */ |
922 | [0x051A] = 0x0000, /* R1306 - Audio IF 1_27 */ | 839 | { 0x051A, 0x0000 }, /* R1306 - Audio IF 1_27 */ |
923 | [0x0540] = 0x000C, /* R1344 - Audio IF 2_1 */ | 840 | { 0x0540, 0x000C }, /* R1344 - Audio IF 2_1 */ |
924 | [0x0541] = 0x0008, /* R1345 - Audio IF 2_2 */ | 841 | { 0x0541, 0x0008 }, /* R1345 - Audio IF 2_2 */ |
925 | [0x0542] = 0x0000, /* R1346 - Audio IF 2_3 */ | 842 | { 0x0542, 0x0000 }, /* R1346 - Audio IF 2_3 */ |
926 | [0x0543] = 0x0000, /* R1347 - Audio IF 2_4 */ | 843 | { 0x0543, 0x0000 }, /* R1347 - Audio IF 2_4 */ |
927 | [0x0544] = 0x0000, /* R1348 - Audio IF 2_5 */ | 844 | { 0x0544, 0x0000 }, /* R1348 - Audio IF 2_5 */ |
928 | [0x0545] = 0x0300, /* R1349 - Audio IF 2_6 */ | 845 | { 0x0545, 0x0300 }, /* R1349 - Audio IF 2_6 */ |
929 | [0x0546] = 0x0300, /* R1350 - Audio IF 2_7 */ | 846 | { 0x0546, 0x0300 }, /* R1350 - Audio IF 2_7 */ |
930 | [0x0547] = 0x1820, /* R1351 - Audio IF 2_8 */ | 847 | { 0x0547, 0x1820 }, /* R1351 - Audio IF 2_8 */ |
931 | [0x0548] = 0x1820, /* R1352 - Audio IF 2_9 */ | 848 | { 0x0548, 0x1820 }, /* R1352 - Audio IF 2_9 */ |
932 | [0x0549] = 0x0000, /* R1353 - Audio IF 2_10 */ | 849 | { 0x0549, 0x0000 }, /* R1353 - Audio IF 2_10 */ |
933 | [0x054A] = 0x0001, /* R1354 - Audio IF 2_11 */ | 850 | { 0x054A, 0x0001 }, /* R1354 - Audio IF 2_11 */ |
934 | [0x0551] = 0x0000, /* R1361 - Audio IF 2_18 */ | 851 | { 0x0551, 0x0000 }, /* R1361 - Audio IF 2_18 */ |
935 | [0x0552] = 0x0001, /* R1362 - Audio IF 2_19 */ | 852 | { 0x0552, 0x0001 }, /* R1362 - Audio IF 2_19 */ |
936 | [0x0559] = 0x0000, /* R1369 - Audio IF 2_26 */ | 853 | { 0x0559, 0x0000 }, /* R1369 - Audio IF 2_26 */ |
937 | [0x055A] = 0x0000, /* R1370 - Audio IF 2_27 */ | 854 | { 0x055A, 0x0000 }, /* R1370 - Audio IF 2_27 */ |
938 | [0x0580] = 0x000C, /* R1408 - Audio IF 3_1 */ | 855 | { 0x0580, 0x000C }, /* R1408 - Audio IF 3_1 */ |
939 | [0x0581] = 0x0008, /* R1409 - Audio IF 3_2 */ | 856 | { 0x0581, 0x0008 }, /* R1409 - Audio IF 3_2 */ |
940 | [0x0582] = 0x0000, /* R1410 - Audio IF 3_3 */ | 857 | { 0x0582, 0x0000 }, /* R1410 - Audio IF 3_3 */ |
941 | [0x0583] = 0x0000, /* R1411 - Audio IF 3_4 */ | 858 | { 0x0583, 0x0000 }, /* R1411 - Audio IF 3_4 */ |
942 | [0x0584] = 0x0000, /* R1412 - Audio IF 3_5 */ | 859 | { 0x0584, 0x0000 }, /* R1412 - Audio IF 3_5 */ |
943 | [0x0585] = 0x0300, /* R1413 - Audio IF 3_6 */ | 860 | { 0x0585, 0x0300 }, /* R1413 - Audio IF 3_6 */ |
944 | [0x0586] = 0x0300, /* R1414 - Audio IF 3_7 */ | 861 | { 0x0586, 0x0300 }, /* R1414 - Audio IF 3_7 */ |
945 | [0x0587] = 0x1820, /* R1415 - Audio IF 3_8 */ | 862 | { 0x0587, 0x1820 }, /* R1415 - Audio IF 3_8 */ |
946 | [0x0588] = 0x1820, /* R1416 - Audio IF 3_9 */ | 863 | { 0x0588, 0x1820 }, /* R1416 - Audio IF 3_9 */ |
947 | [0x0589] = 0x0000, /* R1417 - Audio IF 3_10 */ | 864 | { 0x0589, 0x0000 }, /* R1417 - Audio IF 3_10 */ |
948 | [0x058A] = 0x0001, /* R1418 - Audio IF 3_11 */ | 865 | { 0x058A, 0x0001 }, /* R1418 - Audio IF 3_11 */ |
949 | [0x0591] = 0x0000, /* R1425 - Audio IF 3_18 */ | 866 | { 0x0591, 0x0000 }, /* R1425 - Audio IF 3_18 */ |
950 | [0x0592] = 0x0001, /* R1426 - Audio IF 3_19 */ | 867 | { 0x0592, 0x0001 }, /* R1426 - Audio IF 3_19 */ |
951 | [0x0599] = 0x0000, /* R1433 - Audio IF 3_26 */ | 868 | { 0x0599, 0x0000 }, /* R1433 - Audio IF 3_26 */ |
952 | [0x059A] = 0x0000, /* R1434 - Audio IF 3_27 */ | 869 | { 0x059A, 0x0000 }, /* R1434 - Audio IF 3_27 */ |
953 | [0x0640] = 0x0000, /* R1600 - PWM1MIX Input 1 Source */ | 870 | { 0x0640, 0x0000 }, /* R1600 - PWM1MIX Input 1 Source */ |
954 | [0x0641] = 0x0080, /* R1601 - PWM1MIX Input 1 Volume */ | 871 | { 0x0641, 0x0080 }, /* R1601 - PWM1MIX Input 1 Volume */ |
955 | [0x0642] = 0x0000, /* R1602 - PWM1MIX Input 2 Source */ | 872 | { 0x0642, 0x0000 }, /* R1602 - PWM1MIX Input 2 Source */ |
956 | [0x0643] = 0x0080, /* R1603 - PWM1MIX Input 2 Volume */ | 873 | { 0x0643, 0x0080 }, /* R1603 - PWM1MIX Input 2 Volume */ |
957 | [0x0644] = 0x0000, /* R1604 - PWM1MIX Input 3 Source */ | 874 | { 0x0644, 0x0000 }, /* R1604 - PWM1MIX Input 3 Source */ |
958 | [0x0645] = 0x0080, /* R1605 - PWM1MIX Input 3 Volume */ | 875 | { 0x0645, 0x0080 }, /* R1605 - PWM1MIX Input 3 Volume */ |
959 | [0x0646] = 0x0000, /* R1606 - PWM1MIX Input 4 Source */ | 876 | { 0x0646, 0x0000 }, /* R1606 - PWM1MIX Input 4 Source */ |
960 | [0x0647] = 0x0080, /* R1607 - PWM1MIX Input 4 Volume */ | 877 | { 0x0647, 0x0080 }, /* R1607 - PWM1MIX Input 4 Volume */ |
961 | [0x0648] = 0x0000, /* R1608 - PWM2MIX Input 1 Source */ | 878 | { 0x0648, 0x0000 }, /* R1608 - PWM2MIX Input 1 Source */ |
962 | [0x0649] = 0x0080, /* R1609 - PWM2MIX Input 1 Volume */ | 879 | { 0x0649, 0x0080 }, /* R1609 - PWM2MIX Input 1 Volume */ |
963 | [0x064A] = 0x0000, /* R1610 - PWM2MIX Input 2 Source */ | 880 | { 0x064A, 0x0000 }, /* R1610 - PWM2MIX Input 2 Source */ |
964 | [0x064B] = 0x0080, /* R1611 - PWM2MIX Input 2 Volume */ | 881 | { 0x064B, 0x0080 }, /* R1611 - PWM2MIX Input 2 Volume */ |
965 | [0x064C] = 0x0000, /* R1612 - PWM2MIX Input 3 Source */ | 882 | { 0x064C, 0x0000 }, /* R1612 - PWM2MIX Input 3 Source */ |
966 | [0x064D] = 0x0080, /* R1613 - PWM2MIX Input 3 Volume */ | 883 | { 0x064D, 0x0080 }, /* R1613 - PWM2MIX Input 3 Volume */ |
967 | [0x064E] = 0x0000, /* R1614 - PWM2MIX Input 4 Source */ | 884 | { 0x064E, 0x0000 }, /* R1614 - PWM2MIX Input 4 Source */ |
968 | [0x064F] = 0x0080, /* R1615 - PWM2MIX Input 4 Volume */ | 885 | { 0x064F, 0x0080 }, /* R1615 - PWM2MIX Input 4 Volume */ |
969 | [0x0680] = 0x0000, /* R1664 - OUT1LMIX Input 1 Source */ | 886 | { 0x0680, 0x0000 }, /* R1664 - OUT1LMIX Input 1 Source */ |
970 | [0x0681] = 0x0080, /* R1665 - OUT1LMIX Input 1 Volume */ | 887 | { 0x0681, 0x0080 }, /* R1665 - OUT1LMIX Input 1 Volume */ |
971 | [0x0682] = 0x0000, /* R1666 - OUT1LMIX Input 2 Source */ | 888 | { 0x0682, 0x0000 }, /* R1666 - OUT1LMIX Input 2 Source */ |
972 | [0x0683] = 0x0080, /* R1667 - OUT1LMIX Input 2 Volume */ | 889 | { 0x0683, 0x0080 }, /* R1667 - OUT1LMIX Input 2 Volume */ |
973 | [0x0684] = 0x0000, /* R1668 - OUT1LMIX Input 3 Source */ | 890 | { 0x0684, 0x0000 }, /* R1668 - OUT1LMIX Input 3 Source */ |
974 | [0x0685] = 0x0080, /* R1669 - OUT1LMIX Input 3 Volume */ | 891 | { 0x0685, 0x0080 }, /* R1669 - OUT1LMIX Input 3 Volume */ |
975 | [0x0686] = 0x0000, /* R1670 - OUT1LMIX Input 4 Source */ | 892 | { 0x0686, 0x0000 }, /* R1670 - OUT1LMIX Input 4 Source */ |
976 | [0x0687] = 0x0080, /* R1671 - OUT1LMIX Input 4 Volume */ | 893 | { 0x0687, 0x0080 }, /* R1671 - OUT1LMIX Input 4 Volume */ |
977 | [0x0688] = 0x0000, /* R1672 - OUT1RMIX Input 1 Source */ | 894 | { 0x0688, 0x0000 }, /* R1672 - OUT1RMIX Input 1 Source */ |
978 | [0x0689] = 0x0080, /* R1673 - OUT1RMIX Input 1 Volume */ | 895 | { 0x0689, 0x0080 }, /* R1673 - OUT1RMIX Input 1 Volume */ |
979 | [0x068A] = 0x0000, /* R1674 - OUT1RMIX Input 2 Source */ | 896 | { 0x068A, 0x0000 }, /* R1674 - OUT1RMIX Input 2 Source */ |
980 | [0x068B] = 0x0080, /* R1675 - OUT1RMIX Input 2 Volume */ | 897 | { 0x068B, 0x0080 }, /* R1675 - OUT1RMIX Input 2 Volume */ |
981 | [0x068C] = 0x0000, /* R1676 - OUT1RMIX Input 3 Source */ | 898 | { 0x068C, 0x0000 }, /* R1676 - OUT1RMIX Input 3 Source */ |
982 | [0x068D] = 0x0080, /* R1677 - OUT1RMIX Input 3 Volume */ | 899 | { 0x068D, 0x0080 }, /* R1677 - OUT1RMIX Input 3 Volume */ |
983 | [0x068E] = 0x0000, /* R1678 - OUT1RMIX Input 4 Source */ | 900 | { 0x068E, 0x0000 }, /* R1678 - OUT1RMIX Input 4 Source */ |
984 | [0x068F] = 0x0080, /* R1679 - OUT1RMIX Input 4 Volume */ | 901 | { 0x068F, 0x0080 }, /* R1679 - OUT1RMIX Input 4 Volume */ |
985 | [0x0690] = 0x0000, /* R1680 - OUT2LMIX Input 1 Source */ | 902 | { 0x0690, 0x0000 }, /* R1680 - OUT2LMIX Input 1 Source */ |
986 | [0x0691] = 0x0080, /* R1681 - OUT2LMIX Input 1 Volume */ | 903 | { 0x0691, 0x0080 }, /* R1681 - OUT2LMIX Input 1 Volume */ |
987 | [0x0692] = 0x0000, /* R1682 - OUT2LMIX Input 2 Source */ | 904 | { 0x0692, 0x0000 }, /* R1682 - OUT2LMIX Input 2 Source */ |
988 | [0x0693] = 0x0080, /* R1683 - OUT2LMIX Input 2 Volume */ | 905 | { 0x0693, 0x0080 }, /* R1683 - OUT2LMIX Input 2 Volume */ |
989 | [0x0694] = 0x0000, /* R1684 - OUT2LMIX Input 3 Source */ | 906 | { 0x0694, 0x0000 }, /* R1684 - OUT2LMIX Input 3 Source */ |
990 | [0x0695] = 0x0080, /* R1685 - OUT2LMIX Input 3 Volume */ | 907 | { 0x0695, 0x0080 }, /* R1685 - OUT2LMIX Input 3 Volume */ |
991 | [0x0696] = 0x0000, /* R1686 - OUT2LMIX Input 4 Source */ | 908 | { 0x0696, 0x0000 }, /* R1686 - OUT2LMIX Input 4 Source */ |
992 | [0x0697] = 0x0080, /* R1687 - OUT2LMIX Input 4 Volume */ | 909 | { 0x0697, 0x0080 }, /* R1687 - OUT2LMIX Input 4 Volume */ |
993 | [0x0698] = 0x0000, /* R1688 - OUT2RMIX Input 1 Source */ | 910 | { 0x0698, 0x0000 }, /* R1688 - OUT2RMIX Input 1 Source */ |
994 | [0x0699] = 0x0080, /* R1689 - OUT2RMIX Input 1 Volume */ | 911 | { 0x0699, 0x0080 }, /* R1689 - OUT2RMIX Input 1 Volume */ |
995 | [0x069A] = 0x0000, /* R1690 - OUT2RMIX Input 2 Source */ | 912 | { 0x069A, 0x0000 }, /* R1690 - OUT2RMIX Input 2 Source */ |
996 | [0x069B] = 0x0080, /* R1691 - OUT2RMIX Input 2 Volume */ | 913 | { 0x069B, 0x0080 }, /* R1691 - OUT2RMIX Input 2 Volume */ |
997 | [0x069C] = 0x0000, /* R1692 - OUT2RMIX Input 3 Source */ | 914 | { 0x069C, 0x0000 }, /* R1692 - OUT2RMIX Input 3 Source */ |
998 | [0x069D] = 0x0080, /* R1693 - OUT2RMIX Input 3 Volume */ | 915 | { 0x069D, 0x0080 }, /* R1693 - OUT2RMIX Input 3 Volume */ |
999 | [0x069E] = 0x0000, /* R1694 - OUT2RMIX Input 4 Source */ | 916 | { 0x069E, 0x0000 }, /* R1694 - OUT2RMIX Input 4 Source */ |
1000 | [0x069F] = 0x0080, /* R1695 - OUT2RMIX Input 4 Volume */ | 917 | { 0x069F, 0x0080 }, /* R1695 - OUT2RMIX Input 4 Volume */ |
1001 | [0x06A0] = 0x0000, /* R1696 - OUT3LMIX Input 1 Source */ | 918 | { 0x06A0, 0x0000 }, /* R1696 - OUT3LMIX Input 1 Source */ |
1002 | [0x06A1] = 0x0080, /* R1697 - OUT3LMIX Input 1 Volume */ | 919 | { 0x06A1, 0x0080 }, /* R1697 - OUT3LMIX Input 1 Volume */ |
1003 | [0x06A2] = 0x0000, /* R1698 - OUT3LMIX Input 2 Source */ | 920 | { 0x06A2, 0x0000 }, /* R1698 - OUT3LMIX Input 2 Source */ |
1004 | [0x06A3] = 0x0080, /* R1699 - OUT3LMIX Input 2 Volume */ | 921 | { 0x06A3, 0x0080 }, /* R1699 - OUT3LMIX Input 2 Volume */ |
1005 | [0x06A4] = 0x0000, /* R1700 - OUT3LMIX Input 3 Source */ | 922 | { 0x06A4, 0x0000 }, /* R1700 - OUT3LMIX Input 3 Source */ |
1006 | [0x06A5] = 0x0080, /* R1701 - OUT3LMIX Input 3 Volume */ | 923 | { 0x06A5, 0x0080 }, /* R1701 - OUT3LMIX Input 3 Volume */ |
1007 | [0x06A6] = 0x0000, /* R1702 - OUT3LMIX Input 4 Source */ | 924 | { 0x06A6, 0x0000 }, /* R1702 - OUT3LMIX Input 4 Source */ |
1008 | [0x06A7] = 0x0080, /* R1703 - OUT3LMIX Input 4 Volume */ | 925 | { 0x06A7, 0x0080 }, /* R1703 - OUT3LMIX Input 4 Volume */ |
1009 | [0x06A8] = 0x0000, /* R1704 - OUT3RMIX Input 1 Source */ | 926 | { 0x06A8, 0x0000 }, /* R1704 - OUT3RMIX Input 1 Source */ |
1010 | [0x06A9] = 0x0080, /* R1705 - OUT3RMIX Input 1 Volume */ | 927 | { 0x06A9, 0x0080 }, /* R1705 - OUT3RMIX Input 1 Volume */ |
1011 | [0x06AA] = 0x0000, /* R1706 - OUT3RMIX Input 2 Source */ | 928 | { 0x06AA, 0x0000 }, /* R1706 - OUT3RMIX Input 2 Source */ |
1012 | [0x06AB] = 0x0080, /* R1707 - OUT3RMIX Input 2 Volume */ | 929 | { 0x06AB, 0x0080 }, /* R1707 - OUT3RMIX Input 2 Volume */ |
1013 | [0x06AC] = 0x0000, /* R1708 - OUT3RMIX Input 3 Source */ | 930 | { 0x06AC, 0x0000 }, /* R1708 - OUT3RMIX Input 3 Source */ |
1014 | [0x06AD] = 0x0080, /* R1709 - OUT3RMIX Input 3 Volume */ | 931 | { 0x06AD, 0x0080 }, /* R1709 - OUT3RMIX Input 3 Volume */ |
1015 | [0x06AE] = 0x0000, /* R1710 - OUT3RMIX Input 4 Source */ | 932 | { 0x06AE, 0x0000 }, /* R1710 - OUT3RMIX Input 4 Source */ |
1016 | [0x06AF] = 0x0080, /* R1711 - OUT3RMIX Input 4 Volume */ | 933 | { 0x06AF, 0x0080 }, /* R1711 - OUT3RMIX Input 4 Volume */ |
1017 | [0x06B0] = 0x0000, /* R1712 - OUT4LMIX Input 1 Source */ | 934 | { 0x06B0, 0x0000 }, /* R1712 - OUT4LMIX Input 1 Source */ |
1018 | [0x06B1] = 0x0080, /* R1713 - OUT4LMIX Input 1 Volume */ | 935 | { 0x06B1, 0x0080 }, /* R1713 - OUT4LMIX Input 1 Volume */ |
1019 | [0x06B2] = 0x0000, /* R1714 - OUT4LMIX Input 2 Source */ | 936 | { 0x06B2, 0x0000 }, /* R1714 - OUT4LMIX Input 2 Source */ |
1020 | [0x06B3] = 0x0080, /* R1715 - OUT4LMIX Input 2 Volume */ | 937 | { 0x06B3, 0x0080 }, /* R1715 - OUT4LMIX Input 2 Volume */ |
1021 | [0x06B4] = 0x0000, /* R1716 - OUT4LMIX Input 3 Source */ | 938 | { 0x06B4, 0x0000 }, /* R1716 - OUT4LMIX Input 3 Source */ |
1022 | [0x06B5] = 0x0080, /* R1717 - OUT4LMIX Input 3 Volume */ | 939 | { 0x06B5, 0x0080 }, /* R1717 - OUT4LMIX Input 3 Volume */ |
1023 | [0x06B6] = 0x0000, /* R1718 - OUT4LMIX Input 4 Source */ | 940 | { 0x06B6, 0x0000 }, /* R1718 - OUT4LMIX Input 4 Source */ |
1024 | [0x06B7] = 0x0080, /* R1719 - OUT4LMIX Input 4 Volume */ | 941 | { 0x06B7, 0x0080 }, /* R1719 - OUT4LMIX Input 4 Volume */ |
1025 | [0x06B8] = 0x0000, /* R1720 - OUT4RMIX Input 1 Source */ | 942 | { 0x06B8, 0x0000 }, /* R1720 - OUT4RMIX Input 1 Source */ |
1026 | [0x06B9] = 0x0080, /* R1721 - OUT4RMIX Input 1 Volume */ | 943 | { 0x06B9, 0x0080 }, /* R1721 - OUT4RMIX Input 1 Volume */ |
1027 | [0x06BA] = 0x0000, /* R1722 - OUT4RMIX Input 2 Source */ | 944 | { 0x06BA, 0x0000 }, /* R1722 - OUT4RMIX Input 2 Source */ |
1028 | [0x06BB] = 0x0080, /* R1723 - OUT4RMIX Input 2 Volume */ | 945 | { 0x06BB, 0x0080 }, /* R1723 - OUT4RMIX Input 2 Volume */ |
1029 | [0x06BC] = 0x0000, /* R1724 - OUT4RMIX Input 3 Source */ | 946 | { 0x06BC, 0x0000 }, /* R1724 - OUT4RMIX Input 3 Source */ |
1030 | [0x06BD] = 0x0080, /* R1725 - OUT4RMIX Input 3 Volume */ | 947 | { 0x06BD, 0x0080 }, /* R1725 - OUT4RMIX Input 3 Volume */ |
1031 | [0x06BE] = 0x0000, /* R1726 - OUT4RMIX Input 4 Source */ | 948 | { 0x06BE, 0x0000 }, /* R1726 - OUT4RMIX Input 4 Source */ |
1032 | [0x06BF] = 0x0080, /* R1727 - OUT4RMIX Input 4 Volume */ | 949 | { 0x06BF, 0x0080 }, /* R1727 - OUT4RMIX Input 4 Volume */ |
1033 | [0x06C0] = 0x0000, /* R1728 - OUT5LMIX Input 1 Source */ | 950 | { 0x06C0, 0x0000 }, /* R1728 - OUT5LMIX Input 1 Source */ |
1034 | [0x06C1] = 0x0080, /* R1729 - OUT5LMIX Input 1 Volume */ | 951 | { 0x06C1, 0x0080 }, /* R1729 - OUT5LMIX Input 1 Volume */ |
1035 | [0x06C2] = 0x0000, /* R1730 - OUT5LMIX Input 2 Source */ | 952 | { 0x06C2, 0x0000 }, /* R1730 - OUT5LMIX Input 2 Source */ |
1036 | [0x06C3] = 0x0080, /* R1731 - OUT5LMIX Input 2 Volume */ | 953 | { 0x06C3, 0x0080 }, /* R1731 - OUT5LMIX Input 2 Volume */ |
1037 | [0x06C4] = 0x0000, /* R1732 - OUT5LMIX Input 3 Source */ | 954 | { 0x06C4, 0x0000 }, /* R1732 - OUT5LMIX Input 3 Source */ |
1038 | [0x06C5] = 0x0080, /* R1733 - OUT5LMIX Input 3 Volume */ | 955 | { 0x06C5, 0x0080 }, /* R1733 - OUT5LMIX Input 3 Volume */ |
1039 | [0x06C6] = 0x0000, /* R1734 - OUT5LMIX Input 4 Source */ | 956 | { 0x06C6, 0x0000 }, /* R1734 - OUT5LMIX Input 4 Source */ |
1040 | [0x06C7] = 0x0080, /* R1735 - OUT5LMIX Input 4 Volume */ | 957 | { 0x06C7, 0x0080 }, /* R1735 - OUT5LMIX Input 4 Volume */ |
1041 | [0x06C8] = 0x0000, /* R1736 - OUT5RMIX Input 1 Source */ | 958 | { 0x06C8, 0x0000 }, /* R1736 - OUT5RMIX Input 1 Source */ |
1042 | [0x06C9] = 0x0080, /* R1737 - OUT5RMIX Input 1 Volume */ | 959 | { 0x06C9, 0x0080 }, /* R1737 - OUT5RMIX Input 1 Volume */ |
1043 | [0x06CA] = 0x0000, /* R1738 - OUT5RMIX Input 2 Source */ | 960 | { 0x06CA, 0x0000 }, /* R1738 - OUT5RMIX Input 2 Source */ |
1044 | [0x06CB] = 0x0080, /* R1739 - OUT5RMIX Input 2 Volume */ | 961 | { 0x06CB, 0x0080 }, /* R1739 - OUT5RMIX Input 2 Volume */ |
1045 | [0x06CC] = 0x0000, /* R1740 - OUT5RMIX Input 3 Source */ | 962 | { 0x06CC, 0x0000 }, /* R1740 - OUT5RMIX Input 3 Source */ |
1046 | [0x06CD] = 0x0080, /* R1741 - OUT5RMIX Input 3 Volume */ | 963 | { 0x06CD, 0x0080 }, /* R1741 - OUT5RMIX Input 3 Volume */ |
1047 | [0x06CE] = 0x0000, /* R1742 - OUT5RMIX Input 4 Source */ | 964 | { 0x06CE, 0x0000 }, /* R1742 - OUT5RMIX Input 4 Source */ |
1048 | [0x06CF] = 0x0080, /* R1743 - OUT5RMIX Input 4 Volume */ | 965 | { 0x06CF, 0x0080 }, /* R1743 - OUT5RMIX Input 4 Volume */ |
1049 | [0x06D0] = 0x0000, /* R1744 - OUT6LMIX Input 1 Source */ | 966 | { 0x06D0, 0x0000 }, /* R1744 - OUT6LMIX Input 1 Source */ |
1050 | [0x06D1] = 0x0080, /* R1745 - OUT6LMIX Input 1 Volume */ | 967 | { 0x06D1, 0x0080 }, /* R1745 - OUT6LMIX Input 1 Volume */ |
1051 | [0x06D2] = 0x0000, /* R1746 - OUT6LMIX Input 2 Source */ | 968 | { 0x06D2, 0x0000 }, /* R1746 - OUT6LMIX Input 2 Source */ |
1052 | [0x06D3] = 0x0080, /* R1747 - OUT6LMIX Input 2 Volume */ | 969 | { 0x06D3, 0x0080 }, /* R1747 - OUT6LMIX Input 2 Volume */ |
1053 | [0x06D4] = 0x0000, /* R1748 - OUT6LMIX Input 3 Source */ | 970 | { 0x06D4, 0x0000 }, /* R1748 - OUT6LMIX Input 3 Source */ |
1054 | [0x06D5] = 0x0080, /* R1749 - OUT6LMIX Input 3 Volume */ | 971 | { 0x06D5, 0x0080 }, /* R1749 - OUT6LMIX Input 3 Volume */ |
1055 | [0x06D6] = 0x0000, /* R1750 - OUT6LMIX Input 4 Source */ | 972 | { 0x06D6, 0x0000 }, /* R1750 - OUT6LMIX Input 4 Source */ |
1056 | [0x06D7] = 0x0080, /* R1751 - OUT6LMIX Input 4 Volume */ | 973 | { 0x06D7, 0x0080 }, /* R1751 - OUT6LMIX Input 4 Volume */ |
1057 | [0x06D8] = 0x0000, /* R1752 - OUT6RMIX Input 1 Source */ | 974 | { 0x06D8, 0x0000 }, /* R1752 - OUT6RMIX Input 1 Source */ |
1058 | [0x06D9] = 0x0080, /* R1753 - OUT6RMIX Input 1 Volume */ | 975 | { 0x06D9, 0x0080 }, /* R1753 - OUT6RMIX Input 1 Volume */ |
1059 | [0x06DA] = 0x0000, /* R1754 - OUT6RMIX Input 2 Source */ | 976 | { 0x06DA, 0x0000 }, /* R1754 - OUT6RMIX Input 2 Source */ |
1060 | [0x06DB] = 0x0080, /* R1755 - OUT6RMIX Input 2 Volume */ | 977 | { 0x06DB, 0x0080 }, /* R1755 - OUT6RMIX Input 2 Volume */ |
1061 | [0x06DC] = 0x0000, /* R1756 - OUT6RMIX Input 3 Source */ | 978 | { 0x06DC, 0x0000 }, /* R1756 - OUT6RMIX Input 3 Source */ |
1062 | [0x06DD] = 0x0080, /* R1757 - OUT6RMIX Input 3 Volume */ | 979 | { 0x06DD, 0x0080 }, /* R1757 - OUT6RMIX Input 3 Volume */ |
1063 | [0x06DE] = 0x0000, /* R1758 - OUT6RMIX Input 4 Source */ | 980 | { 0x06DE, 0x0000 }, /* R1758 - OUT6RMIX Input 4 Source */ |
1064 | [0x06DF] = 0x0080, /* R1759 - OUT6RMIX Input 4 Volume */ | 981 | { 0x06DF, 0x0080 }, /* R1759 - OUT6RMIX Input 4 Volume */ |
1065 | [0x0700] = 0x0000, /* R1792 - AIF1TX1MIX Input 1 Source */ | 982 | { 0x0700, 0x0000 }, /* R1792 - AIF1TX1MIX Input 1 Source */ |
1066 | [0x0701] = 0x0080, /* R1793 - AIF1TX1MIX Input 1 Volume */ | 983 | { 0x0701, 0x0080 }, /* R1793 - AIF1TX1MIX Input 1 Volume */ |
1067 | [0x0702] = 0x0000, /* R1794 - AIF1TX1MIX Input 2 Source */ | 984 | { 0x0702, 0x0000 }, /* R1794 - AIF1TX1MIX Input 2 Source */ |
1068 | [0x0703] = 0x0080, /* R1795 - AIF1TX1MIX Input 2 Volume */ | 985 | { 0x0703, 0x0080 }, /* R1795 - AIF1TX1MIX Input 2 Volume */ |
1069 | [0x0704] = 0x0000, /* R1796 - AIF1TX1MIX Input 3 Source */ | 986 | { 0x0704, 0x0000 }, /* R1796 - AIF1TX1MIX Input 3 Source */ |
1070 | [0x0705] = 0x0080, /* R1797 - AIF1TX1MIX Input 3 Volume */ | 987 | { 0x0705, 0x0080 }, /* R1797 - AIF1TX1MIX Input 3 Volume */ |
1071 | [0x0706] = 0x0000, /* R1798 - AIF1TX1MIX Input 4 Source */ | 988 | { 0x0706, 0x0000 }, /* R1798 - AIF1TX1MIX Input 4 Source */ |
1072 | [0x0707] = 0x0080, /* R1799 - AIF1TX1MIX Input 4 Volume */ | 989 | { 0x0707, 0x0080 }, /* R1799 - AIF1TX1MIX Input 4 Volume */ |
1073 | [0x0708] = 0x0000, /* R1800 - AIF1TX2MIX Input 1 Source */ | 990 | { 0x0708, 0x0000 }, /* R1800 - AIF1TX2MIX Input 1 Source */ |
1074 | [0x0709] = 0x0080, /* R1801 - AIF1TX2MIX Input 1 Volume */ | 991 | { 0x0709, 0x0080 }, /* R1801 - AIF1TX2MIX Input 1 Volume */ |
1075 | [0x070A] = 0x0000, /* R1802 - AIF1TX2MIX Input 2 Source */ | 992 | { 0x070A, 0x0000 }, /* R1802 - AIF1TX2MIX Input 2 Source */ |
1076 | [0x070B] = 0x0080, /* R1803 - AIF1TX2MIX Input 2 Volume */ | 993 | { 0x070B, 0x0080 }, /* R1803 - AIF1TX2MIX Input 2 Volume */ |
1077 | [0x070C] = 0x0000, /* R1804 - AIF1TX2MIX Input 3 Source */ | 994 | { 0x070C, 0x0000 }, /* R1804 - AIF1TX2MIX Input 3 Source */ |
1078 | [0x070D] = 0x0080, /* R1805 - AIF1TX2MIX Input 3 Volume */ | 995 | { 0x070D, 0x0080 }, /* R1805 - AIF1TX2MIX Input 3 Volume */ |
1079 | [0x070E] = 0x0000, /* R1806 - AIF1TX2MIX Input 4 Source */ | 996 | { 0x070E, 0x0000 }, /* R1806 - AIF1TX2MIX Input 4 Source */ |
1080 | [0x070F] = 0x0080, /* R1807 - AIF1TX2MIX Input 4 Volume */ | 997 | { 0x070F, 0x0080 }, /* R1807 - AIF1TX2MIX Input 4 Volume */ |
1081 | [0x0710] = 0x0000, /* R1808 - AIF1TX3MIX Input 1 Source */ | 998 | { 0x0710, 0x0000 }, /* R1808 - AIF1TX3MIX Input 1 Source */ |
1082 | [0x0711] = 0x0080, /* R1809 - AIF1TX3MIX Input 1 Volume */ | 999 | { 0x0711, 0x0080 }, /* R1809 - AIF1TX3MIX Input 1 Volume */ |
1083 | [0x0712] = 0x0000, /* R1810 - AIF1TX3MIX Input 2 Source */ | 1000 | { 0x0712, 0x0000 }, /* R1810 - AIF1TX3MIX Input 2 Source */ |
1084 | [0x0713] = 0x0080, /* R1811 - AIF1TX3MIX Input 2 Volume */ | 1001 | { 0x0713, 0x0080 }, /* R1811 - AIF1TX3MIX Input 2 Volume */ |
1085 | [0x0714] = 0x0000, /* R1812 - AIF1TX3MIX Input 3 Source */ | 1002 | { 0x0714, 0x0000 }, /* R1812 - AIF1TX3MIX Input 3 Source */ |
1086 | [0x0715] = 0x0080, /* R1813 - AIF1TX3MIX Input 3 Volume */ | 1003 | { 0x0715, 0x0080 }, /* R1813 - AIF1TX3MIX Input 3 Volume */ |
1087 | [0x0716] = 0x0000, /* R1814 - AIF1TX3MIX Input 4 Source */ | 1004 | { 0x0716, 0x0000 }, /* R1814 - AIF1TX3MIX Input 4 Source */ |
1088 | [0x0717] = 0x0080, /* R1815 - AIF1TX3MIX Input 4 Volume */ | 1005 | { 0x0717, 0x0080 }, /* R1815 - AIF1TX3MIX Input 4 Volume */ |
1089 | [0x0718] = 0x0000, /* R1816 - AIF1TX4MIX Input 1 Source */ | 1006 | { 0x0718, 0x0000 }, /* R1816 - AIF1TX4MIX Input 1 Source */ |
1090 | [0x0719] = 0x0080, /* R1817 - AIF1TX4MIX Input 1 Volume */ | 1007 | { 0x0719, 0x0080 }, /* R1817 - AIF1TX4MIX Input 1 Volume */ |
1091 | [0x071A] = 0x0000, /* R1818 - AIF1TX4MIX Input 2 Source */ | 1008 | { 0x071A, 0x0000 }, /* R1818 - AIF1TX4MIX Input 2 Source */ |
1092 | [0x071B] = 0x0080, /* R1819 - AIF1TX4MIX Input 2 Volume */ | 1009 | { 0x071B, 0x0080 }, /* R1819 - AIF1TX4MIX Input 2 Volume */ |
1093 | [0x071C] = 0x0000, /* R1820 - AIF1TX4MIX Input 3 Source */ | 1010 | { 0x071C, 0x0000 }, /* R1820 - AIF1TX4MIX Input 3 Source */ |
1094 | [0x071D] = 0x0080, /* R1821 - AIF1TX4MIX Input 3 Volume */ | 1011 | { 0x071D, 0x0080 }, /* R1821 - AIF1TX4MIX Input 3 Volume */ |
1095 | [0x071E] = 0x0000, /* R1822 - AIF1TX4MIX Input 4 Source */ | 1012 | { 0x071E, 0x0000 }, /* R1822 - AIF1TX4MIX Input 4 Source */ |
1096 | [0x071F] = 0x0080, /* R1823 - AIF1TX4MIX Input 4 Volume */ | 1013 | { 0x071F, 0x0080 }, /* R1823 - AIF1TX4MIX Input 4 Volume */ |
1097 | [0x0720] = 0x0000, /* R1824 - AIF1TX5MIX Input 1 Source */ | 1014 | { 0x0720, 0x0000 }, /* R1824 - AIF1TX5MIX Input 1 Source */ |
1098 | [0x0721] = 0x0080, /* R1825 - AIF1TX5MIX Input 1 Volume */ | 1015 | { 0x0721, 0x0080 }, /* R1825 - AIF1TX5MIX Input 1 Volume */ |
1099 | [0x0722] = 0x0000, /* R1826 - AIF1TX5MIX Input 2 Source */ | 1016 | { 0x0722, 0x0000 }, /* R1826 - AIF1TX5MIX Input 2 Source */ |
1100 | [0x0723] = 0x0080, /* R1827 - AIF1TX5MIX Input 2 Volume */ | 1017 | { 0x0723, 0x0080 }, /* R1827 - AIF1TX5MIX Input 2 Volume */ |
1101 | [0x0724] = 0x0000, /* R1828 - AIF1TX5MIX Input 3 Source */ | 1018 | { 0x0724, 0x0000 }, /* R1828 - AIF1TX5MIX Input 3 Source */ |
1102 | [0x0725] = 0x0080, /* R1829 - AIF1TX5MIX Input 3 Volume */ | 1019 | { 0x0725, 0x0080 }, /* R1829 - AIF1TX5MIX Input 3 Volume */ |
1103 | [0x0726] = 0x0000, /* R1830 - AIF1TX5MIX Input 4 Source */ | 1020 | { 0x0726, 0x0000 }, /* R1830 - AIF1TX5MIX Input 4 Source */ |
1104 | [0x0727] = 0x0080, /* R1831 - AIF1TX5MIX Input 4 Volume */ | 1021 | { 0x0727, 0x0080 }, /* R1831 - AIF1TX5MIX Input 4 Volume */ |
1105 | [0x0728] = 0x0000, /* R1832 - AIF1TX6MIX Input 1 Source */ | 1022 | { 0x0728, 0x0000 }, /* R1832 - AIF1TX6MIX Input 1 Source */ |
1106 | [0x0729] = 0x0080, /* R1833 - AIF1TX6MIX Input 1 Volume */ | 1023 | { 0x0729, 0x0080 }, /* R1833 - AIF1TX6MIX Input 1 Volume */ |
1107 | [0x072A] = 0x0000, /* R1834 - AIF1TX6MIX Input 2 Source */ | 1024 | { 0x072A, 0x0000 }, /* R1834 - AIF1TX6MIX Input 2 Source */ |
1108 | [0x072B] = 0x0080, /* R1835 - AIF1TX6MIX Input 2 Volume */ | 1025 | { 0x072B, 0x0080 }, /* R1835 - AIF1TX6MIX Input 2 Volume */ |
1109 | [0x072C] = 0x0000, /* R1836 - AIF1TX6MIX Input 3 Source */ | 1026 | { 0x072C, 0x0000 }, /* R1836 - AIF1TX6MIX Input 3 Source */ |
1110 | [0x072D] = 0x0080, /* R1837 - AIF1TX6MIX Input 3 Volume */ | 1027 | { 0x072D, 0x0080 }, /* R1837 - AIF1TX6MIX Input 3 Volume */ |
1111 | [0x072E] = 0x0000, /* R1838 - AIF1TX6MIX Input 4 Source */ | 1028 | { 0x072E, 0x0000 }, /* R1838 - AIF1TX6MIX Input 4 Source */ |
1112 | [0x072F] = 0x0080, /* R1839 - AIF1TX6MIX Input 4 Volume */ | 1029 | { 0x072F, 0x0080 }, /* R1839 - AIF1TX6MIX Input 4 Volume */ |
1113 | [0x0730] = 0x0000, /* R1840 - AIF1TX7MIX Input 1 Source */ | 1030 | { 0x0730, 0x0000 }, /* R1840 - AIF1TX7MIX Input 1 Source */ |
1114 | [0x0731] = 0x0080, /* R1841 - AIF1TX7MIX Input 1 Volume */ | 1031 | { 0x0731, 0x0080 }, /* R1841 - AIF1TX7MIX Input 1 Volume */ |
1115 | [0x0732] = 0x0000, /* R1842 - AIF1TX7MIX Input 2 Source */ | 1032 | { 0x0732, 0x0000 }, /* R1842 - AIF1TX7MIX Input 2 Source */ |
1116 | [0x0733] = 0x0080, /* R1843 - AIF1TX7MIX Input 2 Volume */ | 1033 | { 0x0733, 0x0080 }, /* R1843 - AIF1TX7MIX Input 2 Volume */ |
1117 | [0x0734] = 0x0000, /* R1844 - AIF1TX7MIX Input 3 Source */ | 1034 | { 0x0734, 0x0000 }, /* R1844 - AIF1TX7MIX Input 3 Source */ |
1118 | [0x0735] = 0x0080, /* R1845 - AIF1TX7MIX Input 3 Volume */ | 1035 | { 0x0735, 0x0080 }, /* R1845 - AIF1TX7MIX Input 3 Volume */ |
1119 | [0x0736] = 0x0000, /* R1846 - AIF1TX7MIX Input 4 Source */ | 1036 | { 0x0736, 0x0000 }, /* R1846 - AIF1TX7MIX Input 4 Source */ |
1120 | [0x0737] = 0x0080, /* R1847 - AIF1TX7MIX Input 4 Volume */ | 1037 | { 0x0737, 0x0080 }, /* R1847 - AIF1TX7MIX Input 4 Volume */ |
1121 | [0x0738] = 0x0000, /* R1848 - AIF1TX8MIX Input 1 Source */ | 1038 | { 0x0738, 0x0000 }, /* R1848 - AIF1TX8MIX Input 1 Source */ |
1122 | [0x0739] = 0x0080, /* R1849 - AIF1TX8MIX Input 1 Volume */ | 1039 | { 0x0739, 0x0080 }, /* R1849 - AIF1TX8MIX Input 1 Volume */ |
1123 | [0x073A] = 0x0000, /* R1850 - AIF1TX8MIX Input 2 Source */ | 1040 | { 0x073A, 0x0000 }, /* R1850 - AIF1TX8MIX Input 2 Source */ |
1124 | [0x073B] = 0x0080, /* R1851 - AIF1TX8MIX Input 2 Volume */ | 1041 | { 0x073B, 0x0080 }, /* R1851 - AIF1TX8MIX Input 2 Volume */ |
1125 | [0x073C] = 0x0000, /* R1852 - AIF1TX8MIX Input 3 Source */ | 1042 | { 0x073C, 0x0000 }, /* R1852 - AIF1TX8MIX Input 3 Source */ |
1126 | [0x073D] = 0x0080, /* R1853 - AIF1TX8MIX Input 3 Volume */ | 1043 | { 0x073D, 0x0080 }, /* R1853 - AIF1TX8MIX Input 3 Volume */ |
1127 | [0x073E] = 0x0000, /* R1854 - AIF1TX8MIX Input 4 Source */ | 1044 | { 0x073E, 0x0000 }, /* R1854 - AIF1TX8MIX Input 4 Source */ |
1128 | [0x073F] = 0x0080, /* R1855 - AIF1TX8MIX Input 4 Volume */ | 1045 | { 0x073F, 0x0080 }, /* R1855 - AIF1TX8MIX Input 4 Volume */ |
1129 | [0x0740] = 0x0000, /* R1856 - AIF2TX1MIX Input 1 Source */ | 1046 | { 0x0740, 0x0000 }, /* R1856 - AIF2TX1MIX Input 1 Source */ |
1130 | [0x0741] = 0x0080, /* R1857 - AIF2TX1MIX Input 1 Volume */ | 1047 | { 0x0741, 0x0080 }, /* R1857 - AIF2TX1MIX Input 1 Volume */ |
1131 | [0x0742] = 0x0000, /* R1858 - AIF2TX1MIX Input 2 Source */ | 1048 | { 0x0742, 0x0000 }, /* R1858 - AIF2TX1MIX Input 2 Source */ |
1132 | [0x0743] = 0x0080, /* R1859 - AIF2TX1MIX Input 2 Volume */ | 1049 | { 0x0743, 0x0080 }, /* R1859 - AIF2TX1MIX Input 2 Volume */ |
1133 | [0x0744] = 0x0000, /* R1860 - AIF2TX1MIX Input 3 Source */ | 1050 | { 0x0744, 0x0000 }, /* R1860 - AIF2TX1MIX Input 3 Source */ |
1134 | [0x0745] = 0x0080, /* R1861 - AIF2TX1MIX Input 3 Volume */ | 1051 | { 0x0745, 0x0080 }, /* R1861 - AIF2TX1MIX Input 3 Volume */ |
1135 | [0x0746] = 0x0000, /* R1862 - AIF2TX1MIX Input 4 Source */ | 1052 | { 0x0746, 0x0000 }, /* R1862 - AIF2TX1MIX Input 4 Source */ |
1136 | [0x0747] = 0x0080, /* R1863 - AIF2TX1MIX Input 4 Volume */ | 1053 | { 0x0747, 0x0080 }, /* R1863 - AIF2TX1MIX Input 4 Volume */ |
1137 | [0x0748] = 0x0000, /* R1864 - AIF2TX2MIX Input 1 Source */ | 1054 | { 0x0748, 0x0000 }, /* R1864 - AIF2TX2MIX Input 1 Source */ |
1138 | [0x0749] = 0x0080, /* R1865 - AIF2TX2MIX Input 1 Volume */ | 1055 | { 0x0749, 0x0080 }, /* R1865 - AIF2TX2MIX Input 1 Volume */ |
1139 | [0x074A] = 0x0000, /* R1866 - AIF2TX2MIX Input 2 Source */ | 1056 | { 0x074A, 0x0000 }, /* R1866 - AIF2TX2MIX Input 2 Source */ |
1140 | [0x074B] = 0x0080, /* R1867 - AIF2TX2MIX Input 2 Volume */ | 1057 | { 0x074B, 0x0080 }, /* R1867 - AIF2TX2MIX Input 2 Volume */ |
1141 | [0x074C] = 0x0000, /* R1868 - AIF2TX2MIX Input 3 Source */ | 1058 | { 0x074C, 0x0000 }, /* R1868 - AIF2TX2MIX Input 3 Source */ |
1142 | [0x074D] = 0x0080, /* R1869 - AIF2TX2MIX Input 3 Volume */ | 1059 | { 0x074D, 0x0080 }, /* R1869 - AIF2TX2MIX Input 3 Volume */ |
1143 | [0x074E] = 0x0000, /* R1870 - AIF2TX2MIX Input 4 Source */ | 1060 | { 0x074E, 0x0000 }, /* R1870 - AIF2TX2MIX Input 4 Source */ |
1144 | [0x074F] = 0x0080, /* R1871 - AIF2TX2MIX Input 4 Volume */ | 1061 | { 0x074F, 0x0080 }, /* R1871 - AIF2TX2MIX Input 4 Volume */ |
1145 | [0x0780] = 0x0000, /* R1920 - AIF3TX1MIX Input 1 Source */ | 1062 | { 0x0780, 0x0000 }, /* R1920 - AIF3TX1MIX Input 1 Source */ |
1146 | [0x0781] = 0x0080, /* R1921 - AIF3TX1MIX Input 1 Volume */ | 1063 | { 0x0781, 0x0080 }, /* R1921 - AIF3TX1MIX Input 1 Volume */ |
1147 | [0x0782] = 0x0000, /* R1922 - AIF3TX1MIX Input 2 Source */ | 1064 | { 0x0782, 0x0000 }, /* R1922 - AIF3TX1MIX Input 2 Source */ |
1148 | [0x0783] = 0x0080, /* R1923 - AIF3TX1MIX Input 2 Volume */ | 1065 | { 0x0783, 0x0080 }, /* R1923 - AIF3TX1MIX Input 2 Volume */ |
1149 | [0x0784] = 0x0000, /* R1924 - AIF3TX1MIX Input 3 Source */ | 1066 | { 0x0784, 0x0000 }, /* R1924 - AIF3TX1MIX Input 3 Source */ |
1150 | [0x0785] = 0x0080, /* R1925 - AIF3TX1MIX Input 3 Volume */ | 1067 | { 0x0785, 0x0080 }, /* R1925 - AIF3TX1MIX Input 3 Volume */ |
1151 | [0x0786] = 0x0000, /* R1926 - AIF3TX1MIX Input 4 Source */ | 1068 | { 0x0786, 0x0000 }, /* R1926 - AIF3TX1MIX Input 4 Source */ |
1152 | [0x0787] = 0x0080, /* R1927 - AIF3TX1MIX Input 4 Volume */ | 1069 | { 0x0787, 0x0080 }, /* R1927 - AIF3TX1MIX Input 4 Volume */ |
1153 | [0x0788] = 0x0000, /* R1928 - AIF3TX2MIX Input 1 Source */ | 1070 | { 0x0788, 0x0000 }, /* R1928 - AIF3TX2MIX Input 1 Source */ |
1154 | [0x0789] = 0x0080, /* R1929 - AIF3TX2MIX Input 1 Volume */ | 1071 | { 0x0789, 0x0080 }, /* R1929 - AIF3TX2MIX Input 1 Volume */ |
1155 | [0x078A] = 0x0000, /* R1930 - AIF3TX2MIX Input 2 Source */ | 1072 | { 0x078A, 0x0000 }, /* R1930 - AIF3TX2MIX Input 2 Source */ |
1156 | [0x078B] = 0x0080, /* R1931 - AIF3TX2MIX Input 2 Volume */ | 1073 | { 0x078B, 0x0080 }, /* R1931 - AIF3TX2MIX Input 2 Volume */ |
1157 | [0x078C] = 0x0000, /* R1932 - AIF3TX2MIX Input 3 Source */ | 1074 | { 0x078C, 0x0000 }, /* R1932 - AIF3TX2MIX Input 3 Source */ |
1158 | [0x078D] = 0x0080, /* R1933 - AIF3TX2MIX Input 3 Volume */ | 1075 | { 0x078D, 0x0080 }, /* R1933 - AIF3TX2MIX Input 3 Volume */ |
1159 | [0x078E] = 0x0000, /* R1934 - AIF3TX2MIX Input 4 Source */ | 1076 | { 0x078E, 0x0000 }, /* R1934 - AIF3TX2MIX Input 4 Source */ |
1160 | [0x078F] = 0x0080, /* R1935 - AIF3TX2MIX Input 4 Volume */ | 1077 | { 0x078F, 0x0080 }, /* R1935 - AIF3TX2MIX Input 4 Volume */ |
1161 | [0x0880] = 0x0000, /* R2176 - EQ1MIX Input 1 Source */ | 1078 | { 0x0880, 0x0000 }, /* R2176 - EQ1MIX Input 1 Source */ |
1162 | [0x0881] = 0x0080, /* R2177 - EQ1MIX Input 1 Volume */ | 1079 | { 0x0881, 0x0080 }, /* R2177 - EQ1MIX Input 1 Volume */ |
1163 | [0x0882] = 0x0000, /* R2178 - EQ1MIX Input 2 Source */ | 1080 | { 0x0882, 0x0000 }, /* R2178 - EQ1MIX Input 2 Source */ |
1164 | [0x0883] = 0x0080, /* R2179 - EQ1MIX Input 2 Volume */ | 1081 | { 0x0883, 0x0080 }, /* R2179 - EQ1MIX Input 2 Volume */ |
1165 | [0x0884] = 0x0000, /* R2180 - EQ1MIX Input 3 Source */ | 1082 | { 0x0884, 0x0000 }, /* R2180 - EQ1MIX Input 3 Source */ |
1166 | [0x0885] = 0x0080, /* R2181 - EQ1MIX Input 3 Volume */ | 1083 | { 0x0885, 0x0080 }, /* R2181 - EQ1MIX Input 3 Volume */ |
1167 | [0x0886] = 0x0000, /* R2182 - EQ1MIX Input 4 Source */ | 1084 | { 0x0886, 0x0000 }, /* R2182 - EQ1MIX Input 4 Source */ |
1168 | [0x0887] = 0x0080, /* R2183 - EQ1MIX Input 4 Volume */ | 1085 | { 0x0887, 0x0080 }, /* R2183 - EQ1MIX Input 4 Volume */ |
1169 | [0x0888] = 0x0000, /* R2184 - EQ2MIX Input 1 Source */ | 1086 | { 0x0888, 0x0000 }, /* R2184 - EQ2MIX Input 1 Source */ |
1170 | [0x0889] = 0x0080, /* R2185 - EQ2MIX Input 1 Volume */ | 1087 | { 0x0889, 0x0080 }, /* R2185 - EQ2MIX Input 1 Volume */ |
1171 | [0x088A] = 0x0000, /* R2186 - EQ2MIX Input 2 Source */ | 1088 | { 0x088A, 0x0000 }, /* R2186 - EQ2MIX Input 2 Source */ |
1172 | [0x088B] = 0x0080, /* R2187 - EQ2MIX Input 2 Volume */ | 1089 | { 0x088B, 0x0080 }, /* R2187 - EQ2MIX Input 2 Volume */ |
1173 | [0x088C] = 0x0000, /* R2188 - EQ2MIX Input 3 Source */ | 1090 | { 0x088C, 0x0000 }, /* R2188 - EQ2MIX Input 3 Source */ |
1174 | [0x088D] = 0x0080, /* R2189 - EQ2MIX Input 3 Volume */ | 1091 | { 0x088D, 0x0080 }, /* R2189 - EQ2MIX Input 3 Volume */ |
1175 | [0x088E] = 0x0000, /* R2190 - EQ2MIX Input 4 Source */ | 1092 | { 0x088E, 0x0000 }, /* R2190 - EQ2MIX Input 4 Source */ |
1176 | [0x088F] = 0x0080, /* R2191 - EQ2MIX Input 4 Volume */ | 1093 | { 0x088F, 0x0080 }, /* R2191 - EQ2MIX Input 4 Volume */ |
1177 | [0x0890] = 0x0000, /* R2192 - EQ3MIX Input 1 Source */ | 1094 | { 0x0890, 0x0000 }, /* R2192 - EQ3MIX Input 1 Source */ |
1178 | [0x0891] = 0x0080, /* R2193 - EQ3MIX Input 1 Volume */ | 1095 | { 0x0891, 0x0080 }, /* R2193 - EQ3MIX Input 1 Volume */ |
1179 | [0x0892] = 0x0000, /* R2194 - EQ3MIX Input 2 Source */ | 1096 | { 0x0892, 0x0000 }, /* R2194 - EQ3MIX Input 2 Source */ |
1180 | [0x0893] = 0x0080, /* R2195 - EQ3MIX Input 2 Volume */ | 1097 | { 0x0893, 0x0080 }, /* R2195 - EQ3MIX Input 2 Volume */ |
1181 | [0x0894] = 0x0000, /* R2196 - EQ3MIX Input 3 Source */ | 1098 | { 0x0894, 0x0000 }, /* R2196 - EQ3MIX Input 3 Source */ |
1182 | [0x0895] = 0x0080, /* R2197 - EQ3MIX Input 3 Volume */ | 1099 | { 0x0895, 0x0080 }, /* R2197 - EQ3MIX Input 3 Volume */ |
1183 | [0x0896] = 0x0000, /* R2198 - EQ3MIX Input 4 Source */ | 1100 | { 0x0896, 0x0000 }, /* R2198 - EQ3MIX Input 4 Source */ |
1184 | [0x0897] = 0x0080, /* R2199 - EQ3MIX Input 4 Volume */ | 1101 | { 0x0897, 0x0080 }, /* R2199 - EQ3MIX Input 4 Volume */ |
1185 | [0x0898] = 0x0000, /* R2200 - EQ4MIX Input 1 Source */ | 1102 | { 0x0898, 0x0000 }, /* R2200 - EQ4MIX Input 1 Source */ |
1186 | [0x0899] = 0x0080, /* R2201 - EQ4MIX Input 1 Volume */ | 1103 | { 0x0899, 0x0080 }, /* R2201 - EQ4MIX Input 1 Volume */ |
1187 | [0x089A] = 0x0000, /* R2202 - EQ4MIX Input 2 Source */ | 1104 | { 0x089A, 0x0000 }, /* R2202 - EQ4MIX Input 2 Source */ |
1188 | [0x089B] = 0x0080, /* R2203 - EQ4MIX Input 2 Volume */ | 1105 | { 0x089B, 0x0080 }, /* R2203 - EQ4MIX Input 2 Volume */ |
1189 | [0x089C] = 0x0000, /* R2204 - EQ4MIX Input 3 Source */ | 1106 | { 0x089C, 0x0000 }, /* R2204 - EQ4MIX Input 3 Source */ |
1190 | [0x089D] = 0x0080, /* R2205 - EQ4MIX Input 3 Volume */ | 1107 | { 0x089D, 0x0080 }, /* R2205 - EQ4MIX Input 3 Volume */ |
1191 | [0x089E] = 0x0000, /* R2206 - EQ4MIX Input 4 Source */ | 1108 | { 0x089E, 0x0000 }, /* R2206 - EQ4MIX Input 4 Source */ |
1192 | [0x089F] = 0x0080, /* R2207 - EQ4MIX Input 4 Volume */ | 1109 | { 0x089F, 0x0080 }, /* R2207 - EQ4MIX Input 4 Volume */ |
1193 | [0x08C0] = 0x0000, /* R2240 - DRC1LMIX Input 1 Source */ | 1110 | { 0x08C0, 0x0000 }, /* R2240 - DRC1LMIX Input 1 Source */ |
1194 | [0x08C1] = 0x0080, /* R2241 - DRC1LMIX Input 1 Volume */ | 1111 | { 0x08C1, 0x0080 }, /* R2241 - DRC1LMIX Input 1 Volume */ |
1195 | [0x08C2] = 0x0000, /* R2242 - DRC1LMIX Input 2 Source */ | 1112 | { 0x08C2, 0x0000 }, /* R2242 - DRC1LMIX Input 2 Source */ |
1196 | [0x08C3] = 0x0080, /* R2243 - DRC1LMIX Input 2 Volume */ | 1113 | { 0x08C3, 0x0080 }, /* R2243 - DRC1LMIX Input 2 Volume */ |
1197 | [0x08C4] = 0x0000, /* R2244 - DRC1LMIX Input 3 Source */ | 1114 | { 0x08C4, 0x0000 }, /* R2244 - DRC1LMIX Input 3 Source */ |
1198 | [0x08C5] = 0x0080, /* R2245 - DRC1LMIX Input 3 Volume */ | 1115 | { 0x08C5, 0x0080 }, /* R2245 - DRC1LMIX Input 3 Volume */ |
1199 | [0x08C6] = 0x0000, /* R2246 - DRC1LMIX Input 4 Source */ | 1116 | { 0x08C6, 0x0000 }, /* R2246 - DRC1LMIX Input 4 Source */ |
1200 | [0x08C7] = 0x0080, /* R2247 - DRC1LMIX Input 4 Volume */ | 1117 | { 0x08C7, 0x0080 }, /* R2247 - DRC1LMIX Input 4 Volume */ |
1201 | [0x08C8] = 0x0000, /* R2248 - DRC1RMIX Input 1 Source */ | 1118 | { 0x08C8, 0x0000 }, /* R2248 - DRC1RMIX Input 1 Source */ |
1202 | [0x08C9] = 0x0080, /* R2249 - DRC1RMIX Input 1 Volume */ | 1119 | { 0x08C9, 0x0080 }, /* R2249 - DRC1RMIX Input 1 Volume */ |
1203 | [0x08CA] = 0x0000, /* R2250 - DRC1RMIX Input 2 Source */ | 1120 | { 0x08CA, 0x0000 }, /* R2250 - DRC1RMIX Input 2 Source */ |
1204 | [0x08CB] = 0x0080, /* R2251 - DRC1RMIX Input 2 Volume */ | 1121 | { 0x08CB, 0x0080 }, /* R2251 - DRC1RMIX Input 2 Volume */ |
1205 | [0x08CC] = 0x0000, /* R2252 - DRC1RMIX Input 3 Source */ | 1122 | { 0x08CC, 0x0000 }, /* R2252 - DRC1RMIX Input 3 Source */ |
1206 | [0x08CD] = 0x0080, /* R2253 - DRC1RMIX Input 3 Volume */ | 1123 | { 0x08CD, 0x0080 }, /* R2253 - DRC1RMIX Input 3 Volume */ |
1207 | [0x08CE] = 0x0000, /* R2254 - DRC1RMIX Input 4 Source */ | 1124 | { 0x08CE, 0x0000 }, /* R2254 - DRC1RMIX Input 4 Source */ |
1208 | [0x08CF] = 0x0080, /* R2255 - DRC1RMIX Input 4 Volume */ | 1125 | { 0x08CF, 0x0080 }, /* R2255 - DRC1RMIX Input 4 Volume */ |
1209 | [0x0900] = 0x0000, /* R2304 - HPLP1MIX Input 1 Source */ | 1126 | { 0x0900, 0x0000 }, /* R2304 - HPLP1MIX Input 1 Source */ |
1210 | [0x0901] = 0x0080, /* R2305 - HPLP1MIX Input 1 Volume */ | 1127 | { 0x0901, 0x0080 }, /* R2305 - HPLP1MIX Input 1 Volume */ |
1211 | [0x0902] = 0x0000, /* R2306 - HPLP1MIX Input 2 Source */ | 1128 | { 0x0902, 0x0000 }, /* R2306 - HPLP1MIX Input 2 Source */ |
1212 | [0x0903] = 0x0080, /* R2307 - HPLP1MIX Input 2 Volume */ | 1129 | { 0x0903, 0x0080 }, /* R2307 - HPLP1MIX Input 2 Volume */ |
1213 | [0x0904] = 0x0000, /* R2308 - HPLP1MIX Input 3 Source */ | 1130 | { 0x0904, 0x0000 }, /* R2308 - HPLP1MIX Input 3 Source */ |
1214 | [0x0905] = 0x0080, /* R2309 - HPLP1MIX Input 3 Volume */ | 1131 | { 0x0905, 0x0080 }, /* R2309 - HPLP1MIX Input 3 Volume */ |
1215 | [0x0906] = 0x0000, /* R2310 - HPLP1MIX Input 4 Source */ | 1132 | { 0x0906, 0x0000 }, /* R2310 - HPLP1MIX Input 4 Source */ |
1216 | [0x0907] = 0x0080, /* R2311 - HPLP1MIX Input 4 Volume */ | 1133 | { 0x0907, 0x0080 }, /* R2311 - HPLP1MIX Input 4 Volume */ |
1217 | [0x0908] = 0x0000, /* R2312 - HPLP2MIX Input 1 Source */ | 1134 | { 0x0908, 0x0000 }, /* R2312 - HPLP2MIX Input 1 Source */ |
1218 | [0x0909] = 0x0080, /* R2313 - HPLP2MIX Input 1 Volume */ | 1135 | { 0x0909, 0x0080 }, /* R2313 - HPLP2MIX Input 1 Volume */ |
1219 | [0x090A] = 0x0000, /* R2314 - HPLP2MIX Input 2 Source */ | 1136 | { 0x090A, 0x0000 }, /* R2314 - HPLP2MIX Input 2 Source */ |
1220 | [0x090B] = 0x0080, /* R2315 - HPLP2MIX Input 2 Volume */ | 1137 | { 0x090B, 0x0080 }, /* R2315 - HPLP2MIX Input 2 Volume */ |
1221 | [0x090C] = 0x0000, /* R2316 - HPLP2MIX Input 3 Source */ | 1138 | { 0x090C, 0x0000 }, /* R2316 - HPLP2MIX Input 3 Source */ |
1222 | [0x090D] = 0x0080, /* R2317 - HPLP2MIX Input 3 Volume */ | 1139 | { 0x090D, 0x0080 }, /* R2317 - HPLP2MIX Input 3 Volume */ |
1223 | [0x090E] = 0x0000, /* R2318 - HPLP2MIX Input 4 Source */ | 1140 | { 0x090E, 0x0000 }, /* R2318 - HPLP2MIX Input 4 Source */ |
1224 | [0x090F] = 0x0080, /* R2319 - HPLP2MIX Input 4 Volume */ | 1141 | { 0x090F, 0x0080 }, /* R2319 - HPLP2MIX Input 4 Volume */ |
1225 | [0x0910] = 0x0000, /* R2320 - HPLP3MIX Input 1 Source */ | 1142 | { 0x0910, 0x0000 }, /* R2320 - HPLP3MIX Input 1 Source */ |
1226 | [0x0911] = 0x0080, /* R2321 - HPLP3MIX Input 1 Volume */ | 1143 | { 0x0911, 0x0080 }, /* R2321 - HPLP3MIX Input 1 Volume */ |
1227 | [0x0912] = 0x0000, /* R2322 - HPLP3MIX Input 2 Source */ | 1144 | { 0x0912, 0x0000 }, /* R2322 - HPLP3MIX Input 2 Source */ |
1228 | [0x0913] = 0x0080, /* R2323 - HPLP3MIX Input 2 Volume */ | 1145 | { 0x0913, 0x0080 }, /* R2323 - HPLP3MIX Input 2 Volume */ |
1229 | [0x0914] = 0x0000, /* R2324 - HPLP3MIX Input 3 Source */ | 1146 | { 0x0914, 0x0000 }, /* R2324 - HPLP3MIX Input 3 Source */ |
1230 | [0x0915] = 0x0080, /* R2325 - HPLP3MIX Input 3 Volume */ | 1147 | { 0x0915, 0x0080 }, /* R2325 - HPLP3MIX Input 3 Volume */ |
1231 | [0x0916] = 0x0000, /* R2326 - HPLP3MIX Input 4 Source */ | 1148 | { 0x0916, 0x0000 }, /* R2326 - HPLP3MIX Input 4 Source */ |
1232 | [0x0917] = 0x0080, /* R2327 - HPLP3MIX Input 4 Volume */ | 1149 | { 0x0917, 0x0080 }, /* R2327 - HPLP3MIX Input 4 Volume */ |
1233 | [0x0918] = 0x0000, /* R2328 - HPLP4MIX Input 1 Source */ | 1150 | { 0x0918, 0x0000 }, /* R2328 - HPLP4MIX Input 1 Source */ |
1234 | [0x0919] = 0x0080, /* R2329 - HPLP4MIX Input 1 Volume */ | 1151 | { 0x0919, 0x0080 }, /* R2329 - HPLP4MIX Input 1 Volume */ |
1235 | [0x091A] = 0x0000, /* R2330 - HPLP4MIX Input 2 Source */ | 1152 | { 0x091A, 0x0000 }, /* R2330 - HPLP4MIX Input 2 Source */ |
1236 | [0x091B] = 0x0080, /* R2331 - HPLP4MIX Input 2 Volume */ | 1153 | { 0x091B, 0x0080 }, /* R2331 - HPLP4MIX Input 2 Volume */ |
1237 | [0x091C] = 0x0000, /* R2332 - HPLP4MIX Input 3 Source */ | 1154 | { 0x091C, 0x0000 }, /* R2332 - HPLP4MIX Input 3 Source */ |
1238 | [0x091D] = 0x0080, /* R2333 - HPLP4MIX Input 3 Volume */ | 1155 | { 0x091D, 0x0080 }, /* R2333 - HPLP4MIX Input 3 Volume */ |
1239 | [0x091E] = 0x0000, /* R2334 - HPLP4MIX Input 4 Source */ | 1156 | { 0x091E, 0x0000 }, /* R2334 - HPLP4MIX Input 4 Source */ |
1240 | [0x091F] = 0x0080, /* R2335 - HPLP4MIX Input 4 Volume */ | 1157 | { 0x091F, 0x0080 }, /* R2335 - HPLP4MIX Input 4 Volume */ |
1241 | [0x0940] = 0x0000, /* R2368 - DSP1LMIX Input 1 Source */ | 1158 | { 0x0940, 0x0000 }, /* R2368 - DSP1LMIX Input 1 Source */ |
1242 | [0x0941] = 0x0080, /* R2369 - DSP1LMIX Input 1 Volume */ | 1159 | { 0x0941, 0x0080 }, /* R2369 - DSP1LMIX Input 1 Volume */ |
1243 | [0x0942] = 0x0000, /* R2370 - DSP1LMIX Input 2 Source */ | 1160 | { 0x0942, 0x0000 }, /* R2370 - DSP1LMIX Input 2 Source */ |
1244 | [0x0943] = 0x0080, /* R2371 - DSP1LMIX Input 2 Volume */ | 1161 | { 0x0943, 0x0080 }, /* R2371 - DSP1LMIX Input 2 Volume */ |
1245 | [0x0944] = 0x0000, /* R2372 - DSP1LMIX Input 3 Source */ | 1162 | { 0x0944, 0x0000 }, /* R2372 - DSP1LMIX Input 3 Source */ |
1246 | [0x0945] = 0x0080, /* R2373 - DSP1LMIX Input 3 Volume */ | 1163 | { 0x0945, 0x0080 }, /* R2373 - DSP1LMIX Input 3 Volume */ |
1247 | [0x0946] = 0x0000, /* R2374 - DSP1LMIX Input 4 Source */ | 1164 | { 0x0946, 0x0000 }, /* R2374 - DSP1LMIX Input 4 Source */ |
1248 | [0x0947] = 0x0080, /* R2375 - DSP1LMIX Input 4 Volume */ | 1165 | { 0x0947, 0x0080 }, /* R2375 - DSP1LMIX Input 4 Volume */ |
1249 | [0x0948] = 0x0000, /* R2376 - DSP1RMIX Input 1 Source */ | 1166 | { 0x0948, 0x0000 }, /* R2376 - DSP1RMIX Input 1 Source */ |
1250 | [0x0949] = 0x0080, /* R2377 - DSP1RMIX Input 1 Volume */ | 1167 | { 0x0949, 0x0080 }, /* R2377 - DSP1RMIX Input 1 Volume */ |
1251 | [0x094A] = 0x0000, /* R2378 - DSP1RMIX Input 2 Source */ | 1168 | { 0x094A, 0x0000 }, /* R2378 - DSP1RMIX Input 2 Source */ |
1252 | [0x094B] = 0x0080, /* R2379 - DSP1RMIX Input 2 Volume */ | 1169 | { 0x094B, 0x0080 }, /* R2379 - DSP1RMIX Input 2 Volume */ |
1253 | [0x094C] = 0x0000, /* R2380 - DSP1RMIX Input 3 Source */ | 1170 | { 0x094C, 0x0000 }, /* R2380 - DSP1RMIX Input 3 Source */ |
1254 | [0x094D] = 0x0080, /* R2381 - DSP1RMIX Input 3 Volume */ | 1171 | { 0x094D, 0x0080 }, /* R2381 - DSP1RMIX Input 3 Volume */ |
1255 | [0x094E] = 0x0000, /* R2382 - DSP1RMIX Input 4 Source */ | 1172 | { 0x094E, 0x0000 }, /* R2382 - DSP1RMIX Input 4 Source */ |
1256 | [0x094F] = 0x0080, /* R2383 - DSP1RMIX Input 4 Volume */ | 1173 | { 0x094F, 0x0080 }, /* R2383 - DSP1RMIX Input 4 Volume */ |
1257 | [0x0950] = 0x0000, /* R2384 - DSP1AUX1MIX Input 1 Source */ | 1174 | { 0x0950, 0x0000 }, /* R2384 - DSP1AUX1MIX Input 1 Source */ |
1258 | [0x0958] = 0x0000, /* R2392 - DSP1AUX2MIX Input 1 Source */ | 1175 | { 0x0958, 0x0000 }, /* R2392 - DSP1AUX2MIX Input 1 Source */ |
1259 | [0x0960] = 0x0000, /* R2400 - DSP1AUX3MIX Input 1 Source */ | 1176 | { 0x0960, 0x0000 }, /* R2400 - DSP1AUX3MIX Input 1 Source */ |
1260 | [0x0968] = 0x0000, /* R2408 - DSP1AUX4MIX Input 1 Source */ | 1177 | { 0x0968, 0x0000 }, /* R2408 - DSP1AUX4MIX Input 1 Source */ |
1261 | [0x0970] = 0x0000, /* R2416 - DSP1AUX5MIX Input 1 Source */ | 1178 | { 0x0970, 0x0000 }, /* R2416 - DSP1AUX5MIX Input 1 Source */ |
1262 | [0x0978] = 0x0000, /* R2424 - DSP1AUX6MIX Input 1 Source */ | 1179 | { 0x0978, 0x0000 }, /* R2424 - DSP1AUX6MIX Input 1 Source */ |
1263 | [0x0980] = 0x0000, /* R2432 - DSP2LMIX Input 1 Source */ | 1180 | { 0x0980, 0x0000 }, /* R2432 - DSP2LMIX Input 1 Source */ |
1264 | [0x0981] = 0x0080, /* R2433 - DSP2LMIX Input 1 Volume */ | 1181 | { 0x0981, 0x0080 }, /* R2433 - DSP2LMIX Input 1 Volume */ |
1265 | [0x0982] = 0x0000, /* R2434 - DSP2LMIX Input 2 Source */ | 1182 | { 0x0982, 0x0000 }, /* R2434 - DSP2LMIX Input 2 Source */ |
1266 | [0x0983] = 0x0080, /* R2435 - DSP2LMIX Input 2 Volume */ | 1183 | { 0x0983, 0x0080 }, /* R2435 - DSP2LMIX Input 2 Volume */ |
1267 | [0x0984] = 0x0000, /* R2436 - DSP2LMIX Input 3 Source */ | 1184 | { 0x0984, 0x0000 }, /* R2436 - DSP2LMIX Input 3 Source */ |
1268 | [0x0985] = 0x0080, /* R2437 - DSP2LMIX Input 3 Volume */ | 1185 | { 0x0985, 0x0080 }, /* R2437 - DSP2LMIX Input 3 Volume */ |
1269 | [0x0986] = 0x0000, /* R2438 - DSP2LMIX Input 4 Source */ | 1186 | { 0x0986, 0x0000 }, /* R2438 - DSP2LMIX Input 4 Source */ |
1270 | [0x0987] = 0x0080, /* R2439 - DSP2LMIX Input 4 Volume */ | 1187 | { 0x0987, 0x0080 }, /* R2439 - DSP2LMIX Input 4 Volume */ |
1271 | [0x0988] = 0x0000, /* R2440 - DSP2RMIX Input 1 Source */ | 1188 | { 0x0988, 0x0000 }, /* R2440 - DSP2RMIX Input 1 Source */ |
1272 | [0x0989] = 0x0080, /* R2441 - DSP2RMIX Input 1 Volume */ | 1189 | { 0x0989, 0x0080 }, /* R2441 - DSP2RMIX Input 1 Volume */ |
1273 | [0x098A] = 0x0000, /* R2442 - DSP2RMIX Input 2 Source */ | 1190 | { 0x098A, 0x0000 }, /* R2442 - DSP2RMIX Input 2 Source */ |
1274 | [0x098B] = 0x0080, /* R2443 - DSP2RMIX Input 2 Volume */ | 1191 | { 0x098B, 0x0080 }, /* R2443 - DSP2RMIX Input 2 Volume */ |
1275 | [0x098C] = 0x0000, /* R2444 - DSP2RMIX Input 3 Source */ | 1192 | { 0x098C, 0x0000 }, /* R2444 - DSP2RMIX Input 3 Source */ |
1276 | [0x098D] = 0x0080, /* R2445 - DSP2RMIX Input 3 Volume */ | 1193 | { 0x098D, 0x0080 }, /* R2445 - DSP2RMIX Input 3 Volume */ |
1277 | [0x098E] = 0x0000, /* R2446 - DSP2RMIX Input 4 Source */ | 1194 | { 0x098E, 0x0000 }, /* R2446 - DSP2RMIX Input 4 Source */ |
1278 | [0x098F] = 0x0080, /* R2447 - DSP2RMIX Input 4 Volume */ | 1195 | { 0x098F, 0x0080 }, /* R2447 - DSP2RMIX Input 4 Volume */ |
1279 | [0x0990] = 0x0000, /* R2448 - DSP2AUX1MIX Input 1 Source */ | 1196 | { 0x0990, 0x0000 }, /* R2448 - DSP2AUX1MIX Input 1 Source */ |
1280 | [0x0998] = 0x0000, /* R2456 - DSP2AUX2MIX Input 1 Source */ | 1197 | { 0x0998, 0x0000 }, /* R2456 - DSP2AUX2MIX Input 1 Source */ |
1281 | [0x09A0] = 0x0000, /* R2464 - DSP2AUX3MIX Input 1 Source */ | 1198 | { 0x09A0, 0x0000 }, /* R2464 - DSP2AUX3MIX Input 1 Source */ |
1282 | [0x09A8] = 0x0000, /* R2472 - DSP2AUX4MIX Input 1 Source */ | 1199 | { 0x09A8, 0x0000 }, /* R2472 - DSP2AUX4MIX Input 1 Source */ |
1283 | [0x09B0] = 0x0000, /* R2480 - DSP2AUX5MIX Input 1 Source */ | 1200 | { 0x09B0, 0x0000 }, /* R2480 - DSP2AUX5MIX Input 1 Source */ |
1284 | [0x09B8] = 0x0000, /* R2488 - DSP2AUX6MIX Input 1 Source */ | 1201 | { 0x09B8, 0x0000 }, /* R2488 - DSP2AUX6MIX Input 1 Source */ |
1285 | [0x09C0] = 0x0000, /* R2496 - DSP3LMIX Input 1 Source */ | 1202 | { 0x09C0, 0x0000 }, /* R2496 - DSP3LMIX Input 1 Source */ |
1286 | [0x09C1] = 0x0080, /* R2497 - DSP3LMIX Input 1 Volume */ | 1203 | { 0x09C1, 0x0080 }, /* R2497 - DSP3LMIX Input 1 Volume */ |
1287 | [0x09C2] = 0x0000, /* R2498 - DSP3LMIX Input 2 Source */ | 1204 | { 0x09C2, 0x0000 }, /* R2498 - DSP3LMIX Input 2 Source */ |
1288 | [0x09C3] = 0x0080, /* R2499 - DSP3LMIX Input 2 Volume */ | 1205 | { 0x09C3, 0x0080 }, /* R2499 - DSP3LMIX Input 2 Volume */ |
1289 | [0x09C4] = 0x0000, /* R2500 - DSP3LMIX Input 3 Source */ | 1206 | { 0x09C4, 0x0000 }, /* R2500 - DSP3LMIX Input 3 Source */ |
1290 | [0x09C5] = 0x0080, /* R2501 - DSP3LMIX Input 3 Volume */ | 1207 | { 0x09C5, 0x0080 }, /* R2501 - DSP3LMIX Input 3 Volume */ |
1291 | [0x09C6] = 0x0000, /* R2502 - DSP3LMIX Input 4 Source */ | 1208 | { 0x09C6, 0x0000 }, /* R2502 - DSP3LMIX Input 4 Source */ |
1292 | [0x09C7] = 0x0080, /* R2503 - DSP3LMIX Input 4 Volume */ | 1209 | { 0x09C7, 0x0080 }, /* R2503 - DSP3LMIX Input 4 Volume */ |
1293 | [0x09C8] = 0x0000, /* R2504 - DSP3RMIX Input 1 Source */ | 1210 | { 0x09C8, 0x0000 }, /* R2504 - DSP3RMIX Input 1 Source */ |
1294 | [0x09C9] = 0x0080, /* R2505 - DSP3RMIX Input 1 Volume */ | 1211 | { 0x09C9, 0x0080 }, /* R2505 - DSP3RMIX Input 1 Volume */ |
1295 | [0x09CA] = 0x0000, /* R2506 - DSP3RMIX Input 2 Source */ | 1212 | { 0x09CA, 0x0000 }, /* R2506 - DSP3RMIX Input 2 Source */ |
1296 | [0x09CB] = 0x0080, /* R2507 - DSP3RMIX Input 2 Volume */ | 1213 | { 0x09CB, 0x0080 }, /* R2507 - DSP3RMIX Input 2 Volume */ |
1297 | [0x09CC] = 0x0000, /* R2508 - DSP3RMIX Input 3 Source */ | 1214 | { 0x09CC, 0x0000 }, /* R2508 - DSP3RMIX Input 3 Source */ |
1298 | [0x09CD] = 0x0080, /* R2509 - DSP3RMIX Input 3 Volume */ | 1215 | { 0x09CD, 0x0080 }, /* R2509 - DSP3RMIX Input 3 Volume */ |
1299 | [0x09CE] = 0x0000, /* R2510 - DSP3RMIX Input 4 Source */ | 1216 | { 0x09CE, 0x0000 }, /* R2510 - DSP3RMIX Input 4 Source */ |
1300 | [0x09CF] = 0x0080, /* R2511 - DSP3RMIX Input 4 Volume */ | 1217 | { 0x09CF, 0x0080 }, /* R2511 - DSP3RMIX Input 4 Volume */ |
1301 | [0x09D0] = 0x0000, /* R2512 - DSP3AUX1MIX Input 1 Source */ | 1218 | { 0x09D0, 0x0000 }, /* R2512 - DSP3AUX1MIX Input 1 Source */ |
1302 | [0x09D8] = 0x0000, /* R2520 - DSP3AUX2MIX Input 1 Source */ | 1219 | { 0x09D8, 0x0000 }, /* R2520 - DSP3AUX2MIX Input 1 Source */ |
1303 | [0x09E0] = 0x0000, /* R2528 - DSP3AUX3MIX Input 1 Source */ | 1220 | { 0x09E0, 0x0000 }, /* R2528 - DSP3AUX3MIX Input 1 Source */ |
1304 | [0x09E8] = 0x0000, /* R2536 - DSP3AUX4MIX Input 1 Source */ | 1221 | { 0x09E8, 0x0000 }, /* R2536 - DSP3AUX4MIX Input 1 Source */ |
1305 | [0x09F0] = 0x0000, /* R2544 - DSP3AUX5MIX Input 1 Source */ | 1222 | { 0x09F0, 0x0000 }, /* R2544 - DSP3AUX5MIX Input 1 Source */ |
1306 | [0x09F8] = 0x0000, /* R2552 - DSP3AUX6MIX Input 1 Source */ | 1223 | { 0x09F8, 0x0000 }, /* R2552 - DSP3AUX6MIX Input 1 Source */ |
1307 | [0x0A80] = 0x0000, /* R2688 - ASRC1LMIX Input 1 Source */ | 1224 | { 0x0A80, 0x0000 }, /* R2688 - ASRC1LMIX Input 1 Source */ |
1308 | [0x0A88] = 0x0000, /* R2696 - ASRC1RMIX Input 1 Source */ | 1225 | { 0x0A88, 0x0000 }, /* R2696 - ASRC1RMIX Input 1 Source */ |
1309 | [0x0A90] = 0x0000, /* R2704 - ASRC2LMIX Input 1 Source */ | 1226 | { 0x0A90, 0x0000 }, /* R2704 - ASRC2LMIX Input 1 Source */ |
1310 | [0x0A98] = 0x0000, /* R2712 - ASRC2RMIX Input 1 Source */ | 1227 | { 0x0A98, 0x0000 }, /* R2712 - ASRC2RMIX Input 1 Source */ |
1311 | [0x0B00] = 0x0000, /* R2816 - ISRC1DEC1MIX Input 1 Source */ | 1228 | { 0x0B00, 0x0000 }, /* R2816 - ISRC1DEC1MIX Input 1 Source */ |
1312 | [0x0B08] = 0x0000, /* R2824 - ISRC1DEC2MIX Input 1 Source */ | 1229 | { 0x0B08, 0x0000 }, /* R2824 - ISRC1DEC2MIX Input 1 Source */ |
1313 | [0x0B10] = 0x0000, /* R2832 - ISRC1DEC3MIX Input 1 Source */ | 1230 | { 0x0B10, 0x0000 }, /* R2832 - ISRC1DEC3MIX Input 1 Source */ |
1314 | [0x0B18] = 0x0000, /* R2840 - ISRC1DEC4MIX Input 1 Source */ | 1231 | { 0x0B18, 0x0000 }, /* R2840 - ISRC1DEC4MIX Input 1 Source */ |
1315 | [0x0B20] = 0x0000, /* R2848 - ISRC1INT1MIX Input 1 Source */ | 1232 | { 0x0B20, 0x0000 }, /* R2848 - ISRC1INT1MIX Input 1 Source */ |
1316 | [0x0B28] = 0x0000, /* R2856 - ISRC1INT2MIX Input 1 Source */ | 1233 | { 0x0B28, 0x0000 }, /* R2856 - ISRC1INT2MIX Input 1 Source */ |
1317 | [0x0B30] = 0x0000, /* R2864 - ISRC1INT3MIX Input 1 Source */ | 1234 | { 0x0B30, 0x0000 }, /* R2864 - ISRC1INT3MIX Input 1 Source */ |
1318 | [0x0B38] = 0x0000, /* R2872 - ISRC1INT4MIX Input 1 Source */ | 1235 | { 0x0B38, 0x0000 }, /* R2872 - ISRC1INT4MIX Input 1 Source */ |
1319 | [0x0B40] = 0x0000, /* R2880 - ISRC2DEC1MIX Input 1 Source */ | 1236 | { 0x0B40, 0x0000 }, /* R2880 - ISRC2DEC1MIX Input 1 Source */ |
1320 | [0x0B48] = 0x0000, /* R2888 - ISRC2DEC2MIX Input 1 Source */ | 1237 | { 0x0B48, 0x0000 }, /* R2888 - ISRC2DEC2MIX Input 1 Source */ |
1321 | [0x0B50] = 0x0000, /* R2896 - ISRC2DEC3MIX Input 1 Source */ | 1238 | { 0x0B50, 0x0000 }, /* R2896 - ISRC2DEC3MIX Input 1 Source */ |
1322 | [0x0B58] = 0x0000, /* R2904 - ISRC2DEC4MIX Input 1 Source */ | 1239 | { 0x0B58, 0x0000 }, /* R2904 - ISRC2DEC4MIX Input 1 Source */ |
1323 | [0x0B60] = 0x0000, /* R2912 - ISRC2INT1MIX Input 1 Source */ | 1240 | { 0x0B60, 0x0000 }, /* R2912 - ISRC2INT1MIX Input 1 Source */ |
1324 | [0x0B68] = 0x0000, /* R2920 - ISRC2INT2MIX Input 1 Source */ | 1241 | { 0x0B68, 0x0000 }, /* R2920 - ISRC2INT2MIX Input 1 Source */ |
1325 | [0x0B70] = 0x0000, /* R2928 - ISRC2INT3MIX Input 1 Source */ | 1242 | { 0x0B70, 0x0000 }, /* R2928 - ISRC2INT3MIX Input 1 Source */ |
1326 | [0x0B78] = 0x0000, /* R2936 - ISRC2INT4MIX Input 1 Source */ | 1243 | { 0x0B78, 0x0000 }, /* R2936 - ISRC2INT4MIX Input 1 Source */ |
1327 | [0x0C00] = 0xA001, /* R3072 - GPIO CTRL 1 */ | 1244 | { 0x0C00, 0xA001 }, /* R3072 - GPIO CTRL 1 */ |
1328 | [0x0C01] = 0xA001, /* R3073 - GPIO CTRL 2 */ | 1245 | { 0x0C01, 0xA001 }, /* R3073 - GPIO CTRL 2 */ |
1329 | [0x0C02] = 0xA001, /* R3074 - GPIO CTRL 3 */ | 1246 | { 0x0C02, 0xA001 }, /* R3074 - GPIO CTRL 3 */ |
1330 | [0x0C03] = 0xA001, /* R3075 - GPIO CTRL 4 */ | 1247 | { 0x0C03, 0xA001 }, /* R3075 - GPIO CTRL 4 */ |
1331 | [0x0C04] = 0xA001, /* R3076 - GPIO CTRL 5 */ | 1248 | { 0x0C04, 0xA001 }, /* R3076 - GPIO CTRL 5 */ |
1332 | [0x0C05] = 0xA001, /* R3077 - GPIO CTRL 6 */ | 1249 | { 0x0C05, 0xA001 }, /* R3077 - GPIO CTRL 6 */ |
1333 | [0x0C23] = 0x4003, /* R3107 - Misc Pad Ctrl 1 */ | 1250 | { 0x0C23, 0x4003 }, /* R3107 - Misc Pad Ctrl 1 */ |
1334 | [0x0C24] = 0x0000, /* R3108 - Misc Pad Ctrl 2 */ | 1251 | { 0x0C24, 0x0000 }, /* R3108 - Misc Pad Ctrl 2 */ |
1335 | [0x0C25] = 0x0000, /* R3109 - Misc Pad Ctrl 3 */ | 1252 | { 0x0C25, 0x0000 }, /* R3109 - Misc Pad Ctrl 3 */ |
1336 | [0x0C26] = 0x0000, /* R3110 - Misc Pad Ctrl 4 */ | 1253 | { 0x0C26, 0x0000 }, /* R3110 - Misc Pad Ctrl 4 */ |
1337 | [0x0C27] = 0x0000, /* R3111 - Misc Pad Ctrl 5 */ | 1254 | { 0x0C27, 0x0000 }, /* R3111 - Misc Pad Ctrl 5 */ |
1338 | [0x0C28] = 0x0000, /* R3112 - Misc GPIO 1 */ | 1255 | { 0x0C28, 0x0000 }, /* R3112 - Misc GPIO 1 */ |
1339 | [0x0D00] = 0x0000, /* R3328 - Interrupt Status 1 */ | 1256 | { 0x0D00, 0x0000 }, /* R3328 - Interrupt Status 1 */ |
1340 | [0x0D01] = 0x0000, /* R3329 - Interrupt Status 2 */ | 1257 | { 0x0D01, 0x0000 }, /* R3329 - Interrupt Status 2 */ |
1341 | [0x0D02] = 0x0000, /* R3330 - Interrupt Status 3 */ | 1258 | { 0x0D02, 0x0000 }, /* R3330 - Interrupt Status 3 */ |
1342 | [0x0D03] = 0x0000, /* R3331 - Interrupt Status 4 */ | 1259 | { 0x0D03, 0x0000 }, /* R3331 - Interrupt Status 4 */ |
1343 | [0x0D04] = 0x0000, /* R3332 - Interrupt Raw Status 2 */ | 1260 | { 0x0D04, 0x0000 }, /* R3332 - Interrupt Raw Status 2 */ |
1344 | [0x0D05] = 0x0000, /* R3333 - Interrupt Raw Status 3 */ | 1261 | { 0x0D05, 0x0000 }, /* R3333 - Interrupt Raw Status 3 */ |
1345 | [0x0D06] = 0x0000, /* R3334 - Interrupt Raw Status 4 */ | 1262 | { 0x0D06, 0x0000 }, /* R3334 - Interrupt Raw Status 4 */ |
1346 | [0x0D07] = 0xFFFF, /* R3335 - Interrupt Status 1 Mask */ | 1263 | { 0x0D07, 0xFFFF }, /* R3335 - Interrupt Status 1 Mask */ |
1347 | [0x0D08] = 0xFFFF, /* R3336 - Interrupt Status 2 Mask */ | 1264 | { 0x0D08, 0xFFFF }, /* R3336 - Interrupt Status 2 Mask */ |
1348 | [0x0D09] = 0xFFFF, /* R3337 - Interrupt Status 3 Mask */ | 1265 | { 0x0D09, 0xFFFF }, /* R3337 - Interrupt Status 3 Mask */ |
1349 | [0x0D0A] = 0xFFFF, /* R3338 - Interrupt Status 4 Mask */ | 1266 | { 0x0D0A, 0xFFFF }, /* R3338 - Interrupt Status 4 Mask */ |
1350 | [0x0D1F] = 0x0000, /* R3359 - Interrupt Control */ | 1267 | { 0x0D1F, 0x0000 }, /* R3359 - Interrupt Control */ |
1351 | [0x0D20] = 0xFFFF, /* R3360 - IRQ Debounce 1 */ | 1268 | { 0x0D20, 0xFFFF }, /* R3360 - IRQ Debounce 1 */ |
1352 | [0x0D21] = 0xFFFF, /* R3361 - IRQ Debounce 2 */ | 1269 | { 0x0D21, 0xFFFF }, /* R3361 - IRQ Debounce 2 */ |
1353 | [0x0E00] = 0x0000, /* R3584 - FX_Ctrl */ | 1270 | { 0x0E00, 0x0000 }, /* R3584 - FX_Ctrl */ |
1354 | [0x0E10] = 0x6318, /* R3600 - EQ1_1 */ | 1271 | { 0x0E10, 0x6318 }, /* R3600 - EQ1_1 */ |
1355 | [0x0E11] = 0x6300, /* R3601 - EQ1_2 */ | 1272 | { 0x0E11, 0x6300 }, /* R3601 - EQ1_2 */ |
1356 | [0x0E12] = 0x0FC8, /* R3602 - EQ1_3 */ | 1273 | { 0x0E12, 0x0FC8 }, /* R3602 - EQ1_3 */ |
1357 | [0x0E13] = 0x03FE, /* R3603 - EQ1_4 */ | 1274 | { 0x0E13, 0x03FE }, /* R3603 - EQ1_4 */ |
1358 | [0x0E14] = 0x00E0, /* R3604 - EQ1_5 */ | 1275 | { 0x0E14, 0x00E0 }, /* R3604 - EQ1_5 */ |
1359 | [0x0E15] = 0x1EC4, /* R3605 - EQ1_6 */ | 1276 | { 0x0E15, 0x1EC4 }, /* R3605 - EQ1_6 */ |
1360 | [0x0E16] = 0xF136, /* R3606 - EQ1_7 */ | 1277 | { 0x0E16, 0xF136 }, /* R3606 - EQ1_7 */ |
1361 | [0x0E17] = 0x0409, /* R3607 - EQ1_8 */ | 1278 | { 0x0E17, 0x0409 }, /* R3607 - EQ1_8 */ |
1362 | [0x0E18] = 0x04CC, /* R3608 - EQ1_9 */ | 1279 | { 0x0E18, 0x04CC }, /* R3608 - EQ1_9 */ |
1363 | [0x0E19] = 0x1C9B, /* R3609 - EQ1_10 */ | 1280 | { 0x0E19, 0x1C9B }, /* R3609 - EQ1_10 */ |
1364 | [0x0E1A] = 0xF337, /* R3610 - EQ1_11 */ | 1281 | { 0x0E1A, 0xF337 }, /* R3610 - EQ1_11 */ |
1365 | [0x0E1B] = 0x040B, /* R3611 - EQ1_12 */ | 1282 | { 0x0E1B, 0x040B }, /* R3611 - EQ1_12 */ |
1366 | [0x0E1C] = 0x0CBB, /* R3612 - EQ1_13 */ | 1283 | { 0x0E1C, 0x0CBB }, /* R3612 - EQ1_13 */ |
1367 | [0x0E1D] = 0x16F8, /* R3613 - EQ1_14 */ | 1284 | { 0x0E1D, 0x16F8 }, /* R3613 - EQ1_14 */ |
1368 | [0x0E1E] = 0xF7D9, /* R3614 - EQ1_15 */ | 1285 | { 0x0E1E, 0xF7D9 }, /* R3614 - EQ1_15 */ |
1369 | [0x0E1F] = 0x040A, /* R3615 - EQ1_16 */ | 1286 | { 0x0E1F, 0x040A }, /* R3615 - EQ1_16 */ |
1370 | [0x0E20] = 0x1F14, /* R3616 - EQ1_17 */ | 1287 | { 0x0E20, 0x1F14 }, /* R3616 - EQ1_17 */ |
1371 | [0x0E21] = 0x058C, /* R3617 - EQ1_18 */ | 1288 | { 0x0E21, 0x058C }, /* R3617 - EQ1_18 */ |
1372 | [0x0E22] = 0x0563, /* R3618 - EQ1_19 */ | 1289 | { 0x0E22, 0x0563 }, /* R3618 - EQ1_19 */ |
1373 | [0x0E23] = 0x4000, /* R3619 - EQ1_20 */ | 1290 | { 0x0E23, 0x4000 }, /* R3619 - EQ1_20 */ |
1374 | [0x0E26] = 0x6318, /* R3622 - EQ2_1 */ | 1291 | { 0x0E26, 0x6318 }, /* R3622 - EQ2_1 */ |
1375 | [0x0E27] = 0x6300, /* R3623 - EQ2_2 */ | 1292 | { 0x0E27, 0x6300 }, /* R3623 - EQ2_2 */ |
1376 | [0x0E28] = 0x0FC8, /* R3624 - EQ2_3 */ | 1293 | { 0x0E28, 0x0FC8 }, /* R3624 - EQ2_3 */ |
1377 | [0x0E29] = 0x03FE, /* R3625 - EQ2_4 */ | 1294 | { 0x0E29, 0x03FE }, /* R3625 - EQ2_4 */ |
1378 | [0x0E2A] = 0x00E0, /* R3626 - EQ2_5 */ | 1295 | { 0x0E2A, 0x00E0 }, /* R3626 - EQ2_5 */ |
1379 | [0x0E2B] = 0x1EC4, /* R3627 - EQ2_6 */ | 1296 | { 0x0E2B, 0x1EC4 }, /* R3627 - EQ2_6 */ |
1380 | [0x0E2C] = 0xF136, /* R3628 - EQ2_7 */ | 1297 | { 0x0E2C, 0xF136 }, /* R3628 - EQ2_7 */ |
1381 | [0x0E2D] = 0x0409, /* R3629 - EQ2_8 */ | 1298 | { 0x0E2D, 0x0409 }, /* R3629 - EQ2_8 */ |
1382 | [0x0E2E] = 0x04CC, /* R3630 - EQ2_9 */ | 1299 | { 0x0E2E, 0x04CC }, /* R3630 - EQ2_9 */ |
1383 | [0x0E2F] = 0x1C9B, /* R3631 - EQ2_10 */ | 1300 | { 0x0E2F, 0x1C9B }, /* R3631 - EQ2_10 */ |
1384 | [0x0E30] = 0xF337, /* R3632 - EQ2_11 */ | 1301 | { 0x0E30, 0xF337 }, /* R3632 - EQ2_11 */ |
1385 | [0x0E31] = 0x040B, /* R3633 - EQ2_12 */ | 1302 | { 0x0E31, 0x040B }, /* R3633 - EQ2_12 */ |
1386 | [0x0E32] = 0x0CBB, /* R3634 - EQ2_13 */ | 1303 | { 0x0E32, 0x0CBB }, /* R3634 - EQ2_13 */ |
1387 | [0x0E33] = 0x16F8, /* R3635 - EQ2_14 */ | 1304 | { 0x0E33, 0x16F8 }, /* R3635 - EQ2_14 */ |
1388 | [0x0E34] = 0xF7D9, /* R3636 - EQ2_15 */ | 1305 | { 0x0E34, 0xF7D9 }, /* R3636 - EQ2_15 */ |
1389 | [0x0E35] = 0x040A, /* R3637 - EQ2_16 */ | 1306 | { 0x0E35, 0x040A }, /* R3637 - EQ2_16 */ |
1390 | [0x0E36] = 0x1F14, /* R3638 - EQ2_17 */ | 1307 | { 0x0E36, 0x1F14 }, /* R3638 - EQ2_17 */ |
1391 | [0x0E37] = 0x058C, /* R3639 - EQ2_18 */ | 1308 | { 0x0E37, 0x058C }, /* R3639 - EQ2_18 */ |
1392 | [0x0E38] = 0x0563, /* R3640 - EQ2_19 */ | 1309 | { 0x0E38, 0x0563 }, /* R3640 - EQ2_19 */ |
1393 | [0x0E39] = 0x4000, /* R3641 - EQ2_20 */ | 1310 | { 0x0E39, 0x4000 }, /* R3641 - EQ2_20 */ |
1394 | [0x0E3C] = 0x6318, /* R3644 - EQ3_1 */ | 1311 | { 0x0E3C, 0x6318 }, /* R3644 - EQ3_1 */ |
1395 | [0x0E3D] = 0x6300, /* R3645 - EQ3_2 */ | 1312 | { 0x0E3D, 0x6300 }, /* R3645 - EQ3_2 */ |
1396 | [0x0E3E] = 0x0FC8, /* R3646 - EQ3_3 */ | 1313 | { 0x0E3E, 0x0FC8 }, /* R3646 - EQ3_3 */ |
1397 | [0x0E3F] = 0x03FE, /* R3647 - EQ3_4 */ | 1314 | { 0x0E3F, 0x03FE }, /* R3647 - EQ3_4 */ |
1398 | [0x0E40] = 0x00E0, /* R3648 - EQ3_5 */ | 1315 | { 0x0E40, 0x00E0 }, /* R3648 - EQ3_5 */ |
1399 | [0x0E41] = 0x1EC4, /* R3649 - EQ3_6 */ | 1316 | { 0x0E41, 0x1EC4 }, /* R3649 - EQ3_6 */ |
1400 | [0x0E42] = 0xF136, /* R3650 - EQ3_7 */ | 1317 | { 0x0E42, 0xF136 }, /* R3650 - EQ3_7 */ |
1401 | [0x0E43] = 0x0409, /* R3651 - EQ3_8 */ | 1318 | { 0x0E43, 0x0409 }, /* R3651 - EQ3_8 */ |
1402 | [0x0E44] = 0x04CC, /* R3652 - EQ3_9 */ | 1319 | { 0x0E44, 0x04CC }, /* R3652 - EQ3_9 */ |
1403 | [0x0E45] = 0x1C9B, /* R3653 - EQ3_10 */ | 1320 | { 0x0E45, 0x1C9B }, /* R3653 - EQ3_10 */ |
1404 | [0x0E46] = 0xF337, /* R3654 - EQ3_11 */ | 1321 | { 0x0E46, 0xF337 }, /* R3654 - EQ3_11 */ |
1405 | [0x0E47] = 0x040B, /* R3655 - EQ3_12 */ | 1322 | { 0x0E47, 0x040B }, /* R3655 - EQ3_12 */ |
1406 | [0x0E48] = 0x0CBB, /* R3656 - EQ3_13 */ | 1323 | { 0x0E48, 0x0CBB }, /* R3656 - EQ3_13 */ |
1407 | [0x0E49] = 0x16F8, /* R3657 - EQ3_14 */ | 1324 | { 0x0E49, 0x16F8 }, /* R3657 - EQ3_14 */ |
1408 | [0x0E4A] = 0xF7D9, /* R3658 - EQ3_15 */ | 1325 | { 0x0E4A, 0xF7D9 }, /* R3658 - EQ3_15 */ |
1409 | [0x0E4B] = 0x040A, /* R3659 - EQ3_16 */ | 1326 | { 0x0E4B, 0x040A }, /* R3659 - EQ3_16 */ |
1410 | [0x0E4C] = 0x1F14, /* R3660 - EQ3_17 */ | 1327 | { 0x0E4C, 0x1F14 }, /* R3660 - EQ3_17 */ |
1411 | [0x0E4D] = 0x058C, /* R3661 - EQ3_18 */ | 1328 | { 0x0E4D, 0x058C }, /* R3661 - EQ3_18 */ |
1412 | [0x0E4E] = 0x0563, /* R3662 - EQ3_19 */ | 1329 | { 0x0E4E, 0x0563 }, /* R3662 - EQ3_19 */ |
1413 | [0x0E4F] = 0x4000, /* R3663 - EQ3_20 */ | 1330 | { 0x0E4F, 0x4000 }, /* R3663 - EQ3_20 */ |
1414 | [0x0E52] = 0x6318, /* R3666 - EQ4_1 */ | 1331 | { 0x0E52, 0x6318 }, /* R3666 - EQ4_1 */ |
1415 | [0x0E53] = 0x6300, /* R3667 - EQ4_2 */ | 1332 | { 0x0E53, 0x6300 }, /* R3667 - EQ4_2 */ |
1416 | [0x0E54] = 0x0FC8, /* R3668 - EQ4_3 */ | 1333 | { 0x0E54, 0x0FC8 }, /* R3668 - EQ4_3 */ |
1417 | [0x0E55] = 0x03FE, /* R3669 - EQ4_4 */ | 1334 | { 0x0E55, 0x03FE }, /* R3669 - EQ4_4 */ |
1418 | [0x0E56] = 0x00E0, /* R3670 - EQ4_5 */ | 1335 | { 0x0E56, 0x00E0 }, /* R3670 - EQ4_5 */ |
1419 | [0x0E57] = 0x1EC4, /* R3671 - EQ4_6 */ | 1336 | { 0x0E57, 0x1EC4 }, /* R3671 - EQ4_6 */ |
1420 | [0x0E58] = 0xF136, /* R3672 - EQ4_7 */ | 1337 | { 0x0E58, 0xF136 }, /* R3672 - EQ4_7 */ |
1421 | [0x0E59] = 0x0409, /* R3673 - EQ4_8 */ | 1338 | { 0x0E59, 0x0409 }, /* R3673 - EQ4_8 */ |
1422 | [0x0E5A] = 0x04CC, /* R3674 - EQ4_9 */ | 1339 | { 0x0E5A, 0x04CC }, /* R3674 - EQ4_9 */ |
1423 | [0x0E5B] = 0x1C9B, /* R3675 - EQ4_10 */ | 1340 | { 0x0E5B, 0x1C9B }, /* R3675 - EQ4_10 */ |
1424 | [0x0E5C] = 0xF337, /* R3676 - EQ4_11 */ | 1341 | { 0x0E5C, 0xF337 }, /* R3676 - EQ4_11 */ |
1425 | [0x0E5D] = 0x040B, /* R3677 - EQ4_12 */ | 1342 | { 0x0E5D, 0x040B }, /* R3677 - EQ4_12 */ |
1426 | [0x0E5E] = 0x0CBB, /* R3678 - EQ4_13 */ | 1343 | { 0x0E5E, 0x0CBB }, /* R3678 - EQ4_13 */ |
1427 | [0x0E5F] = 0x16F8, /* R3679 - EQ4_14 */ | 1344 | { 0x0E5F, 0x16F8 }, /* R3679 - EQ4_14 */ |
1428 | [0x0E60] = 0xF7D9, /* R3680 - EQ4_15 */ | 1345 | { 0x0E60, 0xF7D9 }, /* R3680 - EQ4_15 */ |
1429 | [0x0E61] = 0x040A, /* R3681 - EQ4_16 */ | 1346 | { 0x0E61, 0x040A }, /* R3681 - EQ4_16 */ |
1430 | [0x0E62] = 0x1F14, /* R3682 - EQ4_17 */ | 1347 | { 0x0E62, 0x1F14 }, /* R3682 - EQ4_17 */ |
1431 | [0x0E63] = 0x058C, /* R3683 - EQ4_18 */ | 1348 | { 0x0E63, 0x058C }, /* R3683 - EQ4_18 */ |
1432 | [0x0E64] = 0x0563, /* R3684 - EQ4_19 */ | 1349 | { 0x0E64, 0x0563 }, /* R3684 - EQ4_19 */ |
1433 | [0x0E65] = 0x4000, /* R3685 - EQ4_20 */ | 1350 | { 0x0E65, 0x4000 }, /* R3685 - EQ4_20 */ |
1434 | [0x0E80] = 0x0018, /* R3712 - DRC1 ctrl1 */ | 1351 | { 0x0E80, 0x0018 }, /* R3712 - DRC1 ctrl1 */ |
1435 | [0x0E81] = 0x0933, /* R3713 - DRC1 ctrl2 */ | 1352 | { 0x0E81, 0x0933 }, /* R3713 - DRC1 ctrl2 */ |
1436 | [0x0E82] = 0x0018, /* R3714 - DRC1 ctrl3 */ | 1353 | { 0x0E82, 0x0018 }, /* R3714 - DRC1 ctrl3 */ |
1437 | [0x0E83] = 0x0000, /* R3715 - DRC1 ctrl4 */ | 1354 | { 0x0E83, 0x0000 }, /* R3715 - DRC1 ctrl4 */ |
1438 | [0x0E84] = 0x0000, /* R3716 - DRC1 ctrl5 */ | 1355 | { 0x0E84, 0x0000 }, /* R3716 - DRC1 ctrl5 */ |
1439 | [0x0EC0] = 0x0000, /* R3776 - HPLPF1_1 */ | 1356 | { 0x0EC0, 0x0000 }, /* R3776 - HPLPF1_1 */ |
1440 | [0x0EC1] = 0x0000, /* R3777 - HPLPF1_2 */ | 1357 | { 0x0EC1, 0x0000 }, /* R3777 - HPLPF1_2 */ |
1441 | [0x0EC4] = 0x0000, /* R3780 - HPLPF2_1 */ | 1358 | { 0x0EC4, 0x0000 }, /* R3780 - HPLPF2_1 */ |
1442 | [0x0EC5] = 0x0000, /* R3781 - HPLPF2_2 */ | 1359 | { 0x0EC5, 0x0000 }, /* R3781 - HPLPF2_2 */ |
1443 | [0x0EC8] = 0x0000, /* R3784 - HPLPF3_1 */ | 1360 | { 0x0EC8, 0x0000 }, /* R3784 - HPLPF3_1 */ |
1444 | [0x0EC9] = 0x0000, /* R3785 - HPLPF3_2 */ | 1361 | { 0x0EC9, 0x0000 }, /* R3785 - HPLPF3_2 */ |
1445 | [0x0ECC] = 0x0000, /* R3788 - HPLPF4_1 */ | 1362 | { 0x0ECC, 0x0000 }, /* R3788 - HPLPF4_1 */ |
1446 | [0x0ECD] = 0x0000, /* R3789 - HPLPF4_2 */ | 1363 | { 0x0ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ |
1447 | [0x4000] = 0x0000, /* R16384 - DSP1 DM 0 */ | ||
1448 | [0x4001] = 0x0000, /* R16385 - DSP1 DM 1 */ | ||
1449 | [0x4002] = 0x0000, /* R16386 - DSP1 DM 2 */ | ||
1450 | [0x4003] = 0x0000, /* R16387 - DSP1 DM 3 */ | ||
1451 | [0x41FC] = 0x0000, /* R16892 - DSP1 DM 508 */ | ||
1452 | [0x41FD] = 0x0000, /* R16893 - DSP1 DM 509 */ | ||
1453 | [0x41FE] = 0x0000, /* R16894 - DSP1 DM 510 */ | ||
1454 | [0x41FF] = 0x0000, /* R16895 - DSP1 DM 511 */ | ||
1455 | [0x4800] = 0x0000, /* R18432 - DSP1 PM 0 */ | ||
1456 | [0x4801] = 0x0000, /* R18433 - DSP1 PM 1 */ | ||
1457 | [0x4802] = 0x0000, /* R18434 - DSP1 PM 2 */ | ||
1458 | [0x4803] = 0x0000, /* R18435 - DSP1 PM 3 */ | ||
1459 | [0x4804] = 0x0000, /* R18436 - DSP1 PM 4 */ | ||
1460 | [0x4805] = 0x0000, /* R18437 - DSP1 PM 5 */ | ||
1461 | [0x4DFA] = 0x0000, /* R19962 - DSP1 PM 1530 */ | ||
1462 | [0x4DFB] = 0x0000, /* R19963 - DSP1 PM 1531 */ | ||
1463 | [0x4DFC] = 0x0000, /* R19964 - DSP1 PM 1532 */ | ||
1464 | [0x4DFD] = 0x0000, /* R19965 - DSP1 PM 1533 */ | ||
1465 | [0x4DFE] = 0x0000, /* R19966 - DSP1 PM 1534 */ | ||
1466 | [0x4DFF] = 0x0000, /* R19967 - DSP1 PM 1535 */ | ||
1467 | [0x5000] = 0x0000, /* R20480 - DSP1 ZM 0 */ | ||
1468 | [0x5001] = 0x0000, /* R20481 - DSP1 ZM 1 */ | ||
1469 | [0x5002] = 0x0000, /* R20482 - DSP1 ZM 2 */ | ||
1470 | [0x5003] = 0x0000, /* R20483 - DSP1 ZM 3 */ | ||
1471 | [0x57FC] = 0x0000, /* R22524 - DSP1 ZM 2044 */ | ||
1472 | [0x57FD] = 0x0000, /* R22525 - DSP1 ZM 2045 */ | ||
1473 | [0x57FE] = 0x0000, /* R22526 - DSP1 ZM 2046 */ | ||
1474 | [0x57FF] = 0x0000, /* R22527 - DSP1 ZM 2047 */ | ||
1475 | [0x6000] = 0x0000, /* R24576 - DSP2 DM 0 */ | ||
1476 | [0x6001] = 0x0000, /* R24577 - DSP2 DM 1 */ | ||
1477 | [0x6002] = 0x0000, /* R24578 - DSP2 DM 2 */ | ||
1478 | [0x6003] = 0x0000, /* R24579 - DSP2 DM 3 */ | ||
1479 | [0x61FC] = 0x0000, /* R25084 - DSP2 DM 508 */ | ||
1480 | [0x61FD] = 0x0000, /* R25085 - DSP2 DM 509 */ | ||
1481 | [0x61FE] = 0x0000, /* R25086 - DSP2 DM 510 */ | ||
1482 | [0x61FF] = 0x0000, /* R25087 - DSP2 DM 511 */ | ||
1483 | [0x6800] = 0x0000, /* R26624 - DSP2 PM 0 */ | ||
1484 | [0x6801] = 0x0000, /* R26625 - DSP2 PM 1 */ | ||
1485 | [0x6802] = 0x0000, /* R26626 - DSP2 PM 2 */ | ||
1486 | [0x6803] = 0x0000, /* R26627 - DSP2 PM 3 */ | ||
1487 | [0x6804] = 0x0000, /* R26628 - DSP2 PM 4 */ | ||
1488 | [0x6805] = 0x0000, /* R26629 - DSP2 PM 5 */ | ||
1489 | [0x6DFA] = 0x0000, /* R28154 - DSP2 PM 1530 */ | ||
1490 | [0x6DFB] = 0x0000, /* R28155 - DSP2 PM 1531 */ | ||
1491 | [0x6DFC] = 0x0000, /* R28156 - DSP2 PM 1532 */ | ||
1492 | [0x6DFD] = 0x0000, /* R28157 - DSP2 PM 1533 */ | ||
1493 | [0x6DFE] = 0x0000, /* R28158 - DSP2 PM 1534 */ | ||
1494 | [0x6DFF] = 0x0000, /* R28159 - DSP2 PM 1535 */ | ||
1495 | [0x7000] = 0x0000, /* R28672 - DSP2 ZM 0 */ | ||
1496 | [0x7001] = 0x0000, /* R28673 - DSP2 ZM 1 */ | ||
1497 | [0x7002] = 0x0000, /* R28674 - DSP2 ZM 2 */ | ||
1498 | [0x7003] = 0x0000, /* R28675 - DSP2 ZM 3 */ | ||
1499 | [0x77FC] = 0x0000, /* R30716 - DSP2 ZM 2044 */ | ||
1500 | [0x77FD] = 0x0000, /* R30717 - DSP2 ZM 2045 */ | ||
1501 | [0x77FE] = 0x0000, /* R30718 - DSP2 ZM 2046 */ | ||
1502 | [0x77FF] = 0x0000, /* R30719 - DSP2 ZM 2047 */ | ||
1503 | [0x8000] = 0x0000, /* R32768 - DSP3 DM 0 */ | ||
1504 | [0x8001] = 0x0000, /* R32769 - DSP3 DM 1 */ | ||
1505 | [0x8002] = 0x0000, /* R32770 - DSP3 DM 2 */ | ||
1506 | [0x8003] = 0x0000, /* R32771 - DSP3 DM 3 */ | ||
1507 | [0x81FC] = 0x0000, /* R33276 - DSP3 DM 508 */ | ||
1508 | [0x81FD] = 0x0000, /* R33277 - DSP3 DM 509 */ | ||
1509 | [0x81FE] = 0x0000, /* R33278 - DSP3 DM 510 */ | ||
1510 | [0x81FF] = 0x0000, /* R33279 - DSP3 DM 511 */ | ||
1511 | [0x8800] = 0x0000, /* R34816 - DSP3 PM 0 */ | ||
1512 | [0x8801] = 0x0000, /* R34817 - DSP3 PM 1 */ | ||
1513 | [0x8802] = 0x0000, /* R34818 - DSP3 PM 2 */ | ||
1514 | [0x8803] = 0x0000, /* R34819 - DSP3 PM 3 */ | ||
1515 | [0x8804] = 0x0000, /* R34820 - DSP3 PM 4 */ | ||
1516 | [0x8805] = 0x0000, /* R34821 - DSP3 PM 5 */ | ||
1517 | [0x8DFA] = 0x0000, /* R36346 - DSP3 PM 1530 */ | ||
1518 | [0x8DFB] = 0x0000, /* R36347 - DSP3 PM 1531 */ | ||
1519 | [0x8DFC] = 0x0000, /* R36348 - DSP3 PM 1532 */ | ||
1520 | [0x8DFD] = 0x0000, /* R36349 - DSP3 PM 1533 */ | ||
1521 | [0x8DFE] = 0x0000, /* R36350 - DSP3 PM 1534 */ | ||
1522 | [0x8DFF] = 0x0000, /* R36351 - DSP3 PM 1535 */ | ||
1523 | [0x9000] = 0x0000, /* R36864 - DSP3 ZM 0 */ | ||
1524 | [0x9001] = 0x0000, /* R36865 - DSP3 ZM 1 */ | ||
1525 | [0x9002] = 0x0000, /* R36866 - DSP3 ZM 2 */ | ||
1526 | [0x9003] = 0x0000, /* R36867 - DSP3 ZM 3 */ | ||
1527 | [0x97FC] = 0x0000, /* R38908 - DSP3 ZM 2044 */ | ||
1528 | [0x97FD] = 0x0000, /* R38909 - DSP3 ZM 2045 */ | ||
1529 | [0x97FE] = 0x0000, /* R38910 - DSP3 ZM 2046 */ | ||
1530 | [0x97FF] = 0x0000 /* R38911 - DSP3 ZM 2047 */ | ||
1531 | }; | 1364 | }; |
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 42d9039a49e..8b24323d6b2 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/gcd.h> | 18 | #include <linux/gcd.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/regulator/consumer.h> | 21 | #include <linux/regulator/consumer.h> |
23 | #include <linux/regulator/fixed.h> | 22 | #include <linux/regulator/fixed.h> |
24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
@@ -51,6 +50,7 @@ struct wm5100_fll { | |||
51 | 50 | ||
52 | /* codec private data */ | 51 | /* codec private data */ |
53 | struct wm5100_priv { | 52 | struct wm5100_priv { |
53 | struct regmap *regmap; | ||
54 | struct snd_soc_codec *codec; | 54 | struct snd_soc_codec *codec; |
55 | 55 | ||
56 | struct regulator_bulk_data core_supplies[WM5100_NUM_CORE_SUPPLIES]; | 56 | struct regulator_bulk_data core_supplies[WM5100_NUM_CORE_SUPPLIES]; |
@@ -204,17 +204,15 @@ static void wm5100_free_sr(struct snd_soc_codec *codec, int rate) | |||
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | static int wm5100_reset(struct snd_soc_codec *codec) | 207 | static int wm5100_reset(struct wm5100_priv *wm5100) |
208 | { | 208 | { |
209 | struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec); | ||
210 | |||
211 | if (wm5100->pdata.reset) { | 209 | if (wm5100->pdata.reset) { |
212 | gpio_set_value_cansleep(wm5100->pdata.reset, 0); | 210 | gpio_set_value_cansleep(wm5100->pdata.reset, 0); |
213 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); | 211 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); |
214 | 212 | ||
215 | return 0; | 213 | return 0; |
216 | } else { | 214 | } else { |
217 | return snd_soc_write(codec, WM5100_SOFTWARE_RESET, 0); | 215 | return regmap_write(wm5100->regmap, WM5100_SOFTWARE_RESET, 0); |
218 | } | 216 | } |
219 | } | 217 | } |
220 | 218 | ||
@@ -954,7 +952,7 @@ SND_SOC_DAPM_INPUT("IN3L"), | |||
954 | SND_SOC_DAPM_INPUT("IN3R"), | 952 | SND_SOC_DAPM_INPUT("IN3R"), |
955 | SND_SOC_DAPM_INPUT("IN4L"), | 953 | SND_SOC_DAPM_INPUT("IN4L"), |
956 | SND_SOC_DAPM_INPUT("IN4R"), | 954 | SND_SOC_DAPM_INPUT("IN4R"), |
957 | SND_SOC_DAPM_INPUT("TONE"), | 955 | SND_SOC_DAPM_SIGGEN("TONE"), |
958 | 956 | ||
959 | SND_SOC_DAPM_PGA_E("IN1L PGA", WM5100_INPUT_ENABLES, WM5100_IN1L_ENA_SHIFT, 0, | 957 | SND_SOC_DAPM_PGA_E("IN1L PGA", WM5100_INPUT_ENABLES, WM5100_IN1L_ENA_SHIFT, 0, |
960 | NULL, 0, wm5100_out_ev, SND_SOC_DAPM_POST_PMU), | 958 | NULL, 0, wm5100_out_ev, SND_SOC_DAPM_POST_PMU), |
@@ -1375,7 +1373,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1375 | msleep(2); | 1373 | msleep(2); |
1376 | } | 1374 | } |
1377 | 1375 | ||
1378 | codec->cache_only = false; | 1376 | regcache_cache_only(wm5100->regmap, false); |
1379 | 1377 | ||
1380 | switch (wm5100->rev) { | 1378 | switch (wm5100->rev) { |
1381 | case 0: | 1379 | case 0: |
@@ -1399,7 +1397,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1399 | break; | 1397 | break; |
1400 | } | 1398 | } |
1401 | 1399 | ||
1402 | snd_soc_cache_sync(codec); | 1400 | regcache_sync(wm5100->regmap); |
1403 | } | 1401 | } |
1404 | break; | 1402 | break; |
1405 | 1403 | ||
@@ -1662,7 +1660,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, | |||
1662 | return 0; | 1660 | return 0; |
1663 | } | 1661 | } |
1664 | 1662 | ||
1665 | static struct snd_soc_dai_ops wm5100_dai_ops = { | 1663 | static const struct snd_soc_dai_ops wm5100_dai_ops = { |
1666 | .set_fmt = wm5100_set_fmt, | 1664 | .set_fmt = wm5100_set_fmt, |
1667 | .hw_params = wm5100_hw_params, | 1665 | .hw_params = wm5100_hw_params, |
1668 | }; | 1666 | }; |
@@ -1993,6 +1991,9 @@ static int wm5100_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
1993 | else | 1991 | else |
1994 | timeout = 50; | 1992 | timeout = 50; |
1995 | 1993 | ||
1994 | snd_soc_update_bits(codec, WM5100_CLOCKING_3, WM5100_SYSCLK_ENA, | ||
1995 | WM5100_SYSCLK_ENA); | ||
1996 | |||
1996 | /* Poll for the lock; will use interrupt when we can test */ | 1997 | /* Poll for the lock; will use interrupt when we can test */ |
1997 | for (i = 0; i < timeout; i++) { | 1998 | for (i = 0; i < timeout; i++) { |
1998 | if (i2c->irq) { | 1999 | if (i2c->irq) { |
@@ -2350,24 +2351,22 @@ static inline struct wm5100_priv *gpio_to_wm5100(struct gpio_chip *chip) | |||
2350 | static void wm5100_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 2351 | static void wm5100_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
2351 | { | 2352 | { |
2352 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); | 2353 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); |
2353 | struct snd_soc_codec *codec = wm5100->codec; | ||
2354 | 2354 | ||
2355 | snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, | 2355 | regmap_update_bits(wm5100->regmap, WM5100_GPIO_CTRL_1 + offset, |
2356 | WM5100_GP1_LVL, !!value << WM5100_GP1_LVL_SHIFT); | 2356 | WM5100_GP1_LVL, !!value << WM5100_GP1_LVL_SHIFT); |
2357 | } | 2357 | } |
2358 | 2358 | ||
2359 | static int wm5100_gpio_direction_out(struct gpio_chip *chip, | 2359 | static int wm5100_gpio_direction_out(struct gpio_chip *chip, |
2360 | unsigned offset, int value) | 2360 | unsigned offset, int value) |
2361 | { | 2361 | { |
2362 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); | 2362 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); |
2363 | struct snd_soc_codec *codec = wm5100->codec; | ||
2364 | int val, ret; | 2363 | int val, ret; |
2365 | 2364 | ||
2366 | val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT); | 2365 | val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT); |
2367 | 2366 | ||
2368 | ret = snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, | 2367 | ret = regmap_update_bits(wm5100->regmap, WM5100_GPIO_CTRL_1 + offset, |
2369 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR | | 2368 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR | |
2370 | WM5100_GP1_LVL, val); | 2369 | WM5100_GP1_LVL, val); |
2371 | if (ret < 0) | 2370 | if (ret < 0) |
2372 | return ret; | 2371 | return ret; |
2373 | else | 2372 | else |
@@ -2377,25 +2376,24 @@ static int wm5100_gpio_direction_out(struct gpio_chip *chip, | |||
2377 | static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset) | 2376 | static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset) |
2378 | { | 2377 | { |
2379 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); | 2378 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); |
2380 | struct snd_soc_codec *codec = wm5100->codec; | 2379 | unsigned int reg; |
2381 | int ret; | 2380 | int ret; |
2382 | 2381 | ||
2383 | ret = snd_soc_read(codec, WM5100_GPIO_CTRL_1 + offset); | 2382 | ret = regmap_read(wm5100->regmap, WM5100_GPIO_CTRL_1 + offset, ®); |
2384 | if (ret < 0) | 2383 | if (ret < 0) |
2385 | return ret; | 2384 | return ret; |
2386 | 2385 | ||
2387 | return (ret & WM5100_GP1_LVL) != 0; | 2386 | return (reg & WM5100_GP1_LVL) != 0; |
2388 | } | 2387 | } |
2389 | 2388 | ||
2390 | static int wm5100_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | 2389 | static int wm5100_gpio_direction_in(struct gpio_chip *chip, unsigned offset) |
2391 | { | 2390 | { |
2392 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); | 2391 | struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); |
2393 | struct snd_soc_codec *codec = wm5100->codec; | ||
2394 | 2392 | ||
2395 | return snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, | 2393 | return regmap_update_bits(wm5100->regmap, WM5100_GPIO_CTRL_1 + offset, |
2396 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR, | 2394 | WM5100_GP1_FN_MASK | WM5100_GP1_DIR, |
2397 | (1 << WM5100_GP1_FN_SHIFT) | | 2395 | (1 << WM5100_GP1_FN_SHIFT) | |
2398 | (1 << WM5100_GP1_DIR_SHIFT)); | 2396 | (1 << WM5100_GP1_DIR_SHIFT)); |
2399 | } | 2397 | } |
2400 | 2398 | ||
2401 | static struct gpio_chip wm5100_template_chip = { | 2399 | static struct gpio_chip wm5100_template_chip = { |
@@ -2408,14 +2406,14 @@ static struct gpio_chip wm5100_template_chip = { | |||
2408 | .can_sleep = 1, | 2406 | .can_sleep = 1, |
2409 | }; | 2407 | }; |
2410 | 2408 | ||
2411 | static void wm5100_init_gpio(struct snd_soc_codec *codec) | 2409 | static void wm5100_init_gpio(struct i2c_client *i2c) |
2412 | { | 2410 | { |
2413 | struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec); | 2411 | struct wm5100_priv *wm5100 = i2c_get_clientdata(i2c); |
2414 | int ret; | 2412 | int ret; |
2415 | 2413 | ||
2416 | wm5100->gpio_chip = wm5100_template_chip; | 2414 | wm5100->gpio_chip = wm5100_template_chip; |
2417 | wm5100->gpio_chip.ngpio = 6; | 2415 | wm5100->gpio_chip.ngpio = 6; |
2418 | wm5100->gpio_chip.dev = codec->dev; | 2416 | wm5100->gpio_chip.dev = &i2c->dev; |
2419 | 2417 | ||
2420 | if (wm5100->pdata.gpio_base) | 2418 | if (wm5100->pdata.gpio_base) |
2421 | wm5100->gpio_chip.base = wm5100->pdata.gpio_base; | 2419 | wm5100->gpio_chip.base = wm5100->pdata.gpio_base; |
@@ -2424,24 +2422,24 @@ static void wm5100_init_gpio(struct snd_soc_codec *codec) | |||
2424 | 2422 | ||
2425 | ret = gpiochip_add(&wm5100->gpio_chip); | 2423 | ret = gpiochip_add(&wm5100->gpio_chip); |
2426 | if (ret != 0) | 2424 | if (ret != 0) |
2427 | dev_err(codec->dev, "Failed to add GPIOs: %d\n", ret); | 2425 | dev_err(&i2c->dev, "Failed to add GPIOs: %d\n", ret); |
2428 | } | 2426 | } |
2429 | 2427 | ||
2430 | static void wm5100_free_gpio(struct snd_soc_codec *codec) | 2428 | static void wm5100_free_gpio(struct i2c_client *i2c) |
2431 | { | 2429 | { |
2432 | struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec); | 2430 | struct wm5100_priv *wm5100 = i2c_get_clientdata(i2c); |
2433 | int ret; | 2431 | int ret; |
2434 | 2432 | ||
2435 | ret = gpiochip_remove(&wm5100->gpio_chip); | 2433 | ret = gpiochip_remove(&wm5100->gpio_chip); |
2436 | if (ret != 0) | 2434 | if (ret != 0) |
2437 | dev_err(codec->dev, "Failed to remove GPIOs: %d\n", ret); | 2435 | dev_err(&i2c->dev, "Failed to remove GPIOs: %d\n", ret); |
2438 | } | 2436 | } |
2439 | #else | 2437 | #else |
2440 | static void wm5100_init_gpio(struct snd_soc_codec *codec) | 2438 | static void wm5100_init_gpio(struct i2c_client *i2c) |
2441 | { | 2439 | { |
2442 | } | 2440 | } |
2443 | 2441 | ||
2444 | static void wm5100_free_gpio(struct snd_soc_codec *codec) | 2442 | static void wm5100_free_gpio(struct i2c_client *i2c) |
2445 | { | 2443 | { |
2446 | } | 2444 | } |
2447 | #endif | 2445 | #endif |
@@ -2453,131 +2451,21 @@ static int wm5100_probe(struct snd_soc_codec *codec) | |||
2453 | int ret, i, irq_flags; | 2451 | int ret, i, irq_flags; |
2454 | 2452 | ||
2455 | wm5100->codec = codec; | 2453 | wm5100->codec = codec; |
2454 | codec->control_data = wm5100->regmap; | ||
2456 | 2455 | ||
2457 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_I2C); | 2456 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); |
2458 | if (ret != 0) { | 2457 | if (ret != 0) { |
2459 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 2458 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
2460 | return ret; | 2459 | return ret; |
2461 | } | 2460 | } |
2462 | 2461 | ||
2463 | for (i = 0; i < ARRAY_SIZE(wm5100->core_supplies); i++) | 2462 | regcache_cache_only(wm5100->regmap, true); |
2464 | wm5100->core_supplies[i].supply = wm5100_core_supply_names[i]; | ||
2465 | |||
2466 | ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm5100->core_supplies), | ||
2467 | wm5100->core_supplies); | ||
2468 | if (ret != 0) { | ||
2469 | dev_err(codec->dev, "Failed to request core supplies: %d\n", | ||
2470 | ret); | ||
2471 | return ret; | ||
2472 | } | ||
2473 | |||
2474 | wm5100->cpvdd = regulator_get(&i2c->dev, "CPVDD"); | ||
2475 | if (IS_ERR(wm5100->cpvdd)) { | ||
2476 | ret = PTR_ERR(wm5100->cpvdd); | ||
2477 | dev_err(&i2c->dev, "Failed to get CPVDD: %d\n", ret); | ||
2478 | goto err_core; | ||
2479 | } | ||
2480 | |||
2481 | wm5100->dbvdd2 = regulator_get(&i2c->dev, "DBVDD2"); | ||
2482 | if (IS_ERR(wm5100->dbvdd2)) { | ||
2483 | ret = PTR_ERR(wm5100->dbvdd2); | ||
2484 | dev_err(&i2c->dev, "Failed to get DBVDD2: %d\n", ret); | ||
2485 | goto err_cpvdd; | ||
2486 | } | ||
2487 | 2463 | ||
2488 | wm5100->dbvdd3 = regulator_get(&i2c->dev, "DBVDD3"); | ||
2489 | if (IS_ERR(wm5100->dbvdd3)) { | ||
2490 | ret = PTR_ERR(wm5100->dbvdd3); | ||
2491 | dev_err(&i2c->dev, "Failed to get DBVDD2: %d\n", ret); | ||
2492 | goto err_dbvdd2; | ||
2493 | } | ||
2494 | |||
2495 | ret = regulator_bulk_enable(ARRAY_SIZE(wm5100->core_supplies), | ||
2496 | wm5100->core_supplies); | ||
2497 | if (ret != 0) { | ||
2498 | dev_err(codec->dev, "Failed to enable core supplies: %d\n", | ||
2499 | ret); | ||
2500 | goto err_dbvdd3; | ||
2501 | } | ||
2502 | |||
2503 | if (wm5100->pdata.ldo_ena) { | ||
2504 | ret = gpio_request_one(wm5100->pdata.ldo_ena, | ||
2505 | GPIOF_OUT_INIT_HIGH, "WM5100 LDOENA"); | ||
2506 | if (ret < 0) { | ||
2507 | dev_err(&i2c->dev, "Failed to request LDOENA %d: %d\n", | ||
2508 | wm5100->pdata.ldo_ena, ret); | ||
2509 | goto err_enable; | ||
2510 | } | ||
2511 | msleep(2); | ||
2512 | } | ||
2513 | |||
2514 | if (wm5100->pdata.reset) { | ||
2515 | ret = gpio_request_one(wm5100->pdata.reset, | ||
2516 | GPIOF_OUT_INIT_HIGH, "WM5100 /RESET"); | ||
2517 | if (ret < 0) { | ||
2518 | dev_err(&i2c->dev, "Failed to request /RESET %d: %d\n", | ||
2519 | wm5100->pdata.reset, ret); | ||
2520 | goto err_ldo; | ||
2521 | } | ||
2522 | } | ||
2523 | |||
2524 | ret = snd_soc_read(codec, WM5100_SOFTWARE_RESET); | ||
2525 | if (ret < 0) { | ||
2526 | dev_err(codec->dev, "Failed to read ID register\n"); | ||
2527 | goto err_reset; | ||
2528 | } | ||
2529 | switch (ret) { | ||
2530 | case 0x8997: | ||
2531 | case 0x5100: | ||
2532 | break; | ||
2533 | |||
2534 | default: | ||
2535 | dev_err(codec->dev, "Device is not a WM5100, ID is %x\n", ret); | ||
2536 | ret = -EINVAL; | ||
2537 | goto err_reset; | ||
2538 | } | ||
2539 | |||
2540 | ret = snd_soc_read(codec, WM5100_DEVICE_REVISION); | ||
2541 | if (ret < 0) { | ||
2542 | dev_err(codec->dev, "Failed to read revision register\n"); | ||
2543 | goto err_reset; | ||
2544 | } | ||
2545 | wm5100->rev = ret & WM5100_DEVICE_REVISION_MASK; | ||
2546 | |||
2547 | dev_info(codec->dev, "revision %c\n", wm5100->rev + 'A'); | ||
2548 | |||
2549 | ret = wm5100_reset(codec); | ||
2550 | if (ret < 0) { | ||
2551 | dev_err(codec->dev, "Failed to issue reset\n"); | ||
2552 | goto err_reset; | ||
2553 | } | ||
2554 | |||
2555 | codec->cache_only = true; | ||
2556 | |||
2557 | wm5100_init_gpio(codec); | ||
2558 | 2464 | ||
2559 | for (i = 0; i < ARRAY_SIZE(wm5100_dig_vu); i++) | 2465 | for (i = 0; i < ARRAY_SIZE(wm5100_dig_vu); i++) |
2560 | snd_soc_update_bits(codec, wm5100_dig_vu[i], WM5100_OUT_VU, | 2466 | snd_soc_update_bits(codec, wm5100_dig_vu[i], WM5100_OUT_VU, |
2561 | WM5100_OUT_VU); | 2467 | WM5100_OUT_VU); |
2562 | 2468 | ||
2563 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { | ||
2564 | snd_soc_update_bits(codec, WM5100_IN1L_CONTROL, | ||
2565 | WM5100_IN1_MODE_MASK | | ||
2566 | WM5100_IN1_DMIC_SUP_MASK, | ||
2567 | (wm5100->pdata.in_mode[i] << | ||
2568 | WM5100_IN1_MODE_SHIFT) | | ||
2569 | (wm5100->pdata.dmic_sup[i] << | ||
2570 | WM5100_IN1_DMIC_SUP_SHIFT)); | ||
2571 | } | ||
2572 | |||
2573 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.gpio_defaults); i++) { | ||
2574 | if (!wm5100->pdata.gpio_defaults[i]) | ||
2575 | continue; | ||
2576 | |||
2577 | snd_soc_write(codec, WM5100_GPIO_CTRL_1 + i, | ||
2578 | wm5100->pdata.gpio_defaults[i]); | ||
2579 | } | ||
2580 | |||
2581 | /* Don't debounce interrupts to support use of SYSCLK only */ | 2469 | /* Don't debounce interrupts to support use of SYSCLK only */ |
2582 | snd_soc_write(codec, WM5100_IRQ_DEBOUNCE_1, 0); | 2470 | snd_soc_write(codec, WM5100_IRQ_DEBOUNCE_1, 0); |
2583 | snd_soc_write(codec, WM5100_IRQ_DEBOUNCE_2, 0); | 2471 | snd_soc_write(codec, WM5100_IRQ_DEBOUNCE_2, 0); |
@@ -2662,29 +2550,6 @@ static int wm5100_probe(struct snd_soc_codec *codec) | |||
2662 | err_gpio: | 2550 | err_gpio: |
2663 | if (i2c->irq) | 2551 | if (i2c->irq) |
2664 | free_irq(i2c->irq, codec); | 2552 | free_irq(i2c->irq, codec); |
2665 | wm5100_free_gpio(codec); | ||
2666 | err_reset: | ||
2667 | if (wm5100->pdata.reset) { | ||
2668 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); | ||
2669 | gpio_free(wm5100->pdata.reset); | ||
2670 | } | ||
2671 | err_ldo: | ||
2672 | if (wm5100->pdata.ldo_ena) { | ||
2673 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | ||
2674 | gpio_free(wm5100->pdata.ldo_ena); | ||
2675 | } | ||
2676 | err_enable: | ||
2677 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), | ||
2678 | wm5100->core_supplies); | ||
2679 | err_dbvdd3: | ||
2680 | regulator_put(wm5100->dbvdd3); | ||
2681 | err_dbvdd2: | ||
2682 | regulator_put(wm5100->dbvdd2); | ||
2683 | err_cpvdd: | ||
2684 | regulator_put(wm5100->cpvdd); | ||
2685 | err_core: | ||
2686 | regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), | ||
2687 | wm5100->core_supplies); | ||
2688 | 2553 | ||
2689 | return ret; | 2554 | return ret; |
2690 | } | 2555 | } |
@@ -2700,23 +2565,16 @@ static int wm5100_remove(struct snd_soc_codec *codec) | |||
2700 | } | 2565 | } |
2701 | if (i2c->irq) | 2566 | if (i2c->irq) |
2702 | free_irq(i2c->irq, codec); | 2567 | free_irq(i2c->irq, codec); |
2703 | wm5100_free_gpio(codec); | ||
2704 | if (wm5100->pdata.reset) { | ||
2705 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); | ||
2706 | gpio_free(wm5100->pdata.reset); | ||
2707 | } | ||
2708 | if (wm5100->pdata.ldo_ena) { | ||
2709 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | ||
2710 | gpio_free(wm5100->pdata.ldo_ena); | ||
2711 | } | ||
2712 | regulator_put(wm5100->dbvdd3); | ||
2713 | regulator_put(wm5100->dbvdd2); | ||
2714 | regulator_put(wm5100->cpvdd); | ||
2715 | regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), | ||
2716 | wm5100->core_supplies); | ||
2717 | return 0; | 2568 | return 0; |
2718 | } | 2569 | } |
2719 | 2570 | ||
2571 | static int wm5100_soc_volatile(struct snd_soc_codec *codec, | ||
2572 | unsigned int reg) | ||
2573 | { | ||
2574 | return true; | ||
2575 | } | ||
2576 | |||
2577 | |||
2720 | static struct snd_soc_codec_driver soc_codec_dev_wm5100 = { | 2578 | static struct snd_soc_codec_driver soc_codec_dev_wm5100 = { |
2721 | .probe = wm5100_probe, | 2579 | .probe = wm5100_probe, |
2722 | .remove = wm5100_remove, | 2580 | .remove = wm5100_remove, |
@@ -2725,6 +2583,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm5100 = { | |||
2725 | .set_pll = wm5100_set_fll, | 2583 | .set_pll = wm5100_set_fll, |
2726 | .set_bias_level = wm5100_set_bias_level, | 2584 | .set_bias_level = wm5100_set_bias_level, |
2727 | .idle_bias_off = 1, | 2585 | .idle_bias_off = 1, |
2586 | .reg_cache_size = WM5100_MAX_REGISTER, | ||
2587 | .volatile_register = wm5100_soc_volatile, | ||
2728 | 2588 | ||
2729 | .seq_notifier = wm5100_seq_notifier, | 2589 | .seq_notifier = wm5100_seq_notifier, |
2730 | .controls = wm5100_snd_controls, | 2590 | .controls = wm5100_snd_controls, |
@@ -2733,14 +2593,18 @@ static struct snd_soc_codec_driver soc_codec_dev_wm5100 = { | |||
2733 | .num_dapm_widgets = ARRAY_SIZE(wm5100_dapm_widgets), | 2593 | .num_dapm_widgets = ARRAY_SIZE(wm5100_dapm_widgets), |
2734 | .dapm_routes = wm5100_dapm_routes, | 2594 | .dapm_routes = wm5100_dapm_routes, |
2735 | .num_dapm_routes = ARRAY_SIZE(wm5100_dapm_routes), | 2595 | .num_dapm_routes = ARRAY_SIZE(wm5100_dapm_routes), |
2596 | }; | ||
2736 | 2597 | ||
2737 | .reg_cache_size = ARRAY_SIZE(wm5100_reg_defaults), | 2598 | static const struct regmap_config wm5100_regmap = { |
2738 | .reg_word_size = sizeof(u16), | 2599 | .reg_bits = 16, |
2739 | .compress_type = SND_SOC_RBTREE_COMPRESSION, | 2600 | .val_bits = 16, |
2740 | .reg_cache_default = wm5100_reg_defaults, | ||
2741 | 2601 | ||
2742 | .volatile_register = wm5100_volatile_register, | 2602 | .max_register = WM5100_MAX_REGISTER, |
2743 | .readable_register = wm5100_readable_register, | 2603 | .reg_defaults = wm5100_reg_defaults, |
2604 | .num_reg_defaults = ARRAY_SIZE(wm5100_reg_defaults), | ||
2605 | .volatile_reg = wm5100_volatile_register, | ||
2606 | .readable_reg = wm5100_readable_register, | ||
2607 | .cache_type = REGCACHE_RBTREE, | ||
2744 | }; | 2608 | }; |
2745 | 2609 | ||
2746 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | 2610 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, |
@@ -2748,12 +2612,22 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | |||
2748 | { | 2612 | { |
2749 | struct wm5100_pdata *pdata = dev_get_platdata(&i2c->dev); | 2613 | struct wm5100_pdata *pdata = dev_get_platdata(&i2c->dev); |
2750 | struct wm5100_priv *wm5100; | 2614 | struct wm5100_priv *wm5100; |
2615 | unsigned int reg; | ||
2751 | int ret, i; | 2616 | int ret, i; |
2752 | 2617 | ||
2753 | wm5100 = kzalloc(sizeof(struct wm5100_priv), GFP_KERNEL); | 2618 | wm5100 = devm_kzalloc(&i2c->dev, sizeof(struct wm5100_priv), |
2619 | GFP_KERNEL); | ||
2754 | if (wm5100 == NULL) | 2620 | if (wm5100 == NULL) |
2755 | return -ENOMEM; | 2621 | return -ENOMEM; |
2756 | 2622 | ||
2623 | wm5100->regmap = regmap_init_i2c(i2c, &wm5100_regmap); | ||
2624 | if (IS_ERR(wm5100->regmap)) { | ||
2625 | ret = PTR_ERR(wm5100->regmap); | ||
2626 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | ||
2627 | ret); | ||
2628 | goto err; | ||
2629 | } | ||
2630 | |||
2757 | for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++) | 2631 | for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++) |
2758 | init_completion(&wm5100->fll[i].lock); | 2632 | init_completion(&wm5100->fll[i].lock); |
2759 | 2633 | ||
@@ -2762,21 +2636,178 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | |||
2762 | 2636 | ||
2763 | i2c_set_clientdata(i2c, wm5100); | 2637 | i2c_set_clientdata(i2c, wm5100); |
2764 | 2638 | ||
2639 | for (i = 0; i < ARRAY_SIZE(wm5100->core_supplies); i++) | ||
2640 | wm5100->core_supplies[i].supply = wm5100_core_supply_names[i]; | ||
2641 | |||
2642 | ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm5100->core_supplies), | ||
2643 | wm5100->core_supplies); | ||
2644 | if (ret != 0) { | ||
2645 | dev_err(&i2c->dev, "Failed to request core supplies: %d\n", | ||
2646 | ret); | ||
2647 | goto err_regmap; | ||
2648 | } | ||
2649 | |||
2650 | wm5100->cpvdd = regulator_get(&i2c->dev, "CPVDD"); | ||
2651 | if (IS_ERR(wm5100->cpvdd)) { | ||
2652 | ret = PTR_ERR(wm5100->cpvdd); | ||
2653 | dev_err(&i2c->dev, "Failed to get CPVDD: %d\n", ret); | ||
2654 | goto err_core; | ||
2655 | } | ||
2656 | |||
2657 | wm5100->dbvdd2 = regulator_get(&i2c->dev, "DBVDD2"); | ||
2658 | if (IS_ERR(wm5100->dbvdd2)) { | ||
2659 | ret = PTR_ERR(wm5100->dbvdd2); | ||
2660 | dev_err(&i2c->dev, "Failed to get DBVDD2: %d\n", ret); | ||
2661 | goto err_cpvdd; | ||
2662 | } | ||
2663 | |||
2664 | wm5100->dbvdd3 = regulator_get(&i2c->dev, "DBVDD3"); | ||
2665 | if (IS_ERR(wm5100->dbvdd3)) { | ||
2666 | ret = PTR_ERR(wm5100->dbvdd3); | ||
2667 | dev_err(&i2c->dev, "Failed to get DBVDD2: %d\n", ret); | ||
2668 | goto err_dbvdd2; | ||
2669 | } | ||
2670 | |||
2671 | ret = regulator_bulk_enable(ARRAY_SIZE(wm5100->core_supplies), | ||
2672 | wm5100->core_supplies); | ||
2673 | if (ret != 0) { | ||
2674 | dev_err(&i2c->dev, "Failed to enable core supplies: %d\n", | ||
2675 | ret); | ||
2676 | goto err_dbvdd3; | ||
2677 | } | ||
2678 | |||
2679 | if (wm5100->pdata.ldo_ena) { | ||
2680 | ret = gpio_request_one(wm5100->pdata.ldo_ena, | ||
2681 | GPIOF_OUT_INIT_HIGH, "WM5100 LDOENA"); | ||
2682 | if (ret < 0) { | ||
2683 | dev_err(&i2c->dev, "Failed to request LDOENA %d: %d\n", | ||
2684 | wm5100->pdata.ldo_ena, ret); | ||
2685 | goto err_enable; | ||
2686 | } | ||
2687 | msleep(2); | ||
2688 | } | ||
2689 | |||
2690 | if (wm5100->pdata.reset) { | ||
2691 | ret = gpio_request_one(wm5100->pdata.reset, | ||
2692 | GPIOF_OUT_INIT_HIGH, "WM5100 /RESET"); | ||
2693 | if (ret < 0) { | ||
2694 | dev_err(&i2c->dev, "Failed to request /RESET %d: %d\n", | ||
2695 | wm5100->pdata.reset, ret); | ||
2696 | goto err_ldo; | ||
2697 | } | ||
2698 | } | ||
2699 | |||
2700 | ret = regmap_read(wm5100->regmap, WM5100_SOFTWARE_RESET, ®); | ||
2701 | if (ret < 0) { | ||
2702 | dev_err(&i2c->dev, "Failed to read ID register\n"); | ||
2703 | goto err_reset; | ||
2704 | } | ||
2705 | switch (reg) { | ||
2706 | case 0x8997: | ||
2707 | case 0x5100: | ||
2708 | break; | ||
2709 | |||
2710 | default: | ||
2711 | dev_err(&i2c->dev, "Device is not a WM5100, ID is %x\n", reg); | ||
2712 | ret = -EINVAL; | ||
2713 | goto err_reset; | ||
2714 | } | ||
2715 | |||
2716 | ret = regmap_read(wm5100->regmap, WM5100_DEVICE_REVISION, ®); | ||
2717 | if (ret < 0) { | ||
2718 | dev_err(&i2c->dev, "Failed to read revision register\n"); | ||
2719 | goto err_reset; | ||
2720 | } | ||
2721 | wm5100->rev = reg & WM5100_DEVICE_REVISION_MASK; | ||
2722 | |||
2723 | dev_info(&i2c->dev, "revision %c\n", wm5100->rev + 'A'); | ||
2724 | |||
2725 | ret = wm5100_reset(wm5100); | ||
2726 | if (ret < 0) { | ||
2727 | dev_err(&i2c->dev, "Failed to issue reset\n"); | ||
2728 | goto err_reset; | ||
2729 | } | ||
2730 | |||
2731 | wm5100_init_gpio(i2c); | ||
2732 | |||
2733 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.gpio_defaults); i++) { | ||
2734 | if (!wm5100->pdata.gpio_defaults[i]) | ||
2735 | continue; | ||
2736 | |||
2737 | regmap_write(wm5100->regmap, WM5100_GPIO_CTRL_1 + i, | ||
2738 | wm5100->pdata.gpio_defaults[i]); | ||
2739 | } | ||
2740 | |||
2741 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { | ||
2742 | regmap_update_bits(wm5100->regmap, WM5100_IN1L_CONTROL, | ||
2743 | WM5100_IN1_MODE_MASK | | ||
2744 | WM5100_IN1_DMIC_SUP_MASK, | ||
2745 | (wm5100->pdata.in_mode[i] << | ||
2746 | WM5100_IN1_MODE_SHIFT) | | ||
2747 | (wm5100->pdata.dmic_sup[i] << | ||
2748 | WM5100_IN1_DMIC_SUP_SHIFT)); | ||
2749 | } | ||
2750 | |||
2765 | ret = snd_soc_register_codec(&i2c->dev, | 2751 | ret = snd_soc_register_codec(&i2c->dev, |
2766 | &soc_codec_dev_wm5100, wm5100_dai, | 2752 | &soc_codec_dev_wm5100, wm5100_dai, |
2767 | ARRAY_SIZE(wm5100_dai)); | 2753 | ARRAY_SIZE(wm5100_dai)); |
2768 | if (ret < 0) { | 2754 | if (ret < 0) { |
2769 | dev_err(&i2c->dev, "Failed to register WM5100: %d\n", ret); | 2755 | dev_err(&i2c->dev, "Failed to register WM5100: %d\n", ret); |
2770 | kfree(wm5100); | 2756 | goto err_reset; |
2771 | } | 2757 | } |
2772 | 2758 | ||
2773 | return ret; | 2759 | return ret; |
2760 | |||
2761 | err_reset: | ||
2762 | wm5100_free_gpio(i2c); | ||
2763 | if (wm5100->pdata.reset) { | ||
2764 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); | ||
2765 | gpio_free(wm5100->pdata.reset); | ||
2766 | } | ||
2767 | err_ldo: | ||
2768 | if (wm5100->pdata.ldo_ena) { | ||
2769 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | ||
2770 | gpio_free(wm5100->pdata.ldo_ena); | ||
2771 | } | ||
2772 | err_enable: | ||
2773 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), | ||
2774 | wm5100->core_supplies); | ||
2775 | err_dbvdd3: | ||
2776 | regulator_put(wm5100->dbvdd3); | ||
2777 | err_dbvdd2: | ||
2778 | regulator_put(wm5100->dbvdd2); | ||
2779 | err_cpvdd: | ||
2780 | regulator_put(wm5100->cpvdd); | ||
2781 | err_core: | ||
2782 | regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), | ||
2783 | wm5100->core_supplies); | ||
2784 | err_regmap: | ||
2785 | regmap_exit(wm5100->regmap); | ||
2786 | err: | ||
2787 | return ret; | ||
2774 | } | 2788 | } |
2775 | 2789 | ||
2776 | static __devexit int wm5100_i2c_remove(struct i2c_client *client) | 2790 | static __devexit int wm5100_i2c_remove(struct i2c_client *client) |
2777 | { | 2791 | { |
2792 | struct wm5100_priv *wm5100 = i2c_get_clientdata(client); | ||
2793 | |||
2778 | snd_soc_unregister_codec(&client->dev); | 2794 | snd_soc_unregister_codec(&client->dev); |
2779 | kfree(i2c_get_clientdata(client)); | 2795 | wm5100_free_gpio(client); |
2796 | if (wm5100->pdata.reset) { | ||
2797 | gpio_set_value_cansleep(wm5100->pdata.reset, 1); | ||
2798 | gpio_free(wm5100->pdata.reset); | ||
2799 | } | ||
2800 | if (wm5100->pdata.ldo_ena) { | ||
2801 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | ||
2802 | gpio_free(wm5100->pdata.ldo_ena); | ||
2803 | } | ||
2804 | regulator_put(wm5100->dbvdd3); | ||
2805 | regulator_put(wm5100->dbvdd2); | ||
2806 | regulator_put(wm5100->cpvdd); | ||
2807 | regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), | ||
2808 | wm5100->core_supplies); | ||
2809 | regmap_exit(wm5100->regmap); | ||
2810 | |||
2780 | return 0; | 2811 | return 0; |
2781 | } | 2812 | } |
2782 | 2813 | ||
diff --git a/sound/soc/codecs/wm5100.h b/sound/soc/codecs/wm5100.h index 970759636bd..25cb6016f9d 100644 --- a/sound/soc/codecs/wm5100.h +++ b/sound/soc/codecs/wm5100.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define WM5100_ASOC_H | 15 | #define WM5100_ASOC_H |
16 | 16 | ||
17 | #include <sound/soc.h> | 17 | #include <sound/soc.h> |
18 | #include <linux/regmap.h> | ||
18 | 19 | ||
19 | int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); | 20 | int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); |
20 | 21 | ||
@@ -5147,9 +5148,9 @@ int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); | |||
5147 | #define WM5100_DSP3_ZM_END_SHIFT 0 /* DSP3_ZM_END - [15:0] */ | 5148 | #define WM5100_DSP3_ZM_END_SHIFT 0 /* DSP3_ZM_END - [15:0] */ |
5148 | #define WM5100_DSP3_ZM_END_WIDTH 16 /* DSP3_ZM_END - [15:0] */ | 5149 | #define WM5100_DSP3_ZM_END_WIDTH 16 /* DSP3_ZM_END - [15:0] */ |
5149 | 5150 | ||
5150 | int wm5100_readable_register(struct snd_soc_codec *codec, unsigned int reg); | 5151 | bool wm5100_readable_register(struct device *dev, unsigned int reg); |
5151 | int wm5100_volatile_register(struct snd_soc_codec *codec, unsigned int reg); | 5152 | bool wm5100_volatile_register(struct device *dev, unsigned int reg); |
5152 | 5153 | ||
5153 | extern u16 wm5100_reg_defaults[WM5100_MAX_REGISTER + 1]; | 5154 | extern struct reg_default wm5100_reg_defaults[WM5100_REGISTER_COUNT]; |
5154 | 5155 | ||
5155 | #endif | 5156 | #endif |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 35f3ad83dfb..8c4c9591ec0 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -696,7 +696,7 @@ static const struct snd_soc_dapm_widget wm8350_dapm_widgets[] = { | |||
696 | SND_SOC_DAPM_INPUT("IN3L"), | 696 | SND_SOC_DAPM_INPUT("IN3L"), |
697 | }; | 697 | }; |
698 | 698 | ||
699 | static const struct snd_soc_dapm_route audio_map[] = { | 699 | static const struct snd_soc_dapm_route wm8350_dapm_routes[] = { |
700 | 700 | ||
701 | /* left playback mixer */ | 701 | /* left playback mixer */ |
702 | {"Left Playback Mixer", "Playback Switch", "Left DAC"}, | 702 | {"Left Playback Mixer", "Playback Switch", "Left DAC"}, |
@@ -777,29 +777,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
777 | {"Beep", NULL, "IN3R PGA"}, | 777 | {"Beep", NULL, "IN3R PGA"}, |
778 | }; | 778 | }; |
779 | 779 | ||
780 | static int wm8350_add_widgets(struct snd_soc_codec *codec) | ||
781 | { | ||
782 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
783 | int ret; | ||
784 | |||
785 | ret = snd_soc_dapm_new_controls(dapm, | ||
786 | wm8350_dapm_widgets, | ||
787 | ARRAY_SIZE(wm8350_dapm_widgets)); | ||
788 | if (ret != 0) { | ||
789 | dev_err(codec->dev, "dapm control register failed\n"); | ||
790 | return ret; | ||
791 | } | ||
792 | |||
793 | /* set up audio paths */ | ||
794 | ret = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
795 | if (ret != 0) { | ||
796 | dev_err(codec->dev, "DAPM route register failed\n"); | ||
797 | return ret; | ||
798 | } | ||
799 | |||
800 | return 0; | ||
801 | } | ||
802 | |||
803 | static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 780 | static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, |
804 | int clk_id, unsigned int freq, int dir) | 781 | int clk_id, unsigned int freq, int dir) |
805 | { | 782 | { |
@@ -1315,7 +1292,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec, | |||
1315 | return 0; | 1292 | return 0; |
1316 | } | 1293 | } |
1317 | 1294 | ||
1318 | static int wm8350_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1295 | static int wm8350_suspend(struct snd_soc_codec *codec) |
1319 | { | 1296 | { |
1320 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1297 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1321 | return 0; | 1298 | return 0; |
@@ -1511,7 +1488,7 @@ EXPORT_SYMBOL_GPL(wm8350_mic_jack_detect); | |||
1511 | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1488 | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1512 | SNDRV_PCM_FMTBIT_S24_LE) | 1489 | SNDRV_PCM_FMTBIT_S24_LE) |
1513 | 1490 | ||
1514 | static struct snd_soc_dai_ops wm8350_dai_ops = { | 1491 | static const struct snd_soc_dai_ops wm8350_dai_ops = { |
1515 | .hw_params = wm8350_pcm_hw_params, | 1492 | .hw_params = wm8350_pcm_hw_params, |
1516 | .digital_mute = wm8350_mute, | 1493 | .digital_mute = wm8350_mute, |
1517 | .trigger = wm8350_pcm_trigger, | 1494 | .trigger = wm8350_pcm_trigger, |
@@ -1553,7 +1530,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1553 | return -EINVAL; | 1530 | return -EINVAL; |
1554 | } | 1531 | } |
1555 | 1532 | ||
1556 | priv = kzalloc(sizeof(struct wm8350_data), GFP_KERNEL); | 1533 | priv = devm_kzalloc(codec->dev, sizeof(struct wm8350_data), |
1534 | GFP_KERNEL); | ||
1557 | if (priv == NULL) | 1535 | if (priv == NULL) |
1558 | return -ENOMEM; | 1536 | return -ENOMEM; |
1559 | snd_soc_codec_set_drvdata(codec, priv); | 1537 | snd_soc_codec_set_drvdata(codec, priv); |
@@ -1564,7 +1542,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1564 | ret = regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies), | 1542 | ret = regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies), |
1565 | priv->supplies); | 1543 | priv->supplies); |
1566 | if (ret != 0) | 1544 | if (ret != 0) |
1567 | goto err_priv; | 1545 | return ret; |
1568 | 1546 | ||
1569 | wm8350->codec.codec = codec; | 1547 | wm8350->codec.codec = codec; |
1570 | codec->control_data = wm8350; | 1548 | codec->control_data = wm8350; |
@@ -1633,17 +1611,9 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1633 | wm8350_mic_handler, 0, "Microphone detect", priv); | 1611 | wm8350_mic_handler, 0, "Microphone detect", priv); |
1634 | 1612 | ||
1635 | 1613 | ||
1636 | snd_soc_add_controls(codec, wm8350_snd_controls, | ||
1637 | ARRAY_SIZE(wm8350_snd_controls)); | ||
1638 | wm8350_add_widgets(codec); | ||
1639 | |||
1640 | wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1614 | wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1641 | 1615 | ||
1642 | return 0; | 1616 | return 0; |
1643 | |||
1644 | err_priv: | ||
1645 | kfree(priv); | ||
1646 | return ret; | ||
1647 | } | 1617 | } |
1648 | 1618 | ||
1649 | static int wm8350_codec_remove(struct snd_soc_codec *codec) | 1619 | static int wm8350_codec_remove(struct snd_soc_codec *codec) |
@@ -1676,7 +1646,7 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) | |||
1676 | wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); | 1646 | wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); |
1677 | 1647 | ||
1678 | regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies); | 1648 | regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies); |
1679 | kfree(priv); | 1649 | |
1680 | return 0; | 1650 | return 0; |
1681 | } | 1651 | } |
1682 | 1652 | ||
@@ -1688,6 +1658,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8350 = { | |||
1688 | .read = wm8350_codec_read, | 1658 | .read = wm8350_codec_read, |
1689 | .write = wm8350_codec_write, | 1659 | .write = wm8350_codec_write, |
1690 | .set_bias_level = wm8350_set_bias_level, | 1660 | .set_bias_level = wm8350_set_bias_level, |
1661 | |||
1662 | .controls = wm8350_snd_controls, | ||
1663 | .num_controls = ARRAY_SIZE(wm8350_snd_controls), | ||
1664 | .dapm_widgets = wm8350_dapm_widgets, | ||
1665 | .num_dapm_widgets = ARRAY_SIZE(wm8350_dapm_widgets), | ||
1666 | .dapm_routes = wm8350_dapm_routes, | ||
1667 | .num_dapm_routes = ARRAY_SIZE(wm8350_dapm_routes), | ||
1691 | }; | 1668 | }; |
1692 | 1669 | ||
1693 | static int __devinit wm8350_probe(struct platform_device *pdev) | 1670 | static int __devinit wm8350_probe(struct platform_device *pdev) |
@@ -1711,17 +1688,7 @@ static struct platform_driver wm8350_codec_driver = { | |||
1711 | .remove = __devexit_p(wm8350_remove), | 1688 | .remove = __devexit_p(wm8350_remove), |
1712 | }; | 1689 | }; |
1713 | 1690 | ||
1714 | static __init int wm8350_init(void) | 1691 | module_platform_driver(wm8350_codec_driver); |
1715 | { | ||
1716 | return platform_driver_register(&wm8350_codec_driver); | ||
1717 | } | ||
1718 | module_init(wm8350_init); | ||
1719 | |||
1720 | static __exit void wm8350_exit(void) | ||
1721 | { | ||
1722 | platform_driver_unregister(&wm8350_codec_driver); | ||
1723 | } | ||
1724 | module_exit(wm8350_exit); | ||
1725 | 1692 | ||
1726 | MODULE_DESCRIPTION("ASoC WM8350 driver"); | 1693 | MODULE_DESCRIPTION("ASoC WM8350 driver"); |
1727 | MODULE_AUTHOR("Liam Girdwood"); | 1694 | MODULE_AUTHOR("Liam Girdwood"); |
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c index dc13be2a09c..898979d2301 100644 --- a/sound/soc/codecs/wm8400.c +++ b/sound/soc/codecs/wm8400.c | |||
@@ -353,13 +353,6 @@ SOC_SINGLE("RIN34 Mute Switch", WM8400_RIGHT_LINE_INPUT_3_4_VOLUME, | |||
353 | 353 | ||
354 | }; | 354 | }; |
355 | 355 | ||
356 | /* add non dapm controls */ | ||
357 | static int wm8400_add_controls(struct snd_soc_codec *codec) | ||
358 | { | ||
359 | return snd_soc_add_controls(codec, wm8400_snd_controls, | ||
360 | ARRAY_SIZE(wm8400_snd_controls)); | ||
361 | } | ||
362 | |||
363 | /* | 356 | /* |
364 | * _DAPM_ Controls | 357 | * _DAPM_ Controls |
365 | */ | 358 | */ |
@@ -766,8 +759,8 @@ SND_SOC_DAPM_PGA("ROPGA", WM8400_POWER_MANAGEMENT_3, WM8400_ROPGA_ENA_SHIFT, 0, | |||
766 | NULL, 0), | 759 | NULL, 0), |
767 | 760 | ||
768 | /* MICBIAS */ | 761 | /* MICBIAS */ |
769 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8400_POWER_MANAGEMENT_1, | 762 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8400_POWER_MANAGEMENT_1, |
770 | WM8400_MIC1BIAS_ENA_SHIFT, 0), | 763 | WM8400_MIC1BIAS_ENA_SHIFT, 0, NULL, 0), |
771 | 764 | ||
772 | SND_SOC_DAPM_OUTPUT("LON"), | 765 | SND_SOC_DAPM_OUTPUT("LON"), |
773 | SND_SOC_DAPM_OUTPUT("LOP"), | 766 | SND_SOC_DAPM_OUTPUT("LOP"), |
@@ -783,7 +776,7 @@ SND_SOC_DAPM_OUTPUT("RON"), | |||
783 | SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), | 776 | SND_SOC_DAPM_OUTPUT("Internal DAC Sink"), |
784 | }; | 777 | }; |
785 | 778 | ||
786 | static const struct snd_soc_dapm_route audio_map[] = { | 779 | static const struct snd_soc_dapm_route wm8400_dapm_routes[] = { |
787 | /* Make DACs turn on when playing even if not mixed into any outputs */ | 780 | /* Make DACs turn on when playing even if not mixed into any outputs */ |
788 | {"Internal DAC Sink", NULL, "Left DAC"}, | 781 | {"Internal DAC Sink", NULL, "Left DAC"}, |
789 | {"Internal DAC Sink", NULL, "Right DAC"}, | 782 | {"Internal DAC Sink", NULL, "Right DAC"}, |
@@ -909,17 +902,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
909 | {"RON", NULL, "RONMIX"}, | 902 | {"RON", NULL, "RONMIX"}, |
910 | }; | 903 | }; |
911 | 904 | ||
912 | static int wm8400_add_widgets(struct snd_soc_codec *codec) | ||
913 | { | ||
914 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
915 | |||
916 | snd_soc_dapm_new_controls(dapm, wm8400_dapm_widgets, | ||
917 | ARRAY_SIZE(wm8400_dapm_widgets)); | ||
918 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
919 | |||
920 | return 0; | ||
921 | } | ||
922 | |||
923 | /* | 905 | /* |
924 | * Clock after FLL and dividers | 906 | * Clock after FLL and dividers |
925 | */ | 907 | */ |
@@ -1059,7 +1041,7 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
1059 | wm8400_write(codec, WM8400_FLL_CONTROL_3, factors.n); | 1041 | wm8400_write(codec, WM8400_FLL_CONTROL_3, factors.n); |
1060 | 1042 | ||
1061 | reg = wm8400_read(codec, WM8400_FLL_CONTROL_4); | 1043 | reg = wm8400_read(codec, WM8400_FLL_CONTROL_4); |
1062 | reg &= WM8400_FLL_OUTDIV_MASK; | 1044 | reg &= ~WM8400_FLL_OUTDIV_MASK; |
1063 | reg |= factors.outdiv; | 1045 | reg |= factors.outdiv; |
1064 | wm8400_write(codec, WM8400_FLL_CONTROL_4, reg); | 1046 | wm8400_write(codec, WM8400_FLL_CONTROL_4, reg); |
1065 | 1047 | ||
@@ -1316,7 +1298,7 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec, | |||
1316 | #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1298 | #define WM8400_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1317 | SNDRV_PCM_FMTBIT_S24_LE) | 1299 | SNDRV_PCM_FMTBIT_S24_LE) |
1318 | 1300 | ||
1319 | static struct snd_soc_dai_ops wm8400_dai_ops = { | 1301 | static const struct snd_soc_dai_ops wm8400_dai_ops = { |
1320 | .hw_params = wm8400_hw_params, | 1302 | .hw_params = wm8400_hw_params, |
1321 | .digital_mute = wm8400_mute, | 1303 | .digital_mute = wm8400_mute, |
1322 | .set_fmt = wm8400_set_dai_fmt, | 1304 | .set_fmt = wm8400_set_dai_fmt, |
@@ -1352,7 +1334,7 @@ static struct snd_soc_dai_driver wm8400_dai = { | |||
1352 | .ops = &wm8400_dai_ops, | 1334 | .ops = &wm8400_dai_ops, |
1353 | }; | 1335 | }; |
1354 | 1336 | ||
1355 | static int wm8400_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1337 | static int wm8400_suspend(struct snd_soc_codec *codec) |
1356 | { | 1338 | { |
1357 | wm8400_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1339 | wm8400_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1358 | 1340 | ||
@@ -1383,7 +1365,8 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec) | |||
1383 | int ret; | 1365 | int ret; |
1384 | u16 reg; | 1366 | u16 reg; |
1385 | 1367 | ||
1386 | priv = kzalloc(sizeof(struct wm8400_priv), GFP_KERNEL); | 1368 | priv = devm_kzalloc(codec->dev, sizeof(struct wm8400_priv), |
1369 | GFP_KERNEL); | ||
1387 | if (priv == NULL) | 1370 | if (priv == NULL) |
1388 | return -ENOMEM; | 1371 | return -ENOMEM; |
1389 | 1372 | ||
@@ -1395,7 +1378,7 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec) | |||
1395 | ARRAY_SIZE(power), &power[0]); | 1378 | ARRAY_SIZE(power), &power[0]); |
1396 | if (ret != 0) { | 1379 | if (ret != 0) { |
1397 | dev_err(codec->dev, "Failed to get regulators: %d\n", ret); | 1380 | dev_err(codec->dev, "Failed to get regulators: %d\n", ret); |
1398 | goto err; | 1381 | return ret; |
1399 | } | 1382 | } |
1400 | 1383 | ||
1401 | INIT_WORK(&priv->work, wm8400_probe_deferred); | 1384 | INIT_WORK(&priv->work, wm8400_probe_deferred); |
@@ -1420,20 +1403,15 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec) | |||
1420 | ret = -EINVAL; | 1403 | ret = -EINVAL; |
1421 | goto err_regulator; | 1404 | goto err_regulator; |
1422 | } | 1405 | } |
1423 | wm8400_add_controls(codec); | ||
1424 | wm8400_add_widgets(codec); | ||
1425 | return 0; | 1406 | return 0; |
1426 | 1407 | ||
1427 | err_regulator: | 1408 | err_regulator: |
1428 | regulator_bulk_free(ARRAY_SIZE(power), power); | 1409 | regulator_bulk_free(ARRAY_SIZE(power), power); |
1429 | err: | ||
1430 | kfree(priv); | ||
1431 | return ret; | 1410 | return ret; |
1432 | } | 1411 | } |
1433 | 1412 | ||
1434 | static int wm8400_codec_remove(struct snd_soc_codec *codec) | 1413 | static int wm8400_codec_remove(struct snd_soc_codec *codec) |
1435 | { | 1414 | { |
1436 | struct wm8400_priv *priv = snd_soc_codec_get_drvdata(codec); | ||
1437 | u16 reg; | 1415 | u16 reg; |
1438 | 1416 | ||
1439 | reg = wm8400_read(codec, WM8400_POWER_MANAGEMENT_1); | 1417 | reg = wm8400_read(codec, WM8400_POWER_MANAGEMENT_1); |
@@ -1441,7 +1419,6 @@ static int wm8400_codec_remove(struct snd_soc_codec *codec) | |||
1441 | reg & (~WM8400_CODEC_ENA)); | 1419 | reg & (~WM8400_CODEC_ENA)); |
1442 | 1420 | ||
1443 | regulator_bulk_free(ARRAY_SIZE(power), power); | 1421 | regulator_bulk_free(ARRAY_SIZE(power), power); |
1444 | kfree(priv); | ||
1445 | 1422 | ||
1446 | return 0; | 1423 | return 0; |
1447 | } | 1424 | } |
@@ -1454,6 +1431,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8400 = { | |||
1454 | .read = wm8400_read, | 1431 | .read = wm8400_read, |
1455 | .write = wm8400_write, | 1432 | .write = wm8400_write, |
1456 | .set_bias_level = wm8400_set_bias_level, | 1433 | .set_bias_level = wm8400_set_bias_level, |
1434 | |||
1435 | .controls = wm8400_snd_controls, | ||
1436 | .num_controls = ARRAY_SIZE(wm8400_snd_controls), | ||
1437 | .dapm_widgets = wm8400_dapm_widgets, | ||
1438 | .num_dapm_widgets = ARRAY_SIZE(wm8400_dapm_widgets), | ||
1439 | .dapm_routes = wm8400_dapm_routes, | ||
1440 | .num_dapm_routes = ARRAY_SIZE(wm8400_dapm_routes), | ||
1457 | }; | 1441 | }; |
1458 | 1442 | ||
1459 | static int __devinit wm8400_probe(struct platform_device *pdev) | 1443 | static int __devinit wm8400_probe(struct platform_device *pdev) |
@@ -1477,17 +1461,7 @@ static struct platform_driver wm8400_codec_driver = { | |||
1477 | .remove = __devexit_p(wm8400_remove), | 1461 | .remove = __devexit_p(wm8400_remove), |
1478 | }; | 1462 | }; |
1479 | 1463 | ||
1480 | static __init int wm8400_init(void) | 1464 | module_platform_driver(wm8400_codec_driver); |
1481 | { | ||
1482 | return platform_driver_register(&wm8400_codec_driver); | ||
1483 | } | ||
1484 | module_init(wm8400_init); | ||
1485 | |||
1486 | static __exit void wm8400_exit(void) | ||
1487 | { | ||
1488 | platform_driver_unregister(&wm8400_codec_driver); | ||
1489 | } | ||
1490 | module_exit(wm8400_exit); | ||
1491 | 1465 | ||
1492 | MODULE_DESCRIPTION("ASoC WM8400 driver"); | 1466 | MODULE_DESCRIPTION("ASoC WM8400 driver"); |
1493 | MODULE_AUTHOR("Mark Brown"); | 1467 | MODULE_AUTHOR("Mark Brown"); |
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 07c9cc759e9..9166126bd31 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <linux/of_device.h> | 22 | #include <linux/of_device.h> |
@@ -182,7 +181,7 @@ SND_SOC_DAPM_OUTPUT("SPKOUTP"), | |||
182 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | 181 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), |
183 | }; | 182 | }; |
184 | 183 | ||
185 | static const struct snd_soc_dapm_route audio_map[] = { | 184 | static const struct snd_soc_dapm_route wm8510_dapm_routes[] = { |
186 | /* Mono output mixer */ | 185 | /* Mono output mixer */ |
187 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, | 186 | {"Mono Mixer", "PCM Playback Switch", "DAC"}, |
188 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, | 187 | {"Mono Mixer", "Aux Playback Switch", "Aux Input"}, |
@@ -214,17 +213,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
214 | {"ADC", NULL, "Boost Mixer"}, | 213 | {"ADC", NULL, "Boost Mixer"}, |
215 | }; | 214 | }; |
216 | 215 | ||
217 | static int wm8510_add_widgets(struct snd_soc_codec *codec) | ||
218 | { | ||
219 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
220 | |||
221 | snd_soc_dapm_new_controls(dapm, wm8510_dapm_widgets, | ||
222 | ARRAY_SIZE(wm8510_dapm_widgets)); | ||
223 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
224 | |||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | struct pll_ { | 216 | struct pll_ { |
229 | unsigned int pre_div:4; /* prescale - 1 */ | 217 | unsigned int pre_div:4; /* prescale - 1 */ |
230 | unsigned int n:4; | 218 | unsigned int n:4; |
@@ -509,7 +497,7 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec, | |||
509 | #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 497 | #define WM8510_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
510 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 498 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
511 | 499 | ||
512 | static struct snd_soc_dai_ops wm8510_dai_ops = { | 500 | static const struct snd_soc_dai_ops wm8510_dai_ops = { |
513 | .hw_params = wm8510_pcm_hw_params, | 501 | .hw_params = wm8510_pcm_hw_params, |
514 | .digital_mute = wm8510_mute, | 502 | .digital_mute = wm8510_mute, |
515 | .set_fmt = wm8510_set_dai_fmt, | 503 | .set_fmt = wm8510_set_dai_fmt, |
@@ -535,7 +523,7 @@ static struct snd_soc_dai_driver wm8510_dai = { | |||
535 | .symmetric_rates = 1, | 523 | .symmetric_rates = 1, |
536 | }; | 524 | }; |
537 | 525 | ||
538 | static int wm8510_suspend(struct snd_soc_codec *codec, pm_message_t state) | 526 | static int wm8510_suspend(struct snd_soc_codec *codec) |
539 | { | 527 | { |
540 | wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF); | 528 | wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF); |
541 | return 0; | 529 | return 0; |
@@ -562,9 +550,6 @@ static int wm8510_probe(struct snd_soc_codec *codec) | |||
562 | 550 | ||
563 | /* power on device */ | 551 | /* power on device */ |
564 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 552 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
565 | snd_soc_add_controls(codec, wm8510_snd_controls, | ||
566 | ARRAY_SIZE(wm8510_snd_controls)); | ||
567 | wm8510_add_widgets(codec); | ||
568 | 553 | ||
569 | return ret; | 554 | return ret; |
570 | } | 555 | } |
@@ -588,6 +573,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8510 = { | |||
588 | .reg_cache_size = ARRAY_SIZE(wm8510_reg), | 573 | .reg_cache_size = ARRAY_SIZE(wm8510_reg), |
589 | .reg_word_size = sizeof(u16), | 574 | .reg_word_size = sizeof(u16), |
590 | .reg_cache_default =wm8510_reg, | 575 | .reg_cache_default =wm8510_reg, |
576 | |||
577 | .controls = wm8510_snd_controls, | ||
578 | .num_controls = ARRAY_SIZE(wm8510_snd_controls), | ||
579 | .dapm_widgets = wm8510_dapm_widgets, | ||
580 | .num_dapm_widgets = ARRAY_SIZE(wm8510_dapm_widgets), | ||
581 | .dapm_routes = wm8510_dapm_routes, | ||
582 | .num_dapm_routes = ARRAY_SIZE(wm8510_dapm_routes), | ||
591 | }; | 583 | }; |
592 | 584 | ||
593 | static const struct of_device_id wm8510_of_match[] = { | 585 | static const struct of_device_id wm8510_of_match[] = { |
@@ -667,7 +659,7 @@ MODULE_DEVICE_TABLE(i2c, wm8510_i2c_id); | |||
667 | 659 | ||
668 | static struct i2c_driver wm8510_i2c_driver = { | 660 | static struct i2c_driver wm8510_i2c_driver = { |
669 | .driver = { | 661 | .driver = { |
670 | .name = "wm8510-codec", | 662 | .name = "wm8510", |
671 | .owner = THIS_MODULE, | 663 | .owner = THIS_MODULE, |
672 | .of_match_table = wm8510_of_match, | 664 | .of_match_table = wm8510_of_match, |
673 | }, | 665 | }, |
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index db7a6819499..7fea2c3bf7e 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/regulator/consumer.h> | 20 | #include <linux/regulator/consumer.h> |
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <linux/of_device.h> | 22 | #include <linux/of_device.h> |
@@ -365,7 +364,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, | |||
365 | #define WM8523_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 364 | #define WM8523_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
366 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 365 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
367 | 366 | ||
368 | static struct snd_soc_dai_ops wm8523_dai_ops = { | 367 | static const struct snd_soc_dai_ops wm8523_dai_ops = { |
369 | .startup = wm8523_startup, | 368 | .startup = wm8523_startup, |
370 | .hw_params = wm8523_hw_params, | 369 | .hw_params = wm8523_hw_params, |
371 | .set_sysclk = wm8523_set_dai_sysclk, | 370 | .set_sysclk = wm8523_set_dai_sysclk, |
@@ -385,7 +384,7 @@ static struct snd_soc_dai_driver wm8523_dai = { | |||
385 | }; | 384 | }; |
386 | 385 | ||
387 | #ifdef CONFIG_PM | 386 | #ifdef CONFIG_PM |
388 | static int wm8523_suspend(struct snd_soc_codec *codec, pm_message_t state) | 387 | static int wm8523_suspend(struct snd_soc_codec *codec) |
389 | { | 388 | { |
390 | wm8523_set_bias_level(codec, SND_SOC_BIAS_OFF); | 389 | wm8523_set_bias_level(codec, SND_SOC_BIAS_OFF); |
391 | return 0; | 390 | return 0; |
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 8212b3c8bfd..211285164d7 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/platform_device.h> | ||
27 | #include <linux/regulator/consumer.h> | 26 | #include <linux/regulator/consumer.h> |
28 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
29 | #include <linux/of_device.h> | 28 | #include <linux/of_device.h> |
@@ -273,7 +272,7 @@ SND_SOC_DAPM_INPUT("AINL"), | |||
273 | SND_SOC_DAPM_INPUT("AINR"), | 272 | SND_SOC_DAPM_INPUT("AINR"), |
274 | }; | 273 | }; |
275 | 274 | ||
276 | static const struct snd_soc_dapm_route audio_map[] = { | 275 | static const struct snd_soc_dapm_route wm8580_dapm_routes[] = { |
277 | { "VOUT1L", NULL, "DAC1" }, | 276 | { "VOUT1L", NULL, "DAC1" }, |
278 | { "VOUT1R", NULL, "DAC1" }, | 277 | { "VOUT1R", NULL, "DAC1" }, |
279 | 278 | ||
@@ -287,17 +286,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
287 | { "ADC", NULL, "AINR" }, | 286 | { "ADC", NULL, "AINR" }, |
288 | }; | 287 | }; |
289 | 288 | ||
290 | static int wm8580_add_widgets(struct snd_soc_codec *codec) | ||
291 | { | ||
292 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
293 | |||
294 | snd_soc_dapm_new_controls(dapm, wm8580_dapm_widgets, | ||
295 | ARRAY_SIZE(wm8580_dapm_widgets)); | ||
296 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
297 | |||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | /* PLL divisors */ | 289 | /* PLL divisors */ |
302 | struct _pll_div { | 290 | struct _pll_div { |
303 | u32 prescale:1; | 291 | u32 prescale:1; |
@@ -682,7 +670,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
682 | { | 670 | { |
683 | struct snd_soc_codec *codec = dai->codec; | 671 | struct snd_soc_codec *codec = dai->codec; |
684 | struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); | 672 | struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); |
685 | int sel, sel_mask, sel_shift; | 673 | int ret, sel, sel_mask, sel_shift; |
686 | 674 | ||
687 | switch (dai->driver->id) { | 675 | switch (dai->driver->id) { |
688 | case WM8580_DAI_PAIFRX: | 676 | case WM8580_DAI_PAIFRX: |
@@ -723,7 +711,11 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
723 | /* We really should validate PLL settings but not yet */ | 711 | /* We really should validate PLL settings but not yet */ |
724 | wm8580->sysclk[dai->driver->id] = freq; | 712 | wm8580->sysclk[dai->driver->id] = freq; |
725 | 713 | ||
726 | return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel); | 714 | ret = snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel); |
715 | if (ret < 0) | ||
716 | return ret; | ||
717 | |||
718 | return 0; | ||
727 | } | 719 | } |
728 | 720 | ||
729 | static int wm8580_digital_mute(struct snd_soc_dai *codec_dai, int mute) | 721 | static int wm8580_digital_mute(struct snd_soc_dai *codec_dai, int mute) |
@@ -776,7 +768,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
776 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 768 | #define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
777 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 769 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
778 | 770 | ||
779 | static struct snd_soc_dai_ops wm8580_dai_ops_playback = { | 771 | static const struct snd_soc_dai_ops wm8580_dai_ops_playback = { |
780 | .set_sysclk = wm8580_set_sysclk, | 772 | .set_sysclk = wm8580_set_sysclk, |
781 | .hw_params = wm8580_paif_hw_params, | 773 | .hw_params = wm8580_paif_hw_params, |
782 | .set_fmt = wm8580_set_paif_dai_fmt, | 774 | .set_fmt = wm8580_set_paif_dai_fmt, |
@@ -785,7 +777,7 @@ static struct snd_soc_dai_ops wm8580_dai_ops_playback = { | |||
785 | .digital_mute = wm8580_digital_mute, | 777 | .digital_mute = wm8580_digital_mute, |
786 | }; | 778 | }; |
787 | 779 | ||
788 | static struct snd_soc_dai_ops wm8580_dai_ops_capture = { | 780 | static const struct snd_soc_dai_ops wm8580_dai_ops_capture = { |
789 | .set_sysclk = wm8580_set_sysclk, | 781 | .set_sysclk = wm8580_set_sysclk, |
790 | .hw_params = wm8580_paif_hw_params, | 782 | .hw_params = wm8580_paif_hw_params, |
791 | .set_fmt = wm8580_set_paif_dai_fmt, | 783 | .set_fmt = wm8580_set_paif_dai_fmt, |
@@ -857,10 +849,6 @@ static int wm8580_probe(struct snd_soc_codec *codec) | |||
857 | 849 | ||
858 | wm8580_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 850 | wm8580_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
859 | 851 | ||
860 | snd_soc_add_controls(codec, wm8580_snd_controls, | ||
861 | ARRAY_SIZE(wm8580_snd_controls)); | ||
862 | wm8580_add_widgets(codec); | ||
863 | |||
864 | return 0; | 852 | return 0; |
865 | 853 | ||
866 | err_regulator_enable: | 854 | err_regulator_enable: |
@@ -890,6 +878,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8580 = { | |||
890 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), | 878 | .reg_cache_size = ARRAY_SIZE(wm8580_reg), |
891 | .reg_word_size = sizeof(u16), | 879 | .reg_word_size = sizeof(u16), |
892 | .reg_cache_default = wm8580_reg, | 880 | .reg_cache_default = wm8580_reg, |
881 | |||
882 | .controls = wm8580_snd_controls, | ||
883 | .num_controls = ARRAY_SIZE(wm8580_snd_controls), | ||
884 | .dapm_widgets = wm8580_dapm_widgets, | ||
885 | .num_dapm_widgets = ARRAY_SIZE(wm8580_dapm_widgets), | ||
886 | .dapm_routes = wm8580_dapm_routes, | ||
887 | .num_dapm_routes = ARRAY_SIZE(wm8580_dapm_routes), | ||
893 | }; | 888 | }; |
894 | 889 | ||
895 | static const struct of_device_id wm8580_of_match[] = { | 890 | static const struct of_device_id wm8580_of_match[] = { |
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index 076bdb9930a..0b76d1dca5e 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
23 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
24 | #include <linux/of_device.h> | 23 | #include <linux/of_device.h> |
@@ -318,7 +317,7 @@ static int wm8711_set_bias_level(struct snd_soc_codec *codec, | |||
318 | #define WM8711_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 317 | #define WM8711_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
319 | SNDRV_PCM_FMTBIT_S24_LE) | 318 | SNDRV_PCM_FMTBIT_S24_LE) |
320 | 319 | ||
321 | static struct snd_soc_dai_ops wm8711_ops = { | 320 | static const struct snd_soc_dai_ops wm8711_ops = { |
322 | .prepare = wm8711_pcm_prepare, | 321 | .prepare = wm8711_pcm_prepare, |
323 | .hw_params = wm8711_hw_params, | 322 | .hw_params = wm8711_hw_params, |
324 | .shutdown = wm8711_shutdown, | 323 | .shutdown = wm8711_shutdown, |
@@ -339,7 +338,7 @@ static struct snd_soc_dai_driver wm8711_dai = { | |||
339 | .ops = &wm8711_ops, | 338 | .ops = &wm8711_ops, |
340 | }; | 339 | }; |
341 | 340 | ||
342 | static int wm8711_suspend(struct snd_soc_codec *codec, pm_message_t state) | 341 | static int wm8711_suspend(struct snd_soc_codec *codec) |
343 | { | 342 | { |
344 | snd_soc_write(codec, WM8711_ACTIVE, 0x0); | 343 | snd_soc_write(codec, WM8711_ACTIVE, 0x0); |
345 | wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF); | 344 | wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF); |
@@ -375,9 +374,6 @@ static int wm8711_probe(struct snd_soc_codec *codec) | |||
375 | snd_soc_update_bits(codec, WM8711_LOUT1V, 0x0100, 0x0100); | 374 | snd_soc_update_bits(codec, WM8711_LOUT1V, 0x0100, 0x0100); |
376 | snd_soc_update_bits(codec, WM8711_ROUT1V, 0x0100, 0x0100); | 375 | snd_soc_update_bits(codec, WM8711_ROUT1V, 0x0100, 0x0100); |
377 | 376 | ||
378 | snd_soc_add_controls(codec, wm8711_snd_controls, | ||
379 | ARRAY_SIZE(wm8711_snd_controls)); | ||
380 | |||
381 | return ret; | 377 | return ret; |
382 | 378 | ||
383 | } | 379 | } |
@@ -398,6 +394,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8711 = { | |||
398 | .reg_cache_size = ARRAY_SIZE(wm8711_reg), | 394 | .reg_cache_size = ARRAY_SIZE(wm8711_reg), |
399 | .reg_word_size = sizeof(u16), | 395 | .reg_word_size = sizeof(u16), |
400 | .reg_cache_default = wm8711_reg, | 396 | .reg_cache_default = wm8711_reg, |
397 | .controls = wm8711_snd_controls, | ||
398 | .num_controls = ARRAY_SIZE(wm8711_snd_controls), | ||
401 | .dapm_widgets = wm8711_dapm_widgets, | 399 | .dapm_widgets = wm8711_dapm_widgets, |
402 | .num_dapm_widgets = ARRAY_SIZE(wm8711_dapm_widgets), | 400 | .num_dapm_widgets = ARRAY_SIZE(wm8711_dapm_widgets), |
403 | .dapm_routes = wm8711_intercon, | 401 | .dapm_routes = wm8711_intercon, |
diff --git a/sound/soc/codecs/wm8727.c b/sound/soc/codecs/wm8727.c index 74880828511..e8170562071 100644 --- a/sound/soc/codecs/wm8727.c +++ b/sound/soc/codecs/wm8727.c | |||
@@ -59,7 +59,7 @@ static int __devexit wm8727_remove(struct platform_device *pdev) | |||
59 | 59 | ||
60 | static struct platform_driver wm8727_codec_driver = { | 60 | static struct platform_driver wm8727_codec_driver = { |
61 | .driver = { | 61 | .driver = { |
62 | .name = "wm8727-codec", | 62 | .name = "wm8727", |
63 | .owner = THIS_MODULE, | 63 | .owner = THIS_MODULE, |
64 | }, | 64 | }, |
65 | 65 | ||
@@ -67,17 +67,7 @@ static struct platform_driver wm8727_codec_driver = { | |||
67 | .remove = __devexit_p(wm8727_remove), | 67 | .remove = __devexit_p(wm8727_remove), |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static int __init wm8727_init(void) | 70 | module_platform_driver(wm8727_codec_driver); |
71 | { | ||
72 | return platform_driver_register(&wm8727_codec_driver); | ||
73 | } | ||
74 | module_init(wm8727_init); | ||
75 | |||
76 | static void __exit wm8727_exit(void) | ||
77 | { | ||
78 | platform_driver_unregister(&wm8727_codec_driver); | ||
79 | } | ||
80 | module_exit(wm8727_exit); | ||
81 | 71 | ||
82 | MODULE_DESCRIPTION("ASoC wm8727 driver"); | 72 | MODULE_DESCRIPTION("ASoC wm8727 driver"); |
83 | MODULE_AUTHOR("Neil Jones"); | 73 | MODULE_AUTHOR("Neil Jones"); |
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index 04b027efd5c..fc3d59e4908 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c | |||
@@ -196,7 +196,7 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec, | |||
196 | #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 196 | #define WM8728_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
197 | SNDRV_PCM_FMTBIT_S24_LE) | 197 | SNDRV_PCM_FMTBIT_S24_LE) |
198 | 198 | ||
199 | static struct snd_soc_dai_ops wm8728_dai_ops = { | 199 | static const struct snd_soc_dai_ops wm8728_dai_ops = { |
200 | .hw_params = wm8728_hw_params, | 200 | .hw_params = wm8728_hw_params, |
201 | .digital_mute = wm8728_mute, | 201 | .digital_mute = wm8728_mute, |
202 | .set_fmt = wm8728_set_dai_fmt, | 202 | .set_fmt = wm8728_set_dai_fmt, |
@@ -214,7 +214,7 @@ static struct snd_soc_dai_driver wm8728_dai = { | |||
214 | .ops = &wm8728_dai_ops, | 214 | .ops = &wm8728_dai_ops, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | static int wm8728_suspend(struct snd_soc_codec *codec, pm_message_t state) | 217 | static int wm8728_suspend(struct snd_soc_codec *codec) |
218 | { | 218 | { |
219 | wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF); | 219 | wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF); |
220 | 220 | ||
@@ -243,9 +243,6 @@ static int wm8728_probe(struct snd_soc_codec *codec) | |||
243 | /* power on device */ | 243 | /* power on device */ |
244 | wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 244 | wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
245 | 245 | ||
246 | snd_soc_add_controls(codec, wm8728_snd_controls, | ||
247 | ARRAY_SIZE(wm8728_snd_controls)); | ||
248 | |||
249 | return ret; | 246 | return ret; |
250 | } | 247 | } |
251 | 248 | ||
@@ -264,6 +261,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8728 = { | |||
264 | .reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults), | 261 | .reg_cache_size = ARRAY_SIZE(wm8728_reg_defaults), |
265 | .reg_word_size = sizeof(u16), | 262 | .reg_word_size = sizeof(u16), |
266 | .reg_cache_default = wm8728_reg_defaults, | 263 | .reg_cache_default = wm8728_reg_defaults, |
264 | .controls = wm8728_snd_controls, | ||
265 | .num_controls = ARRAY_SIZE(wm8728_snd_controls), | ||
267 | .dapm_widgets = wm8728_dapm_widgets, | 266 | .dapm_widgets = wm8728_dapm_widgets, |
268 | .num_dapm_widgets = ARRAY_SIZE(wm8728_dapm_widgets), | 267 | .num_dapm_widgets = ARRAY_SIZE(wm8728_dapm_widgets), |
269 | .dapm_routes = wm8728_intercon, | 268 | .dapm_routes = wm8728_intercon, |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index a7c9ae17fc7..8821af70e66 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/regulator/consumer.h> | 22 | #include <linux/regulator/consumer.h> |
24 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
25 | #include <linux/of_device.h> | 24 | #include <linux/of_device.h> |
@@ -465,7 +464,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, | |||
465 | #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 464 | #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
466 | SNDRV_PCM_FMTBIT_S24_LE) | 465 | SNDRV_PCM_FMTBIT_S24_LE) |
467 | 466 | ||
468 | static struct snd_soc_dai_ops wm8731_dai_ops = { | 467 | static const struct snd_soc_dai_ops wm8731_dai_ops = { |
469 | .hw_params = wm8731_hw_params, | 468 | .hw_params = wm8731_hw_params, |
470 | .digital_mute = wm8731_mute, | 469 | .digital_mute = wm8731_mute, |
471 | .set_sysclk = wm8731_set_dai_sysclk, | 470 | .set_sysclk = wm8731_set_dai_sysclk, |
@@ -491,7 +490,7 @@ static struct snd_soc_dai_driver wm8731_dai = { | |||
491 | }; | 490 | }; |
492 | 491 | ||
493 | #ifdef CONFIG_PM | 492 | #ifdef CONFIG_PM |
494 | static int wm8731_suspend(struct snd_soc_codec *codec, pm_message_t state) | 493 | static int wm8731_suspend(struct snd_soc_codec *codec) |
495 | { | 494 | { |
496 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); | 495 | wm8731_set_bias_level(codec, SND_SOC_BIAS_OFF); |
497 | 496 | ||
@@ -554,9 +553,6 @@ static int wm8731_probe(struct snd_soc_codec *codec) | |||
554 | /* Disable bypass path by default */ | 553 | /* Disable bypass path by default */ |
555 | snd_soc_update_bits(codec, WM8731_APANA, 0x8, 0); | 554 | snd_soc_update_bits(codec, WM8731_APANA, 0x8, 0); |
556 | 555 | ||
557 | snd_soc_add_controls(codec, wm8731_snd_controls, | ||
558 | ARRAY_SIZE(wm8731_snd_controls)); | ||
559 | |||
560 | /* Regulators will have been enabled by bias management */ | 556 | /* Regulators will have been enabled by bias management */ |
561 | regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); | 557 | regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); |
562 | 558 | ||
@@ -596,6 +592,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8731 = { | |||
596 | .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), | 592 | .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), |
597 | .dapm_routes = wm8731_intercon, | 593 | .dapm_routes = wm8731_intercon, |
598 | .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), | 594 | .num_dapm_routes = ARRAY_SIZE(wm8731_intercon), |
595 | .controls = wm8731_snd_controls, | ||
596 | .num_controls = ARRAY_SIZE(wm8731_snd_controls), | ||
599 | }; | 597 | }; |
600 | 598 | ||
601 | static const struct of_device_id wm8731_of_match[] = { | 599 | static const struct of_device_id wm8731_of_match[] = { |
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index f6aef58845c..ff95e62c56b 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
21 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
@@ -521,7 +520,7 @@ static int wm8737_set_bias_level(struct snd_soc_codec *codec, | |||
521 | #define WM8737_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 520 | #define WM8737_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
522 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 521 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
523 | 522 | ||
524 | static struct snd_soc_dai_ops wm8737_dai_ops = { | 523 | static const struct snd_soc_dai_ops wm8737_dai_ops = { |
525 | .hw_params = wm8737_hw_params, | 524 | .hw_params = wm8737_hw_params, |
526 | .set_sysclk = wm8737_set_dai_sysclk, | 525 | .set_sysclk = wm8737_set_dai_sysclk, |
527 | .set_fmt = wm8737_set_dai_fmt, | 526 | .set_fmt = wm8737_set_dai_fmt, |
@@ -540,7 +539,7 @@ static struct snd_soc_dai_driver wm8737_dai = { | |||
540 | }; | 539 | }; |
541 | 540 | ||
542 | #ifdef CONFIG_PM | 541 | #ifdef CONFIG_PM |
543 | static int wm8737_suspend(struct snd_soc_codec *codec, pm_message_t state) | 542 | static int wm8737_suspend(struct snd_soc_codec *codec) |
544 | { | 543 | { |
545 | wm8737_set_bias_level(codec, SND_SOC_BIAS_OFF); | 544 | wm8737_set_bias_level(codec, SND_SOC_BIAS_OFF); |
546 | return 0; | 545 | return 0; |
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index 57ad22aacc5..3941f50bf18 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/regulator/consumer.h> | 21 | #include <linux/regulator/consumer.h> |
23 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
24 | #include <linux/of_device.h> | 23 | #include <linux/of_device.h> |
@@ -86,24 +85,13 @@ SND_SOC_DAPM_OUTPUT("VOUTRP"), | |||
86 | SND_SOC_DAPM_OUTPUT("VOUTRN"), | 85 | SND_SOC_DAPM_OUTPUT("VOUTRN"), |
87 | }; | 86 | }; |
88 | 87 | ||
89 | static const struct snd_soc_dapm_route intercon[] = { | 88 | static const struct snd_soc_dapm_route wm8741_dapm_routes[] = { |
90 | { "VOUTLP", NULL, "DACL" }, | 89 | { "VOUTLP", NULL, "DACL" }, |
91 | { "VOUTLN", NULL, "DACL" }, | 90 | { "VOUTLN", NULL, "DACL" }, |
92 | { "VOUTRP", NULL, "DACR" }, | 91 | { "VOUTRP", NULL, "DACR" }, |
93 | { "VOUTRN", NULL, "DACR" }, | 92 | { "VOUTRN", NULL, "DACR" }, |
94 | }; | 93 | }; |
95 | 94 | ||
96 | static int wm8741_add_widgets(struct snd_soc_codec *codec) | ||
97 | { | ||
98 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
99 | |||
100 | snd_soc_dapm_new_controls(dapm, wm8741_dapm_widgets, | ||
101 | ARRAY_SIZE(wm8741_dapm_widgets)); | ||
102 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | ||
103 | |||
104 | return 0; | ||
105 | } | ||
106 | |||
107 | static struct { | 95 | static struct { |
108 | int value; | 96 | int value; |
109 | int ratio; | 97 | int ratio; |
@@ -382,7 +370,7 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
382 | #define WM8741_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 370 | #define WM8741_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
383 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 371 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
384 | 372 | ||
385 | static struct snd_soc_dai_ops wm8741_dai_ops = { | 373 | static const struct snd_soc_dai_ops wm8741_dai_ops = { |
386 | .startup = wm8741_startup, | 374 | .startup = wm8741_startup, |
387 | .hw_params = wm8741_hw_params, | 375 | .hw_params = wm8741_hw_params, |
388 | .set_sysclk = wm8741_set_dai_sysclk, | 376 | .set_sysclk = wm8741_set_dai_sysclk, |
@@ -457,10 +445,6 @@ static int wm8741_probe(struct snd_soc_codec *codec) | |||
457 | snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION, | 445 | snd_soc_update_bits(codec, WM8741_DACRMSB_ATTENUATION, |
458 | WM8741_UPDATERM, WM8741_UPDATERM); | 446 | WM8741_UPDATERM, WM8741_UPDATERM); |
459 | 447 | ||
460 | snd_soc_add_controls(codec, wm8741_snd_controls, | ||
461 | ARRAY_SIZE(wm8741_snd_controls)); | ||
462 | wm8741_add_widgets(codec); | ||
463 | |||
464 | dev_dbg(codec->dev, "Successful registration\n"); | 448 | dev_dbg(codec->dev, "Successful registration\n"); |
465 | return ret; | 449 | return ret; |
466 | 450 | ||
@@ -489,6 +473,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8741 = { | |||
489 | .reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults), | 473 | .reg_cache_size = ARRAY_SIZE(wm8741_reg_defaults), |
490 | .reg_word_size = sizeof(u16), | 474 | .reg_word_size = sizeof(u16), |
491 | .reg_cache_default = wm8741_reg_defaults, | 475 | .reg_cache_default = wm8741_reg_defaults, |
476 | |||
477 | .controls = wm8741_snd_controls, | ||
478 | .num_controls = ARRAY_SIZE(wm8741_snd_controls), | ||
479 | .dapm_widgets = wm8741_dapm_widgets, | ||
480 | .num_dapm_widgets = ARRAY_SIZE(wm8741_dapm_widgets), | ||
481 | .dapm_routes = wm8741_dapm_routes, | ||
482 | .num_dapm_routes = ARRAY_SIZE(wm8741_dapm_routes), | ||
492 | }; | 483 | }; |
493 | 484 | ||
494 | static const struct of_device_id wm8741_of_match[] = { | 485 | static const struct of_device_id wm8741_of_match[] = { |
@@ -504,7 +495,8 @@ static int wm8741_i2c_probe(struct i2c_client *i2c, | |||
504 | struct wm8741_priv *wm8741; | 495 | struct wm8741_priv *wm8741; |
505 | int ret; | 496 | int ret; |
506 | 497 | ||
507 | wm8741 = kzalloc(sizeof(struct wm8741_priv), GFP_KERNEL); | 498 | wm8741 = devm_kzalloc(&i2c->dev, sizeof(struct wm8741_priv), |
499 | GFP_KERNEL); | ||
508 | if (wm8741 == NULL) | 500 | if (wm8741 == NULL) |
509 | return -ENOMEM; | 501 | return -ENOMEM; |
510 | 502 | ||
@@ -513,20 +505,13 @@ static int wm8741_i2c_probe(struct i2c_client *i2c, | |||
513 | 505 | ||
514 | ret = snd_soc_register_codec(&i2c->dev, | 506 | ret = snd_soc_register_codec(&i2c->dev, |
515 | &soc_codec_dev_wm8741, &wm8741_dai, 1); | 507 | &soc_codec_dev_wm8741, &wm8741_dai, 1); |
516 | if (ret != 0) | ||
517 | goto err; | ||
518 | 508 | ||
519 | return ret; | 509 | return ret; |
520 | |||
521 | err: | ||
522 | kfree(wm8741); | ||
523 | return ret; | ||
524 | } | 510 | } |
525 | 511 | ||
526 | static int wm8741_i2c_remove(struct i2c_client *client) | 512 | static int wm8741_i2c_remove(struct i2c_client *client) |
527 | { | 513 | { |
528 | snd_soc_unregister_codec(&client->dev); | 514 | snd_soc_unregister_codec(&client->dev); |
529 | kfree(i2c_get_clientdata(client)); | ||
530 | return 0; | 515 | return 0; |
531 | } | 516 | } |
532 | 517 | ||
@@ -554,7 +539,8 @@ static int __devinit wm8741_spi_probe(struct spi_device *spi) | |||
554 | struct wm8741_priv *wm8741; | 539 | struct wm8741_priv *wm8741; |
555 | int ret; | 540 | int ret; |
556 | 541 | ||
557 | wm8741 = kzalloc(sizeof(struct wm8741_priv), GFP_KERNEL); | 542 | wm8741 = devm_kzalloc(&spi->dev, sizeof(struct wm8741_priv), |
543 | GFP_KERNEL); | ||
558 | if (wm8741 == NULL) | 544 | if (wm8741 == NULL) |
559 | return -ENOMEM; | 545 | return -ENOMEM; |
560 | 546 | ||
@@ -563,15 +549,12 @@ static int __devinit wm8741_spi_probe(struct spi_device *spi) | |||
563 | 549 | ||
564 | ret = snd_soc_register_codec(&spi->dev, | 550 | ret = snd_soc_register_codec(&spi->dev, |
565 | &soc_codec_dev_wm8741, &wm8741_dai, 1); | 551 | &soc_codec_dev_wm8741, &wm8741_dai, 1); |
566 | if (ret < 0) | ||
567 | kfree(wm8741); | ||
568 | return ret; | 552 | return ret; |
569 | } | 553 | } |
570 | 554 | ||
571 | static int __devexit wm8741_spi_remove(struct spi_device *spi) | 555 | static int __devexit wm8741_spi_remove(struct spi_device *spi) |
572 | { | 556 | { |
573 | snd_soc_unregister_codec(&spi->dev); | 557 | snd_soc_unregister_codec(&spi->dev); |
574 | kfree(spi_get_drvdata(spi)); | ||
575 | return 0; | 558 | return 0; |
576 | } | 559 | } |
577 | 560 | ||
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index ca75a818070..e4c50ce7d9c 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
23 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
24 | #include <linux/of_device.h> | 23 | #include <linux/of_device.h> |
@@ -302,7 +301,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { | |||
302 | SND_SOC_DAPM_INPUT("RINPUT3"), | 301 | SND_SOC_DAPM_INPUT("RINPUT3"), |
303 | }; | 302 | }; |
304 | 303 | ||
305 | static const struct snd_soc_dapm_route audio_map[] = { | 304 | static const struct snd_soc_dapm_route wm8750_dapm_routes[] = { |
306 | /* left mixer */ | 305 | /* left mixer */ |
307 | {"Left Mixer", "Playback Switch", "Left DAC"}, | 306 | {"Left Mixer", "Playback Switch", "Left DAC"}, |
308 | {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, | 307 | {"Left Mixer", "Left Bypass Switch", "Left Line Mux"}, |
@@ -396,17 +395,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
396 | {"Right ADC", NULL, "Right ADC Mux"}, | 395 | {"Right ADC", NULL, "Right ADC Mux"}, |
397 | }; | 396 | }; |
398 | 397 | ||
399 | static int wm8750_add_widgets(struct snd_soc_codec *codec) | ||
400 | { | ||
401 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
402 | |||
403 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, | ||
404 | ARRAY_SIZE(wm8750_dapm_widgets)); | ||
405 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
406 | |||
407 | return 0; | ||
408 | } | ||
409 | |||
410 | struct _coeff_div { | 398 | struct _coeff_div { |
411 | u32 mclk; | 399 | u32 mclk; |
412 | u32 rate; | 400 | u32 rate; |
@@ -643,7 +631,7 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec, | |||
643 | #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 631 | #define WM8750_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
644 | SNDRV_PCM_FMTBIT_S24_LE) | 632 | SNDRV_PCM_FMTBIT_S24_LE) |
645 | 633 | ||
646 | static struct snd_soc_dai_ops wm8750_dai_ops = { | 634 | static const struct snd_soc_dai_ops wm8750_dai_ops = { |
647 | .hw_params = wm8750_pcm_hw_params, | 635 | .hw_params = wm8750_pcm_hw_params, |
648 | .digital_mute = wm8750_mute, | 636 | .digital_mute = wm8750_mute, |
649 | .set_fmt = wm8750_set_dai_fmt, | 637 | .set_fmt = wm8750_set_dai_fmt, |
@@ -667,7 +655,7 @@ static struct snd_soc_dai_driver wm8750_dai = { | |||
667 | .ops = &wm8750_dai_ops, | 655 | .ops = &wm8750_dai_ops, |
668 | }; | 656 | }; |
669 | 657 | ||
670 | static int wm8750_suspend(struct snd_soc_codec *codec, pm_message_t state) | 658 | static int wm8750_suspend(struct snd_soc_codec *codec) |
671 | { | 659 | { |
672 | wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); | 660 | wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF); |
673 | return 0; | 661 | return 0; |
@@ -709,9 +697,6 @@ static int wm8750_probe(struct snd_soc_codec *codec) | |||
709 | snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100); | 697 | snd_soc_update_bits(codec, WM8750_LINVOL, 0x0100, 0x0100); |
710 | snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100); | 698 | snd_soc_update_bits(codec, WM8750_RINVOL, 0x0100, 0x0100); |
711 | 699 | ||
712 | snd_soc_add_controls(codec, wm8750_snd_controls, | ||
713 | ARRAY_SIZE(wm8750_snd_controls)); | ||
714 | wm8750_add_widgets(codec); | ||
715 | return ret; | 700 | return ret; |
716 | } | 701 | } |
717 | 702 | ||
@@ -730,6 +715,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8750 = { | |||
730 | .reg_cache_size = ARRAY_SIZE(wm8750_reg), | 715 | .reg_cache_size = ARRAY_SIZE(wm8750_reg), |
731 | .reg_word_size = sizeof(u16), | 716 | .reg_word_size = sizeof(u16), |
732 | .reg_cache_default = wm8750_reg, | 717 | .reg_cache_default = wm8750_reg, |
718 | |||
719 | .controls = wm8750_snd_controls, | ||
720 | .num_controls = ARRAY_SIZE(wm8750_snd_controls), | ||
721 | .dapm_widgets = wm8750_dapm_widgets, | ||
722 | .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), | ||
723 | .dapm_routes = wm8750_dapm_routes, | ||
724 | .num_dapm_routes = ARRAY_SIZE(wm8750_dapm_routes), | ||
733 | }; | 725 | }; |
734 | 726 | ||
735 | static const struct of_device_id wm8750_of_match[] = { | 727 | static const struct of_device_id wm8750_of_match[] = { |
@@ -745,7 +737,8 @@ static int __devinit wm8750_spi_probe(struct spi_device *spi) | |||
745 | struct wm8750_priv *wm8750; | 737 | struct wm8750_priv *wm8750; |
746 | int ret; | 738 | int ret; |
747 | 739 | ||
748 | wm8750 = kzalloc(sizeof(struct wm8750_priv), GFP_KERNEL); | 740 | wm8750 = devm_kzalloc(&spi->dev, sizeof(struct wm8750_priv), |
741 | GFP_KERNEL); | ||
749 | if (wm8750 == NULL) | 742 | if (wm8750 == NULL) |
750 | return -ENOMEM; | 743 | return -ENOMEM; |
751 | 744 | ||
@@ -754,15 +747,12 @@ static int __devinit wm8750_spi_probe(struct spi_device *spi) | |||
754 | 747 | ||
755 | ret = snd_soc_register_codec(&spi->dev, | 748 | ret = snd_soc_register_codec(&spi->dev, |
756 | &soc_codec_dev_wm8750, &wm8750_dai, 1); | 749 | &soc_codec_dev_wm8750, &wm8750_dai, 1); |
757 | if (ret < 0) | ||
758 | kfree(wm8750); | ||
759 | return ret; | 750 | return ret; |
760 | } | 751 | } |
761 | 752 | ||
762 | static int __devexit wm8750_spi_remove(struct spi_device *spi) | 753 | static int __devexit wm8750_spi_remove(struct spi_device *spi) |
763 | { | 754 | { |
764 | snd_soc_unregister_codec(&spi->dev); | 755 | snd_soc_unregister_codec(&spi->dev); |
765 | kfree(spi_get_drvdata(spi)); | ||
766 | return 0; | 756 | return 0; |
767 | } | 757 | } |
768 | 758 | ||
@@ -792,7 +782,8 @@ static __devinit int wm8750_i2c_probe(struct i2c_client *i2c, | |||
792 | struct wm8750_priv *wm8750; | 782 | struct wm8750_priv *wm8750; |
793 | int ret; | 783 | int ret; |
794 | 784 | ||
795 | wm8750 = kzalloc(sizeof(struct wm8750_priv), GFP_KERNEL); | 785 | wm8750 = devm_kzalloc(&i2c->dev, sizeof(struct wm8750_priv), |
786 | GFP_KERNEL); | ||
796 | if (wm8750 == NULL) | 787 | if (wm8750 == NULL) |
797 | return -ENOMEM; | 788 | return -ENOMEM; |
798 | 789 | ||
@@ -801,15 +792,12 @@ static __devinit int wm8750_i2c_probe(struct i2c_client *i2c, | |||
801 | 792 | ||
802 | ret = snd_soc_register_codec(&i2c->dev, | 793 | ret = snd_soc_register_codec(&i2c->dev, |
803 | &soc_codec_dev_wm8750, &wm8750_dai, 1); | 794 | &soc_codec_dev_wm8750, &wm8750_dai, 1); |
804 | if (ret < 0) | ||
805 | kfree(wm8750); | ||
806 | return ret; | 795 | return ret; |
807 | } | 796 | } |
808 | 797 | ||
809 | static __devexit int wm8750_i2c_remove(struct i2c_client *client) | 798 | static __devexit int wm8750_i2c_remove(struct i2c_client *client) |
810 | { | 799 | { |
811 | snd_soc_unregister_codec(&client->dev); | 800 | snd_soc_unregister_codec(&client->dev); |
812 | kfree(i2c_get_clientdata(client)); | ||
813 | return 0; | 801 | return 0; |
814 | } | 802 | } |
815 | 803 | ||
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 3a629d0d690..b114c19f530 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/pm.h> | 39 | #include <linux/pm.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/of_device.h> | 41 | #include <linux/of_device.h> |
42 | #include <linux/platform_device.h> | ||
43 | #include <linux/spi/spi.h> | 42 | #include <linux/spi/spi.h> |
44 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
45 | #include <sound/core.h> | 44 | #include <sound/core.h> |
@@ -486,7 +485,7 @@ SND_SOC_DAPM_INPUT("MIC2"), | |||
486 | SND_SOC_DAPM_VMID("VREF"), | 485 | SND_SOC_DAPM_VMID("VREF"), |
487 | }; | 486 | }; |
488 | 487 | ||
489 | static const struct snd_soc_dapm_route audio_map[] = { | 488 | static const struct snd_soc_dapm_route wm8753_dapm_routes[] = { |
490 | /* left mixer */ | 489 | /* left mixer */ |
491 | {"Left Mixer", "Left Playback Switch", "Left DAC"}, | 490 | {"Left Mixer", "Left Playback Switch", "Left DAC"}, |
492 | {"Left Mixer", "Voice Playback Switch", "Voice DAC"}, | 491 | {"Left Mixer", "Voice Playback Switch", "Voice DAC"}, |
@@ -640,17 +639,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
640 | {"ACOP", NULL, "ALC Mixer"}, | 639 | {"ACOP", NULL, "ALC Mixer"}, |
641 | }; | 640 | }; |
642 | 641 | ||
643 | static int wm8753_add_widgets(struct snd_soc_codec *codec) | ||
644 | { | ||
645 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
646 | |||
647 | snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets, | ||
648 | ARRAY_SIZE(wm8753_dapm_widgets)); | ||
649 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
650 | |||
651 | return 0; | ||
652 | } | ||
653 | |||
654 | /* PLL divisors */ | 642 | /* PLL divisors */ |
655 | struct _pll_div { | 643 | struct _pll_div { |
656 | u32 div2:1; | 644 | u32 div2:1; |
@@ -1326,7 +1314,7 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec, | |||
1326 | * 3. Voice disabled - HIFI over HIFI | 1314 | * 3. Voice disabled - HIFI over HIFI |
1327 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture | 1315 | * 4. Voice disabled - HIFI over HIFI, uses voice DAI LRC for capture |
1328 | */ | 1316 | */ |
1329 | static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode = { | 1317 | static const struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode = { |
1330 | .hw_params = wm8753_i2s_hw_params, | 1318 | .hw_params = wm8753_i2s_hw_params, |
1331 | .digital_mute = wm8753_mute, | 1319 | .digital_mute = wm8753_mute, |
1332 | .set_fmt = wm8753_hifi_set_dai_fmt, | 1320 | .set_fmt = wm8753_hifi_set_dai_fmt, |
@@ -1335,7 +1323,7 @@ static struct snd_soc_dai_ops wm8753_dai_ops_hifi_mode = { | |||
1335 | .set_sysclk = wm8753_set_dai_sysclk, | 1323 | .set_sysclk = wm8753_set_dai_sysclk, |
1336 | }; | 1324 | }; |
1337 | 1325 | ||
1338 | static struct snd_soc_dai_ops wm8753_dai_ops_voice_mode = { | 1326 | static const struct snd_soc_dai_ops wm8753_dai_ops_voice_mode = { |
1339 | .hw_params = wm8753_pcm_hw_params, | 1327 | .hw_params = wm8753_pcm_hw_params, |
1340 | .digital_mute = wm8753_mute, | 1328 | .digital_mute = wm8753_mute, |
1341 | .set_fmt = wm8753_voice_set_dai_fmt, | 1329 | .set_fmt = wm8753_voice_set_dai_fmt, |
@@ -1392,7 +1380,7 @@ static void wm8753_work(struct work_struct *work) | |||
1392 | wm8753_set_bias_level(codec, dapm->bias_level); | 1380 | wm8753_set_bias_level(codec, dapm->bias_level); |
1393 | } | 1381 | } |
1394 | 1382 | ||
1395 | static int wm8753_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1383 | static int wm8753_suspend(struct snd_soc_codec *codec) |
1396 | { | 1384 | { |
1397 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1385 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1398 | return 0; | 1386 | return 0; |
@@ -1467,10 +1455,6 @@ static int wm8753_probe(struct snd_soc_codec *codec) | |||
1467 | snd_soc_update_bits(codec, WM8753_LINVOL, 0x0100, 0x0100); | 1455 | snd_soc_update_bits(codec, WM8753_LINVOL, 0x0100, 0x0100); |
1468 | snd_soc_update_bits(codec, WM8753_RINVOL, 0x0100, 0x0100); | 1456 | snd_soc_update_bits(codec, WM8753_RINVOL, 0x0100, 0x0100); |
1469 | 1457 | ||
1470 | snd_soc_add_controls(codec, wm8753_snd_controls, | ||
1471 | ARRAY_SIZE(wm8753_snd_controls)); | ||
1472 | wm8753_add_widgets(codec); | ||
1473 | |||
1474 | return 0; | 1458 | return 0; |
1475 | } | 1459 | } |
1476 | 1460 | ||
@@ -1492,6 +1476,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8753 = { | |||
1492 | .reg_cache_size = ARRAY_SIZE(wm8753_reg), | 1476 | .reg_cache_size = ARRAY_SIZE(wm8753_reg), |
1493 | .reg_word_size = sizeof(u16), | 1477 | .reg_word_size = sizeof(u16), |
1494 | .reg_cache_default = wm8753_reg, | 1478 | .reg_cache_default = wm8753_reg, |
1479 | |||
1480 | .controls = wm8753_snd_controls, | ||
1481 | .num_controls = ARRAY_SIZE(wm8753_snd_controls), | ||
1482 | .dapm_widgets = wm8753_dapm_widgets, | ||
1483 | .num_dapm_widgets = ARRAY_SIZE(wm8753_dapm_widgets), | ||
1484 | .dapm_routes = wm8753_dapm_routes, | ||
1485 | .num_dapm_routes = ARRAY_SIZE(wm8753_dapm_routes), | ||
1495 | }; | 1486 | }; |
1496 | 1487 | ||
1497 | static const struct of_device_id wm8753_of_match[] = { | 1488 | static const struct of_device_id wm8753_of_match[] = { |
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c index aa05e6507f8..19374a9e5ba 100644 --- a/sound/soc/codecs/wm8770.c +++ b/sound/soc/codecs/wm8770.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/spi/spi.h> | 19 | #include <linux/spi/spi.h> |
21 | #include <linux/regulator/consumer.h> | 20 | #include <linux/regulator/consumer.h> |
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
@@ -528,7 +527,7 @@ static int wm8770_set_bias_level(struct snd_soc_codec *codec, | |||
528 | #define WM8770_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 527 | #define WM8770_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
529 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 528 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
530 | 529 | ||
531 | static struct snd_soc_dai_ops wm8770_dai_ops = { | 530 | static const struct snd_soc_dai_ops wm8770_dai_ops = { |
532 | .digital_mute = wm8770_mute, | 531 | .digital_mute = wm8770_mute, |
533 | .hw_params = wm8770_hw_params, | 532 | .hw_params = wm8770_hw_params, |
534 | .set_fmt = wm8770_set_fmt, | 533 | .set_fmt = wm8770_set_fmt, |
@@ -556,7 +555,7 @@ static struct snd_soc_dai_driver wm8770_dai = { | |||
556 | }; | 555 | }; |
557 | 556 | ||
558 | #ifdef CONFIG_PM | 557 | #ifdef CONFIG_PM |
559 | static int wm8770_suspend(struct snd_soc_codec *codec, pm_message_t state) | 558 | static int wm8770_suspend(struct snd_soc_codec *codec) |
560 | { | 559 | { |
561 | wm8770_set_bias_level(codec, SND_SOC_BIAS_OFF); | 560 | wm8770_set_bias_level(codec, SND_SOC_BIAS_OFF); |
562 | return 0; | 561 | return 0; |
@@ -691,13 +690,13 @@ static const struct of_device_id wm8770_of_match[] = { | |||
691 | }; | 690 | }; |
692 | MODULE_DEVICE_TABLE(of, wm8770_of_match); | 691 | MODULE_DEVICE_TABLE(of, wm8770_of_match); |
693 | 692 | ||
694 | #if defined(CONFIG_SPI_MASTER) | ||
695 | static int __devinit wm8770_spi_probe(struct spi_device *spi) | 693 | static int __devinit wm8770_spi_probe(struct spi_device *spi) |
696 | { | 694 | { |
697 | struct wm8770_priv *wm8770; | 695 | struct wm8770_priv *wm8770; |
698 | int ret; | 696 | int ret; |
699 | 697 | ||
700 | wm8770 = kzalloc(sizeof(struct wm8770_priv), GFP_KERNEL); | 698 | wm8770 = devm_kzalloc(&spi->dev, sizeof(struct wm8770_priv), |
699 | GFP_KERNEL); | ||
701 | if (!wm8770) | 700 | if (!wm8770) |
702 | return -ENOMEM; | 701 | return -ENOMEM; |
703 | 702 | ||
@@ -706,15 +705,13 @@ static int __devinit wm8770_spi_probe(struct spi_device *spi) | |||
706 | 705 | ||
707 | ret = snd_soc_register_codec(&spi->dev, | 706 | ret = snd_soc_register_codec(&spi->dev, |
708 | &soc_codec_dev_wm8770, &wm8770_dai, 1); | 707 | &soc_codec_dev_wm8770, &wm8770_dai, 1); |
709 | if (ret < 0) | 708 | |
710 | kfree(wm8770); | ||
711 | return ret; | 709 | return ret; |
712 | } | 710 | } |
713 | 711 | ||
714 | static int __devexit wm8770_spi_remove(struct spi_device *spi) | 712 | static int __devexit wm8770_spi_remove(struct spi_device *spi) |
715 | { | 713 | { |
716 | snd_soc_unregister_codec(&spi->dev); | 714 | snd_soc_unregister_codec(&spi->dev); |
717 | kfree(spi_get_drvdata(spi)); | ||
718 | return 0; | 715 | return 0; |
719 | } | 716 | } |
720 | 717 | ||
@@ -727,28 +724,23 @@ static struct spi_driver wm8770_spi_driver = { | |||
727 | .probe = wm8770_spi_probe, | 724 | .probe = wm8770_spi_probe, |
728 | .remove = __devexit_p(wm8770_spi_remove) | 725 | .remove = __devexit_p(wm8770_spi_remove) |
729 | }; | 726 | }; |
730 | #endif | ||
731 | 727 | ||
732 | static int __init wm8770_modinit(void) | 728 | static int __init wm8770_modinit(void) |
733 | { | 729 | { |
734 | int ret = 0; | 730 | int ret = 0; |
735 | 731 | ||
736 | #if defined(CONFIG_SPI_MASTER) | ||
737 | ret = spi_register_driver(&wm8770_spi_driver); | 732 | ret = spi_register_driver(&wm8770_spi_driver); |
738 | if (ret) { | 733 | if (ret) { |
739 | printk(KERN_ERR "Failed to register wm8770 SPI driver: %d\n", | 734 | printk(KERN_ERR "Failed to register wm8770 SPI driver: %d\n", |
740 | ret); | 735 | ret); |
741 | } | 736 | } |
742 | #endif | ||
743 | return ret; | 737 | return ret; |
744 | } | 738 | } |
745 | module_init(wm8770_modinit); | 739 | module_init(wm8770_modinit); |
746 | 740 | ||
747 | static void __exit wm8770_exit(void) | 741 | static void __exit wm8770_exit(void) |
748 | { | 742 | { |
749 | #if defined(CONFIG_SPI_MASTER) | ||
750 | spi_unregister_driver(&wm8770_spi_driver); | 743 | spi_unregister_driver(&wm8770_spi_driver); |
751 | #endif | ||
752 | } | 744 | } |
753 | module_exit(wm8770_exit); | 745 | module_exit(wm8770_exit); |
754 | 746 | ||
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index bfdc52370ad..33e97d1d8f4 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
25 | #include <sound/core.h> | 24 | #include <sound/core.h> |
@@ -235,6 +234,7 @@ static int wm8776_hw_params(struct snd_pcm_substream *substream, | |||
235 | switch (snd_pcm_format_width(params_format(params))) { | 234 | switch (snd_pcm_format_width(params_format(params))) { |
236 | case 16: | 235 | case 16: |
237 | iface = 0; | 236 | iface = 0; |
237 | break; | ||
238 | case 20: | 238 | case 20: |
239 | iface = 0x10; | 239 | iface = 0x10; |
240 | break; | 240 | break; |
@@ -327,14 +327,14 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec, | |||
327 | #define WM8776_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 327 | #define WM8776_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
328 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 328 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
329 | 329 | ||
330 | static struct snd_soc_dai_ops wm8776_dac_ops = { | 330 | static const struct snd_soc_dai_ops wm8776_dac_ops = { |
331 | .digital_mute = wm8776_mute, | 331 | .digital_mute = wm8776_mute, |
332 | .hw_params = wm8776_hw_params, | 332 | .hw_params = wm8776_hw_params, |
333 | .set_fmt = wm8776_set_fmt, | 333 | .set_fmt = wm8776_set_fmt, |
334 | .set_sysclk = wm8776_set_sysclk, | 334 | .set_sysclk = wm8776_set_sysclk, |
335 | }; | 335 | }; |
336 | 336 | ||
337 | static struct snd_soc_dai_ops wm8776_adc_ops = { | 337 | static const struct snd_soc_dai_ops wm8776_adc_ops = { |
338 | .hw_params = wm8776_hw_params, | 338 | .hw_params = wm8776_hw_params, |
339 | .set_fmt = wm8776_set_fmt, | 339 | .set_fmt = wm8776_set_fmt, |
340 | .set_sysclk = wm8776_set_sysclk, | 340 | .set_sysclk = wm8776_set_sysclk, |
@@ -372,7 +372,7 @@ static struct snd_soc_dai_driver wm8776_dai[] = { | |||
372 | }; | 372 | }; |
373 | 373 | ||
374 | #ifdef CONFIG_PM | 374 | #ifdef CONFIG_PM |
375 | static int wm8776_suspend(struct snd_soc_codec *codec, pm_message_t state) | 375 | static int wm8776_suspend(struct snd_soc_codec *codec) |
376 | { | 376 | { |
377 | wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF); | 377 | wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF); |
378 | 378 | ||
@@ -392,7 +392,6 @@ static int wm8776_resume(struct snd_soc_codec *codec) | |||
392 | static int wm8776_probe(struct snd_soc_codec *codec) | 392 | static int wm8776_probe(struct snd_soc_codec *codec) |
393 | { | 393 | { |
394 | struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec); | 394 | struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec); |
395 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
396 | int ret = 0; | 395 | int ret = 0; |
397 | 396 | ||
398 | ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8776->control_type); | 397 | ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8776->control_type); |
@@ -414,12 +413,6 @@ static int wm8776_probe(struct snd_soc_codec *codec) | |||
414 | snd_soc_update_bits(codec, WM8776_HPRVOL, 0x100, 0x100); | 413 | snd_soc_update_bits(codec, WM8776_HPRVOL, 0x100, 0x100); |
415 | snd_soc_update_bits(codec, WM8776_DACRVOL, 0x100, 0x100); | 414 | snd_soc_update_bits(codec, WM8776_DACRVOL, 0x100, 0x100); |
416 | 415 | ||
417 | snd_soc_add_controls(codec, wm8776_snd_controls, | ||
418 | ARRAY_SIZE(wm8776_snd_controls)); | ||
419 | snd_soc_dapm_new_controls(dapm, wm8776_dapm_widgets, | ||
420 | ARRAY_SIZE(wm8776_dapm_widgets)); | ||
421 | snd_soc_dapm_add_routes(dapm, routes, ARRAY_SIZE(routes)); | ||
422 | |||
423 | return ret; | 416 | return ret; |
424 | } | 417 | } |
425 | 418 | ||
@@ -439,6 +432,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8776 = { | |||
439 | .reg_cache_size = ARRAY_SIZE(wm8776_reg), | 432 | .reg_cache_size = ARRAY_SIZE(wm8776_reg), |
440 | .reg_word_size = sizeof(u16), | 433 | .reg_word_size = sizeof(u16), |
441 | .reg_cache_default = wm8776_reg, | 434 | .reg_cache_default = wm8776_reg, |
435 | |||
436 | .controls = wm8776_snd_controls, | ||
437 | .num_controls = ARRAY_SIZE(wm8776_snd_controls), | ||
438 | .dapm_widgets = wm8776_dapm_widgets, | ||
439 | .num_dapm_widgets = ARRAY_SIZE(wm8776_dapm_widgets), | ||
440 | .dapm_routes = routes, | ||
441 | .num_dapm_routes = ARRAY_SIZE(routes), | ||
442 | }; | 442 | }; |
443 | 443 | ||
444 | static const struct of_device_id wm8776_of_match[] = { | 444 | static const struct of_device_id wm8776_of_match[] = { |
@@ -453,7 +453,8 @@ static int __devinit wm8776_spi_probe(struct spi_device *spi) | |||
453 | struct wm8776_priv *wm8776; | 453 | struct wm8776_priv *wm8776; |
454 | int ret; | 454 | int ret; |
455 | 455 | ||
456 | wm8776 = kzalloc(sizeof(struct wm8776_priv), GFP_KERNEL); | 456 | wm8776 = devm_kzalloc(&spi->dev, sizeof(struct wm8776_priv), |
457 | GFP_KERNEL); | ||
457 | if (wm8776 == NULL) | 458 | if (wm8776 == NULL) |
458 | return -ENOMEM; | 459 | return -ENOMEM; |
459 | 460 | ||
@@ -462,15 +463,13 @@ static int __devinit wm8776_spi_probe(struct spi_device *spi) | |||
462 | 463 | ||
463 | ret = snd_soc_register_codec(&spi->dev, | 464 | ret = snd_soc_register_codec(&spi->dev, |
464 | &soc_codec_dev_wm8776, wm8776_dai, ARRAY_SIZE(wm8776_dai)); | 465 | &soc_codec_dev_wm8776, wm8776_dai, ARRAY_SIZE(wm8776_dai)); |
465 | if (ret < 0) | 466 | |
466 | kfree(wm8776); | ||
467 | return ret; | 467 | return ret; |
468 | } | 468 | } |
469 | 469 | ||
470 | static int __devexit wm8776_spi_remove(struct spi_device *spi) | 470 | static int __devexit wm8776_spi_remove(struct spi_device *spi) |
471 | { | 471 | { |
472 | snd_soc_unregister_codec(&spi->dev); | 472 | snd_soc_unregister_codec(&spi->dev); |
473 | kfree(spi_get_drvdata(spi)); | ||
474 | return 0; | 473 | return 0; |
475 | } | 474 | } |
476 | 475 | ||
@@ -492,7 +491,8 @@ static __devinit int wm8776_i2c_probe(struct i2c_client *i2c, | |||
492 | struct wm8776_priv *wm8776; | 491 | struct wm8776_priv *wm8776; |
493 | int ret; | 492 | int ret; |
494 | 493 | ||
495 | wm8776 = kzalloc(sizeof(struct wm8776_priv), GFP_KERNEL); | 494 | wm8776 = devm_kzalloc(&i2c->dev, sizeof(struct wm8776_priv), |
495 | GFP_KERNEL); | ||
496 | if (wm8776 == NULL) | 496 | if (wm8776 == NULL) |
497 | return -ENOMEM; | 497 | return -ENOMEM; |
498 | 498 | ||
@@ -501,15 +501,13 @@ static __devinit int wm8776_i2c_probe(struct i2c_client *i2c, | |||
501 | 501 | ||
502 | ret = snd_soc_register_codec(&i2c->dev, | 502 | ret = snd_soc_register_codec(&i2c->dev, |
503 | &soc_codec_dev_wm8776, wm8776_dai, ARRAY_SIZE(wm8776_dai)); | 503 | &soc_codec_dev_wm8776, wm8776_dai, ARRAY_SIZE(wm8776_dai)); |
504 | if (ret < 0) | 504 | |
505 | kfree(wm8776); | ||
506 | return ret; | 505 | return ret; |
507 | } | 506 | } |
508 | 507 | ||
509 | static __devexit int wm8776_i2c_remove(struct i2c_client *client) | 508 | static __devexit int wm8776_i2c_remove(struct i2c_client *client) |
510 | { | 509 | { |
511 | snd_soc_unregister_codec(&client->dev); | 510 | snd_soc_unregister_codec(&client->dev); |
512 | kfree(i2c_get_clientdata(client)); | ||
513 | return 0; | 511 | return 0; |
514 | } | 512 | } |
515 | 513 | ||
diff --git a/sound/soc/codecs/wm8782.c b/sound/soc/codecs/wm8782.c index f2ced71328b..3fdea98f732 100644 --- a/sound/soc/codecs/wm8782.c +++ b/sound/soc/codecs/wm8782.c | |||
@@ -63,17 +63,7 @@ static struct platform_driver wm8782_codec_driver = { | |||
63 | .remove = __devexit_p(wm8782_remove), | 63 | .remove = __devexit_p(wm8782_remove), |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static int __init wm8782_init(void) | 66 | module_platform_driver(wm8782_codec_driver); |
67 | { | ||
68 | return platform_driver_register(&wm8782_codec_driver); | ||
69 | } | ||
70 | module_init(wm8782_init); | ||
71 | |||
72 | static void __exit wm8782_exit(void) | ||
73 | { | ||
74 | platform_driver_unregister(&wm8782_codec_driver); | ||
75 | } | ||
76 | module_exit(wm8782_exit); | ||
77 | 67 | ||
78 | MODULE_DESCRIPTION("ASoC WM8782 driver"); | 68 | MODULE_DESCRIPTION("ASoC WM8782 driver"); |
79 | MODULE_AUTHOR("Johannes Stezenbach <js@sig21.net>"); | 69 | MODULE_AUTHOR("Johannes Stezenbach <js@sig21.net>"); |
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c index 9ee072b8597..d54a3ca5e19 100644 --- a/sound/soc/codecs/wm8804.c +++ b/sound/soc/codecs/wm8804.c | |||
@@ -542,7 +542,7 @@ static int wm8804_set_bias_level(struct snd_soc_codec *codec, | |||
542 | } | 542 | } |
543 | 543 | ||
544 | #ifdef CONFIG_PM | 544 | #ifdef CONFIG_PM |
545 | static int wm8804_suspend(struct snd_soc_codec *codec, pm_message_t state) | 545 | static int wm8804_suspend(struct snd_soc_codec *codec) |
546 | { | 546 | { |
547 | wm8804_set_bias_level(codec, SND_SOC_BIAS_OFF); | 547 | wm8804_set_bias_level(codec, SND_SOC_BIAS_OFF); |
548 | return 0; | 548 | return 0; |
@@ -659,8 +659,6 @@ static int wm8804_probe(struct snd_soc_codec *codec) | |||
659 | 659 | ||
660 | wm8804_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 660 | wm8804_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
661 | 661 | ||
662 | snd_soc_add_controls(codec, wm8804_snd_controls, | ||
663 | ARRAY_SIZE(wm8804_snd_controls)); | ||
664 | return 0; | 662 | return 0; |
665 | 663 | ||
666 | err_reg_enable: | 664 | err_reg_enable: |
@@ -670,7 +668,7 @@ err_reg_get: | |||
670 | return ret; | 668 | return ret; |
671 | } | 669 | } |
672 | 670 | ||
673 | static struct snd_soc_dai_ops wm8804_dai_ops = { | 671 | static const struct snd_soc_dai_ops wm8804_dai_ops = { |
674 | .hw_params = wm8804_hw_params, | 672 | .hw_params = wm8804_hw_params, |
675 | .set_fmt = wm8804_set_fmt, | 673 | .set_fmt = wm8804_set_fmt, |
676 | .set_sysclk = wm8804_set_sysclk, | 674 | .set_sysclk = wm8804_set_sysclk, |
@@ -715,7 +713,10 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8804 = { | |||
715 | .reg_cache_size = ARRAY_SIZE(wm8804_reg_defs), | 713 | .reg_cache_size = ARRAY_SIZE(wm8804_reg_defs), |
716 | .reg_word_size = sizeof(u8), | 714 | .reg_word_size = sizeof(u8), |
717 | .reg_cache_default = wm8804_reg_defs, | 715 | .reg_cache_default = wm8804_reg_defs, |
718 | .volatile_register = wm8804_volatile | 716 | .volatile_register = wm8804_volatile, |
717 | |||
718 | .controls = wm8804_snd_controls, | ||
719 | .num_controls = ARRAY_SIZE(wm8804_snd_controls), | ||
719 | }; | 720 | }; |
720 | 721 | ||
721 | static const struct of_device_id wm8804_of_match[] = { | 722 | static const struct of_device_id wm8804_of_match[] = { |
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index 3d0dc1591ec..f18c554efc9 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
29 | #include <sound/core.h> | 28 | #include <sound/core.h> |
30 | #include <sound/pcm.h> | 29 | #include <sound/pcm.h> |
@@ -513,7 +512,7 @@ SND_SOC_DAPM_MIXER("Right Input Mixer", WM8900_REG_POWER2, 4, 0, | |||
513 | wm8900_rinmix_controls, | 512 | wm8900_rinmix_controls, |
514 | ARRAY_SIZE(wm8900_rinmix_controls)), | 513 | ARRAY_SIZE(wm8900_rinmix_controls)), |
515 | 514 | ||
516 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8900_REG_POWER1, 4, 0), | 515 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8900_REG_POWER1, 4, 0, NULL, 0), |
517 | 516 | ||
518 | SND_SOC_DAPM_ADC("ADCL", "Left HiFi Capture", WM8900_REG_POWER2, 1, 0), | 517 | SND_SOC_DAPM_ADC("ADCL", "Left HiFi Capture", WM8900_REG_POWER2, 1, 0), |
519 | SND_SOC_DAPM_ADC("ADCR", "Right HiFi Capture", WM8900_REG_POWER2, 0, 0), | 518 | SND_SOC_DAPM_ADC("ADCR", "Right HiFi Capture", WM8900_REG_POWER2, 0, 0), |
@@ -543,7 +542,7 @@ SND_SOC_DAPM_MIXER("Right Output Mixer", WM8900_REG_POWER3, 2, 0, | |||
543 | }; | 542 | }; |
544 | 543 | ||
545 | /* Target, Path, Source */ | 544 | /* Target, Path, Source */ |
546 | static const struct snd_soc_dapm_route audio_map[] = { | 545 | static const struct snd_soc_dapm_route wm8900_dapm_routes[] = { |
547 | /* Inputs */ | 546 | /* Inputs */ |
548 | {"Left Input PGA", "LINPUT1 Switch", "LINPUT1"}, | 547 | {"Left Input PGA", "LINPUT1 Switch", "LINPUT1"}, |
549 | {"Left Input PGA", "LINPUT2 Switch", "LINPUT2"}, | 548 | {"Left Input PGA", "LINPUT2 Switch", "LINPUT2"}, |
@@ -607,17 +606,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
607 | {"HP_R", NULL, "Headphone Amplifier"}, | 606 | {"HP_R", NULL, "Headphone Amplifier"}, |
608 | }; | 607 | }; |
609 | 608 | ||
610 | static int wm8900_add_widgets(struct snd_soc_codec *codec) | ||
611 | { | ||
612 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
613 | |||
614 | snd_soc_dapm_new_controls(dapm, wm8900_dapm_widgets, | ||
615 | ARRAY_SIZE(wm8900_dapm_widgets)); | ||
616 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
617 | |||
618 | return 0; | ||
619 | } | ||
620 | |||
621 | static int wm8900_hw_params(struct snd_pcm_substream *substream, | 609 | static int wm8900_hw_params(struct snd_pcm_substream *substream, |
622 | struct snd_pcm_hw_params *params, | 610 | struct snd_pcm_hw_params *params, |
623 | struct snd_soc_dai *dai) | 611 | struct snd_soc_dai *dai) |
@@ -987,7 +975,7 @@ static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute) | |||
987 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ | 975 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ |
988 | SNDRV_PCM_FORMAT_S24_LE) | 976 | SNDRV_PCM_FORMAT_S24_LE) |
989 | 977 | ||
990 | static struct snd_soc_dai_ops wm8900_dai_ops = { | 978 | static const struct snd_soc_dai_ops wm8900_dai_ops = { |
991 | .hw_params = wm8900_hw_params, | 979 | .hw_params = wm8900_hw_params, |
992 | .set_clkdiv = wm8900_set_dai_clkdiv, | 980 | .set_clkdiv = wm8900_set_dai_clkdiv, |
993 | .set_pll = wm8900_set_dai_pll, | 981 | .set_pll = wm8900_set_dai_pll, |
@@ -1107,7 +1095,7 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec, | |||
1107 | return 0; | 1095 | return 0; |
1108 | } | 1096 | } |
1109 | 1097 | ||
1110 | static int wm8900_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1098 | static int wm8900_suspend(struct snd_soc_codec *codec) |
1111 | { | 1099 | { |
1112 | struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec); | 1100 | struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec); |
1113 | int fll_out = wm8900->fll_out; | 1101 | int fll_out = wm8900->fll_out; |
@@ -1204,10 +1192,6 @@ static int wm8900_probe(struct snd_soc_codec *codec) | |||
1204 | /* Set the DAC and mixer output bias */ | 1192 | /* Set the DAC and mixer output bias */ |
1205 | snd_soc_write(codec, WM8900_REG_OUTBIASCTL, 0x81); | 1193 | snd_soc_write(codec, WM8900_REG_OUTBIASCTL, 0x81); |
1206 | 1194 | ||
1207 | snd_soc_add_controls(codec, wm8900_snd_controls, | ||
1208 | ARRAY_SIZE(wm8900_snd_controls)); | ||
1209 | wm8900_add_widgets(codec); | ||
1210 | |||
1211 | return 0; | 1195 | return 0; |
1212 | } | 1196 | } |
1213 | 1197 | ||
@@ -1228,6 +1212,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8900 = { | |||
1228 | .reg_cache_size = ARRAY_SIZE(wm8900_reg_defaults), | 1212 | .reg_cache_size = ARRAY_SIZE(wm8900_reg_defaults), |
1229 | .reg_word_size = sizeof(u16), | 1213 | .reg_word_size = sizeof(u16), |
1230 | .reg_cache_default = wm8900_reg_defaults, | 1214 | .reg_cache_default = wm8900_reg_defaults, |
1215 | |||
1216 | .controls = wm8900_snd_controls, | ||
1217 | .num_controls = ARRAY_SIZE(wm8900_snd_controls), | ||
1218 | .dapm_widgets = wm8900_dapm_widgets, | ||
1219 | .num_dapm_widgets = ARRAY_SIZE(wm8900_dapm_widgets), | ||
1220 | .dapm_routes = wm8900_dapm_routes, | ||
1221 | .num_dapm_routes = ARRAY_SIZE(wm8900_dapm_routes), | ||
1231 | }; | 1222 | }; |
1232 | 1223 | ||
1233 | #if defined(CONFIG_SPI_MASTER) | 1224 | #if defined(CONFIG_SPI_MASTER) |
@@ -1259,7 +1250,7 @@ static int __devexit wm8900_spi_remove(struct spi_device *spi) | |||
1259 | 1250 | ||
1260 | static struct spi_driver wm8900_spi_driver = { | 1251 | static struct spi_driver wm8900_spi_driver = { |
1261 | .driver = { | 1252 | .driver = { |
1262 | .name = "wm8900-codec", | 1253 | .name = "wm8900", |
1263 | .owner = THIS_MODULE, | 1254 | .owner = THIS_MODULE, |
1264 | }, | 1255 | }, |
1265 | .probe = wm8900_spi_probe, | 1256 | .probe = wm8900_spi_probe, |
@@ -1303,7 +1294,7 @@ MODULE_DEVICE_TABLE(i2c, wm8900_i2c_id); | |||
1303 | 1294 | ||
1304 | static struct i2c_driver wm8900_i2c_driver = { | 1295 | static struct i2c_driver wm8900_i2c_driver = { |
1305 | .driver = { | 1296 | .driver = { |
1306 | .name = "wm8900-codec", | 1297 | .name = "wm8900", |
1307 | .owner = THIS_MODULE, | 1298 | .owner = THIS_MODULE, |
1308 | }, | 1299 | }, |
1309 | .probe = wm8900_i2c_probe, | 1300 | .probe = wm8900_i2c_probe, |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 4ad8ebd290e..c91fb2f99c1 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -23,8 +23,9 @@ | |||
23 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/regmap.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/irq.h> | ||
28 | #include <sound/core.h> | 29 | #include <sound/core.h> |
29 | #include <sound/jack.h> | 30 | #include <sound/jack.h> |
30 | #include <sound/pcm.h> | 31 | #include <sound/pcm.h> |
@@ -38,184 +39,85 @@ | |||
38 | #include "wm8903.h" | 39 | #include "wm8903.h" |
39 | 40 | ||
40 | /* Register defaults at reset */ | 41 | /* Register defaults at reset */ |
41 | static u16 wm8903_reg_defaults[] = { | 42 | static const struct reg_default wm8903_reg_defaults[] = { |
42 | 0x8903, /* R0 - SW Reset and ID */ | 43 | { 4, 0x0018 }, /* R4 - Bias Control 0 */ |
43 | 0x0000, /* R1 - Revision Number */ | 44 | { 5, 0x0000 }, /* R5 - VMID Control 0 */ |
44 | 0x0000, /* R2 */ | 45 | { 6, 0x0000 }, /* R6 - Mic Bias Control 0 */ |
45 | 0x0000, /* R3 */ | 46 | { 8, 0x0001 }, /* R8 - Analogue DAC 0 */ |
46 | 0x0018, /* R4 - Bias Control 0 */ | 47 | { 10, 0x0001 }, /* R10 - Analogue ADC 0 */ |
47 | 0x0000, /* R5 - VMID Control 0 */ | 48 | { 12, 0x0000 }, /* R12 - Power Management 0 */ |
48 | 0x0000, /* R6 - Mic Bias Control 0 */ | 49 | { 13, 0x0000 }, /* R13 - Power Management 1 */ |
49 | 0x0000, /* R7 */ | 50 | { 14, 0x0000 }, /* R14 - Power Management 2 */ |
50 | 0x0001, /* R8 - Analogue DAC 0 */ | 51 | { 15, 0x0000 }, /* R15 - Power Management 3 */ |
51 | 0x0000, /* R9 */ | 52 | { 16, 0x0000 }, /* R16 - Power Management 4 */ |
52 | 0x0001, /* R10 - Analogue ADC 0 */ | 53 | { 17, 0x0000 }, /* R17 - Power Management 5 */ |
53 | 0x0000, /* R11 */ | 54 | { 18, 0x0000 }, /* R18 - Power Management 6 */ |
54 | 0x0000, /* R12 - Power Management 0 */ | 55 | { 20, 0x0400 }, /* R20 - Clock Rates 0 */ |
55 | 0x0000, /* R13 - Power Management 1 */ | 56 | { 21, 0x0D07 }, /* R21 - Clock Rates 1 */ |
56 | 0x0000, /* R14 - Power Management 2 */ | 57 | { 22, 0x0000 }, /* R22 - Clock Rates 2 */ |
57 | 0x0000, /* R15 - Power Management 3 */ | 58 | { 24, 0x0050 }, /* R24 - Audio Interface 0 */ |
58 | 0x0000, /* R16 - Power Management 4 */ | 59 | { 25, 0x0242 }, /* R25 - Audio Interface 1 */ |
59 | 0x0000, /* R17 - Power Management 5 */ | 60 | { 26, 0x0008 }, /* R26 - Audio Interface 2 */ |
60 | 0x0000, /* R18 - Power Management 6 */ | 61 | { 27, 0x0022 }, /* R27 - Audio Interface 3 */ |
61 | 0x0000, /* R19 */ | 62 | { 30, 0x00C0 }, /* R30 - DAC Digital Volume Left */ |
62 | 0x0400, /* R20 - Clock Rates 0 */ | 63 | { 31, 0x00C0 }, /* R31 - DAC Digital Volume Right */ |
63 | 0x0D07, /* R21 - Clock Rates 1 */ | 64 | { 32, 0x0000 }, /* R32 - DAC Digital 0 */ |
64 | 0x0000, /* R22 - Clock Rates 2 */ | 65 | { 33, 0x0000 }, /* R33 - DAC Digital 1 */ |
65 | 0x0000, /* R23 */ | 66 | { 36, 0x00C0 }, /* R36 - ADC Digital Volume Left */ |
66 | 0x0050, /* R24 - Audio Interface 0 */ | 67 | { 37, 0x00C0 }, /* R37 - ADC Digital Volume Right */ |
67 | 0x0242, /* R25 - Audio Interface 1 */ | 68 | { 38, 0x0000 }, /* R38 - ADC Digital 0 */ |
68 | 0x0008, /* R26 - Audio Interface 2 */ | 69 | { 39, 0x0073 }, /* R39 - Digital Microphone 0 */ |
69 | 0x0022, /* R27 - Audio Interface 3 */ | 70 | { 40, 0x09BF }, /* R40 - DRC 0 */ |
70 | 0x0000, /* R28 */ | 71 | { 41, 0x3241 }, /* R41 - DRC 1 */ |
71 | 0x0000, /* R29 */ | 72 | { 42, 0x0020 }, /* R42 - DRC 2 */ |
72 | 0x00C0, /* R30 - DAC Digital Volume Left */ | 73 | { 43, 0x0000 }, /* R43 - DRC 3 */ |
73 | 0x00C0, /* R31 - DAC Digital Volume Right */ | 74 | { 44, 0x0085 }, /* R44 - Analogue Left Input 0 */ |
74 | 0x0000, /* R32 - DAC Digital 0 */ | 75 | { 45, 0x0085 }, /* R45 - Analogue Right Input 0 */ |
75 | 0x0000, /* R33 - DAC Digital 1 */ | 76 | { 46, 0x0044 }, /* R46 - Analogue Left Input 1 */ |
76 | 0x0000, /* R34 */ | 77 | { 47, 0x0044 }, /* R47 - Analogue Right Input 1 */ |
77 | 0x0000, /* R35 */ | 78 | { 50, 0x0008 }, /* R50 - Analogue Left Mix 0 */ |
78 | 0x00C0, /* R36 - ADC Digital Volume Left */ | 79 | { 51, 0x0004 }, /* R51 - Analogue Right Mix 0 */ |
79 | 0x00C0, /* R37 - ADC Digital Volume Right */ | 80 | { 52, 0x0000 }, /* R52 - Analogue Spk Mix Left 0 */ |
80 | 0x0000, /* R38 - ADC Digital 0 */ | 81 | { 53, 0x0000 }, /* R53 - Analogue Spk Mix Left 1 */ |
81 | 0x0073, /* R39 - Digital Microphone 0 */ | 82 | { 54, 0x0000 }, /* R54 - Analogue Spk Mix Right 0 */ |
82 | 0x09BF, /* R40 - DRC 0 */ | 83 | { 55, 0x0000 }, /* R55 - Analogue Spk Mix Right 1 */ |
83 | 0x3241, /* R41 - DRC 1 */ | 84 | { 57, 0x002D }, /* R57 - Analogue OUT1 Left */ |
84 | 0x0020, /* R42 - DRC 2 */ | 85 | { 58, 0x002D }, /* R58 - Analogue OUT1 Right */ |
85 | 0x0000, /* R43 - DRC 3 */ | 86 | { 59, 0x0039 }, /* R59 - Analogue OUT2 Left */ |
86 | 0x0085, /* R44 - Analogue Left Input 0 */ | 87 | { 60, 0x0039 }, /* R60 - Analogue OUT2 Right */ |
87 | 0x0085, /* R45 - Analogue Right Input 0 */ | 88 | { 62, 0x0139 }, /* R62 - Analogue OUT3 Left */ |
88 | 0x0044, /* R46 - Analogue Left Input 1 */ | 89 | { 63, 0x0139 }, /* R63 - Analogue OUT3 Right */ |
89 | 0x0044, /* R47 - Analogue Right Input 1 */ | 90 | { 64, 0x0000 }, /* R65 - Analogue SPK Output Control 0 */ |
90 | 0x0000, /* R48 */ | 91 | { 67, 0x0010 }, /* R67 - DC Servo 0 */ |
91 | 0x0000, /* R49 */ | 92 | { 69, 0x00A4 }, /* R69 - DC Servo 2 */ |
92 | 0x0008, /* R50 - Analogue Left Mix 0 */ | 93 | { 90, 0x0000 }, /* R90 - Analogue HP 0 */ |
93 | 0x0004, /* R51 - Analogue Right Mix 0 */ | 94 | { 94, 0x0000 }, /* R94 - Analogue Lineout 0 */ |
94 | 0x0000, /* R52 - Analogue Spk Mix Left 0 */ | 95 | { 98, 0x0000 }, /* R98 - Charge Pump 0 */ |
95 | 0x0000, /* R53 - Analogue Spk Mix Left 1 */ | 96 | { 104, 0x0000 }, /* R104 - Class W 0 */ |
96 | 0x0000, /* R54 - Analogue Spk Mix Right 0 */ | 97 | { 108, 0x0000 }, /* R108 - Write Sequencer 0 */ |
97 | 0x0000, /* R55 - Analogue Spk Mix Right 1 */ | 98 | { 109, 0x0000 }, /* R109 - Write Sequencer 1 */ |
98 | 0x0000, /* R56 */ | 99 | { 110, 0x0000 }, /* R110 - Write Sequencer 2 */ |
99 | 0x002D, /* R57 - Analogue OUT1 Left */ | 100 | { 111, 0x0000 }, /* R111 - Write Sequencer 3 */ |
100 | 0x002D, /* R58 - Analogue OUT1 Right */ | 101 | { 112, 0x0000 }, /* R112 - Write Sequencer 4 */ |
101 | 0x0039, /* R59 - Analogue OUT2 Left */ | 102 | { 114, 0x0000 }, /* R114 - Control Interface */ |
102 | 0x0039, /* R60 - Analogue OUT2 Right */ | 103 | { 116, 0x00A8 }, /* R116 - GPIO Control 1 */ |
103 | 0x0100, /* R61 */ | 104 | { 117, 0x00A8 }, /* R117 - GPIO Control 2 */ |
104 | 0x0139, /* R62 - Analogue OUT3 Left */ | 105 | { 118, 0x00A8 }, /* R118 - GPIO Control 3 */ |
105 | 0x0139, /* R63 - Analogue OUT3 Right */ | 106 | { 119, 0x0220 }, /* R119 - GPIO Control 4 */ |
106 | 0x0000, /* R64 */ | 107 | { 120, 0x01A0 }, /* R120 - GPIO Control 5 */ |
107 | 0x0000, /* R65 - Analogue SPK Output Control 0 */ | 108 | { 122, 0xFFFF }, /* R122 - Interrupt Status 1 Mask */ |
108 | 0x0000, /* R66 */ | 109 | { 123, 0x0000 }, /* R123 - Interrupt Polarity 1 */ |
109 | 0x0010, /* R67 - DC Servo 0 */ | 110 | { 126, 0x0000 }, /* R126 - Interrupt Control */ |
110 | 0x0100, /* R68 */ | 111 | { 129, 0x0000 }, /* R129 - Control Interface Test 1 */ |
111 | 0x00A4, /* R69 - DC Servo 2 */ | 112 | { 149, 0x6810 }, /* R149 - Charge Pump Test 1 */ |
112 | 0x0807, /* R70 */ | 113 | { 164, 0x0028 }, /* R164 - Clock Rate Test 4 */ |
113 | 0x0000, /* R71 */ | 114 | { 172, 0x0000 }, /* R172 - Analogue Output Bias 0 */ |
114 | 0x0000, /* R72 */ | ||
115 | 0x0000, /* R73 */ | ||
116 | 0x0000, /* R74 */ | ||
117 | 0x0000, /* R75 */ | ||
118 | 0x0000, /* R76 */ | ||
119 | 0x0000, /* R77 */ | ||
120 | 0x0000, /* R78 */ | ||
121 | 0x000E, /* R79 */ | ||
122 | 0x0000, /* R80 */ | ||
123 | 0x0000, /* R81 */ | ||
124 | 0x0000, /* R82 */ | ||
125 | 0x0000, /* R83 */ | ||
126 | 0x0000, /* R84 */ | ||
127 | 0x0000, /* R85 */ | ||
128 | 0x0000, /* R86 */ | ||
129 | 0x0006, /* R87 */ | ||
130 | 0x0000, /* R88 */ | ||
131 | 0x0000, /* R89 */ | ||
132 | 0x0000, /* R90 - Analogue HP 0 */ | ||
133 | 0x0060, /* R91 */ | ||
134 | 0x0000, /* R92 */ | ||
135 | 0x0000, /* R93 */ | ||
136 | 0x0000, /* R94 - Analogue Lineout 0 */ | ||
137 | 0x0060, /* R95 */ | ||
138 | 0x0000, /* R96 */ | ||
139 | 0x0000, /* R97 */ | ||
140 | 0x0000, /* R98 - Charge Pump 0 */ | ||
141 | 0x1F25, /* R99 */ | ||
142 | 0x2B19, /* R100 */ | ||
143 | 0x01C0, /* R101 */ | ||
144 | 0x01EF, /* R102 */ | ||
145 | 0x2B00, /* R103 */ | ||
146 | 0x0000, /* R104 - Class W 0 */ | ||
147 | 0x01C0, /* R105 */ | ||
148 | 0x1C10, /* R106 */ | ||
149 | 0x0000, /* R107 */ | ||
150 | 0x0000, /* R108 - Write Sequencer 0 */ | ||
151 | 0x0000, /* R109 - Write Sequencer 1 */ | ||
152 | 0x0000, /* R110 - Write Sequencer 2 */ | ||
153 | 0x0000, /* R111 - Write Sequencer 3 */ | ||
154 | 0x0000, /* R112 - Write Sequencer 4 */ | ||
155 | 0x0000, /* R113 */ | ||
156 | 0x0000, /* R114 - Control Interface */ | ||
157 | 0x0000, /* R115 */ | ||
158 | 0x00A8, /* R116 - GPIO Control 1 */ | ||
159 | 0x00A8, /* R117 - GPIO Control 2 */ | ||
160 | 0x00A8, /* R118 - GPIO Control 3 */ | ||
161 | 0x0220, /* R119 - GPIO Control 4 */ | ||
162 | 0x01A0, /* R120 - GPIO Control 5 */ | ||
163 | 0x0000, /* R121 - Interrupt Status 1 */ | ||
164 | 0xFFFF, /* R122 - Interrupt Status 1 Mask */ | ||
165 | 0x0000, /* R123 - Interrupt Polarity 1 */ | ||
166 | 0x0000, /* R124 */ | ||
167 | 0x0003, /* R125 */ | ||
168 | 0x0000, /* R126 - Interrupt Control */ | ||
169 | 0x0000, /* R127 */ | ||
170 | 0x0005, /* R128 */ | ||
171 | 0x0000, /* R129 - Control Interface Test 1 */ | ||
172 | 0x0000, /* R130 */ | ||
173 | 0x0000, /* R131 */ | ||
174 | 0x0000, /* R132 */ | ||
175 | 0x0000, /* R133 */ | ||
176 | 0x0000, /* R134 */ | ||
177 | 0x03FF, /* R135 */ | ||
178 | 0x0007, /* R136 */ | ||
179 | 0x0040, /* R137 */ | ||
180 | 0x0000, /* R138 */ | ||
181 | 0x0000, /* R139 */ | ||
182 | 0x0000, /* R140 */ | ||
183 | 0x0000, /* R141 */ | ||
184 | 0x0000, /* R142 */ | ||
185 | 0x0000, /* R143 */ | ||
186 | 0x0000, /* R144 */ | ||
187 | 0x0000, /* R145 */ | ||
188 | 0x0000, /* R146 */ | ||
189 | 0x0000, /* R147 */ | ||
190 | 0x4000, /* R148 */ | ||
191 | 0x6810, /* R149 - Charge Pump Test 1 */ | ||
192 | 0x0004, /* R150 */ | ||
193 | 0x0000, /* R151 */ | ||
194 | 0x0000, /* R152 */ | ||
195 | 0x0000, /* R153 */ | ||
196 | 0x0000, /* R154 */ | ||
197 | 0x0000, /* R155 */ | ||
198 | 0x0000, /* R156 */ | ||
199 | 0x0000, /* R157 */ | ||
200 | 0x0000, /* R158 */ | ||
201 | 0x0000, /* R159 */ | ||
202 | 0x0000, /* R160 */ | ||
203 | 0x0000, /* R161 */ | ||
204 | 0x0000, /* R162 */ | ||
205 | 0x0000, /* R163 */ | ||
206 | 0x0028, /* R164 - Clock Rate Test 4 */ | ||
207 | 0x0004, /* R165 */ | ||
208 | 0x0000, /* R166 */ | ||
209 | 0x0060, /* R167 */ | ||
210 | 0x0000, /* R168 */ | ||
211 | 0x0000, /* R169 */ | ||
212 | 0x0000, /* R170 */ | ||
213 | 0x0000, /* R171 */ | ||
214 | 0x0000, /* R172 - Analogue Output Bias 0 */ | ||
215 | }; | 115 | }; |
216 | 116 | ||
217 | struct wm8903_priv { | 117 | struct wm8903_priv { |
118 | struct wm8903_platform_data *pdata; | ||
218 | struct snd_soc_codec *codec; | 119 | struct snd_soc_codec *codec; |
120 | struct regmap *regmap; | ||
219 | 121 | ||
220 | int sysclk; | 122 | int sysclk; |
221 | int irq; | 123 | int irq; |
@@ -240,7 +142,93 @@ struct wm8903_priv { | |||
240 | #endif | 142 | #endif |
241 | }; | 143 | }; |
242 | 144 | ||
243 | static int wm8903_volatile_register(struct snd_soc_codec *codec, unsigned int reg) | 145 | static bool wm8903_readable_register(struct device *dev, unsigned int reg) |
146 | { | ||
147 | switch (reg) { | ||
148 | case WM8903_SW_RESET_AND_ID: | ||
149 | case WM8903_REVISION_NUMBER: | ||
150 | case WM8903_BIAS_CONTROL_0: | ||
151 | case WM8903_VMID_CONTROL_0: | ||
152 | case WM8903_MIC_BIAS_CONTROL_0: | ||
153 | case WM8903_ANALOGUE_DAC_0: | ||
154 | case WM8903_ANALOGUE_ADC_0: | ||
155 | case WM8903_POWER_MANAGEMENT_0: | ||
156 | case WM8903_POWER_MANAGEMENT_1: | ||
157 | case WM8903_POWER_MANAGEMENT_2: | ||
158 | case WM8903_POWER_MANAGEMENT_3: | ||
159 | case WM8903_POWER_MANAGEMENT_4: | ||
160 | case WM8903_POWER_MANAGEMENT_5: | ||
161 | case WM8903_POWER_MANAGEMENT_6: | ||
162 | case WM8903_CLOCK_RATES_0: | ||
163 | case WM8903_CLOCK_RATES_1: | ||
164 | case WM8903_CLOCK_RATES_2: | ||
165 | case WM8903_AUDIO_INTERFACE_0: | ||
166 | case WM8903_AUDIO_INTERFACE_1: | ||
167 | case WM8903_AUDIO_INTERFACE_2: | ||
168 | case WM8903_AUDIO_INTERFACE_3: | ||
169 | case WM8903_DAC_DIGITAL_VOLUME_LEFT: | ||
170 | case WM8903_DAC_DIGITAL_VOLUME_RIGHT: | ||
171 | case WM8903_DAC_DIGITAL_0: | ||
172 | case WM8903_DAC_DIGITAL_1: | ||
173 | case WM8903_ADC_DIGITAL_VOLUME_LEFT: | ||
174 | case WM8903_ADC_DIGITAL_VOLUME_RIGHT: | ||
175 | case WM8903_ADC_DIGITAL_0: | ||
176 | case WM8903_DIGITAL_MICROPHONE_0: | ||
177 | case WM8903_DRC_0: | ||
178 | case WM8903_DRC_1: | ||
179 | case WM8903_DRC_2: | ||
180 | case WM8903_DRC_3: | ||
181 | case WM8903_ANALOGUE_LEFT_INPUT_0: | ||
182 | case WM8903_ANALOGUE_RIGHT_INPUT_0: | ||
183 | case WM8903_ANALOGUE_LEFT_INPUT_1: | ||
184 | case WM8903_ANALOGUE_RIGHT_INPUT_1: | ||
185 | case WM8903_ANALOGUE_LEFT_MIX_0: | ||
186 | case WM8903_ANALOGUE_RIGHT_MIX_0: | ||
187 | case WM8903_ANALOGUE_SPK_MIX_LEFT_0: | ||
188 | case WM8903_ANALOGUE_SPK_MIX_LEFT_1: | ||
189 | case WM8903_ANALOGUE_SPK_MIX_RIGHT_0: | ||
190 | case WM8903_ANALOGUE_SPK_MIX_RIGHT_1: | ||
191 | case WM8903_ANALOGUE_OUT1_LEFT: | ||
192 | case WM8903_ANALOGUE_OUT1_RIGHT: | ||
193 | case WM8903_ANALOGUE_OUT2_LEFT: | ||
194 | case WM8903_ANALOGUE_OUT2_RIGHT: | ||
195 | case WM8903_ANALOGUE_OUT3_LEFT: | ||
196 | case WM8903_ANALOGUE_OUT3_RIGHT: | ||
197 | case WM8903_ANALOGUE_SPK_OUTPUT_CONTROL_0: | ||
198 | case WM8903_DC_SERVO_0: | ||
199 | case WM8903_DC_SERVO_2: | ||
200 | case WM8903_DC_SERVO_READBACK_1: | ||
201 | case WM8903_DC_SERVO_READBACK_2: | ||
202 | case WM8903_DC_SERVO_READBACK_3: | ||
203 | case WM8903_DC_SERVO_READBACK_4: | ||
204 | case WM8903_ANALOGUE_HP_0: | ||
205 | case WM8903_ANALOGUE_LINEOUT_0: | ||
206 | case WM8903_CHARGE_PUMP_0: | ||
207 | case WM8903_CLASS_W_0: | ||
208 | case WM8903_WRITE_SEQUENCER_0: | ||
209 | case WM8903_WRITE_SEQUENCER_1: | ||
210 | case WM8903_WRITE_SEQUENCER_2: | ||
211 | case WM8903_WRITE_SEQUENCER_3: | ||
212 | case WM8903_WRITE_SEQUENCER_4: | ||
213 | case WM8903_CONTROL_INTERFACE: | ||
214 | case WM8903_GPIO_CONTROL_1: | ||
215 | case WM8903_GPIO_CONTROL_2: | ||
216 | case WM8903_GPIO_CONTROL_3: | ||
217 | case WM8903_GPIO_CONTROL_4: | ||
218 | case WM8903_GPIO_CONTROL_5: | ||
219 | case WM8903_INTERRUPT_STATUS_1: | ||
220 | case WM8903_INTERRUPT_STATUS_1_MASK: | ||
221 | case WM8903_INTERRUPT_POLARITY_1: | ||
222 | case WM8903_INTERRUPT_CONTROL: | ||
223 | case WM8903_CLOCK_RATE_TEST_4: | ||
224 | case WM8903_ANALOGUE_OUTPUT_BIAS_0: | ||
225 | return true; | ||
226 | default: | ||
227 | return false; | ||
228 | } | ||
229 | } | ||
230 | |||
231 | static bool wm8903_volatile_register(struct device *dev, unsigned int reg) | ||
244 | { | 232 | { |
245 | switch (reg) { | 233 | switch (reg) { |
246 | case WM8903_SW_RESET_AND_ID: | 234 | case WM8903_SW_RESET_AND_ID: |
@@ -258,13 +246,6 @@ static int wm8903_volatile_register(struct snd_soc_codec *codec, unsigned int re | |||
258 | } | 246 | } |
259 | } | 247 | } |
260 | 248 | ||
261 | static void wm8903_reset(struct snd_soc_codec *codec) | ||
262 | { | ||
263 | snd_soc_write(codec, WM8903_SW_RESET_AND_ID, 0); | ||
264 | memcpy(codec->reg_cache, wm8903_reg_defaults, | ||
265 | sizeof(wm8903_reg_defaults)); | ||
266 | } | ||
267 | |||
268 | static int wm8903_cp_event(struct snd_soc_dapm_widget *w, | 249 | static int wm8903_cp_event(struct snd_soc_dapm_widget *w, |
269 | struct snd_kcontrol *kcontrol, int event) | 250 | struct snd_kcontrol *kcontrol, int event) |
270 | { | 251 | { |
@@ -839,7 +820,7 @@ SND_SOC_DAPM_OUTPUT("LON"), | |||
839 | SND_SOC_DAPM_OUTPUT("ROP"), | 820 | SND_SOC_DAPM_OUTPUT("ROP"), |
840 | SND_SOC_DAPM_OUTPUT("RON"), | 821 | SND_SOC_DAPM_OUTPUT("RON"), |
841 | 822 | ||
842 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8903_MIC_BIAS_CONTROL_0, 0, 0), | 823 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8903_MIC_BIAS_CONTROL_0, 0, 0, NULL, 0), |
843 | 824 | ||
844 | SND_SOC_DAPM_MUX("Left Input Mux", SND_SOC_NOPM, 0, 0, &linput_mux), | 825 | SND_SOC_DAPM_MUX("Left Input Mux", SND_SOC_NOPM, 0, 0, &linput_mux), |
845 | SND_SOC_DAPM_MUX("Left Input Inverting Mux", SND_SOC_NOPM, 0, 0, | 826 | SND_SOC_DAPM_MUX("Left Input Inverting Mux", SND_SOC_NOPM, 0, 0, |
@@ -948,7 +929,7 @@ SND_SOC_DAPM_SUPPLY("CLK_SYS", WM8903_CLOCK_RATES_2, 2, 0, NULL, 0), | |||
948 | static const struct snd_soc_dapm_route wm8903_intercon[] = { | 929 | static const struct snd_soc_dapm_route wm8903_intercon[] = { |
949 | 930 | ||
950 | { "CLK_DSP", NULL, "CLK_SYS" }, | 931 | { "CLK_DSP", NULL, "CLK_SYS" }, |
951 | { "Mic Bias", NULL, "CLK_SYS" }, | 932 | { "MICBIAS", NULL, "CLK_SYS" }, |
952 | { "HPL_DCS", NULL, "CLK_SYS" }, | 933 | { "HPL_DCS", NULL, "CLK_SYS" }, |
953 | { "HPR_DCS", NULL, "CLK_SYS" }, | 934 | { "HPR_DCS", NULL, "CLK_SYS" }, |
954 | { "LINEOUTL_DCS", NULL, "CLK_SYS" }, | 935 | { "LINEOUTL_DCS", NULL, "CLK_SYS" }, |
@@ -1732,7 +1713,7 @@ static irqreturn_t wm8903_irq(int irq, void *data) | |||
1732 | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1713 | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1733 | SNDRV_PCM_FMTBIT_S24_LE) | 1714 | SNDRV_PCM_FMTBIT_S24_LE) |
1734 | 1715 | ||
1735 | static struct snd_soc_dai_ops wm8903_dai_ops = { | 1716 | static const struct snd_soc_dai_ops wm8903_dai_ops = { |
1736 | .hw_params = wm8903_hw_params, | 1717 | .hw_params = wm8903_hw_params, |
1737 | .digital_mute = wm8903_digital_mute, | 1718 | .digital_mute = wm8903_digital_mute, |
1738 | .set_fmt = wm8903_set_dai_fmt, | 1719 | .set_fmt = wm8903_set_dai_fmt, |
@@ -1759,7 +1740,7 @@ static struct snd_soc_dai_driver wm8903_dai = { | |||
1759 | .symmetric_rates = 1, | 1740 | .symmetric_rates = 1, |
1760 | }; | 1741 | }; |
1761 | 1742 | ||
1762 | static int wm8903_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1743 | static int wm8903_suspend(struct snd_soc_codec *codec) |
1763 | { | 1744 | { |
1764 | wm8903_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1745 | wm8903_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1765 | 1746 | ||
@@ -1768,23 +1749,11 @@ static int wm8903_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
1768 | 1749 | ||
1769 | static int wm8903_resume(struct snd_soc_codec *codec) | 1750 | static int wm8903_resume(struct snd_soc_codec *codec) |
1770 | { | 1751 | { |
1771 | int i; | 1752 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); |
1772 | u16 *reg_cache = codec->reg_cache; | ||
1773 | u16 *tmp_cache = kmemdup(reg_cache, sizeof(wm8903_reg_defaults), | ||
1774 | GFP_KERNEL); | ||
1775 | 1753 | ||
1776 | /* Bring the codec back up to standby first to minimise pop/clicks */ | 1754 | regcache_sync(wm8903->regmap); |
1777 | wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1778 | 1755 | ||
1779 | /* Sync back everything else */ | 1756 | wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1780 | if (tmp_cache) { | ||
1781 | for (i = 2; i < ARRAY_SIZE(wm8903_reg_defaults); i++) | ||
1782 | if (tmp_cache[i] != reg_cache[i]) | ||
1783 | snd_soc_write(codec, i, tmp_cache[i]); | ||
1784 | kfree(tmp_cache); | ||
1785 | } else { | ||
1786 | dev_err(codec->dev, "Failed to allocate temporary cache\n"); | ||
1787 | } | ||
1788 | 1757 | ||
1789 | return 0; | 1758 | return 0; |
1790 | } | 1759 | } |
@@ -1808,13 +1777,18 @@ static int wm8903_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | |||
1808 | struct wm8903_priv *wm8903 = gpio_to_wm8903(chip); | 1777 | struct wm8903_priv *wm8903 = gpio_to_wm8903(chip); |
1809 | struct snd_soc_codec *codec = wm8903->codec; | 1778 | struct snd_soc_codec *codec = wm8903->codec; |
1810 | unsigned int mask, val; | 1779 | unsigned int mask, val; |
1780 | int ret; | ||
1811 | 1781 | ||
1812 | mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK; | 1782 | mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK; |
1813 | val = (WM8903_GPn_FN_GPIO_INPUT << WM8903_GP1_FN_SHIFT) | | 1783 | val = (WM8903_GPn_FN_GPIO_INPUT << WM8903_GP1_FN_SHIFT) | |
1814 | WM8903_GP1_DIR; | 1784 | WM8903_GP1_DIR; |
1815 | 1785 | ||
1816 | return snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset, | 1786 | ret = snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset, |
1817 | mask, val); | 1787 | mask, val); |
1788 | if (ret < 0) | ||
1789 | return ret; | ||
1790 | |||
1791 | return 0; | ||
1818 | } | 1792 | } |
1819 | 1793 | ||
1820 | static int wm8903_gpio_get(struct gpio_chip *chip, unsigned offset) | 1794 | static int wm8903_gpio_get(struct gpio_chip *chip, unsigned offset) |
@@ -1834,13 +1808,18 @@ static int wm8903_gpio_direction_out(struct gpio_chip *chip, | |||
1834 | struct wm8903_priv *wm8903 = gpio_to_wm8903(chip); | 1808 | struct wm8903_priv *wm8903 = gpio_to_wm8903(chip); |
1835 | struct snd_soc_codec *codec = wm8903->codec; | 1809 | struct snd_soc_codec *codec = wm8903->codec; |
1836 | unsigned int mask, val; | 1810 | unsigned int mask, val; |
1811 | int ret; | ||
1837 | 1812 | ||
1838 | mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK | WM8903_GP1_LVL_MASK; | 1813 | mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK | WM8903_GP1_LVL_MASK; |
1839 | val = (WM8903_GPn_FN_GPIO_OUTPUT << WM8903_GP1_FN_SHIFT) | | 1814 | val = (WM8903_GPn_FN_GPIO_OUTPUT << WM8903_GP1_FN_SHIFT) | |
1840 | (value << WM8903_GP2_LVL_SHIFT); | 1815 | (value << WM8903_GP2_LVL_SHIFT); |
1841 | 1816 | ||
1842 | return snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset, | 1817 | ret = snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset, |
1843 | mask, val); | 1818 | mask, val); |
1819 | if (ret < 0) | ||
1820 | return ret; | ||
1821 | |||
1822 | return 0; | ||
1844 | } | 1823 | } |
1845 | 1824 | ||
1846 | static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 1825 | static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
@@ -1867,14 +1846,14 @@ static struct gpio_chip wm8903_template_chip = { | |||
1867 | static void wm8903_init_gpio(struct snd_soc_codec *codec) | 1846 | static void wm8903_init_gpio(struct snd_soc_codec *codec) |
1868 | { | 1847 | { |
1869 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); | 1848 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); |
1870 | struct wm8903_platform_data *pdata = dev_get_platdata(codec->dev); | 1849 | struct wm8903_platform_data *pdata = wm8903->pdata; |
1871 | int ret; | 1850 | int ret; |
1872 | 1851 | ||
1873 | wm8903->gpio_chip = wm8903_template_chip; | 1852 | wm8903->gpio_chip = wm8903_template_chip; |
1874 | wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; | 1853 | wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; |
1875 | wm8903->gpio_chip.dev = codec->dev; | 1854 | wm8903->gpio_chip.dev = codec->dev; |
1876 | 1855 | ||
1877 | if (pdata && pdata->gpio_base) | 1856 | if (pdata->gpio_base) |
1878 | wm8903->gpio_chip.base = pdata->gpio_base; | 1857 | wm8903->gpio_chip.base = pdata->gpio_base; |
1879 | else | 1858 | else |
1880 | wm8903->gpio_chip.base = -1; | 1859 | wm8903->gpio_chip.base = -1; |
@@ -1905,78 +1884,65 @@ static void wm8903_free_gpio(struct snd_soc_codec *codec) | |||
1905 | 1884 | ||
1906 | static int wm8903_probe(struct snd_soc_codec *codec) | 1885 | static int wm8903_probe(struct snd_soc_codec *codec) |
1907 | { | 1886 | { |
1908 | struct wm8903_platform_data *pdata = dev_get_platdata(codec->dev); | ||
1909 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); | 1887 | struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec); |
1888 | struct wm8903_platform_data *pdata = wm8903->pdata; | ||
1910 | int ret, i; | 1889 | int ret, i; |
1911 | int trigger, irq_pol; | 1890 | int trigger, irq_pol; |
1912 | u16 val; | 1891 | u16 val; |
1892 | bool mic_gpio = false; | ||
1913 | 1893 | ||
1914 | wm8903->codec = codec; | 1894 | wm8903->codec = codec; |
1895 | codec->control_data = wm8903->regmap; | ||
1915 | 1896 | ||
1916 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_I2C); | 1897 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP); |
1917 | if (ret != 0) { | 1898 | if (ret != 0) { |
1918 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 1899 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
1919 | return ret; | 1900 | return ret; |
1920 | } | 1901 | } |
1921 | 1902 | ||
1922 | val = snd_soc_read(codec, WM8903_SW_RESET_AND_ID); | 1903 | /* Set up GPIOs, detect if any are MIC detect outputs */ |
1923 | if (val != wm8903_reg_defaults[WM8903_SW_RESET_AND_ID]) { | 1904 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) { |
1924 | dev_err(codec->dev, | 1905 | if ((!pdata->gpio_cfg[i]) || |
1925 | "Device with ID register %x is not a WM8903\n", val); | 1906 | (pdata->gpio_cfg[i] > WM8903_GPIO_CONFIG_ZERO)) |
1926 | return -ENODEV; | 1907 | continue; |
1927 | } | ||
1928 | |||
1929 | val = snd_soc_read(codec, WM8903_REVISION_NUMBER); | ||
1930 | dev_info(codec->dev, "WM8903 revision %c\n", | ||
1931 | (val & WM8903_CHIP_REV_MASK) + 'A'); | ||
1932 | 1908 | ||
1933 | wm8903_reset(codec); | 1909 | snd_soc_write(codec, WM8903_GPIO_CONTROL_1 + i, |
1910 | pdata->gpio_cfg[i] & 0x7fff); | ||
1934 | 1911 | ||
1935 | /* Set up GPIOs and microphone detection */ | 1912 | val = (pdata->gpio_cfg[i] & WM8903_GP1_FN_MASK) |
1936 | if (pdata) { | 1913 | >> WM8903_GP1_FN_SHIFT; |
1937 | bool mic_gpio = false; | ||
1938 | 1914 | ||
1939 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) { | 1915 | switch (val) { |
1940 | if (pdata->gpio_cfg[i] == WM8903_GPIO_NO_CONFIG) | 1916 | case WM8903_GPn_FN_MICBIAS_CURRENT_DETECT: |
1941 | continue; | 1917 | case WM8903_GPn_FN_MICBIAS_SHORT_DETECT: |
1942 | 1918 | mic_gpio = true; | |
1943 | snd_soc_write(codec, WM8903_GPIO_CONTROL_1 + i, | 1919 | break; |
1944 | pdata->gpio_cfg[i] & 0xffff); | 1920 | default: |
1945 | 1921 | break; | |
1946 | val = (pdata->gpio_cfg[i] & WM8903_GP1_FN_MASK) | ||
1947 | >> WM8903_GP1_FN_SHIFT; | ||
1948 | |||
1949 | switch (val) { | ||
1950 | case WM8903_GPn_FN_MICBIAS_CURRENT_DETECT: | ||
1951 | case WM8903_GPn_FN_MICBIAS_SHORT_DETECT: | ||
1952 | mic_gpio = true; | ||
1953 | break; | ||
1954 | default: | ||
1955 | break; | ||
1956 | } | ||
1957 | } | 1922 | } |
1923 | } | ||
1924 | |||
1925 | /* Set up microphone detection */ | ||
1926 | snd_soc_write(codec, WM8903_MIC_BIAS_CONTROL_0, | ||
1927 | pdata->micdet_cfg); | ||
1958 | 1928 | ||
1959 | snd_soc_write(codec, WM8903_MIC_BIAS_CONTROL_0, | 1929 | /* Microphone detection needs the WSEQ clock */ |
1960 | pdata->micdet_cfg); | 1930 | if (pdata->micdet_cfg) |
1931 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, | ||
1932 | WM8903_WSEQ_ENA, WM8903_WSEQ_ENA); | ||
1961 | 1933 | ||
1962 | /* Microphone detection needs the WSEQ clock */ | 1934 | /* If microphone detection is enabled by pdata but |
1963 | if (pdata->micdet_cfg) | 1935 | * detected via IRQ then interrupts can be lost before |
1964 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, | 1936 | * the machine driver has set up microphone detection |
1965 | WM8903_WSEQ_ENA, WM8903_WSEQ_ENA); | 1937 | * IRQs as the IRQs are clear on read. The detection |
1938 | * will be enabled when the machine driver configures. | ||
1939 | */ | ||
1940 | WARN_ON(!mic_gpio && (pdata->micdet_cfg & WM8903_MICDET_ENA)); | ||
1966 | 1941 | ||
1967 | /* If microphone detection is enabled by pdata but | 1942 | wm8903->mic_delay = pdata->micdet_delay; |
1968 | * detected via IRQ then interrupts can be lost before | ||
1969 | * the machine driver has set up microphone detection | ||
1970 | * IRQs as the IRQs are clear on read. The detection | ||
1971 | * will be enabled when the machine driver configures. | ||
1972 | */ | ||
1973 | WARN_ON(!mic_gpio && (pdata->micdet_cfg & WM8903_MICDET_ENA)); | ||
1974 | 1943 | ||
1975 | wm8903->mic_delay = pdata->micdet_delay; | ||
1976 | } | ||
1977 | |||
1978 | if (wm8903->irq) { | 1944 | if (wm8903->irq) { |
1979 | if (pdata && pdata->irq_active_low) { | 1945 | if (pdata->irq_active_low) { |
1980 | trigger = IRQF_TRIGGER_LOW; | 1946 | trigger = IRQF_TRIGGER_LOW; |
1981 | irq_pol = WM8903_IRQ_POL; | 1947 | irq_pol = WM8903_IRQ_POL; |
1982 | } else { | 1948 | } else { |
@@ -2035,9 +2001,6 @@ static int wm8903_probe(struct snd_soc_codec *codec) | |||
2035 | WM8903_DAC_MUTEMODE | WM8903_DAC_MUTE, | 2001 | WM8903_DAC_MUTEMODE | WM8903_DAC_MUTE, |
2036 | WM8903_DAC_MUTEMODE | WM8903_DAC_MUTE); | 2002 | WM8903_DAC_MUTEMODE | WM8903_DAC_MUTE); |
2037 | 2003 | ||
2038 | snd_soc_add_controls(codec, wm8903_snd_controls, | ||
2039 | ARRAY_SIZE(wm8903_snd_controls)); | ||
2040 | |||
2041 | wm8903_init_gpio(codec); | 2004 | wm8903_init_gpio(codec); |
2042 | 2005 | ||
2043 | return ret; | 2006 | return ret; |
@@ -2062,45 +2025,198 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8903 = { | |||
2062 | .suspend = wm8903_suspend, | 2025 | .suspend = wm8903_suspend, |
2063 | .resume = wm8903_resume, | 2026 | .resume = wm8903_resume, |
2064 | .set_bias_level = wm8903_set_bias_level, | 2027 | .set_bias_level = wm8903_set_bias_level, |
2065 | .reg_cache_size = ARRAY_SIZE(wm8903_reg_defaults), | ||
2066 | .reg_word_size = sizeof(u16), | ||
2067 | .reg_cache_default = wm8903_reg_defaults, | ||
2068 | .volatile_register = wm8903_volatile_register, | ||
2069 | .seq_notifier = wm8903_seq_notifier, | 2028 | .seq_notifier = wm8903_seq_notifier, |
2029 | .controls = wm8903_snd_controls, | ||
2030 | .num_controls = ARRAY_SIZE(wm8903_snd_controls), | ||
2070 | .dapm_widgets = wm8903_dapm_widgets, | 2031 | .dapm_widgets = wm8903_dapm_widgets, |
2071 | .num_dapm_widgets = ARRAY_SIZE(wm8903_dapm_widgets), | 2032 | .num_dapm_widgets = ARRAY_SIZE(wm8903_dapm_widgets), |
2072 | .dapm_routes = wm8903_intercon, | 2033 | .dapm_routes = wm8903_intercon, |
2073 | .num_dapm_routes = ARRAY_SIZE(wm8903_intercon), | 2034 | .num_dapm_routes = ARRAY_SIZE(wm8903_intercon), |
2074 | }; | 2035 | }; |
2075 | 2036 | ||
2076 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 2037 | static const struct regmap_config wm8903_regmap = { |
2038 | .reg_bits = 8, | ||
2039 | .val_bits = 16, | ||
2040 | |||
2041 | .max_register = WM8903_MAX_REGISTER, | ||
2042 | .volatile_reg = wm8903_volatile_register, | ||
2043 | .readable_reg = wm8903_readable_register, | ||
2044 | |||
2045 | .cache_type = REGCACHE_RBTREE, | ||
2046 | .reg_defaults = wm8903_reg_defaults, | ||
2047 | .num_reg_defaults = ARRAY_SIZE(wm8903_reg_defaults), | ||
2048 | }; | ||
2049 | |||
2050 | static int wm8903_set_pdata_irq_trigger(struct i2c_client *i2c, | ||
2051 | struct wm8903_platform_data *pdata) | ||
2052 | { | ||
2053 | struct irq_data *irq_data = irq_get_irq_data(i2c->irq); | ||
2054 | if (!irq_data) { | ||
2055 | dev_err(&i2c->dev, "Invalid IRQ: %d\n", | ||
2056 | i2c->irq); | ||
2057 | return -EINVAL; | ||
2058 | } | ||
2059 | |||
2060 | switch (irqd_get_trigger_type(irq_data)) { | ||
2061 | case IRQ_TYPE_NONE: | ||
2062 | default: | ||
2063 | /* | ||
2064 | * We assume the controller imposes no restrictions, | ||
2065 | * so we are able to select active-high | ||
2066 | */ | ||
2067 | /* Fall-through */ | ||
2068 | case IRQ_TYPE_LEVEL_HIGH: | ||
2069 | pdata->irq_active_low = false; | ||
2070 | break; | ||
2071 | case IRQ_TYPE_LEVEL_LOW: | ||
2072 | pdata->irq_active_low = true; | ||
2073 | break; | ||
2074 | } | ||
2075 | |||
2076 | return 0; | ||
2077 | } | ||
2078 | |||
2079 | static int wm8903_set_pdata_from_of(struct i2c_client *i2c, | ||
2080 | struct wm8903_platform_data *pdata) | ||
2081 | { | ||
2082 | const struct device_node *np = i2c->dev.of_node; | ||
2083 | u32 val32; | ||
2084 | int i; | ||
2085 | |||
2086 | if (of_property_read_u32(np, "micdet-cfg", &val32) >= 0) | ||
2087 | pdata->micdet_cfg = val32; | ||
2088 | |||
2089 | if (of_property_read_u32(np, "micdet-delay", &val32) >= 0) | ||
2090 | pdata->micdet_delay = val32; | ||
2091 | |||
2092 | if (of_property_read_u32_array(np, "gpio-cfg", pdata->gpio_cfg, | ||
2093 | ARRAY_SIZE(pdata->gpio_cfg)) >= 0) { | ||
2094 | /* | ||
2095 | * In device tree: 0 means "write 0", | ||
2096 | * 0xffffffff means "don't touch". | ||
2097 | * | ||
2098 | * In platform data: 0 means "don't touch", | ||
2099 | * 0x8000 means "write 0". | ||
2100 | * | ||
2101 | * Note: WM8903_GPIO_CONFIG_ZERO == 0x8000. | ||
2102 | * | ||
2103 | * Convert from DT to pdata representation here, | ||
2104 | * so no other code needs to change. | ||
2105 | */ | ||
2106 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) { | ||
2107 | if (pdata->gpio_cfg[i] == 0) { | ||
2108 | pdata->gpio_cfg[i] = WM8903_GPIO_CONFIG_ZERO; | ||
2109 | } else if (pdata->gpio_cfg[i] == 0xffffffff) { | ||
2110 | pdata->gpio_cfg[i] = 0; | ||
2111 | } else if (pdata->gpio_cfg[i] > 0x7fff) { | ||
2112 | dev_err(&i2c->dev, "Invalid gpio-cfg[%d] %x\n", | ||
2113 | i, pdata->gpio_cfg[i]); | ||
2114 | return -EINVAL; | ||
2115 | } | ||
2116 | } | ||
2117 | } | ||
2118 | |||
2119 | return 0; | ||
2120 | } | ||
2121 | |||
2077 | static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, | 2122 | static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, |
2078 | const struct i2c_device_id *id) | 2123 | const struct i2c_device_id *id) |
2079 | { | 2124 | { |
2125 | struct wm8903_platform_data *pdata = dev_get_platdata(&i2c->dev); | ||
2080 | struct wm8903_priv *wm8903; | 2126 | struct wm8903_priv *wm8903; |
2127 | unsigned int val; | ||
2081 | int ret; | 2128 | int ret; |
2082 | 2129 | ||
2083 | wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL); | 2130 | wm8903 = devm_kzalloc(&i2c->dev, sizeof(struct wm8903_priv), |
2131 | GFP_KERNEL); | ||
2084 | if (wm8903 == NULL) | 2132 | if (wm8903 == NULL) |
2085 | return -ENOMEM; | 2133 | return -ENOMEM; |
2086 | 2134 | ||
2135 | wm8903->regmap = regmap_init_i2c(i2c, &wm8903_regmap); | ||
2136 | if (IS_ERR(wm8903->regmap)) { | ||
2137 | ret = PTR_ERR(wm8903->regmap); | ||
2138 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | ||
2139 | ret); | ||
2140 | return ret; | ||
2141 | } | ||
2142 | |||
2087 | i2c_set_clientdata(i2c, wm8903); | 2143 | i2c_set_clientdata(i2c, wm8903); |
2088 | wm8903->irq = i2c->irq; | 2144 | wm8903->irq = i2c->irq; |
2089 | 2145 | ||
2146 | /* If no platform data was supplied, create storage for defaults */ | ||
2147 | if (pdata) { | ||
2148 | wm8903->pdata = pdata; | ||
2149 | } else { | ||
2150 | wm8903->pdata = devm_kzalloc(&i2c->dev, | ||
2151 | sizeof(struct wm8903_platform_data), | ||
2152 | GFP_KERNEL); | ||
2153 | if (wm8903->pdata == NULL) { | ||
2154 | dev_err(&i2c->dev, "Failed to allocate pdata\n"); | ||
2155 | return -ENOMEM; | ||
2156 | } | ||
2157 | |||
2158 | if (i2c->irq) { | ||
2159 | ret = wm8903_set_pdata_irq_trigger(i2c, wm8903->pdata); | ||
2160 | if (ret != 0) | ||
2161 | return ret; | ||
2162 | } | ||
2163 | |||
2164 | if (i2c->dev.of_node) { | ||
2165 | ret = wm8903_set_pdata_from_of(i2c, wm8903->pdata); | ||
2166 | if (ret != 0) | ||
2167 | return ret; | ||
2168 | } | ||
2169 | } | ||
2170 | |||
2171 | ret = regmap_read(wm8903->regmap, WM8903_SW_RESET_AND_ID, &val); | ||
2172 | if (ret != 0) { | ||
2173 | dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret); | ||
2174 | goto err; | ||
2175 | } | ||
2176 | if (val != 0x8903) { | ||
2177 | dev_err(&i2c->dev, "Device with ID %x is not a WM8903\n", val); | ||
2178 | ret = -ENODEV; | ||
2179 | goto err; | ||
2180 | } | ||
2181 | |||
2182 | ret = regmap_read(wm8903->regmap, WM8903_REVISION_NUMBER, &val); | ||
2183 | if (ret != 0) { | ||
2184 | dev_err(&i2c->dev, "Failed to read chip revision: %d\n", ret); | ||
2185 | goto err; | ||
2186 | } | ||
2187 | dev_info(&i2c->dev, "WM8903 revision %c\n", | ||
2188 | (val & WM8903_CHIP_REV_MASK) + 'A'); | ||
2189 | |||
2190 | /* Reset the device */ | ||
2191 | regmap_write(wm8903->regmap, WM8903_SW_RESET_AND_ID, 0x8903); | ||
2192 | |||
2090 | ret = snd_soc_register_codec(&i2c->dev, | 2193 | ret = snd_soc_register_codec(&i2c->dev, |
2091 | &soc_codec_dev_wm8903, &wm8903_dai, 1); | 2194 | &soc_codec_dev_wm8903, &wm8903_dai, 1); |
2092 | if (ret < 0) | 2195 | if (ret != 0) |
2093 | kfree(wm8903); | 2196 | goto err; |
2197 | |||
2198 | return 0; | ||
2199 | err: | ||
2200 | regmap_exit(wm8903->regmap); | ||
2094 | return ret; | 2201 | return ret; |
2095 | } | 2202 | } |
2096 | 2203 | ||
2097 | static __devexit int wm8903_i2c_remove(struct i2c_client *client) | 2204 | static __devexit int wm8903_i2c_remove(struct i2c_client *client) |
2098 | { | 2205 | { |
2206 | struct wm8903_priv *wm8903 = i2c_get_clientdata(client); | ||
2207 | |||
2208 | regmap_exit(wm8903->regmap); | ||
2099 | snd_soc_unregister_codec(&client->dev); | 2209 | snd_soc_unregister_codec(&client->dev); |
2100 | kfree(i2c_get_clientdata(client)); | 2210 | |
2101 | return 0; | 2211 | return 0; |
2102 | } | 2212 | } |
2103 | 2213 | ||
2214 | static const struct of_device_id wm8903_of_match[] = { | ||
2215 | { .compatible = "wlf,wm8903", }, | ||
2216 | {}, | ||
2217 | }; | ||
2218 | MODULE_DEVICE_TABLE(of, wm8903_of_match); | ||
2219 | |||
2104 | static const struct i2c_device_id wm8903_i2c_id[] = { | 2220 | static const struct i2c_device_id wm8903_i2c_id[] = { |
2105 | { "wm8903", 0 }, | 2221 | { "wm8903", 0 }, |
2106 | { } | 2222 | { } |
@@ -2111,32 +2227,28 @@ static struct i2c_driver wm8903_i2c_driver = { | |||
2111 | .driver = { | 2227 | .driver = { |
2112 | .name = "wm8903", | 2228 | .name = "wm8903", |
2113 | .owner = THIS_MODULE, | 2229 | .owner = THIS_MODULE, |
2230 | .of_match_table = wm8903_of_match, | ||
2114 | }, | 2231 | }, |
2115 | .probe = wm8903_i2c_probe, | 2232 | .probe = wm8903_i2c_probe, |
2116 | .remove = __devexit_p(wm8903_i2c_remove), | 2233 | .remove = __devexit_p(wm8903_i2c_remove), |
2117 | .id_table = wm8903_i2c_id, | 2234 | .id_table = wm8903_i2c_id, |
2118 | }; | 2235 | }; |
2119 | #endif | ||
2120 | 2236 | ||
2121 | static int __init wm8903_modinit(void) | 2237 | static int __init wm8903_modinit(void) |
2122 | { | 2238 | { |
2123 | int ret = 0; | 2239 | int ret = 0; |
2124 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
2125 | ret = i2c_add_driver(&wm8903_i2c_driver); | 2240 | ret = i2c_add_driver(&wm8903_i2c_driver); |
2126 | if (ret != 0) { | 2241 | if (ret != 0) { |
2127 | printk(KERN_ERR "Failed to register wm8903 I2C driver: %d\n", | 2242 | printk(KERN_ERR "Failed to register wm8903 I2C driver: %d\n", |
2128 | ret); | 2243 | ret); |
2129 | } | 2244 | } |
2130 | #endif | ||
2131 | return ret; | 2245 | return ret; |
2132 | } | 2246 | } |
2133 | module_init(wm8903_modinit); | 2247 | module_init(wm8903_modinit); |
2134 | 2248 | ||
2135 | static void __exit wm8903_exit(void) | 2249 | static void __exit wm8903_exit(void) |
2136 | { | 2250 | { |
2137 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
2138 | i2c_del_driver(&wm8903_i2c_driver); | 2251 | i2c_del_driver(&wm8903_i2c_driver); |
2139 | #endif | ||
2140 | } | 2252 | } |
2141 | module_exit(wm8903_exit); | 2253 | module_exit(wm8903_exit); |
2142 | 2254 | ||
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 285ef87e670..f31c754c886 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/regulator/consumer.h> | 20 | #include <linux/regulator/consumer.h> |
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
@@ -1196,7 +1195,7 @@ SND_SOC_DAPM_INPUT("IN2R"), | |||
1196 | SND_SOC_DAPM_INPUT("IN3L"), | 1195 | SND_SOC_DAPM_INPUT("IN3L"), |
1197 | SND_SOC_DAPM_INPUT("IN3R"), | 1196 | SND_SOC_DAPM_INPUT("IN3R"), |
1198 | 1197 | ||
1199 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8904_MIC_BIAS_CONTROL_0, 0, 0), | 1198 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8904_MIC_BIAS_CONTROL_0, 0, 0, NULL, 0), |
1200 | 1199 | ||
1201 | SND_SOC_DAPM_MUX("Left Capture Mux", SND_SOC_NOPM, 0, 0, &lin_mux), | 1200 | SND_SOC_DAPM_MUX("Left Capture Mux", SND_SOC_NOPM, 0, 0, &lin_mux), |
1202 | SND_SOC_DAPM_MUX("Left Capture Inverting Mux", SND_SOC_NOPM, 0, 0, | 1201 | SND_SOC_DAPM_MUX("Left Capture Inverting Mux", SND_SOC_NOPM, 0, 0, |
@@ -2205,7 +2204,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, | |||
2205 | #define WM8904_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 2204 | #define WM8904_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
2206 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 2205 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
2207 | 2206 | ||
2208 | static struct snd_soc_dai_ops wm8904_dai_ops = { | 2207 | static const struct snd_soc_dai_ops wm8904_dai_ops = { |
2209 | .set_sysclk = wm8904_set_sysclk, | 2208 | .set_sysclk = wm8904_set_sysclk, |
2210 | .set_fmt = wm8904_set_fmt, | 2209 | .set_fmt = wm8904_set_fmt, |
2211 | .set_tdm_slot = wm8904_set_tdm_slot, | 2210 | .set_tdm_slot = wm8904_set_tdm_slot, |
@@ -2235,7 +2234,7 @@ static struct snd_soc_dai_driver wm8904_dai = { | |||
2235 | }; | 2234 | }; |
2236 | 2235 | ||
2237 | #ifdef CONFIG_PM | 2236 | #ifdef CONFIG_PM |
2238 | static int wm8904_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2237 | static int wm8904_suspend(struct snd_soc_codec *codec) |
2239 | { | 2238 | { |
2240 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2239 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2241 | 2240 | ||
@@ -2565,7 +2564,7 @@ MODULE_DEVICE_TABLE(i2c, wm8904_i2c_id); | |||
2565 | 2564 | ||
2566 | static struct i2c_driver wm8904_i2c_driver = { | 2565 | static struct i2c_driver wm8904_i2c_driver = { |
2567 | .driver = { | 2566 | .driver = { |
2568 | .name = "wm8904-codec", | 2567 | .name = "wm8904", |
2569 | .owner = THIS_MODULE, | 2568 | .owner = THIS_MODULE, |
2570 | }, | 2569 | }, |
2571 | .probe = wm8904_i2c_probe, | 2570 | .probe = wm8904_i2c_probe, |
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index de9ec9b8b7d..14039ea2f3e 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/pm.h> | 29 | #include <linux/pm.h> |
30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
31 | #include <linux/platform_device.h> | ||
32 | #include <linux/spi/spi.h> | 31 | #include <linux/spi/spi.h> |
33 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
34 | #include <sound/core.h> | 33 | #include <sound/core.h> |
@@ -629,8 +628,8 @@ static int wm8940_set_dai_clkdiv(struct snd_soc_dai *codec_dai, | |||
629 | ret = snd_soc_write(codec, WM8940_CLOCK, reg | (div << 5)); | 628 | ret = snd_soc_write(codec, WM8940_CLOCK, reg | (div << 5)); |
630 | break; | 629 | break; |
631 | case WM8940_OPCLKDIV: | 630 | case WM8940_OPCLKDIV: |
632 | reg = snd_soc_read(codec, WM8940_ADDCNTRL) & 0xFFCF; | 631 | reg = snd_soc_read(codec, WM8940_GPIO) & 0xFFCF; |
633 | ret = snd_soc_write(codec, WM8940_ADDCNTRL, reg | (div << 4)); | 632 | ret = snd_soc_write(codec, WM8940_GPIO, reg | (div << 4)); |
634 | break; | 633 | break; |
635 | } | 634 | } |
636 | return ret; | 635 | return ret; |
@@ -644,7 +643,7 @@ static int wm8940_set_dai_clkdiv(struct snd_soc_dai *codec_dai, | |||
644 | SNDRV_PCM_FMTBIT_S24_LE | \ | 643 | SNDRV_PCM_FMTBIT_S24_LE | \ |
645 | SNDRV_PCM_FMTBIT_S32_LE) | 644 | SNDRV_PCM_FMTBIT_S32_LE) |
646 | 645 | ||
647 | static struct snd_soc_dai_ops wm8940_dai_ops = { | 646 | static const struct snd_soc_dai_ops wm8940_dai_ops = { |
648 | .hw_params = wm8940_i2s_hw_params, | 647 | .hw_params = wm8940_i2s_hw_params, |
649 | .set_sysclk = wm8940_set_dai_sysclk, | 648 | .set_sysclk = wm8940_set_dai_sysclk, |
650 | .digital_mute = wm8940_mute, | 649 | .digital_mute = wm8940_mute, |
@@ -673,7 +672,7 @@ static struct snd_soc_dai_driver wm8940_dai = { | |||
673 | .symmetric_rates = 1, | 672 | .symmetric_rates = 1, |
674 | }; | 673 | }; |
675 | 674 | ||
676 | static int wm8940_suspend(struct snd_soc_codec *codec, pm_message_t state) | 675 | static int wm8940_suspend(struct snd_soc_codec *codec) |
677 | { | 676 | { |
678 | return wm8940_set_bias_level(codec, SND_SOC_BIAS_OFF); | 677 | return wm8940_set_bias_level(codec, SND_SOC_BIAS_OFF); |
679 | } | 678 | } |
@@ -780,7 +779,7 @@ MODULE_DEVICE_TABLE(i2c, wm8940_i2c_id); | |||
780 | 779 | ||
781 | static struct i2c_driver wm8940_i2c_driver = { | 780 | static struct i2c_driver wm8940_i2c_driver = { |
782 | .driver = { | 781 | .driver = { |
783 | .name = "wm8940-codec", | 782 | .name = "wm8940", |
784 | .owner = THIS_MODULE, | 783 | .owner = THIS_MODULE, |
785 | }, | 784 | }, |
786 | .probe = wm8940_i2c_probe, | 785 | .probe = wm8940_i2c_probe, |
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 3c7198779c3..924548182d5 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
@@ -859,7 +858,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec, | |||
859 | #define WM8955_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 858 | #define WM8955_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
860 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 859 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
861 | 860 | ||
862 | static struct snd_soc_dai_ops wm8955_dai_ops = { | 861 | static const struct snd_soc_dai_ops wm8955_dai_ops = { |
863 | .set_sysclk = wm8955_set_sysclk, | 862 | .set_sysclk = wm8955_set_sysclk, |
864 | .set_fmt = wm8955_set_fmt, | 863 | .set_fmt = wm8955_set_fmt, |
865 | .hw_params = wm8955_hw_params, | 864 | .hw_params = wm8955_hw_params, |
@@ -879,7 +878,7 @@ static struct snd_soc_dai_driver wm8955_dai = { | |||
879 | }; | 878 | }; |
880 | 879 | ||
881 | #ifdef CONFIG_PM | 880 | #ifdef CONFIG_PM |
882 | static int wm8955_suspend(struct snd_soc_codec *codec, pm_message_t state) | 881 | static int wm8955_suspend(struct snd_soc_codec *codec) |
883 | { | 882 | { |
884 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); | 883 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); |
885 | 884 | ||
@@ -1038,7 +1037,7 @@ MODULE_DEVICE_TABLE(i2c, wm8955_i2c_id); | |||
1038 | 1037 | ||
1039 | static struct i2c_driver wm8955_i2c_driver = { | 1038 | static struct i2c_driver wm8955_i2c_driver = { |
1040 | .driver = { | 1039 | .driver = { |
1041 | .name = "wm8955-codec", | 1040 | .name = "wm8955", |
1042 | .owner = THIS_MODULE, | 1041 | .owner = THIS_MODULE, |
1043 | }, | 1042 | }, |
1044 | .probe = wm8955_i2c_probe, | 1043 | .probe = wm8955_i2c_probe, |
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c index 0293763debe..8d4ea43d40a 100644 --- a/sound/soc/codecs/wm8958-dsp2.c +++ b/sound/soc/codecs/wm8958-dsp2.c | |||
@@ -55,11 +55,14 @@ static int wm8958_dsp2_fw(struct snd_soc_codec *codec, const char *name, | |||
55 | return 0; | 55 | return 0; |
56 | 56 | ||
57 | if (fw->size < 32) { | 57 | if (fw->size < 32) { |
58 | dev_err(codec->dev, "%s: firmware too short\n", name); | 58 | dev_err(codec->dev, "%s: firmware too short (%d bytes)\n", |
59 | name, fw->size); | ||
59 | goto err; | 60 | goto err; |
60 | } | 61 | } |
61 | 62 | ||
62 | if (memcmp(fw->data, "WMFW", 4) != 0) { | 63 | if (memcmp(fw->data, "WMFW", 4) != 0) { |
64 | memcpy(&data32, fw->data, sizeof(data32)); | ||
65 | data32 = be32_to_cpu(data32); | ||
63 | dev_err(codec->dev, "%s: firmware has bad file magic %08x\n", | 66 | dev_err(codec->dev, "%s: firmware has bad file magic %08x\n", |
64 | name, data32); | 67 | name, data32); |
65 | goto err; | 68 | goto err; |
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 2df253c1856..e5caae32e54 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/pm.h> | 15 | #include <linux/pm.h> |
16 | #include <linux/i2c.h> | 16 | #include <linux/i2c.h> |
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
19 | #include <sound/core.h> | 18 | #include <sound/core.h> |
20 | #include <sound/pcm.h> | 19 | #include <sound/pcm.h> |
@@ -26,8 +25,6 @@ | |||
26 | 25 | ||
27 | #include "wm8960.h" | 26 | #include "wm8960.h" |
28 | 27 | ||
29 | #define AUDIO_NAME "wm8960" | ||
30 | |||
31 | /* R25 - Power 1 */ | 28 | /* R25 - Power 1 */ |
32 | #define WM8960_VMID_MASK 0x180 | 29 | #define WM8960_VMID_MASK 0x180 |
33 | #define WM8960_VREF 0x40 | 30 | #define WM8960_VREF 0x40 |
@@ -265,7 +262,7 @@ SND_SOC_DAPM_INPUT("RINPUT2"), | |||
265 | SND_SOC_DAPM_INPUT("LINPUT3"), | 262 | SND_SOC_DAPM_INPUT("LINPUT3"), |
266 | SND_SOC_DAPM_INPUT("RINPUT3"), | 263 | SND_SOC_DAPM_INPUT("RINPUT3"), |
267 | 264 | ||
268 | SND_SOC_DAPM_MICBIAS("MICB", WM8960_POWER1, 1, 0), | 265 | SND_SOC_DAPM_SUPPLY("MICB", WM8960_POWER1, 1, 0, NULL, 0), |
269 | 266 | ||
270 | SND_SOC_DAPM_MIXER("Left Boost Mixer", WM8960_POWER1, 5, 0, | 267 | SND_SOC_DAPM_MIXER("Left Boost Mixer", WM8960_POWER1, 5, 0, |
271 | wm8960_lin_boost, ARRAY_SIZE(wm8960_lin_boost)), | 268 | wm8960_lin_boost, ARRAY_SIZE(wm8960_lin_boost)), |
@@ -546,30 +543,24 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, | |||
546 | static int wm8960_mute(struct snd_soc_dai *dai, int mute) | 543 | static int wm8960_mute(struct snd_soc_dai *dai, int mute) |
547 | { | 544 | { |
548 | struct snd_soc_codec *codec = dai->codec; | 545 | struct snd_soc_codec *codec = dai->codec; |
549 | u16 mute_reg = snd_soc_read(codec, WM8960_DACCTL1) & 0xfff7; | ||
550 | 546 | ||
551 | if (mute) | 547 | if (mute) |
552 | snd_soc_write(codec, WM8960_DACCTL1, mute_reg | 0x8); | 548 | snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0x8); |
553 | else | 549 | else |
554 | snd_soc_write(codec, WM8960_DACCTL1, mute_reg); | 550 | snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0); |
555 | return 0; | 551 | return 0; |
556 | } | 552 | } |
557 | 553 | ||
558 | static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec, | 554 | static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec, |
559 | enum snd_soc_bias_level level) | 555 | enum snd_soc_bias_level level) |
560 | { | 556 | { |
561 | u16 reg; | ||
562 | |||
563 | switch (level) { | 557 | switch (level) { |
564 | case SND_SOC_BIAS_ON: | 558 | case SND_SOC_BIAS_ON: |
565 | break; | 559 | break; |
566 | 560 | ||
567 | case SND_SOC_BIAS_PREPARE: | 561 | case SND_SOC_BIAS_PREPARE: |
568 | /* Set VMID to 2x50k */ | 562 | /* Set VMID to 2x50k */ |
569 | reg = snd_soc_read(codec, WM8960_POWER1); | 563 | snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x80); |
570 | reg &= ~0x180; | ||
571 | reg |= 0x80; | ||
572 | snd_soc_write(codec, WM8960_POWER1, reg); | ||
573 | break; | 564 | break; |
574 | 565 | ||
575 | case SND_SOC_BIAS_STANDBY: | 566 | case SND_SOC_BIAS_STANDBY: |
@@ -582,23 +573,19 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec, | |||
582 | WM8960_BUFDCOPEN | WM8960_BUFIOEN); | 573 | WM8960_BUFDCOPEN | WM8960_BUFIOEN); |
583 | 574 | ||
584 | /* Enable & ramp VMID at 2x50k */ | 575 | /* Enable & ramp VMID at 2x50k */ |
585 | reg = snd_soc_read(codec, WM8960_POWER1); | 576 | snd_soc_update_bits(codec, WM8960_POWER1, 0x80, 0x80); |
586 | reg |= 0x80; | ||
587 | snd_soc_write(codec, WM8960_POWER1, reg); | ||
588 | msleep(100); | 577 | msleep(100); |
589 | 578 | ||
590 | /* Enable VREF */ | 579 | /* Enable VREF */ |
591 | snd_soc_write(codec, WM8960_POWER1, reg | WM8960_VREF); | 580 | snd_soc_update_bits(codec, WM8960_POWER1, WM8960_VREF, |
581 | WM8960_VREF); | ||
592 | 582 | ||
593 | /* Disable anti-pop features */ | 583 | /* Disable anti-pop features */ |
594 | snd_soc_write(codec, WM8960_APOP1, WM8960_BUFIOEN); | 584 | snd_soc_write(codec, WM8960_APOP1, WM8960_BUFIOEN); |
595 | } | 585 | } |
596 | 586 | ||
597 | /* Set VMID to 2x250k */ | 587 | /* Set VMID to 2x250k */ |
598 | reg = snd_soc_read(codec, WM8960_POWER1); | 588 | snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x100); |
599 | reg &= ~0x180; | ||
600 | reg |= 0x100; | ||
601 | snd_soc_write(codec, WM8960_POWER1, reg); | ||
602 | break; | 589 | break; |
603 | 590 | ||
604 | case SND_SOC_BIAS_OFF: | 591 | case SND_SOC_BIAS_OFF: |
@@ -790,10 +777,8 @@ static int wm8960_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
790 | 777 | ||
791 | /* Disable the PLL: even if we are changing the frequency the | 778 | /* Disable the PLL: even if we are changing the frequency the |
792 | * PLL needs to be disabled while we do so. */ | 779 | * PLL needs to be disabled while we do so. */ |
793 | snd_soc_write(codec, WM8960_CLOCK1, | 780 | snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0); |
794 | snd_soc_read(codec, WM8960_CLOCK1) & ~1); | 781 | snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0); |
795 | snd_soc_write(codec, WM8960_POWER2, | ||
796 | snd_soc_read(codec, WM8960_POWER2) & ~1); | ||
797 | 782 | ||
798 | if (!freq_in || !freq_out) | 783 | if (!freq_in || !freq_out) |
799 | return 0; | 784 | return 0; |
@@ -812,11 +797,9 @@ static int wm8960_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
812 | snd_soc_write(codec, WM8960_PLL1, reg); | 797 | snd_soc_write(codec, WM8960_PLL1, reg); |
813 | 798 | ||
814 | /* Turn it on */ | 799 | /* Turn it on */ |
815 | snd_soc_write(codec, WM8960_POWER2, | 800 | snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0x1); |
816 | snd_soc_read(codec, WM8960_POWER2) | 1); | ||
817 | msleep(250); | 801 | msleep(250); |
818 | snd_soc_write(codec, WM8960_CLOCK1, | 802 | snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0x1); |
819 | snd_soc_read(codec, WM8960_CLOCK1) | 1); | ||
820 | 803 | ||
821 | return 0; | 804 | return 0; |
822 | } | 805 | } |
@@ -869,7 +852,7 @@ static int wm8960_set_bias_level(struct snd_soc_codec *codec, | |||
869 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 852 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
870 | SNDRV_PCM_FMTBIT_S24_LE) | 853 | SNDRV_PCM_FMTBIT_S24_LE) |
871 | 854 | ||
872 | static struct snd_soc_dai_ops wm8960_dai_ops = { | 855 | static const struct snd_soc_dai_ops wm8960_dai_ops = { |
873 | .hw_params = wm8960_hw_params, | 856 | .hw_params = wm8960_hw_params, |
874 | .digital_mute = wm8960_mute, | 857 | .digital_mute = wm8960_mute, |
875 | .set_fmt = wm8960_set_dai_fmt, | 858 | .set_fmt = wm8960_set_dai_fmt, |
@@ -895,7 +878,7 @@ static struct snd_soc_dai_driver wm8960_dai = { | |||
895 | .symmetric_rates = 1, | 878 | .symmetric_rates = 1, |
896 | }; | 879 | }; |
897 | 880 | ||
898 | static int wm8960_suspend(struct snd_soc_codec *codec, pm_message_t state) | 881 | static int wm8960_suspend(struct snd_soc_codec *codec) |
899 | { | 882 | { |
900 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); | 883 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); |
901 | 884 | ||
@@ -916,7 +899,6 @@ static int wm8960_probe(struct snd_soc_codec *codec) | |||
916 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); | 899 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); |
917 | struct wm8960_data *pdata = dev_get_platdata(codec->dev); | 900 | struct wm8960_data *pdata = dev_get_platdata(codec->dev); |
918 | int ret; | 901 | int ret; |
919 | u16 reg; | ||
920 | 902 | ||
921 | wm8960->set_bias_level = wm8960_set_bias_level_out3; | 903 | wm8960->set_bias_level = wm8960_set_bias_level_out3; |
922 | 904 | ||
@@ -947,26 +929,16 @@ static int wm8960_probe(struct snd_soc_codec *codec) | |||
947 | wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 929 | wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
948 | 930 | ||
949 | /* Latch the update bits */ | 931 | /* Latch the update bits */ |
950 | reg = snd_soc_read(codec, WM8960_LINVOL); | 932 | snd_soc_update_bits(codec, WM8960_LINVOL, 0x100, 0x100); |
951 | snd_soc_write(codec, WM8960_LINVOL, reg | 0x100); | 933 | snd_soc_update_bits(codec, WM8960_RINVOL, 0x100, 0x100); |
952 | reg = snd_soc_read(codec, WM8960_RINVOL); | 934 | snd_soc_update_bits(codec, WM8960_LADC, 0x100, 0x100); |
953 | snd_soc_write(codec, WM8960_RINVOL, reg | 0x100); | 935 | snd_soc_update_bits(codec, WM8960_RADC, 0x100, 0x100); |
954 | reg = snd_soc_read(codec, WM8960_LADC); | 936 | snd_soc_update_bits(codec, WM8960_LDAC, 0x100, 0x100); |
955 | snd_soc_write(codec, WM8960_LADC, reg | 0x100); | 937 | snd_soc_update_bits(codec, WM8960_RDAC, 0x100, 0x100); |
956 | reg = snd_soc_read(codec, WM8960_RADC); | 938 | snd_soc_update_bits(codec, WM8960_LOUT1, 0x100, 0x100); |
957 | snd_soc_write(codec, WM8960_RADC, reg | 0x100); | 939 | snd_soc_update_bits(codec, WM8960_ROUT1, 0x100, 0x100); |
958 | reg = snd_soc_read(codec, WM8960_LDAC); | 940 | snd_soc_update_bits(codec, WM8960_LOUT2, 0x100, 0x100); |
959 | snd_soc_write(codec, WM8960_LDAC, reg | 0x100); | 941 | snd_soc_update_bits(codec, WM8960_ROUT2, 0x100, 0x100); |
960 | reg = snd_soc_read(codec, WM8960_RDAC); | ||
961 | snd_soc_write(codec, WM8960_RDAC, reg | 0x100); | ||
962 | reg = snd_soc_read(codec, WM8960_LOUT1); | ||
963 | snd_soc_write(codec, WM8960_LOUT1, reg | 0x100); | ||
964 | reg = snd_soc_read(codec, WM8960_ROUT1); | ||
965 | snd_soc_write(codec, WM8960_ROUT1, reg | 0x100); | ||
966 | reg = snd_soc_read(codec, WM8960_LOUT2); | ||
967 | snd_soc_write(codec, WM8960_LOUT2, reg | 0x100); | ||
968 | reg = snd_soc_read(codec, WM8960_ROUT2); | ||
969 | snd_soc_write(codec, WM8960_ROUT2, reg | 0x100); | ||
970 | 942 | ||
971 | snd_soc_add_controls(codec, wm8960_snd_controls, | 943 | snd_soc_add_controls(codec, wm8960_snd_controls, |
972 | ARRAY_SIZE(wm8960_snd_controls)); | 944 | ARRAY_SIZE(wm8960_snd_controls)); |
@@ -995,14 +967,14 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8960 = { | |||
995 | .reg_cache_default = wm8960_reg, | 967 | .reg_cache_default = wm8960_reg, |
996 | }; | 968 | }; |
997 | 969 | ||
998 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
999 | static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, | 970 | static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, |
1000 | const struct i2c_device_id *id) | 971 | const struct i2c_device_id *id) |
1001 | { | 972 | { |
1002 | struct wm8960_priv *wm8960; | 973 | struct wm8960_priv *wm8960; |
1003 | int ret; | 974 | int ret; |
1004 | 975 | ||
1005 | wm8960 = kzalloc(sizeof(struct wm8960_priv), GFP_KERNEL); | 976 | wm8960 = devm_kzalloc(&i2c->dev, sizeof(struct wm8960_priv), |
977 | GFP_KERNEL); | ||
1006 | if (wm8960 == NULL) | 978 | if (wm8960 == NULL) |
1007 | return -ENOMEM; | 979 | return -ENOMEM; |
1008 | 980 | ||
@@ -1011,15 +983,13 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, | |||
1011 | 983 | ||
1012 | ret = snd_soc_register_codec(&i2c->dev, | 984 | ret = snd_soc_register_codec(&i2c->dev, |
1013 | &soc_codec_dev_wm8960, &wm8960_dai, 1); | 985 | &soc_codec_dev_wm8960, &wm8960_dai, 1); |
1014 | if (ret < 0) | 986 | |
1015 | kfree(wm8960); | ||
1016 | return ret; | 987 | return ret; |
1017 | } | 988 | } |
1018 | 989 | ||
1019 | static __devexit int wm8960_i2c_remove(struct i2c_client *client) | 990 | static __devexit int wm8960_i2c_remove(struct i2c_client *client) |
1020 | { | 991 | { |
1021 | snd_soc_unregister_codec(&client->dev); | 992 | snd_soc_unregister_codec(&client->dev); |
1022 | kfree(i2c_get_clientdata(client)); | ||
1023 | return 0; | 993 | return 0; |
1024 | } | 994 | } |
1025 | 995 | ||
@@ -1031,34 +1001,29 @@ MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id); | |||
1031 | 1001 | ||
1032 | static struct i2c_driver wm8960_i2c_driver = { | 1002 | static struct i2c_driver wm8960_i2c_driver = { |
1033 | .driver = { | 1003 | .driver = { |
1034 | .name = "wm8960-codec", | 1004 | .name = "wm8960", |
1035 | .owner = THIS_MODULE, | 1005 | .owner = THIS_MODULE, |
1036 | }, | 1006 | }, |
1037 | .probe = wm8960_i2c_probe, | 1007 | .probe = wm8960_i2c_probe, |
1038 | .remove = __devexit_p(wm8960_i2c_remove), | 1008 | .remove = __devexit_p(wm8960_i2c_remove), |
1039 | .id_table = wm8960_i2c_id, | 1009 | .id_table = wm8960_i2c_id, |
1040 | }; | 1010 | }; |
1041 | #endif | ||
1042 | 1011 | ||
1043 | static int __init wm8960_modinit(void) | 1012 | static int __init wm8960_modinit(void) |
1044 | { | 1013 | { |
1045 | int ret = 0; | 1014 | int ret = 0; |
1046 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1047 | ret = i2c_add_driver(&wm8960_i2c_driver); | 1015 | ret = i2c_add_driver(&wm8960_i2c_driver); |
1048 | if (ret != 0) { | 1016 | if (ret != 0) { |
1049 | printk(KERN_ERR "Failed to register WM8960 I2C driver: %d\n", | 1017 | printk(KERN_ERR "Failed to register WM8960 I2C driver: %d\n", |
1050 | ret); | 1018 | ret); |
1051 | } | 1019 | } |
1052 | #endif | ||
1053 | return ret; | 1020 | return ret; |
1054 | } | 1021 | } |
1055 | module_init(wm8960_modinit); | 1022 | module_init(wm8960_modinit); |
1056 | 1023 | ||
1057 | static void __exit wm8960_exit(void) | 1024 | static void __exit wm8960_exit(void) |
1058 | { | 1025 | { |
1059 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1060 | i2c_del_driver(&wm8960_i2c_driver); | 1026 | i2c_del_driver(&wm8960_i2c_driver); |
1061 | #endif | ||
1062 | } | 1027 | } |
1063 | module_exit(wm8960_exit); | 1028 | module_exit(wm8960_exit); |
1064 | 1029 | ||
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 9568c8a49f9..4f20c72a0f1 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -423,11 +422,11 @@ static int wm8961_spk_event(struct snd_soc_dapm_widget *w, | |||
423 | } | 422 | } |
424 | 423 | ||
425 | if (event & SND_SOC_DAPM_PRE_PMD) { | 424 | if (event & SND_SOC_DAPM_PRE_PMD) { |
426 | /* Enable the amplifier */ | 425 | /* Disable the amplifier */ |
427 | spk_reg &= ~(WM8961_SPKL_ENA | WM8961_SPKR_ENA); | 426 | spk_reg &= ~(WM8961_SPKL_ENA | WM8961_SPKR_ENA); |
428 | snd_soc_write(codec, WM8961_CLASS_D_CONTROL_1, spk_reg); | 427 | snd_soc_write(codec, WM8961_CLASS_D_CONTROL_1, spk_reg); |
429 | 428 | ||
430 | /* Enable the PGA */ | 429 | /* Disable the PGA */ |
431 | pwr_reg &= ~(WM8961_SPKL_PGA | WM8961_SPKR_PGA); | 430 | pwr_reg &= ~(WM8961_SPKL_PGA | WM8961_SPKR_PGA); |
432 | snd_soc_write(codec, WM8961_PWR_MGMT_2, pwr_reg); | 431 | snd_soc_write(codec, WM8961_PWR_MGMT_2, pwr_reg); |
433 | } | 432 | } |
@@ -531,7 +530,7 @@ SND_SOC_DAPM_PGA("Right Input", WM8961_PWR_MGMT_1, 4, 0, NULL, 0), | |||
531 | SND_SOC_DAPM_ADC("ADCL", "HiFi Capture", WM8961_PWR_MGMT_1, 3, 0), | 530 | SND_SOC_DAPM_ADC("ADCL", "HiFi Capture", WM8961_PWR_MGMT_1, 3, 0), |
532 | SND_SOC_DAPM_ADC("ADCR", "HiFi Capture", WM8961_PWR_MGMT_1, 2, 0), | 531 | SND_SOC_DAPM_ADC("ADCR", "HiFi Capture", WM8961_PWR_MGMT_1, 2, 0), |
533 | 532 | ||
534 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8961_PWR_MGMT_1, 1, 0), | 533 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8961_PWR_MGMT_1, 1, 0, NULL, 0), |
535 | 534 | ||
536 | SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &dacl_mux), | 535 | SND_SOC_DAPM_MUX("DACL Sidetone", SND_SOC_NOPM, 0, 0, &dacl_mux), |
537 | SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &dacr_mux), | 536 | SND_SOC_DAPM_MUX("DACR Sidetone", SND_SOC_NOPM, 0, 0, &dacr_mux), |
@@ -929,7 +928,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec, | |||
929 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 928 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
930 | SNDRV_PCM_FMTBIT_S24_LE) | 929 | SNDRV_PCM_FMTBIT_S24_LE) |
931 | 930 | ||
932 | static struct snd_soc_dai_ops wm8961_dai_ops = { | 931 | static const struct snd_soc_dai_ops wm8961_dai_ops = { |
933 | .hw_params = wm8961_hw_params, | 932 | .hw_params = wm8961_hw_params, |
934 | .set_sysclk = wm8961_set_sysclk, | 933 | .set_sysclk = wm8961_set_sysclk, |
935 | .set_fmt = wm8961_set_fmt, | 934 | .set_fmt = wm8961_set_fmt, |
@@ -1039,7 +1038,7 @@ static int wm8961_remove(struct snd_soc_codec *codec) | |||
1039 | } | 1038 | } |
1040 | 1039 | ||
1041 | #ifdef CONFIG_PM | 1040 | #ifdef CONFIG_PM |
1042 | static int wm8961_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1041 | static int wm8961_suspend(struct snd_soc_codec *codec) |
1043 | { | 1042 | { |
1044 | wm8961_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1043 | wm8961_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1045 | 1044 | ||
@@ -1048,18 +1047,7 @@ static int wm8961_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
1048 | 1047 | ||
1049 | static int wm8961_resume(struct snd_soc_codec *codec) | 1048 | static int wm8961_resume(struct snd_soc_codec *codec) |
1050 | { | 1049 | { |
1051 | u16 *reg_cache = codec->reg_cache; | 1050 | snd_soc_cache_sync(codec); |
1052 | int i; | ||
1053 | |||
1054 | for (i = 0; i < codec->driver->reg_cache_size; i++) { | ||
1055 | if (reg_cache[i] == wm8961_reg_defaults[i]) | ||
1056 | continue; | ||
1057 | |||
1058 | if (i == WM8961_SOFTWARE_RESET) | ||
1059 | continue; | ||
1060 | |||
1061 | snd_soc_write(codec, i, reg_cache[i]); | ||
1062 | } | ||
1063 | 1051 | ||
1064 | wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1052 | wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1065 | 1053 | ||
@@ -1082,14 +1070,14 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8961 = { | |||
1082 | .volatile_register = wm8961_volatile_register, | 1070 | .volatile_register = wm8961_volatile_register, |
1083 | }; | 1071 | }; |
1084 | 1072 | ||
1085 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1086 | static __devinit int wm8961_i2c_probe(struct i2c_client *i2c, | 1073 | static __devinit int wm8961_i2c_probe(struct i2c_client *i2c, |
1087 | const struct i2c_device_id *id) | 1074 | const struct i2c_device_id *id) |
1088 | { | 1075 | { |
1089 | struct wm8961_priv *wm8961; | 1076 | struct wm8961_priv *wm8961; |
1090 | int ret; | 1077 | int ret; |
1091 | 1078 | ||
1092 | wm8961 = kzalloc(sizeof(struct wm8961_priv), GFP_KERNEL); | 1079 | wm8961 = devm_kzalloc(&i2c->dev, sizeof(struct wm8961_priv), |
1080 | GFP_KERNEL); | ||
1093 | if (wm8961 == NULL) | 1081 | if (wm8961 == NULL) |
1094 | return -ENOMEM; | 1082 | return -ENOMEM; |
1095 | 1083 | ||
@@ -1097,15 +1085,14 @@ static __devinit int wm8961_i2c_probe(struct i2c_client *i2c, | |||
1097 | 1085 | ||
1098 | ret = snd_soc_register_codec(&i2c->dev, | 1086 | ret = snd_soc_register_codec(&i2c->dev, |
1099 | &soc_codec_dev_wm8961, &wm8961_dai, 1); | 1087 | &soc_codec_dev_wm8961, &wm8961_dai, 1); |
1100 | if (ret < 0) | 1088 | |
1101 | kfree(wm8961); | ||
1102 | return ret; | 1089 | return ret; |
1103 | } | 1090 | } |
1104 | 1091 | ||
1105 | static __devexit int wm8961_i2c_remove(struct i2c_client *client) | 1092 | static __devexit int wm8961_i2c_remove(struct i2c_client *client) |
1106 | { | 1093 | { |
1107 | snd_soc_unregister_codec(&client->dev); | 1094 | snd_soc_unregister_codec(&client->dev); |
1108 | kfree(i2c_get_clientdata(client)); | 1095 | |
1109 | return 0; | 1096 | return 0; |
1110 | } | 1097 | } |
1111 | 1098 | ||
@@ -1117,34 +1104,29 @@ MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id); | |||
1117 | 1104 | ||
1118 | static struct i2c_driver wm8961_i2c_driver = { | 1105 | static struct i2c_driver wm8961_i2c_driver = { |
1119 | .driver = { | 1106 | .driver = { |
1120 | .name = "wm8961-codec", | 1107 | .name = "wm8961", |
1121 | .owner = THIS_MODULE, | 1108 | .owner = THIS_MODULE, |
1122 | }, | 1109 | }, |
1123 | .probe = wm8961_i2c_probe, | 1110 | .probe = wm8961_i2c_probe, |
1124 | .remove = __devexit_p(wm8961_i2c_remove), | 1111 | .remove = __devexit_p(wm8961_i2c_remove), |
1125 | .id_table = wm8961_i2c_id, | 1112 | .id_table = wm8961_i2c_id, |
1126 | }; | 1113 | }; |
1127 | #endif | ||
1128 | 1114 | ||
1129 | static int __init wm8961_modinit(void) | 1115 | static int __init wm8961_modinit(void) |
1130 | { | 1116 | { |
1131 | int ret = 0; | 1117 | int ret = 0; |
1132 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1133 | ret = i2c_add_driver(&wm8961_i2c_driver); | 1118 | ret = i2c_add_driver(&wm8961_i2c_driver); |
1134 | if (ret != 0) { | 1119 | if (ret != 0) { |
1135 | printk(KERN_ERR "Failed to register wm8961 I2C driver: %d\n", | 1120 | printk(KERN_ERR "Failed to register wm8961 I2C driver: %d\n", |
1136 | ret); | 1121 | ret); |
1137 | } | 1122 | } |
1138 | #endif | ||
1139 | return ret; | 1123 | return ret; |
1140 | } | 1124 | } |
1141 | module_init(wm8961_modinit); | 1125 | module_init(wm8961_modinit); |
1142 | 1126 | ||
1143 | static void __exit wm8961_exit(void) | 1127 | static void __exit wm8961_exit(void) |
1144 | { | 1128 | { |
1145 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
1146 | i2c_del_driver(&wm8961_i2c_driver); | 1129 | i2c_del_driver(&wm8961_i2c_driver); |
1147 | #endif | ||
1148 | } | 1130 | } |
1149 | module_exit(wm8961_exit); | 1131 | module_exit(wm8961_exit); |
1150 | 1132 | ||
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 53edd9a8c75..296de4e30d2 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/platform_device.h> | 23 | #include <linux/regmap.h> |
24 | #include <linux/regulator/consumer.h> | 24 | #include <linux/regulator/consumer.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
@@ -50,6 +50,7 @@ static const char *wm8962_supply_names[WM8962_NUM_SUPPLIES] = { | |||
50 | 50 | ||
51 | /* codec private data */ | 51 | /* codec private data */ |
52 | struct wm8962_priv { | 52 | struct wm8962_priv { |
53 | struct regmap *regmap; | ||
53 | struct snd_soc_codec *codec; | 54 | struct snd_soc_codec *codec; |
54 | 55 | ||
55 | int sysclk; | 56 | int sysclk; |
@@ -95,7 +96,7 @@ static int wm8962_regulator_event_##n(struct notifier_block *nb, \ | |||
95 | struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \ | 96 | struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \ |
96 | disable_nb[n]); \ | 97 | disable_nb[n]); \ |
97 | if (event & REGULATOR_EVENT_DISABLE) { \ | 98 | if (event & REGULATOR_EVENT_DISABLE) { \ |
98 | wm8962->codec->cache_sync = 1; \ | 99 | regcache_cache_only(wm8962->regmap, true); \ |
99 | } \ | 100 | } \ |
100 | return 0; \ | 101 | return 0; \ |
101 | } | 102 | } |
@@ -109,691 +110,691 @@ WM8962_REGULATOR_EVENT(5) | |||
109 | WM8962_REGULATOR_EVENT(6) | 110 | WM8962_REGULATOR_EVENT(6) |
110 | WM8962_REGULATOR_EVENT(7) | 111 | WM8962_REGULATOR_EVENT(7) |
111 | 112 | ||
112 | static const u16 wm8962_reg[WM8962_MAX_REGISTER + 1] = { | 113 | static struct reg_default wm8962_reg[] = { |
113 | [0] = 0x009F, /* R0 - Left Input volume */ | 114 | { 0, 0x009F }, /* R0 - Left Input volume */ |
114 | [1] = 0x049F, /* R1 - Right Input volume */ | 115 | { 1, 0x049F }, /* R1 - Right Input volume */ |
115 | [2] = 0x0000, /* R2 - HPOUTL volume */ | 116 | { 2, 0x0000 }, /* R2 - HPOUTL volume */ |
116 | [3] = 0x0000, /* R3 - HPOUTR volume */ | 117 | { 3, 0x0000 }, /* R3 - HPOUTR volume */ |
117 | [4] = 0x0020, /* R4 - Clocking1 */ | 118 | { 4, 0x0020 }, /* R4 - Clocking1 */ |
118 | [5] = 0x0018, /* R5 - ADC & DAC Control 1 */ | 119 | { 5, 0x0018 }, /* R5 - ADC & DAC Control 1 */ |
119 | [6] = 0x2008, /* R6 - ADC & DAC Control 2 */ | 120 | { 6, 0x2008 }, /* R6 - ADC & DAC Control 2 */ |
120 | [7] = 0x000A, /* R7 - Audio Interface 0 */ | 121 | { 7, 0x000A }, /* R7 - Audio Interface 0 */ |
121 | [8] = 0x01E4, /* R8 - Clocking2 */ | 122 | { 8, 0x01E4 }, /* R8 - Clocking2 */ |
122 | [9] = 0x0300, /* R9 - Audio Interface 1 */ | 123 | { 9, 0x0300 }, /* R9 - Audio Interface 1 */ |
123 | [10] = 0x00C0, /* R10 - Left DAC volume */ | 124 | { 10, 0x00C0 }, /* R10 - Left DAC volume */ |
124 | [11] = 0x00C0, /* R11 - Right DAC volume */ | 125 | { 11, 0x00C0 }, /* R11 - Right DAC volume */ |
125 | 126 | ||
126 | [14] = 0x0040, /* R14 - Audio Interface 2 */ | 127 | { 14, 0x0040 }, /* R14 - Audio Interface 2 */ |
127 | [15] = 0x6243, /* R15 - Software Reset */ | 128 | { 15, 0x6243 }, /* R15 - Software Reset */ |
128 | 129 | ||
129 | [17] = 0x007B, /* R17 - ALC1 */ | 130 | { 17, 0x007B }, /* R17 - ALC1 */ |
130 | [18] = 0x0000, /* R18 - ALC2 */ | 131 | { 18, 0x0000 }, /* R18 - ALC2 */ |
131 | [19] = 0x1C32, /* R19 - ALC3 */ | 132 | { 19, 0x1C32 }, /* R19 - ALC3 */ |
132 | [20] = 0x3200, /* R20 - Noise Gate */ | 133 | { 20, 0x3200 }, /* R20 - Noise Gate */ |
133 | [21] = 0x00C0, /* R21 - Left ADC volume */ | 134 | { 21, 0x00C0 }, /* R21 - Left ADC volume */ |
134 | [22] = 0x00C0, /* R22 - Right ADC volume */ | 135 | { 22, 0x00C0 }, /* R22 - Right ADC volume */ |
135 | [23] = 0x0160, /* R23 - Additional control(1) */ | 136 | { 23, 0x0160 }, /* R23 - Additional control(1) */ |
136 | [24] = 0x0000, /* R24 - Additional control(2) */ | 137 | { 24, 0x0000 }, /* R24 - Additional control(2) */ |
137 | [25] = 0x0000, /* R25 - Pwr Mgmt (1) */ | 138 | { 25, 0x0000 }, /* R25 - Pwr Mgmt (1) */ |
138 | [26] = 0x0000, /* R26 - Pwr Mgmt (2) */ | 139 | { 26, 0x0000 }, /* R26 - Pwr Mgmt (2) */ |
139 | [27] = 0x0010, /* R27 - Additional Control (3) */ | 140 | { 27, 0x0010 }, /* R27 - Additional Control (3) */ |
140 | [28] = 0x0000, /* R28 - Anti-pop */ | 141 | { 28, 0x0000 }, /* R28 - Anti-pop */ |
141 | 142 | ||
142 | [30] = 0x005E, /* R30 - Clocking 3 */ | 143 | { 30, 0x005E }, /* R30 - Clocking 3 */ |
143 | [31] = 0x0000, /* R31 - Input mixer control (1) */ | 144 | { 31, 0x0000 }, /* R31 - Input mixer control (1) */ |
144 | [32] = 0x0145, /* R32 - Left input mixer volume */ | 145 | { 32, 0x0145 }, /* R32 - Left input mixer volume */ |
145 | [33] = 0x0145, /* R33 - Right input mixer volume */ | 146 | { 33, 0x0145 }, /* R33 - Right input mixer volume */ |
146 | [34] = 0x0009, /* R34 - Input mixer control (2) */ | 147 | { 34, 0x0009 }, /* R34 - Input mixer control (2) */ |
147 | [35] = 0x0003, /* R35 - Input bias control */ | 148 | { 35, 0x0003 }, /* R35 - Input bias control */ |
148 | [37] = 0x0008, /* R37 - Left input PGA control */ | 149 | { 37, 0x0008 }, /* R37 - Left input PGA control */ |
149 | [38] = 0x0008, /* R38 - Right input PGA control */ | 150 | { 38, 0x0008 }, /* R38 - Right input PGA control */ |
150 | 151 | ||
151 | [40] = 0x0000, /* R40 - SPKOUTL volume */ | 152 | { 40, 0x0000 }, /* R40 - SPKOUTL volume */ |
152 | [41] = 0x0000, /* R41 - SPKOUTR volume */ | 153 | { 41, 0x0000 }, /* R41 - SPKOUTR volume */ |
153 | 154 | ||
154 | [47] = 0x0000, /* R47 - Thermal Shutdown Status */ | 155 | { 47, 0x0000 }, /* R47 - Thermal Shutdown Status */ |
155 | [48] = 0x8027, /* R48 - Additional Control (4) */ | 156 | { 48, 0x8027 }, /* R48 - Additional Control (4) */ |
156 | [49] = 0x0010, /* R49 - Class D Control 1 */ | 157 | { 49, 0x0010 }, /* R49 - Class D Control 1 */ |
157 | 158 | ||
158 | [51] = 0x0003, /* R51 - Class D Control 2 */ | 159 | { 51, 0x0003 }, /* R51 - Class D Control 2 */ |
159 | 160 | ||
160 | [56] = 0x0506, /* R56 - Clocking 4 */ | 161 | { 56, 0x0506 }, /* R56 - Clocking 4 */ |
161 | [57] = 0x0000, /* R57 - DAC DSP Mixing (1) */ | 162 | { 57, 0x0000 }, /* R57 - DAC DSP Mixing (1) */ |
162 | [58] = 0x0000, /* R58 - DAC DSP Mixing (2) */ | 163 | { 58, 0x0000 }, /* R58 - DAC DSP Mixing (2) */ |
163 | 164 | ||
164 | [60] = 0x0300, /* R60 - DC Servo 0 */ | 165 | { 60, 0x0300 }, /* R60 - DC Servo 0 */ |
165 | [61] = 0x0300, /* R61 - DC Servo 1 */ | 166 | { 61, 0x0300 }, /* R61 - DC Servo 1 */ |
166 | 167 | ||
167 | [64] = 0x0810, /* R64 - DC Servo 4 */ | 168 | { 64, 0x0810 }, /* R64 - DC Servo 4 */ |
168 | 169 | ||
169 | [66] = 0x0000, /* R66 - DC Servo 6 */ | 170 | { 66, 0x0000 }, /* R66 - DC Servo 6 */ |
170 | 171 | ||
171 | [68] = 0x001B, /* R68 - Analogue PGA Bias */ | 172 | { 68, 0x001B }, /* R68 - Analogue PGA Bias */ |
172 | [69] = 0x0000, /* R69 - Analogue HP 0 */ | 173 | { 69, 0x0000 }, /* R69 - Analogue HP 0 */ |
173 | 174 | ||
174 | [71] = 0x01FB, /* R71 - Analogue HP 2 */ | 175 | { 71, 0x01FB }, /* R71 - Analogue HP 2 */ |
175 | [72] = 0x0000, /* R72 - Charge Pump 1 */ | 176 | { 72, 0x0000 }, /* R72 - Charge Pump 1 */ |
176 | 177 | ||
177 | [82] = 0x0004, /* R82 - Charge Pump B */ | 178 | { 82, 0x0004 }, /* R82 - Charge Pump B */ |
178 | 179 | ||
179 | [87] = 0x0000, /* R87 - Write Sequencer Control 1 */ | 180 | { 87, 0x0000 }, /* R87 - Write Sequencer Control 1 */ |
180 | 181 | ||
181 | [90] = 0x0000, /* R90 - Write Sequencer Control 2 */ | 182 | { 90, 0x0000 }, /* R90 - Write Sequencer Control 2 */ |
182 | 183 | ||
183 | [93] = 0x0000, /* R93 - Write Sequencer Control 3 */ | 184 | { 93, 0x0000 }, /* R93 - Write Sequencer Control 3 */ |
184 | [94] = 0x0000, /* R94 - Control Interface */ | 185 | { 94, 0x0000 }, /* R94 - Control Interface */ |
185 | 186 | ||
186 | [99] = 0x0000, /* R99 - Mixer Enables */ | 187 | { 99, 0x0000 }, /* R99 - Mixer Enables */ |
187 | [100] = 0x0000, /* R100 - Headphone Mixer (1) */ | 188 | { 100, 0x0000 }, /* R100 - Headphone Mixer (1) */ |
188 | [101] = 0x0000, /* R101 - Headphone Mixer (2) */ | 189 | { 101, 0x0000 }, /* R101 - Headphone Mixer (2) */ |
189 | [102] = 0x013F, /* R102 - Headphone Mixer (3) */ | 190 | { 102, 0x013F }, /* R102 - Headphone Mixer (3) */ |
190 | [103] = 0x013F, /* R103 - Headphone Mixer (4) */ | 191 | { 103, 0x013F }, /* R103 - Headphone Mixer (4) */ |
191 | 192 | ||
192 | [105] = 0x0000, /* R105 - Speaker Mixer (1) */ | 193 | { 105, 0x0000 }, /* R105 - Speaker Mixer (1) */ |
193 | [106] = 0x0000, /* R106 - Speaker Mixer (2) */ | 194 | { 106, 0x0000 }, /* R106 - Speaker Mixer (2) */ |
194 | [107] = 0x013F, /* R107 - Speaker Mixer (3) */ | 195 | { 107, 0x013F }, /* R107 - Speaker Mixer (3) */ |
195 | [108] = 0x013F, /* R108 - Speaker Mixer (4) */ | 196 | { 108, 0x013F }, /* R108 - Speaker Mixer (4) */ |
196 | [109] = 0x0003, /* R109 - Speaker Mixer (5) */ | 197 | { 109, 0x0003 }, /* R109 - Speaker Mixer (5) */ |
197 | [110] = 0x0002, /* R110 - Beep Generator (1) */ | 198 | { 110, 0x0002 }, /* R110 - Beep Generator (1) */ |
198 | 199 | ||
199 | [115] = 0x0006, /* R115 - Oscillator Trim (3) */ | 200 | { 115, 0x0006 }, /* R115 - Oscillator Trim (3) */ |
200 | [116] = 0x0026, /* R116 - Oscillator Trim (4) */ | 201 | { 116, 0x0026 }, /* R116 - Oscillator Trim (4) */ |
201 | 202 | ||
202 | [119] = 0x0000, /* R119 - Oscillator Trim (7) */ | 203 | { 119, 0x0000 }, /* R119 - Oscillator Trim (7) */ |
203 | 204 | ||
204 | [124] = 0x0011, /* R124 - Analogue Clocking1 */ | 205 | { 124, 0x0011 }, /* R124 - Analogue Clocking1 */ |
205 | [125] = 0x004B, /* R125 - Analogue Clocking2 */ | 206 | { 125, 0x004B }, /* R125 - Analogue Clocking2 */ |
206 | [126] = 0x000D, /* R126 - Analogue Clocking3 */ | 207 | { 126, 0x000D }, /* R126 - Analogue Clocking3 */ |
207 | [127] = 0x0000, /* R127 - PLL Software Reset */ | 208 | { 127, 0x0000 }, /* R127 - PLL Software Reset */ |
208 | 209 | ||
209 | [129] = 0x0000, /* R129 - PLL2 */ | 210 | { 129, 0x0000 }, /* R129 - PLL2 */ |
210 | 211 | ||
211 | [131] = 0x0000, /* R131 - PLL 4 */ | 212 | { 131, 0x0000 }, /* R131 - PLL 4 */ |
212 | 213 | ||
213 | [136] = 0x0067, /* R136 - PLL 9 */ | 214 | { 136, 0x0067 }, /* R136 - PLL 9 */ |
214 | [137] = 0x001C, /* R137 - PLL 10 */ | 215 | { 137, 0x001C }, /* R137 - PLL 10 */ |
215 | [138] = 0x0071, /* R138 - PLL 11 */ | 216 | { 138, 0x0071 }, /* R138 - PLL 11 */ |
216 | [139] = 0x00C7, /* R139 - PLL 12 */ | 217 | { 139, 0x00C7 }, /* R139 - PLL 12 */ |
217 | [140] = 0x0067, /* R140 - PLL 13 */ | 218 | { 140, 0x0067 }, /* R140 - PLL 13 */ |
218 | [141] = 0x0048, /* R141 - PLL 14 */ | 219 | { 141, 0x0048 }, /* R141 - PLL 14 */ |
219 | [142] = 0x0022, /* R142 - PLL 15 */ | 220 | { 142, 0x0022 }, /* R142 - PLL 15 */ |
220 | [143] = 0x0097, /* R143 - PLL 16 */ | 221 | { 143, 0x0097 }, /* R143 - PLL 16 */ |
221 | 222 | ||
222 | [155] = 0x000C, /* R155 - FLL Control (1) */ | 223 | { 155, 0x000C }, /* R155 - FLL Control (1) */ |
223 | [156] = 0x0039, /* R156 - FLL Control (2) */ | 224 | { 156, 0x0039 }, /* R156 - FLL Control (2) */ |
224 | [157] = 0x0180, /* R157 - FLL Control (3) */ | 225 | { 157, 0x0180 }, /* R157 - FLL Control (3) */ |
225 | 226 | ||
226 | [159] = 0x0032, /* R159 - FLL Control (5) */ | 227 | { 159, 0x0032 }, /* R159 - FLL Control (5) */ |
227 | [160] = 0x0018, /* R160 - FLL Control (6) */ | 228 | { 160, 0x0018 }, /* R160 - FLL Control (6) */ |
228 | [161] = 0x007D, /* R161 - FLL Control (7) */ | 229 | { 161, 0x007D }, /* R161 - FLL Control (7) */ |
229 | [162] = 0x0008, /* R162 - FLL Control (8) */ | 230 | { 162, 0x0008 }, /* R162 - FLL Control (8) */ |
230 | 231 | ||
231 | [252] = 0x0005, /* R252 - General test 1 */ | 232 | { 252, 0x0005 }, /* R252 - General test 1 */ |
232 | 233 | ||
233 | [256] = 0x0000, /* R256 - DF1 */ | 234 | { 256, 0x0000 }, /* R256 - DF1 */ |
234 | [257] = 0x0000, /* R257 - DF2 */ | 235 | { 257, 0x0000 }, /* R257 - DF2 */ |
235 | [258] = 0x0000, /* R258 - DF3 */ | 236 | { 258, 0x0000 }, /* R258 - DF3 */ |
236 | [259] = 0x0000, /* R259 - DF4 */ | 237 | { 259, 0x0000 }, /* R259 - DF4 */ |
237 | [260] = 0x0000, /* R260 - DF5 */ | 238 | { 260, 0x0000 }, /* R260 - DF5 */ |
238 | [261] = 0x0000, /* R261 - DF6 */ | 239 | { 261, 0x0000 }, /* R261 - DF6 */ |
239 | [262] = 0x0000, /* R262 - DF7 */ | 240 | { 262, 0x0000 }, /* R262 - DF7 */ |
240 | 241 | ||
241 | [264] = 0x0000, /* R264 - LHPF1 */ | 242 | { 264, 0x0000 }, /* R264 - LHPF1 */ |
242 | [265] = 0x0000, /* R265 - LHPF2 */ | 243 | { 265, 0x0000 }, /* R265 - LHPF2 */ |
243 | 244 | ||
244 | [268] = 0x0000, /* R268 - THREED1 */ | 245 | { 268, 0x0000 }, /* R268 - THREED1 */ |
245 | [269] = 0x0000, /* R269 - THREED2 */ | 246 | { 269, 0x0000 }, /* R269 - THREED2 */ |
246 | [270] = 0x0000, /* R270 - THREED3 */ | 247 | { 270, 0x0000 }, /* R270 - THREED3 */ |
247 | [271] = 0x0000, /* R271 - THREED4 */ | 248 | { 271, 0x0000 }, /* R271 - THREED4 */ |
248 | 249 | ||
249 | [276] = 0x000C, /* R276 - DRC 1 */ | 250 | { 276, 0x000C }, /* R276 - DRC 1 */ |
250 | [277] = 0x0925, /* R277 - DRC 2 */ | 251 | { 277, 0x0925 }, /* R277 - DRC 2 */ |
251 | [278] = 0x0000, /* R278 - DRC 3 */ | 252 | { 278, 0x0000 }, /* R278 - DRC 3 */ |
252 | [279] = 0x0000, /* R279 - DRC 4 */ | 253 | { 279, 0x0000 }, /* R279 - DRC 4 */ |
253 | [280] = 0x0000, /* R280 - DRC 5 */ | 254 | { 280, 0x0000 }, /* R280 - DRC 5 */ |
254 | 255 | ||
255 | [285] = 0x0000, /* R285 - Tloopback */ | 256 | { 285, 0x0000 }, /* R285 - Tloopback */ |
256 | 257 | ||
257 | [335] = 0x0004, /* R335 - EQ1 */ | 258 | { 335, 0x0004 }, /* R335 - EQ1 */ |
258 | [336] = 0x6318, /* R336 - EQ2 */ | 259 | { 336, 0x6318 }, /* R336 - EQ2 */ |
259 | [337] = 0x6300, /* R337 - EQ3 */ | 260 | { 337, 0x6300 }, /* R337 - EQ3 */ |
260 | [338] = 0x0FCA, /* R338 - EQ4 */ | 261 | { 338, 0x0FCA }, /* R338 - EQ4 */ |
261 | [339] = 0x0400, /* R339 - EQ5 */ | 262 | { 339, 0x0400 }, /* R339 - EQ5 */ |
262 | [340] = 0x00D8, /* R340 - EQ6 */ | 263 | { 340, 0x00D8 }, /* R340 - EQ6 */ |
263 | [341] = 0x1EB5, /* R341 - EQ7 */ | 264 | { 341, 0x1EB5 }, /* R341 - EQ7 */ |
264 | [342] = 0xF145, /* R342 - EQ8 */ | 265 | { 342, 0xF145 }, /* R342 - EQ8 */ |
265 | [343] = 0x0B75, /* R343 - EQ9 */ | 266 | { 343, 0x0B75 }, /* R343 - EQ9 */ |
266 | [344] = 0x01C5, /* R344 - EQ10 */ | 267 | { 344, 0x01C5 }, /* R344 - EQ10 */ |
267 | [345] = 0x1C58, /* R345 - EQ11 */ | 268 | { 345, 0x1C58 }, /* R345 - EQ11 */ |
268 | [346] = 0xF373, /* R346 - EQ12 */ | 269 | { 346, 0xF373 }, /* R346 - EQ12 */ |
269 | [347] = 0x0A54, /* R347 - EQ13 */ | 270 | { 347, 0x0A54 }, /* R347 - EQ13 */ |
270 | [348] = 0x0558, /* R348 - EQ14 */ | 271 | { 348, 0x0558 }, /* R348 - EQ14 */ |
271 | [349] = 0x168E, /* R349 - EQ15 */ | 272 | { 349, 0x168E }, /* R349 - EQ15 */ |
272 | [350] = 0xF829, /* R350 - EQ16 */ | 273 | { 350, 0xF829 }, /* R350 - EQ16 */ |
273 | [351] = 0x07AD, /* R351 - EQ17 */ | 274 | { 351, 0x07AD }, /* R351 - EQ17 */ |
274 | [352] = 0x1103, /* R352 - EQ18 */ | 275 | { 352, 0x1103 }, /* R352 - EQ18 */ |
275 | [353] = 0x0564, /* R353 - EQ19 */ | 276 | { 353, 0x0564 }, /* R353 - EQ19 */ |
276 | [354] = 0x0559, /* R354 - EQ20 */ | 277 | { 354, 0x0559 }, /* R354 - EQ20 */ |
277 | [355] = 0x4000, /* R355 - EQ21 */ | 278 | { 355, 0x4000 }, /* R355 - EQ21 */ |
278 | [356] = 0x6318, /* R356 - EQ22 */ | 279 | { 356, 0x6318 }, /* R356 - EQ22 */ |
279 | [357] = 0x6300, /* R357 - EQ23 */ | 280 | { 357, 0x6300 }, /* R357 - EQ23 */ |
280 | [358] = 0x0FCA, /* R358 - EQ24 */ | 281 | { 358, 0x0FCA }, /* R358 - EQ24 */ |
281 | [359] = 0x0400, /* R359 - EQ25 */ | 282 | { 359, 0x0400 }, /* R359 - EQ25 */ |
282 | [360] = 0x00D8, /* R360 - EQ26 */ | 283 | { 360, 0x00D8 }, /* R360 - EQ26 */ |
283 | [361] = 0x1EB5, /* R361 - EQ27 */ | 284 | { 361, 0x1EB5 }, /* R361 - EQ27 */ |
284 | [362] = 0xF145, /* R362 - EQ28 */ | 285 | { 362, 0xF145 }, /* R362 - EQ28 */ |
285 | [363] = 0x0B75, /* R363 - EQ29 */ | 286 | { 363, 0x0B75 }, /* R363 - EQ29 */ |
286 | [364] = 0x01C5, /* R364 - EQ30 */ | 287 | { 364, 0x01C5 }, /* R364 - EQ30 */ |
287 | [365] = 0x1C58, /* R365 - EQ31 */ | 288 | { 365, 0x1C58 }, /* R365 - EQ31 */ |
288 | [366] = 0xF373, /* R366 - EQ32 */ | 289 | { 366, 0xF373 }, /* R366 - EQ32 */ |
289 | [367] = 0x0A54, /* R367 - EQ33 */ | 290 | { 367, 0x0A54 }, /* R367 - EQ33 */ |
290 | [368] = 0x0558, /* R368 - EQ34 */ | 291 | { 368, 0x0558 }, /* R368 - EQ34 */ |
291 | [369] = 0x168E, /* R369 - EQ35 */ | 292 | { 369, 0x168E }, /* R369 - EQ35 */ |
292 | [370] = 0xF829, /* R370 - EQ36 */ | 293 | { 370, 0xF829 }, /* R370 - EQ36 */ |
293 | [371] = 0x07AD, /* R371 - EQ37 */ | 294 | { 371, 0x07AD }, /* R371 - EQ37 */ |
294 | [372] = 0x1103, /* R372 - EQ38 */ | 295 | { 372, 0x1103 }, /* R372 - EQ38 */ |
295 | [373] = 0x0564, /* R373 - EQ39 */ | 296 | { 373, 0x0564 }, /* R373 - EQ39 */ |
296 | [374] = 0x0559, /* R374 - EQ40 */ | 297 | { 374, 0x0559 }, /* R374 - EQ40 */ |
297 | [375] = 0x4000, /* R375 - EQ41 */ | 298 | { 375, 0x4000 }, /* R375 - EQ41 */ |
298 | 299 | ||
299 | [513] = 0x0000, /* R513 - GPIO 2 */ | 300 | { 513, 0x0000 }, /* R513 - GPIO 2 */ |
300 | [514] = 0x0000, /* R514 - GPIO 3 */ | 301 | { 514, 0x0000 }, /* R514 - GPIO 3 */ |
301 | 302 | ||
302 | [516] = 0x8100, /* R516 - GPIO 5 */ | 303 | { 516, 0x8100 }, /* R516 - GPIO 5 */ |
303 | [517] = 0x8100, /* R517 - GPIO 6 */ | 304 | { 517, 0x8100 }, /* R517 - GPIO 6 */ |
304 | 305 | ||
305 | [560] = 0x0000, /* R560 - Interrupt Status 1 */ | 306 | { 560, 0x0000 }, /* R560 - Interrupt Status 1 */ |
306 | [561] = 0x0000, /* R561 - Interrupt Status 2 */ | 307 | { 561, 0x0000 }, /* R561 - Interrupt Status 2 */ |
307 | 308 | ||
308 | [568] = 0x0030, /* R568 - Interrupt Status 1 Mask */ | 309 | { 568, 0x0030 }, /* R568 - Interrupt Status 1 Mask */ |
309 | [569] = 0xFFED, /* R569 - Interrupt Status 2 Mask */ | 310 | { 569, 0xFFED }, /* R569 - Interrupt Status 2 Mask */ |
310 | 311 | ||
311 | [576] = 0x0000, /* R576 - Interrupt Control */ | 312 | { 576, 0x0000 }, /* R576 - Interrupt Control */ |
312 | 313 | ||
313 | [584] = 0x002D, /* R584 - IRQ Debounce */ | 314 | { 584, 0x002D }, /* R584 - IRQ Debounce */ |
314 | 315 | ||
315 | [586] = 0x0000, /* R586 - MICINT Source Pol */ | 316 | { 586, 0x0000 }, /* R586 - MICINT Source Pol */ |
316 | 317 | ||
317 | [768] = 0x1C00, /* R768 - DSP2 Power Management */ | 318 | { 768, 0x1C00 }, /* R768 - DSP2 Power Management */ |
318 | 319 | ||
319 | [1037] = 0x0000, /* R1037 - DSP2_ExecControl */ | 320 | { 1037, 0x0000 }, /* R1037 - DSP2_ExecControl */ |
320 | 321 | ||
321 | [8192] = 0x0000, /* R8192 - DSP2 Instruction RAM 0 */ | 322 | { 8192, 0x0000 }, /* R8192 - DSP2 Instruction RAM 0 */ |
322 | 323 | ||
323 | [9216] = 0x0030, /* R9216 - DSP2 Address RAM 2 */ | 324 | { 9216, 0x0030 }, /* R9216 - DSP2 Address RAM 2 */ |
324 | [9217] = 0x0000, /* R9217 - DSP2 Address RAM 1 */ | 325 | { 9217, 0x0000 }, /* R9217 - DSP2 Address RAM 1 */ |
325 | [9218] = 0x0000, /* R9218 - DSP2 Address RAM 0 */ | 326 | { 9218, 0x0000 }, /* R9218 - DSP2 Address RAM 0 */ |
326 | 327 | ||
327 | [12288] = 0x0000, /* R12288 - DSP2 Data1 RAM 1 */ | 328 | { 12288, 0x0000 }, /* R12288 - DSP2 Data1 RAM 1 */ |
328 | [12289] = 0x0000, /* R12289 - DSP2 Data1 RAM 0 */ | 329 | { 12289, 0x0000 }, /* R12289 - DSP2 Data1 RAM 0 */ |
329 | 330 | ||
330 | [13312] = 0x0000, /* R13312 - DSP2 Data2 RAM 1 */ | 331 | { 13312, 0x0000 }, /* R13312 - DSP2 Data2 RAM 1 */ |
331 | [13313] = 0x0000, /* R13313 - DSP2 Data2 RAM 0 */ | 332 | { 13313, 0x0000 }, /* R13313 - DSP2 Data2 RAM 0 */ |
332 | 333 | ||
333 | [14336] = 0x0000, /* R14336 - DSP2 Data3 RAM 1 */ | 334 | { 14336, 0x0000 }, /* R14336 - DSP2 Data3 RAM 1 */ |
334 | [14337] = 0x0000, /* R14337 - DSP2 Data3 RAM 0 */ | 335 | { 14337, 0x0000 }, /* R14337 - DSP2 Data3 RAM 0 */ |
335 | 336 | ||
336 | [15360] = 0x000A, /* R15360 - DSP2 Coeff RAM 0 */ | 337 | { 15360, 0x000A }, /* R15360 - DSP2 Coeff RAM 0 */ |
337 | 338 | ||
338 | [16384] = 0x0000, /* R16384 - RETUNEADC_SHARED_COEFF_1 */ | 339 | { 16384, 0x0000 }, /* R16384 - RETUNEADC_SHARED_COEFF_1 */ |
339 | [16385] = 0x0000, /* R16385 - RETUNEADC_SHARED_COEFF_0 */ | 340 | { 16385, 0x0000 }, /* R16385 - RETUNEADC_SHARED_COEFF_0 */ |
340 | [16386] = 0x0000, /* R16386 - RETUNEDAC_SHARED_COEFF_1 */ | 341 | { 16386, 0x0000 }, /* R16386 - RETUNEDAC_SHARED_COEFF_1 */ |
341 | [16387] = 0x0000, /* R16387 - RETUNEDAC_SHARED_COEFF_0 */ | 342 | { 16387, 0x0000 }, /* R16387 - RETUNEDAC_SHARED_COEFF_0 */ |
342 | [16388] = 0x0000, /* R16388 - SOUNDSTAGE_ENABLES_1 */ | 343 | { 16388, 0x0000 }, /* R16388 - SOUNDSTAGE_ENABLES_1 */ |
343 | [16389] = 0x0000, /* R16389 - SOUNDSTAGE_ENABLES_0 */ | 344 | { 16389, 0x0000 }, /* R16389 - SOUNDSTAGE_ENABLES_0 */ |
344 | 345 | ||
345 | [16896] = 0x0002, /* R16896 - HDBASS_AI_1 */ | 346 | { 16896, 0x0002 }, /* R16896 - HDBASS_AI_1 */ |
346 | [16897] = 0xBD12, /* R16897 - HDBASS_AI_0 */ | 347 | { 16897, 0xBD12 }, /* R16897 - HDBASS_AI_0 */ |
347 | [16898] = 0x007C, /* R16898 - HDBASS_AR_1 */ | 348 | { 16898, 0x007C }, /* R16898 - HDBASS_AR_1 */ |
348 | [16899] = 0x586C, /* R16899 - HDBASS_AR_0 */ | 349 | { 16899, 0x586C }, /* R16899 - HDBASS_AR_0 */ |
349 | [16900] = 0x0053, /* R16900 - HDBASS_B_1 */ | 350 | { 16900, 0x0053 }, /* R16900 - HDBASS_B_1 */ |
350 | [16901] = 0x8121, /* R16901 - HDBASS_B_0 */ | 351 | { 16901, 0x8121 }, /* R16901 - HDBASS_B_0 */ |
351 | [16902] = 0x003F, /* R16902 - HDBASS_K_1 */ | 352 | { 16902, 0x003F }, /* R16902 - HDBASS_K_1 */ |
352 | [16903] = 0x8BD8, /* R16903 - HDBASS_K_0 */ | 353 | { 16903, 0x8BD8 }, /* R16903 - HDBASS_K_0 */ |
353 | [16904] = 0x0032, /* R16904 - HDBASS_N1_1 */ | 354 | { 16904, 0x0032 }, /* R16904 - HDBASS_N1_1 */ |
354 | [16905] = 0xF52D, /* R16905 - HDBASS_N1_0 */ | 355 | { 16905, 0xF52D }, /* R16905 - HDBASS_N1_0 */ |
355 | [16906] = 0x0065, /* R16906 - HDBASS_N2_1 */ | 356 | { 16906, 0x0065 }, /* R16906 - HDBASS_N2_1 */ |
356 | [16907] = 0xAC8C, /* R16907 - HDBASS_N2_0 */ | 357 | { 16907, 0xAC8C }, /* R16907 - HDBASS_N2_0 */ |
357 | [16908] = 0x006B, /* R16908 - HDBASS_N3_1 */ | 358 | { 16908, 0x006B }, /* R16908 - HDBASS_N3_1 */ |
358 | [16909] = 0xE087, /* R16909 - HDBASS_N3_0 */ | 359 | { 16909, 0xE087 }, /* R16909 - HDBASS_N3_0 */ |
359 | [16910] = 0x0072, /* R16910 - HDBASS_N4_1 */ | 360 | { 16910, 0x0072 }, /* R16910 - HDBASS_N4_1 */ |
360 | [16911] = 0x1483, /* R16911 - HDBASS_N4_0 */ | 361 | { 16911, 0x1483 }, /* R16911 - HDBASS_N4_0 */ |
361 | [16912] = 0x0072, /* R16912 - HDBASS_N5_1 */ | 362 | { 16912, 0x0072 }, /* R16912 - HDBASS_N5_1 */ |
362 | [16913] = 0x1483, /* R16913 - HDBASS_N5_0 */ | 363 | { 16913, 0x1483 }, /* R16913 - HDBASS_N5_0 */ |
363 | [16914] = 0x0043, /* R16914 - HDBASS_X1_1 */ | 364 | { 16914, 0x0043 }, /* R16914 - HDBASS_X1_1 */ |
364 | [16915] = 0x3525, /* R16915 - HDBASS_X1_0 */ | 365 | { 16915, 0x3525 }, /* R16915 - HDBASS_X1_0 */ |
365 | [16916] = 0x0006, /* R16916 - HDBASS_X2_1 */ | 366 | { 16916, 0x0006 }, /* R16916 - HDBASS_X2_1 */ |
366 | [16917] = 0x6A4A, /* R16917 - HDBASS_X2_0 */ | 367 | { 16917, 0x6A4A }, /* R16917 - HDBASS_X2_0 */ |
367 | [16918] = 0x0043, /* R16918 - HDBASS_X3_1 */ | 368 | { 16918, 0x0043 }, /* R16918 - HDBASS_X3_1 */ |
368 | [16919] = 0x6079, /* R16919 - HDBASS_X3_0 */ | 369 | { 16919, 0x6079 }, /* R16919 - HDBASS_X3_0 */ |
369 | [16920] = 0x0008, /* R16920 - HDBASS_ATK_1 */ | 370 | { 16920, 0x0008 }, /* R16920 - HDBASS_ATK_1 */ |
370 | [16921] = 0x0000, /* R16921 - HDBASS_ATK_0 */ | 371 | { 16921, 0x0000 }, /* R16921 - HDBASS_ATK_0 */ |
371 | [16922] = 0x0001, /* R16922 - HDBASS_DCY_1 */ | 372 | { 16922, 0x0001 }, /* R16922 - HDBASS_DCY_1 */ |
372 | [16923] = 0x0000, /* R16923 - HDBASS_DCY_0 */ | 373 | { 16923, 0x0000 }, /* R16923 - HDBASS_DCY_0 */ |
373 | [16924] = 0x0059, /* R16924 - HDBASS_PG_1 */ | 374 | { 16924, 0x0059 }, /* R16924 - HDBASS_PG_1 */ |
374 | [16925] = 0x999A, /* R16925 - HDBASS_PG_0 */ | 375 | { 16925, 0x999A }, /* R16925 - HDBASS_PG_0 */ |
375 | 376 | ||
376 | [17048] = 0x0083, /* R17408 - HPF_C_1 */ | 377 | { 17048, 0x0083 }, /* R17408 - HPF_C_1 */ |
377 | [17049] = 0x98AD, /* R17409 - HPF_C_0 */ | 378 | { 17049, 0x98AD }, /* R17409 - HPF_C_0 */ |
378 | 379 | ||
379 | [17920] = 0x007F, /* R17920 - ADCL_RETUNE_C1_1 */ | 380 | { 17920, 0x007F }, /* R17920 - ADCL_RETUNE_C1_1 */ |
380 | [17921] = 0xFFFF, /* R17921 - ADCL_RETUNE_C1_0 */ | 381 | { 17921, 0xFFFF }, /* R17921 - ADCL_RETUNE_C1_0 */ |
381 | [17922] = 0x0000, /* R17922 - ADCL_RETUNE_C2_1 */ | 382 | { 17922, 0x0000 }, /* R17922 - ADCL_RETUNE_C2_1 */ |
382 | [17923] = 0x0000, /* R17923 - ADCL_RETUNE_C2_0 */ | 383 | { 17923, 0x0000 }, /* R17923 - ADCL_RETUNE_C2_0 */ |
383 | [17924] = 0x0000, /* R17924 - ADCL_RETUNE_C3_1 */ | 384 | { 17924, 0x0000 }, /* R17924 - ADCL_RETUNE_C3_1 */ |
384 | [17925] = 0x0000, /* R17925 - ADCL_RETUNE_C3_0 */ | 385 | { 17925, 0x0000 }, /* R17925 - ADCL_RETUNE_C3_0 */ |
385 | [17926] = 0x0000, /* R17926 - ADCL_RETUNE_C4_1 */ | 386 | { 17926, 0x0000 }, /* R17926 - ADCL_RETUNE_C4_1 */ |
386 | [17927] = 0x0000, /* R17927 - ADCL_RETUNE_C4_0 */ | 387 | { 17927, 0x0000 }, /* R17927 - ADCL_RETUNE_C4_0 */ |
387 | [17928] = 0x0000, /* R17928 - ADCL_RETUNE_C5_1 */ | 388 | { 17928, 0x0000 }, /* R17928 - ADCL_RETUNE_C5_1 */ |
388 | [17929] = 0x0000, /* R17929 - ADCL_RETUNE_C5_0 */ | 389 | { 17929, 0x0000 }, /* R17929 - ADCL_RETUNE_C5_0 */ |
389 | [17930] = 0x0000, /* R17930 - ADCL_RETUNE_C6_1 */ | 390 | { 17930, 0x0000 }, /* R17930 - ADCL_RETUNE_C6_1 */ |
390 | [17931] = 0x0000, /* R17931 - ADCL_RETUNE_C6_0 */ | 391 | { 17931, 0x0000 }, /* R17931 - ADCL_RETUNE_C6_0 */ |
391 | [17932] = 0x0000, /* R17932 - ADCL_RETUNE_C7_1 */ | 392 | { 17932, 0x0000 }, /* R17932 - ADCL_RETUNE_C7_1 */ |
392 | [17933] = 0x0000, /* R17933 - ADCL_RETUNE_C7_0 */ | 393 | { 17933, 0x0000 }, /* R17933 - ADCL_RETUNE_C7_0 */ |
393 | [17934] = 0x0000, /* R17934 - ADCL_RETUNE_C8_1 */ | 394 | { 17934, 0x0000 }, /* R17934 - ADCL_RETUNE_C8_1 */ |
394 | [17935] = 0x0000, /* R17935 - ADCL_RETUNE_C8_0 */ | 395 | { 17935, 0x0000 }, /* R17935 - ADCL_RETUNE_C8_0 */ |
395 | [17936] = 0x0000, /* R17936 - ADCL_RETUNE_C9_1 */ | 396 | { 17936, 0x0000 }, /* R17936 - ADCL_RETUNE_C9_1 */ |
396 | [17937] = 0x0000, /* R17937 - ADCL_RETUNE_C9_0 */ | 397 | { 17937, 0x0000 }, /* R17937 - ADCL_RETUNE_C9_0 */ |
397 | [17938] = 0x0000, /* R17938 - ADCL_RETUNE_C10_1 */ | 398 | { 17938, 0x0000 }, /* R17938 - ADCL_RETUNE_C10_1 */ |
398 | [17939] = 0x0000, /* R17939 - ADCL_RETUNE_C10_0 */ | 399 | { 17939, 0x0000 }, /* R17939 - ADCL_RETUNE_C10_0 */ |
399 | [17940] = 0x0000, /* R17940 - ADCL_RETUNE_C11_1 */ | 400 | { 17940, 0x0000 }, /* R17940 - ADCL_RETUNE_C11_1 */ |
400 | [17941] = 0x0000, /* R17941 - ADCL_RETUNE_C11_0 */ | 401 | { 17941, 0x0000 }, /* R17941 - ADCL_RETUNE_C11_0 */ |
401 | [17942] = 0x0000, /* R17942 - ADCL_RETUNE_C12_1 */ | 402 | { 17942, 0x0000 }, /* R17942 - ADCL_RETUNE_C12_1 */ |
402 | [17943] = 0x0000, /* R17943 - ADCL_RETUNE_C12_0 */ | 403 | { 17943, 0x0000 }, /* R17943 - ADCL_RETUNE_C12_0 */ |
403 | [17944] = 0x0000, /* R17944 - ADCL_RETUNE_C13_1 */ | 404 | { 17944, 0x0000 }, /* R17944 - ADCL_RETUNE_C13_1 */ |
404 | [17945] = 0x0000, /* R17945 - ADCL_RETUNE_C13_0 */ | 405 | { 17945, 0x0000 }, /* R17945 - ADCL_RETUNE_C13_0 */ |
405 | [17946] = 0x0000, /* R17946 - ADCL_RETUNE_C14_1 */ | 406 | { 17946, 0x0000 }, /* R17946 - ADCL_RETUNE_C14_1 */ |
406 | [17947] = 0x0000, /* R17947 - ADCL_RETUNE_C14_0 */ | 407 | { 17947, 0x0000 }, /* R17947 - ADCL_RETUNE_C14_0 */ |
407 | [17948] = 0x0000, /* R17948 - ADCL_RETUNE_C15_1 */ | 408 | { 17948, 0x0000 }, /* R17948 - ADCL_RETUNE_C15_1 */ |
408 | [17949] = 0x0000, /* R17949 - ADCL_RETUNE_C15_0 */ | 409 | { 17949, 0x0000 }, /* R17949 - ADCL_RETUNE_C15_0 */ |
409 | [17950] = 0x0000, /* R17950 - ADCL_RETUNE_C16_1 */ | 410 | { 17950, 0x0000 }, /* R17950 - ADCL_RETUNE_C16_1 */ |
410 | [17951] = 0x0000, /* R17951 - ADCL_RETUNE_C16_0 */ | 411 | { 17951, 0x0000 }, /* R17951 - ADCL_RETUNE_C16_0 */ |
411 | [17952] = 0x0000, /* R17952 - ADCL_RETUNE_C17_1 */ | 412 | { 17952, 0x0000 }, /* R17952 - ADCL_RETUNE_C17_1 */ |
412 | [17953] = 0x0000, /* R17953 - ADCL_RETUNE_C17_0 */ | 413 | { 17953, 0x0000 }, /* R17953 - ADCL_RETUNE_C17_0 */ |
413 | [17954] = 0x0000, /* R17954 - ADCL_RETUNE_C18_1 */ | 414 | { 17954, 0x0000 }, /* R17954 - ADCL_RETUNE_C18_1 */ |
414 | [17955] = 0x0000, /* R17955 - ADCL_RETUNE_C18_0 */ | 415 | { 17955, 0x0000 }, /* R17955 - ADCL_RETUNE_C18_0 */ |
415 | [17956] = 0x0000, /* R17956 - ADCL_RETUNE_C19_1 */ | 416 | { 17956, 0x0000 }, /* R17956 - ADCL_RETUNE_C19_1 */ |
416 | [17957] = 0x0000, /* R17957 - ADCL_RETUNE_C19_0 */ | 417 | { 17957, 0x0000 }, /* R17957 - ADCL_RETUNE_C19_0 */ |
417 | [17958] = 0x0000, /* R17958 - ADCL_RETUNE_C20_1 */ | 418 | { 17958, 0x0000 }, /* R17958 - ADCL_RETUNE_C20_1 */ |
418 | [17959] = 0x0000, /* R17959 - ADCL_RETUNE_C20_0 */ | 419 | { 17959, 0x0000 }, /* R17959 - ADCL_RETUNE_C20_0 */ |
419 | [17960] = 0x0000, /* R17960 - ADCL_RETUNE_C21_1 */ | 420 | { 17960, 0x0000 }, /* R17960 - ADCL_RETUNE_C21_1 */ |
420 | [17961] = 0x0000, /* R17961 - ADCL_RETUNE_C21_0 */ | 421 | { 17961, 0x0000 }, /* R17961 - ADCL_RETUNE_C21_0 */ |
421 | [17962] = 0x0000, /* R17962 - ADCL_RETUNE_C22_1 */ | 422 | { 17962, 0x0000 }, /* R17962 - ADCL_RETUNE_C22_1 */ |
422 | [17963] = 0x0000, /* R17963 - ADCL_RETUNE_C22_0 */ | 423 | { 17963, 0x0000 }, /* R17963 - ADCL_RETUNE_C22_0 */ |
423 | [17964] = 0x0000, /* R17964 - ADCL_RETUNE_C23_1 */ | 424 | { 17964, 0x0000 }, /* R17964 - ADCL_RETUNE_C23_1 */ |
424 | [17965] = 0x0000, /* R17965 - ADCL_RETUNE_C23_0 */ | 425 | { 17965, 0x0000 }, /* R17965 - ADCL_RETUNE_C23_0 */ |
425 | [17966] = 0x0000, /* R17966 - ADCL_RETUNE_C24_1 */ | 426 | { 17966, 0x0000 }, /* R17966 - ADCL_RETUNE_C24_1 */ |
426 | [17967] = 0x0000, /* R17967 - ADCL_RETUNE_C24_0 */ | 427 | { 17967, 0x0000 }, /* R17967 - ADCL_RETUNE_C24_0 */ |
427 | [17968] = 0x0000, /* R17968 - ADCL_RETUNE_C25_1 */ | 428 | { 17968, 0x0000 }, /* R17968 - ADCL_RETUNE_C25_1 */ |
428 | [17969] = 0x0000, /* R17969 - ADCL_RETUNE_C25_0 */ | 429 | { 17969, 0x0000 }, /* R17969 - ADCL_RETUNE_C25_0 */ |
429 | [17970] = 0x0000, /* R17970 - ADCL_RETUNE_C26_1 */ | 430 | { 17970, 0x0000 }, /* R17970 - ADCL_RETUNE_C26_1 */ |
430 | [17971] = 0x0000, /* R17971 - ADCL_RETUNE_C26_0 */ | 431 | { 17971, 0x0000 }, /* R17971 - ADCL_RETUNE_C26_0 */ |
431 | [17972] = 0x0000, /* R17972 - ADCL_RETUNE_C27_1 */ | 432 | { 17972, 0x0000 }, /* R17972 - ADCL_RETUNE_C27_1 */ |
432 | [17973] = 0x0000, /* R17973 - ADCL_RETUNE_C27_0 */ | 433 | { 17973, 0x0000 }, /* R17973 - ADCL_RETUNE_C27_0 */ |
433 | [17974] = 0x0000, /* R17974 - ADCL_RETUNE_C28_1 */ | 434 | { 17974, 0x0000 }, /* R17974 - ADCL_RETUNE_C28_1 */ |
434 | [17975] = 0x0000, /* R17975 - ADCL_RETUNE_C28_0 */ | 435 | { 17975, 0x0000 }, /* R17975 - ADCL_RETUNE_C28_0 */ |
435 | [17976] = 0x0000, /* R17976 - ADCL_RETUNE_C29_1 */ | 436 | { 17976, 0x0000 }, /* R17976 - ADCL_RETUNE_C29_1 */ |
436 | [17977] = 0x0000, /* R17977 - ADCL_RETUNE_C29_0 */ | 437 | { 17977, 0x0000 }, /* R17977 - ADCL_RETUNE_C29_0 */ |
437 | [17978] = 0x0000, /* R17978 - ADCL_RETUNE_C30_1 */ | 438 | { 17978, 0x0000 }, /* R17978 - ADCL_RETUNE_C30_1 */ |
438 | [17979] = 0x0000, /* R17979 - ADCL_RETUNE_C30_0 */ | 439 | { 17979, 0x0000 }, /* R17979 - ADCL_RETUNE_C30_0 */ |
439 | [17980] = 0x0000, /* R17980 - ADCL_RETUNE_C31_1 */ | 440 | { 17980, 0x0000 }, /* R17980 - ADCL_RETUNE_C31_1 */ |
440 | [17981] = 0x0000, /* R17981 - ADCL_RETUNE_C31_0 */ | 441 | { 17981, 0x0000 }, /* R17981 - ADCL_RETUNE_C31_0 */ |
441 | [17982] = 0x0000, /* R17982 - ADCL_RETUNE_C32_1 */ | 442 | { 17982, 0x0000 }, /* R17982 - ADCL_RETUNE_C32_1 */ |
442 | [17983] = 0x0000, /* R17983 - ADCL_RETUNE_C32_0 */ | 443 | { 17983, 0x0000 }, /* R17983 - ADCL_RETUNE_C32_0 */ |
443 | 444 | ||
444 | [18432] = 0x0020, /* R18432 - RETUNEADC_PG2_1 */ | 445 | { 18432, 0x0020 }, /* R18432 - RETUNEADC_PG2_1 */ |
445 | [18433] = 0x0000, /* R18433 - RETUNEADC_PG2_0 */ | 446 | { 18433, 0x0000 }, /* R18433 - RETUNEADC_PG2_0 */ |
446 | [18434] = 0x0040, /* R18434 - RETUNEADC_PG_1 */ | 447 | { 18434, 0x0040 }, /* R18434 - RETUNEADC_PG_1 */ |
447 | [18435] = 0x0000, /* R18435 - RETUNEADC_PG_0 */ | 448 | { 18435, 0x0000 }, /* R18435 - RETUNEADC_PG_0 */ |
448 | 449 | ||
449 | [18944] = 0x007F, /* R18944 - ADCR_RETUNE_C1_1 */ | 450 | { 18944, 0x007F }, /* R18944 - ADCR_RETUNE_C1_1 */ |
450 | [18945] = 0xFFFF, /* R18945 - ADCR_RETUNE_C1_0 */ | 451 | { 18945, 0xFFFF }, /* R18945 - ADCR_RETUNE_C1_0 */ |
451 | [18946] = 0x0000, /* R18946 - ADCR_RETUNE_C2_1 */ | 452 | { 18946, 0x0000 }, /* R18946 - ADCR_RETUNE_C2_1 */ |
452 | [18947] = 0x0000, /* R18947 - ADCR_RETUNE_C2_0 */ | 453 | { 18947, 0x0000 }, /* R18947 - ADCR_RETUNE_C2_0 */ |
453 | [18948] = 0x0000, /* R18948 - ADCR_RETUNE_C3_1 */ | 454 | { 18948, 0x0000 }, /* R18948 - ADCR_RETUNE_C3_1 */ |
454 | [18949] = 0x0000, /* R18949 - ADCR_RETUNE_C3_0 */ | 455 | { 18949, 0x0000 }, /* R18949 - ADCR_RETUNE_C3_0 */ |
455 | [18950] = 0x0000, /* R18950 - ADCR_RETUNE_C4_1 */ | 456 | { 18950, 0x0000 }, /* R18950 - ADCR_RETUNE_C4_1 */ |
456 | [18951] = 0x0000, /* R18951 - ADCR_RETUNE_C4_0 */ | 457 | { 18951, 0x0000 }, /* R18951 - ADCR_RETUNE_C4_0 */ |
457 | [18952] = 0x0000, /* R18952 - ADCR_RETUNE_C5_1 */ | 458 | { 18952, 0x0000 }, /* R18952 - ADCR_RETUNE_C5_1 */ |
458 | [18953] = 0x0000, /* R18953 - ADCR_RETUNE_C5_0 */ | 459 | { 18953, 0x0000 }, /* R18953 - ADCR_RETUNE_C5_0 */ |
459 | [18954] = 0x0000, /* R18954 - ADCR_RETUNE_C6_1 */ | 460 | { 18954, 0x0000 }, /* R18954 - ADCR_RETUNE_C6_1 */ |
460 | [18955] = 0x0000, /* R18955 - ADCR_RETUNE_C6_0 */ | 461 | { 18955, 0x0000 }, /* R18955 - ADCR_RETUNE_C6_0 */ |
461 | [18956] = 0x0000, /* R18956 - ADCR_RETUNE_C7_1 */ | 462 | { 18956, 0x0000 }, /* R18956 - ADCR_RETUNE_C7_1 */ |
462 | [18957] = 0x0000, /* R18957 - ADCR_RETUNE_C7_0 */ | 463 | { 18957, 0x0000 }, /* R18957 - ADCR_RETUNE_C7_0 */ |
463 | [18958] = 0x0000, /* R18958 - ADCR_RETUNE_C8_1 */ | 464 | { 18958, 0x0000 }, /* R18958 - ADCR_RETUNE_C8_1 */ |
464 | [18959] = 0x0000, /* R18959 - ADCR_RETUNE_C8_0 */ | 465 | { 18959, 0x0000 }, /* R18959 - ADCR_RETUNE_C8_0 */ |
465 | [18960] = 0x0000, /* R18960 - ADCR_RETUNE_C9_1 */ | 466 | { 18960, 0x0000 }, /* R18960 - ADCR_RETUNE_C9_1 */ |
466 | [18961] = 0x0000, /* R18961 - ADCR_RETUNE_C9_0 */ | 467 | { 18961, 0x0000 }, /* R18961 - ADCR_RETUNE_C9_0 */ |
467 | [18962] = 0x0000, /* R18962 - ADCR_RETUNE_C10_1 */ | 468 | { 18962, 0x0000 }, /* R18962 - ADCR_RETUNE_C10_1 */ |
468 | [18963] = 0x0000, /* R18963 - ADCR_RETUNE_C10_0 */ | 469 | { 18963, 0x0000 }, /* R18963 - ADCR_RETUNE_C10_0 */ |
469 | [18964] = 0x0000, /* R18964 - ADCR_RETUNE_C11_1 */ | 470 | { 18964, 0x0000 }, /* R18964 - ADCR_RETUNE_C11_1 */ |
470 | [18965] = 0x0000, /* R18965 - ADCR_RETUNE_C11_0 */ | 471 | { 18965, 0x0000 }, /* R18965 - ADCR_RETUNE_C11_0 */ |
471 | [18966] = 0x0000, /* R18966 - ADCR_RETUNE_C12_1 */ | 472 | { 18966, 0x0000 }, /* R18966 - ADCR_RETUNE_C12_1 */ |
472 | [18967] = 0x0000, /* R18967 - ADCR_RETUNE_C12_0 */ | 473 | { 18967, 0x0000 }, /* R18967 - ADCR_RETUNE_C12_0 */ |
473 | [18968] = 0x0000, /* R18968 - ADCR_RETUNE_C13_1 */ | 474 | { 18968, 0x0000 }, /* R18968 - ADCR_RETUNE_C13_1 */ |
474 | [18969] = 0x0000, /* R18969 - ADCR_RETUNE_C13_0 */ | 475 | { 18969, 0x0000 }, /* R18969 - ADCR_RETUNE_C13_0 */ |
475 | [18970] = 0x0000, /* R18970 - ADCR_RETUNE_C14_1 */ | 476 | { 18970, 0x0000 }, /* R18970 - ADCR_RETUNE_C14_1 */ |
476 | [18971] = 0x0000, /* R18971 - ADCR_RETUNE_C14_0 */ | 477 | { 18971, 0x0000 }, /* R18971 - ADCR_RETUNE_C14_0 */ |
477 | [18972] = 0x0000, /* R18972 - ADCR_RETUNE_C15_1 */ | 478 | { 18972, 0x0000 }, /* R18972 - ADCR_RETUNE_C15_1 */ |
478 | [18973] = 0x0000, /* R18973 - ADCR_RETUNE_C15_0 */ | 479 | { 18973, 0x0000 }, /* R18973 - ADCR_RETUNE_C15_0 */ |
479 | [18974] = 0x0000, /* R18974 - ADCR_RETUNE_C16_1 */ | 480 | { 18974, 0x0000 }, /* R18974 - ADCR_RETUNE_C16_1 */ |
480 | [18975] = 0x0000, /* R18975 - ADCR_RETUNE_C16_0 */ | 481 | { 18975, 0x0000 }, /* R18975 - ADCR_RETUNE_C16_0 */ |
481 | [18976] = 0x0000, /* R18976 - ADCR_RETUNE_C17_1 */ | 482 | { 18976, 0x0000 }, /* R18976 - ADCR_RETUNE_C17_1 */ |
482 | [18977] = 0x0000, /* R18977 - ADCR_RETUNE_C17_0 */ | 483 | { 18977, 0x0000 }, /* R18977 - ADCR_RETUNE_C17_0 */ |
483 | [18978] = 0x0000, /* R18978 - ADCR_RETUNE_C18_1 */ | 484 | { 18978, 0x0000 }, /* R18978 - ADCR_RETUNE_C18_1 */ |
484 | [18979] = 0x0000, /* R18979 - ADCR_RETUNE_C18_0 */ | 485 | { 18979, 0x0000 }, /* R18979 - ADCR_RETUNE_C18_0 */ |
485 | [18980] = 0x0000, /* R18980 - ADCR_RETUNE_C19_1 */ | 486 | { 18980, 0x0000 }, /* R18980 - ADCR_RETUNE_C19_1 */ |
486 | [18981] = 0x0000, /* R18981 - ADCR_RETUNE_C19_0 */ | 487 | { 18981, 0x0000 }, /* R18981 - ADCR_RETUNE_C19_0 */ |
487 | [18982] = 0x0000, /* R18982 - ADCR_RETUNE_C20_1 */ | 488 | { 18982, 0x0000 }, /* R18982 - ADCR_RETUNE_C20_1 */ |
488 | [18983] = 0x0000, /* R18983 - ADCR_RETUNE_C20_0 */ | 489 | { 18983, 0x0000 }, /* R18983 - ADCR_RETUNE_C20_0 */ |
489 | [18984] = 0x0000, /* R18984 - ADCR_RETUNE_C21_1 */ | 490 | { 18984, 0x0000 }, /* R18984 - ADCR_RETUNE_C21_1 */ |
490 | [18985] = 0x0000, /* R18985 - ADCR_RETUNE_C21_0 */ | 491 | { 18985, 0x0000 }, /* R18985 - ADCR_RETUNE_C21_0 */ |
491 | [18986] = 0x0000, /* R18986 - ADCR_RETUNE_C22_1 */ | 492 | { 18986, 0x0000 }, /* R18986 - ADCR_RETUNE_C22_1 */ |
492 | [18987] = 0x0000, /* R18987 - ADCR_RETUNE_C22_0 */ | 493 | { 18987, 0x0000 }, /* R18987 - ADCR_RETUNE_C22_0 */ |
493 | [18988] = 0x0000, /* R18988 - ADCR_RETUNE_C23_1 */ | 494 | { 18988, 0x0000 }, /* R18988 - ADCR_RETUNE_C23_1 */ |
494 | [18989] = 0x0000, /* R18989 - ADCR_RETUNE_C23_0 */ | 495 | { 18989, 0x0000 }, /* R18989 - ADCR_RETUNE_C23_0 */ |
495 | [18990] = 0x0000, /* R18990 - ADCR_RETUNE_C24_1 */ | 496 | { 18990, 0x0000 }, /* R18990 - ADCR_RETUNE_C24_1 */ |
496 | [18991] = 0x0000, /* R18991 - ADCR_RETUNE_C24_0 */ | 497 | { 18991, 0x0000 }, /* R18991 - ADCR_RETUNE_C24_0 */ |
497 | [18992] = 0x0000, /* R18992 - ADCR_RETUNE_C25_1 */ | 498 | { 18992, 0x0000 }, /* R18992 - ADCR_RETUNE_C25_1 */ |
498 | [18993] = 0x0000, /* R18993 - ADCR_RETUNE_C25_0 */ | 499 | { 18993, 0x0000 }, /* R18993 - ADCR_RETUNE_C25_0 */ |
499 | [18994] = 0x0000, /* R18994 - ADCR_RETUNE_C26_1 */ | 500 | { 18994, 0x0000 }, /* R18994 - ADCR_RETUNE_C26_1 */ |
500 | [18995] = 0x0000, /* R18995 - ADCR_RETUNE_C26_0 */ | 501 | { 18995, 0x0000 }, /* R18995 - ADCR_RETUNE_C26_0 */ |
501 | [18996] = 0x0000, /* R18996 - ADCR_RETUNE_C27_1 */ | 502 | { 18996, 0x0000 }, /* R18996 - ADCR_RETUNE_C27_1 */ |
502 | [18997] = 0x0000, /* R18997 - ADCR_RETUNE_C27_0 */ | 503 | { 18997, 0x0000 }, /* R18997 - ADCR_RETUNE_C27_0 */ |
503 | [18998] = 0x0000, /* R18998 - ADCR_RETUNE_C28_1 */ | 504 | { 18998, 0x0000 }, /* R18998 - ADCR_RETUNE_C28_1 */ |
504 | [18999] = 0x0000, /* R18999 - ADCR_RETUNE_C28_0 */ | 505 | { 18999, 0x0000 }, /* R18999 - ADCR_RETUNE_C28_0 */ |
505 | [19000] = 0x0000, /* R19000 - ADCR_RETUNE_C29_1 */ | 506 | { 19000, 0x0000 }, /* R19000 - ADCR_RETUNE_C29_1 */ |
506 | [19001] = 0x0000, /* R19001 - ADCR_RETUNE_C29_0 */ | 507 | { 19001, 0x0000 }, /* R19001 - ADCR_RETUNE_C29_0 */ |
507 | [19002] = 0x0000, /* R19002 - ADCR_RETUNE_C30_1 */ | 508 | { 19002, 0x0000 }, /* R19002 - ADCR_RETUNE_C30_1 */ |
508 | [19003] = 0x0000, /* R19003 - ADCR_RETUNE_C30_0 */ | 509 | { 19003, 0x0000 }, /* R19003 - ADCR_RETUNE_C30_0 */ |
509 | [19004] = 0x0000, /* R19004 - ADCR_RETUNE_C31_1 */ | 510 | { 19004, 0x0000 }, /* R19004 - ADCR_RETUNE_C31_1 */ |
510 | [19005] = 0x0000, /* R19005 - ADCR_RETUNE_C31_0 */ | 511 | { 19005, 0x0000 }, /* R19005 - ADCR_RETUNE_C31_0 */ |
511 | [19006] = 0x0000, /* R19006 - ADCR_RETUNE_C32_1 */ | 512 | { 19006, 0x0000 }, /* R19006 - ADCR_RETUNE_C32_1 */ |
512 | [19007] = 0x0000, /* R19007 - ADCR_RETUNE_C32_0 */ | 513 | { 19007, 0x0000 }, /* R19007 - ADCR_RETUNE_C32_0 */ |
513 | 514 | ||
514 | [19456] = 0x007F, /* R19456 - DACL_RETUNE_C1_1 */ | 515 | { 19456, 0x007F }, /* R19456 - DACL_RETUNE_C1_1 */ |
515 | [19457] = 0xFFFF, /* R19457 - DACL_RETUNE_C1_0 */ | 516 | { 19457, 0xFFFF }, /* R19457 - DACL_RETUNE_C1_0 */ |
516 | [19458] = 0x0000, /* R19458 - DACL_RETUNE_C2_1 */ | 517 | { 19458, 0x0000 }, /* R19458 - DACL_RETUNE_C2_1 */ |
517 | [19459] = 0x0000, /* R19459 - DACL_RETUNE_C2_0 */ | 518 | { 19459, 0x0000 }, /* R19459 - DACL_RETUNE_C2_0 */ |
518 | [19460] = 0x0000, /* R19460 - DACL_RETUNE_C3_1 */ | 519 | { 19460, 0x0000 }, /* R19460 - DACL_RETUNE_C3_1 */ |
519 | [19461] = 0x0000, /* R19461 - DACL_RETUNE_C3_0 */ | 520 | { 19461, 0x0000 }, /* R19461 - DACL_RETUNE_C3_0 */ |
520 | [19462] = 0x0000, /* R19462 - DACL_RETUNE_C4_1 */ | 521 | { 19462, 0x0000 }, /* R19462 - DACL_RETUNE_C4_1 */ |
521 | [19463] = 0x0000, /* R19463 - DACL_RETUNE_C4_0 */ | 522 | { 19463, 0x0000 }, /* R19463 - DACL_RETUNE_C4_0 */ |
522 | [19464] = 0x0000, /* R19464 - DACL_RETUNE_C5_1 */ | 523 | { 19464, 0x0000 }, /* R19464 - DACL_RETUNE_C5_1 */ |
523 | [19465] = 0x0000, /* R19465 - DACL_RETUNE_C5_0 */ | 524 | { 19465, 0x0000 }, /* R19465 - DACL_RETUNE_C5_0 */ |
524 | [19466] = 0x0000, /* R19466 - DACL_RETUNE_C6_1 */ | 525 | { 19466, 0x0000 }, /* R19466 - DACL_RETUNE_C6_1 */ |
525 | [19467] = 0x0000, /* R19467 - DACL_RETUNE_C6_0 */ | 526 | { 19467, 0x0000 }, /* R19467 - DACL_RETUNE_C6_0 */ |
526 | [19468] = 0x0000, /* R19468 - DACL_RETUNE_C7_1 */ | 527 | { 19468, 0x0000 }, /* R19468 - DACL_RETUNE_C7_1 */ |
527 | [19469] = 0x0000, /* R19469 - DACL_RETUNE_C7_0 */ | 528 | { 19469, 0x0000 }, /* R19469 - DACL_RETUNE_C7_0 */ |
528 | [19470] = 0x0000, /* R19470 - DACL_RETUNE_C8_1 */ | 529 | { 19470, 0x0000 }, /* R19470 - DACL_RETUNE_C8_1 */ |
529 | [19471] = 0x0000, /* R19471 - DACL_RETUNE_C8_0 */ | 530 | { 19471, 0x0000 }, /* R19471 - DACL_RETUNE_C8_0 */ |
530 | [19472] = 0x0000, /* R19472 - DACL_RETUNE_C9_1 */ | 531 | { 19472, 0x0000 }, /* R19472 - DACL_RETUNE_C9_1 */ |
531 | [19473] = 0x0000, /* R19473 - DACL_RETUNE_C9_0 */ | 532 | { 19473, 0x0000 }, /* R19473 - DACL_RETUNE_C9_0 */ |
532 | [19474] = 0x0000, /* R19474 - DACL_RETUNE_C10_1 */ | 533 | { 19474, 0x0000 }, /* R19474 - DACL_RETUNE_C10_1 */ |
533 | [19475] = 0x0000, /* R19475 - DACL_RETUNE_C10_0 */ | 534 | { 19475, 0x0000 }, /* R19475 - DACL_RETUNE_C10_0 */ |
534 | [19476] = 0x0000, /* R19476 - DACL_RETUNE_C11_1 */ | 535 | { 19476, 0x0000 }, /* R19476 - DACL_RETUNE_C11_1 */ |
535 | [19477] = 0x0000, /* R19477 - DACL_RETUNE_C11_0 */ | 536 | { 19477, 0x0000 }, /* R19477 - DACL_RETUNE_C11_0 */ |
536 | [19478] = 0x0000, /* R19478 - DACL_RETUNE_C12_1 */ | 537 | { 19478, 0x0000 }, /* R19478 - DACL_RETUNE_C12_1 */ |
537 | [19479] = 0x0000, /* R19479 - DACL_RETUNE_C12_0 */ | 538 | { 19479, 0x0000 }, /* R19479 - DACL_RETUNE_C12_0 */ |
538 | [19480] = 0x0000, /* R19480 - DACL_RETUNE_C13_1 */ | 539 | { 19480, 0x0000 }, /* R19480 - DACL_RETUNE_C13_1 */ |
539 | [19481] = 0x0000, /* R19481 - DACL_RETUNE_C13_0 */ | 540 | { 19481, 0x0000 }, /* R19481 - DACL_RETUNE_C13_0 */ |
540 | [19482] = 0x0000, /* R19482 - DACL_RETUNE_C14_1 */ | 541 | { 19482, 0x0000 }, /* R19482 - DACL_RETUNE_C14_1 */ |
541 | [19483] = 0x0000, /* R19483 - DACL_RETUNE_C14_0 */ | 542 | { 19483, 0x0000 }, /* R19483 - DACL_RETUNE_C14_0 */ |
542 | [19484] = 0x0000, /* R19484 - DACL_RETUNE_C15_1 */ | 543 | { 19484, 0x0000 }, /* R19484 - DACL_RETUNE_C15_1 */ |
543 | [19485] = 0x0000, /* R19485 - DACL_RETUNE_C15_0 */ | 544 | { 19485, 0x0000 }, /* R19485 - DACL_RETUNE_C15_0 */ |
544 | [19486] = 0x0000, /* R19486 - DACL_RETUNE_C16_1 */ | 545 | { 19486, 0x0000 }, /* R19486 - DACL_RETUNE_C16_1 */ |
545 | [19487] = 0x0000, /* R19487 - DACL_RETUNE_C16_0 */ | 546 | { 19487, 0x0000 }, /* R19487 - DACL_RETUNE_C16_0 */ |
546 | [19488] = 0x0000, /* R19488 - DACL_RETUNE_C17_1 */ | 547 | { 19488, 0x0000 }, /* R19488 - DACL_RETUNE_C17_1 */ |
547 | [19489] = 0x0000, /* R19489 - DACL_RETUNE_C17_0 */ | 548 | { 19489, 0x0000 }, /* R19489 - DACL_RETUNE_C17_0 */ |
548 | [19490] = 0x0000, /* R19490 - DACL_RETUNE_C18_1 */ | 549 | { 19490, 0x0000 }, /* R19490 - DACL_RETUNE_C18_1 */ |
549 | [19491] = 0x0000, /* R19491 - DACL_RETUNE_C18_0 */ | 550 | { 19491, 0x0000 }, /* R19491 - DACL_RETUNE_C18_0 */ |
550 | [19492] = 0x0000, /* R19492 - DACL_RETUNE_C19_1 */ | 551 | { 19492, 0x0000 }, /* R19492 - DACL_RETUNE_C19_1 */ |
551 | [19493] = 0x0000, /* R19493 - DACL_RETUNE_C19_0 */ | 552 | { 19493, 0x0000 }, /* R19493 - DACL_RETUNE_C19_0 */ |
552 | [19494] = 0x0000, /* R19494 - DACL_RETUNE_C20_1 */ | 553 | { 19494, 0x0000 }, /* R19494 - DACL_RETUNE_C20_1 */ |
553 | [19495] = 0x0000, /* R19495 - DACL_RETUNE_C20_0 */ | 554 | { 19495, 0x0000 }, /* R19495 - DACL_RETUNE_C20_0 */ |
554 | [19496] = 0x0000, /* R19496 - DACL_RETUNE_C21_1 */ | 555 | { 19496, 0x0000 }, /* R19496 - DACL_RETUNE_C21_1 */ |
555 | [19497] = 0x0000, /* R19497 - DACL_RETUNE_C21_0 */ | 556 | { 19497, 0x0000 }, /* R19497 - DACL_RETUNE_C21_0 */ |
556 | [19498] = 0x0000, /* R19498 - DACL_RETUNE_C22_1 */ | 557 | { 19498, 0x0000 }, /* R19498 - DACL_RETUNE_C22_1 */ |
557 | [19499] = 0x0000, /* R19499 - DACL_RETUNE_C22_0 */ | 558 | { 19499, 0x0000 }, /* R19499 - DACL_RETUNE_C22_0 */ |
558 | [19500] = 0x0000, /* R19500 - DACL_RETUNE_C23_1 */ | 559 | { 19500, 0x0000 }, /* R19500 - DACL_RETUNE_C23_1 */ |
559 | [19501] = 0x0000, /* R19501 - DACL_RETUNE_C23_0 */ | 560 | { 19501, 0x0000 }, /* R19501 - DACL_RETUNE_C23_0 */ |
560 | [19502] = 0x0000, /* R19502 - DACL_RETUNE_C24_1 */ | 561 | { 19502, 0x0000 }, /* R19502 - DACL_RETUNE_C24_1 */ |
561 | [19503] = 0x0000, /* R19503 - DACL_RETUNE_C24_0 */ | 562 | { 19503, 0x0000 }, /* R19503 - DACL_RETUNE_C24_0 */ |
562 | [19504] = 0x0000, /* R19504 - DACL_RETUNE_C25_1 */ | 563 | { 19504, 0x0000 }, /* R19504 - DACL_RETUNE_C25_1 */ |
563 | [19505] = 0x0000, /* R19505 - DACL_RETUNE_C25_0 */ | 564 | { 19505, 0x0000 }, /* R19505 - DACL_RETUNE_C25_0 */ |
564 | [19506] = 0x0000, /* R19506 - DACL_RETUNE_C26_1 */ | 565 | { 19506, 0x0000 }, /* R19506 - DACL_RETUNE_C26_1 */ |
565 | [19507] = 0x0000, /* R19507 - DACL_RETUNE_C26_0 */ | 566 | { 19507, 0x0000 }, /* R19507 - DACL_RETUNE_C26_0 */ |
566 | [19508] = 0x0000, /* R19508 - DACL_RETUNE_C27_1 */ | 567 | { 19508, 0x0000 }, /* R19508 - DACL_RETUNE_C27_1 */ |
567 | [19509] = 0x0000, /* R19509 - DACL_RETUNE_C27_0 */ | 568 | { 19509, 0x0000 }, /* R19509 - DACL_RETUNE_C27_0 */ |
568 | [19510] = 0x0000, /* R19510 - DACL_RETUNE_C28_1 */ | 569 | { 19510, 0x0000 }, /* R19510 - DACL_RETUNE_C28_1 */ |
569 | [19511] = 0x0000, /* R19511 - DACL_RETUNE_C28_0 */ | 570 | { 19511, 0x0000 }, /* R19511 - DACL_RETUNE_C28_0 */ |
570 | [19512] = 0x0000, /* R19512 - DACL_RETUNE_C29_1 */ | 571 | { 19512, 0x0000 }, /* R19512 - DACL_RETUNE_C29_1 */ |
571 | [19513] = 0x0000, /* R19513 - DACL_RETUNE_C29_0 */ | 572 | { 19513, 0x0000 }, /* R19513 - DACL_RETUNE_C29_0 */ |
572 | [19514] = 0x0000, /* R19514 - DACL_RETUNE_C30_1 */ | 573 | { 19514, 0x0000 }, /* R19514 - DACL_RETUNE_C30_1 */ |
573 | [19515] = 0x0000, /* R19515 - DACL_RETUNE_C30_0 */ | 574 | { 19515, 0x0000 }, /* R19515 - DACL_RETUNE_C30_0 */ |
574 | [19516] = 0x0000, /* R19516 - DACL_RETUNE_C31_1 */ | 575 | { 19516, 0x0000 }, /* R19516 - DACL_RETUNE_C31_1 */ |
575 | [19517] = 0x0000, /* R19517 - DACL_RETUNE_C31_0 */ | 576 | { 19517, 0x0000 }, /* R19517 - DACL_RETUNE_C31_0 */ |
576 | [19518] = 0x0000, /* R19518 - DACL_RETUNE_C32_1 */ | 577 | { 19518, 0x0000 }, /* R19518 - DACL_RETUNE_C32_1 */ |
577 | [19519] = 0x0000, /* R19519 - DACL_RETUNE_C32_0 */ | 578 | { 19519, 0x0000 }, /* R19519 - DACL_RETUNE_C32_0 */ |
578 | 579 | ||
579 | [19968] = 0x0020, /* R19968 - RETUNEDAC_PG2_1 */ | 580 | { 19968, 0x0020 }, /* R19968 - RETUNEDAC_PG2_1 */ |
580 | [19969] = 0x0000, /* R19969 - RETUNEDAC_PG2_0 */ | 581 | { 19969, 0x0000 }, /* R19969 - RETUNEDAC_PG2_0 */ |
581 | [19970] = 0x0040, /* R19970 - RETUNEDAC_PG_1 */ | 582 | { 19970, 0x0040 }, /* R19970 - RETUNEDAC_PG_1 */ |
582 | [19971] = 0x0000, /* R19971 - RETUNEDAC_PG_0 */ | 583 | { 19971, 0x0000 }, /* R19971 - RETUNEDAC_PG_0 */ |
583 | 584 | ||
584 | [20480] = 0x007F, /* R20480 - DACR_RETUNE_C1_1 */ | 585 | { 20480, 0x007F }, /* R20480 - DACR_RETUNE_C1_1 */ |
585 | [20481] = 0xFFFF, /* R20481 - DACR_RETUNE_C1_0 */ | 586 | { 20481, 0xFFFF }, /* R20481 - DACR_RETUNE_C1_0 */ |
586 | [20482] = 0x0000, /* R20482 - DACR_RETUNE_C2_1 */ | 587 | { 20482, 0x0000 }, /* R20482 - DACR_RETUNE_C2_1 */ |
587 | [20483] = 0x0000, /* R20483 - DACR_RETUNE_C2_0 */ | 588 | { 20483, 0x0000 }, /* R20483 - DACR_RETUNE_C2_0 */ |
588 | [20484] = 0x0000, /* R20484 - DACR_RETUNE_C3_1 */ | 589 | { 20484, 0x0000 }, /* R20484 - DACR_RETUNE_C3_1 */ |
589 | [20485] = 0x0000, /* R20485 - DACR_RETUNE_C3_0 */ | 590 | { 20485, 0x0000 }, /* R20485 - DACR_RETUNE_C3_0 */ |
590 | [20486] = 0x0000, /* R20486 - DACR_RETUNE_C4_1 */ | 591 | { 20486, 0x0000 }, /* R20486 - DACR_RETUNE_C4_1 */ |
591 | [20487] = 0x0000, /* R20487 - DACR_RETUNE_C4_0 */ | 592 | { 20487, 0x0000 }, /* R20487 - DACR_RETUNE_C4_0 */ |
592 | [20488] = 0x0000, /* R20488 - DACR_RETUNE_C5_1 */ | 593 | { 20488, 0x0000 }, /* R20488 - DACR_RETUNE_C5_1 */ |
593 | [20489] = 0x0000, /* R20489 - DACR_RETUNE_C5_0 */ | 594 | { 20489, 0x0000 }, /* R20489 - DACR_RETUNE_C5_0 */ |
594 | [20490] = 0x0000, /* R20490 - DACR_RETUNE_C6_1 */ | 595 | { 20490, 0x0000 }, /* R20490 - DACR_RETUNE_C6_1 */ |
595 | [20491] = 0x0000, /* R20491 - DACR_RETUNE_C6_0 */ | 596 | { 20491, 0x0000 }, /* R20491 - DACR_RETUNE_C6_0 */ |
596 | [20492] = 0x0000, /* R20492 - DACR_RETUNE_C7_1 */ | 597 | { 20492, 0x0000 }, /* R20492 - DACR_RETUNE_C7_1 */ |
597 | [20493] = 0x0000, /* R20493 - DACR_RETUNE_C7_0 */ | 598 | { 20493, 0x0000 }, /* R20493 - DACR_RETUNE_C7_0 */ |
598 | [20494] = 0x0000, /* R20494 - DACR_RETUNE_C8_1 */ | 599 | { 20494, 0x0000 }, /* R20494 - DACR_RETUNE_C8_1 */ |
599 | [20495] = 0x0000, /* R20495 - DACR_RETUNE_C8_0 */ | 600 | { 20495, 0x0000 }, /* R20495 - DACR_RETUNE_C8_0 */ |
600 | [20496] = 0x0000, /* R20496 - DACR_RETUNE_C9_1 */ | 601 | { 20496, 0x0000 }, /* R20496 - DACR_RETUNE_C9_1 */ |
601 | [20497] = 0x0000, /* R20497 - DACR_RETUNE_C9_0 */ | 602 | { 20497, 0x0000 }, /* R20497 - DACR_RETUNE_C9_0 */ |
602 | [20498] = 0x0000, /* R20498 - DACR_RETUNE_C10_1 */ | 603 | { 20498, 0x0000 }, /* R20498 - DACR_RETUNE_C10_1 */ |
603 | [20499] = 0x0000, /* R20499 - DACR_RETUNE_C10_0 */ | 604 | { 20499, 0x0000 }, /* R20499 - DACR_RETUNE_C10_0 */ |
604 | [20500] = 0x0000, /* R20500 - DACR_RETUNE_C11_1 */ | 605 | { 20500, 0x0000 }, /* R20500 - DACR_RETUNE_C11_1 */ |
605 | [20501] = 0x0000, /* R20501 - DACR_RETUNE_C11_0 */ | 606 | { 20501, 0x0000 }, /* R20501 - DACR_RETUNE_C11_0 */ |
606 | [20502] = 0x0000, /* R20502 - DACR_RETUNE_C12_1 */ | 607 | { 20502, 0x0000 }, /* R20502 - DACR_RETUNE_C12_1 */ |
607 | [20503] = 0x0000, /* R20503 - DACR_RETUNE_C12_0 */ | 608 | { 20503, 0x0000 }, /* R20503 - DACR_RETUNE_C12_0 */ |
608 | [20504] = 0x0000, /* R20504 - DACR_RETUNE_C13_1 */ | 609 | { 20504, 0x0000 }, /* R20504 - DACR_RETUNE_C13_1 */ |
609 | [20505] = 0x0000, /* R20505 - DACR_RETUNE_C13_0 */ | 610 | { 20505, 0x0000 }, /* R20505 - DACR_RETUNE_C13_0 */ |
610 | [20506] = 0x0000, /* R20506 - DACR_RETUNE_C14_1 */ | 611 | { 20506, 0x0000 }, /* R20506 - DACR_RETUNE_C14_1 */ |
611 | [20507] = 0x0000, /* R20507 - DACR_RETUNE_C14_0 */ | 612 | { 20507, 0x0000 }, /* R20507 - DACR_RETUNE_C14_0 */ |
612 | [20508] = 0x0000, /* R20508 - DACR_RETUNE_C15_1 */ | 613 | { 20508, 0x0000 }, /* R20508 - DACR_RETUNE_C15_1 */ |
613 | [20509] = 0x0000, /* R20509 - DACR_RETUNE_C15_0 */ | 614 | { 20509, 0x0000 }, /* R20509 - DACR_RETUNE_C15_0 */ |
614 | [20510] = 0x0000, /* R20510 - DACR_RETUNE_C16_1 */ | 615 | { 20510, 0x0000 }, /* R20510 - DACR_RETUNE_C16_1 */ |
615 | [20511] = 0x0000, /* R20511 - DACR_RETUNE_C16_0 */ | 616 | { 20511, 0x0000 }, /* R20511 - DACR_RETUNE_C16_0 */ |
616 | [20512] = 0x0000, /* R20512 - DACR_RETUNE_C17_1 */ | 617 | { 20512, 0x0000 }, /* R20512 - DACR_RETUNE_C17_1 */ |
617 | [20513] = 0x0000, /* R20513 - DACR_RETUNE_C17_0 */ | 618 | { 20513, 0x0000 }, /* R20513 - DACR_RETUNE_C17_0 */ |
618 | [20514] = 0x0000, /* R20514 - DACR_RETUNE_C18_1 */ | 619 | { 20514, 0x0000 }, /* R20514 - DACR_RETUNE_C18_1 */ |
619 | [20515] = 0x0000, /* R20515 - DACR_RETUNE_C18_0 */ | 620 | { 20515, 0x0000 }, /* R20515 - DACR_RETUNE_C18_0 */ |
620 | [20516] = 0x0000, /* R20516 - DACR_RETUNE_C19_1 */ | 621 | { 20516, 0x0000 }, /* R20516 - DACR_RETUNE_C19_1 */ |
621 | [20517] = 0x0000, /* R20517 - DACR_RETUNE_C19_0 */ | 622 | { 20517, 0x0000 }, /* R20517 - DACR_RETUNE_C19_0 */ |
622 | [20518] = 0x0000, /* R20518 - DACR_RETUNE_C20_1 */ | 623 | { 20518, 0x0000 }, /* R20518 - DACR_RETUNE_C20_1 */ |
623 | [20519] = 0x0000, /* R20519 - DACR_RETUNE_C20_0 */ | 624 | { 20519, 0x0000 }, /* R20519 - DACR_RETUNE_C20_0 */ |
624 | [20520] = 0x0000, /* R20520 - DACR_RETUNE_C21_1 */ | 625 | { 20520, 0x0000 }, /* R20520 - DACR_RETUNE_C21_1 */ |
625 | [20521] = 0x0000, /* R20521 - DACR_RETUNE_C21_0 */ | 626 | { 20521, 0x0000 }, /* R20521 - DACR_RETUNE_C21_0 */ |
626 | [20522] = 0x0000, /* R20522 - DACR_RETUNE_C22_1 */ | 627 | { 20522, 0x0000 }, /* R20522 - DACR_RETUNE_C22_1 */ |
627 | [20523] = 0x0000, /* R20523 - DACR_RETUNE_C22_0 */ | 628 | { 20523, 0x0000 }, /* R20523 - DACR_RETUNE_C22_0 */ |
628 | [20524] = 0x0000, /* R20524 - DACR_RETUNE_C23_1 */ | 629 | { 20524, 0x0000 }, /* R20524 - DACR_RETUNE_C23_1 */ |
629 | [20525] = 0x0000, /* R20525 - DACR_RETUNE_C23_0 */ | 630 | { 20525, 0x0000 }, /* R20525 - DACR_RETUNE_C23_0 */ |
630 | [20526] = 0x0000, /* R20526 - DACR_RETUNE_C24_1 */ | 631 | { 20526, 0x0000 }, /* R20526 - DACR_RETUNE_C24_1 */ |
631 | [20527] = 0x0000, /* R20527 - DACR_RETUNE_C24_0 */ | 632 | { 20527, 0x0000 }, /* R20527 - DACR_RETUNE_C24_0 */ |
632 | [20528] = 0x0000, /* R20528 - DACR_RETUNE_C25_1 */ | 633 | { 20528, 0x0000 }, /* R20528 - DACR_RETUNE_C25_1 */ |
633 | [20529] = 0x0000, /* R20529 - DACR_RETUNE_C25_0 */ | 634 | { 20529, 0x0000 }, /* R20529 - DACR_RETUNE_C25_0 */ |
634 | [20530] = 0x0000, /* R20530 - DACR_RETUNE_C26_1 */ | 635 | { 20530, 0x0000 }, /* R20530 - DACR_RETUNE_C26_1 */ |
635 | [20531] = 0x0000, /* R20531 - DACR_RETUNE_C26_0 */ | 636 | { 20531, 0x0000 }, /* R20531 - DACR_RETUNE_C26_0 */ |
636 | [20532] = 0x0000, /* R20532 - DACR_RETUNE_C27_1 */ | 637 | { 20532, 0x0000 }, /* R20532 - DACR_RETUNE_C27_1 */ |
637 | [20533] = 0x0000, /* R20533 - DACR_RETUNE_C27_0 */ | 638 | { 20533, 0x0000 }, /* R20533 - DACR_RETUNE_C27_0 */ |
638 | [20534] = 0x0000, /* R20534 - DACR_RETUNE_C28_1 */ | 639 | { 20534, 0x0000 }, /* R20534 - DACR_RETUNE_C28_1 */ |
639 | [20535] = 0x0000, /* R20535 - DACR_RETUNE_C28_0 */ | 640 | { 20535, 0x0000 }, /* R20535 - DACR_RETUNE_C28_0 */ |
640 | [20536] = 0x0000, /* R20536 - DACR_RETUNE_C29_1 */ | 641 | { 20536, 0x0000 }, /* R20536 - DACR_RETUNE_C29_1 */ |
641 | [20537] = 0x0000, /* R20537 - DACR_RETUNE_C29_0 */ | 642 | { 20537, 0x0000 }, /* R20537 - DACR_RETUNE_C29_0 */ |
642 | [20538] = 0x0000, /* R20538 - DACR_RETUNE_C30_1 */ | 643 | { 20538, 0x0000 }, /* R20538 - DACR_RETUNE_C30_1 */ |
643 | [20539] = 0x0000, /* R20539 - DACR_RETUNE_C30_0 */ | 644 | { 20539, 0x0000 }, /* R20539 - DACR_RETUNE_C30_0 */ |
644 | [20540] = 0x0000, /* R20540 - DACR_RETUNE_C31_1 */ | 645 | { 20540, 0x0000 }, /* R20540 - DACR_RETUNE_C31_1 */ |
645 | [20541] = 0x0000, /* R20541 - DACR_RETUNE_C31_0 */ | 646 | { 20541, 0x0000 }, /* R20541 - DACR_RETUNE_C31_0 */ |
646 | [20542] = 0x0000, /* R20542 - DACR_RETUNE_C32_1 */ | 647 | { 20542, 0x0000 }, /* R20542 - DACR_RETUNE_C32_1 */ |
647 | [20543] = 0x0000, /* R20543 - DACR_RETUNE_C32_0 */ | 648 | { 20543, 0x0000 }, /* R20543 - DACR_RETUNE_C32_0 */ |
648 | 649 | ||
649 | [20992] = 0x008C, /* R20992 - VSS_XHD2_1 */ | 650 | { 20992, 0x008C }, /* R20992 - VSS_XHD2_1 */ |
650 | [20993] = 0x0200, /* R20993 - VSS_XHD2_0 */ | 651 | { 20993, 0x0200 }, /* R20993 - VSS_XHD2_0 */ |
651 | [20994] = 0x0035, /* R20994 - VSS_XHD3_1 */ | 652 | { 20994, 0x0035 }, /* R20994 - VSS_XHD3_1 */ |
652 | [20995] = 0x0700, /* R20995 - VSS_XHD3_0 */ | 653 | { 20995, 0x0700 }, /* R20995 - VSS_XHD3_0 */ |
653 | [20996] = 0x003A, /* R20996 - VSS_XHN1_1 */ | 654 | { 20996, 0x003A }, /* R20996 - VSS_XHN1_1 */ |
654 | [20997] = 0x4100, /* R20997 - VSS_XHN1_0 */ | 655 | { 20997, 0x4100 }, /* R20997 - VSS_XHN1_0 */ |
655 | [20998] = 0x008B, /* R20998 - VSS_XHN2_1 */ | 656 | { 20998, 0x008B }, /* R20998 - VSS_XHN2_1 */ |
656 | [20999] = 0x7D00, /* R20999 - VSS_XHN2_0 */ | 657 | { 20999, 0x7D00 }, /* R20999 - VSS_XHN2_0 */ |
657 | [21000] = 0x003A, /* R21000 - VSS_XHN3_1 */ | 658 | { 21000, 0x003A }, /* R21000 - VSS_XHN3_1 */ |
658 | [21001] = 0x4100, /* R21001 - VSS_XHN3_0 */ | 659 | { 21001, 0x4100 }, /* R21001 - VSS_XHN3_0 */ |
659 | [21002] = 0x008C, /* R21002 - VSS_XLA_1 */ | 660 | { 21002, 0x008C }, /* R21002 - VSS_XLA_1 */ |
660 | [21003] = 0xFEE8, /* R21003 - VSS_XLA_0 */ | 661 | { 21003, 0xFEE8 }, /* R21003 - VSS_XLA_0 */ |
661 | [21004] = 0x0078, /* R21004 - VSS_XLB_1 */ | 662 | { 21004, 0x0078 }, /* R21004 - VSS_XLB_1 */ |
662 | [21005] = 0x0000, /* R21005 - VSS_XLB_0 */ | 663 | { 21005, 0x0000 }, /* R21005 - VSS_XLB_0 */ |
663 | [21006] = 0x003F, /* R21006 - VSS_XLG_1 */ | 664 | { 21006, 0x003F }, /* R21006 - VSS_XLG_1 */ |
664 | [21007] = 0xB260, /* R21007 - VSS_XLG_0 */ | 665 | { 21007, 0xB260 }, /* R21007 - VSS_XLG_0 */ |
665 | [21008] = 0x002D, /* R21008 - VSS_PG2_1 */ | 666 | { 21008, 0x002D }, /* R21008 - VSS_PG2_1 */ |
666 | [21009] = 0x1818, /* R21009 - VSS_PG2_0 */ | 667 | { 21009, 0x1818 }, /* R21009 - VSS_PG2_0 */ |
667 | [21010] = 0x0020, /* R21010 - VSS_PG_1 */ | 668 | { 21010, 0x0020 }, /* R21010 - VSS_PG_1 */ |
668 | [21011] = 0x0000, /* R21011 - VSS_PG_0 */ | 669 | { 21011, 0x0000 }, /* R21011 - VSS_PG_0 */ |
669 | [21012] = 0x00F1, /* R21012 - VSS_XTD1_1 */ | 670 | { 21012, 0x00F1 }, /* R21012 - VSS_XTD1_1 */ |
670 | [21013] = 0x8340, /* R21013 - VSS_XTD1_0 */ | 671 | { 21013, 0x8340 }, /* R21013 - VSS_XTD1_0 */ |
671 | [21014] = 0x00FB, /* R21014 - VSS_XTD2_1 */ | 672 | { 21014, 0x00FB }, /* R21014 - VSS_XTD2_1 */ |
672 | [21015] = 0x8300, /* R21015 - VSS_XTD2_0 */ | 673 | { 21015, 0x8300 }, /* R21015 - VSS_XTD2_0 */ |
673 | [21016] = 0x00EE, /* R21016 - VSS_XTD3_1 */ | 674 | { 21016, 0x00EE }, /* R21016 - VSS_XTD3_1 */ |
674 | [21017] = 0xAEC0, /* R21017 - VSS_XTD3_0 */ | 675 | { 21017, 0xAEC0 }, /* R21017 - VSS_XTD3_0 */ |
675 | [21018] = 0x00FB, /* R21018 - VSS_XTD4_1 */ | 676 | { 21018, 0x00FB }, /* R21018 - VSS_XTD4_1 */ |
676 | [21019] = 0xAC40, /* R21019 - VSS_XTD4_0 */ | 677 | { 21019, 0xAC40 }, /* R21019 - VSS_XTD4_0 */ |
677 | [21020] = 0x00F1, /* R21020 - VSS_XTD5_1 */ | 678 | { 21020, 0x00F1 }, /* R21020 - VSS_XTD5_1 */ |
678 | [21021] = 0x7F80, /* R21021 - VSS_XTD5_0 */ | 679 | { 21021, 0x7F80 }, /* R21021 - VSS_XTD5_0 */ |
679 | [21022] = 0x00F4, /* R21022 - VSS_XTD6_1 */ | 680 | { 21022, 0x00F4 }, /* R21022 - VSS_XTD6_1 */ |
680 | [21023] = 0x3B40, /* R21023 - VSS_XTD6_0 */ | 681 | { 21023, 0x3B40 }, /* R21023 - VSS_XTD6_0 */ |
681 | [21024] = 0x00F5, /* R21024 - VSS_XTD7_1 */ | 682 | { 21024, 0x00F5 }, /* R21024 - VSS_XTD7_1 */ |
682 | [21025] = 0xFB00, /* R21025 - VSS_XTD7_0 */ | 683 | { 21025, 0xFB00 }, /* R21025 - VSS_XTD7_0 */ |
683 | [21026] = 0x00EA, /* R21026 - VSS_XTD8_1 */ | 684 | { 21026, 0x00EA }, /* R21026 - VSS_XTD8_1 */ |
684 | [21027] = 0x10C0, /* R21027 - VSS_XTD8_0 */ | 685 | { 21027, 0x10C0 }, /* R21027 - VSS_XTD8_0 */ |
685 | [21028] = 0x00FC, /* R21028 - VSS_XTD9_1 */ | 686 | { 21028, 0x00FC }, /* R21028 - VSS_XTD9_1 */ |
686 | [21029] = 0xC580, /* R21029 - VSS_XTD9_0 */ | 687 | { 21029, 0xC580 }, /* R21029 - VSS_XTD9_0 */ |
687 | [21030] = 0x00E2, /* R21030 - VSS_XTD10_1 */ | 688 | { 21030, 0x00E2 }, /* R21030 - VSS_XTD10_1 */ |
688 | [21031] = 0x75C0, /* R21031 - VSS_XTD10_0 */ | 689 | { 21031, 0x75C0 }, /* R21031 - VSS_XTD10_0 */ |
689 | [21032] = 0x0004, /* R21032 - VSS_XTD11_1 */ | 690 | { 21032, 0x0004 }, /* R21032 - VSS_XTD11_1 */ |
690 | [21033] = 0xB480, /* R21033 - VSS_XTD11_0 */ | 691 | { 21033, 0xB480 }, /* R21033 - VSS_XTD11_0 */ |
691 | [21034] = 0x00D4, /* R21034 - VSS_XTD12_1 */ | 692 | { 21034, 0x00D4 }, /* R21034 - VSS_XTD12_1 */ |
692 | [21035] = 0xF980, /* R21035 - VSS_XTD12_0 */ | 693 | { 21035, 0xF980 }, /* R21035 - VSS_XTD12_0 */ |
693 | [21036] = 0x0004, /* R21036 - VSS_XTD13_1 */ | 694 | { 21036, 0x0004 }, /* R21036 - VSS_XTD13_1 */ |
694 | [21037] = 0x9140, /* R21037 - VSS_XTD13_0 */ | 695 | { 21037, 0x9140 }, /* R21037 - VSS_XTD13_0 */ |
695 | [21038] = 0x00D8, /* R21038 - VSS_XTD14_1 */ | 696 | { 21038, 0x00D8 }, /* R21038 - VSS_XTD14_1 */ |
696 | [21039] = 0xA480, /* R21039 - VSS_XTD14_0 */ | 697 | { 21039, 0xA480 }, /* R21039 - VSS_XTD14_0 */ |
697 | [21040] = 0x0002, /* R21040 - VSS_XTD15_1 */ | 698 | { 21040, 0x0002 }, /* R21040 - VSS_XTD15_1 */ |
698 | [21041] = 0x3DC0, /* R21041 - VSS_XTD15_0 */ | 699 | { 21041, 0x3DC0 }, /* R21041 - VSS_XTD15_0 */ |
699 | [21042] = 0x00CF, /* R21042 - VSS_XTD16_1 */ | 700 | { 21042, 0x00CF }, /* R21042 - VSS_XTD16_1 */ |
700 | [21043] = 0x7A80, /* R21043 - VSS_XTD16_0 */ | 701 | { 21043, 0x7A80 }, /* R21043 - VSS_XTD16_0 */ |
701 | [21044] = 0x00DC, /* R21044 - VSS_XTD17_1 */ | 702 | { 21044, 0x00DC }, /* R21044 - VSS_XTD17_1 */ |
702 | [21045] = 0x0600, /* R21045 - VSS_XTD17_0 */ | 703 | { 21045, 0x0600 }, /* R21045 - VSS_XTD17_0 */ |
703 | [21046] = 0x00F2, /* R21046 - VSS_XTD18_1 */ | 704 | { 21046, 0x00F2 }, /* R21046 - VSS_XTD18_1 */ |
704 | [21047] = 0xDAC0, /* R21047 - VSS_XTD18_0 */ | 705 | { 21047, 0xDAC0 }, /* R21047 - VSS_XTD18_0 */ |
705 | [21048] = 0x00BA, /* R21048 - VSS_XTD19_1 */ | 706 | { 21048, 0x00BA }, /* R21048 - VSS_XTD19_1 */ |
706 | [21049] = 0xF340, /* R21049 - VSS_XTD19_0 */ | 707 | { 21049, 0xF340 }, /* R21049 - VSS_XTD19_0 */ |
707 | [21050] = 0x000A, /* R21050 - VSS_XTD20_1 */ | 708 | { 21050, 0x000A }, /* R21050 - VSS_XTD20_1 */ |
708 | [21051] = 0x7940, /* R21051 - VSS_XTD20_0 */ | 709 | { 21051, 0x7940 }, /* R21051 - VSS_XTD20_0 */ |
709 | [21052] = 0x001C, /* R21052 - VSS_XTD21_1 */ | 710 | { 21052, 0x001C }, /* R21052 - VSS_XTD21_1 */ |
710 | [21053] = 0x0680, /* R21053 - VSS_XTD21_0 */ | 711 | { 21053, 0x0680 }, /* R21053 - VSS_XTD21_0 */ |
711 | [21054] = 0x00FD, /* R21054 - VSS_XTD22_1 */ | 712 | { 21054, 0x00FD }, /* R21054 - VSS_XTD22_1 */ |
712 | [21055] = 0x2D00, /* R21055 - VSS_XTD22_0 */ | 713 | { 21055, 0x2D00 }, /* R21055 - VSS_XTD22_0 */ |
713 | [21056] = 0x001C, /* R21056 - VSS_XTD23_1 */ | 714 | { 21056, 0x001C }, /* R21056 - VSS_XTD23_1 */ |
714 | [21057] = 0xE840, /* R21057 - VSS_XTD23_0 */ | 715 | { 21057, 0xE840 }, /* R21057 - VSS_XTD23_0 */ |
715 | [21058] = 0x000D, /* R21058 - VSS_XTD24_1 */ | 716 | { 21058, 0x000D }, /* R21058 - VSS_XTD24_1 */ |
716 | [21059] = 0xDC40, /* R21059 - VSS_XTD24_0 */ | 717 | { 21059, 0xDC40 }, /* R21059 - VSS_XTD24_0 */ |
717 | [21060] = 0x00FC, /* R21060 - VSS_XTD25_1 */ | 718 | { 21060, 0x00FC }, /* R21060 - VSS_XTD25_1 */ |
718 | [21061] = 0x9D00, /* R21061 - VSS_XTD25_0 */ | 719 | { 21061, 0x9D00 }, /* R21061 - VSS_XTD25_0 */ |
719 | [21062] = 0x0009, /* R21062 - VSS_XTD26_1 */ | 720 | { 21062, 0x0009 }, /* R21062 - VSS_XTD26_1 */ |
720 | [21063] = 0x5580, /* R21063 - VSS_XTD26_0 */ | 721 | { 21063, 0x5580 }, /* R21063 - VSS_XTD26_0 */ |
721 | [21064] = 0x00FE, /* R21064 - VSS_XTD27_1 */ | 722 | { 21064, 0x00FE }, /* R21064 - VSS_XTD27_1 */ |
722 | [21065] = 0x7E80, /* R21065 - VSS_XTD27_0 */ | 723 | { 21065, 0x7E80 }, /* R21065 - VSS_XTD27_0 */ |
723 | [21066] = 0x000E, /* R21066 - VSS_XTD28_1 */ | 724 | { 21066, 0x000E }, /* R21066 - VSS_XTD28_1 */ |
724 | [21067] = 0xAB40, /* R21067 - VSS_XTD28_0 */ | 725 | { 21067, 0xAB40 }, /* R21067 - VSS_XTD28_0 */ |
725 | [21068] = 0x00F9, /* R21068 - VSS_XTD29_1 */ | 726 | { 21068, 0x00F9 }, /* R21068 - VSS_XTD29_1 */ |
726 | [21069] = 0x9880, /* R21069 - VSS_XTD29_0 */ | 727 | { 21069, 0x9880 }, /* R21069 - VSS_XTD29_0 */ |
727 | [21070] = 0x0009, /* R21070 - VSS_XTD30_1 */ | 728 | { 21070, 0x0009 }, /* R21070 - VSS_XTD30_1 */ |
728 | [21071] = 0x87C0, /* R21071 - VSS_XTD30_0 */ | 729 | { 21071, 0x87C0 }, /* R21071 - VSS_XTD30_0 */ |
729 | [21072] = 0x00FD, /* R21072 - VSS_XTD31_1 */ | 730 | { 21072, 0x00FD }, /* R21072 - VSS_XTD31_1 */ |
730 | [21073] = 0x2C40, /* R21073 - VSS_XTD31_0 */ | 731 | { 21073, 0x2C40 }, /* R21073 - VSS_XTD31_0 */ |
731 | [21074] = 0x0009, /* R21074 - VSS_XTD32_1 */ | 732 | { 21074, 0x0009 }, /* R21074 - VSS_XTD32_1 */ |
732 | [21075] = 0x4800, /* R21075 - VSS_XTD32_0 */ | 733 | { 21075, 0x4800 }, /* R21075 - VSS_XTD32_0 */ |
733 | [21076] = 0x0003, /* R21076 - VSS_XTS1_1 */ | 734 | { 21076, 0x0003 }, /* R21076 - VSS_XTS1_1 */ |
734 | [21077] = 0x5F40, /* R21077 - VSS_XTS1_0 */ | 735 | { 21077, 0x5F40 }, /* R21077 - VSS_XTS1_0 */ |
735 | [21078] = 0x0000, /* R21078 - VSS_XTS2_1 */ | 736 | { 21078, 0x0000 }, /* R21078 - VSS_XTS2_1 */ |
736 | [21079] = 0x8700, /* R21079 - VSS_XTS2_0 */ | 737 | { 21079, 0x8700 }, /* R21079 - VSS_XTS2_0 */ |
737 | [21080] = 0x00FA, /* R21080 - VSS_XTS3_1 */ | 738 | { 21080, 0x00FA }, /* R21080 - VSS_XTS3_1 */ |
738 | [21081] = 0xE4C0, /* R21081 - VSS_XTS3_0 */ | 739 | { 21081, 0xE4C0 }, /* R21081 - VSS_XTS3_0 */ |
739 | [21082] = 0x0000, /* R21082 - VSS_XTS4_1 */ | 740 | { 21082, 0x0000 }, /* R21082 - VSS_XTS4_1 */ |
740 | [21083] = 0x0B40, /* R21083 - VSS_XTS4_0 */ | 741 | { 21083, 0x0B40 }, /* R21083 - VSS_XTS4_0 */ |
741 | [21084] = 0x0004, /* R21084 - VSS_XTS5_1 */ | 742 | { 21084, 0x0004 }, /* R21084 - VSS_XTS5_1 */ |
742 | [21085] = 0xE180, /* R21085 - VSS_XTS5_0 */ | 743 | { 21085, 0xE180 }, /* R21085 - VSS_XTS5_0 */ |
743 | [21086] = 0x0001, /* R21086 - VSS_XTS6_1 */ | 744 | { 21086, 0x0001 }, /* R21086 - VSS_XTS6_1 */ |
744 | [21087] = 0x1F40, /* R21087 - VSS_XTS6_0 */ | 745 | { 21087, 0x1F40 }, /* R21087 - VSS_XTS6_0 */ |
745 | [21088] = 0x00F8, /* R21088 - VSS_XTS7_1 */ | 746 | { 21088, 0x00F8 }, /* R21088 - VSS_XTS7_1 */ |
746 | [21089] = 0xB000, /* R21089 - VSS_XTS7_0 */ | 747 | { 21089, 0xB000 }, /* R21089 - VSS_XTS7_0 */ |
747 | [21090] = 0x00FB, /* R21090 - VSS_XTS8_1 */ | 748 | { 21090, 0x00FB }, /* R21090 - VSS_XTS8_1 */ |
748 | [21091] = 0xCBC0, /* R21091 - VSS_XTS8_0 */ | 749 | { 21091, 0xCBC0 }, /* R21091 - VSS_XTS8_0 */ |
749 | [21092] = 0x0004, /* R21092 - VSS_XTS9_1 */ | 750 | { 21092, 0x0004 }, /* R21092 - VSS_XTS9_1 */ |
750 | [21093] = 0xF380, /* R21093 - VSS_XTS9_0 */ | 751 | { 21093, 0xF380 }, /* R21093 - VSS_XTS9_0 */ |
751 | [21094] = 0x0007, /* R21094 - VSS_XTS10_1 */ | 752 | { 21094, 0x0007 }, /* R21094 - VSS_XTS10_1 */ |
752 | [21095] = 0xDF40, /* R21095 - VSS_XTS10_0 */ | 753 | { 21095, 0xDF40 }, /* R21095 - VSS_XTS10_0 */ |
753 | [21096] = 0x00FF, /* R21096 - VSS_XTS11_1 */ | 754 | { 21096, 0x00FF }, /* R21096 - VSS_XTS11_1 */ |
754 | [21097] = 0x0700, /* R21097 - VSS_XTS11_0 */ | 755 | { 21097, 0x0700 }, /* R21097 - VSS_XTS11_0 */ |
755 | [21098] = 0x00EF, /* R21098 - VSS_XTS12_1 */ | 756 | { 21098, 0x00EF }, /* R21098 - VSS_XTS12_1 */ |
756 | [21099] = 0xD700, /* R21099 - VSS_XTS12_0 */ | 757 | { 21099, 0xD700 }, /* R21099 - VSS_XTS12_0 */ |
757 | [21100] = 0x00FB, /* R21100 - VSS_XTS13_1 */ | 758 | { 21100, 0x00FB }, /* R21100 - VSS_XTS13_1 */ |
758 | [21101] = 0xAF40, /* R21101 - VSS_XTS13_0 */ | 759 | { 21101, 0xAF40 }, /* R21101 - VSS_XTS13_0 */ |
759 | [21102] = 0x0010, /* R21102 - VSS_XTS14_1 */ | 760 | { 21102, 0x0010 }, /* R21102 - VSS_XTS14_1 */ |
760 | [21103] = 0x8A80, /* R21103 - VSS_XTS14_0 */ | 761 | { 21103, 0x8A80 }, /* R21103 - VSS_XTS14_0 */ |
761 | [21104] = 0x0011, /* R21104 - VSS_XTS15_1 */ | 762 | { 21104, 0x0011 }, /* R21104 - VSS_XTS15_1 */ |
762 | [21105] = 0x07C0, /* R21105 - VSS_XTS15_0 */ | 763 | { 21105, 0x07C0 }, /* R21105 - VSS_XTS15_0 */ |
763 | [21106] = 0x00E0, /* R21106 - VSS_XTS16_1 */ | 764 | { 21106, 0x00E0 }, /* R21106 - VSS_XTS16_1 */ |
764 | [21107] = 0x0800, /* R21107 - VSS_XTS16_0 */ | 765 | { 21107, 0x0800 }, /* R21107 - VSS_XTS16_0 */ |
765 | [21108] = 0x00D2, /* R21108 - VSS_XTS17_1 */ | 766 | { 21108, 0x00D2 }, /* R21108 - VSS_XTS17_1 */ |
766 | [21109] = 0x7600, /* R21109 - VSS_XTS17_0 */ | 767 | { 21109, 0x7600 }, /* R21109 - VSS_XTS17_0 */ |
767 | [21110] = 0x0020, /* R21110 - VSS_XTS18_1 */ | 768 | { 21110, 0x0020 }, /* R21110 - VSS_XTS18_1 */ |
768 | [21111] = 0xCF40, /* R21111 - VSS_XTS18_0 */ | 769 | { 21111, 0xCF40 }, /* R21111 - VSS_XTS18_0 */ |
769 | [21112] = 0x0030, /* R21112 - VSS_XTS19_1 */ | 770 | { 21112, 0x0030 }, /* R21112 - VSS_XTS19_1 */ |
770 | [21113] = 0x2340, /* R21113 - VSS_XTS19_0 */ | 771 | { 21113, 0x2340 }, /* R21113 - VSS_XTS19_0 */ |
771 | [21114] = 0x00FD, /* R21114 - VSS_XTS20_1 */ | 772 | { 21114, 0x00FD }, /* R21114 - VSS_XTS20_1 */ |
772 | [21115] = 0x69C0, /* R21115 - VSS_XTS20_0 */ | 773 | { 21115, 0x69C0 }, /* R21115 - VSS_XTS20_0 */ |
773 | [21116] = 0x0028, /* R21116 - VSS_XTS21_1 */ | 774 | { 21116, 0x0028 }, /* R21116 - VSS_XTS21_1 */ |
774 | [21117] = 0x3500, /* R21117 - VSS_XTS21_0 */ | 775 | { 21117, 0x3500 }, /* R21117 - VSS_XTS21_0 */ |
775 | [21118] = 0x0006, /* R21118 - VSS_XTS22_1 */ | 776 | { 21118, 0x0006 }, /* R21118 - VSS_XTS22_1 */ |
776 | [21119] = 0x3300, /* R21119 - VSS_XTS22_0 */ | 777 | { 21119, 0x3300 }, /* R21119 - VSS_XTS22_0 */ |
777 | [21120] = 0x00D9, /* R21120 - VSS_XTS23_1 */ | 778 | { 21120, 0x00D9 }, /* R21120 - VSS_XTS23_1 */ |
778 | [21121] = 0xF6C0, /* R21121 - VSS_XTS23_0 */ | 779 | { 21121, 0xF6C0 }, /* R21121 - VSS_XTS23_0 */ |
779 | [21122] = 0x00F3, /* R21122 - VSS_XTS24_1 */ | 780 | { 21122, 0x00F3 }, /* R21122 - VSS_XTS24_1 */ |
780 | [21123] = 0x3340, /* R21123 - VSS_XTS24_0 */ | 781 | { 21123, 0x3340 }, /* R21123 - VSS_XTS24_0 */ |
781 | [21124] = 0x000F, /* R21124 - VSS_XTS25_1 */ | 782 | { 21124, 0x000F }, /* R21124 - VSS_XTS25_1 */ |
782 | [21125] = 0x4200, /* R21125 - VSS_XTS25_0 */ | 783 | { 21125, 0x4200 }, /* R21125 - VSS_XTS25_0 */ |
783 | [21126] = 0x0004, /* R21126 - VSS_XTS26_1 */ | 784 | { 21126, 0x0004 }, /* R21126 - VSS_XTS26_1 */ |
784 | [21127] = 0x0C80, /* R21127 - VSS_XTS26_0 */ | 785 | { 21127, 0x0C80 }, /* R21127 - VSS_XTS26_0 */ |
785 | [21128] = 0x00FB, /* R21128 - VSS_XTS27_1 */ | 786 | { 21128, 0x00FB }, /* R21128 - VSS_XTS27_1 */ |
786 | [21129] = 0x3F80, /* R21129 - VSS_XTS27_0 */ | 787 | { 21129, 0x3F80 }, /* R21129 - VSS_XTS27_0 */ |
787 | [21130] = 0x00F7, /* R21130 - VSS_XTS28_1 */ | 788 | { 21130, 0x00F7 }, /* R21130 - VSS_XTS28_1 */ |
788 | [21131] = 0x57C0, /* R21131 - VSS_XTS28_0 */ | 789 | { 21131, 0x57C0 }, /* R21131 - VSS_XTS28_0 */ |
789 | [21132] = 0x0003, /* R21132 - VSS_XTS29_1 */ | 790 | { 21132, 0x0003 }, /* R21132 - VSS_XTS29_1 */ |
790 | [21133] = 0x5400, /* R21133 - VSS_XTS29_0 */ | 791 | { 21133, 0x5400 }, /* R21133 - VSS_XTS29_0 */ |
791 | [21134] = 0x0000, /* R21134 - VSS_XTS30_1 */ | 792 | { 21134, 0x0000 }, /* R21134 - VSS_XTS30_1 */ |
792 | [21135] = 0xC6C0, /* R21135 - VSS_XTS30_0 */ | 793 | { 21135, 0xC6C0 }, /* R21135 - VSS_XTS30_0 */ |
793 | [21136] = 0x0003, /* R21136 - VSS_XTS31_1 */ | 794 | { 21136, 0x0003 }, /* R21136 - VSS_XTS31_1 */ |
794 | [21137] = 0x12C0, /* R21137 - VSS_XTS31_0 */ | 795 | { 21137, 0x12C0 }, /* R21137 - VSS_XTS31_0 */ |
795 | [21138] = 0x00FD, /* R21138 - VSS_XTS32_1 */ | 796 | { 21138, 0x00FD }, /* R21138 - VSS_XTS32_1 */ |
796 | [21139] = 0x8580, /* R21139 - VSS_XTS32_0 */ | 797 | { 21139, 0x8580 }, /* R21139 - VSS_XTS32_0 */ |
797 | }; | 798 | }; |
798 | 799 | ||
799 | static const struct wm8962_reg_access { | 800 | static const struct wm8962_reg_access { |
@@ -802,7 +803,7 @@ static const struct wm8962_reg_access { | |||
802 | u16 vol; | 803 | u16 vol; |
803 | } wm8962_reg_access[WM8962_MAX_REGISTER + 1] = { | 804 | } wm8962_reg_access[WM8962_MAX_REGISTER + 1] = { |
804 | [0] = { 0x00FF, 0x01FF, 0x0000 }, /* R0 - Left Input volume */ | 805 | [0] = { 0x00FF, 0x01FF, 0x0000 }, /* R0 - Left Input volume */ |
805 | [1] = { 0xFEFF, 0x01FF, 0xFFFF }, /* R1 - Right Input volume */ | 806 | [1] = { 0xFEFF, 0x01FF, 0x0000 }, /* R1 - Right Input volume */ |
806 | [2] = { 0x00FF, 0x01FF, 0x0000 }, /* R2 - HPOUTL volume */ | 807 | [2] = { 0x00FF, 0x01FF, 0x0000 }, /* R2 - HPOUTL volume */ |
807 | [3] = { 0x00FF, 0x01FF, 0x0000 }, /* R3 - HPOUTR volume */ | 808 | [3] = { 0x00FF, 0x01FF, 0x0000 }, /* R3 - HPOUTR volume */ |
808 | [4] = { 0x07FE, 0x07FE, 0xFFFF }, /* R4 - Clocking1 */ | 809 | [4] = { 0x07FE, 0x07FE, 0xFFFF }, /* R4 - Clocking1 */ |
@@ -1943,7 +1944,7 @@ static const struct wm8962_reg_access { | |||
1943 | [21139] = { 0xFFFF, 0xFFFF, 0x0000 }, /* R21139 - VSS_XTS32_0 */ | 1944 | [21139] = { 0xFFFF, 0xFFFF, 0x0000 }, /* R21139 - VSS_XTS32_0 */ |
1944 | }; | 1945 | }; |
1945 | 1946 | ||
1946 | static int wm8962_volatile_register(struct snd_soc_codec *codec, unsigned int reg) | 1947 | static bool wm8962_volatile_register(struct device *dev, unsigned int reg) |
1947 | { | 1948 | { |
1948 | if (wm8962_reg_access[reg].vol) | 1949 | if (wm8962_reg_access[reg].vol) |
1949 | return 1; | 1950 | return 1; |
@@ -1951,7 +1952,7 @@ static int wm8962_volatile_register(struct snd_soc_codec *codec, unsigned int re | |||
1951 | return 0; | 1952 | return 0; |
1952 | } | 1953 | } |
1953 | 1954 | ||
1954 | static int wm8962_readable_register(struct snd_soc_codec *codec, unsigned int reg) | 1955 | static bool wm8962_readable_register(struct device *dev, unsigned int reg) |
1955 | { | 1956 | { |
1956 | if (wm8962_reg_access[reg].read) | 1957 | if (wm8962_reg_access[reg].read) |
1957 | return 1; | 1958 | return 1; |
@@ -1959,15 +1960,15 @@ static int wm8962_readable_register(struct snd_soc_codec *codec, unsigned int re | |||
1959 | return 0; | 1960 | return 0; |
1960 | } | 1961 | } |
1961 | 1962 | ||
1962 | static int wm8962_reset(struct snd_soc_codec *codec) | 1963 | static int wm8962_reset(struct wm8962_priv *wm8962) |
1963 | { | 1964 | { |
1964 | int ret; | 1965 | int ret; |
1965 | 1966 | ||
1966 | ret = snd_soc_write(codec, WM8962_SOFTWARE_RESET, 0x6243); | 1967 | ret = regmap_write(wm8962->regmap, WM8962_SOFTWARE_RESET, 0x6243); |
1967 | if (ret != 0) | 1968 | if (ret != 0) |
1968 | return ret; | 1969 | return ret; |
1969 | 1970 | ||
1970 | return snd_soc_write(codec, WM8962_PLL_SOFTWARE_RESET, 0); | 1971 | return regmap_write(wm8962->regmap, WM8962_PLL_SOFTWARE_RESET, 0); |
1971 | } | 1972 | } |
1972 | 1973 | ||
1973 | static const DECLARE_TLV_DB_SCALE(inpga_tlv, -2325, 75, 0); | 1974 | static const DECLARE_TLV_DB_SCALE(inpga_tlv, -2325, 75, 0); |
@@ -2345,6 +2346,10 @@ static int sysclk_event(struct snd_soc_dapm_widget *w, | |||
2345 | int src; | 2346 | int src; |
2346 | int fll; | 2347 | int fll; |
2347 | 2348 | ||
2349 | /* Ignore attempts to run the event during startup */ | ||
2350 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) | ||
2351 | return 0; | ||
2352 | |||
2348 | src = snd_soc_read(codec, WM8962_CLOCKING2) & WM8962_SYSCLK_SRC_MASK; | 2353 | src = snd_soc_read(codec, WM8962_CLOCKING2) & WM8962_SYSCLK_SRC_MASK; |
2349 | 2354 | ||
2350 | switch (src) { | 2355 | switch (src) { |
@@ -2670,7 +2675,7 @@ SND_SOC_DAPM_INPUT("IN3L"), | |||
2670 | SND_SOC_DAPM_INPUT("IN3R"), | 2675 | SND_SOC_DAPM_INPUT("IN3R"), |
2671 | SND_SOC_DAPM_INPUT("IN4L"), | 2676 | SND_SOC_DAPM_INPUT("IN4L"), |
2672 | SND_SOC_DAPM_INPUT("IN4R"), | 2677 | SND_SOC_DAPM_INPUT("IN4R"), |
2673 | SND_SOC_DAPM_INPUT("Beep"), | 2678 | SND_SOC_DAPM_SIGGEN("Beep"), |
2674 | SND_SOC_DAPM_INPUT("DMICDAT"), | 2679 | SND_SOC_DAPM_INPUT("DMICDAT"), |
2675 | 2680 | ||
2676 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8962_PWR_MGMT_1, 1, 0, NULL, 0), | 2681 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8962_PWR_MGMT_1, 1, 0, NULL, 0), |
@@ -2684,6 +2689,8 @@ SND_SOC_DAPM_SUPPLY("TOCLK", WM8962_ADDITIONAL_CONTROL_1, 0, 0, NULL, 0), | |||
2684 | SND_SOC_DAPM_SUPPLY_S("DSP2", 1, WM8962_DSP2_POWER_MANAGEMENT, | 2689 | SND_SOC_DAPM_SUPPLY_S("DSP2", 1, WM8962_DSP2_POWER_MANAGEMENT, |
2685 | WM8962_DSP2_ENA_SHIFT, 0, dsp2_event, | 2690 | WM8962_DSP2_ENA_SHIFT, 0, dsp2_event, |
2686 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), | 2691 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
2692 | SND_SOC_DAPM_SUPPLY("TEMP_HP", WM8962_ADDITIONAL_CONTROL_4, 2, 0, NULL, 0), | ||
2693 | SND_SOC_DAPM_SUPPLY("TEMP_SPK", WM8962_ADDITIONAL_CONTROL_4, 1, 0, NULL, 0), | ||
2687 | 2694 | ||
2688 | SND_SOC_DAPM_MIXER("INPGAL", WM8962_LEFT_INPUT_PGA_CONTROL, 4, 0, | 2695 | SND_SOC_DAPM_MIXER("INPGAL", WM8962_LEFT_INPUT_PGA_CONTROL, 4, 0, |
2689 | inpgal, ARRAY_SIZE(inpgal)), | 2696 | inpgal, ARRAY_SIZE(inpgal)), |
@@ -2839,6 +2846,9 @@ static const struct snd_soc_dapm_route wm8962_intercon[] = { | |||
2839 | 2846 | ||
2840 | { "HPOUTL", NULL, "HPOUT" }, | 2847 | { "HPOUTL", NULL, "HPOUT" }, |
2841 | { "HPOUTR", NULL, "HPOUT" }, | 2848 | { "HPOUTR", NULL, "HPOUT" }, |
2849 | |||
2850 | { "HPOUTL", NULL, "TEMP_HP" }, | ||
2851 | { "HPOUTR", NULL, "TEMP_HP" }, | ||
2842 | }; | 2852 | }; |
2843 | 2853 | ||
2844 | static const struct snd_soc_dapm_route wm8962_spk_mono_intercon[] = { | 2854 | static const struct snd_soc_dapm_route wm8962_spk_mono_intercon[] = { |
@@ -2855,6 +2865,7 @@ static const struct snd_soc_dapm_route wm8962_spk_mono_intercon[] = { | |||
2855 | { "Speaker Output", NULL, "Speaker PGA" }, | 2865 | { "Speaker Output", NULL, "Speaker PGA" }, |
2856 | { "Speaker Output", NULL, "SYSCLK" }, | 2866 | { "Speaker Output", NULL, "SYSCLK" }, |
2857 | { "Speaker Output", NULL, "TOCLK" }, | 2867 | { "Speaker Output", NULL, "TOCLK" }, |
2868 | { "Speaker Output", NULL, "TEMP_SPK" }, | ||
2858 | 2869 | ||
2859 | { "SPKOUT", NULL, "Speaker Output" }, | 2870 | { "SPKOUT", NULL, "Speaker Output" }, |
2860 | }; | 2871 | }; |
@@ -2883,10 +2894,12 @@ static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = { | |||
2883 | { "SPKOUTL Output", NULL, "SPKOUTL PGA" }, | 2894 | { "SPKOUTL Output", NULL, "SPKOUTL PGA" }, |
2884 | { "SPKOUTL Output", NULL, "SYSCLK" }, | 2895 | { "SPKOUTL Output", NULL, "SYSCLK" }, |
2885 | { "SPKOUTL Output", NULL, "TOCLK" }, | 2896 | { "SPKOUTL Output", NULL, "TOCLK" }, |
2897 | { "SPKOUTL Output", NULL, "TEMP_SPK" }, | ||
2886 | 2898 | ||
2887 | { "SPKOUTR Output", NULL, "SPKOUTR PGA" }, | 2899 | { "SPKOUTR Output", NULL, "SPKOUTR PGA" }, |
2888 | { "SPKOUTR Output", NULL, "SYSCLK" }, | 2900 | { "SPKOUTR Output", NULL, "SYSCLK" }, |
2889 | { "SPKOUTR Output", NULL, "TOCLK" }, | 2901 | { "SPKOUTR Output", NULL, "TOCLK" }, |
2902 | { "SPKOUTR Output", NULL, "TEMP_SPK" }, | ||
2890 | 2903 | ||
2891 | { "SPKOUTL", NULL, "SPKOUTL Output" }, | 2904 | { "SPKOUTL", NULL, "SPKOUTL Output" }, |
2892 | { "SPKOUTR", NULL, "SPKOUTR Output" }, | 2905 | { "SPKOUTR", NULL, "SPKOUTR Output" }, |
@@ -2931,33 +2944,6 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec) | |||
2931 | return 0; | 2944 | return 0; |
2932 | } | 2945 | } |
2933 | 2946 | ||
2934 | static void wm8962_sync_cache(struct snd_soc_codec *codec) | ||
2935 | { | ||
2936 | u16 *reg_cache = codec->reg_cache; | ||
2937 | int i; | ||
2938 | |||
2939 | if (!codec->cache_sync) | ||
2940 | return; | ||
2941 | |||
2942 | dev_dbg(codec->dev, "Syncing cache\n"); | ||
2943 | |||
2944 | codec->cache_only = 0; | ||
2945 | |||
2946 | /* Sync back cached values if they're different from the | ||
2947 | * hardware default. | ||
2948 | */ | ||
2949 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | ||
2950 | if (i == WM8962_SOFTWARE_RESET) | ||
2951 | continue; | ||
2952 | if (reg_cache[i] == wm8962_reg[i]) | ||
2953 | continue; | ||
2954 | |||
2955 | snd_soc_write(codec, i, reg_cache[i]); | ||
2956 | } | ||
2957 | |||
2958 | codec->cache_sync = 0; | ||
2959 | } | ||
2960 | |||
2961 | /* -1 for reserved values */ | 2947 | /* -1 for reserved values */ |
2962 | static const int bclk_divs[] = { | 2948 | static const int bclk_divs[] = { |
2963 | 1, -1, 2, 3, 4, -1, 6, 8, -1, 12, 16, 24, -1, 32, 32, 32 | 2949 | 1, -1, 2, 3, 4, -1, 6, 8, -1, 12, 16, 24, -1, 32, 32, 32 |
@@ -3085,7 +3071,8 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec, | |||
3085 | return ret; | 3071 | return ret; |
3086 | } | 3072 | } |
3087 | 3073 | ||
3088 | wm8962_sync_cache(codec); | 3074 | regcache_cache_only(wm8962->regmap, false); |
3075 | regcache_sync(wm8962->regmap); | ||
3089 | 3076 | ||
3090 | snd_soc_update_bits(codec, WM8962_ANTI_POP, | 3077 | snd_soc_update_bits(codec, WM8962_ANTI_POP, |
3091 | WM8962_STARTUP_BIAS_ENA | | 3078 | WM8962_STARTUP_BIAS_ENA | |
@@ -3399,6 +3386,7 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
3399 | unsigned long timeout; | 3386 | unsigned long timeout; |
3400 | int ret; | 3387 | int ret; |
3401 | int fll1 = snd_soc_read(codec, WM8962_FLL_CONTROL_1) & WM8962_FLL_ENA; | 3388 | int fll1 = snd_soc_read(codec, WM8962_FLL_CONTROL_1) & WM8962_FLL_ENA; |
3389 | int sysclk = snd_soc_read(codec, WM8962_CLOCKING2) & WM8962_SYSCLK_ENA; | ||
3402 | 3390 | ||
3403 | /* Any change? */ | 3391 | /* Any change? */ |
3404 | if (source == wm8962->fll_src && Fref == wm8962->fll_fref && | 3392 | if (source == wm8962->fll_src && Fref == wm8962->fll_fref && |
@@ -3459,6 +3447,9 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
3459 | 3447 | ||
3460 | try_wait_for_completion(&wm8962->fll_lock); | 3448 | try_wait_for_completion(&wm8962->fll_lock); |
3461 | 3449 | ||
3450 | if (sysclk) | ||
3451 | fll1 |= WM8962_FLL_ENA; | ||
3452 | |||
3462 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, | 3453 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
3463 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | | 3454 | WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK | |
3464 | WM8962_FLL_ENA, fll1); | 3455 | WM8962_FLL_ENA, fll1); |
@@ -3511,7 +3502,7 @@ static int wm8962_mute(struct snd_soc_dai *dai, int mute) | |||
3511 | #define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 3502 | #define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
3512 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 3503 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
3513 | 3504 | ||
3514 | static struct snd_soc_dai_ops wm8962_dai_ops = { | 3505 | static const struct snd_soc_dai_ops wm8962_dai_ops = { |
3515 | .hw_params = wm8962_hw_params, | 3506 | .hw_params = wm8962_hw_params, |
3516 | .set_sysclk = wm8962_set_dai_sysclk, | 3507 | .set_sysclk = wm8962_set_dai_sysclk, |
3517 | .set_fmt = wm8962_set_dai_fmt, | 3508 | .set_fmt = wm8962_set_dai_fmt, |
@@ -3662,6 +3653,14 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) | |||
3662 | snd_soc_jack_report(wm8962->jack, 0, | 3653 | snd_soc_jack_report(wm8962->jack, 0, |
3663 | SND_JACK_MICROPHONE | SND_JACK_BTN_0); | 3654 | SND_JACK_MICROPHONE | SND_JACK_BTN_0); |
3664 | 3655 | ||
3656 | if (jack) { | ||
3657 | snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK"); | ||
3658 | snd_soc_dapm_force_enable_pin(&codec->dapm, "MICBIAS"); | ||
3659 | } else { | ||
3660 | snd_soc_dapm_disable_pin(&codec->dapm, "SYSCLK"); | ||
3661 | snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS"); | ||
3662 | } | ||
3663 | |||
3665 | return 0; | 3664 | return 0; |
3666 | } | 3665 | } |
3667 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); | 3666 | EXPORT_SYMBOL_GPL(wm8962_mic_detect); |
@@ -3879,13 +3878,17 @@ static int wm8962_gpio_direction_out(struct gpio_chip *chip, | |||
3879 | { | 3878 | { |
3880 | struct wm8962_priv *wm8962 = gpio_to_wm8962(chip); | 3879 | struct wm8962_priv *wm8962 = gpio_to_wm8962(chip); |
3881 | struct snd_soc_codec *codec = wm8962->codec; | 3880 | struct snd_soc_codec *codec = wm8962->codec; |
3882 | int val; | 3881 | int ret, val; |
3883 | 3882 | ||
3884 | /* Force function 1 (logic output) */ | 3883 | /* Force function 1 (logic output) */ |
3885 | val = (1 << WM8962_GP2_FN_SHIFT) | (value << WM8962_GP2_LVL_SHIFT); | 3884 | val = (1 << WM8962_GP2_FN_SHIFT) | (value << WM8962_GP2_LVL_SHIFT); |
3886 | 3885 | ||
3887 | return snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset, | 3886 | ret = snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset, |
3888 | WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val); | 3887 | WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val); |
3888 | if (ret < 0) | ||
3889 | return ret; | ||
3890 | |||
3891 | return 0; | ||
3889 | } | 3892 | } |
3890 | 3893 | ||
3891 | static struct gpio_chip wm8962_template_chip = { | 3894 | static struct gpio_chip wm8962_template_chip = { |
@@ -3946,26 +3949,12 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3946 | bool dmicclk, dmicdat; | 3949 | bool dmicclk, dmicdat; |
3947 | 3950 | ||
3948 | wm8962->codec = codec; | 3951 | wm8962->codec = codec; |
3949 | INIT_DELAYED_WORK(&wm8962->mic_work, wm8962_mic_work); | 3952 | codec->control_data = wm8962->regmap; |
3950 | init_completion(&wm8962->fll_lock); | ||
3951 | |||
3952 | codec->cache_sync = 1; | ||
3953 | codec->dapm.idle_bias_off = 1; | ||
3954 | 3953 | ||
3955 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_I2C); | 3954 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); |
3956 | if (ret != 0) { | 3955 | if (ret != 0) { |
3957 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 3956 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
3958 | goto err; | 3957 | return ret; |
3959 | } | ||
3960 | |||
3961 | for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++) | ||
3962 | wm8962->supplies[i].supply = wm8962_supply_names[i]; | ||
3963 | |||
3964 | ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8962->supplies), | ||
3965 | wm8962->supplies); | ||
3966 | if (ret != 0) { | ||
3967 | dev_err(codec->dev, "Failed to request supplies: %d\n", ret); | ||
3968 | goto err; | ||
3969 | } | 3958 | } |
3970 | 3959 | ||
3971 | wm8962->disable_nb[0].notifier_call = wm8962_regulator_event_0; | 3960 | wm8962->disable_nb[0].notifier_call = wm8962_regulator_event_0; |
@@ -3988,43 +3977,6 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3988 | } | 3977 | } |
3989 | } | 3978 | } |
3990 | 3979 | ||
3991 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8962->supplies), | ||
3992 | wm8962->supplies); | ||
3993 | if (ret != 0) { | ||
3994 | dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); | ||
3995 | goto err_get; | ||
3996 | } | ||
3997 | |||
3998 | ret = snd_soc_read(codec, WM8962_SOFTWARE_RESET); | ||
3999 | if (ret < 0) { | ||
4000 | dev_err(codec->dev, "Failed to read ID register\n"); | ||
4001 | goto err_enable; | ||
4002 | } | ||
4003 | if (ret != wm8962_reg[WM8962_SOFTWARE_RESET]) { | ||
4004 | dev_err(codec->dev, "Device is not a WM8962, ID %x != %x\n", | ||
4005 | ret, wm8962_reg[WM8962_SOFTWARE_RESET]); | ||
4006 | ret = -EINVAL; | ||
4007 | goto err_enable; | ||
4008 | } | ||
4009 | |||
4010 | ret = snd_soc_read(codec, WM8962_RIGHT_INPUT_VOLUME); | ||
4011 | if (ret < 0) { | ||
4012 | dev_err(codec->dev, "Failed to read device revision: %d\n", | ||
4013 | ret); | ||
4014 | goto err_enable; | ||
4015 | } | ||
4016 | |||
4017 | dev_info(codec->dev, "customer id %x revision %c\n", | ||
4018 | (ret & WM8962_CUST_ID_MASK) >> WM8962_CUST_ID_SHIFT, | ||
4019 | ((ret & WM8962_CHIP_REV_MASK) >> WM8962_CHIP_REV_SHIFT) | ||
4020 | + 'A'); | ||
4021 | |||
4022 | ret = wm8962_reset(codec); | ||
4023 | if (ret < 0) { | ||
4024 | dev_err(codec->dev, "Failed to issue reset\n"); | ||
4025 | goto err_enable; | ||
4026 | } | ||
4027 | |||
4028 | /* SYSCLK defaults to on; make sure it is off so we can safely | 3980 | /* SYSCLK defaults to on; make sure it is off so we can safely |
4029 | * write to registers if the device is declocked. | 3981 | * write to registers if the device is declocked. |
4030 | */ | 3982 | */ |
@@ -4039,8 +3991,6 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
4039 | WM8962_OSC_ENA | WM8962_PLL2_ENA | WM8962_PLL3_ENA, | 3991 | WM8962_OSC_ENA | WM8962_PLL2_ENA | WM8962_PLL3_ENA, |
4040 | 0); | 3992 | 0); |
4041 | 3993 | ||
4042 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4043 | |||
4044 | if (pdata) { | 3994 | if (pdata) { |
4045 | /* Apply static configuration for GPIOs */ | 3995 | /* Apply static configuration for GPIOs */ |
4046 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_init); i++) | 3996 | for (i = 0; i < ARRAY_SIZE(pdata->gpio_init); i++) |
@@ -4091,6 +4041,12 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
4091 | /* Stereo control for EQ */ | 4041 | /* Stereo control for EQ */ |
4092 | snd_soc_update_bits(codec, WM8962_EQ1, WM8962_EQ_SHARED_COEFF, 0); | 4042 | snd_soc_update_bits(codec, WM8962_EQ1, WM8962_EQ_SHARED_COEFF, 0); |
4093 | 4043 | ||
4044 | /* Don't debouce interrupts so we don't need SYSCLK */ | ||
4045 | snd_soc_update_bits(codec, WM8962_IRQ_DEBOUNCE, | ||
4046 | WM8962_FLL_LOCK_DB | WM8962_PLL3_LOCK_DB | | ||
4047 | WM8962_PLL2_LOCK_DB | WM8962_TEMP_SHUT_DB, | ||
4048 | 0); | ||
4049 | |||
4094 | wm8962_add_widgets(codec); | 4050 | wm8962_add_widgets(codec); |
4095 | 4051 | ||
4096 | /* Save boards having to disable DMIC when not in use */ | 4052 | /* Save boards having to disable DMIC when not in use */ |
@@ -4150,13 +4106,6 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
4150 | } | 4106 | } |
4151 | 4107 | ||
4152 | return 0; | 4108 | return 0; |
4153 | |||
4154 | err_enable: | ||
4155 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4156 | err_get: | ||
4157 | regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4158 | err: | ||
4159 | return ret; | ||
4160 | } | 4109 | } |
4161 | 4110 | ||
4162 | static int wm8962_remove(struct snd_soc_codec *codec) | 4111 | static int wm8962_remove(struct snd_soc_codec *codec) |
@@ -4174,21 +4123,36 @@ static int wm8962_remove(struct snd_soc_codec *codec) | |||
4174 | for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++) | 4123 | for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++) |
4175 | regulator_unregister_notifier(wm8962->supplies[i].consumer, | 4124 | regulator_unregister_notifier(wm8962->supplies[i].consumer, |
4176 | &wm8962->disable_nb[i]); | 4125 | &wm8962->disable_nb[i]); |
4177 | regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4178 | 4126 | ||
4179 | return 0; | 4127 | return 0; |
4180 | } | 4128 | } |
4181 | 4129 | ||
4130 | static int wm8962_soc_volatile(struct snd_soc_codec *codec, | ||
4131 | unsigned int reg) | ||
4132 | { | ||
4133 | return true; | ||
4134 | } | ||
4135 | |||
4136 | |||
4182 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { | 4137 | static struct snd_soc_codec_driver soc_codec_dev_wm8962 = { |
4183 | .probe = wm8962_probe, | 4138 | .probe = wm8962_probe, |
4184 | .remove = wm8962_remove, | 4139 | .remove = wm8962_remove, |
4185 | .set_bias_level = wm8962_set_bias_level, | 4140 | .set_bias_level = wm8962_set_bias_level, |
4186 | .reg_cache_size = WM8962_MAX_REGISTER + 1, | ||
4187 | .reg_word_size = sizeof(u16), | ||
4188 | .reg_cache_default = wm8962_reg, | ||
4189 | .volatile_register = wm8962_volatile_register, | ||
4190 | .readable_register = wm8962_readable_register, | ||
4191 | .set_pll = wm8962_set_fll, | 4141 | .set_pll = wm8962_set_fll, |
4142 | .reg_cache_size = WM8962_MAX_REGISTER, | ||
4143 | .volatile_register = wm8962_soc_volatile, | ||
4144 | }; | ||
4145 | |||
4146 | static const struct regmap_config wm8962_regmap = { | ||
4147 | .reg_bits = 16, | ||
4148 | .val_bits = 16, | ||
4149 | |||
4150 | .max_register = WM8962_MAX_REGISTER, | ||
4151 | .reg_defaults = wm8962_reg, | ||
4152 | .num_reg_defaults = ARRAY_SIZE(wm8962_reg), | ||
4153 | .volatile_reg = wm8962_volatile_register, | ||
4154 | .readable_reg = wm8962_readable_register, | ||
4155 | .cache_type = REGCACHE_RBTREE, | ||
4192 | }; | 4156 | }; |
4193 | 4157 | ||
4194 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 4158 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
@@ -4196,28 +4160,112 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c, | |||
4196 | const struct i2c_device_id *id) | 4160 | const struct i2c_device_id *id) |
4197 | { | 4161 | { |
4198 | struct wm8962_priv *wm8962; | 4162 | struct wm8962_priv *wm8962; |
4199 | int ret; | 4163 | unsigned int reg; |
4164 | int ret, i; | ||
4200 | 4165 | ||
4201 | wm8962 = kzalloc(sizeof(struct wm8962_priv), GFP_KERNEL); | 4166 | wm8962 = devm_kzalloc(&i2c->dev, sizeof(struct wm8962_priv), |
4167 | GFP_KERNEL); | ||
4202 | if (wm8962 == NULL) | 4168 | if (wm8962 == NULL) |
4203 | return -ENOMEM; | 4169 | return -ENOMEM; |
4204 | 4170 | ||
4205 | i2c_set_clientdata(i2c, wm8962); | 4171 | i2c_set_clientdata(i2c, wm8962); |
4206 | 4172 | ||
4173 | INIT_DELAYED_WORK(&wm8962->mic_work, wm8962_mic_work); | ||
4174 | init_completion(&wm8962->fll_lock); | ||
4207 | wm8962->irq = i2c->irq; | 4175 | wm8962->irq = i2c->irq; |
4208 | 4176 | ||
4177 | for (i = 0; i < ARRAY_SIZE(wm8962->supplies); i++) | ||
4178 | wm8962->supplies[i].supply = wm8962_supply_names[i]; | ||
4179 | |||
4180 | ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8962->supplies), | ||
4181 | wm8962->supplies); | ||
4182 | if (ret != 0) { | ||
4183 | dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); | ||
4184 | goto err; | ||
4185 | } | ||
4186 | |||
4187 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8962->supplies), | ||
4188 | wm8962->supplies); | ||
4189 | if (ret != 0) { | ||
4190 | dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); | ||
4191 | goto err_get; | ||
4192 | } | ||
4193 | |||
4194 | wm8962->regmap = regmap_init_i2c(i2c, &wm8962_regmap); | ||
4195 | if (IS_ERR(wm8962->regmap)) { | ||
4196 | ret = PTR_ERR(wm8962->regmap); | ||
4197 | dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); | ||
4198 | goto err_enable; | ||
4199 | } | ||
4200 | |||
4201 | /* | ||
4202 | * We haven't marked the chip revision as volatile due to | ||
4203 | * sharing a register with the right input volume; explicitly | ||
4204 | * bypass the cache to read it. | ||
4205 | */ | ||
4206 | regcache_cache_bypass(wm8962->regmap, true); | ||
4207 | |||
4208 | ret = regmap_read(wm8962->regmap, WM8962_SOFTWARE_RESET, ®); | ||
4209 | if (ret < 0) { | ||
4210 | dev_err(&i2c->dev, "Failed to read ID register\n"); | ||
4211 | goto err_regmap; | ||
4212 | } | ||
4213 | if (reg != 0x6243) { | ||
4214 | dev_err(&i2c->dev, | ||
4215 | "Device is not a WM8962, ID %x != 0x6243\n", ret); | ||
4216 | ret = -EINVAL; | ||
4217 | goto err_regmap; | ||
4218 | } | ||
4219 | |||
4220 | ret = regmap_read(wm8962->regmap, WM8962_RIGHT_INPUT_VOLUME, ®); | ||
4221 | if (ret < 0) { | ||
4222 | dev_err(&i2c->dev, "Failed to read device revision: %d\n", | ||
4223 | ret); | ||
4224 | goto err_regmap; | ||
4225 | } | ||
4226 | |||
4227 | dev_info(&i2c->dev, "customer id %x revision %c\n", | ||
4228 | (reg & WM8962_CUST_ID_MASK) >> WM8962_CUST_ID_SHIFT, | ||
4229 | ((reg & WM8962_CHIP_REV_MASK) >> WM8962_CHIP_REV_SHIFT) | ||
4230 | + 'A'); | ||
4231 | |||
4232 | regcache_cache_bypass(wm8962->regmap, false); | ||
4233 | |||
4234 | ret = wm8962_reset(wm8962); | ||
4235 | if (ret < 0) { | ||
4236 | dev_err(&i2c->dev, "Failed to issue reset\n"); | ||
4237 | goto err_regmap; | ||
4238 | } | ||
4239 | |||
4240 | regcache_cache_only(wm8962->regmap, true); | ||
4241 | |||
4209 | ret = snd_soc_register_codec(&i2c->dev, | 4242 | ret = snd_soc_register_codec(&i2c->dev, |
4210 | &soc_codec_dev_wm8962, &wm8962_dai, 1); | 4243 | &soc_codec_dev_wm8962, &wm8962_dai, 1); |
4211 | if (ret < 0) | 4244 | if (ret < 0) |
4212 | kfree(wm8962); | 4245 | goto err_regmap; |
4246 | |||
4247 | /* The drivers should power up as needed */ | ||
4248 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4249 | |||
4250 | return 0; | ||
4213 | 4251 | ||
4252 | err_regmap: | ||
4253 | regmap_exit(wm8962->regmap); | ||
4254 | err_enable: | ||
4255 | regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4256 | err_get: | ||
4257 | regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4258 | err: | ||
4214 | return ret; | 4259 | return ret; |
4215 | } | 4260 | } |
4216 | 4261 | ||
4217 | static __devexit int wm8962_i2c_remove(struct i2c_client *client) | 4262 | static __devexit int wm8962_i2c_remove(struct i2c_client *client) |
4218 | { | 4263 | { |
4264 | struct wm8962_priv *wm8962 = dev_get_drvdata(&client->dev); | ||
4265 | |||
4219 | snd_soc_unregister_codec(&client->dev); | 4266 | snd_soc_unregister_codec(&client->dev); |
4220 | kfree(i2c_get_clientdata(client)); | 4267 | regmap_exit(wm8962->regmap); |
4268 | regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); | ||
4221 | return 0; | 4269 | return 0; |
4222 | } | 4270 | } |
4223 | 4271 | ||
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index b444b297d0b..4af893601f0 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/pm.h> | 20 | #include <linux/pm.h> |
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
24 | #include <sound/core.h> | 23 | #include <sound/core.h> |
25 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
@@ -224,7 +223,7 @@ static const struct snd_soc_dapm_widget wm8971_dapm_widgets[] = { | |||
224 | SND_SOC_DAPM_DAC("Left DAC", "Left Playback", WM8971_PWR2, 8, 0), | 223 | SND_SOC_DAPM_DAC("Left DAC", "Left Playback", WM8971_PWR2, 8, 0), |
225 | SND_SOC_DAPM_PGA("Mono Out 1", WM8971_PWR2, 2, 0, NULL, 0), | 224 | SND_SOC_DAPM_PGA("Mono Out 1", WM8971_PWR2, 2, 0, NULL, 0), |
226 | 225 | ||
227 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8971_PWR1, 1, 0), | 226 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8971_PWR1, 1, 0, NULL, 0), |
228 | SND_SOC_DAPM_ADC("Right ADC", "Right Capture", WM8971_PWR1, 2, 0), | 227 | SND_SOC_DAPM_ADC("Right ADC", "Right Capture", WM8971_PWR1, 2, 0), |
229 | SND_SOC_DAPM_ADC("Left ADC", "Left Capture", WM8971_PWR1, 3, 0), | 228 | SND_SOC_DAPM_ADC("Left ADC", "Left Capture", WM8971_PWR1, 3, 0), |
230 | 229 | ||
@@ -567,7 +566,7 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec, | |||
567 | #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 566 | #define WM8971_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
568 | SNDRV_PCM_FMTBIT_S24_LE) | 567 | SNDRV_PCM_FMTBIT_S24_LE) |
569 | 568 | ||
570 | static struct snd_soc_dai_ops wm8971_dai_ops = { | 569 | static const struct snd_soc_dai_ops wm8971_dai_ops = { |
571 | .hw_params = wm8971_pcm_hw_params, | 570 | .hw_params = wm8971_pcm_hw_params, |
572 | .digital_mute = wm8971_mute, | 571 | .digital_mute = wm8971_mute, |
573 | .set_fmt = wm8971_set_dai_fmt, | 572 | .set_fmt = wm8971_set_dai_fmt, |
@@ -600,7 +599,7 @@ static void wm8971_work(struct work_struct *work) | |||
600 | wm8971_set_bias_level(codec, codec->dapm.bias_level); | 599 | wm8971_set_bias_level(codec, codec->dapm.bias_level); |
601 | } | 600 | } |
602 | 601 | ||
603 | static int wm8971_suspend(struct snd_soc_codec *codec, pm_message_t state) | 602 | static int wm8971_suspend(struct snd_soc_codec *codec) |
604 | { | 603 | { |
605 | wm8971_set_bias_level(codec, SND_SOC_BIAS_OFF); | 604 | wm8971_set_bias_level(codec, SND_SOC_BIAS_OFF); |
606 | return 0; | 605 | return 0; |
@@ -725,7 +724,7 @@ MODULE_DEVICE_TABLE(i2c, wm8971_i2c_id); | |||
725 | 724 | ||
726 | static struct i2c_driver wm8971_i2c_driver = { | 725 | static struct i2c_driver wm8971_i2c_driver = { |
727 | .driver = { | 726 | .driver = { |
728 | .name = "wm8971-codec", | 727 | .name = "wm8971", |
729 | .owner = THIS_MODULE, | 728 | .owner = THIS_MODULE, |
730 | }, | 729 | }, |
731 | .probe = wm8971_i2c_probe, | 730 | .probe = wm8971_i2c_probe, |
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index 9352f1e088d..4a6a7b5a61b 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -226,7 +225,7 @@ SND_SOC_DAPM_MIXER("Input PGA", WM8974_POWER2, 2, 0, wm8974_inpga, | |||
226 | SND_SOC_DAPM_MIXER("Boost Mixer", WM8974_POWER2, 4, 0, | 225 | SND_SOC_DAPM_MIXER("Boost Mixer", WM8974_POWER2, 4, 0, |
227 | wm8974_boost_mixer, ARRAY_SIZE(wm8974_boost_mixer)), | 226 | wm8974_boost_mixer, ARRAY_SIZE(wm8974_boost_mixer)), |
228 | 227 | ||
229 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8974_POWER1, 4, 0), | 228 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8974_POWER1, 4, 0, NULL, 0), |
230 | 229 | ||
231 | SND_SOC_DAPM_INPUT("MICN"), | 230 | SND_SOC_DAPM_INPUT("MICN"), |
232 | SND_SOC_DAPM_INPUT("MICP"), | 231 | SND_SOC_DAPM_INPUT("MICP"), |
@@ -557,7 +556,7 @@ static int wm8974_set_bias_level(struct snd_soc_codec *codec, | |||
557 | #define WM8974_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 556 | #define WM8974_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
558 | SNDRV_PCM_FMTBIT_S24_LE) | 557 | SNDRV_PCM_FMTBIT_S24_LE) |
559 | 558 | ||
560 | static struct snd_soc_dai_ops wm8974_ops = { | 559 | static const struct snd_soc_dai_ops wm8974_ops = { |
561 | .hw_params = wm8974_pcm_hw_params, | 560 | .hw_params = wm8974_pcm_hw_params, |
562 | .digital_mute = wm8974_mute, | 561 | .digital_mute = wm8974_mute, |
563 | .set_fmt = wm8974_set_dai_fmt, | 562 | .set_fmt = wm8974_set_dai_fmt, |
@@ -583,7 +582,7 @@ static struct snd_soc_dai_driver wm8974_dai = { | |||
583 | .symmetric_rates = 1, | 582 | .symmetric_rates = 1, |
584 | }; | 583 | }; |
585 | 584 | ||
586 | static int wm8974_suspend(struct snd_soc_codec *codec, pm_message_t state) | 585 | static int wm8974_suspend(struct snd_soc_codec *codec) |
587 | { | 586 | { |
588 | wm8974_set_bias_level(codec, SND_SOC_BIAS_OFF); | 587 | wm8974_set_bias_level(codec, SND_SOC_BIAS_OFF); |
589 | return 0; | 588 | return 0; |
@@ -672,7 +671,7 @@ MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id); | |||
672 | 671 | ||
673 | static struct i2c_driver wm8974_i2c_driver = { | 672 | static struct i2c_driver wm8974_i2c_driver = { |
674 | .driver = { | 673 | .driver = { |
675 | .name = "wm8974-codec", | 674 | .name = "wm8974", |
676 | .owner = THIS_MODULE, | 675 | .owner = THIS_MODULE, |
677 | }, | 676 | }, |
678 | .probe = wm8974_i2c_probe, | 677 | .probe = wm8974_i2c_probe, |
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 41ca4d9ac20..85d514d63a4 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -865,7 +864,7 @@ static int wm8978_set_bias_level(struct snd_soc_codec *codec, | |||
865 | #define WM8978_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 864 | #define WM8978_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
866 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 865 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
867 | 866 | ||
868 | static struct snd_soc_dai_ops wm8978_dai_ops = { | 867 | static const struct snd_soc_dai_ops wm8978_dai_ops = { |
869 | .hw_params = wm8978_hw_params, | 868 | .hw_params = wm8978_hw_params, |
870 | .digital_mute = wm8978_mute, | 869 | .digital_mute = wm8978_mute, |
871 | .set_fmt = wm8978_set_dai_fmt, | 870 | .set_fmt = wm8978_set_dai_fmt, |
@@ -893,7 +892,7 @@ static struct snd_soc_dai_driver wm8978_dai = { | |||
893 | .ops = &wm8978_dai_ops, | 892 | .ops = &wm8978_dai_ops, |
894 | }; | 893 | }; |
895 | 894 | ||
896 | static int wm8978_suspend(struct snd_soc_codec *codec, pm_message_t state) | 895 | static int wm8978_suspend(struct snd_soc_codec *codec) |
897 | { | 896 | { |
898 | wm8978_set_bias_level(codec, SND_SOC_BIAS_OFF); | 897 | wm8978_set_bias_level(codec, SND_SOC_BIAS_OFF); |
899 | /* Also switch PLL off */ | 898 | /* Also switch PLL off */ |
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index 93ee28439be..cebde568d19 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c | |||
@@ -481,7 +481,8 @@ static const struct snd_soc_dapm_widget wm8983_dapm_widgets[] = { | |||
481 | SND_SOC_DAPM_PGA("OUT4 Out", WM8983_POWER_MANAGEMENT_3, | 481 | SND_SOC_DAPM_PGA("OUT4 Out", WM8983_POWER_MANAGEMENT_3, |
482 | 8, 0, NULL, 0), | 482 | 8, 0, NULL, 0), |
483 | 483 | ||
484 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8983_POWER_MANAGEMENT_1, 4, 0), | 484 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8983_POWER_MANAGEMENT_1, 4, 0, |
485 | NULL, 0), | ||
485 | 486 | ||
486 | SND_SOC_DAPM_INPUT("LIN"), | 487 | SND_SOC_DAPM_INPUT("LIN"), |
487 | SND_SOC_DAPM_INPUT("LIP"), | 488 | SND_SOC_DAPM_INPUT("LIP"), |
@@ -973,7 +974,7 @@ static int wm8983_set_bias_level(struct snd_soc_codec *codec, | |||
973 | } | 974 | } |
974 | 975 | ||
975 | #ifdef CONFIG_PM | 976 | #ifdef CONFIG_PM |
976 | static int wm8983_suspend(struct snd_soc_codec *codec, pm_message_t state) | 977 | static int wm8983_suspend(struct snd_soc_codec *codec) |
977 | { | 978 | { |
978 | wm8983_set_bias_level(codec, SND_SOC_BIAS_OFF); | 979 | wm8983_set_bias_level(codec, SND_SOC_BIAS_OFF); |
979 | return 0; | 980 | return 0; |
@@ -1034,7 +1035,7 @@ static int wm8983_probe(struct snd_soc_codec *codec) | |||
1034 | return 0; | 1035 | return 0; |
1035 | } | 1036 | } |
1036 | 1037 | ||
1037 | static struct snd_soc_dai_ops wm8983_dai_ops = { | 1038 | static const struct snd_soc_dai_ops wm8983_dai_ops = { |
1038 | .digital_mute = wm8983_dac_mute, | 1039 | .digital_mute = wm8983_dac_mute, |
1039 | .hw_params = wm8983_hw_params, | 1040 | .hw_params = wm8983_hw_params, |
1040 | .set_fmt = wm8983_set_fmt, | 1041 | .set_fmt = wm8983_set_fmt, |
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index bae510acdec..c0c86b3c6ad 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c | |||
@@ -411,7 +411,8 @@ static const struct snd_soc_dapm_widget wm8985_dapm_widgets[] = { | |||
411 | SND_SOC_DAPM_PGA("Right Speaker Out", WM8985_POWER_MANAGEMENT_3, | 411 | SND_SOC_DAPM_PGA("Right Speaker Out", WM8985_POWER_MANAGEMENT_3, |
412 | 6, 0, NULL, 0), | 412 | 6, 0, NULL, 0), |
413 | 413 | ||
414 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8985_POWER_MANAGEMENT_1, 4, 0), | 414 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8985_POWER_MANAGEMENT_1, 4, 0, |
415 | NULL, 0), | ||
415 | 416 | ||
416 | SND_SOC_DAPM_INPUT("LIN"), | 417 | SND_SOC_DAPM_INPUT("LIN"), |
417 | SND_SOC_DAPM_INPUT("LIP"), | 418 | SND_SOC_DAPM_INPUT("LIP"), |
@@ -944,7 +945,7 @@ static int wm8985_set_bias_level(struct snd_soc_codec *codec, | |||
944 | } | 945 | } |
945 | 946 | ||
946 | #ifdef CONFIG_PM | 947 | #ifdef CONFIG_PM |
947 | static int wm8985_suspend(struct snd_soc_codec *codec, pm_message_t state) | 948 | static int wm8985_suspend(struct snd_soc_codec *codec) |
948 | { | 949 | { |
949 | wm8985_set_bias_level(codec, SND_SOC_BIAS_OFF); | 950 | wm8985_set_bias_level(codec, SND_SOC_BIAS_OFF); |
950 | return 0; | 951 | return 0; |
@@ -1030,7 +1031,7 @@ err_reg_get: | |||
1030 | return ret; | 1031 | return ret; |
1031 | } | 1032 | } |
1032 | 1033 | ||
1033 | static struct snd_soc_dai_ops wm8985_dai_ops = { | 1034 | static const struct snd_soc_dai_ops wm8985_dai_ops = { |
1034 | .digital_mute = wm8985_dac_mute, | 1035 | .digital_mute = wm8985_dac_mute, |
1035 | .hw_params = wm8985_hw_params, | 1036 | .hw_params = wm8985_hw_params, |
1036 | .set_fmt = wm8985_set_fmt, | 1037 | .set_fmt = wm8985_set_fmt, |
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index 2e9eba717d1..ab52963dd04 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -267,7 +266,7 @@ static const struct snd_kcontrol_new wm8988_monomux_controls = | |||
267 | SOC_DAPM_ENUM("Route", monomux); | 266 | SOC_DAPM_ENUM("Route", monomux); |
268 | 267 | ||
269 | static const struct snd_soc_dapm_widget wm8988_dapm_widgets[] = { | 268 | static const struct snd_soc_dapm_widget wm8988_dapm_widgets[] = { |
270 | SND_SOC_DAPM_MICBIAS("Mic Bias", WM8988_PWR1, 1, 0), | 269 | SND_SOC_DAPM_SUPPLY("Mic Bias", WM8988_PWR1, 1, 0, NULL, 0), |
271 | 270 | ||
272 | SND_SOC_DAPM_MUX("Differential Mux", SND_SOC_NOPM, 0, 0, | 271 | SND_SOC_DAPM_MUX("Differential Mux", SND_SOC_NOPM, 0, 0, |
273 | &wm8988_diffmux_controls), | 272 | &wm8988_diffmux_controls), |
@@ -701,7 +700,7 @@ static int wm8988_set_bias_level(struct snd_soc_codec *codec, | |||
701 | #define WM8988_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 700 | #define WM8988_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
702 | SNDRV_PCM_FMTBIT_S24_LE) | 701 | SNDRV_PCM_FMTBIT_S24_LE) |
703 | 702 | ||
704 | static struct snd_soc_dai_ops wm8988_ops = { | 703 | static const struct snd_soc_dai_ops wm8988_ops = { |
705 | .startup = wm8988_pcm_startup, | 704 | .startup = wm8988_pcm_startup, |
706 | .hw_params = wm8988_pcm_hw_params, | 705 | .hw_params = wm8988_pcm_hw_params, |
707 | .set_fmt = wm8988_set_dai_fmt, | 706 | .set_fmt = wm8988_set_dai_fmt, |
@@ -729,7 +728,7 @@ static struct snd_soc_dai_driver wm8988_dai = { | |||
729 | .symmetric_rates = 1, | 728 | .symmetric_rates = 1, |
730 | }; | 729 | }; |
731 | 730 | ||
732 | static int wm8988_suspend(struct snd_soc_codec *codec, pm_message_t state) | 731 | static int wm8988_suspend(struct snd_soc_codec *codec) |
733 | { | 732 | { |
734 | wm8988_set_bias_level(codec, SND_SOC_BIAS_OFF); | 733 | wm8988_set_bias_level(codec, SND_SOC_BIAS_OFF); |
735 | return 0; | 734 | return 0; |
@@ -823,7 +822,7 @@ static int __devexit wm8988_spi_remove(struct spi_device *spi) | |||
823 | 822 | ||
824 | static struct spi_driver wm8988_spi_driver = { | 823 | static struct spi_driver wm8988_spi_driver = { |
825 | .driver = { | 824 | .driver = { |
826 | .name = "wm8988-codec", | 825 | .name = "wm8988", |
827 | .owner = THIS_MODULE, | 826 | .owner = THIS_MODULE, |
828 | }, | 827 | }, |
829 | .probe = wm8988_spi_probe, | 828 | .probe = wm8988_spi_probe, |
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index d29a9622964..e538edaae1f 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -776,8 +775,8 @@ SND_SOC_DAPM_PGA("ROPGA", WM8990_POWER_MANAGEMENT_3, WM8990_ROPGA_ENA_BIT, 0, | |||
776 | NULL, 0), | 775 | NULL, 0), |
777 | 776 | ||
778 | /* MICBIAS */ | 777 | /* MICBIAS */ |
779 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8990_POWER_MANAGEMENT_1, | 778 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8990_POWER_MANAGEMENT_1, |
780 | WM8990_MICBIAS_ENA_BIT, 0), | 779 | WM8990_MICBIAS_ENA_BIT, 0, NULL, 0), |
781 | 780 | ||
782 | SND_SOC_DAPM_OUTPUT("LON"), | 781 | SND_SOC_DAPM_OUTPUT("LON"), |
783 | SND_SOC_DAPM_OUTPUT("LOP"), | 782 | SND_SOC_DAPM_OUTPUT("LOP"), |
@@ -1287,7 +1286,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, | |||
1287 | * 1. ADC/DAC on Primary Interface | 1286 | * 1. ADC/DAC on Primary Interface |
1288 | * 2. ADC on Primary Interface/DAC on secondary | 1287 | * 2. ADC on Primary Interface/DAC on secondary |
1289 | */ | 1288 | */ |
1290 | static struct snd_soc_dai_ops wm8990_dai_ops = { | 1289 | static const struct snd_soc_dai_ops wm8990_dai_ops = { |
1291 | .hw_params = wm8990_hw_params, | 1290 | .hw_params = wm8990_hw_params, |
1292 | .digital_mute = wm8990_mute, | 1291 | .digital_mute = wm8990_mute, |
1293 | .set_fmt = wm8990_set_dai_fmt, | 1292 | .set_fmt = wm8990_set_dai_fmt, |
@@ -1314,7 +1313,7 @@ static struct snd_soc_dai_driver wm8990_dai = { | |||
1314 | .ops = &wm8990_dai_ops, | 1313 | .ops = &wm8990_dai_ops, |
1315 | }; | 1314 | }; |
1316 | 1315 | ||
1317 | static int wm8990_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1316 | static int wm8990_suspend(struct snd_soc_codec *codec) |
1318 | { | 1317 | { |
1319 | wm8990_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1318 | wm8990_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1320 | return 0; | 1319 | return 0; |
@@ -1418,7 +1417,7 @@ MODULE_DEVICE_TABLE(i2c, wm8990_i2c_id); | |||
1418 | 1417 | ||
1419 | static struct i2c_driver wm8990_i2c_driver = { | 1418 | static struct i2c_driver wm8990_i2c_driver = { |
1420 | .driver = { | 1419 | .driver = { |
1421 | .name = "wm8990-codec", | 1420 | .name = "wm8990", |
1422 | .owner = THIS_MODULE, | 1421 | .owner = THIS_MODULE, |
1423 | }, | 1422 | }, |
1424 | .probe = wm8990_i2c_probe, | 1423 | .probe = wm8990_i2c_probe, |
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c index c9ab3ba9bce..7ee40da8dbb 100644 --- a/sound/soc/codecs/wm8991.c +++ b/sound/soc/codecs/wm8991.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 22 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -770,8 +769,8 @@ static const struct snd_soc_dapm_widget wm8991_dapm_widgets[] = { | |||
770 | NULL, 0), | 769 | NULL, 0), |
771 | 770 | ||
772 | /* MICBIAS */ | 771 | /* MICBIAS */ |
773 | SND_SOC_DAPM_MICBIAS("MICBIAS", WM8991_POWER_MANAGEMENT_1, | 772 | SND_SOC_DAPM_SUPPLY("MICBIAS", WM8991_POWER_MANAGEMENT_1, |
774 | WM8991_MICBIAS_ENA_BIT, 0), | 773 | WM8991_MICBIAS_ENA_BIT, 0, NULL, 0), |
775 | 774 | ||
776 | SND_SOC_DAPM_OUTPUT("LON"), | 775 | SND_SOC_DAPM_OUTPUT("LON"), |
777 | SND_SOC_DAPM_OUTPUT("LOP"), | 776 | SND_SOC_DAPM_OUTPUT("LOP"), |
@@ -1241,7 +1240,7 @@ static int wm8991_set_bias_level(struct snd_soc_codec *codec, | |||
1241 | return 0; | 1240 | return 0; |
1242 | } | 1241 | } |
1243 | 1242 | ||
1244 | static int wm8991_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1243 | static int wm8991_suspend(struct snd_soc_codec *codec) |
1245 | { | 1244 | { |
1246 | wm8991_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1245 | wm8991_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1247 | return 0; | 1246 | return 0; |
@@ -1311,7 +1310,7 @@ static int wm8991_probe(struct snd_soc_codec *codec) | |||
1311 | #define WM8991_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 1310 | #define WM8991_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1312 | SNDRV_PCM_FMTBIT_S24_LE) | 1311 | SNDRV_PCM_FMTBIT_S24_LE) |
1313 | 1312 | ||
1314 | static struct snd_soc_dai_ops wm8991_ops = { | 1313 | static const struct snd_soc_dai_ops wm8991_ops = { |
1315 | .hw_params = wm8991_hw_params, | 1314 | .hw_params = wm8991_hw_params, |
1316 | .digital_mute = wm8991_mute, | 1315 | .digital_mute = wm8991_mute, |
1317 | .set_fmt = wm8991_set_dai_fmt, | 1316 | .set_fmt = wm8991_set_dai_fmt, |
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index d1a142f48b0..7c7fd925db8 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -444,6 +444,12 @@ static int _wm8993_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
444 | /* Enable the FLL */ | 444 | /* Enable the FLL */ |
445 | snd_soc_write(codec, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); | 445 | snd_soc_write(codec, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); |
446 | 446 | ||
447 | /* Both overestimates */ | ||
448 | if (Fref < 1000000) | ||
449 | msleep(3); | ||
450 | else | ||
451 | msleep(1); | ||
452 | |||
447 | dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); | 453 | dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); |
448 | 454 | ||
449 | wm8993->fll_fref = Fref; | 455 | wm8993->fll_fref = Fref; |
@@ -934,28 +940,6 @@ static const struct snd_soc_dapm_route routes[] = { | |||
934 | { "Right Headphone Mux", "DAC", "DACR" }, | 940 | { "Right Headphone Mux", "DAC", "DACR" }, |
935 | }; | 941 | }; |
936 | 942 | ||
937 | static void wm8993_cache_restore(struct snd_soc_codec *codec) | ||
938 | { | ||
939 | u16 *cache = codec->reg_cache; | ||
940 | int i; | ||
941 | |||
942 | if (!codec->cache_sync) | ||
943 | return; | ||
944 | |||
945 | /* Reenable hardware writes */ | ||
946 | codec->cache_only = 0; | ||
947 | |||
948 | /* Restore the register settings */ | ||
949 | for (i = 1; i < WM8993_MAX_REGISTER; i++) { | ||
950 | if (cache[i] == wm8993_reg_defaults[i]) | ||
951 | continue; | ||
952 | snd_soc_write(codec, i, cache[i]); | ||
953 | } | ||
954 | |||
955 | /* We're in sync again */ | ||
956 | codec->cache_sync = 0; | ||
957 | } | ||
958 | |||
959 | static int wm8993_set_bias_level(struct snd_soc_codec *codec, | 943 | static int wm8993_set_bias_level(struct snd_soc_codec *codec, |
960 | enum snd_soc_bias_level level) | 944 | enum snd_soc_bias_level level) |
961 | { | 945 | { |
@@ -979,7 +963,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec, | |||
979 | if (ret != 0) | 963 | if (ret != 0) |
980 | return ret; | 964 | return ret; |
981 | 965 | ||
982 | wm8993_cache_restore(codec); | 966 | snd_soc_cache_sync(codec); |
983 | 967 | ||
984 | /* Tune DC servo configuration */ | 968 | /* Tune DC servo configuration */ |
985 | snd_soc_write(codec, 0x44, 3); | 969 | snd_soc_write(codec, 0x44, 3); |
@@ -1394,7 +1378,7 @@ out: | |||
1394 | return 0; | 1378 | return 0; |
1395 | } | 1379 | } |
1396 | 1380 | ||
1397 | static struct snd_soc_dai_ops wm8993_ops = { | 1381 | static const struct snd_soc_dai_ops wm8993_ops = { |
1398 | .set_sysclk = wm8993_set_sysclk, | 1382 | .set_sysclk = wm8993_set_sysclk, |
1399 | .set_fmt = wm8993_set_dai_fmt, | 1383 | .set_fmt = wm8993_set_dai_fmt, |
1400 | .hw_params = wm8993_hw_params, | 1384 | .hw_params = wm8993_hw_params, |
@@ -1544,7 +1528,7 @@ static int wm8993_remove(struct snd_soc_codec *codec) | |||
1544 | } | 1528 | } |
1545 | 1529 | ||
1546 | #ifdef CONFIG_PM | 1530 | #ifdef CONFIG_PM |
1547 | static int wm8993_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1531 | static int wm8993_suspend(struct snd_soc_codec *codec) |
1548 | { | 1532 | { |
1549 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); | 1533 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); |
1550 | int fll_fout = wm8993->fll_fout; | 1534 | int fll_fout = wm8993->fll_fout; |
@@ -1613,7 +1597,8 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c, | |||
1613 | struct wm8993_priv *wm8993; | 1597 | struct wm8993_priv *wm8993; |
1614 | int ret; | 1598 | int ret; |
1615 | 1599 | ||
1616 | wm8993 = kzalloc(sizeof(struct wm8993_priv), GFP_KERNEL); | 1600 | wm8993 = devm_kzalloc(&i2c->dev, sizeof(struct wm8993_priv), |
1601 | GFP_KERNEL); | ||
1617 | if (wm8993 == NULL) | 1602 | if (wm8993 == NULL) |
1618 | return -ENOMEM; | 1603 | return -ENOMEM; |
1619 | 1604 | ||
@@ -1621,8 +1606,6 @@ static __devinit int wm8993_i2c_probe(struct i2c_client *i2c, | |||
1621 | 1606 | ||
1622 | ret = snd_soc_register_codec(&i2c->dev, | 1607 | ret = snd_soc_register_codec(&i2c->dev, |
1623 | &soc_codec_dev_wm8993, &wm8993_dai, 1); | 1608 | &soc_codec_dev_wm8993, &wm8993_dai, 1); |
1624 | if (ret < 0) | ||
1625 | kfree(wm8993); | ||
1626 | return ret; | 1609 | return ret; |
1627 | } | 1610 | } |
1628 | 1611 | ||
@@ -1641,7 +1624,7 @@ MODULE_DEVICE_TABLE(i2c, wm8993_i2c_id); | |||
1641 | 1624 | ||
1642 | static struct i2c_driver wm8993_i2c_driver = { | 1625 | static struct i2c_driver wm8993_i2c_driver = { |
1643 | .driver = { | 1626 | .driver = { |
1644 | .name = "wm8993-codec", | 1627 | .name = "wm8993", |
1645 | .owner = THIS_MODULE, | 1628 | .owner = THIS_MODULE, |
1646 | }, | 1629 | }, |
1647 | .probe = wm8993_i2c_probe, | 1630 | .probe = wm8993_i2c_probe, |
diff --git a/sound/soc/codecs/wm8994-tables.c b/sound/soc/codecs/wm8994-tables.c deleted file mode 100644 index df5a8b9a250..00000000000 --- a/sound/soc/codecs/wm8994-tables.c +++ /dev/null | |||
@@ -1,3147 +0,0 @@ | |||
1 | #include "wm8994.h" | ||
2 | |||
3 | const struct wm8994_access_mask wm8994_access_masks[WM8994_CACHE_SIZE] = { | ||
4 | { 0xFFFF, 0xFFFF }, /* R0 - Software Reset */ | ||
5 | { 0x3B37, 0x3B37 }, /* R1 - Power Management (1) */ | ||
6 | { 0x6BF0, 0x6BF0 }, /* R2 - Power Management (2) */ | ||
7 | { 0x3FF0, 0x3FF0 }, /* R3 - Power Management (3) */ | ||
8 | { 0x3F3F, 0x3F3F }, /* R4 - Power Management (4) */ | ||
9 | { 0x3F0F, 0x3F0F }, /* R5 - Power Management (5) */ | ||
10 | { 0x003F, 0x003F }, /* R6 - Power Management (6) */ | ||
11 | { 0x0000, 0x0000 }, /* R7 */ | ||
12 | { 0x0000, 0x0000 }, /* R8 */ | ||
13 | { 0x0000, 0x0000 }, /* R9 */ | ||
14 | { 0x0000, 0x0000 }, /* R10 */ | ||
15 | { 0x0000, 0x0000 }, /* R11 */ | ||
16 | { 0x0000, 0x0000 }, /* R12 */ | ||
17 | { 0x0000, 0x0000 }, /* R13 */ | ||
18 | { 0x0000, 0x0000 }, /* R14 */ | ||
19 | { 0x0000, 0x0000 }, /* R15 */ | ||
20 | { 0x0000, 0x0000 }, /* R16 */ | ||
21 | { 0x0000, 0x0000 }, /* R17 */ | ||
22 | { 0x0000, 0x0000 }, /* R18 */ | ||
23 | { 0x0000, 0x0000 }, /* R19 */ | ||
24 | { 0x0000, 0x0000 }, /* R20 */ | ||
25 | { 0x01C0, 0x01C0 }, /* R21 - Input Mixer (1) */ | ||
26 | { 0x0000, 0x0000 }, /* R22 */ | ||
27 | { 0x0000, 0x0000 }, /* R23 */ | ||
28 | { 0x00DF, 0x01DF }, /* R24 - Left Line Input 1&2 Volume */ | ||
29 | { 0x00DF, 0x01DF }, /* R25 - Left Line Input 3&4 Volume */ | ||
30 | { 0x00DF, 0x01DF }, /* R26 - Right Line Input 1&2 Volume */ | ||
31 | { 0x00DF, 0x01DF }, /* R27 - Right Line Input 3&4 Volume */ | ||
32 | { 0x00FF, 0x01FF }, /* R28 - Left Output Volume */ | ||
33 | { 0x00FF, 0x01FF }, /* R29 - Right Output Volume */ | ||
34 | { 0x0077, 0x0077 }, /* R30 - Line Outputs Volume */ | ||
35 | { 0x0030, 0x0030 }, /* R31 - HPOUT2 Volume */ | ||
36 | { 0x00FF, 0x01FF }, /* R32 - Left OPGA Volume */ | ||
37 | { 0x00FF, 0x01FF }, /* R33 - Right OPGA Volume */ | ||
38 | { 0x007F, 0x007F }, /* R34 - SPKMIXL Attenuation */ | ||
39 | { 0x017F, 0x017F }, /* R35 - SPKMIXR Attenuation */ | ||
40 | { 0x003F, 0x003F }, /* R36 - SPKOUT Mixers */ | ||
41 | { 0x003F, 0x003F }, /* R37 - ClassD */ | ||
42 | { 0x00FF, 0x01FF }, /* R38 - Speaker Volume Left */ | ||
43 | { 0x00FF, 0x01FF }, /* R39 - Speaker Volume Right */ | ||
44 | { 0x00FF, 0x00FF }, /* R40 - Input Mixer (2) */ | ||
45 | { 0x01B7, 0x01B7 }, /* R41 - Input Mixer (3) */ | ||
46 | { 0x01B7, 0x01B7 }, /* R42 - Input Mixer (4) */ | ||
47 | { 0x01C7, 0x01C7 }, /* R43 - Input Mixer (5) */ | ||
48 | { 0x01C7, 0x01C7 }, /* R44 - Input Mixer (6) */ | ||
49 | { 0x01FF, 0x01FF }, /* R45 - Output Mixer (1) */ | ||
50 | { 0x01FF, 0x01FF }, /* R46 - Output Mixer (2) */ | ||
51 | { 0x0FFF, 0x0FFF }, /* R47 - Output Mixer (3) */ | ||
52 | { 0x0FFF, 0x0FFF }, /* R48 - Output Mixer (4) */ | ||
53 | { 0x0FFF, 0x0FFF }, /* R49 - Output Mixer (5) */ | ||
54 | { 0x0FFF, 0x0FFF }, /* R50 - Output Mixer (6) */ | ||
55 | { 0x0038, 0x0038 }, /* R51 - HPOUT2 Mixer */ | ||
56 | { 0x0077, 0x0077 }, /* R52 - Line Mixer (1) */ | ||
57 | { 0x0077, 0x0077 }, /* R53 - Line Mixer (2) */ | ||
58 | { 0x03FF, 0x03FF }, /* R54 - Speaker Mixer */ | ||
59 | { 0x00C1, 0x00C1 }, /* R55 - Additional Control */ | ||
60 | { 0x00F0, 0x00F0 }, /* R56 - AntiPOP (1) */ | ||
61 | { 0x01EF, 0x01EF }, /* R57 - AntiPOP (2) */ | ||
62 | { 0x00FF, 0x00FF }, /* R58 - MICBIAS */ | ||
63 | { 0x000F, 0x000F }, /* R59 - LDO 1 */ | ||
64 | { 0x0007, 0x0007 }, /* R60 - LDO 2 */ | ||
65 | { 0xFFFF, 0xFFFF }, /* R61 */ | ||
66 | { 0xFFFF, 0xFFFF }, /* R62 */ | ||
67 | { 0x0000, 0x0000 }, /* R63 */ | ||
68 | { 0x0000, 0x0000 }, /* R64 */ | ||
69 | { 0x0000, 0x0000 }, /* R65 */ | ||
70 | { 0x0000, 0x0000 }, /* R66 */ | ||
71 | { 0x0000, 0x0000 }, /* R67 */ | ||
72 | { 0x0000, 0x0000 }, /* R68 */ | ||
73 | { 0x0000, 0x0000 }, /* R69 */ | ||
74 | { 0x0000, 0x0000 }, /* R70 */ | ||
75 | { 0x0000, 0x0000 }, /* R71 */ | ||
76 | { 0x0000, 0x0000 }, /* R72 */ | ||
77 | { 0x0000, 0x0000 }, /* R73 */ | ||
78 | { 0x0000, 0x0000 }, /* R74 */ | ||
79 | { 0x0000, 0x0000 }, /* R75 */ | ||
80 | { 0x8000, 0x8000 }, /* R76 - Charge Pump (1) */ | ||
81 | { 0x0000, 0x0000 }, /* R77 */ | ||
82 | { 0x0000, 0x0000 }, /* R78 */ | ||
83 | { 0x0000, 0x0000 }, /* R79 */ | ||
84 | { 0x0000, 0x0000 }, /* R80 */ | ||
85 | { 0x0301, 0x0301 }, /* R81 - Class W (1) */ | ||
86 | { 0x0000, 0x0000 }, /* R82 */ | ||
87 | { 0x0000, 0x0000 }, /* R83 */ | ||
88 | { 0x333F, 0x333F }, /* R84 - DC Servo (1) */ | ||
89 | { 0x0FEF, 0x0FEF }, /* R85 - DC Servo (2) */ | ||
90 | { 0x0000, 0x0000 }, /* R86 */ | ||
91 | { 0xFFFF, 0xFFFF }, /* R87 - DC Servo (4) */ | ||
92 | { 0x0333, 0x0000 }, /* R88 - DC Servo Readback */ | ||
93 | { 0x0000, 0x0000 }, /* R89 */ | ||
94 | { 0x0000, 0x0000 }, /* R90 */ | ||
95 | { 0x0000, 0x0000 }, /* R91 */ | ||
96 | { 0x0000, 0x0000 }, /* R92 */ | ||
97 | { 0x0000, 0x0000 }, /* R93 */ | ||
98 | { 0x0000, 0x0000 }, /* R94 */ | ||
99 | { 0x0000, 0x0000 }, /* R95 */ | ||
100 | { 0x00EE, 0x00EE }, /* R96 - Analogue HP (1) */ | ||
101 | { 0x0000, 0x0000 }, /* R97 */ | ||
102 | { 0x0000, 0x0000 }, /* R98 */ | ||
103 | { 0x0000, 0x0000 }, /* R99 */ | ||
104 | { 0x0000, 0x0000 }, /* R100 */ | ||
105 | { 0x0000, 0x0000 }, /* R101 */ | ||
106 | { 0x0000, 0x0000 }, /* R102 */ | ||
107 | { 0x0000, 0x0000 }, /* R103 */ | ||
108 | { 0x0000, 0x0000 }, /* R104 */ | ||
109 | { 0x0000, 0x0000 }, /* R105 */ | ||
110 | { 0x0000, 0x0000 }, /* R106 */ | ||
111 | { 0x0000, 0x0000 }, /* R107 */ | ||
112 | { 0x0000, 0x0000 }, /* R108 */ | ||
113 | { 0x0000, 0x0000 }, /* R109 */ | ||
114 | { 0x0000, 0x0000 }, /* R110 */ | ||
115 | { 0x0000, 0x0000 }, /* R111 */ | ||
116 | { 0x0000, 0x0000 }, /* R112 */ | ||
117 | { 0x0000, 0x0000 }, /* R113 */ | ||
118 | { 0x0000, 0x0000 }, /* R114 */ | ||
119 | { 0x0000, 0x0000 }, /* R115 */ | ||
120 | { 0x0000, 0x0000 }, /* R116 */ | ||
121 | { 0x0000, 0x0000 }, /* R117 */ | ||
122 | { 0x0000, 0x0000 }, /* R118 */ | ||
123 | { 0x0000, 0x0000 }, /* R119 */ | ||
124 | { 0x0000, 0x0000 }, /* R120 */ | ||
125 | { 0x0000, 0x0000 }, /* R121 */ | ||
126 | { 0x0000, 0x0000 }, /* R122 */ | ||
127 | { 0x0000, 0x0000 }, /* R123 */ | ||
128 | { 0x0000, 0x0000 }, /* R124 */ | ||
129 | { 0x0000, 0x0000 }, /* R125 */ | ||
130 | { 0x0000, 0x0000 }, /* R126 */ | ||
131 | { 0x0000, 0x0000 }, /* R127 */ | ||
132 | { 0x0000, 0x0000 }, /* R128 */ | ||
133 | { 0x0000, 0x0000 }, /* R129 */ | ||
134 | { 0x0000, 0x0000 }, /* R130 */ | ||
135 | { 0x0000, 0x0000 }, /* R131 */ | ||
136 | { 0x0000, 0x0000 }, /* R132 */ | ||
137 | { 0x0000, 0x0000 }, /* R133 */ | ||
138 | { 0x0000, 0x0000 }, /* R134 */ | ||
139 | { 0x0000, 0x0000 }, /* R135 */ | ||
140 | { 0x0000, 0x0000 }, /* R136 */ | ||
141 | { 0x0000, 0x0000 }, /* R137 */ | ||
142 | { 0x0000, 0x0000 }, /* R138 */ | ||
143 | { 0x0000, 0x0000 }, /* R139 */ | ||
144 | { 0x0000, 0x0000 }, /* R140 */ | ||
145 | { 0x0000, 0x0000 }, /* R141 */ | ||
146 | { 0x0000, 0x0000 }, /* R142 */ | ||
147 | { 0x0000, 0x0000 }, /* R143 */ | ||
148 | { 0x0000, 0x0000 }, /* R144 */ | ||
149 | { 0x0000, 0x0000 }, /* R145 */ | ||
150 | { 0x0000, 0x0000 }, /* R146 */ | ||
151 | { 0x0000, 0x0000 }, /* R147 */ | ||
152 | { 0x0000, 0x0000 }, /* R148 */ | ||
153 | { 0x0000, 0x0000 }, /* R149 */ | ||
154 | { 0x0000, 0x0000 }, /* R150 */ | ||
155 | { 0x0000, 0x0000 }, /* R151 */ | ||
156 | { 0x0000, 0x0000 }, /* R152 */ | ||
157 | { 0x0000, 0x0000 }, /* R153 */ | ||
158 | { 0x0000, 0x0000 }, /* R154 */ | ||
159 | { 0x0000, 0x0000 }, /* R155 */ | ||
160 | { 0x0000, 0x0000 }, /* R156 */ | ||
161 | { 0x0000, 0x0000 }, /* R157 */ | ||
162 | { 0x0000, 0x0000 }, /* R158 */ | ||
163 | { 0x0000, 0x0000 }, /* R159 */ | ||
164 | { 0x0000, 0x0000 }, /* R160 */ | ||
165 | { 0x0000, 0x0000 }, /* R161 */ | ||
166 | { 0x0000, 0x0000 }, /* R162 */ | ||
167 | { 0x0000, 0x0000 }, /* R163 */ | ||
168 | { 0x0000, 0x0000 }, /* R164 */ | ||
169 | { 0x0000, 0x0000 }, /* R165 */ | ||
170 | { 0x0000, 0x0000 }, /* R166 */ | ||
171 | { 0x0000, 0x0000 }, /* R167 */ | ||
172 | { 0x0000, 0x0000 }, /* R168 */ | ||
173 | { 0x0000, 0x0000 }, /* R169 */ | ||
174 | { 0x0000, 0x0000 }, /* R170 */ | ||
175 | { 0x0000, 0x0000 }, /* R171 */ | ||
176 | { 0x0000, 0x0000 }, /* R172 */ | ||
177 | { 0x0000, 0x0000 }, /* R173 */ | ||
178 | { 0x0000, 0x0000 }, /* R174 */ | ||
179 | { 0x0000, 0x0000 }, /* R175 */ | ||
180 | { 0x0000, 0x0000 }, /* R176 */ | ||
181 | { 0x0000, 0x0000 }, /* R177 */ | ||
182 | { 0x0000, 0x0000 }, /* R178 */ | ||
183 | { 0x0000, 0x0000 }, /* R179 */ | ||
184 | { 0x0000, 0x0000 }, /* R180 */ | ||
185 | { 0x0000, 0x0000 }, /* R181 */ | ||
186 | { 0x0000, 0x0000 }, /* R182 */ | ||
187 | { 0x0000, 0x0000 }, /* R183 */ | ||
188 | { 0x0000, 0x0000 }, /* R184 */ | ||
189 | { 0x0000, 0x0000 }, /* R185 */ | ||
190 | { 0x0000, 0x0000 }, /* R186 */ | ||
191 | { 0x0000, 0x0000 }, /* R187 */ | ||
192 | { 0x0000, 0x0000 }, /* R188 */ | ||
193 | { 0x0000, 0x0000 }, /* R189 */ | ||
194 | { 0x0000, 0x0000 }, /* R190 */ | ||
195 | { 0x0000, 0x0000 }, /* R191 */ | ||
196 | { 0x0000, 0x0000 }, /* R192 */ | ||
197 | { 0x0000, 0x0000 }, /* R193 */ | ||
198 | { 0x0000, 0x0000 }, /* R194 */ | ||
199 | { 0x0000, 0x0000 }, /* R195 */ | ||
200 | { 0x0000, 0x0000 }, /* R196 */ | ||
201 | { 0x0000, 0x0000 }, /* R197 */ | ||
202 | { 0x0000, 0x0000 }, /* R198 */ | ||
203 | { 0x0000, 0x0000 }, /* R199 */ | ||
204 | { 0x0000, 0x0000 }, /* R200 */ | ||
205 | { 0x0000, 0x0000 }, /* R201 */ | ||
206 | { 0x0000, 0x0000 }, /* R202 */ | ||
207 | { 0x0000, 0x0000 }, /* R203 */ | ||
208 | { 0x0000, 0x0000 }, /* R204 */ | ||
209 | { 0x0000, 0x0000 }, /* R205 */ | ||
210 | { 0x0000, 0x0000 }, /* R206 */ | ||
211 | { 0x0000, 0x0000 }, /* R207 */ | ||
212 | { 0xFFFF, 0xFFFF }, /* R208 */ | ||
213 | { 0xFFFF, 0xFFFF }, /* R209 */ | ||
214 | { 0xFFFF, 0xFFFF }, /* R210 */ | ||
215 | { 0x0000, 0x0000 }, /* R211 */ | ||
216 | { 0x0000, 0x0000 }, /* R212 */ | ||
217 | { 0x0000, 0x0000 }, /* R213 */ | ||
218 | { 0x0000, 0x0000 }, /* R214 */ | ||
219 | { 0x0000, 0x0000 }, /* R215 */ | ||
220 | { 0x0000, 0x0000 }, /* R216 */ | ||
221 | { 0x0000, 0x0000 }, /* R217 */ | ||
222 | { 0x0000, 0x0000 }, /* R218 */ | ||
223 | { 0x0000, 0x0000 }, /* R219 */ | ||
224 | { 0x0000, 0x0000 }, /* R220 */ | ||
225 | { 0x0000, 0x0000 }, /* R221 */ | ||
226 | { 0x0000, 0x0000 }, /* R222 */ | ||
227 | { 0x0000, 0x0000 }, /* R223 */ | ||
228 | { 0x0000, 0x0000 }, /* R224 */ | ||
229 | { 0x0000, 0x0000 }, /* R225 */ | ||
230 | { 0x0000, 0x0000 }, /* R226 */ | ||
231 | { 0x0000, 0x0000 }, /* R227 */ | ||
232 | { 0x0000, 0x0000 }, /* R228 */ | ||
233 | { 0x0000, 0x0000 }, /* R229 */ | ||
234 | { 0x0000, 0x0000 }, /* R230 */ | ||
235 | { 0x0000, 0x0000 }, /* R231 */ | ||
236 | { 0x0000, 0x0000 }, /* R232 */ | ||
237 | { 0x0000, 0x0000 }, /* R233 */ | ||
238 | { 0x0000, 0x0000 }, /* R234 */ | ||
239 | { 0x0000, 0x0000 }, /* R235 */ | ||
240 | { 0x0000, 0x0000 }, /* R236 */ | ||
241 | { 0x0000, 0x0000 }, /* R237 */ | ||
242 | { 0x0000, 0x0000 }, /* R238 */ | ||
243 | { 0x0000, 0x0000 }, /* R239 */ | ||
244 | { 0x0000, 0x0000 }, /* R240 */ | ||
245 | { 0x0000, 0x0000 }, /* R241 */ | ||
246 | { 0x0000, 0x0000 }, /* R242 */ | ||
247 | { 0x0000, 0x0000 }, /* R243 */ | ||
248 | { 0x0000, 0x0000 }, /* R244 */ | ||
249 | { 0x0000, 0x0000 }, /* R245 */ | ||
250 | { 0x0000, 0x0000 }, /* R246 */ | ||
251 | { 0x0000, 0x0000 }, /* R247 */ | ||
252 | { 0x0000, 0x0000 }, /* R248 */ | ||
253 | { 0x0000, 0x0000 }, /* R249 */ | ||
254 | { 0x0000, 0x0000 }, /* R250 */ | ||
255 | { 0x0000, 0x0000 }, /* R251 */ | ||
256 | { 0x0000, 0x0000 }, /* R252 */ | ||
257 | { 0x0000, 0x0000 }, /* R253 */ | ||
258 | { 0x0000, 0x0000 }, /* R254 */ | ||
259 | { 0x0000, 0x0000 }, /* R255 */ | ||
260 | { 0x000F, 0x0000 }, /* R256 - Chip Revision */ | ||
261 | { 0x0074, 0x0074 }, /* R257 - Control Interface */ | ||
262 | { 0x0000, 0x0000 }, /* R258 */ | ||
263 | { 0x0000, 0x0000 }, /* R259 */ | ||
264 | { 0x0000, 0x0000 }, /* R260 */ | ||
265 | { 0x0000, 0x0000 }, /* R261 */ | ||
266 | { 0x0000, 0x0000 }, /* R262 */ | ||
267 | { 0x0000, 0x0000 }, /* R263 */ | ||
268 | { 0x0000, 0x0000 }, /* R264 */ | ||
269 | { 0x0000, 0x0000 }, /* R265 */ | ||
270 | { 0x0000, 0x0000 }, /* R266 */ | ||
271 | { 0x0000, 0x0000 }, /* R267 */ | ||
272 | { 0x0000, 0x0000 }, /* R268 */ | ||
273 | { 0x0000, 0x0000 }, /* R269 */ | ||
274 | { 0x0000, 0x0000 }, /* R270 */ | ||
275 | { 0x0000, 0x0000 }, /* R271 */ | ||
276 | { 0x807F, 0x837F }, /* R272 - Write Sequencer Ctrl (1) */ | ||
277 | { 0x017F, 0x0000 }, /* R273 - Write Sequencer Ctrl (2) */ | ||
278 | { 0x0000, 0x0000 }, /* R274 */ | ||
279 | { 0x0000, 0x0000 }, /* R275 */ | ||
280 | { 0x0000, 0x0000 }, /* R276 */ | ||
281 | { 0x0000, 0x0000 }, /* R277 */ | ||
282 | { 0x0000, 0x0000 }, /* R278 */ | ||
283 | { 0x0000, 0x0000 }, /* R279 */ | ||
284 | { 0x0000, 0x0000 }, /* R280 */ | ||
285 | { 0x0000, 0x0000 }, /* R281 */ | ||
286 | { 0x0000, 0x0000 }, /* R282 */ | ||
287 | { 0x0000, 0x0000 }, /* R283 */ | ||
288 | { 0x0000, 0x0000 }, /* R284 */ | ||
289 | { 0x0000, 0x0000 }, /* R285 */ | ||
290 | { 0x0000, 0x0000 }, /* R286 */ | ||
291 | { 0x0000, 0x0000 }, /* R287 */ | ||
292 | { 0x0000, 0x0000 }, /* R288 */ | ||
293 | { 0x0000, 0x0000 }, /* R289 */ | ||
294 | { 0x0000, 0x0000 }, /* R290 */ | ||
295 | { 0x0000, 0x0000 }, /* R291 */ | ||
296 | { 0x0000, 0x0000 }, /* R292 */ | ||
297 | { 0x0000, 0x0000 }, /* R293 */ | ||
298 | { 0x0000, 0x0000 }, /* R294 */ | ||
299 | { 0x0000, 0x0000 }, /* R295 */ | ||
300 | { 0x0000, 0x0000 }, /* R296 */ | ||
301 | { 0x0000, 0x0000 }, /* R297 */ | ||
302 | { 0x0000, 0x0000 }, /* R298 */ | ||
303 | { 0x0000, 0x0000 }, /* R299 */ | ||
304 | { 0x0000, 0x0000 }, /* R300 */ | ||
305 | { 0x0000, 0x0000 }, /* R301 */ | ||
306 | { 0x0000, 0x0000 }, /* R302 */ | ||
307 | { 0x0000, 0x0000 }, /* R303 */ | ||
308 | { 0x0000, 0x0000 }, /* R304 */ | ||
309 | { 0x0000, 0x0000 }, /* R305 */ | ||
310 | { 0x0000, 0x0000 }, /* R306 */ | ||
311 | { 0x0000, 0x0000 }, /* R307 */ | ||
312 | { 0x0000, 0x0000 }, /* R308 */ | ||
313 | { 0x0000, 0x0000 }, /* R309 */ | ||
314 | { 0x0000, 0x0000 }, /* R310 */ | ||
315 | { 0x0000, 0x0000 }, /* R311 */ | ||
316 | { 0x0000, 0x0000 }, /* R312 */ | ||
317 | { 0x0000, 0x0000 }, /* R313 */ | ||
318 | { 0x0000, 0x0000 }, /* R314 */ | ||
319 | { 0x0000, 0x0000 }, /* R315 */ | ||
320 | { 0x0000, 0x0000 }, /* R316 */ | ||
321 | { 0x0000, 0x0000 }, /* R317 */ | ||
322 | { 0x0000, 0x0000 }, /* R318 */ | ||
323 | { 0x0000, 0x0000 }, /* R319 */ | ||
324 | { 0x0000, 0x0000 }, /* R320 */ | ||
325 | { 0x0000, 0x0000 }, /* R321 */ | ||
326 | { 0x0000, 0x0000 }, /* R322 */ | ||
327 | { 0x0000, 0x0000 }, /* R323 */ | ||
328 | { 0x0000, 0x0000 }, /* R324 */ | ||
329 | { 0x0000, 0x0000 }, /* R325 */ | ||
330 | { 0x0000, 0x0000 }, /* R326 */ | ||
331 | { 0x0000, 0x0000 }, /* R327 */ | ||
332 | { 0x0000, 0x0000 }, /* R328 */ | ||
333 | { 0x0000, 0x0000 }, /* R329 */ | ||
334 | { 0x0000, 0x0000 }, /* R330 */ | ||
335 | { 0x0000, 0x0000 }, /* R331 */ | ||
336 | { 0x0000, 0x0000 }, /* R332 */ | ||
337 | { 0x0000, 0x0000 }, /* R333 */ | ||
338 | { 0x0000, 0x0000 }, /* R334 */ | ||
339 | { 0x0000, 0x0000 }, /* R335 */ | ||
340 | { 0x0000, 0x0000 }, /* R336 */ | ||
341 | { 0x0000, 0x0000 }, /* R337 */ | ||
342 | { 0x0000, 0x0000 }, /* R338 */ | ||
343 | { 0x0000, 0x0000 }, /* R339 */ | ||
344 | { 0x0000, 0x0000 }, /* R340 */ | ||
345 | { 0x0000, 0x0000 }, /* R341 */ | ||
346 | { 0x0000, 0x0000 }, /* R342 */ | ||
347 | { 0x0000, 0x0000 }, /* R343 */ | ||
348 | { 0x0000, 0x0000 }, /* R344 */ | ||
349 | { 0x0000, 0x0000 }, /* R345 */ | ||
350 | { 0x0000, 0x0000 }, /* R346 */ | ||
351 | { 0x0000, 0x0000 }, /* R347 */ | ||
352 | { 0x0000, 0x0000 }, /* R348 */ | ||
353 | { 0x0000, 0x0000 }, /* R349 */ | ||
354 | { 0x0000, 0x0000 }, /* R350 */ | ||
355 | { 0x0000, 0x0000 }, /* R351 */ | ||
356 | { 0x0000, 0x0000 }, /* R352 */ | ||
357 | { 0x0000, 0x0000 }, /* R353 */ | ||
358 | { 0x0000, 0x0000 }, /* R354 */ | ||
359 | { 0x0000, 0x0000 }, /* R355 */ | ||
360 | { 0x0000, 0x0000 }, /* R356 */ | ||
361 | { 0x0000, 0x0000 }, /* R357 */ | ||
362 | { 0x0000, 0x0000 }, /* R358 */ | ||
363 | { 0x0000, 0x0000 }, /* R359 */ | ||
364 | { 0x0000, 0x0000 }, /* R360 */ | ||
365 | { 0x0000, 0x0000 }, /* R361 */ | ||
366 | { 0x0000, 0x0000 }, /* R362 */ | ||
367 | { 0x0000, 0x0000 }, /* R363 */ | ||
368 | { 0x0000, 0x0000 }, /* R364 */ | ||
369 | { 0x0000, 0x0000 }, /* R365 */ | ||
370 | { 0x0000, 0x0000 }, /* R366 */ | ||
371 | { 0x0000, 0x0000 }, /* R367 */ | ||
372 | { 0x0000, 0x0000 }, /* R368 */ | ||
373 | { 0x0000, 0x0000 }, /* R369 */ | ||
374 | { 0x0000, 0x0000 }, /* R370 */ | ||
375 | { 0x0000, 0x0000 }, /* R371 */ | ||
376 | { 0x0000, 0x0000 }, /* R372 */ | ||
377 | { 0x0000, 0x0000 }, /* R373 */ | ||
378 | { 0x0000, 0x0000 }, /* R374 */ | ||
379 | { 0x0000, 0x0000 }, /* R375 */ | ||
380 | { 0x0000, 0x0000 }, /* R376 */ | ||
381 | { 0x0000, 0x0000 }, /* R377 */ | ||
382 | { 0x0000, 0x0000 }, /* R378 */ | ||
383 | { 0x0000, 0x0000 }, /* R379 */ | ||
384 | { 0x0000, 0x0000 }, /* R380 */ | ||
385 | { 0x0000, 0x0000 }, /* R381 */ | ||
386 | { 0x0000, 0x0000 }, /* R382 */ | ||
387 | { 0x0000, 0x0000 }, /* R383 */ | ||
388 | { 0x0000, 0x0000 }, /* R384 */ | ||
389 | { 0x0000, 0x0000 }, /* R385 */ | ||
390 | { 0x0000, 0x0000 }, /* R386 */ | ||
391 | { 0x0000, 0x0000 }, /* R387 */ | ||
392 | { 0x0000, 0x0000 }, /* R388 */ | ||
393 | { 0x0000, 0x0000 }, /* R389 */ | ||
394 | { 0x0000, 0x0000 }, /* R390 */ | ||
395 | { 0x0000, 0x0000 }, /* R391 */ | ||
396 | { 0x0000, 0x0000 }, /* R392 */ | ||
397 | { 0x0000, 0x0000 }, /* R393 */ | ||
398 | { 0x0000, 0x0000 }, /* R394 */ | ||
399 | { 0x0000, 0x0000 }, /* R395 */ | ||
400 | { 0x0000, 0x0000 }, /* R396 */ | ||
401 | { 0x0000, 0x0000 }, /* R397 */ | ||
402 | { 0x0000, 0x0000 }, /* R398 */ | ||
403 | { 0x0000, 0x0000 }, /* R399 */ | ||
404 | { 0x0000, 0x0000 }, /* R400 */ | ||
405 | { 0x0000, 0x0000 }, /* R401 */ | ||
406 | { 0x0000, 0x0000 }, /* R402 */ | ||
407 | { 0x0000, 0x0000 }, /* R403 */ | ||
408 | { 0x0000, 0x0000 }, /* R404 */ | ||
409 | { 0x0000, 0x0000 }, /* R405 */ | ||
410 | { 0x0000, 0x0000 }, /* R406 */ | ||
411 | { 0x0000, 0x0000 }, /* R407 */ | ||
412 | { 0x0000, 0x0000 }, /* R408 */ | ||
413 | { 0x0000, 0x0000 }, /* R409 */ | ||
414 | { 0x0000, 0x0000 }, /* R410 */ | ||
415 | { 0x0000, 0x0000 }, /* R411 */ | ||
416 | { 0x0000, 0x0000 }, /* R412 */ | ||
417 | { 0x0000, 0x0000 }, /* R413 */ | ||
418 | { 0x0000, 0x0000 }, /* R414 */ | ||
419 | { 0x0000, 0x0000 }, /* R415 */ | ||
420 | { 0x0000, 0x0000 }, /* R416 */ | ||
421 | { 0x0000, 0x0000 }, /* R417 */ | ||
422 | { 0x0000, 0x0000 }, /* R418 */ | ||
423 | { 0x0000, 0x0000 }, /* R419 */ | ||
424 | { 0x0000, 0x0000 }, /* R420 */ | ||
425 | { 0x0000, 0x0000 }, /* R421 */ | ||
426 | { 0x0000, 0x0000 }, /* R422 */ | ||
427 | { 0x0000, 0x0000 }, /* R423 */ | ||
428 | { 0x0000, 0x0000 }, /* R424 */ | ||
429 | { 0x0000, 0x0000 }, /* R425 */ | ||
430 | { 0x0000, 0x0000 }, /* R426 */ | ||
431 | { 0x0000, 0x0000 }, /* R427 */ | ||
432 | { 0x0000, 0x0000 }, /* R428 */ | ||
433 | { 0x0000, 0x0000 }, /* R429 */ | ||
434 | { 0x0000, 0x0000 }, /* R430 */ | ||
435 | { 0x0000, 0x0000 }, /* R431 */ | ||
436 | { 0x0000, 0x0000 }, /* R432 */ | ||
437 | { 0x0000, 0x0000 }, /* R433 */ | ||
438 | { 0x0000, 0x0000 }, /* R434 */ | ||
439 | { 0x0000, 0x0000 }, /* R435 */ | ||
440 | { 0x0000, 0x0000 }, /* R436 */ | ||
441 | { 0x0000, 0x0000 }, /* R437 */ | ||
442 | { 0x0000, 0x0000 }, /* R438 */ | ||
443 | { 0x0000, 0x0000 }, /* R439 */ | ||
444 | { 0x0000, 0x0000 }, /* R440 */ | ||
445 | { 0x0000, 0x0000 }, /* R441 */ | ||
446 | { 0x0000, 0x0000 }, /* R442 */ | ||
447 | { 0x0000, 0x0000 }, /* R443 */ | ||
448 | { 0x0000, 0x0000 }, /* R444 */ | ||
449 | { 0x0000, 0x0000 }, /* R445 */ | ||
450 | { 0x0000, 0x0000 }, /* R446 */ | ||
451 | { 0x0000, 0x0000 }, /* R447 */ | ||
452 | { 0x0000, 0x0000 }, /* R448 */ | ||
453 | { 0x0000, 0x0000 }, /* R449 */ | ||
454 | { 0x0000, 0x0000 }, /* R450 */ | ||
455 | { 0x0000, 0x0000 }, /* R451 */ | ||
456 | { 0x0000, 0x0000 }, /* R452 */ | ||
457 | { 0x0000, 0x0000 }, /* R453 */ | ||
458 | { 0x0000, 0x0000 }, /* R454 */ | ||
459 | { 0x0000, 0x0000 }, /* R455 */ | ||
460 | { 0x0000, 0x0000 }, /* R456 */ | ||
461 | { 0x0000, 0x0000 }, /* R457 */ | ||
462 | { 0x0000, 0x0000 }, /* R458 */ | ||
463 | { 0x0000, 0x0000 }, /* R459 */ | ||
464 | { 0x0000, 0x0000 }, /* R460 */ | ||
465 | { 0x0000, 0x0000 }, /* R461 */ | ||
466 | { 0x0000, 0x0000 }, /* R462 */ | ||
467 | { 0x0000, 0x0000 }, /* R463 */ | ||
468 | { 0x0000, 0x0000 }, /* R464 */ | ||
469 | { 0x0000, 0x0000 }, /* R465 */ | ||
470 | { 0x0000, 0x0000 }, /* R466 */ | ||
471 | { 0x0000, 0x0000 }, /* R467 */ | ||
472 | { 0x0000, 0x0000 }, /* R468 */ | ||
473 | { 0x0000, 0x0000 }, /* R469 */ | ||
474 | { 0x0000, 0x0000 }, /* R470 */ | ||
475 | { 0x0000, 0x0000 }, /* R471 */ | ||
476 | { 0x0000, 0x0000 }, /* R472 */ | ||
477 | { 0x0000, 0x0000 }, /* R473 */ | ||
478 | { 0x0000, 0x0000 }, /* R474 */ | ||
479 | { 0x0000, 0x0000 }, /* R475 */ | ||
480 | { 0x0000, 0x0000 }, /* R476 */ | ||
481 | { 0x0000, 0x0000 }, /* R477 */ | ||
482 | { 0x0000, 0x0000 }, /* R478 */ | ||
483 | { 0x0000, 0x0000 }, /* R479 */ | ||
484 | { 0x0000, 0x0000 }, /* R480 */ | ||
485 | { 0x0000, 0x0000 }, /* R481 */ | ||
486 | { 0x0000, 0x0000 }, /* R482 */ | ||
487 | { 0x0000, 0x0000 }, /* R483 */ | ||
488 | { 0x0000, 0x0000 }, /* R484 */ | ||
489 | { 0x0000, 0x0000 }, /* R485 */ | ||
490 | { 0x0000, 0x0000 }, /* R486 */ | ||
491 | { 0x0000, 0x0000 }, /* R487 */ | ||
492 | { 0x0000, 0x0000 }, /* R488 */ | ||
493 | { 0x0000, 0x0000 }, /* R489 */ | ||
494 | { 0x0000, 0x0000 }, /* R490 */ | ||
495 | { 0x0000, 0x0000 }, /* R491 */ | ||
496 | { 0x0000, 0x0000 }, /* R492 */ | ||
497 | { 0x0000, 0x0000 }, /* R493 */ | ||
498 | { 0x0000, 0x0000 }, /* R494 */ | ||
499 | { 0x0000, 0x0000 }, /* R495 */ | ||
500 | { 0x0000, 0x0000 }, /* R496 */ | ||
501 | { 0x0000, 0x0000 }, /* R497 */ | ||
502 | { 0x0000, 0x0000 }, /* R498 */ | ||
503 | { 0x0000, 0x0000 }, /* R499 */ | ||
504 | { 0x0000, 0x0000 }, /* R500 */ | ||
505 | { 0x0000, 0x0000 }, /* R501 */ | ||
506 | { 0x0000, 0x0000 }, /* R502 */ | ||
507 | { 0x0000, 0x0000 }, /* R503 */ | ||
508 | { 0x0000, 0x0000 }, /* R504 */ | ||
509 | { 0x0000, 0x0000 }, /* R505 */ | ||
510 | { 0x0000, 0x0000 }, /* R506 */ | ||
511 | { 0x0000, 0x0000 }, /* R507 */ | ||
512 | { 0x0000, 0x0000 }, /* R508 */ | ||
513 | { 0x0000, 0x0000 }, /* R509 */ | ||
514 | { 0x0000, 0x0000 }, /* R510 */ | ||
515 | { 0x0000, 0x0000 }, /* R511 */ | ||
516 | { 0x001F, 0x001F }, /* R512 - AIF1 Clocking (1) */ | ||
517 | { 0x003F, 0x003F }, /* R513 - AIF1 Clocking (2) */ | ||
518 | { 0x0000, 0x0000 }, /* R514 */ | ||
519 | { 0x0000, 0x0000 }, /* R515 */ | ||
520 | { 0x001F, 0x001F }, /* R516 - AIF2 Clocking (1) */ | ||
521 | { 0x003F, 0x003F }, /* R517 - AIF2 Clocking (2) */ | ||
522 | { 0x0000, 0x0000 }, /* R518 */ | ||
523 | { 0x0000, 0x0000 }, /* R519 */ | ||
524 | { 0x001F, 0x001F }, /* R520 - Clocking (1) */ | ||
525 | { 0x0777, 0x0777 }, /* R521 - Clocking (2) */ | ||
526 | { 0x0000, 0x0000 }, /* R522 */ | ||
527 | { 0x0000, 0x0000 }, /* R523 */ | ||
528 | { 0x0000, 0x0000 }, /* R524 */ | ||
529 | { 0x0000, 0x0000 }, /* R525 */ | ||
530 | { 0x0000, 0x0000 }, /* R526 */ | ||
531 | { 0x0000, 0x0000 }, /* R527 */ | ||
532 | { 0x00FF, 0x00FF }, /* R528 - AIF1 Rate */ | ||
533 | { 0x00FF, 0x00FF }, /* R529 - AIF2 Rate */ | ||
534 | { 0x000F, 0x0000 }, /* R530 - Rate Status */ | ||
535 | { 0x0000, 0x0000 }, /* R531 */ | ||
536 | { 0x0000, 0x0000 }, /* R532 */ | ||
537 | { 0x0000, 0x0000 }, /* R533 */ | ||
538 | { 0x0000, 0x0000 }, /* R534 */ | ||
539 | { 0x0000, 0x0000 }, /* R535 */ | ||
540 | { 0x0000, 0x0000 }, /* R536 */ | ||
541 | { 0x0000, 0x0000 }, /* R537 */ | ||
542 | { 0x0000, 0x0000 }, /* R538 */ | ||
543 | { 0x0000, 0x0000 }, /* R539 */ | ||
544 | { 0x0000, 0x0000 }, /* R540 */ | ||
545 | { 0x0000, 0x0000 }, /* R541 */ | ||
546 | { 0x0000, 0x0000 }, /* R542 */ | ||
547 | { 0x0000, 0x0000 }, /* R543 */ | ||
548 | { 0x0007, 0x0007 }, /* R544 - FLL1 Control (1) */ | ||
549 | { 0x3F77, 0x3F77 }, /* R545 - FLL1 Control (2) */ | ||
550 | { 0xFFFF, 0xFFFF }, /* R546 - FLL1 Control (3) */ | ||
551 | { 0x7FEF, 0x7FEF }, /* R547 - FLL1 Control (4) */ | ||
552 | { 0x1FDB, 0x1FDB }, /* R548 - FLL1 Control (5) */ | ||
553 | { 0x0000, 0x0000 }, /* R549 */ | ||
554 | { 0x0000, 0x0000 }, /* R550 */ | ||
555 | { 0x0000, 0x0000 }, /* R551 */ | ||
556 | { 0x0000, 0x0000 }, /* R552 */ | ||
557 | { 0x0000, 0x0000 }, /* R553 */ | ||
558 | { 0x0000, 0x0000 }, /* R554 */ | ||
559 | { 0x0000, 0x0000 }, /* R555 */ | ||
560 | { 0x0000, 0x0000 }, /* R556 */ | ||
561 | { 0x0000, 0x0000 }, /* R557 */ | ||
562 | { 0x0000, 0x0000 }, /* R558 */ | ||
563 | { 0x0000, 0x0000 }, /* R559 */ | ||
564 | { 0x0000, 0x0000 }, /* R560 */ | ||
565 | { 0x0000, 0x0000 }, /* R561 */ | ||
566 | { 0x0000, 0x0000 }, /* R562 */ | ||
567 | { 0x0000, 0x0000 }, /* R563 */ | ||
568 | { 0x0000, 0x0000 }, /* R564 */ | ||
569 | { 0x0000, 0x0000 }, /* R565 */ | ||
570 | { 0x0000, 0x0000 }, /* R566 */ | ||
571 | { 0x0000, 0x0000 }, /* R567 */ | ||
572 | { 0x0000, 0x0000 }, /* R568 */ | ||
573 | { 0x0000, 0x0000 }, /* R569 */ | ||
574 | { 0x0000, 0x0000 }, /* R570 */ | ||
575 | { 0x0000, 0x0000 }, /* R571 */ | ||
576 | { 0x0000, 0x0000 }, /* R572 */ | ||
577 | { 0x0000, 0x0000 }, /* R573 */ | ||
578 | { 0x0000, 0x0000 }, /* R574 */ | ||
579 | { 0x0000, 0x0000 }, /* R575 */ | ||
580 | { 0x0007, 0x0007 }, /* R576 - FLL2 Control (1) */ | ||
581 | { 0x3F77, 0x3F77 }, /* R577 - FLL2 Control (2) */ | ||
582 | { 0xFFFF, 0xFFFF }, /* R578 - FLL2 Control (3) */ | ||
583 | { 0x7FEF, 0x7FEF }, /* R579 - FLL2 Control (4) */ | ||
584 | { 0x1FDB, 0x1FDB }, /* R580 - FLL2 Control (5) */ | ||
585 | { 0x0000, 0x0000 }, /* R581 */ | ||
586 | { 0x0000, 0x0000 }, /* R582 */ | ||
587 | { 0x0000, 0x0000 }, /* R583 */ | ||
588 | { 0x0000, 0x0000 }, /* R584 */ | ||
589 | { 0x0000, 0x0000 }, /* R585 */ | ||
590 | { 0x0000, 0x0000 }, /* R586 */ | ||
591 | { 0x0000, 0x0000 }, /* R587 */ | ||
592 | { 0x0000, 0x0000 }, /* R588 */ | ||
593 | { 0x0000, 0x0000 }, /* R589 */ | ||
594 | { 0x0000, 0x0000 }, /* R590 */ | ||
595 | { 0x0000, 0x0000 }, /* R591 */ | ||
596 | { 0x0000, 0x0000 }, /* R592 */ | ||
597 | { 0x0000, 0x0000 }, /* R593 */ | ||
598 | { 0x0000, 0x0000 }, /* R594 */ | ||
599 | { 0x0000, 0x0000 }, /* R595 */ | ||
600 | { 0x0000, 0x0000 }, /* R596 */ | ||
601 | { 0x0000, 0x0000 }, /* R597 */ | ||
602 | { 0x0000, 0x0000 }, /* R598 */ | ||
603 | { 0x0000, 0x0000 }, /* R599 */ | ||
604 | { 0x0000, 0x0000 }, /* R600 */ | ||
605 | { 0x0000, 0x0000 }, /* R601 */ | ||
606 | { 0x0000, 0x0000 }, /* R602 */ | ||
607 | { 0x0000, 0x0000 }, /* R603 */ | ||
608 | { 0x0000, 0x0000 }, /* R604 */ | ||
609 | { 0x0000, 0x0000 }, /* R605 */ | ||
610 | { 0x0000, 0x0000 }, /* R606 */ | ||
611 | { 0x0000, 0x0000 }, /* R607 */ | ||
612 | { 0x0000, 0x0000 }, /* R608 */ | ||
613 | { 0x0000, 0x0000 }, /* R609 */ | ||
614 | { 0x0000, 0x0000 }, /* R610 */ | ||
615 | { 0x0000, 0x0000 }, /* R611 */ | ||
616 | { 0x0000, 0x0000 }, /* R612 */ | ||
617 | { 0x0000, 0x0000 }, /* R613 */ | ||
618 | { 0x0000, 0x0000 }, /* R614 */ | ||
619 | { 0x0000, 0x0000 }, /* R615 */ | ||
620 | { 0x0000, 0x0000 }, /* R616 */ | ||
621 | { 0x0000, 0x0000 }, /* R617 */ | ||
622 | { 0x0000, 0x0000 }, /* R618 */ | ||
623 | { 0x0000, 0x0000 }, /* R619 */ | ||
624 | { 0x0000, 0x0000 }, /* R620 */ | ||
625 | { 0x0000, 0x0000 }, /* R621 */ | ||
626 | { 0x0000, 0x0000 }, /* R622 */ | ||
627 | { 0x0000, 0x0000 }, /* R623 */ | ||
628 | { 0x0000, 0x0000 }, /* R624 */ | ||
629 | { 0x0000, 0x0000 }, /* R625 */ | ||
630 | { 0x0000, 0x0000 }, /* R626 */ | ||
631 | { 0x0000, 0x0000 }, /* R627 */ | ||
632 | { 0x0000, 0x0000 }, /* R628 */ | ||
633 | { 0x0000, 0x0000 }, /* R629 */ | ||
634 | { 0x0000, 0x0000 }, /* R630 */ | ||
635 | { 0x0000, 0x0000 }, /* R631 */ | ||
636 | { 0x0000, 0x0000 }, /* R632 */ | ||
637 | { 0x0000, 0x0000 }, /* R633 */ | ||
638 | { 0x0000, 0x0000 }, /* R634 */ | ||
639 | { 0x0000, 0x0000 }, /* R635 */ | ||
640 | { 0x0000, 0x0000 }, /* R636 */ | ||
641 | { 0x0000, 0x0000 }, /* R637 */ | ||
642 | { 0x0000, 0x0000 }, /* R638 */ | ||
643 | { 0x0000, 0x0000 }, /* R639 */ | ||
644 | { 0x0000, 0x0000 }, /* R640 */ | ||
645 | { 0x0000, 0x0000 }, /* R641 */ | ||
646 | { 0x0000, 0x0000 }, /* R642 */ | ||
647 | { 0x0000, 0x0000 }, /* R643 */ | ||
648 | { 0x0000, 0x0000 }, /* R644 */ | ||
649 | { 0x0000, 0x0000 }, /* R645 */ | ||
650 | { 0x0000, 0x0000 }, /* R646 */ | ||
651 | { 0x0000, 0x0000 }, /* R647 */ | ||
652 | { 0x0000, 0x0000 }, /* R648 */ | ||
653 | { 0x0000, 0x0000 }, /* R649 */ | ||
654 | { 0x0000, 0x0000 }, /* R650 */ | ||
655 | { 0x0000, 0x0000 }, /* R651 */ | ||
656 | { 0x0000, 0x0000 }, /* R652 */ | ||
657 | { 0x0000, 0x0000 }, /* R653 */ | ||
658 | { 0x0000, 0x0000 }, /* R654 */ | ||
659 | { 0x0000, 0x0000 }, /* R655 */ | ||
660 | { 0x0000, 0x0000 }, /* R656 */ | ||
661 | { 0x0000, 0x0000 }, /* R657 */ | ||
662 | { 0x0000, 0x0000 }, /* R658 */ | ||
663 | { 0x0000, 0x0000 }, /* R659 */ | ||
664 | { 0x0000, 0x0000 }, /* R660 */ | ||
665 | { 0x0000, 0x0000 }, /* R661 */ | ||
666 | { 0x0000, 0x0000 }, /* R662 */ | ||
667 | { 0x0000, 0x0000 }, /* R663 */ | ||
668 | { 0x0000, 0x0000 }, /* R664 */ | ||
669 | { 0x0000, 0x0000 }, /* R665 */ | ||
670 | { 0x0000, 0x0000 }, /* R666 */ | ||
671 | { 0x0000, 0x0000 }, /* R667 */ | ||
672 | { 0x0000, 0x0000 }, /* R668 */ | ||
673 | { 0x0000, 0x0000 }, /* R669 */ | ||
674 | { 0x0000, 0x0000 }, /* R670 */ | ||
675 | { 0x0000, 0x0000 }, /* R671 */ | ||
676 | { 0x0000, 0x0000 }, /* R672 */ | ||
677 | { 0x0000, 0x0000 }, /* R673 */ | ||
678 | { 0x0000, 0x0000 }, /* R674 */ | ||
679 | { 0x0000, 0x0000 }, /* R675 */ | ||
680 | { 0x0000, 0x0000 }, /* R676 */ | ||
681 | { 0x0000, 0x0000 }, /* R677 */ | ||
682 | { 0x0000, 0x0000 }, /* R678 */ | ||
683 | { 0x0000, 0x0000 }, /* R679 */ | ||
684 | { 0x0000, 0x0000 }, /* R680 */ | ||
685 | { 0x0000, 0x0000 }, /* R681 */ | ||
686 | { 0x0000, 0x0000 }, /* R682 */ | ||
687 | { 0x0000, 0x0000 }, /* R683 */ | ||
688 | { 0x0000, 0x0000 }, /* R684 */ | ||
689 | { 0x0000, 0x0000 }, /* R685 */ | ||
690 | { 0x0000, 0x0000 }, /* R686 */ | ||
691 | { 0x0000, 0x0000 }, /* R687 */ | ||
692 | { 0x0000, 0x0000 }, /* R688 */ | ||
693 | { 0x0000, 0x0000 }, /* R689 */ | ||
694 | { 0x0000, 0x0000 }, /* R690 */ | ||
695 | { 0x0000, 0x0000 }, /* R691 */ | ||
696 | { 0x0000, 0x0000 }, /* R692 */ | ||
697 | { 0x0000, 0x0000 }, /* R693 */ | ||
698 | { 0x0000, 0x0000 }, /* R694 */ | ||
699 | { 0x0000, 0x0000 }, /* R695 */ | ||
700 | { 0x0000, 0x0000 }, /* R696 */ | ||
701 | { 0x0000, 0x0000 }, /* R697 */ | ||
702 | { 0x0000, 0x0000 }, /* R698 */ | ||
703 | { 0x0000, 0x0000 }, /* R699 */ | ||
704 | { 0x0000, 0x0000 }, /* R700 */ | ||
705 | { 0x0000, 0x0000 }, /* R701 */ | ||
706 | { 0x0000, 0x0000 }, /* R702 */ | ||
707 | { 0x0000, 0x0000 }, /* R703 */ | ||
708 | { 0x0000, 0x0000 }, /* R704 */ | ||
709 | { 0x0000, 0x0000 }, /* R705 */ | ||
710 | { 0x0000, 0x0000 }, /* R706 */ | ||
711 | { 0x0000, 0x0000 }, /* R707 */ | ||
712 | { 0x0000, 0x0000 }, /* R708 */ | ||
713 | { 0x0000, 0x0000 }, /* R709 */ | ||
714 | { 0x0000, 0x0000 }, /* R710 */ | ||
715 | { 0x0000, 0x0000 }, /* R711 */ | ||
716 | { 0x0000, 0x0000 }, /* R712 */ | ||
717 | { 0x0000, 0x0000 }, /* R713 */ | ||
718 | { 0x0000, 0x0000 }, /* R714 */ | ||
719 | { 0x0000, 0x0000 }, /* R715 */ | ||
720 | { 0x0000, 0x0000 }, /* R716 */ | ||
721 | { 0x0000, 0x0000 }, /* R717 */ | ||
722 | { 0x0000, 0x0000 }, /* R718 */ | ||
723 | { 0x0000, 0x0000 }, /* R719 */ | ||
724 | { 0x0000, 0x0000 }, /* R720 */ | ||
725 | { 0x0000, 0x0000 }, /* R721 */ | ||
726 | { 0x0000, 0x0000 }, /* R722 */ | ||
727 | { 0x0000, 0x0000 }, /* R723 */ | ||
728 | { 0x0000, 0x0000 }, /* R724 */ | ||
729 | { 0x0000, 0x0000 }, /* R725 */ | ||
730 | { 0x0000, 0x0000 }, /* R726 */ | ||
731 | { 0x0000, 0x0000 }, /* R727 */ | ||
732 | { 0x0000, 0x0000 }, /* R728 */ | ||
733 | { 0x0000, 0x0000 }, /* R729 */ | ||
734 | { 0x0000, 0x0000 }, /* R730 */ | ||
735 | { 0x0000, 0x0000 }, /* R731 */ | ||
736 | { 0x0000, 0x0000 }, /* R732 */ | ||
737 | { 0x0000, 0x0000 }, /* R733 */ | ||
738 | { 0x0000, 0x0000 }, /* R734 */ | ||
739 | { 0x0000, 0x0000 }, /* R735 */ | ||
740 | { 0x0000, 0x0000 }, /* R736 */ | ||
741 | { 0x0000, 0x0000 }, /* R737 */ | ||
742 | { 0x0000, 0x0000 }, /* R738 */ | ||
743 | { 0x0000, 0x0000 }, /* R739 */ | ||
744 | { 0x0000, 0x0000 }, /* R740 */ | ||
745 | { 0x0000, 0x0000 }, /* R741 */ | ||
746 | { 0x0000, 0x0000 }, /* R742 */ | ||
747 | { 0x0000, 0x0000 }, /* R743 */ | ||
748 | { 0x0000, 0x0000 }, /* R744 */ | ||
749 | { 0x0000, 0x0000 }, /* R745 */ | ||
750 | { 0x0000, 0x0000 }, /* R746 */ | ||
751 | { 0x0000, 0x0000 }, /* R747 */ | ||
752 | { 0x0000, 0x0000 }, /* R748 */ | ||
753 | { 0x0000, 0x0000 }, /* R749 */ | ||
754 | { 0x0000, 0x0000 }, /* R750 */ | ||
755 | { 0x0000, 0x0000 }, /* R751 */ | ||
756 | { 0x0000, 0x0000 }, /* R752 */ | ||
757 | { 0x0000, 0x0000 }, /* R753 */ | ||
758 | { 0x0000, 0x0000 }, /* R754 */ | ||
759 | { 0x0000, 0x0000 }, /* R755 */ | ||
760 | { 0x0000, 0x0000 }, /* R756 */ | ||
761 | { 0x0000, 0x0000 }, /* R757 */ | ||
762 | { 0x0000, 0x0000 }, /* R758 */ | ||
763 | { 0x0000, 0x0000 }, /* R759 */ | ||
764 | { 0x0000, 0x0000 }, /* R760 */ | ||
765 | { 0x0000, 0x0000 }, /* R761 */ | ||
766 | { 0x0000, 0x0000 }, /* R762 */ | ||
767 | { 0x0000, 0x0000 }, /* R763 */ | ||
768 | { 0x0000, 0x0000 }, /* R764 */ | ||
769 | { 0x0000, 0x0000 }, /* R765 */ | ||
770 | { 0x0000, 0x0000 }, /* R766 */ | ||
771 | { 0x0000, 0x0000 }, /* R767 */ | ||
772 | { 0xE1F8, 0xE1F8 }, /* R768 - AIF1 Control (1) */ | ||
773 | { 0xCD1F, 0xCD1F }, /* R769 - AIF1 Control (2) */ | ||
774 | { 0xF000, 0xF000 }, /* R770 - AIF1 Master/Slave */ | ||
775 | { 0x01F0, 0x01F0 }, /* R771 - AIF1 BCLK */ | ||
776 | { 0x0FFF, 0x0FFF }, /* R772 - AIF1ADC LRCLK */ | ||
777 | { 0x0FFF, 0x0FFF }, /* R773 - AIF1DAC LRCLK */ | ||
778 | { 0x0003, 0x0003 }, /* R774 - AIF1DAC Data */ | ||
779 | { 0x0003, 0x0003 }, /* R775 - AIF1ADC Data */ | ||
780 | { 0x0000, 0x0000 }, /* R776 */ | ||
781 | { 0x0000, 0x0000 }, /* R777 */ | ||
782 | { 0x0000, 0x0000 }, /* R778 */ | ||
783 | { 0x0000, 0x0000 }, /* R779 */ | ||
784 | { 0x0000, 0x0000 }, /* R780 */ | ||
785 | { 0x0000, 0x0000 }, /* R781 */ | ||
786 | { 0x0000, 0x0000 }, /* R782 */ | ||
787 | { 0x0000, 0x0000 }, /* R783 */ | ||
788 | { 0xF1F8, 0xF1F8 }, /* R784 - AIF2 Control (1) */ | ||
789 | { 0xFD1F, 0xFD1F }, /* R785 - AIF2 Control (2) */ | ||
790 | { 0xF000, 0xF000 }, /* R786 - AIF2 Master/Slave */ | ||
791 | { 0x01F0, 0x01F0 }, /* R787 - AIF2 BCLK */ | ||
792 | { 0x0FFF, 0x0FFF }, /* R788 - AIF2ADC LRCLK */ | ||
793 | { 0x0FFF, 0x0FFF }, /* R789 - AIF2DAC LRCLK */ | ||
794 | { 0x0003, 0x0003 }, /* R790 - AIF2DAC Data */ | ||
795 | { 0x0003, 0x0003 }, /* R791 - AIF2ADC Data */ | ||
796 | { 0x0000, 0x0000 }, /* R792 */ | ||
797 | { 0x0000, 0x0000 }, /* R793 */ | ||
798 | { 0x0000, 0x0000 }, /* R794 */ | ||
799 | { 0x0000, 0x0000 }, /* R795 */ | ||
800 | { 0x0000, 0x0000 }, /* R796 */ | ||
801 | { 0x0000, 0x0000 }, /* R797 */ | ||
802 | { 0x0000, 0x0000 }, /* R798 */ | ||
803 | { 0x0000, 0x0000 }, /* R799 */ | ||
804 | { 0x0000, 0x0000 }, /* R800 */ | ||
805 | { 0x0000, 0x0000 }, /* R801 */ | ||
806 | { 0x0000, 0x0000 }, /* R802 */ | ||
807 | { 0x0000, 0x0000 }, /* R803 */ | ||
808 | { 0x0000, 0x0000 }, /* R804 */ | ||
809 | { 0x0000, 0x0000 }, /* R805 */ | ||
810 | { 0x0000, 0x0000 }, /* R806 */ | ||
811 | { 0x0000, 0x0000 }, /* R807 */ | ||
812 | { 0x0000, 0x0000 }, /* R808 */ | ||
813 | { 0x0000, 0x0000 }, /* R809 */ | ||
814 | { 0x0000, 0x0000 }, /* R810 */ | ||
815 | { 0x0000, 0x0000 }, /* R811 */ | ||
816 | { 0x0000, 0x0000 }, /* R812 */ | ||
817 | { 0x0000, 0x0000 }, /* R813 */ | ||
818 | { 0x0000, 0x0000 }, /* R814 */ | ||
819 | { 0x0000, 0x0000 }, /* R815 */ | ||
820 | { 0x0000, 0x0000 }, /* R816 */ | ||
821 | { 0x0000, 0x0000 }, /* R817 */ | ||
822 | { 0x0000, 0x0000 }, /* R818 */ | ||
823 | { 0x0000, 0x0000 }, /* R819 */ | ||
824 | { 0x0000, 0x0000 }, /* R820 */ | ||
825 | { 0x0000, 0x0000 }, /* R821 */ | ||
826 | { 0x0000, 0x0000 }, /* R822 */ | ||
827 | { 0x0000, 0x0000 }, /* R823 */ | ||
828 | { 0x0000, 0x0000 }, /* R824 */ | ||
829 | { 0x0000, 0x0000 }, /* R825 */ | ||
830 | { 0x0000, 0x0000 }, /* R826 */ | ||
831 | { 0x0000, 0x0000 }, /* R827 */ | ||
832 | { 0x0000, 0x0000 }, /* R828 */ | ||
833 | { 0x0000, 0x0000 }, /* R829 */ | ||
834 | { 0x0000, 0x0000 }, /* R830 */ | ||
835 | { 0x0000, 0x0000 }, /* R831 */ | ||
836 | { 0x0000, 0x0000 }, /* R832 */ | ||
837 | { 0x0000, 0x0000 }, /* R833 */ | ||
838 | { 0x0000, 0x0000 }, /* R834 */ | ||
839 | { 0x0000, 0x0000 }, /* R835 */ | ||
840 | { 0x0000, 0x0000 }, /* R836 */ | ||
841 | { 0x0000, 0x0000 }, /* R837 */ | ||
842 | { 0x0000, 0x0000 }, /* R838 */ | ||
843 | { 0x0000, 0x0000 }, /* R839 */ | ||
844 | { 0x0000, 0x0000 }, /* R840 */ | ||
845 | { 0x0000, 0x0000 }, /* R841 */ | ||
846 | { 0x0000, 0x0000 }, /* R842 */ | ||
847 | { 0x0000, 0x0000 }, /* R843 */ | ||
848 | { 0x0000, 0x0000 }, /* R844 */ | ||
849 | { 0x0000, 0x0000 }, /* R845 */ | ||
850 | { 0x0000, 0x0000 }, /* R846 */ | ||
851 | { 0x0000, 0x0000 }, /* R847 */ | ||
852 | { 0x0000, 0x0000 }, /* R848 */ | ||
853 | { 0x0000, 0x0000 }, /* R849 */ | ||
854 | { 0x0000, 0x0000 }, /* R850 */ | ||
855 | { 0x0000, 0x0000 }, /* R851 */ | ||
856 | { 0x0000, 0x0000 }, /* R852 */ | ||
857 | { 0x0000, 0x0000 }, /* R853 */ | ||
858 | { 0x0000, 0x0000 }, /* R854 */ | ||
859 | { 0x0000, 0x0000 }, /* R855 */ | ||
860 | { 0x0000, 0x0000 }, /* R856 */ | ||
861 | { 0x0000, 0x0000 }, /* R857 */ | ||
862 | { 0x0000, 0x0000 }, /* R858 */ | ||
863 | { 0x0000, 0x0000 }, /* R859 */ | ||
864 | { 0x0000, 0x0000 }, /* R860 */ | ||
865 | { 0x0000, 0x0000 }, /* R861 */ | ||
866 | { 0x0000, 0x0000 }, /* R862 */ | ||
867 | { 0x0000, 0x0000 }, /* R863 */ | ||
868 | { 0x0000, 0x0000 }, /* R864 */ | ||
869 | { 0x0000, 0x0000 }, /* R865 */ | ||
870 | { 0x0000, 0x0000 }, /* R866 */ | ||
871 | { 0x0000, 0x0000 }, /* R867 */ | ||
872 | { 0x0000, 0x0000 }, /* R868 */ | ||
873 | { 0x0000, 0x0000 }, /* R869 */ | ||
874 | { 0x0000, 0x0000 }, /* R870 */ | ||
875 | { 0x0000, 0x0000 }, /* R871 */ | ||
876 | { 0x0000, 0x0000 }, /* R872 */ | ||
877 | { 0x0000, 0x0000 }, /* R873 */ | ||
878 | { 0x0000, 0x0000 }, /* R874 */ | ||
879 | { 0x0000, 0x0000 }, /* R875 */ | ||
880 | { 0x0000, 0x0000 }, /* R876 */ | ||
881 | { 0x0000, 0x0000 }, /* R877 */ | ||
882 | { 0x0000, 0x0000 }, /* R878 */ | ||
883 | { 0x0000, 0x0000 }, /* R879 */ | ||
884 | { 0x0000, 0x0000 }, /* R880 */ | ||
885 | { 0x0000, 0x0000 }, /* R881 */ | ||
886 | { 0x0000, 0x0000 }, /* R882 */ | ||
887 | { 0x0000, 0x0000 }, /* R883 */ | ||
888 | { 0x0000, 0x0000 }, /* R884 */ | ||
889 | { 0x0000, 0x0000 }, /* R885 */ | ||
890 | { 0x0000, 0x0000 }, /* R886 */ | ||
891 | { 0x0000, 0x0000 }, /* R887 */ | ||
892 | { 0x0000, 0x0000 }, /* R888 */ | ||
893 | { 0x0000, 0x0000 }, /* R889 */ | ||
894 | { 0x0000, 0x0000 }, /* R890 */ | ||
895 | { 0x0000, 0x0000 }, /* R891 */ | ||
896 | { 0x0000, 0x0000 }, /* R892 */ | ||
897 | { 0x0000, 0x0000 }, /* R893 */ | ||
898 | { 0x0000, 0x0000 }, /* R894 */ | ||
899 | { 0x0000, 0x0000 }, /* R895 */ | ||
900 | { 0x0000, 0x0000 }, /* R896 */ | ||
901 | { 0x0000, 0x0000 }, /* R897 */ | ||
902 | { 0x0000, 0x0000 }, /* R898 */ | ||
903 | { 0x0000, 0x0000 }, /* R899 */ | ||
904 | { 0x0000, 0x0000 }, /* R900 */ | ||
905 | { 0x0000, 0x0000 }, /* R901 */ | ||
906 | { 0x0000, 0x0000 }, /* R902 */ | ||
907 | { 0x0000, 0x0000 }, /* R903 */ | ||
908 | { 0x0000, 0x0000 }, /* R904 */ | ||
909 | { 0x0000, 0x0000 }, /* R905 */ | ||
910 | { 0x0000, 0x0000 }, /* R906 */ | ||
911 | { 0x0000, 0x0000 }, /* R907 */ | ||
912 | { 0x0000, 0x0000 }, /* R908 */ | ||
913 | { 0x0000, 0x0000 }, /* R909 */ | ||
914 | { 0x0000, 0x0000 }, /* R910 */ | ||
915 | { 0x0000, 0x0000 }, /* R911 */ | ||
916 | { 0x0000, 0x0000 }, /* R912 */ | ||
917 | { 0x0000, 0x0000 }, /* R913 */ | ||
918 | { 0x0000, 0x0000 }, /* R914 */ | ||
919 | { 0x0000, 0x0000 }, /* R915 */ | ||
920 | { 0x0000, 0x0000 }, /* R916 */ | ||
921 | { 0x0000, 0x0000 }, /* R917 */ | ||
922 | { 0x0000, 0x0000 }, /* R918 */ | ||
923 | { 0x0000, 0x0000 }, /* R919 */ | ||
924 | { 0x0000, 0x0000 }, /* R920 */ | ||
925 | { 0x0000, 0x0000 }, /* R921 */ | ||
926 | { 0x0000, 0x0000 }, /* R922 */ | ||
927 | { 0x0000, 0x0000 }, /* R923 */ | ||
928 | { 0x0000, 0x0000 }, /* R924 */ | ||
929 | { 0x0000, 0x0000 }, /* R925 */ | ||
930 | { 0x0000, 0x0000 }, /* R926 */ | ||
931 | { 0x0000, 0x0000 }, /* R927 */ | ||
932 | { 0x0000, 0x0000 }, /* R928 */ | ||
933 | { 0x0000, 0x0000 }, /* R929 */ | ||
934 | { 0x0000, 0x0000 }, /* R930 */ | ||
935 | { 0x0000, 0x0000 }, /* R931 */ | ||
936 | { 0x0000, 0x0000 }, /* R932 */ | ||
937 | { 0x0000, 0x0000 }, /* R933 */ | ||
938 | { 0x0000, 0x0000 }, /* R934 */ | ||
939 | { 0x0000, 0x0000 }, /* R935 */ | ||
940 | { 0x0000, 0x0000 }, /* R936 */ | ||
941 | { 0x0000, 0x0000 }, /* R937 */ | ||
942 | { 0x0000, 0x0000 }, /* R938 */ | ||
943 | { 0x0000, 0x0000 }, /* R939 */ | ||
944 | { 0x0000, 0x0000 }, /* R940 */ | ||
945 | { 0x0000, 0x0000 }, /* R941 */ | ||
946 | { 0x0000, 0x0000 }, /* R942 */ | ||
947 | { 0x0000, 0x0000 }, /* R943 */ | ||
948 | { 0x0000, 0x0000 }, /* R944 */ | ||
949 | { 0x0000, 0x0000 }, /* R945 */ | ||
950 | { 0x0000, 0x0000 }, /* R946 */ | ||
951 | { 0x0000, 0x0000 }, /* R947 */ | ||
952 | { 0x0000, 0x0000 }, /* R948 */ | ||
953 | { 0x0000, 0x0000 }, /* R949 */ | ||
954 | { 0x0000, 0x0000 }, /* R950 */ | ||
955 | { 0x0000, 0x0000 }, /* R951 */ | ||
956 | { 0x0000, 0x0000 }, /* R952 */ | ||
957 | { 0x0000, 0x0000 }, /* R953 */ | ||
958 | { 0x0000, 0x0000 }, /* R954 */ | ||
959 | { 0x0000, 0x0000 }, /* R955 */ | ||
960 | { 0x0000, 0x0000 }, /* R956 */ | ||
961 | { 0x0000, 0x0000 }, /* R957 */ | ||
962 | { 0x0000, 0x0000 }, /* R958 */ | ||
963 | { 0x0000, 0x0000 }, /* R959 */ | ||
964 | { 0x0000, 0x0000 }, /* R960 */ | ||
965 | { 0x0000, 0x0000 }, /* R961 */ | ||
966 | { 0x0000, 0x0000 }, /* R962 */ | ||
967 | { 0x0000, 0x0000 }, /* R963 */ | ||
968 | { 0x0000, 0x0000 }, /* R964 */ | ||
969 | { 0x0000, 0x0000 }, /* R965 */ | ||
970 | { 0x0000, 0x0000 }, /* R966 */ | ||
971 | { 0x0000, 0x0000 }, /* R967 */ | ||
972 | { 0x0000, 0x0000 }, /* R968 */ | ||
973 | { 0x0000, 0x0000 }, /* R969 */ | ||
974 | { 0x0000, 0x0000 }, /* R970 */ | ||
975 | { 0x0000, 0x0000 }, /* R971 */ | ||
976 | { 0x0000, 0x0000 }, /* R972 */ | ||
977 | { 0x0000, 0x0000 }, /* R973 */ | ||
978 | { 0x0000, 0x0000 }, /* R974 */ | ||
979 | { 0x0000, 0x0000 }, /* R975 */ | ||
980 | { 0x0000, 0x0000 }, /* R976 */ | ||
981 | { 0x0000, 0x0000 }, /* R977 */ | ||
982 | { 0x0000, 0x0000 }, /* R978 */ | ||
983 | { 0x0000, 0x0000 }, /* R979 */ | ||
984 | { 0x0000, 0x0000 }, /* R980 */ | ||
985 | { 0x0000, 0x0000 }, /* R981 */ | ||
986 | { 0x0000, 0x0000 }, /* R982 */ | ||
987 | { 0x0000, 0x0000 }, /* R983 */ | ||
988 | { 0x0000, 0x0000 }, /* R984 */ | ||
989 | { 0x0000, 0x0000 }, /* R985 */ | ||
990 | { 0x0000, 0x0000 }, /* R986 */ | ||
991 | { 0x0000, 0x0000 }, /* R987 */ | ||
992 | { 0x0000, 0x0000 }, /* R988 */ | ||
993 | { 0x0000, 0x0000 }, /* R989 */ | ||
994 | { 0x0000, 0x0000 }, /* R990 */ | ||
995 | { 0x0000, 0x0000 }, /* R991 */ | ||
996 | { 0x0000, 0x0000 }, /* R992 */ | ||
997 | { 0x0000, 0x0000 }, /* R993 */ | ||
998 | { 0x0000, 0x0000 }, /* R994 */ | ||
999 | { 0x0000, 0x0000 }, /* R995 */ | ||
1000 | { 0x0000, 0x0000 }, /* R996 */ | ||
1001 | { 0x0000, 0x0000 }, /* R997 */ | ||
1002 | { 0x0000, 0x0000 }, /* R998 */ | ||
1003 | { 0x0000, 0x0000 }, /* R999 */ | ||
1004 | { 0x0000, 0x0000 }, /* R1000 */ | ||
1005 | { 0x0000, 0x0000 }, /* R1001 */ | ||
1006 | { 0x0000, 0x0000 }, /* R1002 */ | ||
1007 | { 0x0000, 0x0000 }, /* R1003 */ | ||
1008 | { 0x0000, 0x0000 }, /* R1004 */ | ||
1009 | { 0x0000, 0x0000 }, /* R1005 */ | ||
1010 | { 0x0000, 0x0000 }, /* R1006 */ | ||
1011 | { 0x0000, 0x0000 }, /* R1007 */ | ||
1012 | { 0x0000, 0x0000 }, /* R1008 */ | ||
1013 | { 0x0000, 0x0000 }, /* R1009 */ | ||
1014 | { 0x0000, 0x0000 }, /* R1010 */ | ||
1015 | { 0x0000, 0x0000 }, /* R1011 */ | ||
1016 | { 0x0000, 0x0000 }, /* R1012 */ | ||
1017 | { 0x0000, 0x0000 }, /* R1013 */ | ||
1018 | { 0x0000, 0x0000 }, /* R1014 */ | ||
1019 | { 0x0000, 0x0000 }, /* R1015 */ | ||
1020 | { 0x0000, 0x0000 }, /* R1016 */ | ||
1021 | { 0x0000, 0x0000 }, /* R1017 */ | ||
1022 | { 0x0000, 0x0000 }, /* R1018 */ | ||
1023 | { 0x0000, 0x0000 }, /* R1019 */ | ||
1024 | { 0x0000, 0x0000 }, /* R1020 */ | ||
1025 | { 0x0000, 0x0000 }, /* R1021 */ | ||
1026 | { 0x0000, 0x0000 }, /* R1022 */ | ||
1027 | { 0x0000, 0x0000 }, /* R1023 */ | ||
1028 | { 0x00FF, 0x01FF }, /* R1024 - AIF1 ADC1 Left Volume */ | ||
1029 | { 0x00FF, 0x01FF }, /* R1025 - AIF1 ADC1 Right Volume */ | ||
1030 | { 0x00FF, 0x01FF }, /* R1026 - AIF1 DAC1 Left Volume */ | ||
1031 | { 0x00FF, 0x01FF }, /* R1027 - AIF1 DAC1 Right Volume */ | ||
1032 | { 0x00FF, 0x01FF }, /* R1028 - AIF1 ADC2 Left Volume */ | ||
1033 | { 0x00FF, 0x01FF }, /* R1029 - AIF1 ADC2 Right Volume */ | ||
1034 | { 0x00FF, 0x01FF }, /* R1030 - AIF1 DAC2 Left Volume */ | ||
1035 | { 0x00FF, 0x01FF }, /* R1031 - AIF1 DAC2 Right Volume */ | ||
1036 | { 0x0000, 0x0000 }, /* R1032 */ | ||
1037 | { 0x0000, 0x0000 }, /* R1033 */ | ||
1038 | { 0x0000, 0x0000 }, /* R1034 */ | ||
1039 | { 0x0000, 0x0000 }, /* R1035 */ | ||
1040 | { 0x0000, 0x0000 }, /* R1036 */ | ||
1041 | { 0x0000, 0x0000 }, /* R1037 */ | ||
1042 | { 0x0000, 0x0000 }, /* R1038 */ | ||
1043 | { 0x0000, 0x0000 }, /* R1039 */ | ||
1044 | { 0xF800, 0xF800 }, /* R1040 - AIF1 ADC1 Filters */ | ||
1045 | { 0x7800, 0x7800 }, /* R1041 - AIF1 ADC2 Filters */ | ||
1046 | { 0x0000, 0x0000 }, /* R1042 */ | ||
1047 | { 0x0000, 0x0000 }, /* R1043 */ | ||
1048 | { 0x0000, 0x0000 }, /* R1044 */ | ||
1049 | { 0x0000, 0x0000 }, /* R1045 */ | ||
1050 | { 0x0000, 0x0000 }, /* R1046 */ | ||
1051 | { 0x0000, 0x0000 }, /* R1047 */ | ||
1052 | { 0x0000, 0x0000 }, /* R1048 */ | ||
1053 | { 0x0000, 0x0000 }, /* R1049 */ | ||
1054 | { 0x0000, 0x0000 }, /* R1050 */ | ||
1055 | { 0x0000, 0x0000 }, /* R1051 */ | ||
1056 | { 0x0000, 0x0000 }, /* R1052 */ | ||
1057 | { 0x0000, 0x0000 }, /* R1053 */ | ||
1058 | { 0x0000, 0x0000 }, /* R1054 */ | ||
1059 | { 0x0000, 0x0000 }, /* R1055 */ | ||
1060 | { 0x02B6, 0x02B6 }, /* R1056 - AIF1 DAC1 Filters (1) */ | ||
1061 | { 0x3F00, 0x3F00 }, /* R1057 - AIF1 DAC1 Filters (2) */ | ||
1062 | { 0x02B6, 0x02B6 }, /* R1058 - AIF1 DAC2 Filters (1) */ | ||
1063 | { 0x3F00, 0x3F00 }, /* R1059 - AIF1 DAC2 Filters (2) */ | ||
1064 | { 0x0000, 0x0000 }, /* R1060 */ | ||
1065 | { 0x0000, 0x0000 }, /* R1061 */ | ||
1066 | { 0x0000, 0x0000 }, /* R1062 */ | ||
1067 | { 0x0000, 0x0000 }, /* R1063 */ | ||
1068 | { 0x0000, 0x0000 }, /* R1064 */ | ||
1069 | { 0x0000, 0x0000 }, /* R1065 */ | ||
1070 | { 0x0000, 0x0000 }, /* R1066 */ | ||
1071 | { 0x0000, 0x0000 }, /* R1067 */ | ||
1072 | { 0x0000, 0x0000 }, /* R1068 */ | ||
1073 | { 0x0000, 0x0000 }, /* R1069 */ | ||
1074 | { 0x0000, 0x0000 }, /* R1070 */ | ||
1075 | { 0x0000, 0x0000 }, /* R1071 */ | ||
1076 | { 0x006F, 0x006F }, /* R1072 - AIF1 DAC1 Noise Gate */ | ||
1077 | { 0x006F, 0x006F }, /* R1073 - AIF1 DAC2 Noise Gate */ | ||
1078 | { 0x0000, 0x0000 }, /* R1074 */ | ||
1079 | { 0x0000, 0x0000 }, /* R1075 */ | ||
1080 | { 0x0000, 0x0000 }, /* R1076 */ | ||
1081 | { 0x0000, 0x0000 }, /* R1077 */ | ||
1082 | { 0x0000, 0x0000 }, /* R1078 */ | ||
1083 | { 0x0000, 0x0000 }, /* R1079 */ | ||
1084 | { 0x0000, 0x0000 }, /* R1080 */ | ||
1085 | { 0x0000, 0x0000 }, /* R1081 */ | ||
1086 | { 0x0000, 0x0000 }, /* R1082 */ | ||
1087 | { 0x0000, 0x0000 }, /* R1083 */ | ||
1088 | { 0x0000, 0x0000 }, /* R1084 */ | ||
1089 | { 0x0000, 0x0000 }, /* R1085 */ | ||
1090 | { 0x0000, 0x0000 }, /* R1086 */ | ||
1091 | { 0x0000, 0x0000 }, /* R1087 */ | ||
1092 | { 0xFFFF, 0xFFFF }, /* R1088 - AIF1 DRC1 (1) */ | ||
1093 | { 0x1FFF, 0x1FFF }, /* R1089 - AIF1 DRC1 (2) */ | ||
1094 | { 0xFFFF, 0xFFFF }, /* R1090 - AIF1 DRC1 (3) */ | ||
1095 | { 0x07FF, 0x07FF }, /* R1091 - AIF1 DRC1 (4) */ | ||
1096 | { 0x03FF, 0x03FF }, /* R1092 - AIF1 DRC1 (5) */ | ||
1097 | { 0x0000, 0x0000 }, /* R1093 */ | ||
1098 | { 0x0000, 0x0000 }, /* R1094 */ | ||
1099 | { 0x0000, 0x0000 }, /* R1095 */ | ||
1100 | { 0x0000, 0x0000 }, /* R1096 */ | ||
1101 | { 0x0000, 0x0000 }, /* R1097 */ | ||
1102 | { 0x0000, 0x0000 }, /* R1098 */ | ||
1103 | { 0x0000, 0x0000 }, /* R1099 */ | ||
1104 | { 0x0000, 0x0000 }, /* R1100 */ | ||
1105 | { 0x0000, 0x0000 }, /* R1101 */ | ||
1106 | { 0x0000, 0x0000 }, /* R1102 */ | ||
1107 | { 0x0000, 0x0000 }, /* R1103 */ | ||
1108 | { 0xFFFF, 0xFFFF }, /* R1104 - AIF1 DRC2 (1) */ | ||
1109 | { 0x1FFF, 0x1FFF }, /* R1105 - AIF1 DRC2 (2) */ | ||
1110 | { 0xFFFF, 0xFFFF }, /* R1106 - AIF1 DRC2 (3) */ | ||
1111 | { 0x07FF, 0x07FF }, /* R1107 - AIF1 DRC2 (4) */ | ||
1112 | { 0x03FF, 0x03FF }, /* R1108 - AIF1 DRC2 (5) */ | ||
1113 | { 0x0000, 0x0000 }, /* R1109 */ | ||
1114 | { 0x0000, 0x0000 }, /* R1110 */ | ||
1115 | { 0x0000, 0x0000 }, /* R1111 */ | ||
1116 | { 0x0000, 0x0000 }, /* R1112 */ | ||
1117 | { 0x0000, 0x0000 }, /* R1113 */ | ||
1118 | { 0x0000, 0x0000 }, /* R1114 */ | ||
1119 | { 0x0000, 0x0000 }, /* R1115 */ | ||
1120 | { 0x0000, 0x0000 }, /* R1116 */ | ||
1121 | { 0x0000, 0x0000 }, /* R1117 */ | ||
1122 | { 0x0000, 0x0000 }, /* R1118 */ | ||
1123 | { 0x0000, 0x0000 }, /* R1119 */ | ||
1124 | { 0x0000, 0x0000 }, /* R1120 */ | ||
1125 | { 0x0000, 0x0000 }, /* R1121 */ | ||
1126 | { 0x0000, 0x0000 }, /* R1122 */ | ||
1127 | { 0x0000, 0x0000 }, /* R1123 */ | ||
1128 | { 0x0000, 0x0000 }, /* R1124 */ | ||
1129 | { 0x0000, 0x0000 }, /* R1125 */ | ||
1130 | { 0x0000, 0x0000 }, /* R1126 */ | ||
1131 | { 0x0000, 0x0000 }, /* R1127 */ | ||
1132 | { 0x0000, 0x0000 }, /* R1128 */ | ||
1133 | { 0x0000, 0x0000 }, /* R1129 */ | ||
1134 | { 0x0000, 0x0000 }, /* R1130 */ | ||
1135 | { 0x0000, 0x0000 }, /* R1131 */ | ||
1136 | { 0x0000, 0x0000 }, /* R1132 */ | ||
1137 | { 0x0000, 0x0000 }, /* R1133 */ | ||
1138 | { 0x0000, 0x0000 }, /* R1134 */ | ||
1139 | { 0x0000, 0x0000 }, /* R1135 */ | ||
1140 | { 0x0000, 0x0000 }, /* R1136 */ | ||
1141 | { 0x0000, 0x0000 }, /* R1137 */ | ||
1142 | { 0x0000, 0x0000 }, /* R1138 */ | ||
1143 | { 0x0000, 0x0000 }, /* R1139 */ | ||
1144 | { 0x0000, 0x0000 }, /* R1140 */ | ||
1145 | { 0x0000, 0x0000 }, /* R1141 */ | ||
1146 | { 0x0000, 0x0000 }, /* R1142 */ | ||
1147 | { 0x0000, 0x0000 }, /* R1143 */ | ||
1148 | { 0x0000, 0x0000 }, /* R1144 */ | ||
1149 | { 0x0000, 0x0000 }, /* R1145 */ | ||
1150 | { 0x0000, 0x0000 }, /* R1146 */ | ||
1151 | { 0x0000, 0x0000 }, /* R1147 */ | ||
1152 | { 0x0000, 0x0000 }, /* R1148 */ | ||
1153 | { 0x0000, 0x0000 }, /* R1149 */ | ||
1154 | { 0x0000, 0x0000 }, /* R1150 */ | ||
1155 | { 0x0000, 0x0000 }, /* R1151 */ | ||
1156 | { 0xFFFF, 0xFFFF }, /* R1152 - AIF1 DAC1 EQ Gains (1) */ | ||
1157 | { 0xFFC0, 0xFFC0 }, /* R1153 - AIF1 DAC1 EQ Gains (2) */ | ||
1158 | { 0xFFFF, 0xFFFF }, /* R1154 - AIF1 DAC1 EQ Band 1 A */ | ||
1159 | { 0xFFFF, 0xFFFF }, /* R1155 - AIF1 DAC1 EQ Band 1 B */ | ||
1160 | { 0xFFFF, 0xFFFF }, /* R1156 - AIF1 DAC1 EQ Band 1 PG */ | ||
1161 | { 0xFFFF, 0xFFFF }, /* R1157 - AIF1 DAC1 EQ Band 2 A */ | ||
1162 | { 0xFFFF, 0xFFFF }, /* R1158 - AIF1 DAC1 EQ Band 2 B */ | ||
1163 | { 0xFFFF, 0xFFFF }, /* R1159 - AIF1 DAC1 EQ Band 2 C */ | ||
1164 | { 0xFFFF, 0xFFFF }, /* R1160 - AIF1 DAC1 EQ Band 2 PG */ | ||
1165 | { 0xFFFF, 0xFFFF }, /* R1161 - AIF1 DAC1 EQ Band 3 A */ | ||
1166 | { 0xFFFF, 0xFFFF }, /* R1162 - AIF1 DAC1 EQ Band 3 B */ | ||
1167 | { 0xFFFF, 0xFFFF }, /* R1163 - AIF1 DAC1 EQ Band 3 C */ | ||
1168 | { 0xFFFF, 0xFFFF }, /* R1164 - AIF1 DAC1 EQ Band 3 PG */ | ||
1169 | { 0xFFFF, 0xFFFF }, /* R1165 - AIF1 DAC1 EQ Band 4 A */ | ||
1170 | { 0xFFFF, 0xFFFF }, /* R1166 - AIF1 DAC1 EQ Band 4 B */ | ||
1171 | { 0xFFFF, 0xFFFF }, /* R1167 - AIF1 DAC1 EQ Band 4 C */ | ||
1172 | { 0xFFFF, 0xFFFF }, /* R1168 - AIF1 DAC1 EQ Band 4 PG */ | ||
1173 | { 0xFFFF, 0xFFFF }, /* R1169 - AIF1 DAC1 EQ Band 5 A */ | ||
1174 | { 0xFFFF, 0xFFFF }, /* R1170 - AIF1 DAC1 EQ Band 5 B */ | ||
1175 | { 0xFFFF, 0xFFFF }, /* R1171 - AIF1 DAC1 EQ Band 5 PG */ | ||
1176 | { 0x0000, 0x0000 }, /* R1172 */ | ||
1177 | { 0x0000, 0x0000 }, /* R1173 */ | ||
1178 | { 0x0000, 0x0000 }, /* R1174 */ | ||
1179 | { 0x0000, 0x0000 }, /* R1175 */ | ||
1180 | { 0x0000, 0x0000 }, /* R1176 */ | ||
1181 | { 0x0000, 0x0000 }, /* R1177 */ | ||
1182 | { 0x0000, 0x0000 }, /* R1178 */ | ||
1183 | { 0x0000, 0x0000 }, /* R1179 */ | ||
1184 | { 0x0000, 0x0000 }, /* R1180 */ | ||
1185 | { 0x0000, 0x0000 }, /* R1181 */ | ||
1186 | { 0x0000, 0x0000 }, /* R1182 */ | ||
1187 | { 0x0000, 0x0000 }, /* R1183 */ | ||
1188 | { 0xFFFF, 0xFFFF }, /* R1184 - AIF1 DAC2 EQ Gains (1) */ | ||
1189 | { 0xFFC0, 0xFFC0 }, /* R1185 - AIF1 DAC2 EQ Gains (2) */ | ||
1190 | { 0xFFFF, 0xFFFF }, /* R1186 - AIF1 DAC2 EQ Band 1 A */ | ||
1191 | { 0xFFFF, 0xFFFF }, /* R1187 - AIF1 DAC2 EQ Band 1 B */ | ||
1192 | { 0xFFFF, 0xFFFF }, /* R1188 - AIF1 DAC2 EQ Band 1 PG */ | ||
1193 | { 0xFFFF, 0xFFFF }, /* R1189 - AIF1 DAC2 EQ Band 2 A */ | ||
1194 | { 0xFFFF, 0xFFFF }, /* R1190 - AIF1 DAC2 EQ Band 2 B */ | ||
1195 | { 0xFFFF, 0xFFFF }, /* R1191 - AIF1 DAC2 EQ Band 2 C */ | ||
1196 | { 0xFFFF, 0xFFFF }, /* R1192 - AIF1 DAC2 EQ Band 2 PG */ | ||
1197 | { 0xFFFF, 0xFFFF }, /* R1193 - AIF1 DAC2 EQ Band 3 A */ | ||
1198 | { 0xFFFF, 0xFFFF }, /* R1194 - AIF1 DAC2 EQ Band 3 B */ | ||
1199 | { 0xFFFF, 0xFFFF }, /* R1195 - AIF1 DAC2 EQ Band 3 C */ | ||
1200 | { 0xFFFF, 0xFFFF }, /* R1196 - AIF1 DAC2 EQ Band 3 PG */ | ||
1201 | { 0xFFFF, 0xFFFF }, /* R1197 - AIF1 DAC2 EQ Band 4 A */ | ||
1202 | { 0xFFFF, 0xFFFF }, /* R1198 - AIF1 DAC2 EQ Band 4 B */ | ||
1203 | { 0xFFFF, 0xFFFF }, /* R1199 - AIF1 DAC2 EQ Band 4 C */ | ||
1204 | { 0xFFFF, 0xFFFF }, /* R1200 - AIF1 DAC2 EQ Band 4 PG */ | ||
1205 | { 0xFFFF, 0xFFFF }, /* R1201 - AIF1 DAC2 EQ Band 5 A */ | ||
1206 | { 0xFFFF, 0xFFFF }, /* R1202 - AIF1 DAC2 EQ Band 5 B */ | ||
1207 | { 0xFFFF, 0xFFFF }, /* R1203 - AIF1 DAC2 EQ Band 5 PG */ | ||
1208 | { 0x0000, 0x0000 }, /* R1204 */ | ||
1209 | { 0x0000, 0x0000 }, /* R1205 */ | ||
1210 | { 0x0000, 0x0000 }, /* R1206 */ | ||
1211 | { 0x0000, 0x0000 }, /* R1207 */ | ||
1212 | { 0x0000, 0x0000 }, /* R1208 */ | ||
1213 | { 0x0000, 0x0000 }, /* R1209 */ | ||
1214 | { 0x0000, 0x0000 }, /* R1210 */ | ||
1215 | { 0x0000, 0x0000 }, /* R1211 */ | ||
1216 | { 0x0000, 0x0000 }, /* R1212 */ | ||
1217 | { 0x0000, 0x0000 }, /* R1213 */ | ||
1218 | { 0x0000, 0x0000 }, /* R1214 */ | ||
1219 | { 0x0000, 0x0000 }, /* R1215 */ | ||
1220 | { 0x0000, 0x0000 }, /* R1216 */ | ||
1221 | { 0x0000, 0x0000 }, /* R1217 */ | ||
1222 | { 0x0000, 0x0000 }, /* R1218 */ | ||
1223 | { 0x0000, 0x0000 }, /* R1219 */ | ||
1224 | { 0x0000, 0x0000 }, /* R1220 */ | ||
1225 | { 0x0000, 0x0000 }, /* R1221 */ | ||
1226 | { 0x0000, 0x0000 }, /* R1222 */ | ||
1227 | { 0x0000, 0x0000 }, /* R1223 */ | ||
1228 | { 0x0000, 0x0000 }, /* R1224 */ | ||
1229 | { 0x0000, 0x0000 }, /* R1225 */ | ||
1230 | { 0x0000, 0x0000 }, /* R1226 */ | ||
1231 | { 0x0000, 0x0000 }, /* R1227 */ | ||
1232 | { 0x0000, 0x0000 }, /* R1228 */ | ||
1233 | { 0x0000, 0x0000 }, /* R1229 */ | ||
1234 | { 0x0000, 0x0000 }, /* R1230 */ | ||
1235 | { 0x0000, 0x0000 }, /* R1231 */ | ||
1236 | { 0x0000, 0x0000 }, /* R1232 */ | ||
1237 | { 0x0000, 0x0000 }, /* R1233 */ | ||
1238 | { 0x0000, 0x0000 }, /* R1234 */ | ||
1239 | { 0x0000, 0x0000 }, /* R1235 */ | ||
1240 | { 0x0000, 0x0000 }, /* R1236 */ | ||
1241 | { 0x0000, 0x0000 }, /* R1237 */ | ||
1242 | { 0x0000, 0x0000 }, /* R1238 */ | ||
1243 | { 0x0000, 0x0000 }, /* R1239 */ | ||
1244 | { 0x0000, 0x0000 }, /* R1240 */ | ||
1245 | { 0x0000, 0x0000 }, /* R1241 */ | ||
1246 | { 0x0000, 0x0000 }, /* R1242 */ | ||
1247 | { 0x0000, 0x0000 }, /* R1243 */ | ||
1248 | { 0x0000, 0x0000 }, /* R1244 */ | ||
1249 | { 0x0000, 0x0000 }, /* R1245 */ | ||
1250 | { 0x0000, 0x0000 }, /* R1246 */ | ||
1251 | { 0x0000, 0x0000 }, /* R1247 */ | ||
1252 | { 0x0000, 0x0000 }, /* R1248 */ | ||
1253 | { 0x0000, 0x0000 }, /* R1249 */ | ||
1254 | { 0x0000, 0x0000 }, /* R1250 */ | ||
1255 | { 0x0000, 0x0000 }, /* R1251 */ | ||
1256 | { 0x0000, 0x0000 }, /* R1252 */ | ||
1257 | { 0x0000, 0x0000 }, /* R1253 */ | ||
1258 | { 0x0000, 0x0000 }, /* R1254 */ | ||
1259 | { 0x0000, 0x0000 }, /* R1255 */ | ||
1260 | { 0x0000, 0x0000 }, /* R1256 */ | ||
1261 | { 0x0000, 0x0000 }, /* R1257 */ | ||
1262 | { 0x0000, 0x0000 }, /* R1258 */ | ||
1263 | { 0x0000, 0x0000 }, /* R1259 */ | ||
1264 | { 0x0000, 0x0000 }, /* R1260 */ | ||
1265 | { 0x0000, 0x0000 }, /* R1261 */ | ||
1266 | { 0x0000, 0x0000 }, /* R1262 */ | ||
1267 | { 0x0000, 0x0000 }, /* R1263 */ | ||
1268 | { 0x0000, 0x0000 }, /* R1264 */ | ||
1269 | { 0x0000, 0x0000 }, /* R1265 */ | ||
1270 | { 0x0000, 0x0000 }, /* R1266 */ | ||
1271 | { 0x0000, 0x0000 }, /* R1267 */ | ||
1272 | { 0x0000, 0x0000 }, /* R1268 */ | ||
1273 | { 0x0000, 0x0000 }, /* R1269 */ | ||
1274 | { 0x0000, 0x0000 }, /* R1270 */ | ||
1275 | { 0x0000, 0x0000 }, /* R1271 */ | ||
1276 | { 0x0000, 0x0000 }, /* R1272 */ | ||
1277 | { 0x0000, 0x0000 }, /* R1273 */ | ||
1278 | { 0x0000, 0x0000 }, /* R1274 */ | ||
1279 | { 0x0000, 0x0000 }, /* R1275 */ | ||
1280 | { 0x0000, 0x0000 }, /* R1276 */ | ||
1281 | { 0x0000, 0x0000 }, /* R1277 */ | ||
1282 | { 0x0000, 0x0000 }, /* R1278 */ | ||
1283 | { 0x0000, 0x0000 }, /* R1279 */ | ||
1284 | { 0x00FF, 0x01FF }, /* R1280 - AIF2 ADC Left Volume */ | ||
1285 | { 0x00FF, 0x01FF }, /* R1281 - AIF2 ADC Right Volume */ | ||
1286 | { 0x00FF, 0x01FF }, /* R1282 - AIF2 DAC Left Volume */ | ||
1287 | { 0x00FF, 0x01FF }, /* R1283 - AIF2 DAC Right Volume */ | ||
1288 | { 0x0000, 0x0000 }, /* R1284 */ | ||
1289 | { 0x0000, 0x0000 }, /* R1285 */ | ||
1290 | { 0x0000, 0x0000 }, /* R1286 */ | ||
1291 | { 0x0000, 0x0000 }, /* R1287 */ | ||
1292 | { 0x0000, 0x0000 }, /* R1288 */ | ||
1293 | { 0x0000, 0x0000 }, /* R1289 */ | ||
1294 | { 0x0000, 0x0000 }, /* R1290 */ | ||
1295 | { 0x0000, 0x0000 }, /* R1291 */ | ||
1296 | { 0x0000, 0x0000 }, /* R1292 */ | ||
1297 | { 0x0000, 0x0000 }, /* R1293 */ | ||
1298 | { 0x0000, 0x0000 }, /* R1294 */ | ||
1299 | { 0x0000, 0x0000 }, /* R1295 */ | ||
1300 | { 0xF800, 0xF800 }, /* R1296 - AIF2 ADC Filters */ | ||
1301 | { 0x0000, 0x0000 }, /* R1297 */ | ||
1302 | { 0x0000, 0x0000 }, /* R1298 */ | ||
1303 | { 0x0000, 0x0000 }, /* R1299 */ | ||
1304 | { 0x0000, 0x0000 }, /* R1300 */ | ||
1305 | { 0x0000, 0x0000 }, /* R1301 */ | ||
1306 | { 0x0000, 0x0000 }, /* R1302 */ | ||
1307 | { 0x0000, 0x0000 }, /* R1303 */ | ||
1308 | { 0x0000, 0x0000 }, /* R1304 */ | ||
1309 | { 0x0000, 0x0000 }, /* R1305 */ | ||
1310 | { 0x0000, 0x0000 }, /* R1306 */ | ||
1311 | { 0x0000, 0x0000 }, /* R1307 */ | ||
1312 | { 0x0000, 0x0000 }, /* R1308 */ | ||
1313 | { 0x0000, 0x0000 }, /* R1309 */ | ||
1314 | { 0x0000, 0x0000 }, /* R1310 */ | ||
1315 | { 0x0000, 0x0000 }, /* R1311 */ | ||
1316 | { 0x02B6, 0x02B6 }, /* R1312 - AIF2 DAC Filters (1) */ | ||
1317 | { 0x3F00, 0x3F00 }, /* R1313 - AIF2 DAC Filters (2) */ | ||
1318 | { 0x0000, 0x0000 }, /* R1314 */ | ||
1319 | { 0x0000, 0x0000 }, /* R1315 */ | ||
1320 | { 0x0000, 0x0000 }, /* R1316 */ | ||
1321 | { 0x0000, 0x0000 }, /* R1317 */ | ||
1322 | { 0x0000, 0x0000 }, /* R1318 */ | ||
1323 | { 0x0000, 0x0000 }, /* R1319 */ | ||
1324 | { 0x0000, 0x0000 }, /* R1320 */ | ||
1325 | { 0x0000, 0x0000 }, /* R1321 */ | ||
1326 | { 0x0000, 0x0000 }, /* R1322 */ | ||
1327 | { 0x0000, 0x0000 }, /* R1323 */ | ||
1328 | { 0x0000, 0x0000 }, /* R1324 */ | ||
1329 | { 0x0000, 0x0000 }, /* R1325 */ | ||
1330 | { 0x0000, 0x0000 }, /* R1326 */ | ||
1331 | { 0x0000, 0x0000 }, /* R1327 */ | ||
1332 | { 0x006F, 0x006F }, /* R1328 - AIF2 DAC Noise Gate */ | ||
1333 | { 0x0000, 0x0000 }, /* R1329 */ | ||
1334 | { 0x0000, 0x0000 }, /* R1330 */ | ||
1335 | { 0x0000, 0x0000 }, /* R1331 */ | ||
1336 | { 0x0000, 0x0000 }, /* R1332 */ | ||
1337 | { 0x0000, 0x0000 }, /* R1333 */ | ||
1338 | { 0x0000, 0x0000 }, /* R1334 */ | ||
1339 | { 0x0000, 0x0000 }, /* R1335 */ | ||
1340 | { 0x0000, 0x0000 }, /* R1336 */ | ||
1341 | { 0x0000, 0x0000 }, /* R1337 */ | ||
1342 | { 0x0000, 0x0000 }, /* R1338 */ | ||
1343 | { 0x0000, 0x0000 }, /* R1339 */ | ||
1344 | { 0x0000, 0x0000 }, /* R1340 */ | ||
1345 | { 0x0000, 0x0000 }, /* R1341 */ | ||
1346 | { 0x0000, 0x0000 }, /* R1342 */ | ||
1347 | { 0x0000, 0x0000 }, /* R1343 */ | ||
1348 | { 0xFFFF, 0xFFFF }, /* R1344 - AIF2 DRC (1) */ | ||
1349 | { 0x1FFF, 0x1FFF }, /* R1345 - AIF2 DRC (2) */ | ||
1350 | { 0xFFFF, 0xFFFF }, /* R1346 - AIF2 DRC (3) */ | ||
1351 | { 0x07FF, 0x07FF }, /* R1347 - AIF2 DRC (4) */ | ||
1352 | { 0x03FF, 0x03FF }, /* R1348 - AIF2 DRC (5) */ | ||
1353 | { 0x0000, 0x0000 }, /* R1349 */ | ||
1354 | { 0x0000, 0x0000 }, /* R1350 */ | ||
1355 | { 0x0000, 0x0000 }, /* R1351 */ | ||
1356 | { 0x0000, 0x0000 }, /* R1352 */ | ||
1357 | { 0x0000, 0x0000 }, /* R1353 */ | ||
1358 | { 0x0000, 0x0000 }, /* R1354 */ | ||
1359 | { 0x0000, 0x0000 }, /* R1355 */ | ||
1360 | { 0x0000, 0x0000 }, /* R1356 */ | ||
1361 | { 0x0000, 0x0000 }, /* R1357 */ | ||
1362 | { 0x0000, 0x0000 }, /* R1358 */ | ||
1363 | { 0x0000, 0x0000 }, /* R1359 */ | ||
1364 | { 0x0000, 0x0000 }, /* R1360 */ | ||
1365 | { 0x0000, 0x0000 }, /* R1361 */ | ||
1366 | { 0x0000, 0x0000 }, /* R1362 */ | ||
1367 | { 0x0000, 0x0000 }, /* R1363 */ | ||
1368 | { 0x0000, 0x0000 }, /* R1364 */ | ||
1369 | { 0x0000, 0x0000 }, /* R1365 */ | ||
1370 | { 0x0000, 0x0000 }, /* R1366 */ | ||
1371 | { 0x0000, 0x0000 }, /* R1367 */ | ||
1372 | { 0x0000, 0x0000 }, /* R1368 */ | ||
1373 | { 0x0000, 0x0000 }, /* R1369 */ | ||
1374 | { 0x0000, 0x0000 }, /* R1370 */ | ||
1375 | { 0x0000, 0x0000 }, /* R1371 */ | ||
1376 | { 0x0000, 0x0000 }, /* R1372 */ | ||
1377 | { 0x0000, 0x0000 }, /* R1373 */ | ||
1378 | { 0x0000, 0x0000 }, /* R1374 */ | ||
1379 | { 0x0000, 0x0000 }, /* R1375 */ | ||
1380 | { 0x0000, 0x0000 }, /* R1376 */ | ||
1381 | { 0x0000, 0x0000 }, /* R1377 */ | ||
1382 | { 0x0000, 0x0000 }, /* R1378 */ | ||
1383 | { 0x0000, 0x0000 }, /* R1379 */ | ||
1384 | { 0x0000, 0x0000 }, /* R1380 */ | ||
1385 | { 0x0000, 0x0000 }, /* R1381 */ | ||
1386 | { 0x0000, 0x0000 }, /* R1382 */ | ||
1387 | { 0x0000, 0x0000 }, /* R1383 */ | ||
1388 | { 0x0000, 0x0000 }, /* R1384 */ | ||
1389 | { 0x0000, 0x0000 }, /* R1385 */ | ||
1390 | { 0x0000, 0x0000 }, /* R1386 */ | ||
1391 | { 0x0000, 0x0000 }, /* R1387 */ | ||
1392 | { 0x0000, 0x0000 }, /* R1388 */ | ||
1393 | { 0x0000, 0x0000 }, /* R1389 */ | ||
1394 | { 0x0000, 0x0000 }, /* R1390 */ | ||
1395 | { 0x0000, 0x0000 }, /* R1391 */ | ||
1396 | { 0x0000, 0x0000 }, /* R1392 */ | ||
1397 | { 0x0000, 0x0000 }, /* R1393 */ | ||
1398 | { 0x0000, 0x0000 }, /* R1394 */ | ||
1399 | { 0x0000, 0x0000 }, /* R1395 */ | ||
1400 | { 0x0000, 0x0000 }, /* R1396 */ | ||
1401 | { 0x0000, 0x0000 }, /* R1397 */ | ||
1402 | { 0x0000, 0x0000 }, /* R1398 */ | ||
1403 | { 0x0000, 0x0000 }, /* R1399 */ | ||
1404 | { 0x0000, 0x0000 }, /* R1400 */ | ||
1405 | { 0x0000, 0x0000 }, /* R1401 */ | ||
1406 | { 0x0000, 0x0000 }, /* R1402 */ | ||
1407 | { 0x0000, 0x0000 }, /* R1403 */ | ||
1408 | { 0x0000, 0x0000 }, /* R1404 */ | ||
1409 | { 0x0000, 0x0000 }, /* R1405 */ | ||
1410 | { 0x0000, 0x0000 }, /* R1406 */ | ||
1411 | { 0x0000, 0x0000 }, /* R1407 */ | ||
1412 | { 0xFFFF, 0xFFFF }, /* R1408 - AIF2 EQ Gains (1) */ | ||
1413 | { 0xFFC0, 0xFFC0 }, /* R1409 - AIF2 EQ Gains (2) */ | ||
1414 | { 0xFFFF, 0xFFFF }, /* R1410 - AIF2 EQ Band 1 A */ | ||
1415 | { 0xFFFF, 0xFFFF }, /* R1411 - AIF2 EQ Band 1 B */ | ||
1416 | { 0xFFFF, 0xFFFF }, /* R1412 - AIF2 EQ Band 1 PG */ | ||
1417 | { 0xFFFF, 0xFFFF }, /* R1413 - AIF2 EQ Band 2 A */ | ||
1418 | { 0xFFFF, 0xFFFF }, /* R1414 - AIF2 EQ Band 2 B */ | ||
1419 | { 0xFFFF, 0xFFFF }, /* R1415 - AIF2 EQ Band 2 C */ | ||
1420 | { 0xFFFF, 0xFFFF }, /* R1416 - AIF2 EQ Band 2 PG */ | ||
1421 | { 0xFFFF, 0xFFFF }, /* R1417 - AIF2 EQ Band 3 A */ | ||
1422 | { 0xFFFF, 0xFFFF }, /* R1418 - AIF2 EQ Band 3 B */ | ||
1423 | { 0xFFFF, 0xFFFF }, /* R1419 - AIF2 EQ Band 3 C */ | ||
1424 | { 0xFFFF, 0xFFFF }, /* R1420 - AIF2 EQ Band 3 PG */ | ||
1425 | { 0xFFFF, 0xFFFF }, /* R1421 - AIF2 EQ Band 4 A */ | ||
1426 | { 0xFFFF, 0xFFFF }, /* R1422 - AIF2 EQ Band 4 B */ | ||
1427 | { 0xFFFF, 0xFFFF }, /* R1423 - AIF2 EQ Band 4 C */ | ||
1428 | { 0xFFFF, 0xFFFF }, /* R1424 - AIF2 EQ Band 4 PG */ | ||
1429 | { 0xFFFF, 0xFFFF }, /* R1425 - AIF2 EQ Band 5 A */ | ||
1430 | { 0xFFFF, 0xFFFF }, /* R1426 - AIF2 EQ Band 5 B */ | ||
1431 | { 0xFFFF, 0xFFFF }, /* R1427 - AIF2 EQ Band 5 PG */ | ||
1432 | { 0x0000, 0x0000 }, /* R1428 */ | ||
1433 | { 0x0000, 0x0000 }, /* R1429 */ | ||
1434 | { 0x0000, 0x0000 }, /* R1430 */ | ||
1435 | { 0x0000, 0x0000 }, /* R1431 */ | ||
1436 | { 0x0000, 0x0000 }, /* R1432 */ | ||
1437 | { 0x0000, 0x0000 }, /* R1433 */ | ||
1438 | { 0x0000, 0x0000 }, /* R1434 */ | ||
1439 | { 0x0000, 0x0000 }, /* R1435 */ | ||
1440 | { 0x0000, 0x0000 }, /* R1436 */ | ||
1441 | { 0x0000, 0x0000 }, /* R1437 */ | ||
1442 | { 0x0000, 0x0000 }, /* R1438 */ | ||
1443 | { 0x0000, 0x0000 }, /* R1439 */ | ||
1444 | { 0x0000, 0x0000 }, /* R1440 */ | ||
1445 | { 0x0000, 0x0000 }, /* R1441 */ | ||
1446 | { 0x0000, 0x0000 }, /* R1442 */ | ||
1447 | { 0x0000, 0x0000 }, /* R1443 */ | ||
1448 | { 0x0000, 0x0000 }, /* R1444 */ | ||
1449 | { 0x0000, 0x0000 }, /* R1445 */ | ||
1450 | { 0x0000, 0x0000 }, /* R1446 */ | ||
1451 | { 0x0000, 0x0000 }, /* R1447 */ | ||
1452 | { 0x0000, 0x0000 }, /* R1448 */ | ||
1453 | { 0x0000, 0x0000 }, /* R1449 */ | ||
1454 | { 0x0000, 0x0000 }, /* R1450 */ | ||
1455 | { 0x0000, 0x0000 }, /* R1451 */ | ||
1456 | { 0x0000, 0x0000 }, /* R1452 */ | ||
1457 | { 0x0000, 0x0000 }, /* R1453 */ | ||
1458 | { 0x0000, 0x0000 }, /* R1454 */ | ||
1459 | { 0x0000, 0x0000 }, /* R1455 */ | ||
1460 | { 0x0000, 0x0000 }, /* R1456 */ | ||
1461 | { 0x0000, 0x0000 }, /* R1457 */ | ||
1462 | { 0x0000, 0x0000 }, /* R1458 */ | ||
1463 | { 0x0000, 0x0000 }, /* R1459 */ | ||
1464 | { 0x0000, 0x0000 }, /* R1460 */ | ||
1465 | { 0x0000, 0x0000 }, /* R1461 */ | ||
1466 | { 0x0000, 0x0000 }, /* R1462 */ | ||
1467 | { 0x0000, 0x0000 }, /* R1463 */ | ||
1468 | { 0x0000, 0x0000 }, /* R1464 */ | ||
1469 | { 0x0000, 0x0000 }, /* R1465 */ | ||
1470 | { 0x0000, 0x0000 }, /* R1466 */ | ||
1471 | { 0x0000, 0x0000 }, /* R1467 */ | ||
1472 | { 0x0000, 0x0000 }, /* R1468 */ | ||
1473 | { 0x0000, 0x0000 }, /* R1469 */ | ||
1474 | { 0x0000, 0x0000 }, /* R1470 */ | ||
1475 | { 0x0000, 0x0000 }, /* R1471 */ | ||
1476 | { 0x0000, 0x0000 }, /* R1472 */ | ||
1477 | { 0x0000, 0x0000 }, /* R1473 */ | ||
1478 | { 0x0000, 0x0000 }, /* R1474 */ | ||
1479 | { 0x0000, 0x0000 }, /* R1475 */ | ||
1480 | { 0x0000, 0x0000 }, /* R1476 */ | ||
1481 | { 0x0000, 0x0000 }, /* R1477 */ | ||
1482 | { 0x0000, 0x0000 }, /* R1478 */ | ||
1483 | { 0x0000, 0x0000 }, /* R1479 */ | ||
1484 | { 0x0000, 0x0000 }, /* R1480 */ | ||
1485 | { 0x0000, 0x0000 }, /* R1481 */ | ||
1486 | { 0x0000, 0x0000 }, /* R1482 */ | ||
1487 | { 0x0000, 0x0000 }, /* R1483 */ | ||
1488 | { 0x0000, 0x0000 }, /* R1484 */ | ||
1489 | { 0x0000, 0x0000 }, /* R1485 */ | ||
1490 | { 0x0000, 0x0000 }, /* R1486 */ | ||
1491 | { 0x0000, 0x0000 }, /* R1487 */ | ||
1492 | { 0x0000, 0x0000 }, /* R1488 */ | ||
1493 | { 0x0000, 0x0000 }, /* R1489 */ | ||
1494 | { 0x0000, 0x0000 }, /* R1490 */ | ||
1495 | { 0x0000, 0x0000 }, /* R1491 */ | ||
1496 | { 0x0000, 0x0000 }, /* R1492 */ | ||
1497 | { 0x0000, 0x0000 }, /* R1493 */ | ||
1498 | { 0x0000, 0x0000 }, /* R1494 */ | ||
1499 | { 0x0000, 0x0000 }, /* R1495 */ | ||
1500 | { 0x0000, 0x0000 }, /* R1496 */ | ||
1501 | { 0x0000, 0x0000 }, /* R1497 */ | ||
1502 | { 0x0000, 0x0000 }, /* R1498 */ | ||
1503 | { 0x0000, 0x0000 }, /* R1499 */ | ||
1504 | { 0x0000, 0x0000 }, /* R1500 */ | ||
1505 | { 0x0000, 0x0000 }, /* R1501 */ | ||
1506 | { 0x0000, 0x0000 }, /* R1502 */ | ||
1507 | { 0x0000, 0x0000 }, /* R1503 */ | ||
1508 | { 0x0000, 0x0000 }, /* R1504 */ | ||
1509 | { 0x0000, 0x0000 }, /* R1505 */ | ||
1510 | { 0x0000, 0x0000 }, /* R1506 */ | ||
1511 | { 0x0000, 0x0000 }, /* R1507 */ | ||
1512 | { 0x0000, 0x0000 }, /* R1508 */ | ||
1513 | { 0x0000, 0x0000 }, /* R1509 */ | ||
1514 | { 0x0000, 0x0000 }, /* R1510 */ | ||
1515 | { 0x0000, 0x0000 }, /* R1511 */ | ||
1516 | { 0x0000, 0x0000 }, /* R1512 */ | ||
1517 | { 0x0000, 0x0000 }, /* R1513 */ | ||
1518 | { 0x0000, 0x0000 }, /* R1514 */ | ||
1519 | { 0x0000, 0x0000 }, /* R1515 */ | ||
1520 | { 0x0000, 0x0000 }, /* R1516 */ | ||
1521 | { 0x0000, 0x0000 }, /* R1517 */ | ||
1522 | { 0x0000, 0x0000 }, /* R1518 */ | ||
1523 | { 0x0000, 0x0000 }, /* R1519 */ | ||
1524 | { 0x0000, 0x0000 }, /* R1520 */ | ||
1525 | { 0x0000, 0x0000 }, /* R1521 */ | ||
1526 | { 0x0000, 0x0000 }, /* R1522 */ | ||
1527 | { 0x0000, 0x0000 }, /* R1523 */ | ||
1528 | { 0x0000, 0x0000 }, /* R1524 */ | ||
1529 | { 0x0000, 0x0000 }, /* R1525 */ | ||
1530 | { 0x0000, 0x0000 }, /* R1526 */ | ||
1531 | { 0x0000, 0x0000 }, /* R1527 */ | ||
1532 | { 0x0000, 0x0000 }, /* R1528 */ | ||
1533 | { 0x0000, 0x0000 }, /* R1529 */ | ||
1534 | { 0x0000, 0x0000 }, /* R1530 */ | ||
1535 | { 0x0000, 0x0000 }, /* R1531 */ | ||
1536 | { 0x0000, 0x0000 }, /* R1532 */ | ||
1537 | { 0x0000, 0x0000 }, /* R1533 */ | ||
1538 | { 0x0000, 0x0000 }, /* R1534 */ | ||
1539 | { 0x0000, 0x0000 }, /* R1535 */ | ||
1540 | { 0x01EF, 0x01EF }, /* R1536 - DAC1 Mixer Volumes */ | ||
1541 | { 0x0037, 0x0037 }, /* R1537 - DAC1 Left Mixer Routing */ | ||
1542 | { 0x0037, 0x0037 }, /* R1538 - DAC1 Right Mixer Routing */ | ||
1543 | { 0x01EF, 0x01EF }, /* R1539 - DAC2 Mixer Volumes */ | ||
1544 | { 0x0037, 0x0037 }, /* R1540 - DAC2 Left Mixer Routing */ | ||
1545 | { 0x0037, 0x0037 }, /* R1541 - DAC2 Right Mixer Routing */ | ||
1546 | { 0x0003, 0x0003 }, /* R1542 - AIF1 ADC1 Left Mixer Routing */ | ||
1547 | { 0x0003, 0x0003 }, /* R1543 - AIF1 ADC1 Right Mixer Routing */ | ||
1548 | { 0x0003, 0x0003 }, /* R1544 - AIF1 ADC2 Left Mixer Routing */ | ||
1549 | { 0x0003, 0x0003 }, /* R1545 - AIF1 ADC2 Right mixer Routing */ | ||
1550 | { 0x0000, 0x0000 }, /* R1546 */ | ||
1551 | { 0x0000, 0x0000 }, /* R1547 */ | ||
1552 | { 0x0000, 0x0000 }, /* R1548 */ | ||
1553 | { 0x0000, 0x0000 }, /* R1549 */ | ||
1554 | { 0x0000, 0x0000 }, /* R1550 */ | ||
1555 | { 0x0000, 0x0000 }, /* R1551 */ | ||
1556 | { 0x02FF, 0x03FF }, /* R1552 - DAC1 Left Volume */ | ||
1557 | { 0x02FF, 0x03FF }, /* R1553 - DAC1 Right Volume */ | ||
1558 | { 0x02FF, 0x03FF }, /* R1554 - DAC2 Left Volume */ | ||
1559 | { 0x02FF, 0x03FF }, /* R1555 - DAC2 Right Volume */ | ||
1560 | { 0x0003, 0x0003 }, /* R1556 - DAC Softmute */ | ||
1561 | { 0x0000, 0x0000 }, /* R1557 */ | ||
1562 | { 0x0000, 0x0000 }, /* R1558 */ | ||
1563 | { 0x0000, 0x0000 }, /* R1559 */ | ||
1564 | { 0x0000, 0x0000 }, /* R1560 */ | ||
1565 | { 0x0000, 0x0000 }, /* R1561 */ | ||
1566 | { 0x0000, 0x0000 }, /* R1562 */ | ||
1567 | { 0x0000, 0x0000 }, /* R1563 */ | ||
1568 | { 0x0000, 0x0000 }, /* R1564 */ | ||
1569 | { 0x0000, 0x0000 }, /* R1565 */ | ||
1570 | { 0x0000, 0x0000 }, /* R1566 */ | ||
1571 | { 0x0000, 0x0000 }, /* R1567 */ | ||
1572 | { 0x0003, 0x0003 }, /* R1568 - Oversampling */ | ||
1573 | { 0x03C3, 0x03C3 }, /* R1569 - Sidetone */ | ||
1574 | }; | ||
1575 | |||
1576 | const u16 wm8994_reg_defaults[WM8994_CACHE_SIZE] = { | ||
1577 | 0x8994, /* R0 - Software Reset */ | ||
1578 | 0x0000, /* R1 - Power Management (1) */ | ||
1579 | 0x6000, /* R2 - Power Management (2) */ | ||
1580 | 0x0000, /* R3 - Power Management (3) */ | ||
1581 | 0x0000, /* R4 - Power Management (4) */ | ||
1582 | 0x0000, /* R5 - Power Management (5) */ | ||
1583 | 0x0000, /* R6 - Power Management (6) */ | ||
1584 | 0x0000, /* R7 */ | ||
1585 | 0x0000, /* R8 */ | ||
1586 | 0x0000, /* R9 */ | ||
1587 | 0x0000, /* R10 */ | ||
1588 | 0x0000, /* R11 */ | ||
1589 | 0x0000, /* R12 */ | ||
1590 | 0x0000, /* R13 */ | ||
1591 | 0x0000, /* R14 */ | ||
1592 | 0x0000, /* R15 */ | ||
1593 | 0x0000, /* R16 */ | ||
1594 | 0x0000, /* R17 */ | ||
1595 | 0x0000, /* R18 */ | ||
1596 | 0x0000, /* R19 */ | ||
1597 | 0x0000, /* R20 */ | ||
1598 | 0x0000, /* R21 - Input Mixer (1) */ | ||
1599 | 0x0000, /* R22 */ | ||
1600 | 0x0000, /* R23 */ | ||
1601 | 0x008B, /* R24 - Left Line Input 1&2 Volume */ | ||
1602 | 0x008B, /* R25 - Left Line Input 3&4 Volume */ | ||
1603 | 0x008B, /* R26 - Right Line Input 1&2 Volume */ | ||
1604 | 0x008B, /* R27 - Right Line Input 3&4 Volume */ | ||
1605 | 0x006D, /* R28 - Left Output Volume */ | ||
1606 | 0x006D, /* R29 - Right Output Volume */ | ||
1607 | 0x0066, /* R30 - Line Outputs Volume */ | ||
1608 | 0x0020, /* R31 - HPOUT2 Volume */ | ||
1609 | 0x0079, /* R32 - Left OPGA Volume */ | ||
1610 | 0x0079, /* R33 - Right OPGA Volume */ | ||
1611 | 0x0003, /* R34 - SPKMIXL Attenuation */ | ||
1612 | 0x0003, /* R35 - SPKMIXR Attenuation */ | ||
1613 | 0x0011, /* R36 - SPKOUT Mixers */ | ||
1614 | 0x0140, /* R37 - ClassD */ | ||
1615 | 0x0079, /* R38 - Speaker Volume Left */ | ||
1616 | 0x0079, /* R39 - Speaker Volume Right */ | ||
1617 | 0x0000, /* R40 - Input Mixer (2) */ | ||
1618 | 0x0000, /* R41 - Input Mixer (3) */ | ||
1619 | 0x0000, /* R42 - Input Mixer (4) */ | ||
1620 | 0x0000, /* R43 - Input Mixer (5) */ | ||
1621 | 0x0000, /* R44 - Input Mixer (6) */ | ||
1622 | 0x0000, /* R45 - Output Mixer (1) */ | ||
1623 | 0x0000, /* R46 - Output Mixer (2) */ | ||
1624 | 0x0000, /* R47 - Output Mixer (3) */ | ||
1625 | 0x0000, /* R48 - Output Mixer (4) */ | ||
1626 | 0x0000, /* R49 - Output Mixer (5) */ | ||
1627 | 0x0000, /* R50 - Output Mixer (6) */ | ||
1628 | 0x0000, /* R51 - HPOUT2 Mixer */ | ||
1629 | 0x0000, /* R52 - Line Mixer (1) */ | ||
1630 | 0x0000, /* R53 - Line Mixer (2) */ | ||
1631 | 0x0000, /* R54 - Speaker Mixer */ | ||
1632 | 0x0000, /* R55 - Additional Control */ | ||
1633 | 0x0000, /* R56 - AntiPOP (1) */ | ||
1634 | 0x0000, /* R57 - AntiPOP (2) */ | ||
1635 | 0x0000, /* R58 - MICBIAS */ | ||
1636 | 0x000D, /* R59 - LDO 1 */ | ||
1637 | 0x0003, /* R60 - LDO 2 */ | ||
1638 | 0x0039, /* R61 - MICBIAS1 */ | ||
1639 | 0x0039, /* R62 - MICBIAS2 */ | ||
1640 | 0x0000, /* R63 */ | ||
1641 | 0x0000, /* R64 */ | ||
1642 | 0x0000, /* R65 */ | ||
1643 | 0x0000, /* R66 */ | ||
1644 | 0x0000, /* R67 */ | ||
1645 | 0x0000, /* R68 */ | ||
1646 | 0x0000, /* R69 */ | ||
1647 | 0x0000, /* R70 */ | ||
1648 | 0x0000, /* R71 */ | ||
1649 | 0x0000, /* R72 */ | ||
1650 | 0x0000, /* R73 */ | ||
1651 | 0x0000, /* R74 */ | ||
1652 | 0x0000, /* R75 */ | ||
1653 | 0x1F25, /* R76 - Charge Pump (1) */ | ||
1654 | 0x0000, /* R77 */ | ||
1655 | 0x0000, /* R78 */ | ||
1656 | 0x0000, /* R79 */ | ||
1657 | 0x0000, /* R80 */ | ||
1658 | 0x0004, /* R81 - Class W (1) */ | ||
1659 | 0x0000, /* R82 */ | ||
1660 | 0x0000, /* R83 */ | ||
1661 | 0x0000, /* R84 - DC Servo (1) */ | ||
1662 | 0x054A, /* R85 - DC Servo (2) */ | ||
1663 | 0x0000, /* R86 */ | ||
1664 | 0x0000, /* R87 - DC Servo (4) */ | ||
1665 | 0x0000, /* R88 - DC Servo Readback */ | ||
1666 | 0x0000, /* R89 */ | ||
1667 | 0x0000, /* R90 */ | ||
1668 | 0x0000, /* R91 */ | ||
1669 | 0x0000, /* R92 */ | ||
1670 | 0x0000, /* R93 */ | ||
1671 | 0x0000, /* R94 */ | ||
1672 | 0x0000, /* R95 */ | ||
1673 | 0x0000, /* R96 - Analogue HP (1) */ | ||
1674 | 0x0000, /* R97 */ | ||
1675 | 0x0000, /* R98 */ | ||
1676 | 0x0000, /* R99 */ | ||
1677 | 0x0000, /* R100 */ | ||
1678 | 0x0000, /* R101 */ | ||
1679 | 0x0000, /* R102 */ | ||
1680 | 0x0000, /* R103 */ | ||
1681 | 0x0000, /* R104 */ | ||
1682 | 0x0000, /* R105 */ | ||
1683 | 0x0000, /* R106 */ | ||
1684 | 0x0000, /* R107 */ | ||
1685 | 0x0000, /* R108 */ | ||
1686 | 0x0000, /* R109 */ | ||
1687 | 0x0000, /* R110 */ | ||
1688 | 0x0000, /* R111 */ | ||
1689 | 0x0000, /* R112 */ | ||
1690 | 0x0000, /* R113 */ | ||
1691 | 0x0000, /* R114 */ | ||
1692 | 0x0000, /* R115 */ | ||
1693 | 0x0000, /* R116 */ | ||
1694 | 0x0000, /* R117 */ | ||
1695 | 0x0000, /* R118 */ | ||
1696 | 0x0000, /* R119 */ | ||
1697 | 0x0000, /* R120 */ | ||
1698 | 0x0000, /* R121 */ | ||
1699 | 0x0000, /* R122 */ | ||
1700 | 0x0000, /* R123 */ | ||
1701 | 0x0000, /* R124 */ | ||
1702 | 0x0000, /* R125 */ | ||
1703 | 0x0000, /* R126 */ | ||
1704 | 0x0000, /* R127 */ | ||
1705 | 0x0000, /* R128 */ | ||
1706 | 0x0000, /* R129 */ | ||
1707 | 0x0000, /* R130 */ | ||
1708 | 0x0000, /* R131 */ | ||
1709 | 0x0000, /* R132 */ | ||
1710 | 0x0000, /* R133 */ | ||
1711 | 0x0000, /* R134 */ | ||
1712 | 0x0000, /* R135 */ | ||
1713 | 0x0000, /* R136 */ | ||
1714 | 0x0000, /* R137 */ | ||
1715 | 0x0000, /* R138 */ | ||
1716 | 0x0000, /* R139 */ | ||
1717 | 0x0000, /* R140 */ | ||
1718 | 0x0000, /* R141 */ | ||
1719 | 0x0000, /* R142 */ | ||
1720 | 0x0000, /* R143 */ | ||
1721 | 0x0000, /* R144 */ | ||
1722 | 0x0000, /* R145 */ | ||
1723 | 0x0000, /* R146 */ | ||
1724 | 0x0000, /* R147 */ | ||
1725 | 0x0000, /* R148 */ | ||
1726 | 0x0000, /* R149 */ | ||
1727 | 0x0000, /* R150 */ | ||
1728 | 0x0000, /* R151 */ | ||
1729 | 0x0000, /* R152 */ | ||
1730 | 0x0000, /* R153 */ | ||
1731 | 0x0000, /* R154 */ | ||
1732 | 0x0000, /* R155 */ | ||
1733 | 0x0000, /* R156 */ | ||
1734 | 0x0000, /* R157 */ | ||
1735 | 0x0000, /* R158 */ | ||
1736 | 0x0000, /* R159 */ | ||
1737 | 0x0000, /* R160 */ | ||
1738 | 0x0000, /* R161 */ | ||
1739 | 0x0000, /* R162 */ | ||
1740 | 0x0000, /* R163 */ | ||
1741 | 0x0000, /* R164 */ | ||
1742 | 0x0000, /* R165 */ | ||
1743 | 0x0000, /* R166 */ | ||
1744 | 0x0000, /* R167 */ | ||
1745 | 0x0000, /* R168 */ | ||
1746 | 0x0000, /* R169 */ | ||
1747 | 0x0000, /* R170 */ | ||
1748 | 0x0000, /* R171 */ | ||
1749 | 0x0000, /* R172 */ | ||
1750 | 0x0000, /* R173 */ | ||
1751 | 0x0000, /* R174 */ | ||
1752 | 0x0000, /* R175 */ | ||
1753 | 0x0000, /* R176 */ | ||
1754 | 0x0000, /* R177 */ | ||
1755 | 0x0000, /* R178 */ | ||
1756 | 0x0000, /* R179 */ | ||
1757 | 0x0000, /* R180 */ | ||
1758 | 0x0000, /* R181 */ | ||
1759 | 0x0000, /* R182 */ | ||
1760 | 0x0000, /* R183 */ | ||
1761 | 0x0000, /* R184 */ | ||
1762 | 0x0000, /* R185 */ | ||
1763 | 0x0000, /* R186 */ | ||
1764 | 0x0000, /* R187 */ | ||
1765 | 0x0000, /* R188 */ | ||
1766 | 0x0000, /* R189 */ | ||
1767 | 0x0000, /* R190 */ | ||
1768 | 0x0000, /* R191 */ | ||
1769 | 0x0000, /* R192 */ | ||
1770 | 0x0000, /* R193 */ | ||
1771 | 0x0000, /* R194 */ | ||
1772 | 0x0000, /* R195 */ | ||
1773 | 0x0000, /* R196 */ | ||
1774 | 0x0000, /* R197 */ | ||
1775 | 0x0000, /* R198 */ | ||
1776 | 0x0000, /* R199 */ | ||
1777 | 0x0000, /* R200 */ | ||
1778 | 0x0000, /* R201 */ | ||
1779 | 0x0000, /* R202 */ | ||
1780 | 0x0000, /* R203 */ | ||
1781 | 0x0000, /* R204 */ | ||
1782 | 0x0000, /* R205 */ | ||
1783 | 0x0000, /* R206 */ | ||
1784 | 0x0000, /* R207 */ | ||
1785 | 0x0000, /* R208 */ | ||
1786 | 0x0000, /* R209 */ | ||
1787 | 0x0000, /* R210 */ | ||
1788 | 0x0000, /* R211 */ | ||
1789 | 0x0000, /* R212 */ | ||
1790 | 0x0000, /* R213 */ | ||
1791 | 0x0000, /* R214 */ | ||
1792 | 0x0000, /* R215 */ | ||
1793 | 0x0000, /* R216 */ | ||
1794 | 0x0000, /* R217 */ | ||
1795 | 0x0000, /* R218 */ | ||
1796 | 0x0000, /* R219 */ | ||
1797 | 0x0000, /* R220 */ | ||
1798 | 0x0000, /* R221 */ | ||
1799 | 0x0000, /* R222 */ | ||
1800 | 0x0000, /* R223 */ | ||
1801 | 0x0000, /* R224 */ | ||
1802 | 0x0000, /* R225 */ | ||
1803 | 0x0000, /* R226 */ | ||
1804 | 0x0000, /* R227 */ | ||
1805 | 0x0000, /* R228 */ | ||
1806 | 0x0000, /* R229 */ | ||
1807 | 0x0000, /* R230 */ | ||
1808 | 0x0000, /* R231 */ | ||
1809 | 0x0000, /* R232 */ | ||
1810 | 0x0000, /* R233 */ | ||
1811 | 0x0000, /* R234 */ | ||
1812 | 0x0000, /* R235 */ | ||
1813 | 0x0000, /* R236 */ | ||
1814 | 0x0000, /* R237 */ | ||
1815 | 0x0000, /* R238 */ | ||
1816 | 0x0000, /* R239 */ | ||
1817 | 0x0000, /* R240 */ | ||
1818 | 0x0000, /* R241 */ | ||
1819 | 0x0000, /* R242 */ | ||
1820 | 0x0000, /* R243 */ | ||
1821 | 0x0000, /* R244 */ | ||
1822 | 0x0000, /* R245 */ | ||
1823 | 0x0000, /* R246 */ | ||
1824 | 0x0000, /* R247 */ | ||
1825 | 0x0000, /* R248 */ | ||
1826 | 0x0000, /* R249 */ | ||
1827 | 0x0000, /* R250 */ | ||
1828 | 0x0000, /* R251 */ | ||
1829 | 0x0000, /* R252 */ | ||
1830 | 0x0000, /* R253 */ | ||
1831 | 0x0000, /* R254 */ | ||
1832 | 0x0000, /* R255 */ | ||
1833 | 0x0003, /* R256 - Chip Revision */ | ||
1834 | 0x8004, /* R257 - Control Interface */ | ||
1835 | 0x0000, /* R258 */ | ||
1836 | 0x0000, /* R259 */ | ||
1837 | 0x0000, /* R260 */ | ||
1838 | 0x0000, /* R261 */ | ||
1839 | 0x0000, /* R262 */ | ||
1840 | 0x0000, /* R263 */ | ||
1841 | 0x0000, /* R264 */ | ||
1842 | 0x0000, /* R265 */ | ||
1843 | 0x0000, /* R266 */ | ||
1844 | 0x0000, /* R267 */ | ||
1845 | 0x0000, /* R268 */ | ||
1846 | 0x0000, /* R269 */ | ||
1847 | 0x0000, /* R270 */ | ||
1848 | 0x0000, /* R271 */ | ||
1849 | 0x0000, /* R272 - Write Sequencer Ctrl (1) */ | ||
1850 | 0x0000, /* R273 - Write Sequencer Ctrl (2) */ | ||
1851 | 0x0000, /* R274 */ | ||
1852 | 0x0000, /* R275 */ | ||
1853 | 0x0000, /* R276 */ | ||
1854 | 0x0000, /* R277 */ | ||
1855 | 0x0000, /* R278 */ | ||
1856 | 0x0000, /* R279 */ | ||
1857 | 0x0000, /* R280 */ | ||
1858 | 0x0000, /* R281 */ | ||
1859 | 0x0000, /* R282 */ | ||
1860 | 0x0000, /* R283 */ | ||
1861 | 0x0000, /* R284 */ | ||
1862 | 0x0000, /* R285 */ | ||
1863 | 0x0000, /* R286 */ | ||
1864 | 0x0000, /* R287 */ | ||
1865 | 0x0000, /* R288 */ | ||
1866 | 0x0000, /* R289 */ | ||
1867 | 0x0000, /* R290 */ | ||
1868 | 0x0000, /* R291 */ | ||
1869 | 0x0000, /* R292 */ | ||
1870 | 0x0000, /* R293 */ | ||
1871 | 0x0000, /* R294 */ | ||
1872 | 0x0000, /* R295 */ | ||
1873 | 0x0000, /* R296 */ | ||
1874 | 0x0000, /* R297 */ | ||
1875 | 0x0000, /* R298 */ | ||
1876 | 0x0000, /* R299 */ | ||
1877 | 0x0000, /* R300 */ | ||
1878 | 0x0000, /* R301 */ | ||
1879 | 0x0000, /* R302 */ | ||
1880 | 0x0000, /* R303 */ | ||
1881 | 0x0000, /* R304 */ | ||
1882 | 0x0000, /* R305 */ | ||
1883 | 0x0000, /* R306 */ | ||
1884 | 0x0000, /* R307 */ | ||
1885 | 0x0000, /* R308 */ | ||
1886 | 0x0000, /* R309 */ | ||
1887 | 0x0000, /* R310 */ | ||
1888 | 0x0000, /* R311 */ | ||
1889 | 0x0000, /* R312 */ | ||
1890 | 0x0000, /* R313 */ | ||
1891 | 0x0000, /* R314 */ | ||
1892 | 0x0000, /* R315 */ | ||
1893 | 0x0000, /* R316 */ | ||
1894 | 0x0000, /* R317 */ | ||
1895 | 0x0000, /* R318 */ | ||
1896 | 0x0000, /* R319 */ | ||
1897 | 0x0000, /* R320 */ | ||
1898 | 0x0000, /* R321 */ | ||
1899 | 0x0000, /* R322 */ | ||
1900 | 0x0000, /* R323 */ | ||
1901 | 0x0000, /* R324 */ | ||
1902 | 0x0000, /* R325 */ | ||
1903 | 0x0000, /* R326 */ | ||
1904 | 0x0000, /* R327 */ | ||
1905 | 0x0000, /* R328 */ | ||
1906 | 0x0000, /* R329 */ | ||
1907 | 0x0000, /* R330 */ | ||
1908 | 0x0000, /* R331 */ | ||
1909 | 0x0000, /* R332 */ | ||
1910 | 0x0000, /* R333 */ | ||
1911 | 0x0000, /* R334 */ | ||
1912 | 0x0000, /* R335 */ | ||
1913 | 0x0000, /* R336 */ | ||
1914 | 0x0000, /* R337 */ | ||
1915 | 0x0000, /* R338 */ | ||
1916 | 0x0000, /* R339 */ | ||
1917 | 0x0000, /* R340 */ | ||
1918 | 0x0000, /* R341 */ | ||
1919 | 0x0000, /* R342 */ | ||
1920 | 0x0000, /* R343 */ | ||
1921 | 0x0000, /* R344 */ | ||
1922 | 0x0000, /* R345 */ | ||
1923 | 0x0000, /* R346 */ | ||
1924 | 0x0000, /* R347 */ | ||
1925 | 0x0000, /* R348 */ | ||
1926 | 0x0000, /* R349 */ | ||
1927 | 0x0000, /* R350 */ | ||
1928 | 0x0000, /* R351 */ | ||
1929 | 0x0000, /* R352 */ | ||
1930 | 0x0000, /* R353 */ | ||
1931 | 0x0000, /* R354 */ | ||
1932 | 0x0000, /* R355 */ | ||
1933 | 0x0000, /* R356 */ | ||
1934 | 0x0000, /* R357 */ | ||
1935 | 0x0000, /* R358 */ | ||
1936 | 0x0000, /* R359 */ | ||
1937 | 0x0000, /* R360 */ | ||
1938 | 0x0000, /* R361 */ | ||
1939 | 0x0000, /* R362 */ | ||
1940 | 0x0000, /* R363 */ | ||
1941 | 0x0000, /* R364 */ | ||
1942 | 0x0000, /* R365 */ | ||
1943 | 0x0000, /* R366 */ | ||
1944 | 0x0000, /* R367 */ | ||
1945 | 0x0000, /* R368 */ | ||
1946 | 0x0000, /* R369 */ | ||
1947 | 0x0000, /* R370 */ | ||
1948 | 0x0000, /* R371 */ | ||
1949 | 0x0000, /* R372 */ | ||
1950 | 0x0000, /* R373 */ | ||
1951 | 0x0000, /* R374 */ | ||
1952 | 0x0000, /* R375 */ | ||
1953 | 0x0000, /* R376 */ | ||
1954 | 0x0000, /* R377 */ | ||
1955 | 0x0000, /* R378 */ | ||
1956 | 0x0000, /* R379 */ | ||
1957 | 0x0000, /* R380 */ | ||
1958 | 0x0000, /* R381 */ | ||
1959 | 0x0000, /* R382 */ | ||
1960 | 0x0000, /* R383 */ | ||
1961 | 0x0000, /* R384 */ | ||
1962 | 0x0000, /* R385 */ | ||
1963 | 0x0000, /* R386 */ | ||
1964 | 0x0000, /* R387 */ | ||
1965 | 0x0000, /* R388 */ | ||
1966 | 0x0000, /* R389 */ | ||
1967 | 0x0000, /* R390 */ | ||
1968 | 0x0000, /* R391 */ | ||
1969 | 0x0000, /* R392 */ | ||
1970 | 0x0000, /* R393 */ | ||
1971 | 0x0000, /* R394 */ | ||
1972 | 0x0000, /* R395 */ | ||
1973 | 0x0000, /* R396 */ | ||
1974 | 0x0000, /* R397 */ | ||
1975 | 0x0000, /* R398 */ | ||
1976 | 0x0000, /* R399 */ | ||
1977 | 0x0000, /* R400 */ | ||
1978 | 0x0000, /* R401 */ | ||
1979 | 0x0000, /* R402 */ | ||
1980 | 0x0000, /* R403 */ | ||
1981 | 0x0000, /* R404 */ | ||
1982 | 0x0000, /* R405 */ | ||
1983 | 0x0000, /* R406 */ | ||
1984 | 0x0000, /* R407 */ | ||
1985 | 0x0000, /* R408 */ | ||
1986 | 0x0000, /* R409 */ | ||
1987 | 0x0000, /* R410 */ | ||
1988 | 0x0000, /* R411 */ | ||
1989 | 0x0000, /* R412 */ | ||
1990 | 0x0000, /* R413 */ | ||
1991 | 0x0000, /* R414 */ | ||
1992 | 0x0000, /* R415 */ | ||
1993 | 0x0000, /* R416 */ | ||
1994 | 0x0000, /* R417 */ | ||
1995 | 0x0000, /* R418 */ | ||
1996 | 0x0000, /* R419 */ | ||
1997 | 0x0000, /* R420 */ | ||
1998 | 0x0000, /* R421 */ | ||
1999 | 0x0000, /* R422 */ | ||
2000 | 0x0000, /* R423 */ | ||
2001 | 0x0000, /* R424 */ | ||
2002 | 0x0000, /* R425 */ | ||
2003 | 0x0000, /* R426 */ | ||
2004 | 0x0000, /* R427 */ | ||
2005 | 0x0000, /* R428 */ | ||
2006 | 0x0000, /* R429 */ | ||
2007 | 0x0000, /* R430 */ | ||
2008 | 0x0000, /* R431 */ | ||
2009 | 0x0000, /* R432 */ | ||
2010 | 0x0000, /* R433 */ | ||
2011 | 0x0000, /* R434 */ | ||
2012 | 0x0000, /* R435 */ | ||
2013 | 0x0000, /* R436 */ | ||
2014 | 0x0000, /* R437 */ | ||
2015 | 0x0000, /* R438 */ | ||
2016 | 0x0000, /* R439 */ | ||
2017 | 0x0000, /* R440 */ | ||
2018 | 0x0000, /* R441 */ | ||
2019 | 0x0000, /* R442 */ | ||
2020 | 0x0000, /* R443 */ | ||
2021 | 0x0000, /* R444 */ | ||
2022 | 0x0000, /* R445 */ | ||
2023 | 0x0000, /* R446 */ | ||
2024 | 0x0000, /* R447 */ | ||
2025 | 0x0000, /* R448 */ | ||
2026 | 0x0000, /* R449 */ | ||
2027 | 0x0000, /* R450 */ | ||
2028 | 0x0000, /* R451 */ | ||
2029 | 0x0000, /* R452 */ | ||
2030 | 0x0000, /* R453 */ | ||
2031 | 0x0000, /* R454 */ | ||
2032 | 0x0000, /* R455 */ | ||
2033 | 0x0000, /* R456 */ | ||
2034 | 0x0000, /* R457 */ | ||
2035 | 0x0000, /* R458 */ | ||
2036 | 0x0000, /* R459 */ | ||
2037 | 0x0000, /* R460 */ | ||
2038 | 0x0000, /* R461 */ | ||
2039 | 0x0000, /* R462 */ | ||
2040 | 0x0000, /* R463 */ | ||
2041 | 0x0000, /* R464 */ | ||
2042 | 0x0000, /* R465 */ | ||
2043 | 0x0000, /* R466 */ | ||
2044 | 0x0000, /* R467 */ | ||
2045 | 0x0000, /* R468 */ | ||
2046 | 0x0000, /* R469 */ | ||
2047 | 0x0000, /* R470 */ | ||
2048 | 0x0000, /* R471 */ | ||
2049 | 0x0000, /* R472 */ | ||
2050 | 0x0000, /* R473 */ | ||
2051 | 0x0000, /* R474 */ | ||
2052 | 0x0000, /* R475 */ | ||
2053 | 0x0000, /* R476 */ | ||
2054 | 0x0000, /* R477 */ | ||
2055 | 0x0000, /* R478 */ | ||
2056 | 0x0000, /* R479 */ | ||
2057 | 0x0000, /* R480 */ | ||
2058 | 0x0000, /* R481 */ | ||
2059 | 0x0000, /* R482 */ | ||
2060 | 0x0000, /* R483 */ | ||
2061 | 0x0000, /* R484 */ | ||
2062 | 0x0000, /* R485 */ | ||
2063 | 0x0000, /* R486 */ | ||
2064 | 0x0000, /* R487 */ | ||
2065 | 0x0000, /* R488 */ | ||
2066 | 0x0000, /* R489 */ | ||
2067 | 0x0000, /* R490 */ | ||
2068 | 0x0000, /* R491 */ | ||
2069 | 0x0000, /* R492 */ | ||
2070 | 0x0000, /* R493 */ | ||
2071 | 0x0000, /* R494 */ | ||
2072 | 0x0000, /* R495 */ | ||
2073 | 0x0000, /* R496 */ | ||
2074 | 0x0000, /* R497 */ | ||
2075 | 0x0000, /* R498 */ | ||
2076 | 0x0000, /* R499 */ | ||
2077 | 0x0000, /* R500 */ | ||
2078 | 0x0000, /* R501 */ | ||
2079 | 0x0000, /* R502 */ | ||
2080 | 0x0000, /* R503 */ | ||
2081 | 0x0000, /* R504 */ | ||
2082 | 0x0000, /* R505 */ | ||
2083 | 0x0000, /* R506 */ | ||
2084 | 0x0000, /* R507 */ | ||
2085 | 0x0000, /* R508 */ | ||
2086 | 0x0000, /* R509 */ | ||
2087 | 0x0000, /* R510 */ | ||
2088 | 0x0000, /* R511 */ | ||
2089 | 0x0000, /* R512 - AIF1 Clocking (1) */ | ||
2090 | 0x0000, /* R513 - AIF1 Clocking (2) */ | ||
2091 | 0x0000, /* R514 */ | ||
2092 | 0x0000, /* R515 */ | ||
2093 | 0x0000, /* R516 - AIF2 Clocking (1) */ | ||
2094 | 0x0000, /* R517 - AIF2 Clocking (2) */ | ||
2095 | 0x0000, /* R518 */ | ||
2096 | 0x0000, /* R519 */ | ||
2097 | 0x0000, /* R520 - Clocking (1) */ | ||
2098 | 0x0000, /* R521 - Clocking (2) */ | ||
2099 | 0x0000, /* R522 */ | ||
2100 | 0x0000, /* R523 */ | ||
2101 | 0x0000, /* R524 */ | ||
2102 | 0x0000, /* R525 */ | ||
2103 | 0x0000, /* R526 */ | ||
2104 | 0x0000, /* R527 */ | ||
2105 | 0x0083, /* R528 - AIF1 Rate */ | ||
2106 | 0x0083, /* R529 - AIF2 Rate */ | ||
2107 | 0x0000, /* R530 - Rate Status */ | ||
2108 | 0x0000, /* R531 */ | ||
2109 | 0x0000, /* R532 */ | ||
2110 | 0x0000, /* R533 */ | ||
2111 | 0x0000, /* R534 */ | ||
2112 | 0x0000, /* R535 */ | ||
2113 | 0x0000, /* R536 */ | ||
2114 | 0x0000, /* R537 */ | ||
2115 | 0x0000, /* R538 */ | ||
2116 | 0x0000, /* R539 */ | ||
2117 | 0x0000, /* R540 */ | ||
2118 | 0x0000, /* R541 */ | ||
2119 | 0x0000, /* R542 */ | ||
2120 | 0x0000, /* R543 */ | ||
2121 | 0x0000, /* R544 - FLL1 Control (1) */ | ||
2122 | 0x0000, /* R545 - FLL1 Control (2) */ | ||
2123 | 0x0000, /* R546 - FLL1 Control (3) */ | ||
2124 | 0x0000, /* R547 - FLL1 Control (4) */ | ||
2125 | 0x0C80, /* R548 - FLL1 Control (5) */ | ||
2126 | 0x0000, /* R549 */ | ||
2127 | 0x0000, /* R550 */ | ||
2128 | 0x0000, /* R551 */ | ||
2129 | 0x0000, /* R552 */ | ||
2130 | 0x0000, /* R553 */ | ||
2131 | 0x0000, /* R554 */ | ||
2132 | 0x0000, /* R555 */ | ||
2133 | 0x0000, /* R556 */ | ||
2134 | 0x0000, /* R557 */ | ||
2135 | 0x0000, /* R558 */ | ||
2136 | 0x0000, /* R559 */ | ||
2137 | 0x0000, /* R560 */ | ||
2138 | 0x0000, /* R561 */ | ||
2139 | 0x0000, /* R562 */ | ||
2140 | 0x0000, /* R563 */ | ||
2141 | 0x0000, /* R564 */ | ||
2142 | 0x0000, /* R565 */ | ||
2143 | 0x0000, /* R566 */ | ||
2144 | 0x0000, /* R567 */ | ||
2145 | 0x0000, /* R568 */ | ||
2146 | 0x0000, /* R569 */ | ||
2147 | 0x0000, /* R570 */ | ||
2148 | 0x0000, /* R571 */ | ||
2149 | 0x0000, /* R572 */ | ||
2150 | 0x0000, /* R573 */ | ||
2151 | 0x0000, /* R574 */ | ||
2152 | 0x0000, /* R575 */ | ||
2153 | 0x0000, /* R576 - FLL2 Control (1) */ | ||
2154 | 0x0000, /* R577 - FLL2 Control (2) */ | ||
2155 | 0x0000, /* R578 - FLL2 Control (3) */ | ||
2156 | 0x0000, /* R579 - FLL2 Control (4) */ | ||
2157 | 0x0C80, /* R580 - FLL2 Control (5) */ | ||
2158 | 0x0000, /* R581 */ | ||
2159 | 0x0000, /* R582 */ | ||
2160 | 0x0000, /* R583 */ | ||
2161 | 0x0000, /* R584 */ | ||
2162 | 0x0000, /* R585 */ | ||
2163 | 0x0000, /* R586 */ | ||
2164 | 0x0000, /* R587 */ | ||
2165 | 0x0000, /* R588 */ | ||
2166 | 0x0000, /* R589 */ | ||
2167 | 0x0000, /* R590 */ | ||
2168 | 0x0000, /* R591 */ | ||
2169 | 0x0000, /* R592 */ | ||
2170 | 0x0000, /* R593 */ | ||
2171 | 0x0000, /* R594 */ | ||
2172 | 0x0000, /* R595 */ | ||
2173 | 0x0000, /* R596 */ | ||
2174 | 0x0000, /* R597 */ | ||
2175 | 0x0000, /* R598 */ | ||
2176 | 0x0000, /* R599 */ | ||
2177 | 0x0000, /* R600 */ | ||
2178 | 0x0000, /* R601 */ | ||
2179 | 0x0000, /* R602 */ | ||
2180 | 0x0000, /* R603 */ | ||
2181 | 0x0000, /* R604 */ | ||
2182 | 0x0000, /* R605 */ | ||
2183 | 0x0000, /* R606 */ | ||
2184 | 0x0000, /* R607 */ | ||
2185 | 0x0000, /* R608 */ | ||
2186 | 0x0000, /* R609 */ | ||
2187 | 0x0000, /* R610 */ | ||
2188 | 0x0000, /* R611 */ | ||
2189 | 0x0000, /* R612 */ | ||
2190 | 0x0000, /* R613 */ | ||
2191 | 0x0000, /* R614 */ | ||
2192 | 0x0000, /* R615 */ | ||
2193 | 0x0000, /* R616 */ | ||
2194 | 0x0000, /* R617 */ | ||
2195 | 0x0000, /* R618 */ | ||
2196 | 0x0000, /* R619 */ | ||
2197 | 0x0000, /* R620 */ | ||
2198 | 0x0000, /* R621 */ | ||
2199 | 0x0000, /* R622 */ | ||
2200 | 0x0000, /* R623 */ | ||
2201 | 0x0000, /* R624 */ | ||
2202 | 0x0000, /* R625 */ | ||
2203 | 0x0000, /* R626 */ | ||
2204 | 0x0000, /* R627 */ | ||
2205 | 0x0000, /* R628 */ | ||
2206 | 0x0000, /* R629 */ | ||
2207 | 0x0000, /* R630 */ | ||
2208 | 0x0000, /* R631 */ | ||
2209 | 0x0000, /* R632 */ | ||
2210 | 0x0000, /* R633 */ | ||
2211 | 0x0000, /* R634 */ | ||
2212 | 0x0000, /* R635 */ | ||
2213 | 0x0000, /* R636 */ | ||
2214 | 0x0000, /* R637 */ | ||
2215 | 0x0000, /* R638 */ | ||
2216 | 0x0000, /* R639 */ | ||
2217 | 0x0000, /* R640 */ | ||
2218 | 0x0000, /* R641 */ | ||
2219 | 0x0000, /* R642 */ | ||
2220 | 0x0000, /* R643 */ | ||
2221 | 0x0000, /* R644 */ | ||
2222 | 0x0000, /* R645 */ | ||
2223 | 0x0000, /* R646 */ | ||
2224 | 0x0000, /* R647 */ | ||
2225 | 0x0000, /* R648 */ | ||
2226 | 0x0000, /* R649 */ | ||
2227 | 0x0000, /* R650 */ | ||
2228 | 0x0000, /* R651 */ | ||
2229 | 0x0000, /* R652 */ | ||
2230 | 0x0000, /* R653 */ | ||
2231 | 0x0000, /* R654 */ | ||
2232 | 0x0000, /* R655 */ | ||
2233 | 0x0000, /* R656 */ | ||
2234 | 0x0000, /* R657 */ | ||
2235 | 0x0000, /* R658 */ | ||
2236 | 0x0000, /* R659 */ | ||
2237 | 0x0000, /* R660 */ | ||
2238 | 0x0000, /* R661 */ | ||
2239 | 0x0000, /* R662 */ | ||
2240 | 0x0000, /* R663 */ | ||
2241 | 0x0000, /* R664 */ | ||
2242 | 0x0000, /* R665 */ | ||
2243 | 0x0000, /* R666 */ | ||
2244 | 0x0000, /* R667 */ | ||
2245 | 0x0000, /* R668 */ | ||
2246 | 0x0000, /* R669 */ | ||
2247 | 0x0000, /* R670 */ | ||
2248 | 0x0000, /* R671 */ | ||
2249 | 0x0000, /* R672 */ | ||
2250 | 0x0000, /* R673 */ | ||
2251 | 0x0000, /* R674 */ | ||
2252 | 0x0000, /* R675 */ | ||
2253 | 0x0000, /* R676 */ | ||
2254 | 0x0000, /* R677 */ | ||
2255 | 0x0000, /* R678 */ | ||
2256 | 0x0000, /* R679 */ | ||
2257 | 0x0000, /* R680 */ | ||
2258 | 0x0000, /* R681 */ | ||
2259 | 0x0000, /* R682 */ | ||
2260 | 0x0000, /* R683 */ | ||
2261 | 0x0000, /* R684 */ | ||
2262 | 0x0000, /* R685 */ | ||
2263 | 0x0000, /* R686 */ | ||
2264 | 0x0000, /* R687 */ | ||
2265 | 0x0000, /* R688 */ | ||
2266 | 0x0000, /* R689 */ | ||
2267 | 0x0000, /* R690 */ | ||
2268 | 0x0000, /* R691 */ | ||
2269 | 0x0000, /* R692 */ | ||
2270 | 0x0000, /* R693 */ | ||
2271 | 0x0000, /* R694 */ | ||
2272 | 0x0000, /* R695 */ | ||
2273 | 0x0000, /* R696 */ | ||
2274 | 0x0000, /* R697 */ | ||
2275 | 0x0000, /* R698 */ | ||
2276 | 0x0000, /* R699 */ | ||
2277 | 0x0000, /* R700 */ | ||
2278 | 0x0000, /* R701 */ | ||
2279 | 0x0000, /* R702 */ | ||
2280 | 0x0000, /* R703 */ | ||
2281 | 0x0000, /* R704 */ | ||
2282 | 0x0000, /* R705 */ | ||
2283 | 0x0000, /* R706 */ | ||
2284 | 0x0000, /* R707 */ | ||
2285 | 0x0000, /* R708 */ | ||
2286 | 0x0000, /* R709 */ | ||
2287 | 0x0000, /* R710 */ | ||
2288 | 0x0000, /* R711 */ | ||
2289 | 0x0000, /* R712 */ | ||
2290 | 0x0000, /* R713 */ | ||
2291 | 0x0000, /* R714 */ | ||
2292 | 0x0000, /* R715 */ | ||
2293 | 0x0000, /* R716 */ | ||
2294 | 0x0000, /* R717 */ | ||
2295 | 0x0000, /* R718 */ | ||
2296 | 0x0000, /* R719 */ | ||
2297 | 0x0000, /* R720 */ | ||
2298 | 0x0000, /* R721 */ | ||
2299 | 0x0000, /* R722 */ | ||
2300 | 0x0000, /* R723 */ | ||
2301 | 0x0000, /* R724 */ | ||
2302 | 0x0000, /* R725 */ | ||
2303 | 0x0000, /* R726 */ | ||
2304 | 0x0000, /* R727 */ | ||
2305 | 0x0000, /* R728 */ | ||
2306 | 0x0000, /* R729 */ | ||
2307 | 0x0000, /* R730 */ | ||
2308 | 0x0000, /* R731 */ | ||
2309 | 0x0000, /* R732 */ | ||
2310 | 0x0000, /* R733 */ | ||
2311 | 0x0000, /* R734 */ | ||
2312 | 0x0000, /* R735 */ | ||
2313 | 0x0000, /* R736 */ | ||
2314 | 0x0000, /* R737 */ | ||
2315 | 0x0000, /* R738 */ | ||
2316 | 0x0000, /* R739 */ | ||
2317 | 0x0000, /* R740 */ | ||
2318 | 0x0000, /* R741 */ | ||
2319 | 0x0000, /* R742 */ | ||
2320 | 0x0000, /* R743 */ | ||
2321 | 0x0000, /* R744 */ | ||
2322 | 0x0000, /* R745 */ | ||
2323 | 0x0000, /* R746 */ | ||
2324 | 0x0000, /* R747 */ | ||
2325 | 0x0000, /* R748 */ | ||
2326 | 0x0000, /* R749 */ | ||
2327 | 0x0000, /* R750 */ | ||
2328 | 0x0000, /* R751 */ | ||
2329 | 0x0000, /* R752 */ | ||
2330 | 0x0000, /* R753 */ | ||
2331 | 0x0000, /* R754 */ | ||
2332 | 0x0000, /* R755 */ | ||
2333 | 0x0000, /* R756 */ | ||
2334 | 0x0000, /* R757 */ | ||
2335 | 0x0000, /* R758 */ | ||
2336 | 0x0000, /* R759 */ | ||
2337 | 0x0000, /* R760 */ | ||
2338 | 0x0000, /* R761 */ | ||
2339 | 0x0000, /* R762 */ | ||
2340 | 0x0000, /* R763 */ | ||
2341 | 0x0000, /* R764 */ | ||
2342 | 0x0000, /* R765 */ | ||
2343 | 0x0000, /* R766 */ | ||
2344 | 0x0000, /* R767 */ | ||
2345 | 0x4050, /* R768 - AIF1 Control (1) */ | ||
2346 | 0x4000, /* R769 - AIF1 Control (2) */ | ||
2347 | 0x0000, /* R770 - AIF1 Master/Slave */ | ||
2348 | 0x0040, /* R771 - AIF1 BCLK */ | ||
2349 | 0x0040, /* R772 - AIF1ADC LRCLK */ | ||
2350 | 0x0040, /* R773 - AIF1DAC LRCLK */ | ||
2351 | 0x0004, /* R774 - AIF1DAC Data */ | ||
2352 | 0x0100, /* R775 - AIF1ADC Data */ | ||
2353 | 0x0000, /* R776 */ | ||
2354 | 0x0000, /* R777 */ | ||
2355 | 0x0000, /* R778 */ | ||
2356 | 0x0000, /* R779 */ | ||
2357 | 0x0000, /* R780 */ | ||
2358 | 0x0000, /* R781 */ | ||
2359 | 0x0000, /* R782 */ | ||
2360 | 0x0000, /* R783 */ | ||
2361 | 0x4050, /* R784 - AIF2 Control (1) */ | ||
2362 | 0x4000, /* R785 - AIF2 Control (2) */ | ||
2363 | 0x0000, /* R786 - AIF2 Master/Slave */ | ||
2364 | 0x0040, /* R787 - AIF2 BCLK */ | ||
2365 | 0x0040, /* R788 - AIF2ADC LRCLK */ | ||
2366 | 0x0040, /* R789 - AIF2DAC LRCLK */ | ||
2367 | 0x0000, /* R790 - AIF2DAC Data */ | ||
2368 | 0x0000, /* R791 - AIF2ADC Data */ | ||
2369 | 0x0000, /* R792 */ | ||
2370 | 0x0000, /* R793 */ | ||
2371 | 0x0000, /* R794 */ | ||
2372 | 0x0000, /* R795 */ | ||
2373 | 0x0000, /* R796 */ | ||
2374 | 0x0000, /* R797 */ | ||
2375 | 0x0000, /* R798 */ | ||
2376 | 0x0000, /* R799 */ | ||
2377 | 0x0000, /* R800 */ | ||
2378 | 0x0000, /* R801 */ | ||
2379 | 0x0000, /* R802 */ | ||
2380 | 0x0000, /* R803 */ | ||
2381 | 0x0000, /* R804 */ | ||
2382 | 0x0000, /* R805 */ | ||
2383 | 0x0000, /* R806 */ | ||
2384 | 0x0000, /* R807 */ | ||
2385 | 0x0000, /* R808 */ | ||
2386 | 0x0000, /* R809 */ | ||
2387 | 0x0000, /* R810 */ | ||
2388 | 0x0000, /* R811 */ | ||
2389 | 0x0000, /* R812 */ | ||
2390 | 0x0000, /* R813 */ | ||
2391 | 0x0000, /* R814 */ | ||
2392 | 0x0000, /* R815 */ | ||
2393 | 0x0000, /* R816 */ | ||
2394 | 0x0000, /* R817 */ | ||
2395 | 0x0000, /* R818 */ | ||
2396 | 0x0000, /* R819 */ | ||
2397 | 0x0000, /* R820 */ | ||
2398 | 0x0000, /* R821 */ | ||
2399 | 0x0000, /* R822 */ | ||
2400 | 0x0000, /* R823 */ | ||
2401 | 0x0000, /* R824 */ | ||
2402 | 0x0000, /* R825 */ | ||
2403 | 0x0000, /* R826 */ | ||
2404 | 0x0000, /* R827 */ | ||
2405 | 0x0000, /* R828 */ | ||
2406 | 0x0000, /* R829 */ | ||
2407 | 0x0000, /* R830 */ | ||
2408 | 0x0000, /* R831 */ | ||
2409 | 0x0000, /* R832 */ | ||
2410 | 0x0000, /* R833 */ | ||
2411 | 0x0000, /* R834 */ | ||
2412 | 0x0000, /* R835 */ | ||
2413 | 0x0000, /* R836 */ | ||
2414 | 0x0000, /* R837 */ | ||
2415 | 0x0000, /* R838 */ | ||
2416 | 0x0000, /* R839 */ | ||
2417 | 0x0000, /* R840 */ | ||
2418 | 0x0000, /* R841 */ | ||
2419 | 0x0000, /* R842 */ | ||
2420 | 0x0000, /* R843 */ | ||
2421 | 0x0000, /* R844 */ | ||
2422 | 0x0000, /* R845 */ | ||
2423 | 0x0000, /* R846 */ | ||
2424 | 0x0000, /* R847 */ | ||
2425 | 0x0000, /* R848 */ | ||
2426 | 0x0000, /* R849 */ | ||
2427 | 0x0000, /* R850 */ | ||
2428 | 0x0000, /* R851 */ | ||
2429 | 0x0000, /* R852 */ | ||
2430 | 0x0000, /* R853 */ | ||
2431 | 0x0000, /* R854 */ | ||
2432 | 0x0000, /* R855 */ | ||
2433 | 0x0000, /* R856 */ | ||
2434 | 0x0000, /* R857 */ | ||
2435 | 0x0000, /* R858 */ | ||
2436 | 0x0000, /* R859 */ | ||
2437 | 0x0000, /* R860 */ | ||
2438 | 0x0000, /* R861 */ | ||
2439 | 0x0000, /* R862 */ | ||
2440 | 0x0000, /* R863 */ | ||
2441 | 0x0000, /* R864 */ | ||
2442 | 0x0000, /* R865 */ | ||
2443 | 0x0000, /* R866 */ | ||
2444 | 0x0000, /* R867 */ | ||
2445 | 0x0000, /* R868 */ | ||
2446 | 0x0000, /* R869 */ | ||
2447 | 0x0000, /* R870 */ | ||
2448 | 0x0000, /* R871 */ | ||
2449 | 0x0000, /* R872 */ | ||
2450 | 0x0000, /* R873 */ | ||
2451 | 0x0000, /* R874 */ | ||
2452 | 0x0000, /* R875 */ | ||
2453 | 0x0000, /* R876 */ | ||
2454 | 0x0000, /* R877 */ | ||
2455 | 0x0000, /* R878 */ | ||
2456 | 0x0000, /* R879 */ | ||
2457 | 0x0000, /* R880 */ | ||
2458 | 0x0000, /* R881 */ | ||
2459 | 0x0000, /* R882 */ | ||
2460 | 0x0000, /* R883 */ | ||
2461 | 0x0000, /* R884 */ | ||
2462 | 0x0000, /* R885 */ | ||
2463 | 0x0000, /* R886 */ | ||
2464 | 0x0000, /* R887 */ | ||
2465 | 0x0000, /* R888 */ | ||
2466 | 0x0000, /* R889 */ | ||
2467 | 0x0000, /* R890 */ | ||
2468 | 0x0000, /* R891 */ | ||
2469 | 0x0000, /* R892 */ | ||
2470 | 0x0000, /* R893 */ | ||
2471 | 0x0000, /* R894 */ | ||
2472 | 0x0000, /* R895 */ | ||
2473 | 0x0000, /* R896 */ | ||
2474 | 0x0000, /* R897 */ | ||
2475 | 0x0000, /* R898 */ | ||
2476 | 0x0000, /* R899 */ | ||
2477 | 0x0000, /* R900 */ | ||
2478 | 0x0000, /* R901 */ | ||
2479 | 0x0000, /* R902 */ | ||
2480 | 0x0000, /* R903 */ | ||
2481 | 0x0000, /* R904 */ | ||
2482 | 0x0000, /* R905 */ | ||
2483 | 0x0000, /* R906 */ | ||
2484 | 0x0000, /* R907 */ | ||
2485 | 0x0000, /* R908 */ | ||
2486 | 0x0000, /* R909 */ | ||
2487 | 0x0000, /* R910 */ | ||
2488 | 0x0000, /* R911 */ | ||
2489 | 0x0000, /* R912 */ | ||
2490 | 0x0000, /* R913 */ | ||
2491 | 0x0000, /* R914 */ | ||
2492 | 0x0000, /* R915 */ | ||
2493 | 0x0000, /* R916 */ | ||
2494 | 0x0000, /* R917 */ | ||
2495 | 0x0000, /* R918 */ | ||
2496 | 0x0000, /* R919 */ | ||
2497 | 0x0000, /* R920 */ | ||
2498 | 0x0000, /* R921 */ | ||
2499 | 0x0000, /* R922 */ | ||
2500 | 0x0000, /* R923 */ | ||
2501 | 0x0000, /* R924 */ | ||
2502 | 0x0000, /* R925 */ | ||
2503 | 0x0000, /* R926 */ | ||
2504 | 0x0000, /* R927 */ | ||
2505 | 0x0000, /* R928 */ | ||
2506 | 0x0000, /* R929 */ | ||
2507 | 0x0000, /* R930 */ | ||
2508 | 0x0000, /* R931 */ | ||
2509 | 0x0000, /* R932 */ | ||
2510 | 0x0000, /* R933 */ | ||
2511 | 0x0000, /* R934 */ | ||
2512 | 0x0000, /* R935 */ | ||
2513 | 0x0000, /* R936 */ | ||
2514 | 0x0000, /* R937 */ | ||
2515 | 0x0000, /* R938 */ | ||
2516 | 0x0000, /* R939 */ | ||
2517 | 0x0000, /* R940 */ | ||
2518 | 0x0000, /* R941 */ | ||
2519 | 0x0000, /* R942 */ | ||
2520 | 0x0000, /* R943 */ | ||
2521 | 0x0000, /* R944 */ | ||
2522 | 0x0000, /* R945 */ | ||
2523 | 0x0000, /* R946 */ | ||
2524 | 0x0000, /* R947 */ | ||
2525 | 0x0000, /* R948 */ | ||
2526 | 0x0000, /* R949 */ | ||
2527 | 0x0000, /* R950 */ | ||
2528 | 0x0000, /* R951 */ | ||
2529 | 0x0000, /* R952 */ | ||
2530 | 0x0000, /* R953 */ | ||
2531 | 0x0000, /* R954 */ | ||
2532 | 0x0000, /* R955 */ | ||
2533 | 0x0000, /* R956 */ | ||
2534 | 0x0000, /* R957 */ | ||
2535 | 0x0000, /* R958 */ | ||
2536 | 0x0000, /* R959 */ | ||
2537 | 0x0000, /* R960 */ | ||
2538 | 0x0000, /* R961 */ | ||
2539 | 0x0000, /* R962 */ | ||
2540 | 0x0000, /* R963 */ | ||
2541 | 0x0000, /* R964 */ | ||
2542 | 0x0000, /* R965 */ | ||
2543 | 0x0000, /* R966 */ | ||
2544 | 0x0000, /* R967 */ | ||
2545 | 0x0000, /* R968 */ | ||
2546 | 0x0000, /* R969 */ | ||
2547 | 0x0000, /* R970 */ | ||
2548 | 0x0000, /* R971 */ | ||
2549 | 0x0000, /* R972 */ | ||
2550 | 0x0000, /* R973 */ | ||
2551 | 0x0000, /* R974 */ | ||
2552 | 0x0000, /* R975 */ | ||
2553 | 0x0000, /* R976 */ | ||
2554 | 0x0000, /* R977 */ | ||
2555 | 0x0000, /* R978 */ | ||
2556 | 0x0000, /* R979 */ | ||
2557 | 0x0000, /* R980 */ | ||
2558 | 0x0000, /* R981 */ | ||
2559 | 0x0000, /* R982 */ | ||
2560 | 0x0000, /* R983 */ | ||
2561 | 0x0000, /* R984 */ | ||
2562 | 0x0000, /* R985 */ | ||
2563 | 0x0000, /* R986 */ | ||
2564 | 0x0000, /* R987 */ | ||
2565 | 0x0000, /* R988 */ | ||
2566 | 0x0000, /* R989 */ | ||
2567 | 0x0000, /* R990 */ | ||
2568 | 0x0000, /* R991 */ | ||
2569 | 0x0000, /* R992 */ | ||
2570 | 0x0000, /* R993 */ | ||
2571 | 0x0000, /* R994 */ | ||
2572 | 0x0000, /* R995 */ | ||
2573 | 0x0000, /* R996 */ | ||
2574 | 0x0000, /* R997 */ | ||
2575 | 0x0000, /* R998 */ | ||
2576 | 0x0000, /* R999 */ | ||
2577 | 0x0000, /* R1000 */ | ||
2578 | 0x0000, /* R1001 */ | ||
2579 | 0x0000, /* R1002 */ | ||
2580 | 0x0000, /* R1003 */ | ||
2581 | 0x0000, /* R1004 */ | ||
2582 | 0x0000, /* R1005 */ | ||
2583 | 0x0000, /* R1006 */ | ||
2584 | 0x0000, /* R1007 */ | ||
2585 | 0x0000, /* R1008 */ | ||
2586 | 0x0000, /* R1009 */ | ||
2587 | 0x0000, /* R1010 */ | ||
2588 | 0x0000, /* R1011 */ | ||
2589 | 0x0000, /* R1012 */ | ||
2590 | 0x0000, /* R1013 */ | ||
2591 | 0x0000, /* R1014 */ | ||
2592 | 0x0000, /* R1015 */ | ||
2593 | 0x0000, /* R1016 */ | ||
2594 | 0x0000, /* R1017 */ | ||
2595 | 0x0000, /* R1018 */ | ||
2596 | 0x0000, /* R1019 */ | ||
2597 | 0x0000, /* R1020 */ | ||
2598 | 0x0000, /* R1021 */ | ||
2599 | 0x0000, /* R1022 */ | ||
2600 | 0x0000, /* R1023 */ | ||
2601 | 0x00C0, /* R1024 - AIF1 ADC1 Left Volume */ | ||
2602 | 0x00C0, /* R1025 - AIF1 ADC1 Right Volume */ | ||
2603 | 0x00C0, /* R1026 - AIF1 DAC1 Left Volume */ | ||
2604 | 0x00C0, /* R1027 - AIF1 DAC1 Right Volume */ | ||
2605 | 0x00C0, /* R1028 - AIF1 ADC2 Left Volume */ | ||
2606 | 0x00C0, /* R1029 - AIF1 ADC2 Right Volume */ | ||
2607 | 0x00C0, /* R1030 - AIF1 DAC2 Left Volume */ | ||
2608 | 0x00C0, /* R1031 - AIF1 DAC2 Right Volume */ | ||
2609 | 0x0000, /* R1032 */ | ||
2610 | 0x0000, /* R1033 */ | ||
2611 | 0x0000, /* R1034 */ | ||
2612 | 0x0000, /* R1035 */ | ||
2613 | 0x0000, /* R1036 */ | ||
2614 | 0x0000, /* R1037 */ | ||
2615 | 0x0000, /* R1038 */ | ||
2616 | 0x0000, /* R1039 */ | ||
2617 | 0x0000, /* R1040 - AIF1 ADC1 Filters */ | ||
2618 | 0x0000, /* R1041 - AIF1 ADC2 Filters */ | ||
2619 | 0x0000, /* R1042 */ | ||
2620 | 0x0000, /* R1043 */ | ||
2621 | 0x0000, /* R1044 */ | ||
2622 | 0x0000, /* R1045 */ | ||
2623 | 0x0000, /* R1046 */ | ||
2624 | 0x0000, /* R1047 */ | ||
2625 | 0x0000, /* R1048 */ | ||
2626 | 0x0000, /* R1049 */ | ||
2627 | 0x0000, /* R1050 */ | ||
2628 | 0x0000, /* R1051 */ | ||
2629 | 0x0000, /* R1052 */ | ||
2630 | 0x0000, /* R1053 */ | ||
2631 | 0x0000, /* R1054 */ | ||
2632 | 0x0000, /* R1055 */ | ||
2633 | 0x0200, /* R1056 - AIF1 DAC1 Filters (1) */ | ||
2634 | 0x0010, /* R1057 - AIF1 DAC1 Filters (2) */ | ||
2635 | 0x0200, /* R1058 - AIF1 DAC2 Filters (1) */ | ||
2636 | 0x0010, /* R1059 - AIF1 DAC2 Filters (2) */ | ||
2637 | 0x0000, /* R1060 */ | ||
2638 | 0x0000, /* R1061 */ | ||
2639 | 0x0000, /* R1062 */ | ||
2640 | 0x0000, /* R1063 */ | ||
2641 | 0x0000, /* R1064 */ | ||
2642 | 0x0000, /* R1065 */ | ||
2643 | 0x0000, /* R1066 */ | ||
2644 | 0x0000, /* R1067 */ | ||
2645 | 0x0000, /* R1068 */ | ||
2646 | 0x0000, /* R1069 */ | ||
2647 | 0x0000, /* R1070 */ | ||
2648 | 0x0000, /* R1071 */ | ||
2649 | 0x0068, /* R1072 - AIF1 DAC1 Noise Gate */ | ||
2650 | 0x0068, /* R1073 - AIF1 DAC2 Noise Gate */ | ||
2651 | 0x0000, /* R1074 */ | ||
2652 | 0x0000, /* R1075 */ | ||
2653 | 0x0000, /* R1076 */ | ||
2654 | 0x0000, /* R1077 */ | ||
2655 | 0x0000, /* R1078 */ | ||
2656 | 0x0000, /* R1079 */ | ||
2657 | 0x0000, /* R1080 */ | ||
2658 | 0x0000, /* R1081 */ | ||
2659 | 0x0000, /* R1082 */ | ||
2660 | 0x0000, /* R1083 */ | ||
2661 | 0x0000, /* R1084 */ | ||
2662 | 0x0000, /* R1085 */ | ||
2663 | 0x0000, /* R1086 */ | ||
2664 | 0x0000, /* R1087 */ | ||
2665 | 0x0098, /* R1088 - AIF1 DRC1 (1) */ | ||
2666 | 0x0845, /* R1089 - AIF1 DRC1 (2) */ | ||
2667 | 0x0000, /* R1090 - AIF1 DRC1 (3) */ | ||
2668 | 0x0000, /* R1091 - AIF1 DRC1 (4) */ | ||
2669 | 0x0000, /* R1092 - AIF1 DRC1 (5) */ | ||
2670 | 0x0000, /* R1093 */ | ||
2671 | 0x0000, /* R1094 */ | ||
2672 | 0x0000, /* R1095 */ | ||
2673 | 0x0000, /* R1096 */ | ||
2674 | 0x0000, /* R1097 */ | ||
2675 | 0x0000, /* R1098 */ | ||
2676 | 0x0000, /* R1099 */ | ||
2677 | 0x0000, /* R1100 */ | ||
2678 | 0x0000, /* R1101 */ | ||
2679 | 0x0000, /* R1102 */ | ||
2680 | 0x0000, /* R1103 */ | ||
2681 | 0x0098, /* R1104 - AIF1 DRC2 (1) */ | ||
2682 | 0x0845, /* R1105 - AIF1 DRC2 (2) */ | ||
2683 | 0x0000, /* R1106 - AIF1 DRC2 (3) */ | ||
2684 | 0x0000, /* R1107 - AIF1 DRC2 (4) */ | ||
2685 | 0x0000, /* R1108 - AIF1 DRC2 (5) */ | ||
2686 | 0x0000, /* R1109 */ | ||
2687 | 0x0000, /* R1110 */ | ||
2688 | 0x0000, /* R1111 */ | ||
2689 | 0x0000, /* R1112 */ | ||
2690 | 0x0000, /* R1113 */ | ||
2691 | 0x0000, /* R1114 */ | ||
2692 | 0x0000, /* R1115 */ | ||
2693 | 0x0000, /* R1116 */ | ||
2694 | 0x0000, /* R1117 */ | ||
2695 | 0x0000, /* R1118 */ | ||
2696 | 0x0000, /* R1119 */ | ||
2697 | 0x0000, /* R1120 */ | ||
2698 | 0x0000, /* R1121 */ | ||
2699 | 0x0000, /* R1122 */ | ||
2700 | 0x0000, /* R1123 */ | ||
2701 | 0x0000, /* R1124 */ | ||
2702 | 0x0000, /* R1125 */ | ||
2703 | 0x0000, /* R1126 */ | ||
2704 | 0x0000, /* R1127 */ | ||
2705 | 0x0000, /* R1128 */ | ||
2706 | 0x0000, /* R1129 */ | ||
2707 | 0x0000, /* R1130 */ | ||
2708 | 0x0000, /* R1131 */ | ||
2709 | 0x0000, /* R1132 */ | ||
2710 | 0x0000, /* R1133 */ | ||
2711 | 0x0000, /* R1134 */ | ||
2712 | 0x0000, /* R1135 */ | ||
2713 | 0x0000, /* R1136 */ | ||
2714 | 0x0000, /* R1137 */ | ||
2715 | 0x0000, /* R1138 */ | ||
2716 | 0x0000, /* R1139 */ | ||
2717 | 0x0000, /* R1140 */ | ||
2718 | 0x0000, /* R1141 */ | ||
2719 | 0x0000, /* R1142 */ | ||
2720 | 0x0000, /* R1143 */ | ||
2721 | 0x0000, /* R1144 */ | ||
2722 | 0x0000, /* R1145 */ | ||
2723 | 0x0000, /* R1146 */ | ||
2724 | 0x0000, /* R1147 */ | ||
2725 | 0x0000, /* R1148 */ | ||
2726 | 0x0000, /* R1149 */ | ||
2727 | 0x0000, /* R1150 */ | ||
2728 | 0x0000, /* R1151 */ | ||
2729 | 0x6318, /* R1152 - AIF1 DAC1 EQ Gains (1) */ | ||
2730 | 0x6300, /* R1153 - AIF1 DAC1 EQ Gains (2) */ | ||
2731 | 0x0FCA, /* R1154 - AIF1 DAC1 EQ Band 1 A */ | ||
2732 | 0x0400, /* R1155 - AIF1 DAC1 EQ Band 1 B */ | ||
2733 | 0x00D8, /* R1156 - AIF1 DAC1 EQ Band 1 PG */ | ||
2734 | 0x1EB5, /* R1157 - AIF1 DAC1 EQ Band 2 A */ | ||
2735 | 0xF145, /* R1158 - AIF1 DAC1 EQ Band 2 B */ | ||
2736 | 0x0B75, /* R1159 - AIF1 DAC1 EQ Band 2 C */ | ||
2737 | 0x01C5, /* R1160 - AIF1 DAC1 EQ Band 2 PG */ | ||
2738 | 0x1C58, /* R1161 - AIF1 DAC1 EQ Band 3 A */ | ||
2739 | 0xF373, /* R1162 - AIF1 DAC1 EQ Band 3 B */ | ||
2740 | 0x0A54, /* R1163 - AIF1 DAC1 EQ Band 3 C */ | ||
2741 | 0x0558, /* R1164 - AIF1 DAC1 EQ Band 3 PG */ | ||
2742 | 0x168E, /* R1165 - AIF1 DAC1 EQ Band 4 A */ | ||
2743 | 0xF829, /* R1166 - AIF1 DAC1 EQ Band 4 B */ | ||
2744 | 0x07AD, /* R1167 - AIF1 DAC1 EQ Band 4 C */ | ||
2745 | 0x1103, /* R1168 - AIF1 DAC1 EQ Band 4 PG */ | ||
2746 | 0x0564, /* R1169 - AIF1 DAC1 EQ Band 5 A */ | ||
2747 | 0x0559, /* R1170 - AIF1 DAC1 EQ Band 5 B */ | ||
2748 | 0x4000, /* R1171 - AIF1 DAC1 EQ Band 5 PG */ | ||
2749 | 0x0000, /* R1172 */ | ||
2750 | 0x0000, /* R1173 */ | ||
2751 | 0x0000, /* R1174 */ | ||
2752 | 0x0000, /* R1175 */ | ||
2753 | 0x0000, /* R1176 */ | ||
2754 | 0x0000, /* R1177 */ | ||
2755 | 0x0000, /* R1178 */ | ||
2756 | 0x0000, /* R1179 */ | ||
2757 | 0x0000, /* R1180 */ | ||
2758 | 0x0000, /* R1181 */ | ||
2759 | 0x0000, /* R1182 */ | ||
2760 | 0x0000, /* R1183 */ | ||
2761 | 0x6318, /* R1184 - AIF1 DAC2 EQ Gains (1) */ | ||
2762 | 0x6300, /* R1185 - AIF1 DAC2 EQ Gains (2) */ | ||
2763 | 0x0FCA, /* R1186 - AIF1 DAC2 EQ Band 1 A */ | ||
2764 | 0x0400, /* R1187 - AIF1 DAC2 EQ Band 1 B */ | ||
2765 | 0x00D8, /* R1188 - AIF1 DAC2 EQ Band 1 PG */ | ||
2766 | 0x1EB5, /* R1189 - AIF1 DAC2 EQ Band 2 A */ | ||
2767 | 0xF145, /* R1190 - AIF1 DAC2 EQ Band 2 B */ | ||
2768 | 0x0B75, /* R1191 - AIF1 DAC2 EQ Band 2 C */ | ||
2769 | 0x01C5, /* R1192 - AIF1 DAC2 EQ Band 2 PG */ | ||
2770 | 0x1C58, /* R1193 - AIF1 DAC2 EQ Band 3 A */ | ||
2771 | 0xF373, /* R1194 - AIF1 DAC2 EQ Band 3 B */ | ||
2772 | 0x0A54, /* R1195 - AIF1 DAC2 EQ Band 3 C */ | ||
2773 | 0x0558, /* R1196 - AIF1 DAC2 EQ Band 3 PG */ | ||
2774 | 0x168E, /* R1197 - AIF1 DAC2 EQ Band 4 A */ | ||
2775 | 0xF829, /* R1198 - AIF1 DAC2 EQ Band 4 B */ | ||
2776 | 0x07AD, /* R1199 - AIF1 DAC2 EQ Band 4 C */ | ||
2777 | 0x1103, /* R1200 - AIF1 DAC2 EQ Band 4 PG */ | ||
2778 | 0x0564, /* R1201 - AIF1 DAC2 EQ Band 5 A */ | ||
2779 | 0x0559, /* R1202 - AIF1 DAC2 EQ Band 5 B */ | ||
2780 | 0x4000, /* R1203 - AIF1 DAC2 EQ Band 5 PG */ | ||
2781 | 0x0000, /* R1204 */ | ||
2782 | 0x0000, /* R1205 */ | ||
2783 | 0x0000, /* R1206 */ | ||
2784 | 0x0000, /* R1207 */ | ||
2785 | 0x0000, /* R1208 */ | ||
2786 | 0x0000, /* R1209 */ | ||
2787 | 0x0000, /* R1210 */ | ||
2788 | 0x0000, /* R1211 */ | ||
2789 | 0x0000, /* R1212 */ | ||
2790 | 0x0000, /* R1213 */ | ||
2791 | 0x0000, /* R1214 */ | ||
2792 | 0x0000, /* R1215 */ | ||
2793 | 0x0000, /* R1216 */ | ||
2794 | 0x0000, /* R1217 */ | ||
2795 | 0x0000, /* R1218 */ | ||
2796 | 0x0000, /* R1219 */ | ||
2797 | 0x0000, /* R1220 */ | ||
2798 | 0x0000, /* R1221 */ | ||
2799 | 0x0000, /* R1222 */ | ||
2800 | 0x0000, /* R1223 */ | ||
2801 | 0x0000, /* R1224 */ | ||
2802 | 0x0000, /* R1225 */ | ||
2803 | 0x0000, /* R1226 */ | ||
2804 | 0x0000, /* R1227 */ | ||
2805 | 0x0000, /* R1228 */ | ||
2806 | 0x0000, /* R1229 */ | ||
2807 | 0x0000, /* R1230 */ | ||
2808 | 0x0000, /* R1231 */ | ||
2809 | 0x0000, /* R1232 */ | ||
2810 | 0x0000, /* R1233 */ | ||
2811 | 0x0000, /* R1234 */ | ||
2812 | 0x0000, /* R1235 */ | ||
2813 | 0x0000, /* R1236 */ | ||
2814 | 0x0000, /* R1237 */ | ||
2815 | 0x0000, /* R1238 */ | ||
2816 | 0x0000, /* R1239 */ | ||
2817 | 0x0000, /* R1240 */ | ||
2818 | 0x0000, /* R1241 */ | ||
2819 | 0x0000, /* R1242 */ | ||
2820 | 0x0000, /* R1243 */ | ||
2821 | 0x0000, /* R1244 */ | ||
2822 | 0x0000, /* R1245 */ | ||
2823 | 0x0000, /* R1246 */ | ||
2824 | 0x0000, /* R1247 */ | ||
2825 | 0x0000, /* R1248 */ | ||
2826 | 0x0000, /* R1249 */ | ||
2827 | 0x0000, /* R1250 */ | ||
2828 | 0x0000, /* R1251 */ | ||
2829 | 0x0000, /* R1252 */ | ||
2830 | 0x0000, /* R1253 */ | ||
2831 | 0x0000, /* R1254 */ | ||
2832 | 0x0000, /* R1255 */ | ||
2833 | 0x0000, /* R1256 */ | ||
2834 | 0x0000, /* R1257 */ | ||
2835 | 0x0000, /* R1258 */ | ||
2836 | 0x0000, /* R1259 */ | ||
2837 | 0x0000, /* R1260 */ | ||
2838 | 0x0000, /* R1261 */ | ||
2839 | 0x0000, /* R1262 */ | ||
2840 | 0x0000, /* R1263 */ | ||
2841 | 0x0000, /* R1264 */ | ||
2842 | 0x0000, /* R1265 */ | ||
2843 | 0x0000, /* R1266 */ | ||
2844 | 0x0000, /* R1267 */ | ||
2845 | 0x0000, /* R1268 */ | ||
2846 | 0x0000, /* R1269 */ | ||
2847 | 0x0000, /* R1270 */ | ||
2848 | 0x0000, /* R1271 */ | ||
2849 | 0x0000, /* R1272 */ | ||
2850 | 0x0000, /* R1273 */ | ||
2851 | 0x0000, /* R1274 */ | ||
2852 | 0x0000, /* R1275 */ | ||
2853 | 0x0000, /* R1276 */ | ||
2854 | 0x0000, /* R1277 */ | ||
2855 | 0x0000, /* R1278 */ | ||
2856 | 0x0000, /* R1279 */ | ||
2857 | 0x00C0, /* R1280 - AIF2 ADC Left Volume */ | ||
2858 | 0x00C0, /* R1281 - AIF2 ADC Right Volume */ | ||
2859 | 0x00C0, /* R1282 - AIF2 DAC Left Volume */ | ||
2860 | 0x00C0, /* R1283 - AIF2 DAC Right Volume */ | ||
2861 | 0x0000, /* R1284 */ | ||
2862 | 0x0000, /* R1285 */ | ||
2863 | 0x0000, /* R1286 */ | ||
2864 | 0x0000, /* R1287 */ | ||
2865 | 0x0000, /* R1288 */ | ||
2866 | 0x0000, /* R1289 */ | ||
2867 | 0x0000, /* R1290 */ | ||
2868 | 0x0000, /* R1291 */ | ||
2869 | 0x0000, /* R1292 */ | ||
2870 | 0x0000, /* R1293 */ | ||
2871 | 0x0000, /* R1294 */ | ||
2872 | 0x0000, /* R1295 */ | ||
2873 | 0x0000, /* R1296 - AIF2 ADC Filters */ | ||
2874 | 0x0000, /* R1297 */ | ||
2875 | 0x0000, /* R1298 */ | ||
2876 | 0x0000, /* R1299 */ | ||
2877 | 0x0000, /* R1300 */ | ||
2878 | 0x0000, /* R1301 */ | ||
2879 | 0x0000, /* R1302 */ | ||
2880 | 0x0000, /* R1303 */ | ||
2881 | 0x0000, /* R1304 */ | ||
2882 | 0x0000, /* R1305 */ | ||
2883 | 0x0000, /* R1306 */ | ||
2884 | 0x0000, /* R1307 */ | ||
2885 | 0x0000, /* R1308 */ | ||
2886 | 0x0000, /* R1309 */ | ||
2887 | 0x0000, /* R1310 */ | ||
2888 | 0x0000, /* R1311 */ | ||
2889 | 0x0200, /* R1312 - AIF2 DAC Filters (1) */ | ||
2890 | 0x0010, /* R1313 - AIF2 DAC Filters (2) */ | ||
2891 | 0x0000, /* R1314 */ | ||
2892 | 0x0000, /* R1315 */ | ||
2893 | 0x0000, /* R1316 */ | ||
2894 | 0x0000, /* R1317 */ | ||
2895 | 0x0000, /* R1318 */ | ||
2896 | 0x0000, /* R1319 */ | ||
2897 | 0x0000, /* R1320 */ | ||
2898 | 0x0000, /* R1321 */ | ||
2899 | 0x0000, /* R1322 */ | ||
2900 | 0x0000, /* R1323 */ | ||
2901 | 0x0000, /* R1324 */ | ||
2902 | 0x0000, /* R1325 */ | ||
2903 | 0x0000, /* R1326 */ | ||
2904 | 0x0000, /* R1327 */ | ||
2905 | 0x0068, /* R1328 - AIF2 DAC Noise Gate */ | ||
2906 | 0x0000, /* R1329 */ | ||
2907 | 0x0000, /* R1330 */ | ||
2908 | 0x0000, /* R1331 */ | ||
2909 | 0x0000, /* R1332 */ | ||
2910 | 0x0000, /* R1333 */ | ||
2911 | 0x0000, /* R1334 */ | ||
2912 | 0x0000, /* R1335 */ | ||
2913 | 0x0000, /* R1336 */ | ||
2914 | 0x0000, /* R1337 */ | ||
2915 | 0x0000, /* R1338 */ | ||
2916 | 0x0000, /* R1339 */ | ||
2917 | 0x0000, /* R1340 */ | ||
2918 | 0x0000, /* R1341 */ | ||
2919 | 0x0000, /* R1342 */ | ||
2920 | 0x0000, /* R1343 */ | ||
2921 | 0x0098, /* R1344 - AIF2 DRC (1) */ | ||
2922 | 0x0845, /* R1345 - AIF2 DRC (2) */ | ||
2923 | 0x0000, /* R1346 - AIF2 DRC (3) */ | ||
2924 | 0x0000, /* R1347 - AIF2 DRC (4) */ | ||
2925 | 0x0000, /* R1348 - AIF2 DRC (5) */ | ||
2926 | 0x0000, /* R1349 */ | ||
2927 | 0x0000, /* R1350 */ | ||
2928 | 0x0000, /* R1351 */ | ||
2929 | 0x0000, /* R1352 */ | ||
2930 | 0x0000, /* R1353 */ | ||
2931 | 0x0000, /* R1354 */ | ||
2932 | 0x0000, /* R1355 */ | ||
2933 | 0x0000, /* R1356 */ | ||
2934 | 0x0000, /* R1357 */ | ||
2935 | 0x0000, /* R1358 */ | ||
2936 | 0x0000, /* R1359 */ | ||
2937 | 0x0000, /* R1360 */ | ||
2938 | 0x0000, /* R1361 */ | ||
2939 | 0x0000, /* R1362 */ | ||
2940 | 0x0000, /* R1363 */ | ||
2941 | 0x0000, /* R1364 */ | ||
2942 | 0x0000, /* R1365 */ | ||
2943 | 0x0000, /* R1366 */ | ||
2944 | 0x0000, /* R1367 */ | ||
2945 | 0x0000, /* R1368 */ | ||
2946 | 0x0000, /* R1369 */ | ||
2947 | 0x0000, /* R1370 */ | ||
2948 | 0x0000, /* R1371 */ | ||
2949 | 0x0000, /* R1372 */ | ||
2950 | 0x0000, /* R1373 */ | ||
2951 | 0x0000, /* R1374 */ | ||
2952 | 0x0000, /* R1375 */ | ||
2953 | 0x0000, /* R1376 */ | ||
2954 | 0x0000, /* R1377 */ | ||
2955 | 0x0000, /* R1378 */ | ||
2956 | 0x0000, /* R1379 */ | ||
2957 | 0x0000, /* R1380 */ | ||
2958 | 0x0000, /* R1381 */ | ||
2959 | 0x0000, /* R1382 */ | ||
2960 | 0x0000, /* R1383 */ | ||
2961 | 0x0000, /* R1384 */ | ||
2962 | 0x0000, /* R1385 */ | ||
2963 | 0x0000, /* R1386 */ | ||
2964 | 0x0000, /* R1387 */ | ||
2965 | 0x0000, /* R1388 */ | ||
2966 | 0x0000, /* R1389 */ | ||
2967 | 0x0000, /* R1390 */ | ||
2968 | 0x0000, /* R1391 */ | ||
2969 | 0x0000, /* R1392 */ | ||
2970 | 0x0000, /* R1393 */ | ||
2971 | 0x0000, /* R1394 */ | ||
2972 | 0x0000, /* R1395 */ | ||
2973 | 0x0000, /* R1396 */ | ||
2974 | 0x0000, /* R1397 */ | ||
2975 | 0x0000, /* R1398 */ | ||
2976 | 0x0000, /* R1399 */ | ||
2977 | 0x0000, /* R1400 */ | ||
2978 | 0x0000, /* R1401 */ | ||
2979 | 0x0000, /* R1402 */ | ||
2980 | 0x0000, /* R1403 */ | ||
2981 | 0x0000, /* R1404 */ | ||
2982 | 0x0000, /* R1405 */ | ||
2983 | 0x0000, /* R1406 */ | ||
2984 | 0x0000, /* R1407 */ | ||
2985 | 0x6318, /* R1408 - AIF2 EQ Gains (1) */ | ||
2986 | 0x6300, /* R1409 - AIF2 EQ Gains (2) */ | ||
2987 | 0x0FCA, /* R1410 - AIF2 EQ Band 1 A */ | ||
2988 | 0x0400, /* R1411 - AIF2 EQ Band 1 B */ | ||
2989 | 0x00D8, /* R1412 - AIF2 EQ Band 1 PG */ | ||
2990 | 0x1EB5, /* R1413 - AIF2 EQ Band 2 A */ | ||
2991 | 0xF145, /* R1414 - AIF2 EQ Band 2 B */ | ||
2992 | 0x0B75, /* R1415 - AIF2 EQ Band 2 C */ | ||
2993 | 0x01C5, /* R1416 - AIF2 EQ Band 2 PG */ | ||
2994 | 0x1C58, /* R1417 - AIF2 EQ Band 3 A */ | ||
2995 | 0xF373, /* R1418 - AIF2 EQ Band 3 B */ | ||
2996 | 0x0A54, /* R1419 - AIF2 EQ Band 3 C */ | ||
2997 | 0x0558, /* R1420 - AIF2 EQ Band 3 PG */ | ||
2998 | 0x168E, /* R1421 - AIF2 EQ Band 4 A */ | ||
2999 | 0xF829, /* R1422 - AIF2 EQ Band 4 B */ | ||
3000 | 0x07AD, /* R1423 - AIF2 EQ Band 4 C */ | ||
3001 | 0x1103, /* R1424 - AIF2 EQ Band 4 PG */ | ||
3002 | 0x0564, /* R1425 - AIF2 EQ Band 5 A */ | ||
3003 | 0x0559, /* R1426 - AIF2 EQ Band 5 B */ | ||
3004 | 0x4000, /* R1427 - AIF2 EQ Band 5 PG */ | ||
3005 | 0x0000, /* R1428 */ | ||
3006 | 0x0000, /* R1429 */ | ||
3007 | 0x0000, /* R1430 */ | ||
3008 | 0x0000, /* R1431 */ | ||
3009 | 0x0000, /* R1432 */ | ||
3010 | 0x0000, /* R1433 */ | ||
3011 | 0x0000, /* R1434 */ | ||
3012 | 0x0000, /* R1435 */ | ||
3013 | 0x0000, /* R1436 */ | ||
3014 | 0x0000, /* R1437 */ | ||
3015 | 0x0000, /* R1438 */ | ||
3016 | 0x0000, /* R1439 */ | ||
3017 | 0x0000, /* R1440 */ | ||
3018 | 0x0000, /* R1441 */ | ||
3019 | 0x0000, /* R1442 */ | ||
3020 | 0x0000, /* R1443 */ | ||
3021 | 0x0000, /* R1444 */ | ||
3022 | 0x0000, /* R1445 */ | ||
3023 | 0x0000, /* R1446 */ | ||
3024 | 0x0000, /* R1447 */ | ||
3025 | 0x0000, /* R1448 */ | ||
3026 | 0x0000, /* R1449 */ | ||
3027 | 0x0000, /* R1450 */ | ||
3028 | 0x0000, /* R1451 */ | ||
3029 | 0x0000, /* R1452 */ | ||
3030 | 0x0000, /* R1453 */ | ||
3031 | 0x0000, /* R1454 */ | ||
3032 | 0x0000, /* R1455 */ | ||
3033 | 0x0000, /* R1456 */ | ||
3034 | 0x0000, /* R1457 */ | ||
3035 | 0x0000, /* R1458 */ | ||
3036 | 0x0000, /* R1459 */ | ||
3037 | 0x0000, /* R1460 */ | ||
3038 | 0x0000, /* R1461 */ | ||
3039 | 0x0000, /* R1462 */ | ||
3040 | 0x0000, /* R1463 */ | ||
3041 | 0x0000, /* R1464 */ | ||
3042 | 0x0000, /* R1465 */ | ||
3043 | 0x0000, /* R1466 */ | ||
3044 | 0x0000, /* R1467 */ | ||
3045 | 0x0000, /* R1468 */ | ||
3046 | 0x0000, /* R1469 */ | ||
3047 | 0x0000, /* R1470 */ | ||
3048 | 0x0000, /* R1471 */ | ||
3049 | 0x0000, /* R1472 */ | ||
3050 | 0x0000, /* R1473 */ | ||
3051 | 0x0000, /* R1474 */ | ||
3052 | 0x0000, /* R1475 */ | ||
3053 | 0x0000, /* R1476 */ | ||
3054 | 0x0000, /* R1477 */ | ||
3055 | 0x0000, /* R1478 */ | ||
3056 | 0x0000, /* R1479 */ | ||
3057 | 0x0000, /* R1480 */ | ||
3058 | 0x0000, /* R1481 */ | ||
3059 | 0x0000, /* R1482 */ | ||
3060 | 0x0000, /* R1483 */ | ||
3061 | 0x0000, /* R1484 */ | ||
3062 | 0x0000, /* R1485 */ | ||
3063 | 0x0000, /* R1486 */ | ||
3064 | 0x0000, /* R1487 */ | ||
3065 | 0x0000, /* R1488 */ | ||
3066 | 0x0000, /* R1489 */ | ||
3067 | 0x0000, /* R1490 */ | ||
3068 | 0x0000, /* R1491 */ | ||
3069 | 0x0000, /* R1492 */ | ||
3070 | 0x0000, /* R1493 */ | ||
3071 | 0x0000, /* R1494 */ | ||
3072 | 0x0000, /* R1495 */ | ||
3073 | 0x0000, /* R1496 */ | ||
3074 | 0x0000, /* R1497 */ | ||
3075 | 0x0000, /* R1498 */ | ||
3076 | 0x0000, /* R1499 */ | ||
3077 | 0x0000, /* R1500 */ | ||
3078 | 0x0000, /* R1501 */ | ||
3079 | 0x0000, /* R1502 */ | ||
3080 | 0x0000, /* R1503 */ | ||
3081 | 0x0000, /* R1504 */ | ||
3082 | 0x0000, /* R1505 */ | ||
3083 | 0x0000, /* R1506 */ | ||
3084 | 0x0000, /* R1507 */ | ||
3085 | 0x0000, /* R1508 */ | ||
3086 | 0x0000, /* R1509 */ | ||
3087 | 0x0000, /* R1510 */ | ||
3088 | 0x0000, /* R1511 */ | ||
3089 | 0x0000, /* R1512 */ | ||
3090 | 0x0000, /* R1513 */ | ||
3091 | 0x0000, /* R1514 */ | ||
3092 | 0x0000, /* R1515 */ | ||
3093 | 0x0000, /* R1516 */ | ||
3094 | 0x0000, /* R1517 */ | ||
3095 | 0x0000, /* R1518 */ | ||
3096 | 0x0000, /* R1519 */ | ||
3097 | 0x0000, /* R1520 */ | ||
3098 | 0x0000, /* R1521 */ | ||
3099 | 0x0000, /* R1522 */ | ||
3100 | 0x0000, /* R1523 */ | ||
3101 | 0x0000, /* R1524 */ | ||
3102 | 0x0000, /* R1525 */ | ||
3103 | 0x0000, /* R1526 */ | ||
3104 | 0x0000, /* R1527 */ | ||
3105 | 0x0000, /* R1528 */ | ||
3106 | 0x0000, /* R1529 */ | ||
3107 | 0x0000, /* R1530 */ | ||
3108 | 0x0000, /* R1531 */ | ||
3109 | 0x0000, /* R1532 */ | ||
3110 | 0x0000, /* R1533 */ | ||
3111 | 0x0000, /* R1534 */ | ||
3112 | 0x0000, /* R1535 */ | ||
3113 | 0x0000, /* R1536 - DAC1 Mixer Volumes */ | ||
3114 | 0x0000, /* R1537 - DAC1 Left Mixer Routing */ | ||
3115 | 0x0000, /* R1538 - DAC1 Right Mixer Routing */ | ||
3116 | 0x0000, /* R1539 - DAC2 Mixer Volumes */ | ||
3117 | 0x0000, /* R1540 - DAC2 Left Mixer Routing */ | ||
3118 | 0x0000, /* R1541 - DAC2 Right Mixer Routing */ | ||
3119 | 0x0000, /* R1542 - AIF1 ADC1 Left Mixer Routing */ | ||
3120 | 0x0000, /* R1543 - AIF1 ADC1 Right Mixer Routing */ | ||
3121 | 0x0000, /* R1544 - AIF1 ADC2 Left Mixer Routing */ | ||
3122 | 0x0000, /* R1545 - AIF1 ADC2 Right mixer Routing */ | ||
3123 | 0x0000, /* R1546 */ | ||
3124 | 0x0000, /* R1547 */ | ||
3125 | 0x0000, /* R1548 */ | ||
3126 | 0x0000, /* R1549 */ | ||
3127 | 0x0000, /* R1550 */ | ||
3128 | 0x0000, /* R1551 */ | ||
3129 | 0x02C0, /* R1552 - DAC1 Left Volume */ | ||
3130 | 0x02C0, /* R1553 - DAC1 Right Volume */ | ||
3131 | 0x02C0, /* R1554 - DAC2 Left Volume */ | ||
3132 | 0x02C0, /* R1555 - DAC2 Right Volume */ | ||
3133 | 0x0000, /* R1556 - DAC Softmute */ | ||
3134 | 0x0000, /* R1557 */ | ||
3135 | 0x0000, /* R1558 */ | ||
3136 | 0x0000, /* R1559 */ | ||
3137 | 0x0000, /* R1560 */ | ||
3138 | 0x0000, /* R1561 */ | ||
3139 | 0x0000, /* R1562 */ | ||
3140 | 0x0000, /* R1563 */ | ||
3141 | 0x0000, /* R1564 */ | ||
3142 | 0x0000, /* R1565 */ | ||
3143 | 0x0000, /* R1566 */ | ||
3144 | 0x0000, /* R1567 */ | ||
3145 | 0x0002, /* R1568 - Oversampling */ | ||
3146 | 0x0000, /* R1569 - Sidetone */ | ||
3147 | }; | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 9c982e47eb9..93d27b66025 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -38,6 +38,11 @@ | |||
38 | #include "wm8994.h" | 38 | #include "wm8994.h" |
39 | #include "wm_hubs.h" | 39 | #include "wm_hubs.h" |
40 | 40 | ||
41 | #define WM1811_JACKDET_MODE_NONE 0x0000 | ||
42 | #define WM1811_JACKDET_MODE_JACK 0x0100 | ||
43 | #define WM1811_JACKDET_MODE_MIC 0x0080 | ||
44 | #define WM1811_JACKDET_MODE_AUDIO 0x0180 | ||
45 | |||
41 | #define WM8994_NUM_DRC 3 | 46 | #define WM8994_NUM_DRC 3 |
42 | #define WM8994_NUM_EQ 3 | 47 | #define WM8994_NUM_EQ 3 |
43 | 48 | ||
@@ -53,103 +58,69 @@ static int wm8994_retune_mobile_base[] = { | |||
53 | WM8994_AIF2_EQ_GAINS_1, | 58 | WM8994_AIF2_EQ_GAINS_1, |
54 | }; | 59 | }; |
55 | 60 | ||
56 | static int wm8994_readable(struct snd_soc_codec *codec, unsigned int reg) | 61 | static void wm8958_default_micdet(u16 status, void *data); |
57 | { | ||
58 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
59 | struct wm8994 *control = codec->control_data; | ||
60 | |||
61 | switch (reg) { | ||
62 | case WM8994_GPIO_1: | ||
63 | case WM8994_GPIO_2: | ||
64 | case WM8994_GPIO_3: | ||
65 | case WM8994_GPIO_4: | ||
66 | case WM8994_GPIO_5: | ||
67 | case WM8994_GPIO_6: | ||
68 | case WM8994_GPIO_7: | ||
69 | case WM8994_GPIO_8: | ||
70 | case WM8994_GPIO_9: | ||
71 | case WM8994_GPIO_10: | ||
72 | case WM8994_GPIO_11: | ||
73 | case WM8994_INTERRUPT_STATUS_1: | ||
74 | case WM8994_INTERRUPT_STATUS_2: | ||
75 | case WM8994_INTERRUPT_RAW_STATUS_2: | ||
76 | return 1; | ||
77 | |||
78 | case WM8958_DSP2_PROGRAM: | ||
79 | case WM8958_DSP2_CONFIG: | ||
80 | case WM8958_DSP2_EXECCONTROL: | ||
81 | if (control->type == WM8958) | ||
82 | return 1; | ||
83 | else | ||
84 | return 0; | ||
85 | 62 | ||
86 | default: | 63 | static const struct wm8958_micd_rate micdet_rates[] = { |
87 | break; | 64 | { 32768, true, 1, 4 }, |
88 | } | 65 | { 32768, false, 1, 1 }, |
66 | { 44100 * 256, true, 7, 10 }, | ||
67 | { 44100 * 256, false, 7, 10 }, | ||
68 | }; | ||
89 | 69 | ||
90 | if (reg >= WM8994_CACHE_SIZE) | 70 | static const struct wm8958_micd_rate jackdet_rates[] = { |
91 | return 0; | 71 | { 32768, true, 0, 1 }, |
92 | return wm8994_access_masks[reg].readable != 0; | 72 | { 32768, false, 0, 1 }, |
93 | } | 73 | { 44100 * 256, true, 7, 10 }, |
74 | { 44100 * 256, false, 7, 10 }, | ||
75 | }; | ||
94 | 76 | ||
95 | static int wm8994_volatile(struct snd_soc_codec *codec, unsigned int reg) | 77 | static void wm8958_micd_set_rate(struct snd_soc_codec *codec) |
96 | { | 78 | { |
97 | if (reg >= WM8994_CACHE_SIZE) | 79 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
98 | return 1; | 80 | int best, i, sysclk, val; |
99 | 81 | bool idle; | |
100 | switch (reg) { | 82 | const struct wm8958_micd_rate *rates; |
101 | case WM8994_SOFTWARE_RESET: | 83 | int num_rates; |
102 | case WM8994_CHIP_REVISION: | ||
103 | case WM8994_DC_SERVO_1: | ||
104 | case WM8994_DC_SERVO_READBACK: | ||
105 | case WM8994_RATE_STATUS: | ||
106 | case WM8994_LDO_1: | ||
107 | case WM8994_LDO_2: | ||
108 | case WM8958_DSP2_EXECCONTROL: | ||
109 | case WM8958_MIC_DETECT_3: | ||
110 | case WM8994_DC_SERVO_4E: | ||
111 | return 1; | ||
112 | default: | ||
113 | return 0; | ||
114 | } | ||
115 | } | ||
116 | 84 | ||
117 | static int wm8994_write(struct snd_soc_codec *codec, unsigned int reg, | 85 | if (wm8994->jack_cb != wm8958_default_micdet) |
118 | unsigned int value) | 86 | return; |
119 | { | ||
120 | int ret; | ||
121 | 87 | ||
122 | BUG_ON(reg > WM8994_MAX_REGISTER); | 88 | idle = !wm8994->jack_mic; |
123 | 89 | ||
124 | if (!wm8994_volatile(codec, reg)) { | 90 | sysclk = snd_soc_read(codec, WM8994_CLOCKING_1); |
125 | ret = snd_soc_cache_write(codec, reg, value); | 91 | if (sysclk & WM8994_SYSCLK_SRC) |
126 | if (ret != 0) | 92 | sysclk = wm8994->aifclk[1]; |
127 | dev_err(codec->dev, "Cache write to %x failed: %d\n", | 93 | else |
128 | reg, ret); | 94 | sysclk = wm8994->aifclk[0]; |
95 | |||
96 | if (wm8994->pdata && wm8994->pdata->micd_rates) { | ||
97 | rates = wm8994->pdata->micd_rates; | ||
98 | num_rates = wm8994->pdata->num_micd_rates; | ||
99 | } else if (wm8994->jackdet) { | ||
100 | rates = jackdet_rates; | ||
101 | num_rates = ARRAY_SIZE(jackdet_rates); | ||
102 | } else { | ||
103 | rates = micdet_rates; | ||
104 | num_rates = ARRAY_SIZE(micdet_rates); | ||
129 | } | 105 | } |
130 | 106 | ||
131 | return wm8994_reg_write(codec->control_data, reg, value); | 107 | best = 0; |
132 | } | 108 | for (i = 0; i < num_rates; i++) { |
133 | 109 | if (rates[i].idle != idle) | |
134 | static unsigned int wm8994_read(struct snd_soc_codec *codec, | 110 | continue; |
135 | unsigned int reg) | 111 | if (abs(rates[i].sysclk - sysclk) < |
136 | { | 112 | abs(rates[best].sysclk - sysclk)) |
137 | unsigned int val; | 113 | best = i; |
138 | int ret; | 114 | else if (rates[best].idle != idle) |
139 | 115 | best = i; | |
140 | BUG_ON(reg > WM8994_MAX_REGISTER); | ||
141 | |||
142 | if (!wm8994_volatile(codec, reg) && wm8994_readable(codec, reg) && | ||
143 | reg < codec->driver->reg_cache_size) { | ||
144 | ret = snd_soc_cache_read(codec, reg, &val); | ||
145 | if (ret >= 0) | ||
146 | return val; | ||
147 | else | ||
148 | dev_err(codec->dev, "Cache read from %x failed: %d\n", | ||
149 | reg, ret); | ||
150 | } | 116 | } |
151 | 117 | ||
152 | return wm8994_reg_read(codec->control_data, reg); | 118 | val = rates[best].start << WM8958_MICD_BIAS_STARTTIME_SHIFT |
119 | | rates[best].rate << WM8958_MICD_RATE_SHIFT; | ||
120 | |||
121 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
122 | WM8958_MICD_BIAS_STARTTIME_MASK | | ||
123 | WM8958_MICD_RATE_MASK, val); | ||
153 | } | 124 | } |
154 | 125 | ||
155 | static int configure_aif_clock(struct snd_soc_codec *codec, int aif) | 126 | static int configure_aif_clock(struct snd_soc_codec *codec, int aif) |
@@ -221,8 +192,10 @@ static int configure_clock(struct snd_soc_codec *codec) | |||
221 | */ | 192 | */ |
222 | 193 | ||
223 | /* If they're equal it doesn't matter which is used */ | 194 | /* If they're equal it doesn't matter which is used */ |
224 | if (wm8994->aifclk[0] == wm8994->aifclk[1]) | 195 | if (wm8994->aifclk[0] == wm8994->aifclk[1]) { |
196 | wm8958_micd_set_rate(codec); | ||
225 | return 0; | 197 | return 0; |
198 | } | ||
226 | 199 | ||
227 | if (wm8994->aifclk[0] < wm8994->aifclk[1]) | 200 | if (wm8994->aifclk[0] < wm8994->aifclk[1]) |
228 | new = WM8994_SYSCLK_SRC; | 201 | new = WM8994_SYSCLK_SRC; |
@@ -231,10 +204,10 @@ static int configure_clock(struct snd_soc_codec *codec) | |||
231 | 204 | ||
232 | change = snd_soc_update_bits(codec, WM8994_CLOCKING_1, | 205 | change = snd_soc_update_bits(codec, WM8994_CLOCKING_1, |
233 | WM8994_SYSCLK_SRC, new); | 206 | WM8994_SYSCLK_SRC, new); |
234 | if (!change) | 207 | if (change) |
235 | return 0; | 208 | snd_soc_dapm_sync(&codec->dapm); |
236 | 209 | ||
237 | snd_soc_dapm_sync(&codec->dapm); | 210 | wm8958_micd_set_rate(codec); |
238 | 211 | ||
239 | return 0; | 212 | return 0; |
240 | } | 213 | } |
@@ -708,6 +681,74 @@ SOC_SINGLE_TLV("MIXINL IN1RP Boost Volume", WM8994_INPUT_MIXER_1, 8, 1, 0, | |||
708 | mixin_boost_tlv), | 681 | mixin_boost_tlv), |
709 | }; | 682 | }; |
710 | 683 | ||
684 | /* We run all mode setting through a function to enforce audio mode */ | ||
685 | static void wm1811_jackdet_set_mode(struct snd_soc_codec *codec, u16 mode) | ||
686 | { | ||
687 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
688 | |||
689 | if (wm8994->active_refcount) | ||
690 | mode = WM1811_JACKDET_MODE_AUDIO; | ||
691 | |||
692 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
693 | WM1811_JACKDET_MODE_MASK, mode); | ||
694 | |||
695 | if (mode == WM1811_JACKDET_MODE_MIC) | ||
696 | msleep(2); | ||
697 | } | ||
698 | |||
699 | static void active_reference(struct snd_soc_codec *codec) | ||
700 | { | ||
701 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
702 | |||
703 | mutex_lock(&wm8994->accdet_lock); | ||
704 | |||
705 | wm8994->active_refcount++; | ||
706 | |||
707 | dev_dbg(codec->dev, "Active refcount incremented, now %d\n", | ||
708 | wm8994->active_refcount); | ||
709 | |||
710 | if (wm8994->active_refcount == 1) { | ||
711 | /* If we're using jack detection go into audio mode */ | ||
712 | if (wm8994->jackdet && wm8994->jack_cb) { | ||
713 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
714 | WM1811_JACKDET_MODE_MASK, | ||
715 | WM1811_JACKDET_MODE_AUDIO); | ||
716 | msleep(2); | ||
717 | } | ||
718 | } | ||
719 | |||
720 | mutex_unlock(&wm8994->accdet_lock); | ||
721 | } | ||
722 | |||
723 | static void active_dereference(struct snd_soc_codec *codec) | ||
724 | { | ||
725 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
726 | u16 mode; | ||
727 | |||
728 | mutex_lock(&wm8994->accdet_lock); | ||
729 | |||
730 | wm8994->active_refcount--; | ||
731 | |||
732 | dev_dbg(codec->dev, "Active refcount decremented, now %d\n", | ||
733 | wm8994->active_refcount); | ||
734 | |||
735 | if (wm8994->active_refcount == 0) { | ||
736 | /* Go into appropriate detection only mode */ | ||
737 | if (wm8994->jackdet && wm8994->jack_cb) { | ||
738 | if (wm8994->jack_mic || wm8994->mic_detecting) | ||
739 | mode = WM1811_JACKDET_MODE_MIC; | ||
740 | else | ||
741 | mode = WM1811_JACKDET_MODE_JACK; | ||
742 | |||
743 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
744 | WM1811_JACKDET_MODE_MASK, | ||
745 | mode); | ||
746 | } | ||
747 | } | ||
748 | |||
749 | mutex_unlock(&wm8994->accdet_lock); | ||
750 | } | ||
751 | |||
711 | static int clk_sys_event(struct snd_soc_dapm_widget *w, | 752 | static int clk_sys_event(struct snd_soc_dapm_widget *w, |
712 | struct snd_kcontrol *kcontrol, int event) | 753 | struct snd_kcontrol *kcontrol, int event) |
713 | { | 754 | { |
@@ -1325,15 +1366,15 @@ SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), | |||
1325 | }; | 1366 | }; |
1326 | 1367 | ||
1327 | static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { | 1368 | static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { |
1328 | SND_SOC_DAPM_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, | 1369 | SND_SOC_DAPM_VIRT_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, |
1329 | adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | 1370 | adc_mux_ev, SND_SOC_DAPM_PRE_PMU), |
1330 | SND_SOC_DAPM_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, | 1371 | SND_SOC_DAPM_VIRT_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, |
1331 | adc_mux_ev, SND_SOC_DAPM_PRE_PMU), | 1372 | adc_mux_ev, SND_SOC_DAPM_PRE_PMU), |
1332 | }; | 1373 | }; |
1333 | 1374 | ||
1334 | static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { | 1375 | static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { |
1335 | SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), | 1376 | SND_SOC_DAPM_VIRT_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), |
1336 | SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), | 1377 | SND_SOC_DAPM_VIRT_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), |
1337 | }; | 1378 | }; |
1338 | 1379 | ||
1339 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { | 1380 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { |
@@ -1768,7 +1809,7 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
1768 | unsigned int freq_in, unsigned int freq_out) | 1809 | unsigned int freq_in, unsigned int freq_out) |
1769 | { | 1810 | { |
1770 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1811 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1771 | struct wm8994 *control = codec->control_data; | 1812 | struct wm8994 *control = wm8994->wm8994; |
1772 | int reg_offset, ret; | 1813 | int reg_offset, ret; |
1773 | struct fll_div fll; | 1814 | struct fll_div fll; |
1774 | u16 reg, aif1, aif2; | 1815 | u16 reg, aif1, aif2; |
@@ -1865,6 +1906,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
1865 | if (freq_out) { | 1906 | if (freq_out) { |
1866 | /* Enable VMID if we need it */ | 1907 | /* Enable VMID if we need it */ |
1867 | if (!was_enabled) { | 1908 | if (!was_enabled) { |
1909 | active_reference(codec); | ||
1910 | |||
1868 | switch (control->type) { | 1911 | switch (control->type) { |
1869 | case WM8994: | 1912 | case WM8994: |
1870 | vmid_reference(codec); | 1913 | vmid_reference(codec); |
@@ -1908,6 +1951,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, | |||
1908 | default: | 1951 | default: |
1909 | break; | 1952 | break; |
1910 | } | 1953 | } |
1954 | |||
1955 | active_dereference(codec); | ||
1911 | } | 1956 | } |
1912 | } | 1957 | } |
1913 | 1958 | ||
@@ -2017,20 +2062,33 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, | |||
2017 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, | 2062 | static int wm8994_set_bias_level(struct snd_soc_codec *codec, |
2018 | enum snd_soc_bias_level level) | 2063 | enum snd_soc_bias_level level) |
2019 | { | 2064 | { |
2020 | struct wm8994 *control = codec->control_data; | ||
2021 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2065 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2066 | struct wm8994 *control = wm8994->wm8994; | ||
2022 | 2067 | ||
2023 | switch (level) { | 2068 | switch (level) { |
2024 | case SND_SOC_BIAS_ON: | 2069 | case SND_SOC_BIAS_ON: |
2025 | break; | 2070 | break; |
2026 | 2071 | ||
2027 | case SND_SOC_BIAS_PREPARE: | 2072 | case SND_SOC_BIAS_PREPARE: |
2073 | /* MICBIAS into regulating mode */ | ||
2074 | switch (control->type) { | ||
2075 | case WM8958: | ||
2076 | case WM1811: | ||
2077 | snd_soc_update_bits(codec, WM8958_MICBIAS1, | ||
2078 | WM8958_MICB1_MODE, 0); | ||
2079 | snd_soc_update_bits(codec, WM8958_MICBIAS2, | ||
2080 | WM8958_MICB2_MODE, 0); | ||
2081 | break; | ||
2082 | default: | ||
2083 | break; | ||
2084 | } | ||
2085 | |||
2086 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) | ||
2087 | active_reference(codec); | ||
2028 | break; | 2088 | break; |
2029 | 2089 | ||
2030 | case SND_SOC_BIAS_STANDBY: | 2090 | case SND_SOC_BIAS_STANDBY: |
2031 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 2091 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
2032 | pm_runtime_get_sync(codec->dev); | ||
2033 | |||
2034 | switch (control->type) { | 2092 | switch (control->type) { |
2035 | case WM8994: | 2093 | case WM8994: |
2036 | if (wm8994->revision < 4) { | 2094 | if (wm8994->revision < 4) { |
@@ -2077,25 +2135,40 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, | |||
2077 | WM8994_LINEOUT2_DISCH); | 2135 | WM8994_LINEOUT2_DISCH); |
2078 | } | 2136 | } |
2079 | 2137 | ||
2138 | if (codec->dapm.bias_level == SND_SOC_BIAS_PREPARE) | ||
2139 | active_dereference(codec); | ||
2080 | 2140 | ||
2141 | /* MICBIAS into bypass mode on newer devices */ | ||
2142 | switch (control->type) { | ||
2143 | case WM8958: | ||
2144 | case WM1811: | ||
2145 | snd_soc_update_bits(codec, WM8958_MICBIAS1, | ||
2146 | WM8958_MICB1_MODE, | ||
2147 | WM8958_MICB1_MODE); | ||
2148 | snd_soc_update_bits(codec, WM8958_MICBIAS2, | ||
2149 | WM8958_MICB2_MODE, | ||
2150 | WM8958_MICB2_MODE); | ||
2151 | break; | ||
2152 | default: | ||
2153 | break; | ||
2154 | } | ||
2081 | break; | 2155 | break; |
2082 | 2156 | ||
2083 | case SND_SOC_BIAS_OFF: | 2157 | case SND_SOC_BIAS_OFF: |
2084 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) { | 2158 | if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) |
2085 | wm8994->cur_fw = NULL; | 2159 | wm8994->cur_fw = NULL; |
2086 | |||
2087 | pm_runtime_put(codec->dev); | ||
2088 | } | ||
2089 | break; | 2160 | break; |
2090 | } | 2161 | } |
2091 | codec->dapm.bias_level = level; | 2162 | codec->dapm.bias_level = level; |
2163 | |||
2092 | return 0; | 2164 | return 0; |
2093 | } | 2165 | } |
2094 | 2166 | ||
2095 | static int wm8994_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) | 2167 | static int wm8994_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) |
2096 | { | 2168 | { |
2097 | struct snd_soc_codec *codec = dai->codec; | 2169 | struct snd_soc_codec *codec = dai->codec; |
2098 | struct wm8994 *control = codec->control_data; | 2170 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2171 | struct wm8994 *control = wm8994->wm8994; | ||
2099 | int ms_reg; | 2172 | int ms_reg; |
2100 | int aif1_reg; | 2173 | int aif1_reg; |
2101 | int ms = 0; | 2174 | int ms = 0; |
@@ -2357,6 +2430,11 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, | |||
2357 | bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; | 2430 | bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT; |
2358 | 2431 | ||
2359 | lrclk = bclk_rate / params_rate(params); | 2432 | lrclk = bclk_rate / params_rate(params); |
2433 | if (!lrclk) { | ||
2434 | dev_err(dai->dev, "Unable to generate LRCLK from %dHz BCLK\n", | ||
2435 | bclk_rate); | ||
2436 | return -EINVAL; | ||
2437 | } | ||
2360 | dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n", | 2438 | dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n", |
2361 | lrclk, bclk_rate / lrclk); | 2439 | lrclk, bclk_rate / lrclk); |
2362 | 2440 | ||
@@ -2390,7 +2468,8 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream, | |||
2390 | struct snd_soc_dai *dai) | 2468 | struct snd_soc_dai *dai) |
2391 | { | 2469 | { |
2392 | struct snd_soc_codec *codec = dai->codec; | 2470 | struct snd_soc_codec *codec = dai->codec; |
2393 | struct wm8994 *control = codec->control_data; | 2471 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2472 | struct wm8994 *control = wm8994->wm8994; | ||
2394 | int aif1_reg; | 2473 | int aif1_reg; |
2395 | int aif1 = 0; | 2474 | int aif1 = 0; |
2396 | 2475 | ||
@@ -2531,7 +2610,7 @@ static int wm8994_aif2_probe(struct snd_soc_dai *dai) | |||
2531 | #define WM8994_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 2610 | #define WM8994_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
2532 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 2611 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
2533 | 2612 | ||
2534 | static struct snd_soc_dai_ops wm8994_aif1_dai_ops = { | 2613 | static const struct snd_soc_dai_ops wm8994_aif1_dai_ops = { |
2535 | .set_sysclk = wm8994_set_dai_sysclk, | 2614 | .set_sysclk = wm8994_set_dai_sysclk, |
2536 | .set_fmt = wm8994_set_dai_fmt, | 2615 | .set_fmt = wm8994_set_dai_fmt, |
2537 | .hw_params = wm8994_hw_params, | 2616 | .hw_params = wm8994_hw_params, |
@@ -2541,7 +2620,7 @@ static struct snd_soc_dai_ops wm8994_aif1_dai_ops = { | |||
2541 | .set_tristate = wm8994_set_tristate, | 2620 | .set_tristate = wm8994_set_tristate, |
2542 | }; | 2621 | }; |
2543 | 2622 | ||
2544 | static struct snd_soc_dai_ops wm8994_aif2_dai_ops = { | 2623 | static const struct snd_soc_dai_ops wm8994_aif2_dai_ops = { |
2545 | .set_sysclk = wm8994_set_dai_sysclk, | 2624 | .set_sysclk = wm8994_set_dai_sysclk, |
2546 | .set_fmt = wm8994_set_dai_fmt, | 2625 | .set_fmt = wm8994_set_dai_fmt, |
2547 | .hw_params = wm8994_hw_params, | 2626 | .hw_params = wm8994_hw_params, |
@@ -2551,7 +2630,7 @@ static struct snd_soc_dai_ops wm8994_aif2_dai_ops = { | |||
2551 | .set_tristate = wm8994_set_tristate, | 2630 | .set_tristate = wm8994_set_tristate, |
2552 | }; | 2631 | }; |
2553 | 2632 | ||
2554 | static struct snd_soc_dai_ops wm8994_aif3_dai_ops = { | 2633 | static const struct snd_soc_dai_ops wm8994_aif3_dai_ops = { |
2555 | .hw_params = wm8994_aif3_hw_params, | 2634 | .hw_params = wm8994_aif3_hw_params, |
2556 | .set_tristate = wm8994_set_tristate, | 2635 | .set_tristate = wm8994_set_tristate, |
2557 | }; | 2636 | }; |
@@ -2618,10 +2697,10 @@ static struct snd_soc_dai_driver wm8994_dai[] = { | |||
2618 | }; | 2697 | }; |
2619 | 2698 | ||
2620 | #ifdef CONFIG_PM | 2699 | #ifdef CONFIG_PM |
2621 | static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2700 | static int wm8994_suspend(struct snd_soc_codec *codec) |
2622 | { | 2701 | { |
2623 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2702 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2624 | struct wm8994 *control = codec->control_data; | 2703 | struct wm8994 *control = wm8994->wm8994; |
2625 | int i, ret; | 2704 | int i, ret; |
2626 | 2705 | ||
2627 | switch (control->type) { | 2706 | switch (control->type) { |
@@ -2629,6 +2708,9 @@ static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
2629 | snd_soc_update_bits(codec, WM8994_MICBIAS, WM8994_MICD_ENA, 0); | 2708 | snd_soc_update_bits(codec, WM8994_MICBIAS, WM8994_MICD_ENA, 0); |
2630 | break; | 2709 | break; |
2631 | case WM1811: | 2710 | case WM1811: |
2711 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
2712 | WM1811_JACKDET_MODE_MASK, 0); | ||
2713 | /* Fall through */ | ||
2632 | case WM8958: | 2714 | case WM8958: |
2633 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | 2715 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, |
2634 | WM8958_MICD_ENA, 0); | 2716 | WM8958_MICD_ENA, 0); |
@@ -2652,14 +2734,14 @@ static int wm8994_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
2652 | static int wm8994_resume(struct snd_soc_codec *codec) | 2734 | static int wm8994_resume(struct snd_soc_codec *codec) |
2653 | { | 2735 | { |
2654 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2736 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2655 | struct wm8994 *control = codec->control_data; | 2737 | struct wm8994 *control = wm8994->wm8994; |
2656 | int i, ret; | 2738 | int i, ret; |
2657 | unsigned int val, mask; | 2739 | unsigned int val, mask; |
2658 | 2740 | ||
2659 | if (wm8994->revision < 4) { | 2741 | if (wm8994->revision < 4) { |
2660 | /* force a HW read */ | 2742 | /* force a HW read */ |
2661 | val = wm8994_reg_read(codec->control_data, | 2743 | ret = regmap_read(control->regmap, |
2662 | WM8994_POWER_MANAGEMENT_5); | 2744 | WM8994_POWER_MANAGEMENT_5, &val); |
2663 | 2745 | ||
2664 | /* modify the cache only */ | 2746 | /* modify the cache only */ |
2665 | codec->cache_only = 1; | 2747 | codec->cache_only = 1; |
@@ -2698,6 +2780,13 @@ static int wm8994_resume(struct snd_soc_codec *codec) | |||
2698 | WM8994_MICD_ENA, WM8994_MICD_ENA); | 2780 | WM8994_MICD_ENA, WM8994_MICD_ENA); |
2699 | break; | 2781 | break; |
2700 | case WM1811: | 2782 | case WM1811: |
2783 | if (wm8994->jackdet && wm8994->jack_cb) { | ||
2784 | /* Restart from idle */ | ||
2785 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
2786 | WM1811_JACKDET_MODE_MASK, | ||
2787 | WM1811_JACKDET_MODE_JACK); | ||
2788 | break; | ||
2789 | } | ||
2701 | case WM8958: | 2790 | case WM8958: |
2702 | if (wm8994->jack_cb) | 2791 | if (wm8994->jack_cb) |
2703 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | 2792 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, |
@@ -2810,8 +2899,8 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994) | |||
2810 | }; | 2899 | }; |
2811 | 2900 | ||
2812 | /* We need an array of texts for the enum API */ | 2901 | /* We need an array of texts for the enum API */ |
2813 | wm8994->drc_texts = kmalloc(sizeof(char *) | 2902 | wm8994->drc_texts = devm_kzalloc(wm8994->codec->dev, |
2814 | * pdata->num_drc_cfgs, GFP_KERNEL); | 2903 | sizeof(char *) * pdata->num_drc_cfgs, GFP_KERNEL); |
2815 | if (!wm8994->drc_texts) { | 2904 | if (!wm8994->drc_texts) { |
2816 | dev_err(wm8994->codec->dev, | 2905 | dev_err(wm8994->codec->dev, |
2817 | "Failed to allocate %d DRC config texts\n", | 2906 | "Failed to allocate %d DRC config texts\n", |
@@ -2874,7 +2963,7 @@ int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
2874 | { | 2963 | { |
2875 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2964 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2876 | struct wm8994_micdet *micdet; | 2965 | struct wm8994_micdet *micdet; |
2877 | struct wm8994 *control = codec->control_data; | 2966 | struct wm8994 *control = wm8994->wm8994; |
2878 | int reg; | 2967 | int reg; |
2879 | 2968 | ||
2880 | if (control->type != WM8994) | 2969 | if (control->type != WM8994) |
@@ -2957,21 +3046,136 @@ static void wm8958_default_micdet(u16 status, void *data) | |||
2957 | { | 3046 | { |
2958 | struct snd_soc_codec *codec = data; | 3047 | struct snd_soc_codec *codec = data; |
2959 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 3048 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2960 | int report = 0; | 3049 | int report; |
3050 | |||
3051 | dev_dbg(codec->dev, "MICDET %x\n", status); | ||
3052 | |||
3053 | /* Either nothing present or just starting detection */ | ||
3054 | if (!(status & WM8958_MICD_STS)) { | ||
3055 | if (!wm8994->jackdet) { | ||
3056 | /* If nothing present then clear our statuses */ | ||
3057 | dev_dbg(codec->dev, "Detected open circuit\n"); | ||
3058 | wm8994->jack_mic = false; | ||
3059 | wm8994->mic_detecting = true; | ||
3060 | |||
3061 | wm8958_micd_set_rate(codec); | ||
3062 | |||
3063 | snd_soc_jack_report(wm8994->micdet[0].jack, 0, | ||
3064 | wm8994->btn_mask | | ||
3065 | SND_JACK_HEADSET); | ||
3066 | } | ||
3067 | return; | ||
3068 | } | ||
3069 | |||
3070 | /* If the measurement is showing a high impedence we've got a | ||
3071 | * microphone. | ||
3072 | */ | ||
3073 | if (wm8994->mic_detecting && (status & 0x600)) { | ||
3074 | dev_dbg(codec->dev, "Detected microphone\n"); | ||
3075 | |||
3076 | wm8994->mic_detecting = false; | ||
3077 | wm8994->jack_mic = true; | ||
3078 | |||
3079 | wm8958_micd_set_rate(codec); | ||
3080 | |||
3081 | snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADSET, | ||
3082 | SND_JACK_HEADSET); | ||
3083 | } | ||
3084 | |||
3085 | |||
3086 | if (wm8994->mic_detecting && status & 0x4) { | ||
3087 | dev_dbg(codec->dev, "Detected headphone\n"); | ||
3088 | wm8994->mic_detecting = false; | ||
3089 | |||
3090 | wm8958_micd_set_rate(codec); | ||
3091 | |||
3092 | snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADPHONE, | ||
3093 | SND_JACK_HEADSET); | ||
3094 | |||
3095 | /* If we have jackdet that will detect removal */ | ||
3096 | if (wm8994->jackdet) { | ||
3097 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
3098 | WM8958_MICD_ENA, 0); | ||
2961 | 3099 | ||
2962 | /* If nothing present then clear our statuses */ | 3100 | wm1811_jackdet_set_mode(codec, |
2963 | if (!(status & WM8958_MICD_STS)) | 3101 | WM1811_JACKDET_MODE_JACK); |
2964 | goto done; | 3102 | } |
3103 | } | ||
3104 | |||
3105 | /* Report short circuit as a button */ | ||
3106 | if (wm8994->jack_mic) { | ||
3107 | report = 0; | ||
3108 | if (status & 0x4) | ||
3109 | report |= SND_JACK_BTN_0; | ||
3110 | |||
3111 | if (status & 0x8) | ||
3112 | report |= SND_JACK_BTN_1; | ||
2965 | 3113 | ||
2966 | report = SND_JACK_MICROPHONE; | 3114 | if (status & 0x10) |
3115 | report |= SND_JACK_BTN_2; | ||
2967 | 3116 | ||
2968 | /* Everything else is buttons; just assign slots */ | 3117 | if (status & 0x20) |
2969 | if (status & 0x1c) | 3118 | report |= SND_JACK_BTN_3; |
2970 | report |= SND_JACK_BTN_0; | ||
2971 | 3119 | ||
2972 | done: | 3120 | if (status & 0x40) |
2973 | snd_soc_jack_report(wm8994->micdet[0].jack, report, | 3121 | report |= SND_JACK_BTN_4; |
2974 | SND_JACK_BTN_0 | SND_JACK_MICROPHONE); | 3122 | |
3123 | if (status & 0x80) | ||
3124 | report |= SND_JACK_BTN_5; | ||
3125 | |||
3126 | snd_soc_jack_report(wm8994->micdet[0].jack, report, | ||
3127 | wm8994->btn_mask); | ||
3128 | } | ||
3129 | } | ||
3130 | |||
3131 | static irqreturn_t wm1811_jackdet_irq(int irq, void *data) | ||
3132 | { | ||
3133 | struct wm8994_priv *wm8994 = data; | ||
3134 | struct snd_soc_codec *codec = wm8994->codec; | ||
3135 | int reg; | ||
3136 | |||
3137 | mutex_lock(&wm8994->accdet_lock); | ||
3138 | |||
3139 | reg = snd_soc_read(codec, WM1811_JACKDET_CTRL); | ||
3140 | if (reg < 0) { | ||
3141 | dev_err(codec->dev, "Failed to read jack status: %d\n", reg); | ||
3142 | mutex_unlock(&wm8994->accdet_lock); | ||
3143 | return IRQ_NONE; | ||
3144 | } | ||
3145 | |||
3146 | dev_dbg(codec->dev, "JACKDET %x\n", reg); | ||
3147 | |||
3148 | if (reg & WM1811_JACKDET_LVL) { | ||
3149 | dev_dbg(codec->dev, "Jack detected\n"); | ||
3150 | |||
3151 | snd_soc_jack_report(wm8994->micdet[0].jack, | ||
3152 | SND_JACK_MECHANICAL, SND_JACK_MECHANICAL); | ||
3153 | |||
3154 | /* | ||
3155 | * Start off measument of microphone impedence to find | ||
3156 | * out what's actually there. | ||
3157 | */ | ||
3158 | wm8994->mic_detecting = true; | ||
3159 | wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_MIC); | ||
3160 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
3161 | WM8958_MICD_ENA, WM8958_MICD_ENA); | ||
3162 | } else { | ||
3163 | dev_dbg(codec->dev, "Jack not detected\n"); | ||
3164 | |||
3165 | snd_soc_jack_report(wm8994->micdet[0].jack, 0, | ||
3166 | SND_JACK_MECHANICAL | SND_JACK_HEADSET | | ||
3167 | wm8994->btn_mask); | ||
3168 | |||
3169 | wm8994->mic_detecting = false; | ||
3170 | wm8994->jack_mic = false; | ||
3171 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
3172 | WM8958_MICD_ENA, 0); | ||
3173 | wm1811_jackdet_set_mode(codec, WM1811_JACKDET_MODE_JACK); | ||
3174 | } | ||
3175 | |||
3176 | mutex_unlock(&wm8994->accdet_lock); | ||
3177 | |||
3178 | return IRQ_HANDLED; | ||
2975 | } | 3179 | } |
2976 | 3180 | ||
2977 | /** | 3181 | /** |
@@ -2994,7 +3198,8 @@ int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
2994 | wm8958_micdet_cb cb, void *cb_data) | 3198 | wm8958_micdet_cb cb, void *cb_data) |
2995 | { | 3199 | { |
2996 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 3200 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2997 | struct wm8994 *control = codec->control_data; | 3201 | struct wm8994 *control = wm8994->wm8994; |
3202 | u16 micd_lvl_sel; | ||
2998 | 3203 | ||
2999 | switch (control->type) { | 3204 | switch (control->type) { |
3000 | case WM1811: | 3205 | case WM1811: |
@@ -3011,15 +3216,50 @@ int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
3011 | cb_data = codec; | 3216 | cb_data = codec; |
3012 | } | 3217 | } |
3013 | 3218 | ||
3219 | snd_soc_dapm_force_enable_pin(&codec->dapm, "CLK_SYS"); | ||
3220 | |||
3014 | wm8994->micdet[0].jack = jack; | 3221 | wm8994->micdet[0].jack = jack; |
3015 | wm8994->jack_cb = cb; | 3222 | wm8994->jack_cb = cb; |
3016 | wm8994->jack_cb_data = cb_data; | 3223 | wm8994->jack_cb_data = cb_data; |
3017 | 3224 | ||
3018 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | 3225 | wm8994->mic_detecting = true; |
3019 | WM8958_MICD_ENA, WM8958_MICD_ENA); | 3226 | wm8994->jack_mic = false; |
3227 | |||
3228 | wm8958_micd_set_rate(codec); | ||
3229 | |||
3230 | /* Detect microphones and short circuits by default */ | ||
3231 | if (wm8994->pdata->micd_lvl_sel) | ||
3232 | micd_lvl_sel = wm8994->pdata->micd_lvl_sel; | ||
3233 | else | ||
3234 | micd_lvl_sel = 0x41; | ||
3235 | |||
3236 | wm8994->btn_mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | | ||
3237 | SND_JACK_BTN_2 | SND_JACK_BTN_3 | | ||
3238 | SND_JACK_BTN_4 | SND_JACK_BTN_5; | ||
3239 | |||
3240 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_2, | ||
3241 | WM8958_MICD_LVL_SEL_MASK, micd_lvl_sel); | ||
3242 | |||
3243 | WARN_ON(codec->dapm.bias_level > SND_SOC_BIAS_STANDBY); | ||
3244 | |||
3245 | /* | ||
3246 | * If we can use jack detection start off with that, | ||
3247 | * otherwise jump straight to microphone detection. | ||
3248 | */ | ||
3249 | if (wm8994->jackdet) { | ||
3250 | snd_soc_update_bits(codec, WM8994_LDO_1, | ||
3251 | WM8994_LDO1_DISCH, 0); | ||
3252 | wm1811_jackdet_set_mode(codec, | ||
3253 | WM1811_JACKDET_MODE_JACK); | ||
3254 | } else { | ||
3255 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | ||
3256 | WM8958_MICD_ENA, WM8958_MICD_ENA); | ||
3257 | } | ||
3258 | |||
3020 | } else { | 3259 | } else { |
3021 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, | 3260 | snd_soc_update_bits(codec, WM8958_MIC_DETECT_1, |
3022 | WM8958_MICD_ENA, 0); | 3261 | WM8958_MICD_ENA, 0); |
3262 | snd_soc_dapm_disable_pin(&codec->dapm, "CLK_SYS"); | ||
3023 | } | 3263 | } |
3024 | 3264 | ||
3025 | return 0; | 3265 | return 0; |
@@ -3032,6 +3272,18 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3032 | struct snd_soc_codec *codec = wm8994->codec; | 3272 | struct snd_soc_codec *codec = wm8994->codec; |
3033 | int reg, count; | 3273 | int reg, count; |
3034 | 3274 | ||
3275 | mutex_lock(&wm8994->accdet_lock); | ||
3276 | |||
3277 | /* | ||
3278 | * Jack detection may have detected a removal simulataneously | ||
3279 | * with an update of the MICDET status; if so it will have | ||
3280 | * stopped detection and we can ignore this interrupt. | ||
3281 | */ | ||
3282 | if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) { | ||
3283 | mutex_unlock(&wm8994->accdet_lock); | ||
3284 | return IRQ_HANDLED; | ||
3285 | } | ||
3286 | |||
3035 | /* We may occasionally read a detection without an impedence | 3287 | /* We may occasionally read a detection without an impedence |
3036 | * range being provided - if that happens loop again. | 3288 | * range being provided - if that happens loop again. |
3037 | */ | 3289 | */ |
@@ -3039,6 +3291,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3039 | do { | 3291 | do { |
3040 | reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); | 3292 | reg = snd_soc_read(codec, WM8958_MIC_DETECT_3); |
3041 | if (reg < 0) { | 3293 | if (reg < 0) { |
3294 | mutex_unlock(&wm8994->accdet_lock); | ||
3042 | dev_err(codec->dev, | 3295 | dev_err(codec->dev, |
3043 | "Failed to read mic detect status: %d\n", | 3296 | "Failed to read mic detect status: %d\n", |
3044 | reg); | 3297 | reg); |
@@ -3069,6 +3322,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3069 | dev_warn(codec->dev, "Accessory detection with no callback\n"); | 3322 | dev_warn(codec->dev, "Accessory detection with no callback\n"); |
3070 | 3323 | ||
3071 | out: | 3324 | out: |
3325 | mutex_unlock(&wm8994->accdet_lock); | ||
3326 | |||
3072 | return IRQ_HANDLED; | 3327 | return IRQ_HANDLED; |
3073 | } | 3328 | } |
3074 | 3329 | ||
@@ -3101,22 +3356,28 @@ static irqreturn_t wm8994_temp_shut(int irq, void *data) | |||
3101 | 3356 | ||
3102 | static int wm8994_codec_probe(struct snd_soc_codec *codec) | 3357 | static int wm8994_codec_probe(struct snd_soc_codec *codec) |
3103 | { | 3358 | { |
3104 | struct wm8994 *control; | 3359 | struct wm8994 *control = dev_get_drvdata(codec->dev->parent); |
3105 | struct wm8994_priv *wm8994; | 3360 | struct wm8994_priv *wm8994; |
3106 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 3361 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
3362 | unsigned int reg; | ||
3107 | int ret, i; | 3363 | int ret, i; |
3108 | 3364 | ||
3109 | codec->control_data = dev_get_drvdata(codec->dev->parent); | 3365 | codec->control_data = control->regmap; |
3110 | control = codec->control_data; | ||
3111 | 3366 | ||
3112 | wm8994 = kzalloc(sizeof(struct wm8994_priv), GFP_KERNEL); | 3367 | wm8994 = devm_kzalloc(codec->dev, sizeof(struct wm8994_priv), |
3368 | GFP_KERNEL); | ||
3113 | if (wm8994 == NULL) | 3369 | if (wm8994 == NULL) |
3114 | return -ENOMEM; | 3370 | return -ENOMEM; |
3115 | snd_soc_codec_set_drvdata(codec, wm8994); | 3371 | snd_soc_codec_set_drvdata(codec, wm8994); |
3116 | 3372 | ||
3373 | snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); | ||
3374 | |||
3375 | wm8994->wm8994 = dev_get_drvdata(codec->dev->parent); | ||
3117 | wm8994->pdata = dev_get_platdata(codec->dev->parent); | 3376 | wm8994->pdata = dev_get_platdata(codec->dev->parent); |
3118 | wm8994->codec = codec; | 3377 | wm8994->codec = codec; |
3119 | 3378 | ||
3379 | mutex_init(&wm8994->accdet_lock); | ||
3380 | |||
3120 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) | 3381 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) |
3121 | init_completion(&wm8994->fll_locked[i]); | 3382 | init_completion(&wm8994->fll_locked[i]); |
3122 | 3383 | ||
@@ -3129,25 +3390,6 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3129 | pm_runtime_enable(codec->dev); | 3390 | pm_runtime_enable(codec->dev); |
3130 | pm_runtime_resume(codec->dev); | 3391 | pm_runtime_resume(codec->dev); |
3131 | 3392 | ||
3132 | /* Read our current status back from the chip - we don't want to | ||
3133 | * reset as this may interfere with the GPIO or LDO operation. */ | ||
3134 | for (i = 0; i < WM8994_CACHE_SIZE; i++) { | ||
3135 | if (!wm8994_readable(codec, i) || wm8994_volatile(codec, i)) | ||
3136 | continue; | ||
3137 | |||
3138 | ret = wm8994_reg_read(codec->control_data, i); | ||
3139 | if (ret <= 0) | ||
3140 | continue; | ||
3141 | |||
3142 | ret = snd_soc_cache_write(codec, i, ret); | ||
3143 | if (ret != 0) { | ||
3144 | dev_err(codec->dev, | ||
3145 | "Failed to initialise cache for 0x%x: %d\n", | ||
3146 | i, ret); | ||
3147 | goto err; | ||
3148 | } | ||
3149 | } | ||
3150 | |||
3151 | /* Set revision-specific configuration */ | 3393 | /* Set revision-specific configuration */ |
3152 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); | 3394 | wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION); |
3153 | switch (control->type) { | 3395 | switch (control->type) { |
@@ -3178,6 +3420,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3178 | switch (wm8994->revision) { | 3420 | switch (wm8994->revision) { |
3179 | case 0: | 3421 | case 0: |
3180 | case 1: | 3422 | case 1: |
3423 | case 2: | ||
3424 | case 3: | ||
3181 | wm8994->hubs.dcs_codes_l = -9; | 3425 | wm8994->hubs.dcs_codes_l = -9; |
3182 | wm8994->hubs.dcs_codes_r = -5; | 3426 | wm8994->hubs.dcs_codes_r = -5; |
3183 | break; | 3427 | break; |
@@ -3193,14 +3437,14 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3193 | break; | 3437 | break; |
3194 | } | 3438 | } |
3195 | 3439 | ||
3196 | wm8994_request_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, | 3440 | wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, |
3197 | wm8994_fifo_error, "FIFO error", codec); | 3441 | wm8994_fifo_error, "FIFO error", codec); |
3198 | wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_WARN, | 3442 | wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, |
3199 | wm8994_temp_warn, "Thermal warning", codec); | 3443 | wm8994_temp_warn, "Thermal warning", codec); |
3200 | wm8994_request_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT, | 3444 | wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, |
3201 | wm8994_temp_shut, "Thermal shutdown", codec); | 3445 | wm8994_temp_shut, "Thermal shutdown", codec); |
3202 | 3446 | ||
3203 | ret = wm8994_request_irq(codec->control_data, WM8994_IRQ_DCS_DONE, | 3447 | ret = wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, |
3204 | wm_hubs_dcs_done, "DC servo done", | 3448 | wm_hubs_dcs_done, "DC servo done", |
3205 | &wm8994->hubs); | 3449 | &wm8994->hubs); |
3206 | if (ret == 0) | 3450 | if (ret == 0) |
@@ -3220,7 +3464,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3220 | ret); | 3464 | ret); |
3221 | } | 3465 | } |
3222 | 3466 | ||
3223 | ret = wm8994_request_irq(codec->control_data, | 3467 | ret = wm8994_request_irq(wm8994->wm8994, |
3224 | WM8994_IRQ_MIC1_SHRT, | 3468 | WM8994_IRQ_MIC1_SHRT, |
3225 | wm8994_mic_irq, "Mic 1 short", | 3469 | wm8994_mic_irq, "Mic 1 short", |
3226 | wm8994); | 3470 | wm8994); |
@@ -3229,7 +3473,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3229 | "Failed to request Mic1 short IRQ: %d\n", | 3473 | "Failed to request Mic1 short IRQ: %d\n", |
3230 | ret); | 3474 | ret); |
3231 | 3475 | ||
3232 | ret = wm8994_request_irq(codec->control_data, | 3476 | ret = wm8994_request_irq(wm8994->wm8994, |
3233 | WM8994_IRQ_MIC2_DET, | 3477 | WM8994_IRQ_MIC2_DET, |
3234 | wm8994_mic_irq, "Mic 2 detect", | 3478 | wm8994_mic_irq, "Mic 2 detect", |
3235 | wm8994); | 3479 | wm8994); |
@@ -3238,7 +3482,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3238 | "Failed to request Mic2 detect IRQ: %d\n", | 3482 | "Failed to request Mic2 detect IRQ: %d\n", |
3239 | ret); | 3483 | ret); |
3240 | 3484 | ||
3241 | ret = wm8994_request_irq(codec->control_data, | 3485 | ret = wm8994_request_irq(wm8994->wm8994, |
3242 | WM8994_IRQ_MIC2_SHRT, | 3486 | WM8994_IRQ_MIC2_SHRT, |
3243 | wm8994_mic_irq, "Mic 2 short", | 3487 | wm8994_mic_irq, "Mic 2 short", |
3244 | wm8994); | 3488 | wm8994); |
@@ -3263,9 +3507,24 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3263 | } | 3507 | } |
3264 | } | 3508 | } |
3265 | 3509 | ||
3510 | switch (control->type) { | ||
3511 | case WM1811: | ||
3512 | if (wm8994->revision > 1) { | ||
3513 | ret = wm8994_request_irq(wm8994->wm8994, | ||
3514 | WM8994_IRQ_GPIO(6), | ||
3515 | wm1811_jackdet_irq, "JACKDET", | ||
3516 | wm8994); | ||
3517 | if (ret == 0) | ||
3518 | wm8994->jackdet = true; | ||
3519 | } | ||
3520 | break; | ||
3521 | default: | ||
3522 | break; | ||
3523 | } | ||
3524 | |||
3266 | wm8994->fll_locked_irq = true; | 3525 | wm8994->fll_locked_irq = true; |
3267 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) { | 3526 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) { |
3268 | ret = wm8994_request_irq(codec->control_data, | 3527 | ret = wm8994_request_irq(wm8994->wm8994, |
3269 | WM8994_IRQ_FLL1_LOCK + i, | 3528 | WM8994_IRQ_FLL1_LOCK + i, |
3270 | wm8994_fll_locked_irq, "FLL lock", | 3529 | wm8994_fll_locked_irq, "FLL lock", |
3271 | &wm8994->fll_locked[i]); | 3530 | &wm8994->fll_locked[i]); |
@@ -3277,24 +3536,24 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3277 | * configured on init - if a system wants to do this dynamically | 3536 | * configured on init - if a system wants to do this dynamically |
3278 | * at runtime we can deal with that then. | 3537 | * at runtime we can deal with that then. |
3279 | */ | 3538 | */ |
3280 | ret = wm8994_reg_read(codec->control_data, WM8994_GPIO_1); | 3539 | ret = regmap_read(control->regmap, WM8994_GPIO_1, ®); |
3281 | if (ret < 0) { | 3540 | if (ret < 0) { |
3282 | dev_err(codec->dev, "Failed to read GPIO1 state: %d\n", ret); | 3541 | dev_err(codec->dev, "Failed to read GPIO1 state: %d\n", ret); |
3283 | goto err_irq; | 3542 | goto err_irq; |
3284 | } | 3543 | } |
3285 | if ((ret & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) { | 3544 | if ((reg & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) { |
3286 | wm8994->lrclk_shared[0] = 1; | 3545 | wm8994->lrclk_shared[0] = 1; |
3287 | wm8994_dai[0].symmetric_rates = 1; | 3546 | wm8994_dai[0].symmetric_rates = 1; |
3288 | } else { | 3547 | } else { |
3289 | wm8994->lrclk_shared[0] = 0; | 3548 | wm8994->lrclk_shared[0] = 0; |
3290 | } | 3549 | } |
3291 | 3550 | ||
3292 | ret = wm8994_reg_read(codec->control_data, WM8994_GPIO_6); | 3551 | ret = regmap_read(control->regmap, WM8994_GPIO_6, ®); |
3293 | if (ret < 0) { | 3552 | if (ret < 0) { |
3294 | dev_err(codec->dev, "Failed to read GPIO6 state: %d\n", ret); | 3553 | dev_err(codec->dev, "Failed to read GPIO6 state: %d\n", ret); |
3295 | goto err_irq; | 3554 | goto err_irq; |
3296 | } | 3555 | } |
3297 | if ((ret & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) { | 3556 | if ((reg & WM8994_GPN_FN_MASK) != WM8994_GP_FN_PIN_SPECIFIC) { |
3298 | wm8994->lrclk_shared[1] = 1; | 3557 | wm8994->lrclk_shared[1] = 1; |
3299 | wm8994_dai[1].symmetric_rates = 1; | 3558 | wm8994_dai[1].symmetric_rates = 1; |
3300 | } else { | 3559 | } else { |
@@ -3361,6 +3620,19 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3361 | break; | 3620 | break; |
3362 | } | 3621 | } |
3363 | 3622 | ||
3623 | /* Put MICBIAS into bypass mode by default on newer devices */ | ||
3624 | switch (control->type) { | ||
3625 | case WM8958: | ||
3626 | case WM1811: | ||
3627 | snd_soc_update_bits(codec, WM8958_MICBIAS1, | ||
3628 | WM8958_MICB1_MODE, WM8958_MICB1_MODE); | ||
3629 | snd_soc_update_bits(codec, WM8958_MICBIAS2, | ||
3630 | WM8958_MICB2_MODE, WM8958_MICB2_MODE); | ||
3631 | break; | ||
3632 | default: | ||
3633 | break; | ||
3634 | } | ||
3635 | |||
3364 | wm8994_update_class_w(codec); | 3636 | wm8994_update_class_w(codec); |
3365 | 3637 | ||
3366 | wm8994_handle_pdata(wm8994); | 3638 | wm8994_handle_pdata(wm8994); |
@@ -3472,28 +3744,29 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3472 | return 0; | 3744 | return 0; |
3473 | 3745 | ||
3474 | err_irq: | 3746 | err_irq: |
3475 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_SHRT, wm8994); | 3747 | if (wm8994->jackdet) |
3476 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); | 3748 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); |
3477 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); | 3749 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_SHRT, wm8994); |
3750 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, wm8994); | ||
3751 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, wm8994); | ||
3478 | if (wm8994->micdet_irq) | 3752 | if (wm8994->micdet_irq) |
3479 | free_irq(wm8994->micdet_irq, wm8994); | 3753 | free_irq(wm8994->micdet_irq, wm8994); |
3480 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) | 3754 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) |
3481 | wm8994_free_irq(codec->control_data, WM8994_IRQ_FLL1_LOCK + i, | 3755 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, |
3482 | &wm8994->fll_locked[i]); | 3756 | &wm8994->fll_locked[i]); |
3483 | wm8994_free_irq(codec->control_data, WM8994_IRQ_DCS_DONE, | 3757 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, |
3484 | &wm8994->hubs); | 3758 | &wm8994->hubs); |
3485 | wm8994_free_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, codec); | 3759 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, codec); |
3486 | wm8994_free_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT, codec); | 3760 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, codec); |
3487 | wm8994_free_irq(codec->control_data, WM8994_IRQ_TEMP_WARN, codec); | 3761 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, codec); |
3488 | err: | 3762 | |
3489 | kfree(wm8994); | ||
3490 | return ret; | 3763 | return ret; |
3491 | } | 3764 | } |
3492 | 3765 | ||
3493 | static int wm8994_codec_remove(struct snd_soc_codec *codec) | 3766 | static int wm8994_codec_remove(struct snd_soc_codec *codec) |
3494 | { | 3767 | { |
3495 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 3768 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
3496 | struct wm8994 *control = codec->control_data; | 3769 | struct wm8994 *control = wm8994->wm8994; |
3497 | int i; | 3770 | int i; |
3498 | 3771 | ||
3499 | wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); | 3772 | wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); |
@@ -3501,24 +3774,27 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
3501 | pm_runtime_disable(codec->dev); | 3774 | pm_runtime_disable(codec->dev); |
3502 | 3775 | ||
3503 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) | 3776 | for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) |
3504 | wm8994_free_irq(codec->control_data, WM8994_IRQ_FLL1_LOCK + i, | 3777 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, |
3505 | &wm8994->fll_locked[i]); | 3778 | &wm8994->fll_locked[i]); |
3506 | 3779 | ||
3507 | wm8994_free_irq(codec->control_data, WM8994_IRQ_DCS_DONE, | 3780 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, |
3508 | &wm8994->hubs); | 3781 | &wm8994->hubs); |
3509 | wm8994_free_irq(codec->control_data, WM8994_IRQ_FIFOS_ERR, codec); | 3782 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, codec); |
3510 | wm8994_free_irq(codec->control_data, WM8994_IRQ_TEMP_SHUT, codec); | 3783 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, codec); |
3511 | wm8994_free_irq(codec->control_data, WM8994_IRQ_TEMP_WARN, codec); | 3784 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, codec); |
3785 | |||
3786 | if (wm8994->jackdet) | ||
3787 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); | ||
3512 | 3788 | ||
3513 | switch (control->type) { | 3789 | switch (control->type) { |
3514 | case WM8994: | 3790 | case WM8994: |
3515 | if (wm8994->micdet_irq) | 3791 | if (wm8994->micdet_irq) |
3516 | free_irq(wm8994->micdet_irq, wm8994); | 3792 | free_irq(wm8994->micdet_irq, wm8994); |
3517 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, | 3793 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, |
3518 | wm8994); | 3794 | wm8994); |
3519 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, | 3795 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, |
3520 | wm8994); | 3796 | wm8994); |
3521 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, | 3797 | wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET, |
3522 | wm8994); | 3798 | wm8994); |
3523 | break; | 3799 | break; |
3524 | 3800 | ||
@@ -3535,27 +3811,24 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
3535 | if (wm8994->enh_eq) | 3811 | if (wm8994->enh_eq) |
3536 | release_firmware(wm8994->enh_eq); | 3812 | release_firmware(wm8994->enh_eq); |
3537 | kfree(wm8994->retune_mobile_texts); | 3813 | kfree(wm8994->retune_mobile_texts); |
3538 | kfree(wm8994->drc_texts); | ||
3539 | kfree(wm8994); | ||
3540 | 3814 | ||
3541 | return 0; | 3815 | return 0; |
3542 | } | 3816 | } |
3543 | 3817 | ||
3818 | static int wm8994_soc_volatile(struct snd_soc_codec *codec, | ||
3819 | unsigned int reg) | ||
3820 | { | ||
3821 | return true; | ||
3822 | } | ||
3823 | |||
3544 | static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { | 3824 | static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { |
3545 | .probe = wm8994_codec_probe, | 3825 | .probe = wm8994_codec_probe, |
3546 | .remove = wm8994_codec_remove, | 3826 | .remove = wm8994_codec_remove, |
3547 | .suspend = wm8994_suspend, | 3827 | .suspend = wm8994_suspend, |
3548 | .resume = wm8994_resume, | 3828 | .resume = wm8994_resume, |
3549 | .read = wm8994_read, | ||
3550 | .write = wm8994_write, | ||
3551 | .readable_register = wm8994_readable, | ||
3552 | .volatile_register = wm8994_volatile, | ||
3553 | .set_bias_level = wm8994_set_bias_level, | 3829 | .set_bias_level = wm8994_set_bias_level, |
3554 | 3830 | .reg_cache_size = WM8994_MAX_REGISTER, | |
3555 | .reg_cache_size = WM8994_CACHE_SIZE, | 3831 | .volatile_register = wm8994_soc_volatile, |
3556 | .reg_cache_default = wm8994_reg_defaults, | ||
3557 | .reg_word_size = 2, | ||
3558 | .compress_type = SND_SOC_RBTREE_COMPRESSION, | ||
3559 | }; | 3832 | }; |
3560 | 3833 | ||
3561 | static int __devinit wm8994_probe(struct platform_device *pdev) | 3834 | static int __devinit wm8994_probe(struct platform_device *pdev) |
@@ -3579,18 +3852,7 @@ static struct platform_driver wm8994_codec_driver = { | |||
3579 | .remove = __devexit_p(wm8994_remove), | 3852 | .remove = __devexit_p(wm8994_remove), |
3580 | }; | 3853 | }; |
3581 | 3854 | ||
3582 | static __init int wm8994_init(void) | 3855 | module_platform_driver(wm8994_codec_driver); |
3583 | { | ||
3584 | return platform_driver_register(&wm8994_codec_driver); | ||
3585 | } | ||
3586 | module_init(wm8994_init); | ||
3587 | |||
3588 | static __exit void wm8994_exit(void) | ||
3589 | { | ||
3590 | platform_driver_unregister(&wm8994_codec_driver); | ||
3591 | } | ||
3592 | module_exit(wm8994_exit); | ||
3593 | |||
3594 | 3856 | ||
3595 | MODULE_DESCRIPTION("ASoC WM8994 driver"); | 3857 | MODULE_DESCRIPTION("ASoC WM8994 driver"); |
3596 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | 3858 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
diff --git a/sound/soc/codecs/wm8994.h b/sound/soc/codecs/wm8994.h index f4f1355efc8..c3a42474ab1 100644 --- a/sound/soc/codecs/wm8994.h +++ b/sound/soc/codecs/wm8994.h | |||
@@ -39,16 +39,6 @@ int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
39 | int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | 39 | int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, |
40 | wm8958_micdet_cb cb, void *cb_data); | 40 | wm8958_micdet_cb cb, void *cb_data); |
41 | 41 | ||
42 | #define WM8994_CACHE_SIZE 1570 | ||
43 | |||
44 | struct wm8994_access_mask { | ||
45 | unsigned short readable; /* Mask of readable bits */ | ||
46 | unsigned short writable; /* Mask of writable bits */ | ||
47 | }; | ||
48 | |||
49 | extern const struct wm8994_access_mask wm8994_access_masks[WM8994_CACHE_SIZE]; | ||
50 | extern const u16 wm8994_reg_defaults[WM8994_CACHE_SIZE]; | ||
51 | |||
52 | int wm8958_aif_ev(struct snd_soc_dapm_widget *w, | 42 | int wm8958_aif_ev(struct snd_soc_dapm_widget *w, |
53 | struct snd_kcontrol *kcontrol, int event); | 43 | struct snd_kcontrol *kcontrol, int event); |
54 | 44 | ||
@@ -70,10 +60,11 @@ struct wm8994_fll_config { | |||
70 | #define WM8994_NUM_DRC 3 | 60 | #define WM8994_NUM_DRC 3 |
71 | #define WM8994_NUM_EQ 3 | 61 | #define WM8994_NUM_EQ 3 |
72 | 62 | ||
63 | struct wm8994; | ||
64 | |||
73 | struct wm8994_priv { | 65 | struct wm8994_priv { |
74 | struct wm_hubs_data hubs; | 66 | struct wm_hubs_data hubs; |
75 | enum snd_soc_control_type control_type; | 67 | struct wm8994 *wm8994; |
76 | void *control_data; | ||
77 | struct snd_soc_codec *codec; | 68 | struct snd_soc_codec *codec; |
78 | int sysclk[2]; | 69 | int sysclk[2]; |
79 | int sysclk_rate[2]; | 70 | int sysclk_rate[2]; |
@@ -84,6 +75,7 @@ struct wm8994_priv { | |||
84 | bool fll_locked_irq; | 75 | bool fll_locked_irq; |
85 | 76 | ||
86 | int vmid_refcount; | 77 | int vmid_refcount; |
78 | int active_refcount; | ||
87 | 79 | ||
88 | int dac_rates[2]; | 80 | int dac_rates[2]; |
89 | int lrclk_shared[2]; | 81 | int lrclk_shared[2]; |
@@ -125,7 +117,12 @@ struct wm8994_priv { | |||
125 | const char **enh_eq_texts; | 117 | const char **enh_eq_texts; |
126 | struct soc_enum enh_eq_enum; | 118 | struct soc_enum enh_eq_enum; |
127 | 119 | ||
120 | struct mutex accdet_lock; | ||
128 | struct wm8994_micdet micdet[2]; | 121 | struct wm8994_micdet micdet[2]; |
122 | bool mic_detecting; | ||
123 | bool jack_mic; | ||
124 | int btn_mask; | ||
125 | bool jackdet; | ||
129 | 126 | ||
130 | wm8958_micdet_cb jack_cb; | 127 | wm8958_micdet_cb jack_cb; |
131 | void *jack_cb_data; | 128 | void *jack_cb_data; |
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 78eeb21e669..c8aada597d7 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/regmap.h> | ||
21 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
22 | #include <linux/regulator/consumer.h> | 23 | #include <linux/regulator/consumer.h> |
23 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
@@ -43,88 +44,331 @@ static const char *wm8995_supply_names[WM8995_NUM_SUPPLIES] = { | |||
43 | "MICVDD" | 44 | "MICVDD" |
44 | }; | 45 | }; |
45 | 46 | ||
46 | static const u16 wm8995_reg_defs[WM8995_MAX_REGISTER + 1] = { | 47 | static struct reg_default wm8995_reg_defaults[] = { |
47 | [0] = 0x8995, [5] = 0x0100, [16] = 0x000b, [17] = 0x000b, | 48 | { 0, 0x8995 }, |
48 | [24] = 0x02c0, [25] = 0x02c0, [26] = 0x02c0, [27] = 0x02c0, | 49 | { 5, 0x0100 }, |
49 | [28] = 0x000f, [32] = 0x0005, [33] = 0x0005, [40] = 0x0003, | 50 | { 16, 0x000b }, |
50 | [41] = 0x0013, [48] = 0x0004, [56] = 0x09f8, [64] = 0x1f25, | 51 | { 17, 0x000b }, |
51 | [69] = 0x0004, [82] = 0xaaaa, [84] = 0x2a2a, [146] = 0x0060, | 52 | { 24, 0x02c0 }, |
52 | [256] = 0x0002, [257] = 0x8004, [520] = 0x0010, [528] = 0x0083, | 53 | { 25, 0x02c0 }, |
53 | [529] = 0x0083, [548] = 0x0c80, [580] = 0x0c80, [768] = 0x4050, | 54 | { 26, 0x02c0 }, |
54 | [769] = 0x4000, [771] = 0x0040, [772] = 0x0040, [773] = 0x0040, | 55 | { 27, 0x02c0 }, |
55 | [774] = 0x0004, [775] = 0x0100, [784] = 0x4050, [785] = 0x4000, | 56 | { 28, 0x000f }, |
56 | [787] = 0x0040, [788] = 0x0040, [789] = 0x0040, [1024] = 0x00c0, | 57 | { 32, 0x0005 }, |
57 | [1025] = 0x00c0, [1026] = 0x00c0, [1027] = 0x00c0, [1028] = 0x00c0, | 58 | { 33, 0x0005 }, |
58 | [1029] = 0x00c0, [1030] = 0x00c0, [1031] = 0x00c0, [1056] = 0x0200, | 59 | { 40, 0x0003 }, |
59 | [1057] = 0x0010, [1058] = 0x0200, [1059] = 0x0010, [1088] = 0x0098, | 60 | { 41, 0x0013 }, |
60 | [1089] = 0x0845, [1104] = 0x0098, [1105] = 0x0845, [1152] = 0x6318, | 61 | { 48, 0x0004 }, |
61 | [1153] = 0x6300, [1154] = 0x0fca, [1155] = 0x0400, [1156] = 0x00d8, | 62 | { 56, 0x09f8 }, |
62 | [1157] = 0x1eb5, [1158] = 0xf145, [1159] = 0x0b75, [1160] = 0x01c5, | 63 | { 64, 0x1f25 }, |
63 | [1161] = 0x1c58, [1162] = 0xf373, [1163] = 0x0a54, [1164] = 0x0558, | 64 | { 69, 0x0004 }, |
64 | [1165] = 0x168e, [1166] = 0xf829, [1167] = 0x07ad, [1168] = 0x1103, | 65 | { 82, 0xaaaa }, |
65 | [1169] = 0x0564, [1170] = 0x0559, [1171] = 0x4000, [1184] = 0x6318, | 66 | { 84, 0x2a2a }, |
66 | [1185] = 0x6300, [1186] = 0x0fca, [1187] = 0x0400, [1188] = 0x00d8, | 67 | { 146, 0x0060 }, |
67 | [1189] = 0x1eb5, [1190] = 0xf145, [1191] = 0x0b75, [1192] = 0x01c5, | 68 | { 256, 0x0002 }, |
68 | [1193] = 0x1c58, [1194] = 0xf373, [1195] = 0x0a54, [1196] = 0x0558, | 69 | { 257, 0x8004 }, |
69 | [1197] = 0x168e, [1198] = 0xf829, [1199] = 0x07ad, [1200] = 0x1103, | 70 | { 520, 0x0010 }, |
70 | [1201] = 0x0564, [1202] = 0x0559, [1203] = 0x4000, [1280] = 0x00c0, | 71 | { 528, 0x0083 }, |
71 | [1281] = 0x00c0, [1282] = 0x00c0, [1283] = 0x00c0, [1312] = 0x0200, | 72 | { 529, 0x0083 }, |
72 | [1313] = 0x0010, [1344] = 0x0098, [1345] = 0x0845, [1408] = 0x6318, | 73 | { 548, 0x0c80 }, |
73 | [1409] = 0x6300, [1410] = 0x0fca, [1411] = 0x0400, [1412] = 0x00d8, | 74 | { 580, 0x0c80 }, |
74 | [1413] = 0x1eb5, [1414] = 0xf145, [1415] = 0x0b75, [1416] = 0x01c5, | 75 | { 768, 0x4050 }, |
75 | [1417] = 0x1c58, [1418] = 0xf373, [1419] = 0x0a54, [1420] = 0x0558, | 76 | { 769, 0x4000 }, |
76 | [1421] = 0x168e, [1422] = 0xf829, [1423] = 0x07ad, [1424] = 0x1103, | 77 | { 771, 0x0040 }, |
77 | [1425] = 0x0564, [1426] = 0x0559, [1427] = 0x4000, [1568] = 0x0002, | 78 | { 772, 0x0040 }, |
78 | [1792] = 0xa100, [1793] = 0xa101, [1794] = 0xa101, [1795] = 0xa101, | 79 | { 773, 0x0040 }, |
79 | [1796] = 0xa101, [1797] = 0xa101, [1798] = 0xa101, [1799] = 0xa101, | 80 | { 774, 0x0004 }, |
80 | [1800] = 0xa101, [1801] = 0xa101, [1802] = 0xa101, [1803] = 0xa101, | 81 | { 775, 0x0100 }, |
81 | [1804] = 0xa101, [1805] = 0xa101, [1825] = 0x0055, [1848] = 0x3fff, | 82 | { 784, 0x4050 }, |
82 | [1849] = 0x1fff, [2049] = 0x0001, [2050] = 0x0069, [2056] = 0x0002, | 83 | { 785, 0x4000 }, |
83 | [2057] = 0x0003, [2058] = 0x0069, [12288] = 0x0001, [12289] = 0x0001, | 84 | { 787, 0x0040 }, |
84 | [12291] = 0x0006, [12292] = 0x0040, [12293] = 0x0001, [12294] = 0x000f, | 85 | { 788, 0x0040 }, |
85 | [12295] = 0x0006, [12296] = 0x0001, [12297] = 0x0003, [12298] = 0x0104, | 86 | { 789, 0x0040 }, |
86 | [12300] = 0x0060, [12301] = 0x0011, [12302] = 0x0401, [12304] = 0x0050, | 87 | { 1024, 0x00c0 }, |
87 | [12305] = 0x0003, [12306] = 0x0100, [12308] = 0x0051, [12309] = 0x0003, | 88 | { 1025, 0x00c0 }, |
88 | [12310] = 0x0104, [12311] = 0x000a, [12312] = 0x0060, [12313] = 0x003b, | 89 | { 1026, 0x00c0 }, |
89 | [12314] = 0x0502, [12315] = 0x0100, [12316] = 0x2fff, [12320] = 0x2fff, | 90 | { 1027, 0x00c0 }, |
90 | [12324] = 0x2fff, [12328] = 0x2fff, [12332] = 0x2fff, [12336] = 0x2fff, | 91 | { 1028, 0x00c0 }, |
91 | [12340] = 0x2fff, [12344] = 0x2fff, [12348] = 0x2fff, [12352] = 0x0001, | 92 | { 1029, 0x00c0 }, |
92 | [12353] = 0x0001, [12355] = 0x0006, [12356] = 0x0040, [12357] = 0x0001, | 93 | { 1030, 0x00c0 }, |
93 | [12358] = 0x000f, [12359] = 0x0006, [12360] = 0x0001, [12361] = 0x0003, | 94 | { 1031, 0x00c0 }, |
94 | [12362] = 0x0104, [12364] = 0x0060, [12365] = 0x0011, [12366] = 0x0401, | 95 | { 1056, 0x0200 }, |
95 | [12368] = 0x0050, [12369] = 0x0003, [12370] = 0x0100, [12372] = 0x0060, | 96 | { 1057, 0x0010 }, |
96 | [12373] = 0x003b, [12374] = 0x0502, [12375] = 0x0100, [12376] = 0x2fff, | 97 | { 1058, 0x0200 }, |
97 | [12380] = 0x2fff, [12384] = 0x2fff, [12388] = 0x2fff, [12392] = 0x2fff, | 98 | { 1059, 0x0010 }, |
98 | [12396] = 0x2fff, [12400] = 0x2fff, [12404] = 0x2fff, [12408] = 0x2fff, | 99 | { 1088, 0x0098 }, |
99 | [12412] = 0x2fff, [12416] = 0x0001, [12417] = 0x0001, [12419] = 0x0006, | 100 | { 1089, 0x0845 }, |
100 | [12420] = 0x0040, [12421] = 0x0001, [12422] = 0x000f, [12423] = 0x0006, | 101 | { 1104, 0x0098 }, |
101 | [12424] = 0x0001, [12425] = 0x0003, [12426] = 0x0106, [12428] = 0x0061, | 102 | { 1105, 0x0845 }, |
102 | [12429] = 0x0011, [12430] = 0x0401, [12432] = 0x0050, [12433] = 0x0003, | 103 | { 1152, 0x6318 }, |
103 | [12434] = 0x0102, [12436] = 0x0051, [12437] = 0x0003, [12438] = 0x0106, | 104 | { 1153, 0x6300 }, |
104 | [12439] = 0x000a, [12440] = 0x0061, [12441] = 0x003b, [12442] = 0x0502, | 105 | { 1154, 0x0fca }, |
105 | [12443] = 0x0100, [12444] = 0x2fff, [12448] = 0x2fff, [12452] = 0x2fff, | 106 | { 1155, 0x0400 }, |
106 | [12456] = 0x2fff, [12460] = 0x2fff, [12464] = 0x2fff, [12468] = 0x2fff, | 107 | { 1156, 0x00d8 }, |
107 | [12472] = 0x2fff, [12476] = 0x2fff, [12480] = 0x0001, [12481] = 0x0001, | 108 | { 1157, 0x1eb5 }, |
108 | [12483] = 0x0006, [12484] = 0x0040, [12485] = 0x0001, [12486] = 0x000f, | 109 | { 1158, 0xf145 }, |
109 | [12487] = 0x0006, [12488] = 0x0001, [12489] = 0x0003, [12490] = 0x0106, | 110 | { 1159, 0x0b75 }, |
110 | [12492] = 0x0061, [12493] = 0x0011, [12494] = 0x0401, [12496] = 0x0050, | 111 | { 1160, 0x01c5 }, |
111 | [12497] = 0x0003, [12498] = 0x0102, [12500] = 0x0061, [12501] = 0x003b, | 112 | { 1161, 0x1c58 }, |
112 | [12502] = 0x0502, [12503] = 0x0100, [12504] = 0x2fff, [12508] = 0x2fff, | 113 | { 1162, 0xf373 }, |
113 | [12512] = 0x2fff, [12516] = 0x2fff, [12520] = 0x2fff, [12524] = 0x2fff, | 114 | { 1163, 0x0a54 }, |
114 | [12528] = 0x2fff, [12532] = 0x2fff, [12536] = 0x2fff, [12540] = 0x2fff, | 115 | { 1164, 0x0558 }, |
115 | [12544] = 0x0060, [12546] = 0x0601, [12548] = 0x0050, [12550] = 0x0100, | 116 | { 1165, 0x168e }, |
116 | [12552] = 0x0001, [12554] = 0x0104, [12555] = 0x0100, [12556] = 0x2fff, | 117 | { 1166, 0xf829 }, |
117 | [12560] = 0x2fff, [12564] = 0x2fff, [12568] = 0x2fff, [12572] = 0x2fff, | 118 | { 1167, 0x07ad }, |
118 | [12576] = 0x2fff, [12580] = 0x2fff, [12584] = 0x2fff, [12588] = 0x2fff, | 119 | { 1168, 0x1103 }, |
119 | [12592] = 0x2fff, [12596] = 0x2fff, [12600] = 0x2fff, [12604] = 0x2fff, | 120 | { 1169, 0x0564 }, |
120 | [12608] = 0x0061, [12610] = 0x0601, [12612] = 0x0050, [12614] = 0x0102, | 121 | { 1170, 0x0559 }, |
121 | [12616] = 0x0001, [12618] = 0x0106, [12619] = 0x0100, [12620] = 0x2fff, | 122 | { 1171, 0x4000 }, |
122 | [12624] = 0x2fff, [12628] = 0x2fff, [12632] = 0x2fff, [12636] = 0x2fff, | 123 | { 1184, 0x6318 }, |
123 | [12640] = 0x2fff, [12644] = 0x2fff, [12648] = 0x2fff, [12652] = 0x2fff, | 124 | { 1185, 0x6300 }, |
124 | [12656] = 0x2fff, [12660] = 0x2fff, [12664] = 0x2fff, [12668] = 0x2fff, | 125 | { 1186, 0x0fca }, |
125 | [12672] = 0x0060, [12674] = 0x0601, [12676] = 0x0061, [12678] = 0x0601, | 126 | { 1187, 0x0400 }, |
126 | [12680] = 0x0050, [12682] = 0x0300, [12684] = 0x0001, [12686] = 0x0304, | 127 | { 1188, 0x00d8 }, |
127 | [12688] = 0x0040, [12690] = 0x000f, [12692] = 0x0001, [12695] = 0x0100 | 128 | { 1189, 0x1eb5 }, |
129 | { 1190, 0xf145 }, | ||
130 | { 1191, 0x0b75 }, | ||
131 | { 1192, 0x01c5 }, | ||
132 | { 1193, 0x1c58 }, | ||
133 | { 1194, 0xf373 }, | ||
134 | { 1195, 0x0a54 }, | ||
135 | { 1196, 0x0558 }, | ||
136 | { 1197, 0x168e }, | ||
137 | { 1198, 0xf829 }, | ||
138 | { 1199, 0x07ad }, | ||
139 | { 1200, 0x1103 }, | ||
140 | { 1201, 0x0564 }, | ||
141 | { 1202, 0x0559 }, | ||
142 | { 1203, 0x4000 }, | ||
143 | { 1280, 0x00c0 }, | ||
144 | { 1281, 0x00c0 }, | ||
145 | { 1282, 0x00c0 }, | ||
146 | { 1283, 0x00c0 }, | ||
147 | { 1312, 0x0200 }, | ||
148 | { 1313, 0x0010 }, | ||
149 | { 1344, 0x0098 }, | ||
150 | { 1345, 0x0845 }, | ||
151 | { 1408, 0x6318 }, | ||
152 | { 1409, 0x6300 }, | ||
153 | { 1410, 0x0fca }, | ||
154 | { 1411, 0x0400 }, | ||
155 | { 1412, 0x00d8 }, | ||
156 | { 1413, 0x1eb5 }, | ||
157 | { 1414, 0xf145 }, | ||
158 | { 1415, 0x0b75 }, | ||
159 | { 1416, 0x01c5 }, | ||
160 | { 1417, 0x1c58 }, | ||
161 | { 1418, 0xf373 }, | ||
162 | { 1419, 0x0a54 }, | ||
163 | { 1420, 0x0558 }, | ||
164 | { 1421, 0x168e }, | ||
165 | { 1422, 0xf829 }, | ||
166 | { 1423, 0x07ad }, | ||
167 | { 1424, 0x1103 }, | ||
168 | { 1425, 0x0564 }, | ||
169 | { 1426, 0x0559 }, | ||
170 | { 1427, 0x4000 }, | ||
171 | { 1568, 0x0002 }, | ||
172 | { 1792, 0xa100 }, | ||
173 | { 1793, 0xa101 }, | ||
174 | { 1794, 0xa101 }, | ||
175 | { 1795, 0xa101 }, | ||
176 | { 1796, 0xa101 }, | ||
177 | { 1797, 0xa101 }, | ||
178 | { 1798, 0xa101 }, | ||
179 | { 1799, 0xa101 }, | ||
180 | { 1800, 0xa101 }, | ||
181 | { 1801, 0xa101 }, | ||
182 | { 1802, 0xa101 }, | ||
183 | { 1803, 0xa101 }, | ||
184 | { 1804, 0xa101 }, | ||
185 | { 1805, 0xa101 }, | ||
186 | { 1825, 0x0055 }, | ||
187 | { 1848, 0x3fff }, | ||
188 | { 1849, 0x1fff }, | ||
189 | { 2049, 0x0001 }, | ||
190 | { 2050, 0x0069 }, | ||
191 | { 2056, 0x0002 }, | ||
192 | { 2057, 0x0003 }, | ||
193 | { 2058, 0x0069 }, | ||
194 | { 12288, 0x0001 }, | ||
195 | { 12289, 0x0001 }, | ||
196 | { 12291, 0x0006 }, | ||
197 | { 12292, 0x0040 }, | ||
198 | { 12293, 0x0001 }, | ||
199 | { 12294, 0x000f }, | ||
200 | { 12295, 0x0006 }, | ||
201 | { 12296, 0x0001 }, | ||
202 | { 12297, 0x0003 }, | ||
203 | { 12298, 0x0104 }, | ||
204 | { 12300, 0x0060 }, | ||
205 | { 12301, 0x0011 }, | ||
206 | { 12302, 0x0401 }, | ||
207 | { 12304, 0x0050 }, | ||
208 | { 12305, 0x0003 }, | ||
209 | { 12306, 0x0100 }, | ||
210 | { 12308, 0x0051 }, | ||
211 | { 12309, 0x0003 }, | ||
212 | { 12310, 0x0104 }, | ||
213 | { 12311, 0x000a }, | ||
214 | { 12312, 0x0060 }, | ||
215 | { 12313, 0x003b }, | ||
216 | { 12314, 0x0502 }, | ||
217 | { 12315, 0x0100 }, | ||
218 | { 12316, 0x2fff }, | ||
219 | { 12320, 0x2fff }, | ||
220 | { 12324, 0x2fff }, | ||
221 | { 12328, 0x2fff }, | ||
222 | { 12332, 0x2fff }, | ||
223 | { 12336, 0x2fff }, | ||
224 | { 12340, 0x2fff }, | ||
225 | { 12344, 0x2fff }, | ||
226 | { 12348, 0x2fff }, | ||
227 | { 12352, 0x0001 }, | ||
228 | { 12353, 0x0001 }, | ||
229 | { 12355, 0x0006 }, | ||
230 | { 12356, 0x0040 }, | ||
231 | { 12357, 0x0001 }, | ||
232 | { 12358, 0x000f }, | ||
233 | { 12359, 0x0006 }, | ||
234 | { 12360, 0x0001 }, | ||
235 | { 12361, 0x0003 }, | ||
236 | { 12362, 0x0104 }, | ||
237 | { 12364, 0x0060 }, | ||
238 | { 12365, 0x0011 }, | ||
239 | { 12366, 0x0401 }, | ||
240 | { 12368, 0x0050 }, | ||
241 | { 12369, 0x0003 }, | ||
242 | { 12370, 0x0100 }, | ||
243 | { 12372, 0x0060 }, | ||
244 | { 12373, 0x003b }, | ||
245 | { 12374, 0x0502 }, | ||
246 | { 12375, 0x0100 }, | ||
247 | { 12376, 0x2fff }, | ||
248 | { 12380, 0x2fff }, | ||
249 | { 12384, 0x2fff }, | ||
250 | { 12388, 0x2fff }, | ||
251 | { 12392, 0x2fff }, | ||
252 | { 12396, 0x2fff }, | ||
253 | { 12400, 0x2fff }, | ||
254 | { 12404, 0x2fff }, | ||
255 | { 12408, 0x2fff }, | ||
256 | { 12412, 0x2fff }, | ||
257 | { 12416, 0x0001 }, | ||
258 | { 12417, 0x0001 }, | ||
259 | { 12419, 0x0006 }, | ||
260 | { 12420, 0x0040 }, | ||
261 | { 12421, 0x0001 }, | ||
262 | { 12422, 0x000f }, | ||
263 | { 12423, 0x0006 }, | ||
264 | { 12424, 0x0001 }, | ||
265 | { 12425, 0x0003 }, | ||
266 | { 12426, 0x0106 }, | ||
267 | { 12428, 0x0061 }, | ||
268 | { 12429, 0x0011 }, | ||
269 | { 12430, 0x0401 }, | ||
270 | { 12432, 0x0050 }, | ||
271 | { 12433, 0x0003 }, | ||
272 | { 12434, 0x0102 }, | ||
273 | { 12436, 0x0051 }, | ||
274 | { 12437, 0x0003 }, | ||
275 | { 12438, 0x0106 }, | ||
276 | { 12439, 0x000a }, | ||
277 | { 12440, 0x0061 }, | ||
278 | { 12441, 0x003b }, | ||
279 | { 12442, 0x0502 }, | ||
280 | { 12443, 0x0100 }, | ||
281 | { 12444, 0x2fff }, | ||
282 | { 12448, 0x2fff }, | ||
283 | { 12452, 0x2fff }, | ||
284 | { 12456, 0x2fff }, | ||
285 | { 12460, 0x2fff }, | ||
286 | { 12464, 0x2fff }, | ||
287 | { 12468, 0x2fff }, | ||
288 | { 12472, 0x2fff }, | ||
289 | { 12476, 0x2fff }, | ||
290 | { 12480, 0x0001 }, | ||
291 | { 12481, 0x0001 }, | ||
292 | { 12483, 0x0006 }, | ||
293 | { 12484, 0x0040 }, | ||
294 | { 12485, 0x0001 }, | ||
295 | { 12486, 0x000f }, | ||
296 | { 12487, 0x0006 }, | ||
297 | { 12488, 0x0001 }, | ||
298 | { 12489, 0x0003 }, | ||
299 | { 12490, 0x0106 }, | ||
300 | { 12492, 0x0061 }, | ||
301 | { 12493, 0x0011 }, | ||
302 | { 12494, 0x0401 }, | ||
303 | { 12496, 0x0050 }, | ||
304 | { 12497, 0x0003 }, | ||
305 | { 12498, 0x0102 }, | ||
306 | { 12500, 0x0061 }, | ||
307 | { 12501, 0x003b }, | ||
308 | { 12502, 0x0502 }, | ||
309 | { 12503, 0x0100 }, | ||
310 | { 12504, 0x2fff }, | ||
311 | { 12508, 0x2fff }, | ||
312 | { 12512, 0x2fff }, | ||
313 | { 12516, 0x2fff }, | ||
314 | { 12520, 0x2fff }, | ||
315 | { 12524, 0x2fff }, | ||
316 | { 12528, 0x2fff }, | ||
317 | { 12532, 0x2fff }, | ||
318 | { 12536, 0x2fff }, | ||
319 | { 12540, 0x2fff }, | ||
320 | { 12544, 0x0060 }, | ||
321 | { 12546, 0x0601 }, | ||
322 | { 12548, 0x0050 }, | ||
323 | { 12550, 0x0100 }, | ||
324 | { 12552, 0x0001 }, | ||
325 | { 12554, 0x0104 }, | ||
326 | { 12555, 0x0100 }, | ||
327 | { 12556, 0x2fff }, | ||
328 | { 12560, 0x2fff }, | ||
329 | { 12564, 0x2fff }, | ||
330 | { 12568, 0x2fff }, | ||
331 | { 12572, 0x2fff }, | ||
332 | { 12576, 0x2fff }, | ||
333 | { 12580, 0x2fff }, | ||
334 | { 12584, 0x2fff }, | ||
335 | { 12588, 0x2fff }, | ||
336 | { 12592, 0x2fff }, | ||
337 | { 12596, 0x2fff }, | ||
338 | { 12600, 0x2fff }, | ||
339 | { 12604, 0x2fff }, | ||
340 | { 12608, 0x0061 }, | ||
341 | { 12610, 0x0601 }, | ||
342 | { 12612, 0x0050 }, | ||
343 | { 12614, 0x0102 }, | ||
344 | { 12616, 0x0001 }, | ||
345 | { 12618, 0x0106 }, | ||
346 | { 12619, 0x0100 }, | ||
347 | { 12620, 0x2fff }, | ||
348 | { 12624, 0x2fff }, | ||
349 | { 12628, 0x2fff }, | ||
350 | { 12632, 0x2fff }, | ||
351 | { 12636, 0x2fff }, | ||
352 | { 12640, 0x2fff }, | ||
353 | { 12644, 0x2fff }, | ||
354 | { 12648, 0x2fff }, | ||
355 | { 12652, 0x2fff }, | ||
356 | { 12656, 0x2fff }, | ||
357 | { 12660, 0x2fff }, | ||
358 | { 12664, 0x2fff }, | ||
359 | { 12668, 0x2fff }, | ||
360 | { 12672, 0x0060 }, | ||
361 | { 12674, 0x0601 }, | ||
362 | { 12676, 0x0061 }, | ||
363 | { 12678, 0x0601 }, | ||
364 | { 12680, 0x0050 }, | ||
365 | { 12682, 0x0300 }, | ||
366 | { 12684, 0x0001 }, | ||
367 | { 12686, 0x0304 }, | ||
368 | { 12688, 0x0040 }, | ||
369 | { 12690, 0x000f }, | ||
370 | { 12692, 0x0001 }, | ||
371 | { 12695, 0x0100 }, | ||
128 | }; | 372 | }; |
129 | 373 | ||
130 | struct fll_config { | 374 | struct fll_config { |
@@ -134,7 +378,7 @@ struct fll_config { | |||
134 | }; | 378 | }; |
135 | 379 | ||
136 | struct wm8995_priv { | 380 | struct wm8995_priv { |
137 | enum snd_soc_control_type control_type; | 381 | struct regmap *regmap; |
138 | int sysclk[2]; | 382 | int sysclk[2]; |
139 | int mclk[2]; | 383 | int mclk[2]; |
140 | int aifclk[2]; | 384 | int aifclk[2]; |
@@ -156,7 +400,7 @@ static int wm8995_regulator_event_##n(struct notifier_block *nb, \ | |||
156 | struct wm8995_priv *wm8995 = container_of(nb, struct wm8995_priv, \ | 400 | struct wm8995_priv *wm8995 = container_of(nb, struct wm8995_priv, \ |
157 | disable_nb[n]); \ | 401 | disable_nb[n]); \ |
158 | if (event & REGULATOR_EVENT_DISABLE) { \ | 402 | if (event & REGULATOR_EVENT_DISABLE) { \ |
159 | wm8995->codec->cache_sync = 1; \ | 403 | regcache_mark_dirty(wm8995->regmap); \ |
160 | } \ | 404 | } \ |
161 | return 0; \ | 405 | return 0; \ |
162 | } | 406 | } |
@@ -688,8 +932,10 @@ static const struct snd_soc_dapm_widget wm8995_dapm_widgets[] = { | |||
688 | SND_SOC_DAPM_MIXER("IN1R PGA", SND_SOC_NOPM, 0, 0, | 932 | SND_SOC_DAPM_MIXER("IN1R PGA", SND_SOC_NOPM, 0, 0, |
689 | &in1r_pga, 1), | 933 | &in1r_pga, 1), |
690 | 934 | ||
691 | SND_SOC_DAPM_MICBIAS("MICBIAS1", WM8995_POWER_MANAGEMENT_1, 8, 0), | 935 | SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8995_POWER_MANAGEMENT_1, 8, 0, |
692 | SND_SOC_DAPM_MICBIAS("MICBIAS2", WM8995_POWER_MANAGEMENT_1, 9, 0), | 936 | NULL, 0), |
937 | SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8995_POWER_MANAGEMENT_1, 9, 0, | ||
938 | NULL, 0), | ||
693 | 939 | ||
694 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8995_AIF1_CLOCKING_1, 0, 0, NULL, 0), | 940 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8995_AIF1_CLOCKING_1, 0, 0, NULL, 0), |
695 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8995_AIF2_CLOCKING_1, 0, 0, NULL, 0), | 941 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8995_AIF2_CLOCKING_1, 0, 0, NULL, 0), |
@@ -947,31 +1193,244 @@ static const struct snd_soc_dapm_route wm8995_intercon[] = { | |||
947 | { "SPK2R", NULL, "SPK2R Driver" } | 1193 | { "SPK2R", NULL, "SPK2R Driver" } |
948 | }; | 1194 | }; |
949 | 1195 | ||
950 | static int wm8995_volatile(struct snd_soc_codec *codec, unsigned int reg) | 1196 | static bool wm8995_readable(struct device *dev, unsigned int reg) |
951 | { | 1197 | { |
952 | /* out of bounds registers are generally considered | ||
953 | * volatile to support register banks that are partially | ||
954 | * owned by something else for e.g. a DSP | ||
955 | */ | ||
956 | if (reg > WM8995_MAX_CACHED_REGISTER) | ||
957 | return 1; | ||
958 | |||
959 | switch (reg) { | 1198 | switch (reg) { |
960 | case WM8995_SOFTWARE_RESET: | 1199 | case WM8995_SOFTWARE_RESET: |
1200 | case WM8995_POWER_MANAGEMENT_1: | ||
1201 | case WM8995_POWER_MANAGEMENT_2: | ||
1202 | case WM8995_POWER_MANAGEMENT_3: | ||
1203 | case WM8995_POWER_MANAGEMENT_4: | ||
1204 | case WM8995_POWER_MANAGEMENT_5: | ||
1205 | case WM8995_LEFT_LINE_INPUT_1_VOLUME: | ||
1206 | case WM8995_RIGHT_LINE_INPUT_1_VOLUME: | ||
1207 | case WM8995_LEFT_LINE_INPUT_CONTROL: | ||
1208 | case WM8995_DAC1_LEFT_VOLUME: | ||
1209 | case WM8995_DAC1_RIGHT_VOLUME: | ||
1210 | case WM8995_DAC2_LEFT_VOLUME: | ||
1211 | case WM8995_DAC2_RIGHT_VOLUME: | ||
1212 | case WM8995_OUTPUT_VOLUME_ZC_1: | ||
1213 | case WM8995_MICBIAS_1: | ||
1214 | case WM8995_MICBIAS_2: | ||
1215 | case WM8995_LDO_1: | ||
1216 | case WM8995_LDO_2: | ||
1217 | case WM8995_ACCESSORY_DETECT_MODE1: | ||
1218 | case WM8995_ACCESSORY_DETECT_MODE2: | ||
1219 | case WM8995_HEADPHONE_DETECT1: | ||
1220 | case WM8995_HEADPHONE_DETECT2: | ||
1221 | case WM8995_MIC_DETECT_1: | ||
1222 | case WM8995_MIC_DETECT_2: | ||
1223 | case WM8995_CHARGE_PUMP_1: | ||
1224 | case WM8995_CLASS_W_1: | ||
1225 | case WM8995_DC_SERVO_1: | ||
1226 | case WM8995_DC_SERVO_2: | ||
1227 | case WM8995_DC_SERVO_3: | ||
1228 | case WM8995_DC_SERVO_5: | ||
1229 | case WM8995_DC_SERVO_6: | ||
1230 | case WM8995_DC_SERVO_7: | ||
961 | case WM8995_DC_SERVO_READBACK_0: | 1231 | case WM8995_DC_SERVO_READBACK_0: |
1232 | case WM8995_ANALOGUE_HP_1: | ||
1233 | case WM8995_ANALOGUE_HP_2: | ||
1234 | case WM8995_CHIP_REVISION: | ||
1235 | case WM8995_CONTROL_INTERFACE_1: | ||
1236 | case WM8995_CONTROL_INTERFACE_2: | ||
1237 | case WM8995_WRITE_SEQUENCER_CTRL_1: | ||
1238 | case WM8995_WRITE_SEQUENCER_CTRL_2: | ||
1239 | case WM8995_AIF1_CLOCKING_1: | ||
1240 | case WM8995_AIF1_CLOCKING_2: | ||
1241 | case WM8995_AIF2_CLOCKING_1: | ||
1242 | case WM8995_AIF2_CLOCKING_2: | ||
1243 | case WM8995_CLOCKING_1: | ||
1244 | case WM8995_CLOCKING_2: | ||
1245 | case WM8995_AIF1_RATE: | ||
1246 | case WM8995_AIF2_RATE: | ||
1247 | case WM8995_RATE_STATUS: | ||
1248 | case WM8995_FLL1_CONTROL_1: | ||
1249 | case WM8995_FLL1_CONTROL_2: | ||
1250 | case WM8995_FLL1_CONTROL_3: | ||
1251 | case WM8995_FLL1_CONTROL_4: | ||
1252 | case WM8995_FLL1_CONTROL_5: | ||
1253 | case WM8995_FLL2_CONTROL_1: | ||
1254 | case WM8995_FLL2_CONTROL_2: | ||
1255 | case WM8995_FLL2_CONTROL_3: | ||
1256 | case WM8995_FLL2_CONTROL_4: | ||
1257 | case WM8995_FLL2_CONTROL_5: | ||
1258 | case WM8995_AIF1_CONTROL_1: | ||
1259 | case WM8995_AIF1_CONTROL_2: | ||
1260 | case WM8995_AIF1_MASTER_SLAVE: | ||
1261 | case WM8995_AIF1_BCLK: | ||
1262 | case WM8995_AIF1ADC_LRCLK: | ||
1263 | case WM8995_AIF1DAC_LRCLK: | ||
1264 | case WM8995_AIF1DAC_DATA: | ||
1265 | case WM8995_AIF1ADC_DATA: | ||
1266 | case WM8995_AIF2_CONTROL_1: | ||
1267 | case WM8995_AIF2_CONTROL_2: | ||
1268 | case WM8995_AIF2_MASTER_SLAVE: | ||
1269 | case WM8995_AIF2_BCLK: | ||
1270 | case WM8995_AIF2ADC_LRCLK: | ||
1271 | case WM8995_AIF2DAC_LRCLK: | ||
1272 | case WM8995_AIF2DAC_DATA: | ||
1273 | case WM8995_AIF2ADC_DATA: | ||
1274 | case WM8995_AIF1_ADC1_LEFT_VOLUME: | ||
1275 | case WM8995_AIF1_ADC1_RIGHT_VOLUME: | ||
1276 | case WM8995_AIF1_DAC1_LEFT_VOLUME: | ||
1277 | case WM8995_AIF1_DAC1_RIGHT_VOLUME: | ||
1278 | case WM8995_AIF1_ADC2_LEFT_VOLUME: | ||
1279 | case WM8995_AIF1_ADC2_RIGHT_VOLUME: | ||
1280 | case WM8995_AIF1_DAC2_LEFT_VOLUME: | ||
1281 | case WM8995_AIF1_DAC2_RIGHT_VOLUME: | ||
1282 | case WM8995_AIF1_ADC1_FILTERS: | ||
1283 | case WM8995_AIF1_ADC2_FILTERS: | ||
1284 | case WM8995_AIF1_DAC1_FILTERS_1: | ||
1285 | case WM8995_AIF1_DAC1_FILTERS_2: | ||
1286 | case WM8995_AIF1_DAC2_FILTERS_1: | ||
1287 | case WM8995_AIF1_DAC2_FILTERS_2: | ||
1288 | case WM8995_AIF1_DRC1_1: | ||
1289 | case WM8995_AIF1_DRC1_2: | ||
1290 | case WM8995_AIF1_DRC1_3: | ||
1291 | case WM8995_AIF1_DRC1_4: | ||
1292 | case WM8995_AIF1_DRC1_5: | ||
1293 | case WM8995_AIF1_DRC2_1: | ||
1294 | case WM8995_AIF1_DRC2_2: | ||
1295 | case WM8995_AIF1_DRC2_3: | ||
1296 | case WM8995_AIF1_DRC2_4: | ||
1297 | case WM8995_AIF1_DRC2_5: | ||
1298 | case WM8995_AIF1_DAC1_EQ_GAINS_1: | ||
1299 | case WM8995_AIF1_DAC1_EQ_GAINS_2: | ||
1300 | case WM8995_AIF1_DAC1_EQ_BAND_1_A: | ||
1301 | case WM8995_AIF1_DAC1_EQ_BAND_1_B: | ||
1302 | case WM8995_AIF1_DAC1_EQ_BAND_1_PG: | ||
1303 | case WM8995_AIF1_DAC1_EQ_BAND_2_A: | ||
1304 | case WM8995_AIF1_DAC1_EQ_BAND_2_B: | ||
1305 | case WM8995_AIF1_DAC1_EQ_BAND_2_C: | ||
1306 | case WM8995_AIF1_DAC1_EQ_BAND_2_PG: | ||
1307 | case WM8995_AIF1_DAC1_EQ_BAND_3_A: | ||
1308 | case WM8995_AIF1_DAC1_EQ_BAND_3_B: | ||
1309 | case WM8995_AIF1_DAC1_EQ_BAND_3_C: | ||
1310 | case WM8995_AIF1_DAC1_EQ_BAND_3_PG: | ||
1311 | case WM8995_AIF1_DAC1_EQ_BAND_4_A: | ||
1312 | case WM8995_AIF1_DAC1_EQ_BAND_4_B: | ||
1313 | case WM8995_AIF1_DAC1_EQ_BAND_4_C: | ||
1314 | case WM8995_AIF1_DAC1_EQ_BAND_4_PG: | ||
1315 | case WM8995_AIF1_DAC1_EQ_BAND_5_A: | ||
1316 | case WM8995_AIF1_DAC1_EQ_BAND_5_B: | ||
1317 | case WM8995_AIF1_DAC1_EQ_BAND_5_PG: | ||
1318 | case WM8995_AIF1_DAC2_EQ_GAINS_1: | ||
1319 | case WM8995_AIF1_DAC2_EQ_GAINS_2: | ||
1320 | case WM8995_AIF1_DAC2_EQ_BAND_1_A: | ||
1321 | case WM8995_AIF1_DAC2_EQ_BAND_1_B: | ||
1322 | case WM8995_AIF1_DAC2_EQ_BAND_1_PG: | ||
1323 | case WM8995_AIF1_DAC2_EQ_BAND_2_A: | ||
1324 | case WM8995_AIF1_DAC2_EQ_BAND_2_B: | ||
1325 | case WM8995_AIF1_DAC2_EQ_BAND_2_C: | ||
1326 | case WM8995_AIF1_DAC2_EQ_BAND_2_PG: | ||
1327 | case WM8995_AIF1_DAC2_EQ_BAND_3_A: | ||
1328 | case WM8995_AIF1_DAC2_EQ_BAND_3_B: | ||
1329 | case WM8995_AIF1_DAC2_EQ_BAND_3_C: | ||
1330 | case WM8995_AIF1_DAC2_EQ_BAND_3_PG: | ||
1331 | case WM8995_AIF1_DAC2_EQ_BAND_4_A: | ||
1332 | case WM8995_AIF1_DAC2_EQ_BAND_4_B: | ||
1333 | case WM8995_AIF1_DAC2_EQ_BAND_4_C: | ||
1334 | case WM8995_AIF1_DAC2_EQ_BAND_4_PG: | ||
1335 | case WM8995_AIF1_DAC2_EQ_BAND_5_A: | ||
1336 | case WM8995_AIF1_DAC2_EQ_BAND_5_B: | ||
1337 | case WM8995_AIF1_DAC2_EQ_BAND_5_PG: | ||
1338 | case WM8995_AIF2_ADC_LEFT_VOLUME: | ||
1339 | case WM8995_AIF2_ADC_RIGHT_VOLUME: | ||
1340 | case WM8995_AIF2_DAC_LEFT_VOLUME: | ||
1341 | case WM8995_AIF2_DAC_RIGHT_VOLUME: | ||
1342 | case WM8995_AIF2_ADC_FILTERS: | ||
1343 | case WM8995_AIF2_DAC_FILTERS_1: | ||
1344 | case WM8995_AIF2_DAC_FILTERS_2: | ||
1345 | case WM8995_AIF2_DRC_1: | ||
1346 | case WM8995_AIF2_DRC_2: | ||
1347 | case WM8995_AIF2_DRC_3: | ||
1348 | case WM8995_AIF2_DRC_4: | ||
1349 | case WM8995_AIF2_DRC_5: | ||
1350 | case WM8995_AIF2_EQ_GAINS_1: | ||
1351 | case WM8995_AIF2_EQ_GAINS_2: | ||
1352 | case WM8995_AIF2_EQ_BAND_1_A: | ||
1353 | case WM8995_AIF2_EQ_BAND_1_B: | ||
1354 | case WM8995_AIF2_EQ_BAND_1_PG: | ||
1355 | case WM8995_AIF2_EQ_BAND_2_A: | ||
1356 | case WM8995_AIF2_EQ_BAND_2_B: | ||
1357 | case WM8995_AIF2_EQ_BAND_2_C: | ||
1358 | case WM8995_AIF2_EQ_BAND_2_PG: | ||
1359 | case WM8995_AIF2_EQ_BAND_3_A: | ||
1360 | case WM8995_AIF2_EQ_BAND_3_B: | ||
1361 | case WM8995_AIF2_EQ_BAND_3_C: | ||
1362 | case WM8995_AIF2_EQ_BAND_3_PG: | ||
1363 | case WM8995_AIF2_EQ_BAND_4_A: | ||
1364 | case WM8995_AIF2_EQ_BAND_4_B: | ||
1365 | case WM8995_AIF2_EQ_BAND_4_C: | ||
1366 | case WM8995_AIF2_EQ_BAND_4_PG: | ||
1367 | case WM8995_AIF2_EQ_BAND_5_A: | ||
1368 | case WM8995_AIF2_EQ_BAND_5_B: | ||
1369 | case WM8995_AIF2_EQ_BAND_5_PG: | ||
1370 | case WM8995_DAC1_MIXER_VOLUMES: | ||
1371 | case WM8995_DAC1_LEFT_MIXER_ROUTING: | ||
1372 | case WM8995_DAC1_RIGHT_MIXER_ROUTING: | ||
1373 | case WM8995_DAC2_MIXER_VOLUMES: | ||
1374 | case WM8995_DAC2_LEFT_MIXER_ROUTING: | ||
1375 | case WM8995_DAC2_RIGHT_MIXER_ROUTING: | ||
1376 | case WM8995_AIF1_ADC1_LEFT_MIXER_ROUTING: | ||
1377 | case WM8995_AIF1_ADC1_RIGHT_MIXER_ROUTING: | ||
1378 | case WM8995_AIF1_ADC2_LEFT_MIXER_ROUTING: | ||
1379 | case WM8995_AIF1_ADC2_RIGHT_MIXER_ROUTING: | ||
1380 | case WM8995_DAC_SOFTMUTE: | ||
1381 | case WM8995_OVERSAMPLING: | ||
1382 | case WM8995_SIDETONE: | ||
1383 | case WM8995_GPIO_1: | ||
1384 | case WM8995_GPIO_2: | ||
1385 | case WM8995_GPIO_3: | ||
1386 | case WM8995_GPIO_4: | ||
1387 | case WM8995_GPIO_5: | ||
1388 | case WM8995_GPIO_6: | ||
1389 | case WM8995_GPIO_7: | ||
1390 | case WM8995_GPIO_8: | ||
1391 | case WM8995_GPIO_9: | ||
1392 | case WM8995_GPIO_10: | ||
1393 | case WM8995_GPIO_11: | ||
1394 | case WM8995_GPIO_12: | ||
1395 | case WM8995_GPIO_13: | ||
1396 | case WM8995_GPIO_14: | ||
1397 | case WM8995_PULL_CONTROL_1: | ||
1398 | case WM8995_PULL_CONTROL_2: | ||
962 | case WM8995_INTERRUPT_STATUS_1: | 1399 | case WM8995_INTERRUPT_STATUS_1: |
963 | case WM8995_INTERRUPT_STATUS_2: | 1400 | case WM8995_INTERRUPT_STATUS_2: |
1401 | case WM8995_INTERRUPT_RAW_STATUS_2: | ||
964 | case WM8995_INTERRUPT_STATUS_1_MASK: | 1402 | case WM8995_INTERRUPT_STATUS_1_MASK: |
965 | case WM8995_INTERRUPT_STATUS_2_MASK: | 1403 | case WM8995_INTERRUPT_STATUS_2_MASK: |
966 | case WM8995_INTERRUPT_CONTROL: | 1404 | case WM8995_INTERRUPT_CONTROL: |
1405 | case WM8995_LEFT_PDM_SPEAKER_1: | ||
1406 | case WM8995_RIGHT_PDM_SPEAKER_1: | ||
1407 | case WM8995_PDM_SPEAKER_1_MUTE_SEQUENCE: | ||
1408 | case WM8995_LEFT_PDM_SPEAKER_2: | ||
1409 | case WM8995_RIGHT_PDM_SPEAKER_2: | ||
1410 | case WM8995_PDM_SPEAKER_2_MUTE_SEQUENCE: | ||
1411 | return true; | ||
1412 | default: | ||
1413 | return false; | ||
1414 | } | ||
1415 | } | ||
1416 | |||
1417 | static bool wm8995_volatile(struct device *dev, unsigned int reg) | ||
1418 | { | ||
1419 | switch (reg) { | ||
1420 | case WM8995_SOFTWARE_RESET: | ||
1421 | case WM8995_DC_SERVO_READBACK_0: | ||
1422 | case WM8995_INTERRUPT_STATUS_1: | ||
1423 | case WM8995_INTERRUPT_STATUS_2: | ||
1424 | case WM8995_INTERRUPT_CONTROL: | ||
967 | case WM8995_ACCESSORY_DETECT_MODE1: | 1425 | case WM8995_ACCESSORY_DETECT_MODE1: |
968 | case WM8995_ACCESSORY_DETECT_MODE2: | 1426 | case WM8995_ACCESSORY_DETECT_MODE2: |
969 | case WM8995_HEADPHONE_DETECT1: | 1427 | case WM8995_HEADPHONE_DETECT1: |
970 | case WM8995_HEADPHONE_DETECT2: | 1428 | case WM8995_HEADPHONE_DETECT2: |
971 | return 1; | 1429 | case WM8995_RATE_STATUS: |
1430 | return true; | ||
1431 | default: | ||
1432 | return false; | ||
972 | } | 1433 | } |
973 | |||
974 | return 0; | ||
975 | } | 1434 | } |
976 | 1435 | ||
977 | static int wm8995_aif_mute(struct snd_soc_dai *dai, int mute) | 1436 | static int wm8995_aif_mute(struct snd_soc_dai *dai, int mute) |
@@ -1526,7 +1985,7 @@ static int wm8995_set_bias_level(struct snd_soc_codec *codec, | |||
1526 | if (ret) | 1985 | if (ret) |
1527 | return ret; | 1986 | return ret; |
1528 | 1987 | ||
1529 | ret = snd_soc_cache_sync(codec); | 1988 | ret = regcache_sync(wm8995->regmap); |
1530 | if (ret) { | 1989 | if (ret) { |
1531 | dev_err(codec->dev, | 1990 | dev_err(codec->dev, |
1532 | "Failed to sync cache: %d\n", ret); | 1991 | "Failed to sync cache: %d\n", ret); |
@@ -1550,7 +2009,7 @@ static int wm8995_set_bias_level(struct snd_soc_codec *codec, | |||
1550 | } | 2009 | } |
1551 | 2010 | ||
1552 | #ifdef CONFIG_PM | 2011 | #ifdef CONFIG_PM |
1553 | static int wm8995_suspend(struct snd_soc_codec *codec, pm_message_t state) | 2012 | static int wm8995_suspend(struct snd_soc_codec *codec) |
1554 | { | 2013 | { |
1555 | wm8995_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2014 | wm8995_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1556 | return 0; | 2015 | return 0; |
@@ -1592,7 +2051,8 @@ static int wm8995_probe(struct snd_soc_codec *codec) | |||
1592 | wm8995 = snd_soc_codec_get_drvdata(codec); | 2051 | wm8995 = snd_soc_codec_get_drvdata(codec); |
1593 | wm8995->codec = codec; | 2052 | wm8995->codec = codec; |
1594 | 2053 | ||
1595 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, wm8995->control_type); | 2054 | codec->control_data = wm8995->regmap; |
2055 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); | ||
1596 | if (ret < 0) { | 2056 | if (ret < 0) { |
1597 | dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret); | 2057 | dev_err(codec->dev, "Failed to set cache i/o: %d\n", ret); |
1598 | return ret; | 2058 | return ret; |
@@ -1696,7 +2156,7 @@ err_reg_get: | |||
1696 | #define WM8995_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ | 2156 | #define WM8995_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
1697 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 2157 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
1698 | 2158 | ||
1699 | static struct snd_soc_dai_ops wm8995_aif1_dai_ops = { | 2159 | static const struct snd_soc_dai_ops wm8995_aif1_dai_ops = { |
1700 | .set_sysclk = wm8995_set_dai_sysclk, | 2160 | .set_sysclk = wm8995_set_dai_sysclk, |
1701 | .set_fmt = wm8995_set_dai_fmt, | 2161 | .set_fmt = wm8995_set_dai_fmt, |
1702 | .hw_params = wm8995_hw_params, | 2162 | .hw_params = wm8995_hw_params, |
@@ -1705,7 +2165,7 @@ static struct snd_soc_dai_ops wm8995_aif1_dai_ops = { | |||
1705 | .set_tristate = wm8995_set_tristate, | 2165 | .set_tristate = wm8995_set_tristate, |
1706 | }; | 2166 | }; |
1707 | 2167 | ||
1708 | static struct snd_soc_dai_ops wm8995_aif2_dai_ops = { | 2168 | static const struct snd_soc_dai_ops wm8995_aif2_dai_ops = { |
1709 | .set_sysclk = wm8995_set_dai_sysclk, | 2169 | .set_sysclk = wm8995_set_dai_sysclk, |
1710 | .set_fmt = wm8995_set_dai_fmt, | 2170 | .set_fmt = wm8995_set_dai_fmt, |
1711 | .hw_params = wm8995_hw_params, | 2171 | .hw_params = wm8995_hw_params, |
@@ -1714,7 +2174,7 @@ static struct snd_soc_dai_ops wm8995_aif2_dai_ops = { | |||
1714 | .set_tristate = wm8995_set_tristate, | 2174 | .set_tristate = wm8995_set_tristate, |
1715 | }; | 2175 | }; |
1716 | 2176 | ||
1717 | static struct snd_soc_dai_ops wm8995_aif3_dai_ops = { | 2177 | static const struct snd_soc_dai_ops wm8995_aif3_dai_ops = { |
1718 | .set_tristate = wm8995_set_tristate, | 2178 | .set_tristate = wm8995_set_tristate, |
1719 | }; | 2179 | }; |
1720 | 2180 | ||
@@ -1781,11 +2241,18 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8995 = { | |||
1781 | .suspend = wm8995_suspend, | 2241 | .suspend = wm8995_suspend, |
1782 | .resume = wm8995_resume, | 2242 | .resume = wm8995_resume, |
1783 | .set_bias_level = wm8995_set_bias_level, | 2243 | .set_bias_level = wm8995_set_bias_level, |
1784 | .reg_cache_size = ARRAY_SIZE(wm8995_reg_defs), | 2244 | }; |
1785 | .reg_word_size = sizeof(u16), | 2245 | |
1786 | .reg_cache_default = wm8995_reg_defs, | 2246 | static struct regmap_config wm8995_regmap = { |
1787 | .volatile_register = wm8995_volatile, | 2247 | .reg_bits = 16, |
1788 | .compress_type = SND_SOC_RBTREE_COMPRESSION | 2248 | .val_bits = 16, |
2249 | |||
2250 | .max_register = WM8995_MAX_REGISTER, | ||
2251 | .reg_defaults = wm8995_reg_defaults, | ||
2252 | .num_reg_defaults = ARRAY_SIZE(wm8995_reg_defaults), | ||
2253 | .volatile_reg = wm8995_volatile, | ||
2254 | .readable_reg = wm8995_readable, | ||
2255 | .cache_type = REGCACHE_RBTREE, | ||
1789 | }; | 2256 | }; |
1790 | 2257 | ||
1791 | #if defined(CONFIG_SPI_MASTER) | 2258 | #if defined(CONFIG_SPI_MASTER) |
@@ -1798,21 +2265,37 @@ static int __devinit wm8995_spi_probe(struct spi_device *spi) | |||
1798 | if (!wm8995) | 2265 | if (!wm8995) |
1799 | return -ENOMEM; | 2266 | return -ENOMEM; |
1800 | 2267 | ||
1801 | wm8995->control_type = SND_SOC_SPI; | ||
1802 | spi_set_drvdata(spi, wm8995); | 2268 | spi_set_drvdata(spi, wm8995); |
1803 | 2269 | ||
2270 | wm8995->regmap = regmap_init_spi(spi, &wm8995_regmap); | ||
2271 | if (IS_ERR(wm8995->regmap)) { | ||
2272 | ret = PTR_ERR(wm8995->regmap); | ||
2273 | dev_err(&spi->dev, "Failed to register regmap: %d\n", ret); | ||
2274 | goto err_alloc; | ||
2275 | } | ||
2276 | |||
1804 | ret = snd_soc_register_codec(&spi->dev, | 2277 | ret = snd_soc_register_codec(&spi->dev, |
1805 | &soc_codec_dev_wm8995, wm8995_dai, | 2278 | &soc_codec_dev_wm8995, wm8995_dai, |
1806 | ARRAY_SIZE(wm8995_dai)); | 2279 | ARRAY_SIZE(wm8995_dai)); |
1807 | if (ret < 0) | 2280 | if (ret < 0) |
1808 | kfree(wm8995); | 2281 | goto err_regmap; |
2282 | |||
2283 | return ret; | ||
2284 | |||
2285 | err_regmap: | ||
2286 | regmap_exit(wm8995->regmap); | ||
2287 | err_alloc: | ||
2288 | kfree(wm8995); | ||
2289 | |||
1809 | return ret; | 2290 | return ret; |
1810 | } | 2291 | } |
1811 | 2292 | ||
1812 | static int __devexit wm8995_spi_remove(struct spi_device *spi) | 2293 | static int __devexit wm8995_spi_remove(struct spi_device *spi) |
1813 | { | 2294 | { |
2295 | struct wm8995_priv *wm8995 = spi_get_drvdata(spi); | ||
1814 | snd_soc_unregister_codec(&spi->dev); | 2296 | snd_soc_unregister_codec(&spi->dev); |
1815 | kfree(spi_get_drvdata(spi)); | 2297 | regmap_exit(wm8995->regmap); |
2298 | kfree(wm8995); | ||
1816 | return 0; | 2299 | return 0; |
1817 | } | 2300 | } |
1818 | 2301 | ||
@@ -1837,21 +2320,40 @@ static __devinit int wm8995_i2c_probe(struct i2c_client *i2c, | |||
1837 | if (!wm8995) | 2320 | if (!wm8995) |
1838 | return -ENOMEM; | 2321 | return -ENOMEM; |
1839 | 2322 | ||
1840 | wm8995->control_type = SND_SOC_I2C; | ||
1841 | i2c_set_clientdata(i2c, wm8995); | 2323 | i2c_set_clientdata(i2c, wm8995); |
1842 | 2324 | ||
2325 | wm8995->regmap = regmap_init_i2c(i2c, &wm8995_regmap); | ||
2326 | if (IS_ERR(wm8995->regmap)) { | ||
2327 | ret = PTR_ERR(wm8995->regmap); | ||
2328 | dev_err(&i2c->dev, "Failed to register regmap: %d\n", ret); | ||
2329 | goto err_alloc; | ||
2330 | } | ||
2331 | |||
1843 | ret = snd_soc_register_codec(&i2c->dev, | 2332 | ret = snd_soc_register_codec(&i2c->dev, |
1844 | &soc_codec_dev_wm8995, wm8995_dai, | 2333 | &soc_codec_dev_wm8995, wm8995_dai, |
1845 | ARRAY_SIZE(wm8995_dai)); | 2334 | ARRAY_SIZE(wm8995_dai)); |
1846 | if (ret < 0) | 2335 | if (ret < 0) { |
1847 | kfree(wm8995); | 2336 | dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); |
2337 | goto err_regmap; | ||
2338 | } | ||
2339 | |||
2340 | return ret; | ||
2341 | |||
2342 | err_regmap: | ||
2343 | regmap_exit(wm8995->regmap); | ||
2344 | err_alloc: | ||
2345 | kfree(wm8995); | ||
2346 | |||
1848 | return ret; | 2347 | return ret; |
1849 | } | 2348 | } |
1850 | 2349 | ||
1851 | static __devexit int wm8995_i2c_remove(struct i2c_client *client) | 2350 | static __devexit int wm8995_i2c_remove(struct i2c_client *client) |
1852 | { | 2351 | { |
2352 | struct wm8995_priv *wm8995 = i2c_get_clientdata(client); | ||
2353 | |||
1853 | snd_soc_unregister_codec(&client->dev); | 2354 | snd_soc_unregister_codec(&client->dev); |
1854 | kfree(i2c_get_clientdata(client)); | 2355 | regmap_exit(wm8995->regmap); |
2356 | kfree(wm8995); | ||
1855 | return 0; | 2357 | return 0; |
1856 | } | 2358 | } |
1857 | 2359 | ||
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 645c980d6b8..d8da10fe5b5 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/gcd.h> | 19 | #include <linux/gcd.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/regmap.h> | ||
22 | #include <linux/regulator/consumer.h> | 23 | #include <linux/regulator/consumer.h> |
23 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
24 | #include <linux/workqueue.h> | 25 | #include <linux/workqueue.h> |
@@ -49,6 +50,8 @@ static const char *wm8996_supply_names[WM8996_NUM_SUPPLIES] = { | |||
49 | }; | 50 | }; |
50 | 51 | ||
51 | struct wm8996_priv { | 52 | struct wm8996_priv { |
53 | struct device *dev; | ||
54 | struct regmap *regmap; | ||
52 | struct snd_soc_codec *codec; | 55 | struct snd_soc_codec *codec; |
53 | 56 | ||
54 | int ldo1ena; | 57 | int ldo1ena; |
@@ -105,7 +108,7 @@ static int wm8996_regulator_event_##n(struct notifier_block *nb, \ | |||
105 | struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \ | 108 | struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \ |
106 | disable_nb[n]); \ | 109 | disable_nb[n]); \ |
107 | if (event & REGULATOR_EVENT_DISABLE) { \ | 110 | if (event & REGULATOR_EVENT_DISABLE) { \ |
108 | wm8996->codec->cache_sync = 1; \ | 111 | regcache_cache_only(wm8996->regmap, true); \ |
109 | } \ | 112 | } \ |
110 | return 0; \ | 113 | return 0; \ |
111 | } | 114 | } |
@@ -114,297 +117,365 @@ WM8996_REGULATOR_EVENT(0) | |||
114 | WM8996_REGULATOR_EVENT(1) | 117 | WM8996_REGULATOR_EVENT(1) |
115 | WM8996_REGULATOR_EVENT(2) | 118 | WM8996_REGULATOR_EVENT(2) |
116 | 119 | ||
117 | static const u16 wm8996_reg[WM8996_MAX_REGISTER] = { | 120 | static struct reg_default wm8996_reg[] = { |
118 | [WM8996_SOFTWARE_RESET] = 0x8996, | 121 | { WM8996_SOFTWARE_RESET, 0x8996 }, |
119 | [WM8996_POWER_MANAGEMENT_7] = 0x10, | 122 | { WM8996_POWER_MANAGEMENT_1, 0x0 }, |
120 | [WM8996_DAC1_HPOUT1_VOLUME] = 0x88, | 123 | { WM8996_POWER_MANAGEMENT_2, 0x0 }, |
121 | [WM8996_DAC2_HPOUT2_VOLUME] = 0x88, | 124 | { WM8996_POWER_MANAGEMENT_3, 0x0 }, |
122 | [WM8996_DAC1_LEFT_VOLUME] = 0x2c0, | 125 | { WM8996_POWER_MANAGEMENT_4, 0x0 }, |
123 | [WM8996_DAC1_RIGHT_VOLUME] = 0x2c0, | 126 | { WM8996_POWER_MANAGEMENT_5, 0x0 }, |
124 | [WM8996_DAC2_LEFT_VOLUME] = 0x2c0, | 127 | { WM8996_POWER_MANAGEMENT_6, 0x0 }, |
125 | [WM8996_DAC2_RIGHT_VOLUME] = 0x2c0, | 128 | { WM8996_POWER_MANAGEMENT_7, 0x10 }, |
126 | [WM8996_OUTPUT1_LEFT_VOLUME] = 0x80, | 129 | { WM8996_POWER_MANAGEMENT_8, 0x0 }, |
127 | [WM8996_OUTPUT1_RIGHT_VOLUME] = 0x80, | 130 | { WM8996_LEFT_LINE_INPUT_VOLUME, 0x0 }, |
128 | [WM8996_OUTPUT2_LEFT_VOLUME] = 0x80, | 131 | { WM8996_RIGHT_LINE_INPUT_VOLUME, 0x0 }, |
129 | [WM8996_OUTPUT2_RIGHT_VOLUME] = 0x80, | 132 | { WM8996_LINE_INPUT_CONTROL, 0x0 }, |
130 | [WM8996_MICBIAS_1] = 0x39, | 133 | { WM8996_DAC1_HPOUT1_VOLUME, 0x88 }, |
131 | [WM8996_MICBIAS_2] = 0x39, | 134 | { WM8996_DAC2_HPOUT2_VOLUME, 0x88 }, |
132 | [WM8996_LDO_1] = 0x3, | 135 | { WM8996_DAC1_LEFT_VOLUME, 0x2c0 }, |
133 | [WM8996_LDO_2] = 0x13, | 136 | { WM8996_DAC1_RIGHT_VOLUME, 0x2c0 }, |
134 | [WM8996_ACCESSORY_DETECT_MODE_1] = 0x4, | 137 | { WM8996_DAC2_LEFT_VOLUME, 0x2c0 }, |
135 | [WM8996_HEADPHONE_DETECT_1] = 0x20, | 138 | { WM8996_DAC2_RIGHT_VOLUME, 0x2c0 }, |
136 | [WM8996_MIC_DETECT_1] = 0x7600, | 139 | { WM8996_OUTPUT1_LEFT_VOLUME, 0x80 }, |
137 | [WM8996_MIC_DETECT_2] = 0xbf, | 140 | { WM8996_OUTPUT1_RIGHT_VOLUME, 0x80 }, |
138 | [WM8996_CHARGE_PUMP_1] = 0x1f25, | 141 | { WM8996_OUTPUT2_LEFT_VOLUME, 0x80 }, |
139 | [WM8996_CHARGE_PUMP_2] = 0xab19, | 142 | { WM8996_OUTPUT2_RIGHT_VOLUME, 0x80 }, |
140 | [WM8996_DC_SERVO_5] = 0x2a2a, | 143 | { WM8996_MICBIAS_1, 0x39 }, |
141 | [WM8996_CONTROL_INTERFACE_1] = 0x8004, | 144 | { WM8996_MICBIAS_2, 0x39 }, |
142 | [WM8996_CLOCKING_1] = 0x10, | 145 | { WM8996_LDO_1, 0x3 }, |
143 | [WM8996_AIF_RATE] = 0x83, | 146 | { WM8996_LDO_2, 0x13 }, |
144 | [WM8996_FLL_CONTROL_4] = 0x5dc0, | 147 | { WM8996_ACCESSORY_DETECT_MODE_1, 0x4 }, |
145 | [WM8996_FLL_CONTROL_5] = 0xc84, | 148 | { WM8996_ACCESSORY_DETECT_MODE_2, 0x0 }, |
146 | [WM8996_FLL_EFS_2] = 0x2, | 149 | { WM8996_HEADPHONE_DETECT_1, 0x20 }, |
147 | [WM8996_AIF1_TX_LRCLK_1] = 0x80, | 150 | { WM8996_HEADPHONE_DETECT_2, 0x0 }, |
148 | [WM8996_AIF1_TX_LRCLK_2] = 0x8, | 151 | { WM8996_MIC_DETECT_1, 0x7600 }, |
149 | [WM8996_AIF1_RX_LRCLK_1] = 0x80, | 152 | { WM8996_MIC_DETECT_2, 0xbf }, |
150 | [WM8996_AIF1TX_DATA_CONFIGURATION_1] = 0x1818, | 153 | { WM8996_CHARGE_PUMP_1, 0x1f25 }, |
151 | [WM8996_AIF1RX_DATA_CONFIGURATION] = 0x1818, | 154 | { WM8996_CHARGE_PUMP_2, 0xab19 }, |
152 | [WM8996_AIF1TX_TEST] = 0x7, | 155 | { WM8996_DC_SERVO_1, 0x0 }, |
153 | [WM8996_AIF2_TX_LRCLK_1] = 0x80, | 156 | { WM8996_DC_SERVO_2, 0x0 }, |
154 | [WM8996_AIF2_TX_LRCLK_2] = 0x8, | 157 | { WM8996_DC_SERVO_3, 0x0 }, |
155 | [WM8996_AIF2_RX_LRCLK_1] = 0x80, | 158 | { WM8996_DC_SERVO_5, 0x2a2a }, |
156 | [WM8996_AIF2TX_DATA_CONFIGURATION_1] = 0x1818, | 159 | { WM8996_DC_SERVO_6, 0x0 }, |
157 | [WM8996_AIF2RX_DATA_CONFIGURATION] = 0x1818, | 160 | { WM8996_DC_SERVO_7, 0x0 }, |
158 | [WM8996_AIF2TX_TEST] = 0x1, | 161 | { WM8996_ANALOGUE_HP_1, 0x0 }, |
159 | [WM8996_DSP1_TX_LEFT_VOLUME] = 0xc0, | 162 | { WM8996_ANALOGUE_HP_2, 0x0 }, |
160 | [WM8996_DSP1_TX_RIGHT_VOLUME] = 0xc0, | 163 | { WM8996_CONTROL_INTERFACE_1, 0x8004 }, |
161 | [WM8996_DSP1_RX_LEFT_VOLUME] = 0xc0, | 164 | { WM8996_WRITE_SEQUENCER_CTRL_1, 0x0 }, |
162 | [WM8996_DSP1_RX_RIGHT_VOLUME] = 0xc0, | 165 | { WM8996_WRITE_SEQUENCER_CTRL_2, 0x0 }, |
163 | [WM8996_DSP1_TX_FILTERS] = 0x2000, | 166 | { WM8996_AIF_CLOCKING_1, 0x0 }, |
164 | [WM8996_DSP1_RX_FILTERS_1] = 0x200, | 167 | { WM8996_AIF_CLOCKING_2, 0x0 }, |
165 | [WM8996_DSP1_RX_FILTERS_2] = 0x10, | 168 | { WM8996_CLOCKING_1, 0x10 }, |
166 | [WM8996_DSP1_DRC_1] = 0x98, | 169 | { WM8996_CLOCKING_2, 0x0 }, |
167 | [WM8996_DSP1_DRC_2] = 0x845, | 170 | { WM8996_AIF_RATE, 0x83 }, |
168 | [WM8996_DSP1_RX_EQ_GAINS_1] = 0x6318, | 171 | { WM8996_FLL_CONTROL_1, 0x0 }, |
169 | [WM8996_DSP1_RX_EQ_GAINS_2] = 0x6300, | 172 | { WM8996_FLL_CONTROL_2, 0x0 }, |
170 | [WM8996_DSP1_RX_EQ_BAND_1_A] = 0xfca, | 173 | { WM8996_FLL_CONTROL_3, 0x0 }, |
171 | [WM8996_DSP1_RX_EQ_BAND_1_B] = 0x400, | 174 | { WM8996_FLL_CONTROL_4, 0x5dc0 }, |
172 | [WM8996_DSP1_RX_EQ_BAND_1_PG] = 0xd8, | 175 | { WM8996_FLL_CONTROL_5, 0xc84 }, |
173 | [WM8996_DSP1_RX_EQ_BAND_2_A] = 0x1eb5, | 176 | { WM8996_FLL_EFS_1, 0x0 }, |
174 | [WM8996_DSP1_RX_EQ_BAND_2_B] = 0xf145, | 177 | { WM8996_FLL_EFS_2, 0x2 }, |
175 | [WM8996_DSP1_RX_EQ_BAND_2_C] = 0xb75, | 178 | { WM8996_AIF1_CONTROL, 0x0 }, |
176 | [WM8996_DSP1_RX_EQ_BAND_2_PG] = 0x1c5, | 179 | { WM8996_AIF1_BCLK, 0x0 }, |
177 | [WM8996_DSP1_RX_EQ_BAND_3_A] = 0x1c58, | 180 | { WM8996_AIF1_TX_LRCLK_1, 0x80 }, |
178 | [WM8996_DSP1_RX_EQ_BAND_3_B] = 0xf373, | 181 | { WM8996_AIF1_TX_LRCLK_2, 0x8 }, |
179 | [WM8996_DSP1_RX_EQ_BAND_3_C] = 0xa54, | 182 | { WM8996_AIF1_RX_LRCLK_1, 0x80 }, |
180 | [WM8996_DSP1_RX_EQ_BAND_3_PG] = 0x558, | 183 | { WM8996_AIF1_RX_LRCLK_2, 0x0 }, |
181 | [WM8996_DSP1_RX_EQ_BAND_4_A] = 0x168e, | 184 | { WM8996_AIF1TX_DATA_CONFIGURATION_1, 0x1818 }, |
182 | [WM8996_DSP1_RX_EQ_BAND_4_B] = 0xf829, | 185 | { WM8996_AIF1TX_DATA_CONFIGURATION_2, 0 }, |
183 | [WM8996_DSP1_RX_EQ_BAND_4_C] = 0x7ad, | 186 | { WM8996_AIF1RX_DATA_CONFIGURATION, 0x1818 }, |
184 | [WM8996_DSP1_RX_EQ_BAND_4_PG] = 0x1103, | 187 | { WM8996_AIF1TX_CHANNEL_0_CONFIGURATION, 0x0 }, |
185 | [WM8996_DSP1_RX_EQ_BAND_5_A] = 0x564, | 188 | { WM8996_AIF1TX_CHANNEL_1_CONFIGURATION, 0x0 }, |
186 | [WM8996_DSP1_RX_EQ_BAND_5_B] = 0x559, | 189 | { WM8996_AIF1TX_CHANNEL_2_CONFIGURATION, 0x0 }, |
187 | [WM8996_DSP1_RX_EQ_BAND_5_PG] = 0x4000, | 190 | { WM8996_AIF1TX_CHANNEL_3_CONFIGURATION, 0x0 }, |
188 | [WM8996_DSP2_TX_LEFT_VOLUME] = 0xc0, | 191 | { WM8996_AIF1TX_CHANNEL_4_CONFIGURATION, 0x0 }, |
189 | [WM8996_DSP2_TX_RIGHT_VOLUME] = 0xc0, | 192 | { WM8996_AIF1TX_CHANNEL_5_CONFIGURATION, 0x0 }, |
190 | [WM8996_DSP2_RX_LEFT_VOLUME] = 0xc0, | 193 | { WM8996_AIF1RX_CHANNEL_0_CONFIGURATION, 0x0 }, |
191 | [WM8996_DSP2_RX_RIGHT_VOLUME] = 0xc0, | 194 | { WM8996_AIF1RX_CHANNEL_1_CONFIGURATION, 0x0 }, |
192 | [WM8996_DSP2_TX_FILTERS] = 0x2000, | 195 | { WM8996_AIF1RX_CHANNEL_2_CONFIGURATION, 0x0 }, |
193 | [WM8996_DSP2_RX_FILTERS_1] = 0x200, | 196 | { WM8996_AIF1RX_CHANNEL_3_CONFIGURATION, 0x0 }, |
194 | [WM8996_DSP2_RX_FILTERS_2] = 0x10, | 197 | { WM8996_AIF1RX_CHANNEL_4_CONFIGURATION, 0x0 }, |
195 | [WM8996_DSP2_DRC_1] = 0x98, | 198 | { WM8996_AIF1RX_CHANNEL_5_CONFIGURATION, 0x0 }, |
196 | [WM8996_DSP2_DRC_2] = 0x845, | 199 | { WM8996_AIF1RX_MONO_CONFIGURATION, 0x0 }, |
197 | [WM8996_DSP2_RX_EQ_GAINS_1] = 0x6318, | 200 | { WM8996_AIF1TX_TEST, 0x7 }, |
198 | [WM8996_DSP2_RX_EQ_GAINS_2] = 0x6300, | 201 | { WM8996_AIF2_CONTROL, 0x0 }, |
199 | [WM8996_DSP2_RX_EQ_BAND_1_A] = 0xfca, | 202 | { WM8996_AIF2_BCLK, 0x0 }, |
200 | [WM8996_DSP2_RX_EQ_BAND_1_B] = 0x400, | 203 | { WM8996_AIF2_TX_LRCLK_1, 0x80 }, |
201 | [WM8996_DSP2_RX_EQ_BAND_1_PG] = 0xd8, | 204 | { WM8996_AIF2_TX_LRCLK_2, 0x8 }, |
202 | [WM8996_DSP2_RX_EQ_BAND_2_A] = 0x1eb5, | 205 | { WM8996_AIF2_RX_LRCLK_1, 0x80 }, |
203 | [WM8996_DSP2_RX_EQ_BAND_2_B] = 0xf145, | 206 | { WM8996_AIF2_RX_LRCLK_2, 0x0 }, |
204 | [WM8996_DSP2_RX_EQ_BAND_2_C] = 0xb75, | 207 | { WM8996_AIF2TX_DATA_CONFIGURATION_1, 0x1818 }, |
205 | [WM8996_DSP2_RX_EQ_BAND_2_PG] = 0x1c5, | 208 | { WM8996_AIF2RX_DATA_CONFIGURATION, 0x1818 }, |
206 | [WM8996_DSP2_RX_EQ_BAND_3_A] = 0x1c58, | 209 | { WM8996_AIF2RX_DATA_CONFIGURATION, 0x0 }, |
207 | [WM8996_DSP2_RX_EQ_BAND_3_B] = 0xf373, | 210 | { WM8996_AIF2TX_CHANNEL_0_CONFIGURATION, 0x0 }, |
208 | [WM8996_DSP2_RX_EQ_BAND_3_C] = 0xa54, | 211 | { WM8996_AIF2TX_CHANNEL_1_CONFIGURATION, 0x0 }, |
209 | [WM8996_DSP2_RX_EQ_BAND_3_PG] = 0x558, | 212 | { WM8996_AIF2RX_CHANNEL_0_CONFIGURATION, 0x0 }, |
210 | [WM8996_DSP2_RX_EQ_BAND_4_A] = 0x168e, | 213 | { WM8996_AIF2RX_CHANNEL_1_CONFIGURATION, 0x0 }, |
211 | [WM8996_DSP2_RX_EQ_BAND_4_B] = 0xf829, | 214 | { WM8996_AIF2RX_MONO_CONFIGURATION, 0x0 }, |
212 | [WM8996_DSP2_RX_EQ_BAND_4_C] = 0x7ad, | 215 | { WM8996_AIF2TX_TEST, 0x1 }, |
213 | [WM8996_DSP2_RX_EQ_BAND_4_PG] = 0x1103, | 216 | { WM8996_DSP1_TX_LEFT_VOLUME, 0xc0 }, |
214 | [WM8996_DSP2_RX_EQ_BAND_5_A] = 0x564, | 217 | { WM8996_DSP1_TX_RIGHT_VOLUME, 0xc0 }, |
215 | [WM8996_DSP2_RX_EQ_BAND_5_B] = 0x559, | 218 | { WM8996_DSP1_RX_LEFT_VOLUME, 0xc0 }, |
216 | [WM8996_DSP2_RX_EQ_BAND_5_PG] = 0x4000, | 219 | { WM8996_DSP1_RX_RIGHT_VOLUME, 0xc0 }, |
217 | [WM8996_OVERSAMPLING] = 0xd, | 220 | { WM8996_DSP1_TX_FILTERS, 0x2000 }, |
218 | [WM8996_SIDETONE] = 0x1040, | 221 | { WM8996_DSP1_RX_FILTERS_1, 0x200 }, |
219 | [WM8996_GPIO_1] = 0xa101, | 222 | { WM8996_DSP1_RX_FILTERS_2, 0x10 }, |
220 | [WM8996_GPIO_2] = 0xa101, | 223 | { WM8996_DSP1_DRC_1, 0x98 }, |
221 | [WM8996_GPIO_3] = 0xa101, | 224 | { WM8996_DSP1_DRC_2, 0x845 }, |
222 | [WM8996_GPIO_4] = 0xa101, | 225 | { WM8996_DSP1_RX_EQ_GAINS_1, 0x6318 }, |
223 | [WM8996_GPIO_5] = 0xa101, | 226 | { WM8996_DSP1_RX_EQ_GAINS_2, 0x6300 }, |
224 | [WM8996_PULL_CONTROL_2] = 0x140, | 227 | { WM8996_DSP1_RX_EQ_BAND_1_A, 0xfca }, |
225 | [WM8996_INTERRUPT_STATUS_1_MASK] = 0x1f, | 228 | { WM8996_DSP1_RX_EQ_BAND_1_B, 0x400 }, |
226 | [WM8996_INTERRUPT_STATUS_2_MASK] = 0x1ecf, | 229 | { WM8996_DSP1_RX_EQ_BAND_1_PG, 0xd8 }, |
227 | [WM8996_RIGHT_PDM_SPEAKER] = 0x1, | 230 | { WM8996_DSP1_RX_EQ_BAND_2_A, 0x1eb5 }, |
228 | [WM8996_PDM_SPEAKER_MUTE_SEQUENCE] = 0x69, | 231 | { WM8996_DSP1_RX_EQ_BAND_2_B, 0xf145 }, |
229 | [WM8996_PDM_SPEAKER_VOLUME] = 0x66, | 232 | { WM8996_DSP1_RX_EQ_BAND_2_C, 0xb75 }, |
230 | [WM8996_WRITE_SEQUENCER_0] = 0x1, | 233 | { WM8996_DSP1_RX_EQ_BAND_2_PG, 0x1c5 }, |
231 | [WM8996_WRITE_SEQUENCER_1] = 0x1, | 234 | { WM8996_DSP1_RX_EQ_BAND_3_A, 0x1c58 }, |
232 | [WM8996_WRITE_SEQUENCER_3] = 0x6, | 235 | { WM8996_DSP1_RX_EQ_BAND_3_B, 0xf373 }, |
233 | [WM8996_WRITE_SEQUENCER_4] = 0x40, | 236 | { WM8996_DSP1_RX_EQ_BAND_3_C, 0xa54 }, |
234 | [WM8996_WRITE_SEQUENCER_5] = 0x1, | 237 | { WM8996_DSP1_RX_EQ_BAND_3_PG, 0x558 }, |
235 | [WM8996_WRITE_SEQUENCER_6] = 0xf, | 238 | { WM8996_DSP1_RX_EQ_BAND_4_A, 0x168e }, |
236 | [WM8996_WRITE_SEQUENCER_7] = 0x6, | 239 | { WM8996_DSP1_RX_EQ_BAND_4_B, 0xf829 }, |
237 | [WM8996_WRITE_SEQUENCER_8] = 0x1, | 240 | { WM8996_DSP1_RX_EQ_BAND_4_C, 0x7ad }, |
238 | [WM8996_WRITE_SEQUENCER_9] = 0x3, | 241 | { WM8996_DSP1_RX_EQ_BAND_4_PG, 0x1103 }, |
239 | [WM8996_WRITE_SEQUENCER_10] = 0x104, | 242 | { WM8996_DSP1_RX_EQ_BAND_5_A, 0x564 }, |
240 | [WM8996_WRITE_SEQUENCER_12] = 0x60, | 243 | { WM8996_DSP1_RX_EQ_BAND_5_B, 0x559 }, |
241 | [WM8996_WRITE_SEQUENCER_13] = 0x11, | 244 | { WM8996_DSP1_RX_EQ_BAND_5_PG, 0x4000 }, |
242 | [WM8996_WRITE_SEQUENCER_14] = 0x401, | 245 | { WM8996_DSP2_TX_LEFT_VOLUME, 0xc0 }, |
243 | [WM8996_WRITE_SEQUENCER_16] = 0x50, | 246 | { WM8996_DSP2_TX_RIGHT_VOLUME, 0xc0 }, |
244 | [WM8996_WRITE_SEQUENCER_17] = 0x3, | 247 | { WM8996_DSP2_RX_LEFT_VOLUME, 0xc0 }, |
245 | [WM8996_WRITE_SEQUENCER_18] = 0x100, | 248 | { WM8996_DSP2_RX_RIGHT_VOLUME, 0xc0 }, |
246 | [WM8996_WRITE_SEQUENCER_20] = 0x51, | 249 | { WM8996_DSP2_TX_FILTERS, 0x2000 }, |
247 | [WM8996_WRITE_SEQUENCER_21] = 0x3, | 250 | { WM8996_DSP2_RX_FILTERS_1, 0x200 }, |
248 | [WM8996_WRITE_SEQUENCER_22] = 0x104, | 251 | { WM8996_DSP2_RX_FILTERS_2, 0x10 }, |
249 | [WM8996_WRITE_SEQUENCER_23] = 0xa, | 252 | { WM8996_DSP2_DRC_1, 0x98 }, |
250 | [WM8996_WRITE_SEQUENCER_24] = 0x60, | 253 | { WM8996_DSP2_DRC_2, 0x845 }, |
251 | [WM8996_WRITE_SEQUENCER_25] = 0x3b, | 254 | { WM8996_DSP2_RX_EQ_GAINS_1, 0x6318 }, |
252 | [WM8996_WRITE_SEQUENCER_26] = 0x502, | 255 | { WM8996_DSP2_RX_EQ_GAINS_2, 0x6300 }, |
253 | [WM8996_WRITE_SEQUENCER_27] = 0x100, | 256 | { WM8996_DSP2_RX_EQ_BAND_1_A, 0xfca }, |
254 | [WM8996_WRITE_SEQUENCER_28] = 0x2fff, | 257 | { WM8996_DSP2_RX_EQ_BAND_1_B, 0x400 }, |
255 | [WM8996_WRITE_SEQUENCER_32] = 0x2fff, | 258 | { WM8996_DSP2_RX_EQ_BAND_1_PG, 0xd8 }, |
256 | [WM8996_WRITE_SEQUENCER_36] = 0x2fff, | 259 | { WM8996_DSP2_RX_EQ_BAND_2_A, 0x1eb5 }, |
257 | [WM8996_WRITE_SEQUENCER_40] = 0x2fff, | 260 | { WM8996_DSP2_RX_EQ_BAND_2_B, 0xf145 }, |
258 | [WM8996_WRITE_SEQUENCER_44] = 0x2fff, | 261 | { WM8996_DSP2_RX_EQ_BAND_2_C, 0xb75 }, |
259 | [WM8996_WRITE_SEQUENCER_48] = 0x2fff, | 262 | { WM8996_DSP2_RX_EQ_BAND_2_PG, 0x1c5 }, |
260 | [WM8996_WRITE_SEQUENCER_52] = 0x2fff, | 263 | { WM8996_DSP2_RX_EQ_BAND_3_A, 0x1c58 }, |
261 | [WM8996_WRITE_SEQUENCER_56] = 0x2fff, | 264 | { WM8996_DSP2_RX_EQ_BAND_3_B, 0xf373 }, |
262 | [WM8996_WRITE_SEQUENCER_60] = 0x2fff, | 265 | { WM8996_DSP2_RX_EQ_BAND_3_C, 0xa54 }, |
263 | [WM8996_WRITE_SEQUENCER_64] = 0x1, | 266 | { WM8996_DSP2_RX_EQ_BAND_3_PG, 0x558 }, |
264 | [WM8996_WRITE_SEQUENCER_65] = 0x1, | 267 | { WM8996_DSP2_RX_EQ_BAND_4_A, 0x168e }, |
265 | [WM8996_WRITE_SEQUENCER_67] = 0x6, | 268 | { WM8996_DSP2_RX_EQ_BAND_4_B, 0xf829 }, |
266 | [WM8996_WRITE_SEQUENCER_68] = 0x40, | 269 | { WM8996_DSP2_RX_EQ_BAND_4_C, 0x7ad }, |
267 | [WM8996_WRITE_SEQUENCER_69] = 0x1, | 270 | { WM8996_DSP2_RX_EQ_BAND_4_PG, 0x1103 }, |
268 | [WM8996_WRITE_SEQUENCER_70] = 0xf, | 271 | { WM8996_DSP2_RX_EQ_BAND_5_A, 0x564 }, |
269 | [WM8996_WRITE_SEQUENCER_71] = 0x6, | 272 | { WM8996_DSP2_RX_EQ_BAND_5_B, 0x559 }, |
270 | [WM8996_WRITE_SEQUENCER_72] = 0x1, | 273 | { WM8996_DSP2_RX_EQ_BAND_5_PG, 0x4000 }, |
271 | [WM8996_WRITE_SEQUENCER_73] = 0x3, | 274 | { WM8996_DAC1_MIXER_VOLUMES, 0x0 }, |
272 | [WM8996_WRITE_SEQUENCER_74] = 0x104, | 275 | { WM8996_DAC1_LEFT_MIXER_ROUTING, 0x0 }, |
273 | [WM8996_WRITE_SEQUENCER_76] = 0x60, | 276 | { WM8996_DAC1_RIGHT_MIXER_ROUTING, 0x0 }, |
274 | [WM8996_WRITE_SEQUENCER_77] = 0x11, | 277 | { WM8996_DAC2_MIXER_VOLUMES, 0x0 }, |
275 | [WM8996_WRITE_SEQUENCER_78] = 0x401, | 278 | { WM8996_DAC2_LEFT_MIXER_ROUTING, 0x0 }, |
276 | [WM8996_WRITE_SEQUENCER_80] = 0x50, | 279 | { WM8996_DAC2_RIGHT_MIXER_ROUTING, 0x0 }, |
277 | [WM8996_WRITE_SEQUENCER_81] = 0x3, | 280 | { WM8996_DSP1_TX_LEFT_MIXER_ROUTING, 0x0 }, |
278 | [WM8996_WRITE_SEQUENCER_82] = 0x100, | 281 | { WM8996_DSP1_TX_RIGHT_MIXER_ROUTING, 0x0 }, |
279 | [WM8996_WRITE_SEQUENCER_84] = 0x60, | 282 | { WM8996_DSP2_TX_LEFT_MIXER_ROUTING, 0x0 }, |
280 | [WM8996_WRITE_SEQUENCER_85] = 0x3b, | 283 | { WM8996_DSP2_TX_RIGHT_MIXER_ROUTING, 0x0 }, |
281 | [WM8996_WRITE_SEQUENCER_86] = 0x502, | 284 | { WM8996_DSP_TX_MIXER_SELECT, 0x0 }, |
282 | [WM8996_WRITE_SEQUENCER_87] = 0x100, | 285 | { WM8996_DAC_SOFTMUTE, 0x0 }, |
283 | [WM8996_WRITE_SEQUENCER_88] = 0x2fff, | 286 | { WM8996_OVERSAMPLING, 0xd }, |
284 | [WM8996_WRITE_SEQUENCER_92] = 0x2fff, | 287 | { WM8996_SIDETONE, 0x1040 }, |
285 | [WM8996_WRITE_SEQUENCER_96] = 0x2fff, | 288 | { WM8996_GPIO_1, 0xa101 }, |
286 | [WM8996_WRITE_SEQUENCER_100] = 0x2fff, | 289 | { WM8996_GPIO_2, 0xa101 }, |
287 | [WM8996_WRITE_SEQUENCER_104] = 0x2fff, | 290 | { WM8996_GPIO_3, 0xa101 }, |
288 | [WM8996_WRITE_SEQUENCER_108] = 0x2fff, | 291 | { WM8996_GPIO_4, 0xa101 }, |
289 | [WM8996_WRITE_SEQUENCER_112] = 0x2fff, | 292 | { WM8996_GPIO_5, 0xa101 }, |
290 | [WM8996_WRITE_SEQUENCER_116] = 0x2fff, | 293 | { WM8996_PULL_CONTROL_1, 0x0 }, |
291 | [WM8996_WRITE_SEQUENCER_120] = 0x2fff, | 294 | { WM8996_PULL_CONTROL_2, 0x140 }, |
292 | [WM8996_WRITE_SEQUENCER_124] = 0x2fff, | 295 | { WM8996_INTERRUPT_STATUS_1_MASK, 0x1f }, |
293 | [WM8996_WRITE_SEQUENCER_128] = 0x1, | 296 | { WM8996_INTERRUPT_STATUS_2_MASK, 0x1ecf }, |
294 | [WM8996_WRITE_SEQUENCER_129] = 0x1, | 297 | { WM8996_LEFT_PDM_SPEAKER, 0x0 }, |
295 | [WM8996_WRITE_SEQUENCER_131] = 0x6, | 298 | { WM8996_RIGHT_PDM_SPEAKER, 0x1 }, |
296 | [WM8996_WRITE_SEQUENCER_132] = 0x40, | 299 | { WM8996_PDM_SPEAKER_MUTE_SEQUENCE, 0x69 }, |
297 | [WM8996_WRITE_SEQUENCER_133] = 0x1, | 300 | { WM8996_PDM_SPEAKER_VOLUME, 0x66 }, |
298 | [WM8996_WRITE_SEQUENCER_134] = 0xf, | 301 | { WM8996_WRITE_SEQUENCER_0, 0x1 }, |
299 | [WM8996_WRITE_SEQUENCER_135] = 0x6, | 302 | { WM8996_WRITE_SEQUENCER_1, 0x1 }, |
300 | [WM8996_WRITE_SEQUENCER_136] = 0x1, | 303 | { WM8996_WRITE_SEQUENCER_3, 0x6 }, |
301 | [WM8996_WRITE_SEQUENCER_137] = 0x3, | 304 | { WM8996_WRITE_SEQUENCER_4, 0x40 }, |
302 | [WM8996_WRITE_SEQUENCER_138] = 0x106, | 305 | { WM8996_WRITE_SEQUENCER_5, 0x1 }, |
303 | [WM8996_WRITE_SEQUENCER_140] = 0x61, | 306 | { WM8996_WRITE_SEQUENCER_6, 0xf }, |
304 | [WM8996_WRITE_SEQUENCER_141] = 0x11, | 307 | { WM8996_WRITE_SEQUENCER_7, 0x6 }, |
305 | [WM8996_WRITE_SEQUENCER_142] = 0x401, | 308 | { WM8996_WRITE_SEQUENCER_8, 0x1 }, |
306 | [WM8996_WRITE_SEQUENCER_144] = 0x50, | 309 | { WM8996_WRITE_SEQUENCER_9, 0x3 }, |
307 | [WM8996_WRITE_SEQUENCER_145] = 0x3, | 310 | { WM8996_WRITE_SEQUENCER_10, 0x104 }, |
308 | [WM8996_WRITE_SEQUENCER_146] = 0x102, | 311 | { WM8996_WRITE_SEQUENCER_12, 0x60 }, |
309 | [WM8996_WRITE_SEQUENCER_148] = 0x51, | 312 | { WM8996_WRITE_SEQUENCER_13, 0x11 }, |
310 | [WM8996_WRITE_SEQUENCER_149] = 0x3, | 313 | { WM8996_WRITE_SEQUENCER_14, 0x401 }, |
311 | [WM8996_WRITE_SEQUENCER_150] = 0x106, | 314 | { WM8996_WRITE_SEQUENCER_16, 0x50 }, |
312 | [WM8996_WRITE_SEQUENCER_151] = 0xa, | 315 | { WM8996_WRITE_SEQUENCER_17, 0x3 }, |
313 | [WM8996_WRITE_SEQUENCER_152] = 0x61, | 316 | { WM8996_WRITE_SEQUENCER_18, 0x100 }, |
314 | [WM8996_WRITE_SEQUENCER_153] = 0x3b, | 317 | { WM8996_WRITE_SEQUENCER_20, 0x51 }, |
315 | [WM8996_WRITE_SEQUENCER_154] = 0x502, | 318 | { WM8996_WRITE_SEQUENCER_21, 0x3 }, |
316 | [WM8996_WRITE_SEQUENCER_155] = 0x100, | 319 | { WM8996_WRITE_SEQUENCER_22, 0x104 }, |
317 | [WM8996_WRITE_SEQUENCER_156] = 0x2fff, | 320 | { WM8996_WRITE_SEQUENCER_23, 0xa }, |
318 | [WM8996_WRITE_SEQUENCER_160] = 0x2fff, | 321 | { WM8996_WRITE_SEQUENCER_24, 0x60 }, |
319 | [WM8996_WRITE_SEQUENCER_164] = 0x2fff, | 322 | { WM8996_WRITE_SEQUENCER_25, 0x3b }, |
320 | [WM8996_WRITE_SEQUENCER_168] = 0x2fff, | 323 | { WM8996_WRITE_SEQUENCER_26, 0x502 }, |
321 | [WM8996_WRITE_SEQUENCER_172] = 0x2fff, | 324 | { WM8996_WRITE_SEQUENCER_27, 0x100 }, |
322 | [WM8996_WRITE_SEQUENCER_176] = 0x2fff, | 325 | { WM8996_WRITE_SEQUENCER_28, 0x2fff }, |
323 | [WM8996_WRITE_SEQUENCER_180] = 0x2fff, | 326 | { WM8996_WRITE_SEQUENCER_32, 0x2fff }, |
324 | [WM8996_WRITE_SEQUENCER_184] = 0x2fff, | 327 | { WM8996_WRITE_SEQUENCER_36, 0x2fff }, |
325 | [WM8996_WRITE_SEQUENCER_188] = 0x2fff, | 328 | { WM8996_WRITE_SEQUENCER_40, 0x2fff }, |
326 | [WM8996_WRITE_SEQUENCER_192] = 0x1, | 329 | { WM8996_WRITE_SEQUENCER_44, 0x2fff }, |
327 | [WM8996_WRITE_SEQUENCER_193] = 0x1, | 330 | { WM8996_WRITE_SEQUENCER_48, 0x2fff }, |
328 | [WM8996_WRITE_SEQUENCER_195] = 0x6, | 331 | { WM8996_WRITE_SEQUENCER_52, 0x2fff }, |
329 | [WM8996_WRITE_SEQUENCER_196] = 0x40, | 332 | { WM8996_WRITE_SEQUENCER_56, 0x2fff }, |
330 | [WM8996_WRITE_SEQUENCER_197] = 0x1, | 333 | { WM8996_WRITE_SEQUENCER_60, 0x2fff }, |
331 | [WM8996_WRITE_SEQUENCER_198] = 0xf, | 334 | { WM8996_WRITE_SEQUENCER_64, 0x1 }, |
332 | [WM8996_WRITE_SEQUENCER_199] = 0x6, | 335 | { WM8996_WRITE_SEQUENCER_65, 0x1 }, |
333 | [WM8996_WRITE_SEQUENCER_200] = 0x1, | 336 | { WM8996_WRITE_SEQUENCER_67, 0x6 }, |
334 | [WM8996_WRITE_SEQUENCER_201] = 0x3, | 337 | { WM8996_WRITE_SEQUENCER_68, 0x40 }, |
335 | [WM8996_WRITE_SEQUENCER_202] = 0x106, | 338 | { WM8996_WRITE_SEQUENCER_69, 0x1 }, |
336 | [WM8996_WRITE_SEQUENCER_204] = 0x61, | 339 | { WM8996_WRITE_SEQUENCER_70, 0xf }, |
337 | [WM8996_WRITE_SEQUENCER_205] = 0x11, | 340 | { WM8996_WRITE_SEQUENCER_71, 0x6 }, |
338 | [WM8996_WRITE_SEQUENCER_206] = 0x401, | 341 | { WM8996_WRITE_SEQUENCER_72, 0x1 }, |
339 | [WM8996_WRITE_SEQUENCER_208] = 0x50, | 342 | { WM8996_WRITE_SEQUENCER_73, 0x3 }, |
340 | [WM8996_WRITE_SEQUENCER_209] = 0x3, | 343 | { WM8996_WRITE_SEQUENCER_74, 0x104 }, |
341 | [WM8996_WRITE_SEQUENCER_210] = 0x102, | 344 | { WM8996_WRITE_SEQUENCER_76, 0x60 }, |
342 | [WM8996_WRITE_SEQUENCER_212] = 0x61, | 345 | { WM8996_WRITE_SEQUENCER_77, 0x11 }, |
343 | [WM8996_WRITE_SEQUENCER_213] = 0x3b, | 346 | { WM8996_WRITE_SEQUENCER_78, 0x401 }, |
344 | [WM8996_WRITE_SEQUENCER_214] = 0x502, | 347 | { WM8996_WRITE_SEQUENCER_80, 0x50 }, |
345 | [WM8996_WRITE_SEQUENCER_215] = 0x100, | 348 | { WM8996_WRITE_SEQUENCER_81, 0x3 }, |
346 | [WM8996_WRITE_SEQUENCER_216] = 0x2fff, | 349 | { WM8996_WRITE_SEQUENCER_82, 0x100 }, |
347 | [WM8996_WRITE_SEQUENCER_220] = 0x2fff, | 350 | { WM8996_WRITE_SEQUENCER_84, 0x60 }, |
348 | [WM8996_WRITE_SEQUENCER_224] = 0x2fff, | 351 | { WM8996_WRITE_SEQUENCER_85, 0x3b }, |
349 | [WM8996_WRITE_SEQUENCER_228] = 0x2fff, | 352 | { WM8996_WRITE_SEQUENCER_86, 0x502 }, |
350 | [WM8996_WRITE_SEQUENCER_232] = 0x2fff, | 353 | { WM8996_WRITE_SEQUENCER_87, 0x100 }, |
351 | [WM8996_WRITE_SEQUENCER_236] = 0x2fff, | 354 | { WM8996_WRITE_SEQUENCER_88, 0x2fff }, |
352 | [WM8996_WRITE_SEQUENCER_240] = 0x2fff, | 355 | { WM8996_WRITE_SEQUENCER_92, 0x2fff }, |
353 | [WM8996_WRITE_SEQUENCER_244] = 0x2fff, | 356 | { WM8996_WRITE_SEQUENCER_96, 0x2fff }, |
354 | [WM8996_WRITE_SEQUENCER_248] = 0x2fff, | 357 | { WM8996_WRITE_SEQUENCER_100, 0x2fff }, |
355 | [WM8996_WRITE_SEQUENCER_252] = 0x2fff, | 358 | { WM8996_WRITE_SEQUENCER_104, 0x2fff }, |
356 | [WM8996_WRITE_SEQUENCER_256] = 0x60, | 359 | { WM8996_WRITE_SEQUENCER_108, 0x2fff }, |
357 | [WM8996_WRITE_SEQUENCER_258] = 0x601, | 360 | { WM8996_WRITE_SEQUENCER_112, 0x2fff }, |
358 | [WM8996_WRITE_SEQUENCER_260] = 0x50, | 361 | { WM8996_WRITE_SEQUENCER_116, 0x2fff }, |
359 | [WM8996_WRITE_SEQUENCER_262] = 0x100, | 362 | { WM8996_WRITE_SEQUENCER_120, 0x2fff }, |
360 | [WM8996_WRITE_SEQUENCER_264] = 0x1, | 363 | { WM8996_WRITE_SEQUENCER_124, 0x2fff }, |
361 | [WM8996_WRITE_SEQUENCER_266] = 0x104, | 364 | { WM8996_WRITE_SEQUENCER_128, 0x1 }, |
362 | [WM8996_WRITE_SEQUENCER_267] = 0x100, | 365 | { WM8996_WRITE_SEQUENCER_129, 0x1 }, |
363 | [WM8996_WRITE_SEQUENCER_268] = 0x2fff, | 366 | { WM8996_WRITE_SEQUENCER_131, 0x6 }, |
364 | [WM8996_WRITE_SEQUENCER_272] = 0x2fff, | 367 | { WM8996_WRITE_SEQUENCER_132, 0x40 }, |
365 | [WM8996_WRITE_SEQUENCER_276] = 0x2fff, | 368 | { WM8996_WRITE_SEQUENCER_133, 0x1 }, |
366 | [WM8996_WRITE_SEQUENCER_280] = 0x2fff, | 369 | { WM8996_WRITE_SEQUENCER_134, 0xf }, |
367 | [WM8996_WRITE_SEQUENCER_284] = 0x2fff, | 370 | { WM8996_WRITE_SEQUENCER_135, 0x6 }, |
368 | [WM8996_WRITE_SEQUENCER_288] = 0x2fff, | 371 | { WM8996_WRITE_SEQUENCER_136, 0x1 }, |
369 | [WM8996_WRITE_SEQUENCER_292] = 0x2fff, | 372 | { WM8996_WRITE_SEQUENCER_137, 0x3 }, |
370 | [WM8996_WRITE_SEQUENCER_296] = 0x2fff, | 373 | { WM8996_WRITE_SEQUENCER_138, 0x106 }, |
371 | [WM8996_WRITE_SEQUENCER_300] = 0x2fff, | 374 | { WM8996_WRITE_SEQUENCER_140, 0x61 }, |
372 | [WM8996_WRITE_SEQUENCER_304] = 0x2fff, | 375 | { WM8996_WRITE_SEQUENCER_141, 0x11 }, |
373 | [WM8996_WRITE_SEQUENCER_308] = 0x2fff, | 376 | { WM8996_WRITE_SEQUENCER_142, 0x401 }, |
374 | [WM8996_WRITE_SEQUENCER_312] = 0x2fff, | 377 | { WM8996_WRITE_SEQUENCER_144, 0x50 }, |
375 | [WM8996_WRITE_SEQUENCER_316] = 0x2fff, | 378 | { WM8996_WRITE_SEQUENCER_145, 0x3 }, |
376 | [WM8996_WRITE_SEQUENCER_320] = 0x61, | 379 | { WM8996_WRITE_SEQUENCER_146, 0x102 }, |
377 | [WM8996_WRITE_SEQUENCER_322] = 0x601, | 380 | { WM8996_WRITE_SEQUENCER_148, 0x51 }, |
378 | [WM8996_WRITE_SEQUENCER_324] = 0x50, | 381 | { WM8996_WRITE_SEQUENCER_149, 0x3 }, |
379 | [WM8996_WRITE_SEQUENCER_326] = 0x102, | 382 | { WM8996_WRITE_SEQUENCER_150, 0x106 }, |
380 | [WM8996_WRITE_SEQUENCER_328] = 0x1, | 383 | { WM8996_WRITE_SEQUENCER_151, 0xa }, |
381 | [WM8996_WRITE_SEQUENCER_330] = 0x106, | 384 | { WM8996_WRITE_SEQUENCER_152, 0x61 }, |
382 | [WM8996_WRITE_SEQUENCER_331] = 0x100, | 385 | { WM8996_WRITE_SEQUENCER_153, 0x3b }, |
383 | [WM8996_WRITE_SEQUENCER_332] = 0x2fff, | 386 | { WM8996_WRITE_SEQUENCER_154, 0x502 }, |
384 | [WM8996_WRITE_SEQUENCER_336] = 0x2fff, | 387 | { WM8996_WRITE_SEQUENCER_155, 0x100 }, |
385 | [WM8996_WRITE_SEQUENCER_340] = 0x2fff, | 388 | { WM8996_WRITE_SEQUENCER_156, 0x2fff }, |
386 | [WM8996_WRITE_SEQUENCER_344] = 0x2fff, | 389 | { WM8996_WRITE_SEQUENCER_160, 0x2fff }, |
387 | [WM8996_WRITE_SEQUENCER_348] = 0x2fff, | 390 | { WM8996_WRITE_SEQUENCER_164, 0x2fff }, |
388 | [WM8996_WRITE_SEQUENCER_352] = 0x2fff, | 391 | { WM8996_WRITE_SEQUENCER_168, 0x2fff }, |
389 | [WM8996_WRITE_SEQUENCER_356] = 0x2fff, | 392 | { WM8996_WRITE_SEQUENCER_172, 0x2fff }, |
390 | [WM8996_WRITE_SEQUENCER_360] = 0x2fff, | 393 | { WM8996_WRITE_SEQUENCER_176, 0x2fff }, |
391 | [WM8996_WRITE_SEQUENCER_364] = 0x2fff, | 394 | { WM8996_WRITE_SEQUENCER_180, 0x2fff }, |
392 | [WM8996_WRITE_SEQUENCER_368] = 0x2fff, | 395 | { WM8996_WRITE_SEQUENCER_184, 0x2fff }, |
393 | [WM8996_WRITE_SEQUENCER_372] = 0x2fff, | 396 | { WM8996_WRITE_SEQUENCER_188, 0x2fff }, |
394 | [WM8996_WRITE_SEQUENCER_376] = 0x2fff, | 397 | { WM8996_WRITE_SEQUENCER_192, 0x1 }, |
395 | [WM8996_WRITE_SEQUENCER_380] = 0x2fff, | 398 | { WM8996_WRITE_SEQUENCER_193, 0x1 }, |
396 | [WM8996_WRITE_SEQUENCER_384] = 0x60, | 399 | { WM8996_WRITE_SEQUENCER_195, 0x6 }, |
397 | [WM8996_WRITE_SEQUENCER_386] = 0x601, | 400 | { WM8996_WRITE_SEQUENCER_196, 0x40 }, |
398 | [WM8996_WRITE_SEQUENCER_388] = 0x61, | 401 | { WM8996_WRITE_SEQUENCER_197, 0x1 }, |
399 | [WM8996_WRITE_SEQUENCER_390] = 0x601, | 402 | { WM8996_WRITE_SEQUENCER_198, 0xf }, |
400 | [WM8996_WRITE_SEQUENCER_392] = 0x50, | 403 | { WM8996_WRITE_SEQUENCER_199, 0x6 }, |
401 | [WM8996_WRITE_SEQUENCER_394] = 0x300, | 404 | { WM8996_WRITE_SEQUENCER_200, 0x1 }, |
402 | [WM8996_WRITE_SEQUENCER_396] = 0x1, | 405 | { WM8996_WRITE_SEQUENCER_201, 0x3 }, |
403 | [WM8996_WRITE_SEQUENCER_398] = 0x304, | 406 | { WM8996_WRITE_SEQUENCER_202, 0x106 }, |
404 | [WM8996_WRITE_SEQUENCER_400] = 0x40, | 407 | { WM8996_WRITE_SEQUENCER_204, 0x61 }, |
405 | [WM8996_WRITE_SEQUENCER_402] = 0xf, | 408 | { WM8996_WRITE_SEQUENCER_205, 0x11 }, |
406 | [WM8996_WRITE_SEQUENCER_404] = 0x1, | 409 | { WM8996_WRITE_SEQUENCER_206, 0x401 }, |
407 | [WM8996_WRITE_SEQUENCER_407] = 0x100, | 410 | { WM8996_WRITE_SEQUENCER_208, 0x50 }, |
411 | { WM8996_WRITE_SEQUENCER_209, 0x3 }, | ||
412 | { WM8996_WRITE_SEQUENCER_210, 0x102 }, | ||
413 | { WM8996_WRITE_SEQUENCER_212, 0x61 }, | ||
414 | { WM8996_WRITE_SEQUENCER_213, 0x3b }, | ||
415 | { WM8996_WRITE_SEQUENCER_214, 0x502 }, | ||
416 | { WM8996_WRITE_SEQUENCER_215, 0x100 }, | ||
417 | { WM8996_WRITE_SEQUENCER_216, 0x2fff }, | ||
418 | { WM8996_WRITE_SEQUENCER_220, 0x2fff }, | ||
419 | { WM8996_WRITE_SEQUENCER_224, 0x2fff }, | ||
420 | { WM8996_WRITE_SEQUENCER_228, 0x2fff }, | ||
421 | { WM8996_WRITE_SEQUENCER_232, 0x2fff }, | ||
422 | { WM8996_WRITE_SEQUENCER_236, 0x2fff }, | ||
423 | { WM8996_WRITE_SEQUENCER_240, 0x2fff }, | ||
424 | { WM8996_WRITE_SEQUENCER_244, 0x2fff }, | ||
425 | { WM8996_WRITE_SEQUENCER_248, 0x2fff }, | ||
426 | { WM8996_WRITE_SEQUENCER_252, 0x2fff }, | ||
427 | { WM8996_WRITE_SEQUENCER_256, 0x60 }, | ||
428 | { WM8996_WRITE_SEQUENCER_258, 0x601 }, | ||
429 | { WM8996_WRITE_SEQUENCER_260, 0x50 }, | ||
430 | { WM8996_WRITE_SEQUENCER_262, 0x100 }, | ||
431 | { WM8996_WRITE_SEQUENCER_264, 0x1 }, | ||
432 | { WM8996_WRITE_SEQUENCER_266, 0x104 }, | ||
433 | { WM8996_WRITE_SEQUENCER_267, 0x100 }, | ||
434 | { WM8996_WRITE_SEQUENCER_268, 0x2fff }, | ||
435 | { WM8996_WRITE_SEQUENCER_272, 0x2fff }, | ||
436 | { WM8996_WRITE_SEQUENCER_276, 0x2fff }, | ||
437 | { WM8996_WRITE_SEQUENCER_280, 0x2fff }, | ||
438 | { WM8996_WRITE_SEQUENCER_284, 0x2fff }, | ||
439 | { WM8996_WRITE_SEQUENCER_288, 0x2fff }, | ||
440 | { WM8996_WRITE_SEQUENCER_292, 0x2fff }, | ||
441 | { WM8996_WRITE_SEQUENCER_296, 0x2fff }, | ||
442 | { WM8996_WRITE_SEQUENCER_300, 0x2fff }, | ||
443 | { WM8996_WRITE_SEQUENCER_304, 0x2fff }, | ||
444 | { WM8996_WRITE_SEQUENCER_308, 0x2fff }, | ||
445 | { WM8996_WRITE_SEQUENCER_312, 0x2fff }, | ||
446 | { WM8996_WRITE_SEQUENCER_316, 0x2fff }, | ||
447 | { WM8996_WRITE_SEQUENCER_320, 0x61 }, | ||
448 | { WM8996_WRITE_SEQUENCER_322, 0x601 }, | ||
449 | { WM8996_WRITE_SEQUENCER_324, 0x50 }, | ||
450 | { WM8996_WRITE_SEQUENCER_326, 0x102 }, | ||
451 | { WM8996_WRITE_SEQUENCER_328, 0x1 }, | ||
452 | { WM8996_WRITE_SEQUENCER_330, 0x106 }, | ||
453 | { WM8996_WRITE_SEQUENCER_331, 0x100 }, | ||
454 | { WM8996_WRITE_SEQUENCER_332, 0x2fff }, | ||
455 | { WM8996_WRITE_SEQUENCER_336, 0x2fff }, | ||
456 | { WM8996_WRITE_SEQUENCER_340, 0x2fff }, | ||
457 | { WM8996_WRITE_SEQUENCER_344, 0x2fff }, | ||
458 | { WM8996_WRITE_SEQUENCER_348, 0x2fff }, | ||
459 | { WM8996_WRITE_SEQUENCER_352, 0x2fff }, | ||
460 | { WM8996_WRITE_SEQUENCER_356, 0x2fff }, | ||
461 | { WM8996_WRITE_SEQUENCER_360, 0x2fff }, | ||
462 | { WM8996_WRITE_SEQUENCER_364, 0x2fff }, | ||
463 | { WM8996_WRITE_SEQUENCER_368, 0x2fff }, | ||
464 | { WM8996_WRITE_SEQUENCER_372, 0x2fff }, | ||
465 | { WM8996_WRITE_SEQUENCER_376, 0x2fff }, | ||
466 | { WM8996_WRITE_SEQUENCER_380, 0x2fff }, | ||
467 | { WM8996_WRITE_SEQUENCER_384, 0x60 }, | ||
468 | { WM8996_WRITE_SEQUENCER_386, 0x601 }, | ||
469 | { WM8996_WRITE_SEQUENCER_388, 0x61 }, | ||
470 | { WM8996_WRITE_SEQUENCER_390, 0x601 }, | ||
471 | { WM8996_WRITE_SEQUENCER_392, 0x50 }, | ||
472 | { WM8996_WRITE_SEQUENCER_394, 0x300 }, | ||
473 | { WM8996_WRITE_SEQUENCER_396, 0x1 }, | ||
474 | { WM8996_WRITE_SEQUENCER_398, 0x304 }, | ||
475 | { WM8996_WRITE_SEQUENCER_400, 0x40 }, | ||
476 | { WM8996_WRITE_SEQUENCER_402, 0xf }, | ||
477 | { WM8996_WRITE_SEQUENCER_404, 0x1 }, | ||
478 | { WM8996_WRITE_SEQUENCER_407, 0x100 }, | ||
408 | }; | 479 | }; |
409 | 480 | ||
410 | static const DECLARE_TLV_DB_SCALE(inpga_tlv, 0, 100, 0); | 481 | static const DECLARE_TLV_DB_SCALE(inpga_tlv, 0, 100, 0); |
@@ -1413,8 +1484,7 @@ static const struct snd_soc_dapm_route wm8996_dapm_routes[] = { | |||
1413 | { "SPKDAT", NULL, "SPKR PGA" }, | 1484 | { "SPKDAT", NULL, "SPKR PGA" }, |
1414 | }; | 1485 | }; |
1415 | 1486 | ||
1416 | static int wm8996_readable_register(struct snd_soc_codec *codec, | 1487 | static bool wm8996_readable_register(struct device *dev, unsigned int reg) |
1417 | unsigned int reg) | ||
1418 | { | 1488 | { |
1419 | /* Due to the sparseness of the register map the compiler | 1489 | /* Due to the sparseness of the register map the compiler |
1420 | * output from an explicit switch statement ends up being much | 1490 | * output from an explicit switch statement ends up being much |
@@ -1621,8 +1691,7 @@ static int wm8996_readable_register(struct snd_soc_codec *codec, | |||
1621 | } | 1691 | } |
1622 | } | 1692 | } |
1623 | 1693 | ||
1624 | static int wm8996_volatile_register(struct snd_soc_codec *codec, | 1694 | static bool wm8996_volatile_register(struct device *dev, unsigned int reg) |
1625 | unsigned int reg) | ||
1626 | { | 1695 | { |
1627 | switch (reg) { | 1696 | switch (reg) { |
1628 | case WM8996_SOFTWARE_RESET: | 1697 | case WM8996_SOFTWARE_RESET: |
@@ -1646,9 +1715,15 @@ static int wm8996_volatile_register(struct snd_soc_codec *codec, | |||
1646 | } | 1715 | } |
1647 | } | 1716 | } |
1648 | 1717 | ||
1649 | static int wm8996_reset(struct snd_soc_codec *codec) | 1718 | static int wm8996_reset(struct wm8996_priv *wm8996) |
1650 | { | 1719 | { |
1651 | return snd_soc_write(codec, WM8996_SOFTWARE_RESET, 0x8915); | 1720 | if (wm8996->pdata.ldo_ena > 0) { |
1721 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | ||
1722 | return 0; | ||
1723 | } else { | ||
1724 | return regmap_write(wm8996->regmap, WM8996_SOFTWARE_RESET, | ||
1725 | 0x8915); | ||
1726 | } | ||
1652 | } | 1727 | } |
1653 | 1728 | ||
1654 | static const int bclk_divs[] = { | 1729 | static const int bclk_divs[] = { |
@@ -1723,13 +1798,13 @@ static int wm8996_set_bias_level(struct snd_soc_codec *codec, | |||
1723 | msleep(5); | 1798 | msleep(5); |
1724 | } | 1799 | } |
1725 | 1800 | ||
1726 | codec->cache_only = false; | 1801 | regcache_cache_only(codec->control_data, false); |
1727 | snd_soc_cache_sync(codec); | 1802 | regcache_sync(codec->control_data); |
1728 | } | 1803 | } |
1729 | break; | 1804 | break; |
1730 | 1805 | ||
1731 | case SND_SOC_BIAS_OFF: | 1806 | case SND_SOC_BIAS_OFF: |
1732 | codec->cache_only = true; | 1807 | regcache_cache_only(codec->control_data, true); |
1733 | if (wm8996->pdata.ldo_ena >= 0) | 1808 | if (wm8996->pdata.ldo_ena >= 0) |
1734 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | 1809 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); |
1735 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), | 1810 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), |
@@ -1968,6 +2043,7 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai, | |||
1968 | break; | 2043 | break; |
1969 | case 24576000: | 2044 | case 24576000: |
1970 | ratediv = WM8996_SYSCLK_DIV; | 2045 | ratediv = WM8996_SYSCLK_DIV; |
2046 | wm8996->sysclk /= 2; | ||
1971 | case 12288000: | 2047 | case 12288000: |
1972 | snd_soc_update_bits(codec, WM8996_AIF_RATE, | 2048 | snd_soc_update_bits(codec, WM8996_AIF_RATE, |
1973 | WM8996_SYSCLK_RATE, WM8996_SYSCLK_RATE); | 2049 | WM8996_SYSCLK_RATE, WM8996_SYSCLK_RATE); |
@@ -2251,48 +2327,45 @@ static inline struct wm8996_priv *gpio_to_wm8996(struct gpio_chip *chip) | |||
2251 | static void wm8996_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 2327 | static void wm8996_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
2252 | { | 2328 | { |
2253 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); | 2329 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); |
2254 | struct snd_soc_codec *codec = wm8996->codec; | ||
2255 | 2330 | ||
2256 | snd_soc_update_bits(codec, WM8996_GPIO_1 + offset, | 2331 | regmap_update_bits(wm8996->regmap, WM8996_GPIO_1 + offset, |
2257 | WM8996_GP1_LVL, !!value << WM8996_GP1_LVL_SHIFT); | 2332 | WM8996_GP1_LVL, !!value << WM8996_GP1_LVL_SHIFT); |
2258 | } | 2333 | } |
2259 | 2334 | ||
2260 | static int wm8996_gpio_direction_out(struct gpio_chip *chip, | 2335 | static int wm8996_gpio_direction_out(struct gpio_chip *chip, |
2261 | unsigned offset, int value) | 2336 | unsigned offset, int value) |
2262 | { | 2337 | { |
2263 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); | 2338 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); |
2264 | struct snd_soc_codec *codec = wm8996->codec; | ||
2265 | int val; | 2339 | int val; |
2266 | 2340 | ||
2267 | val = (1 << WM8996_GP1_FN_SHIFT) | (!!value << WM8996_GP1_LVL_SHIFT); | 2341 | val = (1 << WM8996_GP1_FN_SHIFT) | (!!value << WM8996_GP1_LVL_SHIFT); |
2268 | 2342 | ||
2269 | return snd_soc_update_bits(codec, WM8996_GPIO_1 + offset, | 2343 | return regmap_update_bits(wm8996->regmap, WM8996_GPIO_1 + offset, |
2270 | WM8996_GP1_FN_MASK | WM8996_GP1_DIR | | 2344 | WM8996_GP1_FN_MASK | WM8996_GP1_DIR | |
2271 | WM8996_GP1_LVL, val); | 2345 | WM8996_GP1_LVL, val); |
2272 | } | 2346 | } |
2273 | 2347 | ||
2274 | static int wm8996_gpio_get(struct gpio_chip *chip, unsigned offset) | 2348 | static int wm8996_gpio_get(struct gpio_chip *chip, unsigned offset) |
2275 | { | 2349 | { |
2276 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); | 2350 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); |
2277 | struct snd_soc_codec *codec = wm8996->codec; | 2351 | unsigned int reg; |
2278 | int ret; | 2352 | int ret; |
2279 | 2353 | ||
2280 | ret = snd_soc_read(codec, WM8996_GPIO_1 + offset); | 2354 | ret = regmap_read(wm8996->regmap, WM8996_GPIO_1 + offset, ®); |
2281 | if (ret < 0) | 2355 | if (ret < 0) |
2282 | return ret; | 2356 | return ret; |
2283 | 2357 | ||
2284 | return (ret & WM8996_GP1_LVL) != 0; | 2358 | return (reg & WM8996_GP1_LVL) != 0; |
2285 | } | 2359 | } |
2286 | 2360 | ||
2287 | static int wm8996_gpio_direction_in(struct gpio_chip *chip, unsigned offset) | 2361 | static int wm8996_gpio_direction_in(struct gpio_chip *chip, unsigned offset) |
2288 | { | 2362 | { |
2289 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); | 2363 | struct wm8996_priv *wm8996 = gpio_to_wm8996(chip); |
2290 | struct snd_soc_codec *codec = wm8996->codec; | ||
2291 | 2364 | ||
2292 | return snd_soc_update_bits(codec, WM8996_GPIO_1 + offset, | 2365 | return regmap_update_bits(wm8996->regmap, WM8996_GPIO_1 + offset, |
2293 | WM8996_GP1_FN_MASK | WM8996_GP1_DIR, | 2366 | WM8996_GP1_FN_MASK | WM8996_GP1_DIR, |
2294 | (1 << WM8996_GP1_FN_SHIFT) | | 2367 | (1 << WM8996_GP1_FN_SHIFT) | |
2295 | (1 << WM8996_GP1_DIR_SHIFT)); | 2368 | (1 << WM8996_GP1_DIR_SHIFT)); |
2296 | } | 2369 | } |
2297 | 2370 | ||
2298 | static struct gpio_chip wm8996_template_chip = { | 2371 | static struct gpio_chip wm8996_template_chip = { |
@@ -2305,14 +2378,13 @@ static struct gpio_chip wm8996_template_chip = { | |||
2305 | .can_sleep = 1, | 2378 | .can_sleep = 1, |
2306 | }; | 2379 | }; |
2307 | 2380 | ||
2308 | static void wm8996_init_gpio(struct snd_soc_codec *codec) | 2381 | static void wm8996_init_gpio(struct wm8996_priv *wm8996) |
2309 | { | 2382 | { |
2310 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | ||
2311 | int ret; | 2383 | int ret; |
2312 | 2384 | ||
2313 | wm8996->gpio_chip = wm8996_template_chip; | 2385 | wm8996->gpio_chip = wm8996_template_chip; |
2314 | wm8996->gpio_chip.ngpio = 5; | 2386 | wm8996->gpio_chip.ngpio = 5; |
2315 | wm8996->gpio_chip.dev = codec->dev; | 2387 | wm8996->gpio_chip.dev = wm8996->dev; |
2316 | 2388 | ||
2317 | if (wm8996->pdata.gpio_base) | 2389 | if (wm8996->pdata.gpio_base) |
2318 | wm8996->gpio_chip.base = wm8996->pdata.gpio_base; | 2390 | wm8996->gpio_chip.base = wm8996->pdata.gpio_base; |
@@ -2321,24 +2393,23 @@ static void wm8996_init_gpio(struct snd_soc_codec *codec) | |||
2321 | 2393 | ||
2322 | ret = gpiochip_add(&wm8996->gpio_chip); | 2394 | ret = gpiochip_add(&wm8996->gpio_chip); |
2323 | if (ret != 0) | 2395 | if (ret != 0) |
2324 | dev_err(codec->dev, "Failed to add GPIOs: %d\n", ret); | 2396 | dev_err(wm8996->dev, "Failed to add GPIOs: %d\n", ret); |
2325 | } | 2397 | } |
2326 | 2398 | ||
2327 | static void wm8996_free_gpio(struct snd_soc_codec *codec) | 2399 | static void wm8996_free_gpio(struct wm8996_priv *wm8996) |
2328 | { | 2400 | { |
2329 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | ||
2330 | int ret; | 2401 | int ret; |
2331 | 2402 | ||
2332 | ret = gpiochip_remove(&wm8996->gpio_chip); | 2403 | ret = gpiochip_remove(&wm8996->gpio_chip); |
2333 | if (ret != 0) | 2404 | if (ret != 0) |
2334 | dev_err(codec->dev, "Failed to remove GPIOs: %d\n", ret); | 2405 | dev_err(wm8996->dev, "Failed to remove GPIOs: %d\n", ret); |
2335 | } | 2406 | } |
2336 | #else | 2407 | #else |
2337 | static void wm8996_init_gpio(struct snd_soc_codec *codec) | 2408 | static void wm8996_init_gpio(struct wm8996_priv *wm8996) |
2338 | { | 2409 | { |
2339 | } | 2410 | } |
2340 | 2411 | ||
2341 | static void wm8996_free_gpio(struct snd_soc_codec *codec) | 2412 | static void wm8996_free_gpio(struct wm8996_priv *wm8996) |
2342 | { | 2413 | { |
2343 | } | 2414 | } |
2344 | #endif | 2415 | #endif |
@@ -2501,8 +2572,10 @@ static void wm8996_micd(struct snd_soc_codec *codec) | |||
2501 | SND_JACK_BTN_0); | 2572 | SND_JACK_BTN_0); |
2502 | 2573 | ||
2503 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, | 2574 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, |
2504 | WM8996_MICD_RATE_MASK, | 2575 | WM8996_MICD_RATE_MASK | |
2505 | WM8996_MICD_RATE_MASK); | 2576 | WM8996_MICD_BIAS_STARTTIME_MASK, |
2577 | WM8996_MICD_RATE_MASK | | ||
2578 | 9 << WM8996_MICD_BIAS_STARTTIME_SHIFT); | ||
2506 | return; | 2579 | return; |
2507 | } | 2580 | } |
2508 | 2581 | ||
@@ -2519,8 +2592,10 @@ static void wm8996_micd(struct snd_soc_codec *codec) | |||
2519 | /* Increase poll rate to give better responsiveness | 2592 | /* Increase poll rate to give better responsiveness |
2520 | * for buttons */ | 2593 | * for buttons */ |
2521 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, | 2594 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, |
2522 | WM8996_MICD_RATE_MASK, | 2595 | WM8996_MICD_RATE_MASK | |
2523 | 5 << WM8996_MICD_RATE_SHIFT); | 2596 | WM8996_MICD_BIAS_STARTTIME_MASK, |
2597 | 5 << WM8996_MICD_RATE_SHIFT | | ||
2598 | 7 << WM8996_MICD_BIAS_STARTTIME_SHIFT); | ||
2524 | } else { | 2599 | } else { |
2525 | dev_dbg(codec->dev, "Mic button up\n"); | 2600 | dev_dbg(codec->dev, "Mic button up\n"); |
2526 | snd_soc_jack_report(wm8996->jack, 0, SND_JACK_BTN_0); | 2601 | snd_soc_jack_report(wm8996->jack, 0, SND_JACK_BTN_0); |
@@ -2568,8 +2643,10 @@ static void wm8996_micd(struct snd_soc_codec *codec) | |||
2568 | * responsiveness. | 2643 | * responsiveness. |
2569 | */ | 2644 | */ |
2570 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, | 2645 | snd_soc_update_bits(codec, WM8996_MIC_DETECT_1, |
2571 | WM8996_MICD_RATE_MASK, | 2646 | WM8996_MICD_RATE_MASK | |
2572 | 7 << WM8996_MICD_RATE_SHIFT); | 2647 | WM8996_MICD_BIAS_STARTTIME_MASK, |
2648 | 7 << WM8996_MICD_RATE_SHIFT | | ||
2649 | 7 << WM8996_MICD_BIAS_STARTTIME_SHIFT); | ||
2573 | } | 2650 | } |
2574 | } | 2651 | } |
2575 | } | 2652 | } |
@@ -2692,6 +2769,18 @@ static void wm8996_retune_mobile_pdata(struct snd_soc_codec *codec) | |||
2692 | "Failed to add ReTune Mobile controls: %d\n", ret); | 2769 | "Failed to add ReTune Mobile controls: %d\n", ret); |
2693 | } | 2770 | } |
2694 | 2771 | ||
2772 | static const struct regmap_config wm8996_regmap = { | ||
2773 | .reg_bits = 16, | ||
2774 | .val_bits = 16, | ||
2775 | |||
2776 | .max_register = WM8996_MAX_REGISTER, | ||
2777 | .reg_defaults = wm8996_reg, | ||
2778 | .num_reg_defaults = ARRAY_SIZE(wm8996_reg), | ||
2779 | .volatile_reg = wm8996_volatile_register, | ||
2780 | .readable_reg = wm8996_readable_register, | ||
2781 | .cache_type = REGCACHE_RBTREE, | ||
2782 | }; | ||
2783 | |||
2695 | static int wm8996_probe(struct snd_soc_codec *codec) | 2784 | static int wm8996_probe(struct snd_soc_codec *codec) |
2696 | { | 2785 | { |
2697 | int ret; | 2786 | int ret; |
@@ -2707,19 +2796,11 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2707 | 2796 | ||
2708 | dapm->idle_bias_off = true; | 2797 | dapm->idle_bias_off = true; |
2709 | 2798 | ||
2710 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_I2C); | 2799 | codec->control_data = wm8996->regmap; |
2711 | if (ret != 0) { | ||
2712 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | ||
2713 | goto err; | ||
2714 | } | ||
2715 | |||
2716 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) | ||
2717 | wm8996->supplies[i].supply = wm8996_supply_names[i]; | ||
2718 | 2800 | ||
2719 | ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8996->supplies), | 2801 | ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP); |
2720 | wm8996->supplies); | ||
2721 | if (ret != 0) { | 2802 | if (ret != 0) { |
2722 | dev_err(codec->dev, "Failed to request supplies: %d\n", ret); | 2803 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
2723 | goto err; | 2804 | goto err; |
2724 | } | 2805 | } |
2725 | 2806 | ||
@@ -2727,13 +2808,6 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2727 | wm8996->disable_nb[1].notifier_call = wm8996_regulator_event_1; | 2808 | wm8996->disable_nb[1].notifier_call = wm8996_regulator_event_1; |
2728 | wm8996->disable_nb[2].notifier_call = wm8996_regulator_event_2; | 2809 | wm8996->disable_nb[2].notifier_call = wm8996_regulator_event_2; |
2729 | 2810 | ||
2730 | wm8996->cpvdd = regulator_get(&i2c->dev, "CPVDD"); | ||
2731 | if (IS_ERR(wm8996->cpvdd)) { | ||
2732 | ret = PTR_ERR(wm8996->cpvdd); | ||
2733 | dev_err(&i2c->dev, "Failed to get CPVDD: %d\n", ret); | ||
2734 | goto err_get; | ||
2735 | } | ||
2736 | |||
2737 | /* This should really be moved into the regulator core */ | 2811 | /* This should really be moved into the regulator core */ |
2738 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) { | 2812 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) { |
2739 | ret = regulator_register_notifier(wm8996->supplies[i].consumer, | 2813 | ret = regulator_register_notifier(wm8996->supplies[i].consumer, |
@@ -2745,50 +2819,7 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2745 | } | 2819 | } |
2746 | } | 2820 | } |
2747 | 2821 | ||
2748 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies), | 2822 | regcache_cache_only(codec->control_data, true); |
2749 | wm8996->supplies); | ||
2750 | if (ret != 0) { | ||
2751 | dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); | ||
2752 | goto err_cpvdd; | ||
2753 | } | ||
2754 | |||
2755 | if (wm8996->pdata.ldo_ena >= 0) { | ||
2756 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 1); | ||
2757 | msleep(5); | ||
2758 | } | ||
2759 | |||
2760 | ret = snd_soc_read(codec, WM8996_SOFTWARE_RESET); | ||
2761 | if (ret < 0) { | ||
2762 | dev_err(codec->dev, "Failed to read ID register: %d\n", ret); | ||
2763 | goto err_enable; | ||
2764 | } | ||
2765 | if (ret != 0x8915) { | ||
2766 | dev_err(codec->dev, "Device is not a WM8996, ID %x\n", ret); | ||
2767 | ret = -EINVAL; | ||
2768 | goto err_enable; | ||
2769 | } | ||
2770 | |||
2771 | ret = snd_soc_read(codec, WM8996_CHIP_REVISION); | ||
2772 | if (ret < 0) { | ||
2773 | dev_err(codec->dev, "Failed to read device revision: %d\n", | ||
2774 | ret); | ||
2775 | goto err_enable; | ||
2776 | } | ||
2777 | |||
2778 | dev_info(codec->dev, "revision %c\n", | ||
2779 | (ret & WM8996_CHIP_REV_MASK) + 'A'); | ||
2780 | |||
2781 | if (wm8996->pdata.ldo_ena >= 0) { | ||
2782 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | ||
2783 | } else { | ||
2784 | ret = wm8996_reset(codec); | ||
2785 | if (ret < 0) { | ||
2786 | dev_err(codec->dev, "Failed to issue reset\n"); | ||
2787 | goto err_enable; | ||
2788 | } | ||
2789 | } | ||
2790 | |||
2791 | codec->cache_only = true; | ||
2792 | 2823 | ||
2793 | /* Apply platform data settings */ | 2824 | /* Apply platform data settings */ |
2794 | snd_soc_update_bits(codec, WM8996_LINE_INPUT_CONTROL, | 2825 | snd_soc_update_bits(codec, WM8996_LINE_INPUT_CONTROL, |
@@ -2946,10 +2977,6 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2946 | WM8996_AIF2TX_LRCLK_MODE, | 2977 | WM8996_AIF2TX_LRCLK_MODE, |
2947 | WM8996_AIF2TX_LRCLK_MODE); | 2978 | WM8996_AIF2TX_LRCLK_MODE); |
2948 | 2979 | ||
2949 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
2950 | |||
2951 | wm8996_init_gpio(codec); | ||
2952 | |||
2953 | if (i2c->irq) { | 2980 | if (i2c->irq) { |
2954 | if (wm8996->pdata.irq_flags) | 2981 | if (wm8996->pdata.irq_flags) |
2955 | irq_flags = wm8996->pdata.irq_flags; | 2982 | irq_flags = wm8996->pdata.irq_flags; |
@@ -2987,15 +3014,6 @@ static int wm8996_probe(struct snd_soc_codec *codec) | |||
2987 | 3014 | ||
2988 | return 0; | 3015 | return 0; |
2989 | 3016 | ||
2990 | err_enable: | ||
2991 | if (wm8996->pdata.ldo_ena >= 0) | ||
2992 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | ||
2993 | |||
2994 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
2995 | err_cpvdd: | ||
2996 | regulator_put(wm8996->cpvdd); | ||
2997 | err_get: | ||
2998 | regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
2999 | err: | 3017 | err: |
3000 | return ret; | 3018 | return ret; |
3001 | } | 3019 | } |
@@ -3012,8 +3030,6 @@ static int wm8996_remove(struct snd_soc_codec *codec) | |||
3012 | if (i2c->irq) | 3030 | if (i2c->irq) |
3013 | free_irq(i2c->irq, codec); | 3031 | free_irq(i2c->irq, codec); |
3014 | 3032 | ||
3015 | wm8996_free_gpio(codec); | ||
3016 | |||
3017 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) | 3033 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) |
3018 | regulator_unregister_notifier(wm8996->supplies[i].consumer, | 3034 | regulator_unregister_notifier(wm8996->supplies[i].consumer, |
3019 | &wm8996->disable_nb[i]); | 3035 | &wm8996->disable_nb[i]); |
@@ -3023,17 +3039,17 @@ static int wm8996_remove(struct snd_soc_codec *codec) | |||
3023 | return 0; | 3039 | return 0; |
3024 | } | 3040 | } |
3025 | 3041 | ||
3042 | static int wm8996_soc_volatile_register(struct snd_soc_codec *codec, | ||
3043 | unsigned int reg) | ||
3044 | { | ||
3045 | return true; | ||
3046 | } | ||
3047 | |||
3026 | static struct snd_soc_codec_driver soc_codec_dev_wm8996 = { | 3048 | static struct snd_soc_codec_driver soc_codec_dev_wm8996 = { |
3027 | .probe = wm8996_probe, | 3049 | .probe = wm8996_probe, |
3028 | .remove = wm8996_remove, | 3050 | .remove = wm8996_remove, |
3029 | .set_bias_level = wm8996_set_bias_level, | 3051 | .set_bias_level = wm8996_set_bias_level, |
3030 | .seq_notifier = wm8996_seq_notifier, | 3052 | .seq_notifier = wm8996_seq_notifier, |
3031 | .reg_cache_size = WM8996_MAX_REGISTER + 1, | ||
3032 | .reg_word_size = sizeof(u16), | ||
3033 | .reg_cache_default = wm8996_reg, | ||
3034 | .volatile_register = wm8996_volatile_register, | ||
3035 | .readable_register = wm8996_readable_register, | ||
3036 | .compress_type = SND_SOC_RBTREE_COMPRESSION, | ||
3037 | .controls = wm8996_snd_controls, | 3053 | .controls = wm8996_snd_controls, |
3038 | .num_controls = ARRAY_SIZE(wm8996_snd_controls), | 3054 | .num_controls = ARRAY_SIZE(wm8996_snd_controls), |
3039 | .dapm_widgets = wm8996_dapm_widgets, | 3055 | .dapm_widgets = wm8996_dapm_widgets, |
@@ -3041,6 +3057,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8996 = { | |||
3041 | .dapm_routes = wm8996_dapm_routes, | 3057 | .dapm_routes = wm8996_dapm_routes, |
3042 | .num_dapm_routes = ARRAY_SIZE(wm8996_dapm_routes), | 3058 | .num_dapm_routes = ARRAY_SIZE(wm8996_dapm_routes), |
3043 | .set_pll = wm8996_set_fll, | 3059 | .set_pll = wm8996_set_fll, |
3060 | .reg_cache_size = WM8996_MAX_REGISTER, | ||
3061 | .volatile_register = wm8996_soc_volatile_register, | ||
3044 | }; | 3062 | }; |
3045 | 3063 | ||
3046 | #define WM8996_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ | 3064 | #define WM8996_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ |
@@ -3049,7 +3067,7 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8996 = { | |||
3049 | SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE |\ | 3067 | SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE |\ |
3050 | SNDRV_PCM_FMTBIT_S32_LE) | 3068 | SNDRV_PCM_FMTBIT_S32_LE) |
3051 | 3069 | ||
3052 | static struct snd_soc_dai_ops wm8996_dai_ops = { | 3070 | static const struct snd_soc_dai_ops wm8996_dai_ops = { |
3053 | .set_fmt = wm8996_set_fmt, | 3071 | .set_fmt = wm8996_set_fmt, |
3054 | .hw_params = wm8996_hw_params, | 3072 | .hw_params = wm8996_hw_params, |
3055 | .set_sysclk = wm8996_set_sysclk, | 3073 | .set_sysclk = wm8996_set_sysclk, |
@@ -3098,13 +3116,16 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c, | |||
3098 | const struct i2c_device_id *id) | 3116 | const struct i2c_device_id *id) |
3099 | { | 3117 | { |
3100 | struct wm8996_priv *wm8996; | 3118 | struct wm8996_priv *wm8996; |
3101 | int ret; | 3119 | int ret, i; |
3120 | unsigned int reg; | ||
3102 | 3121 | ||
3103 | wm8996 = kzalloc(sizeof(struct wm8996_priv), GFP_KERNEL); | 3122 | wm8996 = devm_kzalloc(&i2c->dev, sizeof(struct wm8996_priv), |
3123 | GFP_KERNEL); | ||
3104 | if (wm8996 == NULL) | 3124 | if (wm8996 == NULL) |
3105 | return -ENOMEM; | 3125 | return -ENOMEM; |
3106 | 3126 | ||
3107 | i2c_set_clientdata(i2c, wm8996); | 3127 | i2c_set_clientdata(i2c, wm8996); |
3128 | wm8996->dev = &i2c->dev; | ||
3108 | 3129 | ||
3109 | if (dev_get_platdata(&i2c->dev)) | 3130 | if (dev_get_platdata(&i2c->dev)) |
3110 | memcpy(&wm8996->pdata, dev_get_platdata(&i2c->dev), | 3131 | memcpy(&wm8996->pdata, dev_get_platdata(&i2c->dev), |
@@ -3120,19 +3141,97 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c, | |||
3120 | } | 3141 | } |
3121 | } | 3142 | } |
3122 | 3143 | ||
3144 | for (i = 0; i < ARRAY_SIZE(wm8996->supplies); i++) | ||
3145 | wm8996->supplies[i].supply = wm8996_supply_names[i]; | ||
3146 | |||
3147 | ret = regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8996->supplies), | ||
3148 | wm8996->supplies); | ||
3149 | if (ret != 0) { | ||
3150 | dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); | ||
3151 | goto err_gpio; | ||
3152 | } | ||
3153 | |||
3154 | wm8996->cpvdd = regulator_get(&i2c->dev, "CPVDD"); | ||
3155 | if (IS_ERR(wm8996->cpvdd)) { | ||
3156 | ret = PTR_ERR(wm8996->cpvdd); | ||
3157 | dev_err(&i2c->dev, "Failed to get CPVDD: %d\n", ret); | ||
3158 | goto err_get; | ||
3159 | } | ||
3160 | |||
3161 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8996->supplies), | ||
3162 | wm8996->supplies); | ||
3163 | if (ret != 0) { | ||
3164 | dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); | ||
3165 | goto err_cpvdd; | ||
3166 | } | ||
3167 | |||
3168 | if (wm8996->pdata.ldo_ena > 0) { | ||
3169 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 1); | ||
3170 | msleep(5); | ||
3171 | } | ||
3172 | |||
3173 | wm8996->regmap = regmap_init_i2c(i2c, &wm8996_regmap); | ||
3174 | if (IS_ERR(wm8996->regmap)) { | ||
3175 | ret = PTR_ERR(wm8996->regmap); | ||
3176 | dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); | ||
3177 | goto err_enable; | ||
3178 | } | ||
3179 | |||
3180 | ret = regmap_read(wm8996->regmap, WM8996_SOFTWARE_RESET, ®); | ||
3181 | if (ret < 0) { | ||
3182 | dev_err(&i2c->dev, "Failed to read ID register: %d\n", ret); | ||
3183 | goto err_regmap; | ||
3184 | } | ||
3185 | if (reg != 0x8915) { | ||
3186 | dev_err(&i2c->dev, "Device is not a WM8996, ID %x\n", ret); | ||
3187 | ret = -EINVAL; | ||
3188 | goto err_regmap; | ||
3189 | } | ||
3190 | |||
3191 | ret = regmap_read(wm8996->regmap, WM8996_CHIP_REVISION, ®); | ||
3192 | if (ret < 0) { | ||
3193 | dev_err(&i2c->dev, "Failed to read device revision: %d\n", | ||
3194 | ret); | ||
3195 | goto err_regmap; | ||
3196 | } | ||
3197 | |||
3198 | dev_info(&i2c->dev, "revision %c\n", | ||
3199 | (reg & WM8996_CHIP_REV_MASK) + 'A'); | ||
3200 | |||
3201 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3202 | |||
3203 | ret = wm8996_reset(wm8996); | ||
3204 | if (ret < 0) { | ||
3205 | dev_err(&i2c->dev, "Failed to issue reset\n"); | ||
3206 | goto err_regmap; | ||
3207 | } | ||
3208 | |||
3209 | wm8996_init_gpio(wm8996); | ||
3210 | |||
3123 | ret = snd_soc_register_codec(&i2c->dev, | 3211 | ret = snd_soc_register_codec(&i2c->dev, |
3124 | &soc_codec_dev_wm8996, wm8996_dai, | 3212 | &soc_codec_dev_wm8996, wm8996_dai, |
3125 | ARRAY_SIZE(wm8996_dai)); | 3213 | ARRAY_SIZE(wm8996_dai)); |
3126 | if (ret < 0) | 3214 | if (ret < 0) |
3127 | goto err_gpio; | 3215 | goto err_gpiolib; |
3128 | 3216 | ||
3129 | return ret; | 3217 | return ret; |
3130 | 3218 | ||
3219 | err_gpiolib: | ||
3220 | wm8996_free_gpio(wm8996); | ||
3221 | err_regmap: | ||
3222 | regmap_exit(wm8996->regmap); | ||
3223 | err_enable: | ||
3224 | if (wm8996->pdata.ldo_ena > 0) | ||
3225 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | ||
3226 | regulator_bulk_disable(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3227 | err_cpvdd: | ||
3228 | regulator_put(wm8996->cpvdd); | ||
3229 | err_get: | ||
3230 | regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3131 | err_gpio: | 3231 | err_gpio: |
3132 | if (wm8996->pdata.ldo_ena > 0) | 3232 | if (wm8996->pdata.ldo_ena > 0) |
3133 | gpio_free(wm8996->pdata.ldo_ena); | 3233 | gpio_free(wm8996->pdata.ldo_ena); |
3134 | err: | 3234 | err: |
3135 | kfree(wm8996); | ||
3136 | 3235 | ||
3137 | return ret; | 3236 | return ret; |
3138 | } | 3237 | } |
@@ -3142,9 +3241,14 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client) | |||
3142 | struct wm8996_priv *wm8996 = i2c_get_clientdata(client); | 3241 | struct wm8996_priv *wm8996 = i2c_get_clientdata(client); |
3143 | 3242 | ||
3144 | snd_soc_unregister_codec(&client->dev); | 3243 | snd_soc_unregister_codec(&client->dev); |
3145 | if (wm8996->pdata.ldo_ena > 0) | 3244 | wm8996_free_gpio(wm8996); |
3245 | regulator_put(wm8996->cpvdd); | ||
3246 | regulator_bulk_free(ARRAY_SIZE(wm8996->supplies), wm8996->supplies); | ||
3247 | regmap_exit(wm8996->regmap); | ||
3248 | if (wm8996->pdata.ldo_ena > 0) { | ||
3249 | gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0); | ||
3146 | gpio_free(wm8996->pdata.ldo_ena); | 3250 | gpio_free(wm8996->pdata.ldo_ena); |
3147 | kfree(i2c_get_clientdata(client)); | 3251 | } |
3148 | return 0; | 3252 | return 0; |
3149 | } | 3253 | } |
3150 | 3254 | ||
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 4a398c3bfe8..a6bab392700 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/regmap.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <sound/core.h> | 23 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
@@ -30,69 +30,60 @@ | |||
30 | #include <sound/wm9081.h> | 30 | #include <sound/wm9081.h> |
31 | #include "wm9081.h" | 31 | #include "wm9081.h" |
32 | 32 | ||
33 | static u16 wm9081_reg_defaults[] = { | 33 | static struct reg_default wm9081_reg[] = { |
34 | 0x0000, /* R0 - Software Reset */ | 34 | { 2, 0x00B9 }, /* R2 - Analogue Lineout */ |
35 | 0x0000, /* R1 */ | 35 | { 3, 0x00B9 }, /* R3 - Analogue Speaker PGA */ |
36 | 0x00B9, /* R2 - Analogue Lineout */ | 36 | { 4, 0x0001 }, /* R4 - VMID Control */ |
37 | 0x00B9, /* R3 - Analogue Speaker PGA */ | 37 | { 5, 0x0068 }, /* R5 - Bias Control 1 */ |
38 | 0x0001, /* R4 - VMID Control */ | 38 | { 7, 0x0000 }, /* R7 - Analogue Mixer */ |
39 | 0x0068, /* R5 - Bias Control 1 */ | 39 | { 8, 0x0000 }, /* R8 - Anti Pop Control */ |
40 | 0x0000, /* R6 */ | 40 | { 9, 0x01DB }, /* R9 - Analogue Speaker 1 */ |
41 | 0x0000, /* R7 - Analogue Mixer */ | 41 | { 10, 0x0018 }, /* R10 - Analogue Speaker 2 */ |
42 | 0x0000, /* R8 - Anti Pop Control */ | 42 | { 11, 0x0180 }, /* R11 - Power Management */ |
43 | 0x01DB, /* R9 - Analogue Speaker 1 */ | 43 | { 12, 0x0000 }, /* R12 - Clock Control 1 */ |
44 | 0x0018, /* R10 - Analogue Speaker 2 */ | 44 | { 13, 0x0038 }, /* R13 - Clock Control 2 */ |
45 | 0x0180, /* R11 - Power Management */ | 45 | { 14, 0x4000 }, /* R14 - Clock Control 3 */ |
46 | 0x0000, /* R12 - Clock Control 1 */ | 46 | { 16, 0x0000 }, /* R16 - FLL Control 1 */ |
47 | 0x0038, /* R13 - Clock Control 2 */ | 47 | { 17, 0x0200 }, /* R17 - FLL Control 2 */ |
48 | 0x4000, /* R14 - Clock Control 3 */ | 48 | { 18, 0x0000 }, /* R18 - FLL Control 3 */ |
49 | 0x0000, /* R15 */ | 49 | { 19, 0x0204 }, /* R19 - FLL Control 4 */ |
50 | 0x0000, /* R16 - FLL Control 1 */ | 50 | { 20, 0x0000 }, /* R20 - FLL Control 5 */ |
51 | 0x0200, /* R17 - FLL Control 2 */ | 51 | { 22, 0x0000 }, /* R22 - Audio Interface 1 */ |
52 | 0x0000, /* R18 - FLL Control 3 */ | 52 | { 23, 0x0002 }, /* R23 - Audio Interface 2 */ |
53 | 0x0204, /* R19 - FLL Control 4 */ | 53 | { 24, 0x0008 }, /* R24 - Audio Interface 3 */ |
54 | 0x0000, /* R20 - FLL Control 5 */ | 54 | { 25, 0x0022 }, /* R25 - Audio Interface 4 */ |
55 | 0x0000, /* R21 */ | 55 | { 27, 0x0006 }, /* R27 - Interrupt Status Mask */ |
56 | 0x0000, /* R22 - Audio Interface 1 */ | 56 | { 28, 0x0000 }, /* R28 - Interrupt Polarity */ |
57 | 0x0002, /* R23 - Audio Interface 2 */ | 57 | { 29, 0x0000 }, /* R29 - Interrupt Control */ |
58 | 0x0008, /* R24 - Audio Interface 3 */ | 58 | { 30, 0x00C0 }, /* R30 - DAC Digital 1 */ |
59 | 0x0022, /* R25 - Audio Interface 4 */ | 59 | { 31, 0x0008 }, /* R31 - DAC Digital 2 */ |
60 | 0x0000, /* R26 - Interrupt Status */ | 60 | { 32, 0x09AF }, /* R32 - DRC 1 */ |
61 | 0x0006, /* R27 - Interrupt Status Mask */ | 61 | { 33, 0x4201 }, /* R33 - DRC 2 */ |
62 | 0x0000, /* R28 - Interrupt Polarity */ | 62 | { 34, 0x0000 }, /* R34 - DRC 3 */ |
63 | 0x0000, /* R29 - Interrupt Control */ | 63 | { 35, 0x0000 }, /* R35 - DRC 4 */ |
64 | 0x00C0, /* R30 - DAC Digital 1 */ | 64 | { 38, 0x0000 }, /* R38 - Write Sequencer 1 */ |
65 | 0x0008, /* R31 - DAC Digital 2 */ | 65 | { 39, 0x0000 }, /* R39 - Write Sequencer 2 */ |
66 | 0x09AF, /* R32 - DRC 1 */ | 66 | { 40, 0x0002 }, /* R40 - MW Slave 1 */ |
67 | 0x4201, /* R33 - DRC 2 */ | 67 | { 42, 0x0000 }, /* R42 - EQ 1 */ |
68 | 0x0000, /* R34 - DRC 3 */ | 68 | { 43, 0x0000 }, /* R43 - EQ 2 */ |
69 | 0x0000, /* R35 - DRC 4 */ | 69 | { 44, 0x0FCA }, /* R44 - EQ 3 */ |
70 | 0x0000, /* R36 */ | 70 | { 45, 0x0400 }, /* R45 - EQ 4 */ |
71 | 0x0000, /* R37 */ | 71 | { 46, 0x00B8 }, /* R46 - EQ 5 */ |
72 | 0x0000, /* R38 - Write Sequencer 1 */ | 72 | { 47, 0x1EB5 }, /* R47 - EQ 6 */ |
73 | 0x0000, /* R39 - Write Sequencer 2 */ | 73 | { 48, 0xF145 }, /* R48 - EQ 7 */ |
74 | 0x0002, /* R40 - MW Slave 1 */ | 74 | { 49, 0x0B75 }, /* R49 - EQ 8 */ |
75 | 0x0000, /* R41 */ | 75 | { 50, 0x01C5 }, /* R50 - EQ 9 */ |
76 | 0x0000, /* R42 - EQ 1 */ | 76 | { 51, 0x169E }, /* R51 - EQ 10 */ |
77 | 0x0000, /* R43 - EQ 2 */ | 77 | { 52, 0xF829 }, /* R52 - EQ 11 */ |
78 | 0x0FCA, /* R44 - EQ 3 */ | 78 | { 53, 0x07AD }, /* R53 - EQ 12 */ |
79 | 0x0400, /* R45 - EQ 4 */ | 79 | { 54, 0x1103 }, /* R54 - EQ 13 */ |
80 | 0x00B8, /* R46 - EQ 5 */ | 80 | { 55, 0x1C58 }, /* R55 - EQ 14 */ |
81 | 0x1EB5, /* R47 - EQ 6 */ | 81 | { 56, 0xF373 }, /* R56 - EQ 15 */ |
82 | 0xF145, /* R48 - EQ 7 */ | 82 | { 57, 0x0A54 }, /* R57 - EQ 16 */ |
83 | 0x0B75, /* R49 - EQ 8 */ | 83 | { 58, 0x0558 }, /* R58 - EQ 17 */ |
84 | 0x01C5, /* R50 - EQ 9 */ | 84 | { 59, 0x0564 }, /* R59 - EQ 18 */ |
85 | 0x169E, /* R51 - EQ 10 */ | 85 | { 60, 0x0559 }, /* R60 - EQ 19 */ |
86 | 0xF829, /* R52 - EQ 11 */ | 86 | { 61, 0x4000 }, /* R61 - EQ 20 */ |
87 | 0x07AD, /* R53 - EQ 12 */ | ||
88 | 0x1103, /* R54 - EQ 13 */ | ||
89 | 0x1C58, /* R55 - EQ 14 */ | ||
90 | 0xF373, /* R56 - EQ 15 */ | ||
91 | 0x0A54, /* R57 - EQ 16 */ | ||
92 | 0x0558, /* R58 - EQ 17 */ | ||
93 | 0x0564, /* R59 - EQ 18 */ | ||
94 | 0x0559, /* R60 - EQ 19 */ | ||
95 | 0x4000, /* R61 - EQ 20 */ | ||
96 | }; | 87 | }; |
97 | 88 | ||
98 | static struct { | 89 | static struct { |
@@ -156,7 +147,7 @@ static struct { | |||
156 | }; | 147 | }; |
157 | 148 | ||
158 | struct wm9081_priv { | 149 | struct wm9081_priv { |
159 | enum snd_soc_control_type control_type; | 150 | struct regmap *regmap; |
160 | int sysclk_source; | 151 | int sysclk_source; |
161 | int mclk_rate; | 152 | int mclk_rate; |
162 | int sysclk_rate; | 153 | int sysclk_rate; |
@@ -169,20 +160,84 @@ struct wm9081_priv { | |||
169 | struct wm9081_pdata pdata; | 160 | struct wm9081_pdata pdata; |
170 | }; | 161 | }; |
171 | 162 | ||
172 | static int wm9081_volatile_register(struct snd_soc_codec *codec, unsigned int reg) | 163 | static bool wm9081_volatile_register(struct device *dev, unsigned int reg) |
173 | { | 164 | { |
174 | switch (reg) { | 165 | switch (reg) { |
175 | case WM9081_SOFTWARE_RESET: | 166 | case WM9081_SOFTWARE_RESET: |
176 | case WM9081_INTERRUPT_STATUS: | 167 | case WM9081_INTERRUPT_STATUS: |
177 | return 1; | 168 | return true; |
178 | default: | 169 | default: |
179 | return 0; | 170 | return false; |
171 | } | ||
172 | } | ||
173 | |||
174 | static bool wm9081_readable_register(struct device *dev, unsigned int reg) | ||
175 | { | ||
176 | switch (reg) { | ||
177 | case WM9081_SOFTWARE_RESET: | ||
178 | case WM9081_ANALOGUE_LINEOUT: | ||
179 | case WM9081_ANALOGUE_SPEAKER_PGA: | ||
180 | case WM9081_VMID_CONTROL: | ||
181 | case WM9081_BIAS_CONTROL_1: | ||
182 | case WM9081_ANALOGUE_MIXER: | ||
183 | case WM9081_ANTI_POP_CONTROL: | ||
184 | case WM9081_ANALOGUE_SPEAKER_1: | ||
185 | case WM9081_ANALOGUE_SPEAKER_2: | ||
186 | case WM9081_POWER_MANAGEMENT: | ||
187 | case WM9081_CLOCK_CONTROL_1: | ||
188 | case WM9081_CLOCK_CONTROL_2: | ||
189 | case WM9081_CLOCK_CONTROL_3: | ||
190 | case WM9081_FLL_CONTROL_1: | ||
191 | case WM9081_FLL_CONTROL_2: | ||
192 | case WM9081_FLL_CONTROL_3: | ||
193 | case WM9081_FLL_CONTROL_4: | ||
194 | case WM9081_FLL_CONTROL_5: | ||
195 | case WM9081_AUDIO_INTERFACE_1: | ||
196 | case WM9081_AUDIO_INTERFACE_2: | ||
197 | case WM9081_AUDIO_INTERFACE_3: | ||
198 | case WM9081_AUDIO_INTERFACE_4: | ||
199 | case WM9081_INTERRUPT_STATUS: | ||
200 | case WM9081_INTERRUPT_STATUS_MASK: | ||
201 | case WM9081_INTERRUPT_POLARITY: | ||
202 | case WM9081_INTERRUPT_CONTROL: | ||
203 | case WM9081_DAC_DIGITAL_1: | ||
204 | case WM9081_DAC_DIGITAL_2: | ||
205 | case WM9081_DRC_1: | ||
206 | case WM9081_DRC_2: | ||
207 | case WM9081_DRC_3: | ||
208 | case WM9081_DRC_4: | ||
209 | case WM9081_WRITE_SEQUENCER_1: | ||
210 | case WM9081_WRITE_SEQUENCER_2: | ||
211 | case WM9081_MW_SLAVE_1: | ||
212 | case WM9081_EQ_1: | ||
213 | case WM9081_EQ_2: | ||
214 | case WM9081_EQ_3: | ||
215 | case WM9081_EQ_4: | ||
216 | case WM9081_EQ_5: | ||
217 | case WM9081_EQ_6: | ||
218 | case WM9081_EQ_7: | ||
219 | case WM9081_EQ_8: | ||
220 | case WM9081_EQ_9: | ||
221 | case WM9081_EQ_10: | ||
222 | case WM9081_EQ_11: | ||
223 | case WM9081_EQ_12: | ||
224 | case WM9081_EQ_13: | ||
225 | case WM9081_EQ_14: | ||
226 | case WM9081_EQ_15: | ||
227 | case WM9081_EQ_16: | ||
228 | case WM9081_EQ_17: | ||
229 | case WM9081_EQ_18: | ||
230 | case WM9081_EQ_19: | ||
231 | case WM9081_EQ_20: | ||
232 | return true; | ||
233 | default: | ||
234 | return false; | ||
180 | } | 235 | } |
181 | } | 236 | } |
182 | 237 | ||
183 | static int wm9081_reset(struct snd_soc_codec *codec) | 238 | static int wm9081_reset(struct regmap *map) |
184 | { | 239 | { |
185 | return snd_soc_write(codec, WM9081_SOFTWARE_RESET, 0); | 240 | return regmap_write(map, WM9081_SOFTWARE_RESET, 0x9081); |
186 | } | 241 | } |
187 | 242 | ||
188 | static const DECLARE_TLV_DB_SCALE(drc_in_tlv, -4500, 75, 0); | 243 | static const DECLARE_TLV_DB_SCALE(drc_in_tlv, -4500, 75, 0); |
@@ -737,6 +792,7 @@ SND_SOC_DAPM_SUPPLY("CLK_SYS", WM9081_CLOCK_CONTROL_3, 0, 0, clk_sys_event, | |||
737 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | 792 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
738 | SND_SOC_DAPM_SUPPLY("CLK_DSP", WM9081_CLOCK_CONTROL_3, 1, 0, NULL, 0), | 793 | SND_SOC_DAPM_SUPPLY("CLK_DSP", WM9081_CLOCK_CONTROL_3, 1, 0, NULL, 0), |
739 | SND_SOC_DAPM_SUPPLY("TOCLK", WM9081_CLOCK_CONTROL_3, 2, 0, NULL, 0), | 794 | SND_SOC_DAPM_SUPPLY("TOCLK", WM9081_CLOCK_CONTROL_3, 2, 0, NULL, 0), |
795 | SND_SOC_DAPM_SUPPLY("TSENSE", WM9081_POWER_MANAGEMENT, 7, 0, NULL, 0), | ||
740 | }; | 796 | }; |
741 | 797 | ||
742 | 798 | ||
@@ -759,6 +815,7 @@ static const struct snd_soc_dapm_route wm9081_audio_paths[] = { | |||
759 | { "Speaker PGA", NULL, "CLK_SYS" }, | 815 | { "Speaker PGA", NULL, "CLK_SYS" }, |
760 | 816 | ||
761 | { "Speaker", NULL, "Speaker PGA" }, | 817 | { "Speaker", NULL, "Speaker PGA" }, |
818 | { "Speaker", NULL, "TSENSE" }, | ||
762 | 819 | ||
763 | { "SPKN", NULL, "Speaker" }, | 820 | { "SPKN", NULL, "Speaker" }, |
764 | { "SPKP", NULL, "Speaker" }, | 821 | { "SPKP", NULL, "Speaker" }, |
@@ -767,84 +824,74 @@ static const struct snd_soc_dapm_route wm9081_audio_paths[] = { | |||
767 | static int wm9081_set_bias_level(struct snd_soc_codec *codec, | 824 | static int wm9081_set_bias_level(struct snd_soc_codec *codec, |
768 | enum snd_soc_bias_level level) | 825 | enum snd_soc_bias_level level) |
769 | { | 826 | { |
770 | u16 reg; | ||
771 | |||
772 | switch (level) { | 827 | switch (level) { |
773 | case SND_SOC_BIAS_ON: | 828 | case SND_SOC_BIAS_ON: |
774 | break; | 829 | break; |
775 | 830 | ||
776 | case SND_SOC_BIAS_PREPARE: | 831 | case SND_SOC_BIAS_PREPARE: |
777 | /* VMID=2*40k */ | 832 | /* VMID=2*40k */ |
778 | reg = snd_soc_read(codec, WM9081_VMID_CONTROL); | 833 | snd_soc_update_bits(codec, WM9081_VMID_CONTROL, |
779 | reg &= ~WM9081_VMID_SEL_MASK; | 834 | WM9081_VMID_SEL_MASK, 0x2); |
780 | reg |= 0x2; | ||
781 | snd_soc_write(codec, WM9081_VMID_CONTROL, reg); | ||
782 | 835 | ||
783 | /* Normal bias current */ | 836 | /* Normal bias current */ |
784 | reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); | 837 | snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, |
785 | reg &= ~WM9081_STBY_BIAS_ENA; | 838 | WM9081_STBY_BIAS_ENA, 0); |
786 | snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); | ||
787 | break; | 839 | break; |
788 | 840 | ||
789 | case SND_SOC_BIAS_STANDBY: | 841 | case SND_SOC_BIAS_STANDBY: |
790 | /* Initial cold start */ | 842 | /* Initial cold start */ |
791 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 843 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
792 | /* Disable LINEOUT discharge */ | 844 | /* Disable LINEOUT discharge */ |
793 | reg = snd_soc_read(codec, WM9081_ANTI_POP_CONTROL); | 845 | snd_soc_update_bits(codec, WM9081_ANTI_POP_CONTROL, |
794 | reg &= ~WM9081_LINEOUT_DISCH; | 846 | WM9081_LINEOUT_DISCH, 0); |
795 | snd_soc_write(codec, WM9081_ANTI_POP_CONTROL, reg); | ||
796 | 847 | ||
797 | /* Select startup bias source */ | 848 | /* Select startup bias source */ |
798 | reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); | 849 | snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, |
799 | reg |= WM9081_BIAS_SRC | WM9081_BIAS_ENA; | 850 | WM9081_BIAS_SRC | WM9081_BIAS_ENA, |
800 | snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); | 851 | WM9081_BIAS_SRC | WM9081_BIAS_ENA); |
801 | 852 | ||
802 | /* VMID 2*4k; Soft VMID ramp enable */ | 853 | /* VMID 2*4k; Soft VMID ramp enable */ |
803 | reg = snd_soc_read(codec, WM9081_VMID_CONTROL); | 854 | snd_soc_update_bits(codec, WM9081_VMID_CONTROL, |
804 | reg |= WM9081_VMID_RAMP | 0x6; | 855 | WM9081_VMID_RAMP | |
805 | snd_soc_write(codec, WM9081_VMID_CONTROL, reg); | 856 | WM9081_VMID_SEL_MASK, |
857 | WM9081_VMID_RAMP | 0x6); | ||
806 | 858 | ||
807 | mdelay(100); | 859 | mdelay(100); |
808 | 860 | ||
809 | /* Normal bias enable & soft start off */ | 861 | /* Normal bias enable & soft start off */ |
810 | reg &= ~WM9081_VMID_RAMP; | 862 | snd_soc_update_bits(codec, WM9081_VMID_CONTROL, |
811 | snd_soc_write(codec, WM9081_VMID_CONTROL, reg); | 863 | WM9081_VMID_RAMP, 0); |
812 | 864 | ||
813 | /* Standard bias source */ | 865 | /* Standard bias source */ |
814 | reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); | 866 | snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, |
815 | reg &= ~WM9081_BIAS_SRC; | 867 | WM9081_BIAS_SRC, 0); |
816 | snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); | ||
817 | } | 868 | } |
818 | 869 | ||
819 | /* VMID 2*240k */ | 870 | /* VMID 2*240k */ |
820 | reg = snd_soc_read(codec, WM9081_VMID_CONTROL); | 871 | snd_soc_update_bits(codec, WM9081_VMID_CONTROL, |
821 | reg &= ~WM9081_VMID_SEL_MASK; | 872 | WM9081_VMID_SEL_MASK, 0x04); |
822 | reg |= 0x04; | ||
823 | snd_soc_write(codec, WM9081_VMID_CONTROL, reg); | ||
824 | 873 | ||
825 | /* Standby bias current on */ | 874 | /* Standby bias current on */ |
826 | reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); | 875 | snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, |
827 | reg |= WM9081_STBY_BIAS_ENA; | 876 | WM9081_STBY_BIAS_ENA, |
828 | snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); | 877 | WM9081_STBY_BIAS_ENA); |
829 | break; | 878 | break; |
830 | 879 | ||
831 | case SND_SOC_BIAS_OFF: | 880 | case SND_SOC_BIAS_OFF: |
832 | /* Startup bias source and disable bias */ | 881 | /* Startup bias source and disable bias */ |
833 | reg = snd_soc_read(codec, WM9081_BIAS_CONTROL_1); | 882 | snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, |
834 | reg |= WM9081_BIAS_SRC; | 883 | WM9081_BIAS_SRC | WM9081_BIAS_ENA, |
835 | reg &= ~WM9081_BIAS_ENA; | 884 | WM9081_BIAS_SRC); |
836 | snd_soc_write(codec, WM9081_BIAS_CONTROL_1, reg); | ||
837 | 885 | ||
838 | /* Disable VMID with soft ramping */ | 886 | /* Disable VMID with soft ramping */ |
839 | reg = snd_soc_read(codec, WM9081_VMID_CONTROL); | 887 | snd_soc_update_bits(codec, WM9081_VMID_CONTROL, |
840 | reg &= ~WM9081_VMID_SEL_MASK; | 888 | WM9081_VMID_RAMP | WM9081_VMID_SEL_MASK, |
841 | reg |= WM9081_VMID_RAMP; | 889 | WM9081_VMID_RAMP); |
842 | snd_soc_write(codec, WM9081_VMID_CONTROL, reg); | ||
843 | 890 | ||
844 | /* Actively discharge LINEOUT */ | 891 | /* Actively discharge LINEOUT */ |
845 | reg = snd_soc_read(codec, WM9081_ANTI_POP_CONTROL); | 892 | snd_soc_update_bits(codec, WM9081_ANTI_POP_CONTROL, |
846 | reg |= WM9081_LINEOUT_DISCH; | 893 | WM9081_LINEOUT_DISCH, |
847 | snd_soc_write(codec, WM9081_ANTI_POP_CONTROL, reg); | 894 | WM9081_LINEOUT_DISCH); |
848 | break; | 895 | break; |
849 | } | 896 | } |
850 | 897 | ||
@@ -1185,7 +1232,7 @@ static int wm9081_set_tdm_slot(struct snd_soc_dai *dai, | |||
1185 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | 1232 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ |
1186 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) | 1233 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
1187 | 1234 | ||
1188 | static struct snd_soc_dai_ops wm9081_dai_ops = { | 1235 | static const struct snd_soc_dai_ops wm9081_dai_ops = { |
1189 | .hw_params = wm9081_hw_params, | 1236 | .hw_params = wm9081_hw_params, |
1190 | .set_fmt = wm9081_set_dai_fmt, | 1237 | .set_fmt = wm9081_set_dai_fmt, |
1191 | .digital_mute = wm9081_digital_mute, | 1238 | .digital_mute = wm9081_digital_mute, |
@@ -1213,25 +1260,14 @@ static int wm9081_probe(struct snd_soc_codec *codec) | |||
1213 | int ret; | 1260 | int ret; |
1214 | u16 reg; | 1261 | u16 reg; |
1215 | 1262 | ||
1216 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, wm9081->control_type); | 1263 | codec->control_data = wm9081->regmap; |
1264 | |||
1265 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP); | ||
1217 | if (ret != 0) { | 1266 | if (ret != 0) { |
1218 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 1267 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
1219 | return ret; | 1268 | return ret; |
1220 | } | 1269 | } |
1221 | 1270 | ||
1222 | reg = snd_soc_read(codec, WM9081_SOFTWARE_RESET); | ||
1223 | if (reg != 0x9081) { | ||
1224 | dev_err(codec->dev, "Device is not a WM9081: ID=0x%x\n", reg); | ||
1225 | ret = -EINVAL; | ||
1226 | return ret; | ||
1227 | } | ||
1228 | |||
1229 | ret = wm9081_reset(codec); | ||
1230 | if (ret < 0) { | ||
1231 | dev_err(codec->dev, "Failed to issue reset\n"); | ||
1232 | return ret; | ||
1233 | } | ||
1234 | |||
1235 | reg = 0; | 1271 | reg = 0; |
1236 | if (wm9081->pdata.irq_high) | 1272 | if (wm9081->pdata.irq_high) |
1237 | reg |= WM9081_IRQ_POL; | 1273 | reg |= WM9081_IRQ_POL; |
@@ -1243,11 +1279,10 @@ static int wm9081_probe(struct snd_soc_codec *codec) | |||
1243 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1279 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1244 | 1280 | ||
1245 | /* Enable zero cross by default */ | 1281 | /* Enable zero cross by default */ |
1246 | reg = snd_soc_read(codec, WM9081_ANALOGUE_LINEOUT); | 1282 | snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT, |
1247 | snd_soc_write(codec, WM9081_ANALOGUE_LINEOUT, reg | WM9081_LINEOUTZC); | 1283 | WM9081_LINEOUTZC, WM9081_LINEOUTZC); |
1248 | reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_PGA); | 1284 | snd_soc_update_bits(codec, WM9081_ANALOGUE_SPEAKER_PGA, |
1249 | snd_soc_write(codec, WM9081_ANALOGUE_SPEAKER_PGA, | 1285 | WM9081_SPKPGAZC, WM9081_SPKPGAZC); |
1250 | reg | WM9081_SPKPGAZC); | ||
1251 | 1286 | ||
1252 | if (!wm9081->pdata.num_retune_configs) { | 1287 | if (!wm9081->pdata.num_retune_configs) { |
1253 | dev_dbg(codec->dev, | 1288 | dev_dbg(codec->dev, |
@@ -1266,7 +1301,7 @@ static int wm9081_remove(struct snd_soc_codec *codec) | |||
1266 | } | 1301 | } |
1267 | 1302 | ||
1268 | #ifdef CONFIG_PM | 1303 | #ifdef CONFIG_PM |
1269 | static int wm9081_suspend(struct snd_soc_codec *codec, pm_message_t state) | 1304 | static int wm9081_suspend(struct snd_soc_codec *codec) |
1270 | { | 1305 | { |
1271 | wm9081_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1306 | wm9081_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1272 | 1307 | ||
@@ -1275,15 +1310,9 @@ static int wm9081_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
1275 | 1310 | ||
1276 | static int wm9081_resume(struct snd_soc_codec *codec) | 1311 | static int wm9081_resume(struct snd_soc_codec *codec) |
1277 | { | 1312 | { |
1278 | u16 *reg_cache = codec->reg_cache; | 1313 | struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); |
1279 | int i; | ||
1280 | |||
1281 | for (i = 0; i < codec->driver->reg_cache_size; i++) { | ||
1282 | if (i == WM9081_SOFTWARE_RESET) | ||
1283 | continue; | ||
1284 | 1314 | ||
1285 | snd_soc_write(codec, i, reg_cache[i]); | 1315 | regcache_sync(wm9081->regmap); |
1286 | } | ||
1287 | 1316 | ||
1288 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1317 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
1289 | 1318 | ||
@@ -1303,11 +1332,6 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9081 = { | |||
1303 | .set_sysclk = wm9081_set_sysclk, | 1332 | .set_sysclk = wm9081_set_sysclk, |
1304 | .set_bias_level = wm9081_set_bias_level, | 1333 | .set_bias_level = wm9081_set_bias_level, |
1305 | 1334 | ||
1306 | .reg_cache_size = ARRAY_SIZE(wm9081_reg_defaults), | ||
1307 | .reg_word_size = sizeof(u16), | ||
1308 | .reg_cache_default = wm9081_reg_defaults, | ||
1309 | .volatile_register = wm9081_volatile_register, | ||
1310 | |||
1311 | .controls = wm9081_snd_controls, | 1335 | .controls = wm9081_snd_controls, |
1312 | .num_controls = ARRAY_SIZE(wm9081_snd_controls), | 1336 | .num_controls = ARRAY_SIZE(wm9081_snd_controls), |
1313 | .dapm_widgets = wm9081_dapm_widgets, | 1337 | .dapm_widgets = wm9081_dapm_widgets, |
@@ -1316,19 +1340,56 @@ static struct snd_soc_codec_driver soc_codec_dev_wm9081 = { | |||
1316 | .num_dapm_routes = ARRAY_SIZE(wm9081_audio_paths), | 1340 | .num_dapm_routes = ARRAY_SIZE(wm9081_audio_paths), |
1317 | }; | 1341 | }; |
1318 | 1342 | ||
1343 | static const struct regmap_config wm9081_regmap = { | ||
1344 | .reg_bits = 8, | ||
1345 | .val_bits = 16, | ||
1346 | |||
1347 | .max_register = WM9081_MAX_REGISTER, | ||
1348 | .reg_defaults = wm9081_reg, | ||
1349 | .num_reg_defaults = ARRAY_SIZE(wm9081_reg), | ||
1350 | .volatile_reg = wm9081_volatile_register, | ||
1351 | .readable_reg = wm9081_readable_register, | ||
1352 | .cache_type = REGCACHE_RBTREE, | ||
1353 | }; | ||
1354 | |||
1319 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 1355 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
1320 | static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, | 1356 | static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, |
1321 | const struct i2c_device_id *id) | 1357 | const struct i2c_device_id *id) |
1322 | { | 1358 | { |
1323 | struct wm9081_priv *wm9081; | 1359 | struct wm9081_priv *wm9081; |
1360 | unsigned int reg; | ||
1324 | int ret; | 1361 | int ret; |
1325 | 1362 | ||
1326 | wm9081 = kzalloc(sizeof(struct wm9081_priv), GFP_KERNEL); | 1363 | wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv), |
1364 | GFP_KERNEL); | ||
1327 | if (wm9081 == NULL) | 1365 | if (wm9081 == NULL) |
1328 | return -ENOMEM; | 1366 | return -ENOMEM; |
1329 | 1367 | ||
1330 | i2c_set_clientdata(i2c, wm9081); | 1368 | i2c_set_clientdata(i2c, wm9081); |
1331 | wm9081->control_type = SND_SOC_I2C; | 1369 | |
1370 | wm9081->regmap = regmap_init_i2c(i2c, &wm9081_regmap); | ||
1371 | if (IS_ERR(wm9081->regmap)) { | ||
1372 | ret = PTR_ERR(wm9081->regmap); | ||
1373 | dev_err(&i2c->dev, "regmap_init() failed: %d\n", ret); | ||
1374 | goto err; | ||
1375 | } | ||
1376 | |||
1377 | ret = regmap_read(wm9081->regmap, WM9081_SOFTWARE_RESET, ®); | ||
1378 | if (ret != 0) { | ||
1379 | dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret); | ||
1380 | goto err_regmap; | ||
1381 | } | ||
1382 | if (reg != 0x9081) { | ||
1383 | dev_err(&i2c->dev, "Device is not a WM9081: ID=0x%x\n", reg); | ||
1384 | ret = -EINVAL; | ||
1385 | goto err_regmap; | ||
1386 | } | ||
1387 | |||
1388 | ret = wm9081_reset(wm9081->regmap); | ||
1389 | if (ret < 0) { | ||
1390 | dev_err(&i2c->dev, "Failed to issue reset\n"); | ||
1391 | goto err_regmap; | ||
1392 | } | ||
1332 | 1393 | ||
1333 | if (dev_get_platdata(&i2c->dev)) | 1394 | if (dev_get_platdata(&i2c->dev)) |
1334 | memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev), | 1395 | memcpy(&wm9081->pdata, dev_get_platdata(&i2c->dev), |
@@ -1337,14 +1398,23 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, | |||
1337 | ret = snd_soc_register_codec(&i2c->dev, | 1398 | ret = snd_soc_register_codec(&i2c->dev, |
1338 | &soc_codec_dev_wm9081, &wm9081_dai, 1); | 1399 | &soc_codec_dev_wm9081, &wm9081_dai, 1); |
1339 | if (ret < 0) | 1400 | if (ret < 0) |
1340 | kfree(wm9081); | 1401 | goto err_regmap; |
1402 | |||
1403 | return 0; | ||
1404 | |||
1405 | err_regmap: | ||
1406 | regmap_exit(wm9081->regmap); | ||
1407 | err: | ||
1408 | |||
1341 | return ret; | 1409 | return ret; |
1342 | } | 1410 | } |
1343 | 1411 | ||
1344 | static __devexit int wm9081_i2c_remove(struct i2c_client *client) | 1412 | static __devexit int wm9081_i2c_remove(struct i2c_client *client) |
1345 | { | 1413 | { |
1414 | struct wm9081_priv *wm9081 = i2c_get_clientdata(client); | ||
1415 | |||
1346 | snd_soc_unregister_codec(&client->dev); | 1416 | snd_soc_unregister_codec(&client->dev); |
1347 | kfree(i2c_get_clientdata(client)); | 1417 | regmap_exit(wm9081->regmap); |
1348 | return 0; | 1418 | return 0; |
1349 | } | 1419 | } |
1350 | 1420 | ||
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index f94c06057c6..41ebe0dce77 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c | |||
@@ -513,18 +513,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec, | |||
513 | case SND_SOC_BIAS_STANDBY: | 513 | case SND_SOC_BIAS_STANDBY: |
514 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 514 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
515 | /* Restore the register cache */ | 515 | /* Restore the register cache */ |
516 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | 516 | snd_soc_cache_sync(codec); |
517 | if (reg_cache[i] == wm9090_reg_defaults[i]) | ||
518 | continue; | ||
519 | if (wm9090_volatile(codec, i)) | ||
520 | continue; | ||
521 | |||
522 | ret = snd_soc_write(codec, i, reg_cache[i]); | ||
523 | if (ret != 0) | ||
524 | dev_warn(codec->dev, | ||
525 | "Failed to restore register %d: %d\n", | ||
526 | i, ret); | ||
527 | } | ||
528 | } | 517 | } |
529 | 518 | ||
530 | /* We keep VMID off during standby since the combination of | 519 | /* We keep VMID off during standby since the combination of |
@@ -604,7 +593,7 @@ static int wm9090_probe(struct snd_soc_codec *codec) | |||
604 | } | 593 | } |
605 | 594 | ||
606 | #ifdef CONFIG_PM | 595 | #ifdef CONFIG_PM |
607 | static int wm9090_suspend(struct snd_soc_codec *codec, pm_message_t state) | 596 | static int wm9090_suspend(struct snd_soc_codec *codec) |
608 | { | 597 | { |
609 | wm9090_set_bias_level(codec, SND_SOC_BIAS_OFF); | 598 | wm9090_set_bias_level(codec, SND_SOC_BIAS_OFF); |
610 | 599 | ||
@@ -647,7 +636,7 @@ static int wm9090_i2c_probe(struct i2c_client *i2c, | |||
647 | struct wm9090_priv *wm9090; | 636 | struct wm9090_priv *wm9090; |
648 | int ret; | 637 | int ret; |
649 | 638 | ||
650 | wm9090 = kzalloc(sizeof(*wm9090), GFP_KERNEL); | 639 | wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL); |
651 | if (wm9090 == NULL) { | 640 | if (wm9090 == NULL) { |
652 | dev_err(&i2c->dev, "Can not allocate memory\n"); | 641 | dev_err(&i2c->dev, "Can not allocate memory\n"); |
653 | return -ENOMEM; | 642 | return -ENOMEM; |
@@ -661,8 +650,6 @@ static int wm9090_i2c_probe(struct i2c_client *i2c, | |||
661 | 650 | ||
662 | ret = snd_soc_register_codec(&i2c->dev, | 651 | ret = snd_soc_register_codec(&i2c->dev, |
663 | &soc_codec_dev_wm9090, NULL, 0); | 652 | &soc_codec_dev_wm9090, NULL, 0); |
664 | if (ret < 0) | ||
665 | kfree(wm9090); | ||
666 | return ret; | 653 | return ret; |
667 | } | 654 | } |
668 | 655 | ||
@@ -671,7 +658,6 @@ static int __devexit wm9090_i2c_remove(struct i2c_client *i2c) | |||
671 | struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c); | 658 | struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c); |
672 | 659 | ||
673 | snd_soc_unregister_codec(&i2c->dev); | 660 | snd_soc_unregister_codec(&i2c->dev); |
674 | kfree(wm9090); | ||
675 | 661 | ||
676 | return 0; | 662 | return 0; |
677 | } | 663 | } |
@@ -685,7 +671,7 @@ MODULE_DEVICE_TABLE(i2c, wm9090_id); | |||
685 | 671 | ||
686 | static struct i2c_driver wm9090_i2c_driver = { | 672 | static struct i2c_driver wm9090_i2c_driver = { |
687 | .driver = { | 673 | .driver = { |
688 | .name = "wm9090-codec", | 674 | .name = "wm9090", |
689 | .owner = THIS_MODULE, | 675 | .owner = THIS_MODULE, |
690 | }, | 676 | }, |
691 | .probe = wm9090_i2c_probe, | 677 | .probe = wm9090_i2c_probe, |
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 646b58dda84..40c92ead85a 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c | |||
@@ -258,7 +258,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, | |||
258 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | 258 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ |
259 | SNDRV_PCM_RATE_48000) | 259 | SNDRV_PCM_RATE_48000) |
260 | 260 | ||
261 | static struct snd_soc_dai_ops wm9705_dai_ops = { | 261 | static const struct snd_soc_dai_ops wm9705_dai_ops = { |
262 | .prepare = ac97_prepare, | 262 | .prepare = ac97_prepare, |
263 | }; | 263 | }; |
264 | 264 | ||
@@ -306,7 +306,7 @@ static int wm9705_reset(struct snd_soc_codec *codec) | |||
306 | } | 306 | } |
307 | 307 | ||
308 | #ifdef CONFIG_PM | 308 | #ifdef CONFIG_PM |
309 | static int wm9705_soc_suspend(struct snd_soc_codec *codec, pm_message_t msg) | 309 | static int wm9705_soc_suspend(struct snd_soc_codec *codec) |
310 | { | 310 | { |
311 | soc_ac97_ops.write(codec->ac97, AC97_POWERDOWN, 0xffff); | 311 | soc_ac97_ops.write(codec->ac97, AC97_POWERDOWN, 0xffff); |
312 | 312 | ||
@@ -406,17 +406,7 @@ static struct platform_driver wm9705_codec_driver = { | |||
406 | .remove = __devexit_p(wm9705_remove), | 406 | .remove = __devexit_p(wm9705_remove), |
407 | }; | 407 | }; |
408 | 408 | ||
409 | static int __init wm9705_init(void) | 409 | module_platform_driver(wm9705_codec_driver); |
410 | { | ||
411 | return platform_driver_register(&wm9705_codec_driver); | ||
412 | } | ||
413 | module_init(wm9705_init); | ||
414 | |||
415 | static void __exit wm9705_exit(void) | ||
416 | { | ||
417 | platform_driver_unregister(&wm9705_codec_driver); | ||
418 | } | ||
419 | module_exit(wm9705_exit); | ||
420 | 410 | ||
421 | MODULE_DESCRIPTION("ASoC WM9705 driver"); | 411 | MODULE_DESCRIPTION("ASoC WM9705 driver"); |
422 | MODULE_AUTHOR("Ian Molton"); | 412 | MODULE_AUTHOR("Ian Molton"); |
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 90117f8156e..b7b31f84c10 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -505,11 +505,11 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
505 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ | 505 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\ |
506 | SNDRV_PCM_RATE_48000) | 506 | SNDRV_PCM_RATE_48000) |
507 | 507 | ||
508 | static struct snd_soc_dai_ops wm9712_dai_ops_hifi = { | 508 | static const struct snd_soc_dai_ops wm9712_dai_ops_hifi = { |
509 | .prepare = ac97_prepare, | 509 | .prepare = ac97_prepare, |
510 | }; | 510 | }; |
511 | 511 | ||
512 | static struct snd_soc_dai_ops wm9712_dai_ops_aux = { | 512 | static const struct snd_soc_dai_ops wm9712_dai_ops_aux = { |
513 | .prepare = ac97_aux_prepare, | 513 | .prepare = ac97_aux_prepare, |
514 | }; | 514 | }; |
515 | 515 | ||
@@ -583,8 +583,7 @@ err: | |||
583 | return -EIO; | 583 | return -EIO; |
584 | } | 584 | } |
585 | 585 | ||
586 | static int wm9712_soc_suspend(struct snd_soc_codec *codec, | 586 | static int wm9712_soc_suspend(struct snd_soc_codec *codec) |
587 | pm_message_t state) | ||
588 | { | 587 | { |
589 | wm9712_set_bias_level(codec, SND_SOC_BIAS_OFF); | 588 | wm9712_set_bias_level(codec, SND_SOC_BIAS_OFF); |
590 | return 0; | 589 | return 0; |
@@ -694,17 +693,7 @@ static struct platform_driver wm9712_codec_driver = { | |||
694 | .remove = __devexit_p(wm9712_remove), | 693 | .remove = __devexit_p(wm9712_remove), |
695 | }; | 694 | }; |
696 | 695 | ||
697 | static int __init wm9712_init(void) | 696 | module_platform_driver(wm9712_codec_driver); |
698 | { | ||
699 | return platform_driver_register(&wm9712_codec_driver); | ||
700 | } | ||
701 | module_init(wm9712_init); | ||
702 | |||
703 | static void __exit wm9712_exit(void) | ||
704 | { | ||
705 | platform_driver_unregister(&wm9712_codec_driver); | ||
706 | } | ||
707 | module_exit(wm9712_exit); | ||
708 | 697 | ||
709 | MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver"); | 698 | MODULE_DESCRIPTION("ASoC WM9711/WM9712 driver"); |
710 | MODULE_AUTHOR("Liam Girdwood"); | 699 | MODULE_AUTHOR("Liam Girdwood"); |
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 7167cb6787d..2b8479bfcd9 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1026,19 +1026,19 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, | |||
1026 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ | 1026 | (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \ |
1027 | SNDRV_PCM_FORMAT_S24_LE) | 1027 | SNDRV_PCM_FORMAT_S24_LE) |
1028 | 1028 | ||
1029 | static struct snd_soc_dai_ops wm9713_dai_ops_hifi = { | 1029 | static const struct snd_soc_dai_ops wm9713_dai_ops_hifi = { |
1030 | .prepare = ac97_hifi_prepare, | 1030 | .prepare = ac97_hifi_prepare, |
1031 | .set_clkdiv = wm9713_set_dai_clkdiv, | 1031 | .set_clkdiv = wm9713_set_dai_clkdiv, |
1032 | .set_pll = wm9713_set_dai_pll, | 1032 | .set_pll = wm9713_set_dai_pll, |
1033 | }; | 1033 | }; |
1034 | 1034 | ||
1035 | static struct snd_soc_dai_ops wm9713_dai_ops_aux = { | 1035 | static const struct snd_soc_dai_ops wm9713_dai_ops_aux = { |
1036 | .prepare = ac97_aux_prepare, | 1036 | .prepare = ac97_aux_prepare, |
1037 | .set_clkdiv = wm9713_set_dai_clkdiv, | 1037 | .set_clkdiv = wm9713_set_dai_clkdiv, |
1038 | .set_pll = wm9713_set_dai_pll, | 1038 | .set_pll = wm9713_set_dai_pll, |
1039 | }; | 1039 | }; |
1040 | 1040 | ||
1041 | static struct snd_soc_dai_ops wm9713_dai_ops_voice = { | 1041 | static const struct snd_soc_dai_ops wm9713_dai_ops_voice = { |
1042 | .hw_params = wm9713_pcm_hw_params, | 1042 | .hw_params = wm9713_pcm_hw_params, |
1043 | .set_clkdiv = wm9713_set_dai_clkdiv, | 1043 | .set_clkdiv = wm9713_set_dai_clkdiv, |
1044 | .set_pll = wm9713_set_dai_pll, | 1044 | .set_pll = wm9713_set_dai_pll, |
@@ -1140,8 +1140,7 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec, | |||
1140 | return 0; | 1140 | return 0; |
1141 | } | 1141 | } |
1142 | 1142 | ||
1143 | static int wm9713_soc_suspend(struct snd_soc_codec *codec, | 1143 | static int wm9713_soc_suspend(struct snd_soc_codec *codec) |
1144 | pm_message_t state) | ||
1145 | { | 1144 | { |
1146 | u16 reg; | 1145 | u16 reg; |
1147 | 1146 | ||
@@ -1277,17 +1276,7 @@ static struct platform_driver wm9713_codec_driver = { | |||
1277 | .remove = __devexit_p(wm9713_remove), | 1276 | .remove = __devexit_p(wm9713_remove), |
1278 | }; | 1277 | }; |
1279 | 1278 | ||
1280 | static int __init wm9713_init(void) | 1279 | module_platform_driver(wm9713_codec_driver); |
1281 | { | ||
1282 | return platform_driver_register(&wm9713_codec_driver); | ||
1283 | } | ||
1284 | module_init(wm9713_init); | ||
1285 | |||
1286 | static void __exit wm9713_exit(void) | ||
1287 | { | ||
1288 | platform_driver_unregister(&wm9713_codec_driver); | ||
1289 | } | ||
1290 | module_exit(wm9713_exit); | ||
1291 | 1280 | ||
1292 | MODULE_DESCRIPTION("ASoC WM9713/WM9714 driver"); | 1281 | MODULE_DESCRIPTION("ASoC WM9713/WM9714 driver"); |
1293 | MODULE_AUTHOR("Liam Girdwood"); | 1282 | MODULE_AUTHOR("Liam Girdwood"); |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 48e61e91240..2a61094075f 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/mfd/wm8994/registers.h> | 20 | #include <linux/mfd/wm8994/registers.h> |
22 | #include <sound/core.h> | 21 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 22 | #include <sound/pcm.h> |
@@ -611,8 +610,8 @@ SND_SOC_DAPM_INPUT("IN1RP"), | |||
611 | SND_SOC_DAPM_INPUT("IN2RN"), | 610 | SND_SOC_DAPM_INPUT("IN2RN"), |
612 | SND_SOC_DAPM_INPUT("IN2RP:VXRP"), | 611 | SND_SOC_DAPM_INPUT("IN2RP:VXRP"), |
613 | 612 | ||
614 | SND_SOC_DAPM_MICBIAS("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0), | 613 | SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0), |
615 | SND_SOC_DAPM_MICBIAS("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0), | 614 | SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0), |
616 | 615 | ||
617 | SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, | 616 | SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, |
618 | in1l_pga, ARRAY_SIZE(in1l_pga)), | 617 | in1l_pga, ARRAY_SIZE(in1l_pga)), |
@@ -654,6 +653,7 @@ SND_SOC_DAPM_MIXER("SPKL Boost", SND_SOC_NOPM, 0, 0, | |||
654 | SND_SOC_DAPM_MIXER("SPKR Boost", SND_SOC_NOPM, 0, 0, | 653 | SND_SOC_DAPM_MIXER("SPKR Boost", SND_SOC_NOPM, 0, 0, |
655 | right_speaker_boost, ARRAY_SIZE(right_speaker_boost)), | 654 | right_speaker_boost, ARRAY_SIZE(right_speaker_boost)), |
656 | 655 | ||
656 | SND_SOC_DAPM_SUPPLY("TSHUT", WM8993_POWER_MANAGEMENT_2, 14, 0, NULL, 0), | ||
657 | SND_SOC_DAPM_PGA("SPKL Driver", WM8993_POWER_MANAGEMENT_1, 12, 0, | 657 | SND_SOC_DAPM_PGA("SPKL Driver", WM8993_POWER_MANAGEMENT_1, 12, 0, |
658 | NULL, 0), | 658 | NULL, 0), |
659 | SND_SOC_DAPM_PGA("SPKR Driver", WM8993_POWER_MANAGEMENT_1, 13, 0, | 659 | SND_SOC_DAPM_PGA("SPKR Driver", WM8993_POWER_MANAGEMENT_1, 13, 0, |
@@ -789,10 +789,12 @@ static const struct snd_soc_dapm_route analogue_routes[] = { | |||
789 | { "SPKL Driver", NULL, "VMID" }, | 789 | { "SPKL Driver", NULL, "VMID" }, |
790 | { "SPKL Driver", NULL, "SPKL Boost" }, | 790 | { "SPKL Driver", NULL, "SPKL Boost" }, |
791 | { "SPKL Driver", NULL, "CLK_SYS" }, | 791 | { "SPKL Driver", NULL, "CLK_SYS" }, |
792 | { "SPKL Driver", NULL, "TSHUT" }, | ||
792 | 793 | ||
793 | { "SPKR Driver", NULL, "VMID" }, | 794 | { "SPKR Driver", NULL, "VMID" }, |
794 | { "SPKR Driver", NULL, "SPKR Boost" }, | 795 | { "SPKR Driver", NULL, "SPKR Boost" }, |
795 | { "SPKR Driver", NULL, "CLK_SYS" }, | 796 | { "SPKR Driver", NULL, "CLK_SYS" }, |
797 | { "SPKR Driver", NULL, "TSHUT" }, | ||
796 | 798 | ||
797 | { "SPKOUTLP", NULL, "SPKL Driver" }, | 799 | { "SPKOUTLP", NULL, "SPKL Driver" }, |
798 | { "SPKOUTLN", NULL, "SPKL Driver" }, | 800 | { "SPKOUTLN", NULL, "SPKL Driver" }, |