diff options
author | Mark Brown <broonie@kernel.org> | 2015-08-30 10:52:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-30 10:52:16 -0400 |
commit | 28becbd59c89cccf26b7539684105437fa77210e (patch) | |
tree | 515a1df93817c4f164d38a75cac4aa6128079df6 | |
parent | cb42e0f709a73caf4d631be32189bb1ca513ad25 (diff) | |
parent | dbe71b9d86ee77cf58a92657c43b0e48954dc62b (diff) |
Merge remote-tracking branch 'asoc/topic/ssm4567' into asoc-next
106 files changed, 1599 insertions, 111 deletions
diff --git a/include/sound/rt298.h b/include/sound/rt298.h new file mode 100644 index 000000000000..7fffeaa84f64 --- /dev/null +++ b/include/sound/rt298.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * linux/sound/rt286.h -- Platform data for RT286 | ||
3 | * | ||
4 | * Copyright 2013 Realtek Microelectronics | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_RT298_H | ||
12 | #define __LINUX_SND_RT298_H | ||
13 | |||
14 | struct rt298_platform_data { | ||
15 | bool cbj_en; /*combo jack enable*/ | ||
16 | bool gpio2_en; /*GPIO2 enable*/ | ||
17 | bool suspend_power_off; /* power is off during suspend */ | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index efaafce8ba38..76125a281557 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -83,6 +83,7 @@ config SND_SOC_ALL_CODECS | |||
83 | select SND_SOC_PCM512x_I2C if I2C | 83 | select SND_SOC_PCM512x_I2C if I2C |
84 | select SND_SOC_PCM512x_SPI if SPI_MASTER | 84 | select SND_SOC_PCM512x_SPI if SPI_MASTER |
85 | select SND_SOC_RT286 if I2C | 85 | select SND_SOC_RT286 if I2C |
86 | select SND_SOC_RT298 if I2C | ||
86 | select SND_SOC_RT5631 if I2C | 87 | select SND_SOC_RT5631 if I2C |
87 | select SND_SOC_RT5640 if I2C | 88 | select SND_SOC_RT5640 if I2C |
88 | select SND_SOC_RT5645 if I2C | 89 | select SND_SOC_RT5645 if I2C |
@@ -512,12 +513,18 @@ config SND_SOC_RL6231 | |||
512 | config SND_SOC_RL6347A | 513 | config SND_SOC_RL6347A |
513 | tristate | 514 | tristate |
514 | default y if SND_SOC_RT286=y | 515 | default y if SND_SOC_RT286=y |
516 | default y if SND_SOC_RT298=y | ||
515 | default m if SND_SOC_RT286=m | 517 | default m if SND_SOC_RT286=m |
518 | default m if SND_SOC_RT298=m | ||
516 | 519 | ||
517 | config SND_SOC_RT286 | 520 | config SND_SOC_RT286 |
518 | tristate | 521 | tristate |
519 | depends on I2C | 522 | depends on I2C |
520 | 523 | ||
524 | config SND_SOC_RT298 | ||
525 | tristate | ||
526 | depends on I2C | ||
527 | |||
521 | config SND_SOC_RT5631 | 528 | config SND_SOC_RT5631 |
522 | tristate "Realtek ALC5631/RT5631 CODEC" | 529 | tristate "Realtek ALC5631/RT5631 CODEC" |
523 | depends on I2C | 530 | depends on I2C |
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index cf160d972cb3..3b58c4571859 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile | |||
@@ -79,6 +79,7 @@ snd-soc-pcm512x-spi-objs := pcm512x-spi.o | |||
79 | snd-soc-rl6231-objs := rl6231.o | 79 | snd-soc-rl6231-objs := rl6231.o |
80 | snd-soc-rl6347a-objs := rl6347a.o | 80 | snd-soc-rl6347a-objs := rl6347a.o |
81 | snd-soc-rt286-objs := rt286.o | 81 | snd-soc-rt286-objs := rt286.o |
82 | snd-soc-rt298-objs := rt298.o | ||
82 | snd-soc-rt5631-objs := rt5631.o | 83 | snd-soc-rt5631-objs := rt5631.o |
83 | snd-soc-rt5640-objs := rt5640.o | 84 | snd-soc-rt5640-objs := rt5640.o |
84 | snd-soc-rt5645-objs := rt5645.o | 85 | snd-soc-rt5645-objs := rt5645.o |
@@ -266,6 +267,7 @@ obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o | |||
266 | obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o | 267 | obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o |
267 | obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o | 268 | obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o |
268 | obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o | 269 | obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o |
270 | obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o | ||
269 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o | 271 | obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o |
270 | obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o | 272 | obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o |
271 | obj-$(CONFIG_SND_SOC_RT5645) += snd-soc-rt5645.o | 273 | obj-$(CONFIG_SND_SOC_RT5645) += snd-soc-rt5645.o |
diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c index a43160254929..6c96860f46de 100644 --- a/sound/soc/codecs/adau1373.c +++ b/sound/soc/codecs/adau1373.c | |||
@@ -1534,7 +1534,6 @@ MODULE_DEVICE_TABLE(i2c, adau1373_i2c_id); | |||
1534 | static struct i2c_driver adau1373_i2c_driver = { | 1534 | static struct i2c_driver adau1373_i2c_driver = { |
1535 | .driver = { | 1535 | .driver = { |
1536 | .name = "adau1373", | 1536 | .name = "adau1373", |
1537 | .owner = THIS_MODULE, | ||
1538 | }, | 1537 | }, |
1539 | .probe = adau1373_i2c_probe, | 1538 | .probe = adau1373_i2c_probe, |
1540 | .remove = adau1373_i2c_remove, | 1539 | .remove = adau1373_i2c_remove, |
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index ff7f846e3b76..de53c0d7bf10 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c | |||
@@ -915,7 +915,6 @@ MODULE_DEVICE_TABLE(i2c, adau1701_i2c_id); | |||
915 | static struct i2c_driver adau1701_i2c_driver = { | 915 | static struct i2c_driver adau1701_i2c_driver = { |
916 | .driver = { | 916 | .driver = { |
917 | .name = "adau1701", | 917 | .name = "adau1701", |
918 | .owner = THIS_MODULE, | ||
919 | .of_match_table = of_match_ptr(adau1701_dt_ids), | 918 | .of_match_table = of_match_ptr(adau1701_dt_ids), |
920 | }, | 919 | }, |
921 | .probe = adau1701_i2c_probe, | 920 | .probe = adau1701_i2c_probe, |
diff --git a/sound/soc/codecs/adau1761-i2c.c b/sound/soc/codecs/adau1761-i2c.c index 862796dec693..348ccb17d3cc 100644 --- a/sound/soc/codecs/adau1761-i2c.c +++ b/sound/soc/codecs/adau1761-i2c.c | |||
@@ -47,7 +47,6 @@ MODULE_DEVICE_TABLE(i2c, adau1761_i2c_ids); | |||
47 | static struct i2c_driver adau1761_i2c_driver = { | 47 | static struct i2c_driver adau1761_i2c_driver = { |
48 | .driver = { | 48 | .driver = { |
49 | .name = "adau1761", | 49 | .name = "adau1761", |
50 | .owner = THIS_MODULE, | ||
51 | }, | 50 | }, |
52 | .probe = adau1761_i2c_probe, | 51 | .probe = adau1761_i2c_probe, |
53 | .remove = adau1761_i2c_remove, | 52 | .remove = adau1761_i2c_remove, |
diff --git a/sound/soc/codecs/adau1781-i2c.c b/sound/soc/codecs/adau1781-i2c.c index 2ce4362ccec1..0e32bba92339 100644 --- a/sound/soc/codecs/adau1781-i2c.c +++ b/sound/soc/codecs/adau1781-i2c.c | |||
@@ -45,7 +45,6 @@ MODULE_DEVICE_TABLE(i2c, adau1781_i2c_ids); | |||
45 | static struct i2c_driver adau1781_i2c_driver = { | 45 | static struct i2c_driver adau1781_i2c_driver = { |
46 | .driver = { | 46 | .driver = { |
47 | .name = "adau1781", | 47 | .name = "adau1781", |
48 | .owner = THIS_MODULE, | ||
49 | }, | 48 | }, |
50 | .probe = adau1781_i2c_probe, | 49 | .probe = adau1781_i2c_probe, |
51 | .remove = adau1781_i2c_remove, | 50 | .remove = adau1781_i2c_remove, |
diff --git a/sound/soc/codecs/adau1977-i2c.c b/sound/soc/codecs/adau1977-i2c.c index 9700e8c838c9..21e7394a972a 100644 --- a/sound/soc/codecs/adau1977-i2c.c +++ b/sound/soc/codecs/adau1977-i2c.c | |||
@@ -46,7 +46,6 @@ MODULE_DEVICE_TABLE(i2c, adau1977_i2c_ids); | |||
46 | static struct i2c_driver adau1977_i2c_driver = { | 46 | static struct i2c_driver adau1977_i2c_driver = { |
47 | .driver = { | 47 | .driver = { |
48 | .name = "adau1977", | 48 | .name = "adau1977", |
49 | .owner = THIS_MODULE, | ||
50 | }, | 49 | }, |
51 | .probe = adau1977_i2c_probe, | 50 | .probe = adau1977_i2c_probe, |
52 | .remove = adau1977_i2c_remove, | 51 | .remove = adau1977_i2c_remove, |
diff --git a/sound/soc/codecs/adav803.c b/sound/soc/codecs/adav803.c index 66d9fce34e62..52881faedcf6 100644 --- a/sound/soc/codecs/adav803.c +++ b/sound/soc/codecs/adav803.c | |||
@@ -36,7 +36,6 @@ static int adav803_remove(struct i2c_client *client) | |||
36 | static struct i2c_driver adav803_driver = { | 36 | static struct i2c_driver adav803_driver = { |
37 | .driver = { | 37 | .driver = { |
38 | .name = "adav803", | 38 | .name = "adav803", |
39 | .owner = THIS_MODULE, | ||
40 | }, | 39 | }, |
41 | .probe = adav803_probe, | 40 | .probe = adav803_probe, |
42 | .remove = adav803_remove, | 41 | .remove = adav803_remove, |
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index 8670861e5bec..54428c64387b 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -444,7 +444,6 @@ MODULE_DEVICE_TABLE(i2c, ak4535_i2c_id); | |||
444 | static struct i2c_driver ak4535_i2c_driver = { | 444 | static struct i2c_driver ak4535_i2c_driver = { |
445 | .driver = { | 445 | .driver = { |
446 | .name = "ak4535", | 446 | .name = "ak4535", |
447 | .owner = THIS_MODULE, | ||
448 | }, | 447 | }, |
449 | .probe = ak4535_i2c_probe, | 448 | .probe = ak4535_i2c_probe, |
450 | .remove = ak4535_i2c_remove, | 449 | .remove = ak4535_i2c_remove, |
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index 2d0ff4595ea0..b14176f8d884 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c | |||
@@ -609,7 +609,6 @@ MODULE_DEVICE_TABLE(i2c, ak4641_i2c_id); | |||
609 | static struct i2c_driver ak4641_i2c_driver = { | 609 | static struct i2c_driver ak4641_i2c_driver = { |
610 | .driver = { | 610 | .driver = { |
611 | .name = "ak4641", | 611 | .name = "ak4641", |
612 | .owner = THIS_MODULE, | ||
613 | }, | 612 | }, |
614 | .probe = ak4641_i2c_probe, | 613 | .probe = ak4641_i2c_probe, |
615 | .remove = ak4641_i2c_remove, | 614 | .remove = ak4641_i2c_remove, |
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 7c0f6552c229..66352f70ac47 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -626,7 +626,6 @@ MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id); | |||
626 | static struct i2c_driver ak4642_i2c_driver = { | 626 | static struct i2c_driver ak4642_i2c_driver = { |
627 | .driver = { | 627 | .driver = { |
628 | .name = "ak4642-codec", | 628 | .name = "ak4642-codec", |
629 | .owner = THIS_MODULE, | ||
630 | .of_match_table = ak4642_of_match, | 629 | .of_match_table = ak4642_of_match, |
631 | }, | 630 | }, |
632 | .probe = ak4642_i2c_probe, | 631 | .probe = ak4642_i2c_probe, |
diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c index 0e59063aeb6f..c73a9f6914b6 100644 --- a/sound/soc/codecs/ak4671.c +++ b/sound/soc/codecs/ak4671.c | |||
@@ -663,7 +663,6 @@ MODULE_DEVICE_TABLE(i2c, ak4671_i2c_id); | |||
663 | static struct i2c_driver ak4671_i2c_driver = { | 663 | static struct i2c_driver ak4671_i2c_driver = { |
664 | .driver = { | 664 | .driver = { |
665 | .name = "ak4671-codec", | 665 | .name = "ak4671-codec", |
666 | .owner = THIS_MODULE, | ||
667 | }, | 666 | }, |
668 | .probe = ak4671_i2c_probe, | 667 | .probe = ak4671_i2c_probe, |
669 | .remove = ak4671_i2c_remove, | 668 | .remove = ak4671_i2c_remove, |
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index 0fc24e0d518c..cf99c4e90acc 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c | |||
@@ -1085,7 +1085,6 @@ MODULE_DEVICE_TABLE(of, alc5623_of_match); | |||
1085 | static struct i2c_driver alc5623_i2c_driver = { | 1085 | static struct i2c_driver alc5623_i2c_driver = { |
1086 | .driver = { | 1086 | .driver = { |
1087 | .name = "alc562x-codec", | 1087 | .name = "alc562x-codec", |
1088 | .owner = THIS_MODULE, | ||
1089 | .of_match_table = of_match_ptr(alc5623_of_match), | 1088 | .of_match_table = of_match_ptr(alc5623_of_match), |
1090 | }, | 1089 | }, |
1091 | .probe = alc5623_i2c_probe, | 1090 | .probe = alc5623_i2c_probe, |
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index 607a63b9705f..9277ac68b696 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c | |||
@@ -1183,7 +1183,6 @@ MODULE_DEVICE_TABLE(of, alc5632_of_match); | |||
1183 | static struct i2c_driver alc5632_i2c_driver = { | 1183 | static struct i2c_driver alc5632_i2c_driver = { |
1184 | .driver = { | 1184 | .driver = { |
1185 | .name = "alc5632", | 1185 | .name = "alc5632", |
1186 | .owner = THIS_MODULE, | ||
1187 | .of_match_table = of_match_ptr(alc5632_of_match), | 1186 | .of_match_table = of_match_ptr(alc5632_of_match), |
1188 | }, | 1187 | }, |
1189 | .probe = alc5632_i2c_probe, | 1188 | .probe = alc5632_i2c_probe, |
diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c index 8f40025b7e7c..76564dc752d3 100644 --- a/sound/soc/codecs/cs35l32.c +++ b/sound/soc/codecs/cs35l32.c | |||
@@ -607,7 +607,6 @@ MODULE_DEVICE_TABLE(i2c, cs35l32_id); | |||
607 | static struct i2c_driver cs35l32_i2c_driver = { | 607 | static struct i2c_driver cs35l32_i2c_driver = { |
608 | .driver = { | 608 | .driver = { |
609 | .name = "cs35l32", | 609 | .name = "cs35l32", |
610 | .owner = THIS_MODULE, | ||
611 | .pm = &cs35l32_runtime_pm, | 610 | .pm = &cs35l32_runtime_pm, |
612 | .of_match_table = cs35l32_of_match, | 611 | .of_match_table = cs35l32_of_match, |
613 | }, | 612 | }, |
diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 8e36198474d9..e42a5038b983 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c | |||
@@ -658,7 +658,6 @@ MODULE_DEVICE_TABLE(i2c, cs4265_id); | |||
658 | static struct i2c_driver cs4265_i2c_driver = { | 658 | static struct i2c_driver cs4265_i2c_driver = { |
659 | .driver = { | 659 | .driver = { |
660 | .name = "cs4265", | 660 | .name = "cs4265", |
661 | .owner = THIS_MODULE, | ||
662 | .of_match_table = cs4265_of_match, | 661 | .of_match_table = cs4265_of_match, |
663 | }, | 662 | }, |
664 | .id_table = cs4265_id, | 663 | .id_table = cs4265_id, |
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index e6d4ff9fd992..e07807d96b68 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c | |||
@@ -751,7 +751,6 @@ MODULE_DEVICE_TABLE(i2c, cs4270_id); | |||
751 | static struct i2c_driver cs4270_i2c_driver = { | 751 | static struct i2c_driver cs4270_i2c_driver = { |
752 | .driver = { | 752 | .driver = { |
753 | .name = "cs4270", | 753 | .name = "cs4270", |
754 | .owner = THIS_MODULE, | ||
755 | .of_match_table = cs4270_of_match, | 754 | .of_match_table = cs4270_of_match, |
756 | }, | 755 | }, |
757 | .id_table = cs4270_id, | 756 | .id_table = cs4270_id, |
diff --git a/sound/soc/codecs/cs4271-i2c.c b/sound/soc/codecs/cs4271-i2c.c index b264da030340..dcb3223d7d8f 100644 --- a/sound/soc/codecs/cs4271-i2c.c +++ b/sound/soc/codecs/cs4271-i2c.c | |||
@@ -48,7 +48,6 @@ MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id); | |||
48 | static struct i2c_driver cs4271_i2c_driver = { | 48 | static struct i2c_driver cs4271_i2c_driver = { |
49 | .driver = { | 49 | .driver = { |
50 | .name = "cs4271", | 50 | .name = "cs4271", |
51 | .owner = THIS_MODULE, | ||
52 | .of_match_table = of_match_ptr(cs4271_dt_ids), | 51 | .of_match_table = of_match_ptr(cs4271_dt_ids), |
53 | }, | 52 | }, |
54 | .probe = cs4271_i2c_probe, | 53 | .probe = cs4271_i2c_probe, |
diff --git a/sound/soc/codecs/cs42l51-i2c.c b/sound/soc/codecs/cs42l51-i2c.c index c40428f25ba5..9bad478474fa 100644 --- a/sound/soc/codecs/cs42l51-i2c.c +++ b/sound/soc/codecs/cs42l51-i2c.c | |||
@@ -45,7 +45,6 @@ static int cs42l51_i2c_remove(struct i2c_client *i2c) | |||
45 | static struct i2c_driver cs42l51_i2c_driver = { | 45 | static struct i2c_driver cs42l51_i2c_driver = { |
46 | .driver = { | 46 | .driver = { |
47 | .name = "cs42l51", | 47 | .name = "cs42l51", |
48 | .owner = THIS_MODULE, | ||
49 | .of_match_table = cs42l51_of_match, | 48 | .of_match_table = cs42l51_of_match, |
50 | }, | 49 | }, |
51 | .probe = cs42l51_i2c_probe, | 50 | .probe = cs42l51_i2c_probe, |
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 4de52c9957ac..b82d8e5b76ed 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c | |||
@@ -1285,7 +1285,6 @@ MODULE_DEVICE_TABLE(i2c, cs42l52_id); | |||
1285 | static struct i2c_driver cs42l52_i2c_driver = { | 1285 | static struct i2c_driver cs42l52_i2c_driver = { |
1286 | .driver = { | 1286 | .driver = { |
1287 | .name = "cs42l52", | 1287 | .name = "cs42l52", |
1288 | .owner = THIS_MODULE, | ||
1289 | .of_match_table = cs42l52_of_match, | 1288 | .of_match_table = cs42l52_of_match, |
1290 | }, | 1289 | }, |
1291 | .id_table = cs42l52_id, | 1290 | .id_table = cs42l52_id, |
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index 1e11ba45a79f..4ae793365985 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c | |||
@@ -1408,7 +1408,6 @@ MODULE_DEVICE_TABLE(i2c, cs42l56_id); | |||
1408 | static struct i2c_driver cs42l56_i2c_driver = { | 1408 | static struct i2c_driver cs42l56_i2c_driver = { |
1409 | .driver = { | 1409 | .driver = { |
1410 | .name = "cs42l56", | 1410 | .name = "cs42l56", |
1411 | .owner = THIS_MODULE, | ||
1412 | .of_match_table = cs42l56_of_match, | 1411 | .of_match_table = cs42l56_of_match, |
1413 | }, | 1412 | }, |
1414 | .id_table = cs42l56_id, | 1413 | .id_table = cs42l56_id, |
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index b7853b9d3a60..7cb1d7091dae 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c | |||
@@ -1491,7 +1491,6 @@ MODULE_DEVICE_TABLE(i2c, cs42l73_id); | |||
1491 | static struct i2c_driver cs42l73_i2c_driver = { | 1491 | static struct i2c_driver cs42l73_i2c_driver = { |
1492 | .driver = { | 1492 | .driver = { |
1493 | .name = "cs42l73", | 1493 | .name = "cs42l73", |
1494 | .owner = THIS_MODULE, | ||
1495 | .of_match_table = cs42l73_of_match, | 1494 | .of_match_table = cs42l73_of_match, |
1496 | }, | 1495 | }, |
1497 | .id_table = cs42l73_id, | 1496 | .id_table = cs42l73_id, |
diff --git a/sound/soc/codecs/cs42xx8-i2c.c b/sound/soc/codecs/cs42xx8-i2c.c index 657dce27eade..800c1d549347 100644 --- a/sound/soc/codecs/cs42xx8-i2c.c +++ b/sound/soc/codecs/cs42xx8-i2c.c | |||
@@ -20,7 +20,7 @@ | |||
20 | static int cs42xx8_i2c_probe(struct i2c_client *i2c, | 20 | static int cs42xx8_i2c_probe(struct i2c_client *i2c, |
21 | const struct i2c_device_id *id) | 21 | const struct i2c_device_id *id) |
22 | { | 22 | { |
23 | u32 ret = cs42xx8_probe(&i2c->dev, | 23 | int ret = cs42xx8_probe(&i2c->dev, |
24 | devm_regmap_init_i2c(i2c, &cs42xx8_regmap_config)); | 24 | devm_regmap_init_i2c(i2c, &cs42xx8_regmap_config)); |
25 | if (ret) | 25 | if (ret) |
26 | return ret; | 26 | return ret; |
@@ -49,8 +49,8 @@ MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id); | |||
49 | static struct i2c_driver cs42xx8_i2c_driver = { | 49 | static struct i2c_driver cs42xx8_i2c_driver = { |
50 | .driver = { | 50 | .driver = { |
51 | .name = "cs42xx8", | 51 | .name = "cs42xx8", |
52 | .owner = THIS_MODULE, | ||
53 | .pm = &cs42xx8_pm, | 52 | .pm = &cs42xx8_pm, |
53 | .of_match_table = cs42xx8_of_match, | ||
54 | }, | 54 | }, |
55 | .probe = cs42xx8_i2c_probe, | 55 | .probe = cs42xx8_i2c_probe, |
56 | .remove = cs42xx8_i2c_remove, | 56 | .remove = cs42xx8_i2c_remove, |
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index e1d46862e81f..d562e1b9a5d1 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c | |||
@@ -425,7 +425,7 @@ const struct cs42xx8_driver_data cs42888_data = { | |||
425 | }; | 425 | }; |
426 | EXPORT_SYMBOL_GPL(cs42888_data); | 426 | EXPORT_SYMBOL_GPL(cs42888_data); |
427 | 427 | ||
428 | static const struct of_device_id cs42xx8_of_match[] = { | 428 | const struct of_device_id cs42xx8_of_match[] = { |
429 | { .compatible = "cirrus,cs42448", .data = &cs42448_data, }, | 429 | { .compatible = "cirrus,cs42448", .data = &cs42448_data, }, |
430 | { .compatible = "cirrus,cs42888", .data = &cs42888_data, }, | 430 | { .compatible = "cirrus,cs42888", .data = &cs42888_data, }, |
431 | { /* sentinel */ } | 431 | { /* sentinel */ } |
@@ -435,16 +435,24 @@ EXPORT_SYMBOL_GPL(cs42xx8_of_match); | |||
435 | 435 | ||
436 | int cs42xx8_probe(struct device *dev, struct regmap *regmap) | 436 | int cs42xx8_probe(struct device *dev, struct regmap *regmap) |
437 | { | 437 | { |
438 | const struct of_device_id *of_id = of_match_device(cs42xx8_of_match, dev); | 438 | const struct of_device_id *of_id; |
439 | struct cs42xx8_priv *cs42xx8; | 439 | struct cs42xx8_priv *cs42xx8; |
440 | int ret, val, i; | 440 | int ret, val, i; |
441 | 441 | ||
442 | if (IS_ERR(regmap)) { | ||
443 | ret = PTR_ERR(regmap); | ||
444 | dev_err(dev, "failed to allocate regmap: %d\n", ret); | ||
445 | return ret; | ||
446 | } | ||
447 | |||
442 | cs42xx8 = devm_kzalloc(dev, sizeof(*cs42xx8), GFP_KERNEL); | 448 | cs42xx8 = devm_kzalloc(dev, sizeof(*cs42xx8), GFP_KERNEL); |
443 | if (cs42xx8 == NULL) | 449 | if (cs42xx8 == NULL) |
444 | return -ENOMEM; | 450 | return -ENOMEM; |
445 | 451 | ||
452 | cs42xx8->regmap = regmap; | ||
446 | dev_set_drvdata(dev, cs42xx8); | 453 | dev_set_drvdata(dev, cs42xx8); |
447 | 454 | ||
455 | of_id = of_match_device(cs42xx8_of_match, dev); | ||
448 | if (of_id) | 456 | if (of_id) |
449 | cs42xx8->drvdata = of_id->data; | 457 | cs42xx8->drvdata = of_id->data; |
450 | 458 | ||
@@ -482,13 +490,6 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap) | |||
482 | /* Make sure hardware reset done */ | 490 | /* Make sure hardware reset done */ |
483 | msleep(5); | 491 | msleep(5); |
484 | 492 | ||
485 | cs42xx8->regmap = regmap; | ||
486 | if (IS_ERR(cs42xx8->regmap)) { | ||
487 | ret = PTR_ERR(cs42xx8->regmap); | ||
488 | dev_err(dev, "failed to allocate regmap: %d\n", ret); | ||
489 | goto err_enable; | ||
490 | } | ||
491 | |||
492 | /* | 493 | /* |
493 | * We haven't marked the chip revision as volatile due to | 494 | * We haven't marked the chip revision as volatile due to |
494 | * sharing a register with the right input volume; explicitly | 495 | * sharing a register with the right input volume; explicitly |
diff --git a/sound/soc/codecs/cs42xx8.h b/sound/soc/codecs/cs42xx8.h index b2c10e537ef6..d36c61b6df74 100644 --- a/sound/soc/codecs/cs42xx8.h +++ b/sound/soc/codecs/cs42xx8.h | |||
@@ -22,6 +22,7 @@ extern const struct dev_pm_ops cs42xx8_pm; | |||
22 | extern const struct cs42xx8_driver_data cs42448_data; | 22 | extern const struct cs42xx8_driver_data cs42448_data; |
23 | extern const struct cs42xx8_driver_data cs42888_data; | 23 | extern const struct cs42xx8_driver_data cs42888_data; |
24 | extern const struct regmap_config cs42xx8_regmap_config; | 24 | extern const struct regmap_config cs42xx8_regmap_config; |
25 | extern const struct of_device_id cs42xx8_of_match[]; | ||
25 | int cs42xx8_probe(struct device *dev, struct regmap *regmap); | 26 | int cs42xx8_probe(struct device *dev, struct regmap *regmap); |
26 | 27 | ||
27 | /* CS42888 register map */ | 28 | /* CS42888 register map */ |
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 21810e5f3321..9c7b41a8642d 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c | |||
@@ -1259,7 +1259,6 @@ MODULE_DEVICE_TABLE(i2c, da7210_i2c_id); | |||
1259 | static struct i2c_driver da7210_i2c_driver = { | 1259 | static struct i2c_driver da7210_i2c_driver = { |
1260 | .driver = { | 1260 | .driver = { |
1261 | .name = "da7210", | 1261 | .name = "da7210", |
1262 | .owner = THIS_MODULE, | ||
1263 | }, | 1262 | }, |
1264 | .probe = da7210_i2c_probe, | 1263 | .probe = da7210_i2c_probe, |
1265 | .remove = da7210_i2c_remove, | 1264 | .remove = da7210_i2c_remove, |
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 238e48a3a4fe..f635401b7730 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c | |||
@@ -1585,7 +1585,6 @@ MODULE_DEVICE_TABLE(i2c, da7213_i2c_id); | |||
1585 | static struct i2c_driver da7213_i2c_driver = { | 1585 | static struct i2c_driver da7213_i2c_driver = { |
1586 | .driver = { | 1586 | .driver = { |
1587 | .name = "da7213", | 1587 | .name = "da7213", |
1588 | .owner = THIS_MODULE, | ||
1589 | }, | 1588 | }, |
1590 | .probe = da7213_i2c_probe, | 1589 | .probe = da7213_i2c_probe, |
1591 | .remove = da7213_remove, | 1590 | .remove = da7213_remove, |
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index 207523686bd5..5446d047d2de 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c | |||
@@ -1572,7 +1572,6 @@ MODULE_DEVICE_TABLE(i2c, da732x_i2c_id); | |||
1572 | static struct i2c_driver da732x_i2c_driver = { | 1572 | static struct i2c_driver da732x_i2c_driver = { |
1573 | .driver = { | 1573 | .driver = { |
1574 | .name = "da7320", | 1574 | .name = "da7320", |
1575 | .owner = THIS_MODULE, | ||
1576 | }, | 1575 | }, |
1577 | .probe = da732x_i2c_probe, | 1576 | .probe = da732x_i2c_probe, |
1578 | .remove = da732x_i2c_remove, | 1577 | .remove = da732x_i2c_remove, |
diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c index 66bb446473b8..7d5baa66b132 100644 --- a/sound/soc/codecs/da9055.c +++ b/sound/soc/codecs/da9055.c | |||
@@ -1538,7 +1538,6 @@ static const struct of_device_id da9055_of_match[] = { | |||
1538 | static struct i2c_driver da9055_i2c_driver = { | 1538 | static struct i2c_driver da9055_i2c_driver = { |
1539 | .driver = { | 1539 | .driver = { |
1540 | .name = "da9055-codec", | 1540 | .name = "da9055-codec", |
1541 | .owner = THIS_MODULE, | ||
1542 | .of_match_table = of_match_ptr(da9055_of_match), | 1541 | .of_match_table = of_match_ptr(da9055_of_match), |
1543 | }, | 1542 | }, |
1544 | .probe = da9055_i2c_probe, | 1543 | .probe = da9055_i2c_probe, |
diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index ebd90283c960..58a43b11eb7e 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c | |||
@@ -1149,7 +1149,6 @@ MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id); | |||
1149 | static struct i2c_driver isabelle_i2c_driver = { | 1149 | static struct i2c_driver isabelle_i2c_driver = { |
1150 | .driver = { | 1150 | .driver = { |
1151 | .name = "isabelle", | 1151 | .name = "isabelle", |
1152 | .owner = THIS_MODULE, | ||
1153 | }, | 1152 | }, |
1154 | .probe = isabelle_i2c_probe, | 1153 | .probe = isabelle_i2c_probe, |
1155 | .remove = isabelle_i2c_remove, | 1154 | .remove = isabelle_i2c_remove, |
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c index 99ffc49aa779..558de1053f73 100644 --- a/sound/soc/codecs/lm4857.c +++ b/sound/soc/codecs/lm4857.c | |||
@@ -142,7 +142,6 @@ MODULE_DEVICE_TABLE(i2c, lm4857_i2c_id); | |||
142 | static struct i2c_driver lm4857_i2c_driver = { | 142 | static struct i2c_driver lm4857_i2c_driver = { |
143 | .driver = { | 143 | .driver = { |
144 | .name = "lm4857", | 144 | .name = "lm4857", |
145 | .owner = THIS_MODULE, | ||
146 | }, | 145 | }, |
147 | .probe = lm4857_i2c_probe, | 146 | .probe = lm4857_i2c_probe, |
148 | .id_table = lm4857_i2c_id, | 147 | .id_table = lm4857_i2c_id, |
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c index 6600aa0a33dc..9b2e38395eb9 100644 --- a/sound/soc/codecs/lm49453.c +++ b/sound/soc/codecs/lm49453.c | |||
@@ -1460,7 +1460,6 @@ MODULE_DEVICE_TABLE(i2c, lm49453_i2c_id); | |||
1460 | static struct i2c_driver lm49453_i2c_driver = { | 1460 | static struct i2c_driver lm49453_i2c_driver = { |
1461 | .driver = { | 1461 | .driver = { |
1462 | .name = "lm49453", | 1462 | .name = "lm49453", |
1463 | .owner = THIS_MODULE, | ||
1464 | }, | 1463 | }, |
1465 | .probe = lm49453_i2c_probe, | 1464 | .probe = lm49453_i2c_probe, |
1466 | .remove = lm49453_i2c_remove, | 1465 | .remove = lm49453_i2c_remove, |
diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c index e1c196a41930..1526aef2f2a9 100644 --- a/sound/soc/codecs/max9768.c +++ b/sound/soc/codecs/max9768.c | |||
@@ -242,7 +242,6 @@ MODULE_DEVICE_TABLE(i2c, max9768_i2c_id); | |||
242 | static struct i2c_driver max9768_i2c_driver = { | 242 | static struct i2c_driver max9768_i2c_driver = { |
243 | .driver = { | 243 | .driver = { |
244 | .name = "max9768", | 244 | .name = "max9768", |
245 | .owner = THIS_MODULE, | ||
246 | }, | 245 | }, |
247 | .probe = max9768_i2c_probe, | 246 | .probe = max9768_i2c_probe, |
248 | .remove = max9768_i2c_remove, | 247 | .remove = max9768_i2c_remove, |
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index d0f45348bfbb..99c2daa0eebf 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -2011,7 +2011,6 @@ MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); | |||
2011 | static struct i2c_driver max98088_i2c_driver = { | 2011 | static struct i2c_driver max98088_i2c_driver = { |
2012 | .driver = { | 2012 | .driver = { |
2013 | .name = "max98088", | 2013 | .name = "max98088", |
2014 | .owner = THIS_MODULE, | ||
2015 | }, | 2014 | }, |
2016 | .probe = max98088_i2c_probe, | 2015 | .probe = max98088_i2c_probe, |
2017 | .remove = max98088_i2c_remove, | 2016 | .remove = max98088_i2c_remove, |
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 2a4c2e12972a..c09196f951f6 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -2748,7 +2748,6 @@ MODULE_DEVICE_TABLE(acpi, max98090_acpi_match); | |||
2748 | static struct i2c_driver max98090_i2c_driver = { | 2748 | static struct i2c_driver max98090_i2c_driver = { |
2749 | .driver = { | 2749 | .driver = { |
2750 | .name = "max98090", | 2750 | .name = "max98090", |
2751 | .owner = THIS_MODULE, | ||
2752 | .pm = &max98090_pm, | 2751 | .pm = &max98090_pm, |
2753 | .of_match_table = of_match_ptr(max98090_of_match), | 2752 | .of_match_table = of_match_ptr(max98090_of_match), |
2754 | .acpi_match_table = ACPI_PTR(max98090_acpi_match), | 2753 | .acpi_match_table = ACPI_PTR(max98090_acpi_match), |
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 9a46d3dcf703..ea45c355d324 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c | |||
@@ -2431,7 +2431,6 @@ MODULE_DEVICE_TABLE(of, max98095_of_match); | |||
2431 | static struct i2c_driver max98095_i2c_driver = { | 2431 | static struct i2c_driver max98095_i2c_driver = { |
2432 | .driver = { | 2432 | .driver = { |
2433 | .name = "max98095", | 2433 | .name = "max98095", |
2434 | .owner = THIS_MODULE, | ||
2435 | .of_match_table = of_match_ptr(max98095_of_match), | 2434 | .of_match_table = of_match_ptr(max98095_of_match), |
2436 | }, | 2435 | }, |
2437 | .probe = max98095_i2c_probe, | 2436 | .probe = max98095_i2c_probe, |
diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c index 481d58f1cb3f..7c990521638c 100644 --- a/sound/soc/codecs/max9850.c +++ b/sound/soc/codecs/max9850.c | |||
@@ -352,7 +352,6 @@ MODULE_DEVICE_TABLE(i2c, max9850_i2c_id); | |||
352 | static struct i2c_driver max9850_i2c_driver = { | 352 | static struct i2c_driver max9850_i2c_driver = { |
353 | .driver = { | 353 | .driver = { |
354 | .name = "max9850", | 354 | .name = "max9850", |
355 | .owner = THIS_MODULE, | ||
356 | }, | 355 | }, |
357 | .probe = max9850_i2c_probe, | 356 | .probe = max9850_i2c_probe, |
358 | .remove = max9850_i2c_remove, | 357 | .remove = max9850_i2c_remove, |
diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c index 29549cdbf4c1..7692623ad5c3 100644 --- a/sound/soc/codecs/max9877.c +++ b/sound/soc/codecs/max9877.c | |||
@@ -174,7 +174,6 @@ MODULE_DEVICE_TABLE(i2c, max9877_i2c_id); | |||
174 | static struct i2c_driver max9877_i2c_driver = { | 174 | static struct i2c_driver max9877_i2c_driver = { |
175 | .driver = { | 175 | .driver = { |
176 | .name = "max9877", | 176 | .name = "max9877", |
177 | .owner = THIS_MODULE, | ||
178 | }, | 177 | }, |
179 | .probe = max9877_i2c_probe, | 178 | .probe = max9877_i2c_probe, |
180 | .remove = max9877_i2c_remove, | 179 | .remove = max9877_i2c_remove, |
diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c index aad664225dc3..ce551eecbf95 100644 --- a/sound/soc/codecs/max98925.c +++ b/sound/soc/codecs/max98925.c | |||
@@ -639,7 +639,6 @@ MODULE_DEVICE_TABLE(of, max98925_of_match); | |||
639 | static struct i2c_driver max98925_i2c_driver = { | 639 | static struct i2c_driver max98925_i2c_driver = { |
640 | .driver = { | 640 | .driver = { |
641 | .name = "max98925", | 641 | .name = "max98925", |
642 | .owner = THIS_MODULE, | ||
643 | .of_match_table = of_match_ptr(max98925_of_match), | 642 | .of_match_table = of_match_ptr(max98925_of_match), |
644 | .pm = NULL, | 643 | .pm = NULL, |
645 | }, | 644 | }, |
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c index b74118e019fb..bda2bd751be4 100644 --- a/sound/soc/codecs/ml26124.c +++ b/sound/soc/codecs/ml26124.c | |||
@@ -597,7 +597,6 @@ MODULE_DEVICE_TABLE(i2c, ml26124_i2c_id); | |||
597 | static struct i2c_driver ml26124_i2c_driver = { | 597 | static struct i2c_driver ml26124_i2c_driver = { |
598 | .driver = { | 598 | .driver = { |
599 | .name = "ml26124", | 599 | .name = "ml26124", |
600 | .owner = THIS_MODULE, | ||
601 | }, | 600 | }, |
602 | .probe = ml26124_i2c_probe, | 601 | .probe = ml26124_i2c_probe, |
603 | .remove = ml26124_i2c_remove, | 602 | .remove = ml26124_i2c_remove, |
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c index 490970e5ab8c..58325234285c 100644 --- a/sound/soc/codecs/pcm1681.c +++ b/sound/soc/codecs/pcm1681.c | |||
@@ -335,7 +335,6 @@ static int pcm1681_i2c_remove(struct i2c_client *client) | |||
335 | static struct i2c_driver pcm1681_i2c_driver = { | 335 | static struct i2c_driver pcm1681_i2c_driver = { |
336 | .driver = { | 336 | .driver = { |
337 | .name = "pcm1681", | 337 | .name = "pcm1681", |
338 | .owner = THIS_MODULE, | ||
339 | .of_match_table = of_match_ptr(pcm1681_dt_ids), | 338 | .of_match_table = of_match_ptr(pcm1681_dt_ids), |
340 | }, | 339 | }, |
341 | .id_table = pcm1681_i2c_id, | 340 | .id_table = pcm1681_i2c_id, |
diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c index dcdfac0ffeb1..dbff416e38be 100644 --- a/sound/soc/codecs/pcm512x-i2c.c +++ b/sound/soc/codecs/pcm512x-i2c.c | |||
@@ -67,7 +67,6 @@ static struct i2c_driver pcm512x_i2c_driver = { | |||
67 | .id_table = pcm512x_i2c_id, | 67 | .id_table = pcm512x_i2c_id, |
68 | .driver = { | 68 | .driver = { |
69 | .name = "pcm512x", | 69 | .name = "pcm512x", |
70 | .owner = THIS_MODULE, | ||
71 | .of_match_table = pcm512x_of_match, | 70 | .of_match_table = pcm512x_of_match, |
72 | .pm = &pcm512x_pm_ops, | 71 | .pm = &pcm512x_pm_ops, |
73 | }, | 72 | }, |
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 5c43e263b2c1..83029e461309 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c | |||
@@ -1259,7 +1259,6 @@ static int rt286_i2c_remove(struct i2c_client *i2c) | |||
1259 | static struct i2c_driver rt286_i2c_driver = { | 1259 | static struct i2c_driver rt286_i2c_driver = { |
1260 | .driver = { | 1260 | .driver = { |
1261 | .name = "rt286", | 1261 | .name = "rt286", |
1262 | .owner = THIS_MODULE, | ||
1263 | .acpi_match_table = ACPI_PTR(rt286_acpi_match), | 1262 | .acpi_match_table = ACPI_PTR(rt286_acpi_match), |
1264 | }, | 1263 | }, |
1265 | .probe = rt286_i2c_probe, | 1264 | .probe = rt286_i2c_probe, |
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c new file mode 100644 index 000000000000..75e5679dfef8 --- /dev/null +++ b/sound/soc/codecs/rt298.c | |||
@@ -0,0 +1,1273 @@ | |||
1 | /* | ||
2 | * rt298.c -- RT298 ALSA SoC audio codec driver | ||
3 | * | ||
4 | * Copyright 2015 Realtek Semiconductor Corp. | ||
5 | * Author: Bard Liao <bardliao@realtek.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/moduleparam.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/pm.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/spi/spi.h> | ||
20 | #include <linux/acpi.h> | ||
21 | #include <sound/core.h> | ||
22 | #include <sound/pcm.h> | ||
23 | #include <sound/pcm_params.h> | ||
24 | #include <sound/soc.h> | ||
25 | #include <sound/soc-dapm.h> | ||
26 | #include <sound/initval.h> | ||
27 | #include <sound/tlv.h> | ||
28 | #include <sound/jack.h> | ||
29 | #include <linux/workqueue.h> | ||
30 | #include <sound/rt298.h> | ||
31 | #include <sound/hda_verbs.h> | ||
32 | |||
33 | #include "rl6347a.h" | ||
34 | #include "rt298.h" | ||
35 | |||
36 | #define RT298_VENDOR_ID 0x10ec0298 | ||
37 | |||
38 | struct rt298_priv { | ||
39 | struct reg_default *index_cache; | ||
40 | int index_cache_size; | ||
41 | struct regmap *regmap; | ||
42 | struct snd_soc_codec *codec; | ||
43 | struct rt298_platform_data pdata; | ||
44 | struct i2c_client *i2c; | ||
45 | struct snd_soc_jack *jack; | ||
46 | struct delayed_work jack_detect_work; | ||
47 | int sys_clk; | ||
48 | int clk_id; | ||
49 | int is_hp_in; | ||
50 | }; | ||
51 | |||
52 | static struct reg_default rt298_index_def[] = { | ||
53 | { 0x01, 0xaaaa }, | ||
54 | { 0x02, 0x8aaa }, | ||
55 | { 0x03, 0x0002 }, | ||
56 | { 0x04, 0xaf01 }, | ||
57 | { 0x08, 0x000d }, | ||
58 | { 0x09, 0xd810 }, | ||
59 | { 0x0a, 0x0120 }, | ||
60 | { 0x0b, 0x0000 }, | ||
61 | { 0x0d, 0x2800 }, | ||
62 | { 0x0f, 0x0000 }, | ||
63 | { 0x19, 0x0a17 }, | ||
64 | { 0x20, 0x0020 }, | ||
65 | { 0x33, 0x0208 }, | ||
66 | { 0x46, 0x0300 }, | ||
67 | { 0x49, 0x0004 }, | ||
68 | { 0x4f, 0x50e9 }, | ||
69 | { 0x50, 0x2000 }, | ||
70 | { 0x63, 0x2902 }, | ||
71 | { 0x67, 0x1111 }, | ||
72 | { 0x68, 0x1016 }, | ||
73 | { 0x69, 0x273f }, | ||
74 | }; | ||
75 | #define INDEX_CACHE_SIZE ARRAY_SIZE(rt298_index_def) | ||
76 | |||
77 | static const struct reg_default rt298_reg[] = { | ||
78 | { 0x00170500, 0x00000400 }, | ||
79 | { 0x00220000, 0x00000031 }, | ||
80 | { 0x00239000, 0x0000007f }, | ||
81 | { 0x0023a000, 0x0000007f }, | ||
82 | { 0x00270500, 0x00000400 }, | ||
83 | { 0x00370500, 0x00000400 }, | ||
84 | { 0x00870500, 0x00000400 }, | ||
85 | { 0x00920000, 0x00000031 }, | ||
86 | { 0x00935000, 0x000000c3 }, | ||
87 | { 0x00936000, 0x000000c3 }, | ||
88 | { 0x00970500, 0x00000400 }, | ||
89 | { 0x00b37000, 0x00000097 }, | ||
90 | { 0x00b37200, 0x00000097 }, | ||
91 | { 0x00b37300, 0x00000097 }, | ||
92 | { 0x00c37000, 0x00000000 }, | ||
93 | { 0x00c37100, 0x00000080 }, | ||
94 | { 0x01270500, 0x00000400 }, | ||
95 | { 0x01370500, 0x00000400 }, | ||
96 | { 0x01371f00, 0x411111f0 }, | ||
97 | { 0x01439000, 0x00000080 }, | ||
98 | { 0x0143a000, 0x00000080 }, | ||
99 | { 0x01470700, 0x00000000 }, | ||
100 | { 0x01470500, 0x00000400 }, | ||
101 | { 0x01470c00, 0x00000000 }, | ||
102 | { 0x01470100, 0x00000000 }, | ||
103 | { 0x01837000, 0x00000000 }, | ||
104 | { 0x01870500, 0x00000400 }, | ||
105 | { 0x02050000, 0x00000000 }, | ||
106 | { 0x02139000, 0x00000080 }, | ||
107 | { 0x0213a000, 0x00000080 }, | ||
108 | { 0x02170100, 0x00000000 }, | ||
109 | { 0x02170500, 0x00000400 }, | ||
110 | { 0x02170700, 0x00000000 }, | ||
111 | { 0x02270100, 0x00000000 }, | ||
112 | { 0x02370100, 0x00000000 }, | ||
113 | { 0x01870700, 0x00000020 }, | ||
114 | { 0x00830000, 0x000000c3 }, | ||
115 | { 0x00930000, 0x000000c3 }, | ||
116 | { 0x01270700, 0x00000000 }, | ||
117 | }; | ||
118 | |||
119 | static bool rt298_volatile_register(struct device *dev, unsigned int reg) | ||
120 | { | ||
121 | switch (reg) { | ||
122 | case 0 ... 0xff: | ||
123 | case RT298_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID): | ||
124 | case RT298_GET_HP_SENSE: | ||
125 | case RT298_GET_MIC1_SENSE: | ||
126 | case RT298_PROC_COEF: | ||
127 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_MIC1, 0): | ||
128 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_SPK_OUT, 0): | ||
129 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0): | ||
130 | return true; | ||
131 | default: | ||
132 | return true; | ||
133 | } | ||
134 | |||
135 | |||
136 | } | ||
137 | |||
138 | static bool rt298_readable_register(struct device *dev, unsigned int reg) | ||
139 | { | ||
140 | switch (reg) { | ||
141 | case 0 ... 0xff: | ||
142 | case RT298_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID): | ||
143 | case RT298_GET_HP_SENSE: | ||
144 | case RT298_GET_MIC1_SENSE: | ||
145 | case RT298_SET_AUDIO_POWER: | ||
146 | case RT298_SET_HPO_POWER: | ||
147 | case RT298_SET_SPK_POWER: | ||
148 | case RT298_SET_DMIC1_POWER: | ||
149 | case RT298_SPK_MUX: | ||
150 | case RT298_HPO_MUX: | ||
151 | case RT298_ADC0_MUX: | ||
152 | case RT298_ADC1_MUX: | ||
153 | case RT298_SET_MIC1: | ||
154 | case RT298_SET_PIN_HPO: | ||
155 | case RT298_SET_PIN_SPK: | ||
156 | case RT298_SET_PIN_DMIC1: | ||
157 | case RT298_SPK_EAPD: | ||
158 | case RT298_SET_AMP_GAIN_HPO: | ||
159 | case RT298_SET_DMIC2_DEFAULT: | ||
160 | case RT298_DACL_GAIN: | ||
161 | case RT298_DACR_GAIN: | ||
162 | case RT298_ADCL_GAIN: | ||
163 | case RT298_ADCR_GAIN: | ||
164 | case RT298_MIC_GAIN: | ||
165 | case RT298_SPOL_GAIN: | ||
166 | case RT298_SPOR_GAIN: | ||
167 | case RT298_HPOL_GAIN: | ||
168 | case RT298_HPOR_GAIN: | ||
169 | case RT298_F_DAC_SWITCH: | ||
170 | case RT298_F_RECMIX_SWITCH: | ||
171 | case RT298_REC_MIC_SWITCH: | ||
172 | case RT298_REC_I2S_SWITCH: | ||
173 | case RT298_REC_LINE_SWITCH: | ||
174 | case RT298_REC_BEEP_SWITCH: | ||
175 | case RT298_DAC_FORMAT: | ||
176 | case RT298_ADC_FORMAT: | ||
177 | case RT298_COEF_INDEX: | ||
178 | case RT298_PROC_COEF: | ||
179 | case RT298_SET_AMP_GAIN_ADC_IN1: | ||
180 | case RT298_SET_AMP_GAIN_ADC_IN2: | ||
181 | case RT298_SET_POWER(RT298_DAC_OUT1): | ||
182 | case RT298_SET_POWER(RT298_DAC_OUT2): | ||
183 | case RT298_SET_POWER(RT298_ADC_IN1): | ||
184 | case RT298_SET_POWER(RT298_ADC_IN2): | ||
185 | case RT298_SET_POWER(RT298_DMIC2): | ||
186 | case RT298_SET_POWER(RT298_MIC1): | ||
187 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_MIC1, 0): | ||
188 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_SPK_OUT, 0): | ||
189 | case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0): | ||
190 | return true; | ||
191 | default: | ||
192 | return false; | ||
193 | } | ||
194 | } | ||
195 | |||
196 | #ifdef CONFIG_PM | ||
197 | static void rt298_index_sync(struct snd_soc_codec *codec) | ||
198 | { | ||
199 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
200 | int i; | ||
201 | |||
202 | for (i = 0; i < INDEX_CACHE_SIZE; i++) { | ||
203 | snd_soc_write(codec, rt298->index_cache[i].reg, | ||
204 | rt298->index_cache[i].def); | ||
205 | } | ||
206 | } | ||
207 | #endif | ||
208 | |||
209 | static int rt298_support_power_controls[] = { | ||
210 | RT298_DAC_OUT1, | ||
211 | RT298_DAC_OUT2, | ||
212 | RT298_ADC_IN1, | ||
213 | RT298_ADC_IN2, | ||
214 | RT298_MIC1, | ||
215 | RT298_DMIC1, | ||
216 | RT298_DMIC2, | ||
217 | RT298_SPK_OUT, | ||
218 | RT298_HP_OUT, | ||
219 | }; | ||
220 | #define RT298_POWER_REG_LEN ARRAY_SIZE(rt298_support_power_controls) | ||
221 | |||
222 | static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic) | ||
223 | { | ||
224 | struct snd_soc_dapm_context *dapm; | ||
225 | unsigned int val, buf; | ||
226 | |||
227 | *hp = false; | ||
228 | *mic = false; | ||
229 | |||
230 | if (!rt298->codec) | ||
231 | return -EINVAL; | ||
232 | |||
233 | dapm = snd_soc_codec_get_dapm(rt298->codec); | ||
234 | |||
235 | if (rt298->pdata.cbj_en) { | ||
236 | regmap_read(rt298->regmap, RT298_GET_HP_SENSE, &buf); | ||
237 | *hp = buf & 0x80000000; | ||
238 | if (*hp == rt298->is_hp_in) | ||
239 | return -1; | ||
240 | rt298->is_hp_in = *hp; | ||
241 | if (*hp) { | ||
242 | /* power on HV,VERF */ | ||
243 | regmap_update_bits(rt298->regmap, | ||
244 | RT298_DC_GAIN, 0x200, 0x200); | ||
245 | |||
246 | snd_soc_dapm_force_enable_pin(dapm, "HV"); | ||
247 | snd_soc_dapm_force_enable_pin(dapm, "VREF"); | ||
248 | /* power LDO1 */ | ||
249 | snd_soc_dapm_force_enable_pin(dapm, "LDO1"); | ||
250 | snd_soc_dapm_sync(dapm); | ||
251 | |||
252 | regmap_write(rt298->regmap, RT298_SET_MIC1, 0x24); | ||
253 | msleep(50); | ||
254 | |||
255 | regmap_update_bits(rt298->regmap, | ||
256 | RT298_CBJ_CTRL1, 0xfcc0, 0xd400); | ||
257 | msleep(300); | ||
258 | regmap_read(rt298->regmap, RT298_CBJ_CTRL2, &val); | ||
259 | |||
260 | if (0x0070 == (val & 0x0070)) { | ||
261 | *mic = true; | ||
262 | } else { | ||
263 | regmap_update_bits(rt298->regmap, | ||
264 | RT298_CBJ_CTRL1, 0xfcc0, 0xe400); | ||
265 | msleep(300); | ||
266 | regmap_read(rt298->regmap, | ||
267 | RT298_CBJ_CTRL2, &val); | ||
268 | if (0x0070 == (val & 0x0070)) | ||
269 | *mic = true; | ||
270 | else | ||
271 | *mic = false; | ||
272 | } | ||
273 | regmap_update_bits(rt298->regmap, | ||
274 | RT298_DC_GAIN, 0x200, 0x0); | ||
275 | |||
276 | } else { | ||
277 | *mic = false; | ||
278 | regmap_write(rt298->regmap, RT298_SET_MIC1, 0x20); | ||
279 | } | ||
280 | } else { | ||
281 | regmap_read(rt298->regmap, RT298_GET_HP_SENSE, &buf); | ||
282 | *hp = buf & 0x80000000; | ||
283 | regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf); | ||
284 | *mic = buf & 0x80000000; | ||
285 | } | ||
286 | |||
287 | snd_soc_dapm_disable_pin(dapm, "HV"); | ||
288 | snd_soc_dapm_disable_pin(dapm, "VREF"); | ||
289 | if (!*hp) | ||
290 | snd_soc_dapm_disable_pin(dapm, "LDO1"); | ||
291 | snd_soc_dapm_sync(dapm); | ||
292 | |||
293 | pr_debug("*hp = %d *mic = %d\n", *hp, *mic); | ||
294 | |||
295 | return 0; | ||
296 | } | ||
297 | |||
298 | static void rt298_jack_detect_work(struct work_struct *work) | ||
299 | { | ||
300 | struct rt298_priv *rt298 = | ||
301 | container_of(work, struct rt298_priv, jack_detect_work.work); | ||
302 | int status = 0; | ||
303 | bool hp = false; | ||
304 | bool mic = false; | ||
305 | |||
306 | if (rt298_jack_detect(rt298, &hp, &mic) < 0) | ||
307 | return; | ||
308 | |||
309 | if (hp == true) | ||
310 | status |= SND_JACK_HEADPHONE; | ||
311 | |||
312 | if (mic == true) | ||
313 | status |= SND_JACK_MICROPHONE; | ||
314 | |||
315 | snd_soc_jack_report(rt298->jack, status, | ||
316 | SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); | ||
317 | } | ||
318 | |||
319 | int rt298_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) | ||
320 | { | ||
321 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
322 | |||
323 | rt298->jack = jack; | ||
324 | |||
325 | /* Send an initial empty report */ | ||
326 | snd_soc_jack_report(rt298->jack, 0, | ||
327 | SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); | ||
328 | |||
329 | return 0; | ||
330 | } | ||
331 | EXPORT_SYMBOL_GPL(rt298_mic_detect); | ||
332 | |||
333 | static int is_mclk_mode(struct snd_soc_dapm_widget *source, | ||
334 | struct snd_soc_dapm_widget *sink) | ||
335 | { | ||
336 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); | ||
337 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
338 | |||
339 | if (rt298->clk_id == RT298_SCLK_S_MCLK) | ||
340 | return 1; | ||
341 | else | ||
342 | return 0; | ||
343 | } | ||
344 | |||
345 | static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6350, 50, 0); | ||
346 | static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0); | ||
347 | |||
348 | static const struct snd_kcontrol_new rt298_snd_controls[] = { | ||
349 | SOC_DOUBLE_R_TLV("DAC0 Playback Volume", RT298_DACL_GAIN, | ||
350 | RT298_DACR_GAIN, 0, 0x7f, 0, out_vol_tlv), | ||
351 | SOC_DOUBLE_R_TLV("ADC0 Capture Volume", RT298_ADCL_GAIN, | ||
352 | RT298_ADCR_GAIN, 0, 0x7f, 0, out_vol_tlv), | ||
353 | SOC_SINGLE_TLV("AMIC Volume", RT298_MIC_GAIN, | ||
354 | 0, 0x3, 0, mic_vol_tlv), | ||
355 | SOC_DOUBLE_R("Speaker Playback Switch", RT298_SPOL_GAIN, | ||
356 | RT298_SPOR_GAIN, RT298_MUTE_SFT, 1, 1), | ||
357 | }; | ||
358 | |||
359 | /* Digital Mixer */ | ||
360 | static const struct snd_kcontrol_new rt298_front_mix[] = { | ||
361 | SOC_DAPM_SINGLE("DAC Switch", RT298_F_DAC_SWITCH, | ||
362 | RT298_MUTE_SFT, 1, 1), | ||
363 | SOC_DAPM_SINGLE("RECMIX Switch", RT298_F_RECMIX_SWITCH, | ||
364 | RT298_MUTE_SFT, 1, 1), | ||
365 | }; | ||
366 | |||
367 | /* Analog Input Mixer */ | ||
368 | static const struct snd_kcontrol_new rt298_rec_mix[] = { | ||
369 | SOC_DAPM_SINGLE("Mic1 Switch", RT298_REC_MIC_SWITCH, | ||
370 | RT298_MUTE_SFT, 1, 1), | ||
371 | SOC_DAPM_SINGLE("I2S Switch", RT298_REC_I2S_SWITCH, | ||
372 | RT298_MUTE_SFT, 1, 1), | ||
373 | SOC_DAPM_SINGLE("Line1 Switch", RT298_REC_LINE_SWITCH, | ||
374 | RT298_MUTE_SFT, 1, 1), | ||
375 | SOC_DAPM_SINGLE("Beep Switch", RT298_REC_BEEP_SWITCH, | ||
376 | RT298_MUTE_SFT, 1, 1), | ||
377 | }; | ||
378 | |||
379 | static const struct snd_kcontrol_new spo_enable_control = | ||
380 | SOC_DAPM_SINGLE("Switch", RT298_SET_PIN_SPK, | ||
381 | RT298_SET_PIN_SFT, 1, 0); | ||
382 | |||
383 | static const struct snd_kcontrol_new hpol_enable_control = | ||
384 | SOC_DAPM_SINGLE_AUTODISABLE("Switch", RT298_HPOL_GAIN, | ||
385 | RT298_MUTE_SFT, 1, 1); | ||
386 | |||
387 | static const struct snd_kcontrol_new hpor_enable_control = | ||
388 | SOC_DAPM_SINGLE_AUTODISABLE("Switch", RT298_HPOR_GAIN, | ||
389 | RT298_MUTE_SFT, 1, 1); | ||
390 | |||
391 | /* ADC0 source */ | ||
392 | static const char * const rt298_adc_src[] = { | ||
393 | "Mic", "RECMIX", "Dmic" | ||
394 | }; | ||
395 | |||
396 | static const int rt298_adc_values[] = { | ||
397 | 0, 4, 5, | ||
398 | }; | ||
399 | |||
400 | static SOC_VALUE_ENUM_SINGLE_DECL( | ||
401 | rt298_adc0_enum, RT298_ADC0_MUX, RT298_ADC_SEL_SFT, | ||
402 | RT298_ADC_SEL_MASK, rt298_adc_src, rt298_adc_values); | ||
403 | |||
404 | static const struct snd_kcontrol_new rt298_adc0_mux = | ||
405 | SOC_DAPM_ENUM("ADC 0 source", rt298_adc0_enum); | ||
406 | |||
407 | static SOC_VALUE_ENUM_SINGLE_DECL( | ||
408 | rt298_adc1_enum, RT298_ADC1_MUX, RT298_ADC_SEL_SFT, | ||
409 | RT298_ADC_SEL_MASK, rt298_adc_src, rt298_adc_values); | ||
410 | |||
411 | static const struct snd_kcontrol_new rt298_adc1_mux = | ||
412 | SOC_DAPM_ENUM("ADC 1 source", rt298_adc1_enum); | ||
413 | |||
414 | static const char * const rt298_dac_src[] = { | ||
415 | "Front", "Surround" | ||
416 | }; | ||
417 | /* HP-OUT source */ | ||
418 | static SOC_ENUM_SINGLE_DECL(rt298_hpo_enum, RT298_HPO_MUX, | ||
419 | 0, rt298_dac_src); | ||
420 | |||
421 | static const struct snd_kcontrol_new rt298_hpo_mux = | ||
422 | SOC_DAPM_ENUM("HPO source", rt298_hpo_enum); | ||
423 | |||
424 | /* SPK-OUT source */ | ||
425 | static SOC_ENUM_SINGLE_DECL(rt298_spo_enum, RT298_SPK_MUX, | ||
426 | 0, rt298_dac_src); | ||
427 | |||
428 | static const struct snd_kcontrol_new rt298_spo_mux = | ||
429 | SOC_DAPM_ENUM("SPO source", rt298_spo_enum); | ||
430 | |||
431 | static int rt298_spk_event(struct snd_soc_dapm_widget *w, | ||
432 | struct snd_kcontrol *kcontrol, int event) | ||
433 | { | ||
434 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
435 | |||
436 | switch (event) { | ||
437 | case SND_SOC_DAPM_POST_PMU: | ||
438 | snd_soc_write(codec, | ||
439 | RT298_SPK_EAPD, RT298_SET_EAPD_HIGH); | ||
440 | break; | ||
441 | case SND_SOC_DAPM_PRE_PMD: | ||
442 | snd_soc_write(codec, | ||
443 | RT298_SPK_EAPD, RT298_SET_EAPD_LOW); | ||
444 | break; | ||
445 | |||
446 | default: | ||
447 | return 0; | ||
448 | } | ||
449 | |||
450 | return 0; | ||
451 | } | ||
452 | |||
453 | static int rt298_set_dmic1_event(struct snd_soc_dapm_widget *w, | ||
454 | struct snd_kcontrol *kcontrol, int event) | ||
455 | { | ||
456 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
457 | |||
458 | switch (event) { | ||
459 | case SND_SOC_DAPM_POST_PMU: | ||
460 | snd_soc_write(codec, RT298_SET_PIN_DMIC1, 0x20); | ||
461 | break; | ||
462 | case SND_SOC_DAPM_PRE_PMD: | ||
463 | snd_soc_write(codec, RT298_SET_PIN_DMIC1, 0); | ||
464 | break; | ||
465 | default: | ||
466 | return 0; | ||
467 | } | ||
468 | |||
469 | return 0; | ||
470 | } | ||
471 | |||
472 | static int rt298_adc_event(struct snd_soc_dapm_widget *w, | ||
473 | struct snd_kcontrol *kcontrol, int event) | ||
474 | { | ||
475 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
476 | unsigned int nid; | ||
477 | |||
478 | nid = (w->reg >> 20) & 0xff; | ||
479 | |||
480 | switch (event) { | ||
481 | case SND_SOC_DAPM_POST_PMU: | ||
482 | snd_soc_update_bits(codec, | ||
483 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0), | ||
484 | 0x7080, 0x7000); | ||
485 | break; | ||
486 | case SND_SOC_DAPM_PRE_PMD: | ||
487 | snd_soc_update_bits(codec, | ||
488 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0), | ||
489 | 0x7080, 0x7080); | ||
490 | break; | ||
491 | default: | ||
492 | return 0; | ||
493 | } | ||
494 | |||
495 | return 0; | ||
496 | } | ||
497 | |||
498 | static int rt298_mic1_event(struct snd_soc_dapm_widget *w, | ||
499 | struct snd_kcontrol *kcontrol, int event) | ||
500 | { | ||
501 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
502 | |||
503 | switch (event) { | ||
504 | case SND_SOC_DAPM_PRE_PMU: | ||
505 | snd_soc_update_bits(codec, | ||
506 | RT298_A_BIAS_CTRL3, 0xc000, 0x8000); | ||
507 | snd_soc_update_bits(codec, | ||
508 | RT298_A_BIAS_CTRL2, 0xc000, 0x8000); | ||
509 | break; | ||
510 | case SND_SOC_DAPM_POST_PMD: | ||
511 | snd_soc_update_bits(codec, | ||
512 | RT298_A_BIAS_CTRL3, 0xc000, 0x0000); | ||
513 | snd_soc_update_bits(codec, | ||
514 | RT298_A_BIAS_CTRL2, 0xc000, 0x0000); | ||
515 | break; | ||
516 | default: | ||
517 | return 0; | ||
518 | } | ||
519 | |||
520 | return 0; | ||
521 | } | ||
522 | |||
523 | static int rt298_vref_event(struct snd_soc_dapm_widget *w, | ||
524 | struct snd_kcontrol *kcontrol, int event) | ||
525 | { | ||
526 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); | ||
527 | |||
528 | switch (event) { | ||
529 | case SND_SOC_DAPM_PRE_PMU: | ||
530 | snd_soc_update_bits(codec, | ||
531 | RT298_CBJ_CTRL1, 0x0400, 0x0000); | ||
532 | mdelay(50); | ||
533 | break; | ||
534 | default: | ||
535 | return 0; | ||
536 | } | ||
537 | |||
538 | return 0; | ||
539 | } | ||
540 | |||
541 | static const struct snd_soc_dapm_widget rt298_dapm_widgets[] = { | ||
542 | |||
543 | SND_SOC_DAPM_SUPPLY_S("HV", 1, RT298_POWER_CTRL1, | ||
544 | 12, 1, NULL, 0), | ||
545 | SND_SOC_DAPM_SUPPLY("VREF", RT298_POWER_CTRL1, | ||
546 | 0, 1, rt298_vref_event, SND_SOC_DAPM_PRE_PMU), | ||
547 | SND_SOC_DAPM_SUPPLY_S("BG_MBIAS", 1, RT298_POWER_CTRL2, | ||
548 | 1, 0, NULL, 0), | ||
549 | SND_SOC_DAPM_SUPPLY_S("LDO1", 1, RT298_POWER_CTRL2, | ||
550 | 2, 0, NULL, 0), | ||
551 | SND_SOC_DAPM_SUPPLY_S("LDO2", 1, RT298_POWER_CTRL2, | ||
552 | 3, 0, NULL, 0), | ||
553 | SND_SOC_DAPM_SUPPLY_S("VREF1", 1, RT298_POWER_CTRL2, | ||
554 | 4, 1, NULL, 0), | ||
555 | SND_SOC_DAPM_SUPPLY_S("LV", 2, RT298_POWER_CTRL1, | ||
556 | 13, 1, NULL, 0), | ||
557 | |||
558 | |||
559 | SND_SOC_DAPM_SUPPLY("MCLK MODE", RT298_PLL_CTRL1, | ||
560 | 5, 0, NULL, 0), | ||
561 | SND_SOC_DAPM_SUPPLY("MIC1 Input Buffer", SND_SOC_NOPM, | ||
562 | 0, 0, rt298_mic1_event, SND_SOC_DAPM_PRE_PMU | | ||
563 | SND_SOC_DAPM_POST_PMD), | ||
564 | |||
565 | /* Input Lines */ | ||
566 | SND_SOC_DAPM_INPUT("DMIC1 Pin"), | ||
567 | SND_SOC_DAPM_INPUT("DMIC2 Pin"), | ||
568 | SND_SOC_DAPM_INPUT("MIC1"), | ||
569 | SND_SOC_DAPM_INPUT("LINE1"), | ||
570 | SND_SOC_DAPM_INPUT("Beep"), | ||
571 | |||
572 | /* DMIC */ | ||
573 | SND_SOC_DAPM_PGA_E("DMIC1", RT298_SET_POWER(RT298_DMIC1), 0, 1, | ||
574 | NULL, 0, rt298_set_dmic1_event, | ||
575 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | ||
576 | SND_SOC_DAPM_PGA("DMIC2", RT298_SET_POWER(RT298_DMIC2), 0, 1, | ||
577 | NULL, 0), | ||
578 | SND_SOC_DAPM_SUPPLY("DMIC Receiver", SND_SOC_NOPM, | ||
579 | 0, 0, NULL, 0), | ||
580 | |||
581 | /* REC Mixer */ | ||
582 | SND_SOC_DAPM_MIXER("RECMIX", SND_SOC_NOPM, 0, 0, | ||
583 | rt298_rec_mix, ARRAY_SIZE(rt298_rec_mix)), | ||
584 | |||
585 | /* ADCs */ | ||
586 | SND_SOC_DAPM_ADC("ADC 0", NULL, SND_SOC_NOPM, 0, 0), | ||
587 | SND_SOC_DAPM_ADC("ADC 1", NULL, SND_SOC_NOPM, 0, 0), | ||
588 | |||
589 | /* ADC Mux */ | ||
590 | SND_SOC_DAPM_MUX_E("ADC 0 Mux", RT298_SET_POWER(RT298_ADC_IN1), 0, 1, | ||
591 | &rt298_adc0_mux, rt298_adc_event, SND_SOC_DAPM_PRE_PMD | | ||
592 | SND_SOC_DAPM_POST_PMU), | ||
593 | SND_SOC_DAPM_MUX_E("ADC 1 Mux", RT298_SET_POWER(RT298_ADC_IN2), 0, 1, | ||
594 | &rt298_adc1_mux, rt298_adc_event, SND_SOC_DAPM_PRE_PMD | | ||
595 | SND_SOC_DAPM_POST_PMU), | ||
596 | |||
597 | /* Audio Interface */ | ||
598 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), | ||
599 | SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), | ||
600 | SND_SOC_DAPM_AIF_IN("AIF2RX", "AIF2 Playback", 0, SND_SOC_NOPM, 0, 0), | ||
601 | SND_SOC_DAPM_AIF_OUT("AIF2TX", "AIF2 Capture", 0, SND_SOC_NOPM, 0, 0), | ||
602 | |||
603 | /* Output Side */ | ||
604 | /* DACs */ | ||
605 | SND_SOC_DAPM_DAC("DAC 0", NULL, SND_SOC_NOPM, 0, 0), | ||
606 | SND_SOC_DAPM_DAC("DAC 1", NULL, SND_SOC_NOPM, 0, 0), | ||
607 | |||
608 | /* Output Mux */ | ||
609 | SND_SOC_DAPM_MUX("SPK Mux", SND_SOC_NOPM, 0, 0, &rt298_spo_mux), | ||
610 | SND_SOC_DAPM_MUX("HPO Mux", SND_SOC_NOPM, 0, 0, &rt298_hpo_mux), | ||
611 | |||
612 | SND_SOC_DAPM_SUPPLY("HP Power", RT298_SET_PIN_HPO, | ||
613 | RT298_SET_PIN_SFT, 0, NULL, 0), | ||
614 | |||
615 | /* Output Mixer */ | ||
616 | SND_SOC_DAPM_MIXER("Front", RT298_SET_POWER(RT298_DAC_OUT1), 0, 1, | ||
617 | rt298_front_mix, ARRAY_SIZE(rt298_front_mix)), | ||
618 | SND_SOC_DAPM_PGA("Surround", RT298_SET_POWER(RT298_DAC_OUT2), 0, 1, | ||
619 | NULL, 0), | ||
620 | |||
621 | /* Output Pga */ | ||
622 | SND_SOC_DAPM_SWITCH_E("SPO", SND_SOC_NOPM, 0, 0, | ||
623 | &spo_enable_control, rt298_spk_event, | ||
624 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), | ||
625 | SND_SOC_DAPM_SWITCH("HPO L", SND_SOC_NOPM, 0, 0, | ||
626 | &hpol_enable_control), | ||
627 | SND_SOC_DAPM_SWITCH("HPO R", SND_SOC_NOPM, 0, 0, | ||
628 | &hpor_enable_control), | ||
629 | |||
630 | /* Output Lines */ | ||
631 | SND_SOC_DAPM_OUTPUT("SPOL"), | ||
632 | SND_SOC_DAPM_OUTPUT("SPOR"), | ||
633 | SND_SOC_DAPM_OUTPUT("HPO Pin"), | ||
634 | SND_SOC_DAPM_OUTPUT("SPDIF"), | ||
635 | }; | ||
636 | |||
637 | static const struct snd_soc_dapm_route rt298_dapm_routes[] = { | ||
638 | |||
639 | {"ADC 0", NULL, "MCLK MODE", is_mclk_mode}, | ||
640 | {"ADC 1", NULL, "MCLK MODE", is_mclk_mode}, | ||
641 | {"Front", NULL, "MCLK MODE", is_mclk_mode}, | ||
642 | {"Surround", NULL, "MCLK MODE", is_mclk_mode}, | ||
643 | |||
644 | {"HP Power", NULL, "LDO1"}, | ||
645 | {"HP Power", NULL, "LDO2"}, | ||
646 | {"HP Power", NULL, "LV"}, | ||
647 | {"HP Power", NULL, "VREF1"}, | ||
648 | {"HP Power", NULL, "BG_MBIAS"}, | ||
649 | |||
650 | {"MIC1", NULL, "LDO1"}, | ||
651 | {"MIC1", NULL, "LDO2"}, | ||
652 | {"MIC1", NULL, "HV"}, | ||
653 | {"MIC1", NULL, "LV"}, | ||
654 | {"MIC1", NULL, "VREF"}, | ||
655 | {"MIC1", NULL, "VREF1"}, | ||
656 | {"MIC1", NULL, "BG_MBIAS"}, | ||
657 | {"MIC1", NULL, "MIC1 Input Buffer"}, | ||
658 | |||
659 | {"SPO", NULL, "LDO1"}, | ||
660 | {"SPO", NULL, "LDO2"}, | ||
661 | {"SPO", NULL, "HV"}, | ||
662 | {"SPO", NULL, "LV"}, | ||
663 | {"SPO", NULL, "VREF"}, | ||
664 | {"SPO", NULL, "VREF1"}, | ||
665 | {"SPO", NULL, "BG_MBIAS"}, | ||
666 | |||
667 | {"DMIC1", NULL, "DMIC1 Pin"}, | ||
668 | {"DMIC2", NULL, "DMIC2 Pin"}, | ||
669 | {"DMIC1", NULL, "DMIC Receiver"}, | ||
670 | {"DMIC2", NULL, "DMIC Receiver"}, | ||
671 | |||
672 | {"RECMIX", "Beep Switch", "Beep"}, | ||
673 | {"RECMIX", "Line1 Switch", "LINE1"}, | ||
674 | {"RECMIX", "Mic1 Switch", "MIC1"}, | ||
675 | |||
676 | {"ADC 0 Mux", "Dmic", "DMIC1"}, | ||
677 | {"ADC 0 Mux", "RECMIX", "RECMIX"}, | ||
678 | {"ADC 0 Mux", "Mic", "MIC1"}, | ||
679 | {"ADC 1 Mux", "Dmic", "DMIC2"}, | ||
680 | {"ADC 1 Mux", "RECMIX", "RECMIX"}, | ||
681 | {"ADC 1 Mux", "Mic", "MIC1"}, | ||
682 | |||
683 | {"ADC 0", NULL, "ADC 0 Mux"}, | ||
684 | {"ADC 1", NULL, "ADC 1 Mux"}, | ||
685 | |||
686 | {"AIF1TX", NULL, "ADC 0"}, | ||
687 | {"AIF2TX", NULL, "ADC 1"}, | ||
688 | |||
689 | {"DAC 0", NULL, "AIF1RX"}, | ||
690 | {"DAC 1", NULL, "AIF2RX"}, | ||
691 | |||
692 | {"Front", "DAC Switch", "DAC 0"}, | ||
693 | {"Front", "RECMIX Switch", "RECMIX"}, | ||
694 | |||
695 | {"Surround", NULL, "DAC 1"}, | ||
696 | |||
697 | {"SPK Mux", "Front", "Front"}, | ||
698 | {"SPK Mux", "Surround", "Surround"}, | ||
699 | |||
700 | {"HPO Mux", "Front", "Front"}, | ||
701 | {"HPO Mux", "Surround", "Surround"}, | ||
702 | |||
703 | {"SPO", "Switch", "SPK Mux"}, | ||
704 | {"HPO L", "Switch", "HPO Mux"}, | ||
705 | {"HPO R", "Switch", "HPO Mux"}, | ||
706 | {"HPO L", NULL, "HP Power"}, | ||
707 | {"HPO R", NULL, "HP Power"}, | ||
708 | |||
709 | {"SPOL", NULL, "SPO"}, | ||
710 | {"SPOR", NULL, "SPO"}, | ||
711 | {"HPO Pin", NULL, "HPO L"}, | ||
712 | {"HPO Pin", NULL, "HPO R"}, | ||
713 | }; | ||
714 | |||
715 | static int rt298_hw_params(struct snd_pcm_substream *substream, | ||
716 | struct snd_pcm_hw_params *params, | ||
717 | struct snd_soc_dai *dai) | ||
718 | { | ||
719 | struct snd_soc_codec *codec = dai->codec; | ||
720 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
721 | unsigned int val = 0; | ||
722 | int d_len_code; | ||
723 | |||
724 | switch (params_rate(params)) { | ||
725 | /* bit 14 0:48K 1:44.1K */ | ||
726 | case 44100: | ||
727 | case 48000: | ||
728 | break; | ||
729 | default: | ||
730 | dev_err(codec->dev, "Unsupported sample rate %d\n", | ||
731 | params_rate(params)); | ||
732 | return -EINVAL; | ||
733 | } | ||
734 | switch (rt298->sys_clk) { | ||
735 | case 12288000: | ||
736 | case 24576000: | ||
737 | if (params_rate(params) != 48000) { | ||
738 | dev_err(codec->dev, "Sys_clk is not matched (%d %d)\n", | ||
739 | params_rate(params), rt298->sys_clk); | ||
740 | return -EINVAL; | ||
741 | } | ||
742 | break; | ||
743 | case 11289600: | ||
744 | case 22579200: | ||
745 | if (params_rate(params) != 44100) { | ||
746 | dev_err(codec->dev, "Sys_clk is not matched (%d %d)\n", | ||
747 | params_rate(params), rt298->sys_clk); | ||
748 | return -EINVAL; | ||
749 | } | ||
750 | break; | ||
751 | } | ||
752 | |||
753 | if (params_channels(params) <= 16) { | ||
754 | /* bit 3:0 Number of Channel */ | ||
755 | val |= (params_channels(params) - 1); | ||
756 | } else { | ||
757 | dev_err(codec->dev, "Unsupported channels %d\n", | ||
758 | params_channels(params)); | ||
759 | return -EINVAL; | ||
760 | } | ||
761 | |||
762 | d_len_code = 0; | ||
763 | switch (params_width(params)) { | ||
764 | /* bit 6:4 Bits per Sample */ | ||
765 | case 16: | ||
766 | d_len_code = 0; | ||
767 | val |= (0x1 << 4); | ||
768 | break; | ||
769 | case 32: | ||
770 | d_len_code = 2; | ||
771 | val |= (0x4 << 4); | ||
772 | break; | ||
773 | case 20: | ||
774 | d_len_code = 1; | ||
775 | val |= (0x2 << 4); | ||
776 | break; | ||
777 | case 24: | ||
778 | d_len_code = 2; | ||
779 | val |= (0x3 << 4); | ||
780 | break; | ||
781 | case 8: | ||
782 | d_len_code = 3; | ||
783 | break; | ||
784 | default: | ||
785 | return -EINVAL; | ||
786 | } | ||
787 | |||
788 | snd_soc_update_bits(codec, | ||
789 | RT298_I2S_CTRL1, 0x0018, d_len_code << 3); | ||
790 | dev_dbg(codec->dev, "format val = 0x%x\n", val); | ||
791 | |||
792 | snd_soc_update_bits(codec, RT298_DAC_FORMAT, 0x407f, val); | ||
793 | snd_soc_update_bits(codec, RT298_ADC_FORMAT, 0x407f, val); | ||
794 | |||
795 | return 0; | ||
796 | } | ||
797 | |||
798 | static int rt298_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) | ||
799 | { | ||
800 | struct snd_soc_codec *codec = dai->codec; | ||
801 | |||
802 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | ||
803 | case SND_SOC_DAIFMT_CBM_CFM: | ||
804 | snd_soc_update_bits(codec, | ||
805 | RT298_I2S_CTRL1, 0x800, 0x800); | ||
806 | break; | ||
807 | case SND_SOC_DAIFMT_CBS_CFS: | ||
808 | snd_soc_update_bits(codec, | ||
809 | RT298_I2S_CTRL1, 0x800, 0x0); | ||
810 | break; | ||
811 | default: | ||
812 | return -EINVAL; | ||
813 | } | ||
814 | |||
815 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | ||
816 | case SND_SOC_DAIFMT_I2S: | ||
817 | snd_soc_update_bits(codec, | ||
818 | RT298_I2S_CTRL1, 0x300, 0x0); | ||
819 | break; | ||
820 | case SND_SOC_DAIFMT_LEFT_J: | ||
821 | snd_soc_update_bits(codec, | ||
822 | RT298_I2S_CTRL1, 0x300, 0x1 << 8); | ||
823 | break; | ||
824 | case SND_SOC_DAIFMT_DSP_A: | ||
825 | snd_soc_update_bits(codec, | ||
826 | RT298_I2S_CTRL1, 0x300, 0x2 << 8); | ||
827 | break; | ||
828 | case SND_SOC_DAIFMT_DSP_B: | ||
829 | snd_soc_update_bits(codec, | ||
830 | RT298_I2S_CTRL1, 0x300, 0x3 << 8); | ||
831 | break; | ||
832 | default: | ||
833 | return -EINVAL; | ||
834 | } | ||
835 | /* bit 15 Stream Type 0:PCM 1:Non-PCM */ | ||
836 | snd_soc_update_bits(codec, RT298_DAC_FORMAT, 0x8000, 0); | ||
837 | snd_soc_update_bits(codec, RT298_ADC_FORMAT, 0x8000, 0); | ||
838 | |||
839 | return 0; | ||
840 | } | ||
841 | |||
842 | static int rt298_set_dai_sysclk(struct snd_soc_dai *dai, | ||
843 | int clk_id, unsigned int freq, int dir) | ||
844 | { | ||
845 | struct snd_soc_codec *codec = dai->codec; | ||
846 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
847 | |||
848 | dev_dbg(codec->dev, "%s freq=%d\n", __func__, freq); | ||
849 | |||
850 | if (RT298_SCLK_S_MCLK == clk_id) { | ||
851 | snd_soc_update_bits(codec, | ||
852 | RT298_I2S_CTRL2, 0x0100, 0x0); | ||
853 | snd_soc_update_bits(codec, | ||
854 | RT298_PLL_CTRL1, 0x20, 0x20); | ||
855 | } else { | ||
856 | snd_soc_update_bits(codec, | ||
857 | RT298_I2S_CTRL2, 0x0100, 0x0100); | ||
858 | snd_soc_update_bits(codec, | ||
859 | RT298_PLL_CTRL, 0x4, 0x4); | ||
860 | snd_soc_update_bits(codec, | ||
861 | RT298_PLL_CTRL1, 0x20, 0x0); | ||
862 | } | ||
863 | |||
864 | switch (freq) { | ||
865 | case 19200000: | ||
866 | if (RT298_SCLK_S_MCLK == clk_id) { | ||
867 | dev_err(codec->dev, "Should not use MCLK\n"); | ||
868 | return -EINVAL; | ||
869 | } | ||
870 | snd_soc_update_bits(codec, | ||
871 | RT298_I2S_CTRL2, 0x40, 0x40); | ||
872 | break; | ||
873 | case 24000000: | ||
874 | if (RT298_SCLK_S_MCLK == clk_id) { | ||
875 | dev_err(codec->dev, "Should not use MCLK\n"); | ||
876 | return -EINVAL; | ||
877 | } | ||
878 | snd_soc_update_bits(codec, | ||
879 | RT298_I2S_CTRL2, 0x40, 0x0); | ||
880 | break; | ||
881 | case 12288000: | ||
882 | case 11289600: | ||
883 | snd_soc_update_bits(codec, | ||
884 | RT298_I2S_CTRL2, 0x8, 0x0); | ||
885 | snd_soc_update_bits(codec, | ||
886 | RT298_CLK_DIV, 0xfc1e, 0x0004); | ||
887 | break; | ||
888 | case 24576000: | ||
889 | case 22579200: | ||
890 | snd_soc_update_bits(codec, | ||
891 | RT298_I2S_CTRL2, 0x8, 0x8); | ||
892 | snd_soc_update_bits(codec, | ||
893 | RT298_CLK_DIV, 0xfc1e, 0x5406); | ||
894 | break; | ||
895 | default: | ||
896 | dev_err(codec->dev, "Unsupported system clock\n"); | ||
897 | return -EINVAL; | ||
898 | } | ||
899 | |||
900 | rt298->sys_clk = freq; | ||
901 | rt298->clk_id = clk_id; | ||
902 | |||
903 | return 0; | ||
904 | } | ||
905 | |||
906 | static int rt298_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) | ||
907 | { | ||
908 | struct snd_soc_codec *codec = dai->codec; | ||
909 | |||
910 | dev_dbg(codec->dev, "%s ratio=%d\n", __func__, ratio); | ||
911 | if (50 == ratio) | ||
912 | snd_soc_update_bits(codec, | ||
913 | RT298_I2S_CTRL1, 0x1000, 0x1000); | ||
914 | else | ||
915 | snd_soc_update_bits(codec, | ||
916 | RT298_I2S_CTRL1, 0x1000, 0x0); | ||
917 | |||
918 | |||
919 | return 0; | ||
920 | } | ||
921 | |||
922 | static int rt298_set_bias_level(struct snd_soc_codec *codec, | ||
923 | enum snd_soc_bias_level level) | ||
924 | { | ||
925 | switch (level) { | ||
926 | case SND_SOC_BIAS_PREPARE: | ||
927 | if (SND_SOC_BIAS_STANDBY == | ||
928 | snd_soc_codec_get_bias_level(codec)) { | ||
929 | snd_soc_write(codec, | ||
930 | RT298_SET_AUDIO_POWER, AC_PWRST_D0); | ||
931 | snd_soc_update_bits(codec, 0x0d, 0x200, 0x200); | ||
932 | snd_soc_update_bits(codec, 0x52, 0x80, 0x0); | ||
933 | mdelay(20); | ||
934 | snd_soc_update_bits(codec, 0x0d, 0x200, 0x0); | ||
935 | snd_soc_update_bits(codec, 0x52, 0x80, 0x80); | ||
936 | } | ||
937 | break; | ||
938 | |||
939 | case SND_SOC_BIAS_ON: | ||
940 | mdelay(30); | ||
941 | snd_soc_update_bits(codec, | ||
942 | RT298_CBJ_CTRL1, 0x0400, 0x0400); | ||
943 | |||
944 | break; | ||
945 | |||
946 | case SND_SOC_BIAS_STANDBY: | ||
947 | snd_soc_write(codec, | ||
948 | RT298_SET_AUDIO_POWER, AC_PWRST_D3); | ||
949 | snd_soc_update_bits(codec, | ||
950 | RT298_CBJ_CTRL1, 0x0400, 0x0000); | ||
951 | break; | ||
952 | |||
953 | default: | ||
954 | break; | ||
955 | } | ||
956 | |||
957 | return 0; | ||
958 | } | ||
959 | |||
960 | static irqreturn_t rt298_irq(int irq, void *data) | ||
961 | { | ||
962 | struct rt298_priv *rt298 = data; | ||
963 | bool hp = false; | ||
964 | bool mic = false; | ||
965 | int ret, status = 0; | ||
966 | |||
967 | ret = rt298_jack_detect(rt298, &hp, &mic); | ||
968 | |||
969 | /* Clear IRQ */ | ||
970 | regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1); | ||
971 | |||
972 | if (ret == 0) { | ||
973 | if (hp == true) | ||
974 | status |= SND_JACK_HEADPHONE; | ||
975 | |||
976 | if (mic == true) | ||
977 | status |= SND_JACK_MICROPHONE; | ||
978 | |||
979 | snd_soc_jack_report(rt298->jack, status, | ||
980 | SND_JACK_MICROPHONE | SND_JACK_HEADPHONE); | ||
981 | |||
982 | pm_wakeup_event(&rt298->i2c->dev, 300); | ||
983 | } | ||
984 | |||
985 | return IRQ_HANDLED; | ||
986 | } | ||
987 | |||
988 | static int rt298_probe(struct snd_soc_codec *codec) | ||
989 | { | ||
990 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
991 | |||
992 | rt298->codec = codec; | ||
993 | |||
994 | if (rt298->i2c->irq) { | ||
995 | regmap_update_bits(rt298->regmap, | ||
996 | RT298_IRQ_CTRL, 0x2, 0x2); | ||
997 | |||
998 | INIT_DELAYED_WORK(&rt298->jack_detect_work, | ||
999 | rt298_jack_detect_work); | ||
1000 | schedule_delayed_work(&rt298->jack_detect_work, | ||
1001 | msecs_to_jiffies(1250)); | ||
1002 | } | ||
1003 | |||
1004 | return 0; | ||
1005 | } | ||
1006 | |||
1007 | static int rt298_remove(struct snd_soc_codec *codec) | ||
1008 | { | ||
1009 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
1010 | |||
1011 | cancel_delayed_work_sync(&rt298->jack_detect_work); | ||
1012 | |||
1013 | return 0; | ||
1014 | } | ||
1015 | |||
1016 | #ifdef CONFIG_PM | ||
1017 | static int rt298_suspend(struct snd_soc_codec *codec) | ||
1018 | { | ||
1019 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
1020 | |||
1021 | rt298->is_hp_in = -1; | ||
1022 | regcache_cache_only(rt298->regmap, true); | ||
1023 | regcache_mark_dirty(rt298->regmap); | ||
1024 | |||
1025 | return 0; | ||
1026 | } | ||
1027 | |||
1028 | static int rt298_resume(struct snd_soc_codec *codec) | ||
1029 | { | ||
1030 | struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec); | ||
1031 | |||
1032 | regcache_cache_only(rt298->regmap, false); | ||
1033 | rt298_index_sync(codec); | ||
1034 | regcache_sync(rt298->regmap); | ||
1035 | |||
1036 | return 0; | ||
1037 | } | ||
1038 | #else | ||
1039 | #define rt298_suspend NULL | ||
1040 | #define rt298_resume NULL | ||
1041 | #endif | ||
1042 | |||
1043 | #define RT298_STEREO_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) | ||
1044 | #define RT298_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ | ||
1045 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) | ||
1046 | |||
1047 | static const struct snd_soc_dai_ops rt298_aif_dai_ops = { | ||
1048 | .hw_params = rt298_hw_params, | ||
1049 | .set_fmt = rt298_set_dai_fmt, | ||
1050 | .set_sysclk = rt298_set_dai_sysclk, | ||
1051 | .set_bclk_ratio = rt298_set_bclk_ratio, | ||
1052 | }; | ||
1053 | |||
1054 | static struct snd_soc_dai_driver rt298_dai[] = { | ||
1055 | { | ||
1056 | .name = "rt298-aif1", | ||
1057 | .id = RT298_AIF1, | ||
1058 | .playback = { | ||
1059 | .stream_name = "AIF1 Playback", | ||
1060 | .channels_min = 1, | ||
1061 | .channels_max = 2, | ||
1062 | .rates = RT298_STEREO_RATES, | ||
1063 | .formats = RT298_FORMATS, | ||
1064 | }, | ||
1065 | .capture = { | ||
1066 | .stream_name = "AIF1 Capture", | ||
1067 | .channels_min = 1, | ||
1068 | .channels_max = 2, | ||
1069 | .rates = RT298_STEREO_RATES, | ||
1070 | .formats = RT298_FORMATS, | ||
1071 | }, | ||
1072 | .ops = &rt298_aif_dai_ops, | ||
1073 | .symmetric_rates = 1, | ||
1074 | }, | ||
1075 | { | ||
1076 | .name = "rt298-aif2", | ||
1077 | .id = RT298_AIF2, | ||
1078 | .playback = { | ||
1079 | .stream_name = "AIF2 Playback", | ||
1080 | .channels_min = 1, | ||
1081 | .channels_max = 2, | ||
1082 | .rates = RT298_STEREO_RATES, | ||
1083 | .formats = RT298_FORMATS, | ||
1084 | }, | ||
1085 | .capture = { | ||
1086 | .stream_name = "AIF2 Capture", | ||
1087 | .channels_min = 1, | ||
1088 | .channels_max = 2, | ||
1089 | .rates = RT298_STEREO_RATES, | ||
1090 | .formats = RT298_FORMATS, | ||
1091 | }, | ||
1092 | .ops = &rt298_aif_dai_ops, | ||
1093 | .symmetric_rates = 1, | ||
1094 | }, | ||
1095 | |||
1096 | }; | ||
1097 | |||
1098 | static struct snd_soc_codec_driver soc_codec_dev_rt298 = { | ||
1099 | .probe = rt298_probe, | ||
1100 | .remove = rt298_remove, | ||
1101 | .suspend = rt298_suspend, | ||
1102 | .resume = rt298_resume, | ||
1103 | .set_bias_level = rt298_set_bias_level, | ||
1104 | .idle_bias_off = true, | ||
1105 | .controls = rt298_snd_controls, | ||
1106 | .num_controls = ARRAY_SIZE(rt298_snd_controls), | ||
1107 | .dapm_widgets = rt298_dapm_widgets, | ||
1108 | .num_dapm_widgets = ARRAY_SIZE(rt298_dapm_widgets), | ||
1109 | .dapm_routes = rt298_dapm_routes, | ||
1110 | .num_dapm_routes = ARRAY_SIZE(rt298_dapm_routes), | ||
1111 | }; | ||
1112 | |||
1113 | static const struct regmap_config rt298_regmap = { | ||
1114 | .reg_bits = 32, | ||
1115 | .val_bits = 32, | ||
1116 | .max_register = 0x02370100, | ||
1117 | .volatile_reg = rt298_volatile_register, | ||
1118 | .readable_reg = rt298_readable_register, | ||
1119 | .reg_write = rl6347a_hw_write, | ||
1120 | .reg_read = rl6347a_hw_read, | ||
1121 | .cache_type = REGCACHE_RBTREE, | ||
1122 | .reg_defaults = rt298_reg, | ||
1123 | .num_reg_defaults = ARRAY_SIZE(rt298_reg), | ||
1124 | }; | ||
1125 | |||
1126 | static const struct i2c_device_id rt298_i2c_id[] = { | ||
1127 | {"rt298", 0}, | ||
1128 | {} | ||
1129 | }; | ||
1130 | MODULE_DEVICE_TABLE(i2c, rt298_i2c_id); | ||
1131 | |||
1132 | static const struct acpi_device_id rt298_acpi_match[] = { | ||
1133 | { "INT343A", 0 }, | ||
1134 | {}, | ||
1135 | }; | ||
1136 | MODULE_DEVICE_TABLE(acpi, rt298_acpi_match); | ||
1137 | |||
1138 | static int rt298_i2c_probe(struct i2c_client *i2c, | ||
1139 | const struct i2c_device_id *id) | ||
1140 | { | ||
1141 | struct rt298_platform_data *pdata = dev_get_platdata(&i2c->dev); | ||
1142 | struct rt298_priv *rt298; | ||
1143 | struct device *dev = &i2c->dev; | ||
1144 | const struct acpi_device_id *acpiid; | ||
1145 | int i, ret; | ||
1146 | |||
1147 | pr_info("%s\n", __func__); | ||
1148 | |||
1149 | rt298 = devm_kzalloc(&i2c->dev, sizeof(*rt298), | ||
1150 | GFP_KERNEL); | ||
1151 | if (NULL == rt298) | ||
1152 | return -ENOMEM; | ||
1153 | |||
1154 | rt298->regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &rt298_regmap); | ||
1155 | if (IS_ERR(rt298->regmap)) { | ||
1156 | ret = PTR_ERR(rt298->regmap); | ||
1157 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | ||
1158 | ret); | ||
1159 | return ret; | ||
1160 | } | ||
1161 | |||
1162 | regmap_read(rt298->regmap, | ||
1163 | RT298_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &ret); | ||
1164 | if (ret != RT298_VENDOR_ID) { | ||
1165 | dev_err(&i2c->dev, | ||
1166 | "Device with ID register %#x is not rt298\n", ret); | ||
1167 | return -ENODEV; | ||
1168 | } | ||
1169 | |||
1170 | rt298->index_cache = rt298_index_def; | ||
1171 | rt298->index_cache_size = INDEX_CACHE_SIZE; | ||
1172 | rt298->i2c = i2c; | ||
1173 | i2c_set_clientdata(i2c, rt298); | ||
1174 | |||
1175 | /* restore codec default */ | ||
1176 | for (i = 0; i < INDEX_CACHE_SIZE; i++) | ||
1177 | regmap_write(rt298->regmap, rt298->index_cache[i].reg, | ||
1178 | rt298->index_cache[i].def); | ||
1179 | for (i = 0; i < ARRAY_SIZE(rt298_reg); i++) | ||
1180 | regmap_write(rt298->regmap, rt298_reg[i].reg, | ||
1181 | rt298_reg[i].def); | ||
1182 | |||
1183 | if (pdata) | ||
1184 | rt298->pdata = *pdata; | ||
1185 | |||
1186 | /* enable jack combo mode on supported devices */ | ||
1187 | acpiid = acpi_match_device(dev->driver->acpi_match_table, dev); | ||
1188 | if (acpiid) { | ||
1189 | rt298->pdata = *(struct rt298_platform_data *) | ||
1190 | acpiid->driver_data; | ||
1191 | } | ||
1192 | |||
1193 | /* VREF Charging */ | ||
1194 | regmap_update_bits(rt298->regmap, 0x04, 0x80, 0x80); | ||
1195 | regmap_update_bits(rt298->regmap, 0x1b, 0x860, 0x860); | ||
1196 | /* Vref2 */ | ||
1197 | regmap_update_bits(rt298->regmap, 0x08, 0x20, 0x20); | ||
1198 | |||
1199 | regmap_write(rt298->regmap, RT298_SET_AUDIO_POWER, AC_PWRST_D3); | ||
1200 | |||
1201 | for (i = 0; i < RT298_POWER_REG_LEN; i++) | ||
1202 | regmap_write(rt298->regmap, | ||
1203 | RT298_SET_POWER(rt298_support_power_controls[i]), | ||
1204 | AC_PWRST_D1); | ||
1205 | |||
1206 | if (!rt298->pdata.cbj_en) { | ||
1207 | regmap_write(rt298->regmap, RT298_CBJ_CTRL2, 0x0000); | ||
1208 | regmap_write(rt298->regmap, RT298_MIC1_DET_CTRL, 0x0816); | ||
1209 | regmap_update_bits(rt298->regmap, | ||
1210 | RT298_CBJ_CTRL1, 0xf000, 0xb000); | ||
1211 | } else { | ||
1212 | regmap_update_bits(rt298->regmap, | ||
1213 | RT298_CBJ_CTRL1, 0xf000, 0x5000); | ||
1214 | } | ||
1215 | |||
1216 | mdelay(10); | ||
1217 | |||
1218 | if (!rt298->pdata.gpio2_en) | ||
1219 | regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x4000); | ||
1220 | else | ||
1221 | regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0); | ||
1222 | |||
1223 | mdelay(10); | ||
1224 | |||
1225 | regmap_write(rt298->regmap, RT298_MISC_CTRL1, 0x0000); | ||
1226 | regmap_update_bits(rt298->regmap, | ||
1227 | RT298_WIND_FILTER_CTRL, 0x0082, 0x0082); | ||
1228 | regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2); | ||
1229 | rt298->is_hp_in = -1; | ||
1230 | |||
1231 | if (rt298->i2c->irq) { | ||
1232 | ret = request_threaded_irq(rt298->i2c->irq, NULL, rt298_irq, | ||
1233 | IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt298", rt298); | ||
1234 | if (ret != 0) { | ||
1235 | dev_err(&i2c->dev, | ||
1236 | "Failed to reguest IRQ: %d\n", ret); | ||
1237 | return ret; | ||
1238 | } | ||
1239 | } | ||
1240 | |||
1241 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt298, | ||
1242 | rt298_dai, ARRAY_SIZE(rt298_dai)); | ||
1243 | |||
1244 | return ret; | ||
1245 | } | ||
1246 | |||
1247 | static int rt298_i2c_remove(struct i2c_client *i2c) | ||
1248 | { | ||
1249 | struct rt298_priv *rt298 = i2c_get_clientdata(i2c); | ||
1250 | |||
1251 | if (i2c->irq) | ||
1252 | free_irq(i2c->irq, rt298); | ||
1253 | snd_soc_unregister_codec(&i2c->dev); | ||
1254 | |||
1255 | return 0; | ||
1256 | } | ||
1257 | |||
1258 | |||
1259 | static struct i2c_driver rt298_i2c_driver = { | ||
1260 | .driver = { | ||
1261 | .name = "rt298", | ||
1262 | .acpi_match_table = ACPI_PTR(rt298_acpi_match), | ||
1263 | }, | ||
1264 | .probe = rt298_i2c_probe, | ||
1265 | .remove = rt298_i2c_remove, | ||
1266 | .id_table = rt298_i2c_id, | ||
1267 | }; | ||
1268 | |||
1269 | module_i2c_driver(rt298_i2c_driver); | ||
1270 | |||
1271 | MODULE_DESCRIPTION("ASoC RT298 driver"); | ||
1272 | MODULE_AUTHOR("Bard Liao <bardliao@realtek.com>"); | ||
1273 | MODULE_LICENSE("GPL"); | ||
diff --git a/sound/soc/codecs/rt298.h b/sound/soc/codecs/rt298.h new file mode 100644 index 000000000000..31da16265f2b --- /dev/null +++ b/sound/soc/codecs/rt298.h | |||
@@ -0,0 +1,206 @@ | |||
1 | /* | ||
2 | * rt298.h -- RT298 ALSA SoC audio driver | ||
3 | * | ||
4 | * Copyright 2011 Realtek Microelectronics | ||
5 | * Author: Johnny Hsu <johnnyhsu@realtek.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __RT298_H__ | ||
13 | #define __RT298_H__ | ||
14 | |||
15 | #define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D) | ||
16 | |||
17 | #define RT298_AUDIO_FUNCTION_GROUP 0x01 | ||
18 | #define RT298_DAC_OUT1 0x02 | ||
19 | #define RT298_DAC_OUT2 0x03 | ||
20 | #define RT298_DIG_CVT 0x06 | ||
21 | #define RT298_ADC_IN1 0x09 | ||
22 | #define RT298_ADC_IN2 0x08 | ||
23 | #define RT298_MIXER_IN 0x0b | ||
24 | #define RT298_MIXER_OUT1 0x0c | ||
25 | #define RT298_MIXER_OUT2 0x0d | ||
26 | #define RT298_DMIC1 0x12 | ||
27 | #define RT298_DMIC2 0x13 | ||
28 | #define RT298_SPK_OUT 0x14 | ||
29 | #define RT298_MIC1 0x18 | ||
30 | #define RT298_LINE1 0x1a | ||
31 | #define RT298_BEEP 0x1d | ||
32 | #define RT298_SPDIF 0x1e | ||
33 | #define RT298_VENDOR_REGISTERS 0x20 | ||
34 | #define RT298_HP_OUT 0x21 | ||
35 | #define RT298_MIXER_IN1 0x22 | ||
36 | #define RT298_MIXER_IN2 0x23 | ||
37 | |||
38 | #define RT298_SET_PIN_SFT 6 | ||
39 | #define RT298_SET_PIN_ENABLE 0x40 | ||
40 | #define RT298_SET_PIN_DISABLE 0 | ||
41 | #define RT298_SET_EAPD_HIGH 0x2 | ||
42 | #define RT298_SET_EAPD_LOW 0 | ||
43 | |||
44 | #define RT298_MUTE_SFT 7 | ||
45 | |||
46 | /* Verb commands */ | ||
47 | #define RT298_GET_PARAM(NID, PARAM) VERB_CMD(AC_VERB_PARAMETERS, NID, PARAM) | ||
48 | #define RT298_SET_POWER(NID) VERB_CMD(AC_VERB_SET_POWER_STATE, NID, 0) | ||
49 | #define RT298_SET_AUDIO_POWER RT298_SET_POWER(RT298_AUDIO_FUNCTION_GROUP) | ||
50 | #define RT298_SET_HPO_POWER RT298_SET_POWER(RT298_HP_OUT) | ||
51 | #define RT298_SET_SPK_POWER RT298_SET_POWER(RT298_SPK_OUT) | ||
52 | #define RT298_SET_DMIC1_POWER RT298_SET_POWER(RT298_DMIC1) | ||
53 | #define RT298_SPK_MUX\ | ||
54 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_SPK_OUT, 0) | ||
55 | #define RT298_HPO_MUX\ | ||
56 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_HP_OUT, 0) | ||
57 | #define RT298_ADC0_MUX\ | ||
58 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN1, 0) | ||
59 | #define RT298_ADC1_MUX\ | ||
60 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN2, 0) | ||
61 | #define RT298_SET_MIC1\ | ||
62 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_MIC1, 0) | ||
63 | #define RT298_SET_PIN_HPO\ | ||
64 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_HP_OUT, 0) | ||
65 | #define RT298_SET_PIN_SPK\ | ||
66 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPK_OUT, 0) | ||
67 | #define RT298_SET_PIN_DMIC1\ | ||
68 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_DMIC1, 0) | ||
69 | #define RT298_SET_PIN_SPDIF\ | ||
70 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPDIF, 0) | ||
71 | #define RT298_SET_PIN_DIG_CVT\ | ||
72 | VERB_CMD(AC_VERB_SET_DIGI_CONVERT_1, RT298_DIG_CVT, 0) | ||
73 | #define RT298_SPK_EAPD\ | ||
74 | VERB_CMD(AC_VERB_SET_EAPD_BTLENABLE, RT298_SPK_OUT, 0) | ||
75 | #define RT298_SET_AMP_GAIN_HPO\ | ||
76 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0) | ||
77 | #define RT298_SET_AMP_GAIN_ADC_IN1\ | ||
78 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0) | ||
79 | #define RT298_SET_AMP_GAIN_ADC_IN2\ | ||
80 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN2, 0) | ||
81 | #define RT298_GET_HP_SENSE\ | ||
82 | VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_HP_OUT, 0) | ||
83 | #define RT298_GET_MIC1_SENSE\ | ||
84 | VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_MIC1, 0) | ||
85 | #define RT298_SET_DMIC2_DEFAULT\ | ||
86 | VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_DMIC2, 0) | ||
87 | #define RT298_SET_SPDIF_DEFAULT\ | ||
88 | VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_SPDIF, 0) | ||
89 | #define RT298_DACL_GAIN\ | ||
90 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0xa000) | ||
91 | #define RT298_DACR_GAIN\ | ||
92 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0x9000) | ||
93 | #define RT298_ADCL_GAIN\ | ||
94 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x6000) | ||
95 | #define RT298_ADCR_GAIN\ | ||
96 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x5000) | ||
97 | #define RT298_MIC_GAIN\ | ||
98 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIC1, 0x7000) | ||
99 | #define RT298_SPOL_GAIN\ | ||
100 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0xa000) | ||
101 | #define RT298_SPOR_GAIN\ | ||
102 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0x9000) | ||
103 | #define RT298_HPOL_GAIN\ | ||
104 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0xa000) | ||
105 | #define RT298_HPOR_GAIN\ | ||
106 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0x9000) | ||
107 | #define RT298_F_DAC_SWITCH\ | ||
108 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7000) | ||
109 | #define RT298_F_RECMIX_SWITCH\ | ||
110 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7100) | ||
111 | #define RT298_REC_MIC_SWITCH\ | ||
112 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7000) | ||
113 | #define RT298_REC_I2S_SWITCH\ | ||
114 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7100) | ||
115 | #define RT298_REC_LINE_SWITCH\ | ||
116 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7200) | ||
117 | #define RT298_REC_BEEP_SWITCH\ | ||
118 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7300) | ||
119 | #define RT298_DAC_FORMAT\ | ||
120 | VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_DAC_OUT1, 0) | ||
121 | #define RT298_ADC_FORMAT\ | ||
122 | VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_ADC_IN1, 0) | ||
123 | #define RT298_COEF_INDEX\ | ||
124 | VERB_CMD(AC_VERB_SET_COEF_INDEX, RT298_VENDOR_REGISTERS, 0) | ||
125 | #define RT298_PROC_COEF\ | ||
126 | VERB_CMD(AC_VERB_SET_PROC_COEF, RT298_VENDOR_REGISTERS, 0) | ||
127 | |||
128 | /* Index registers */ | ||
129 | #define RT298_A_BIAS_CTRL1 0x01 | ||
130 | #define RT298_A_BIAS_CTRL2 0x02 | ||
131 | #define RT298_POWER_CTRL1 0x03 | ||
132 | #define RT298_A_BIAS_CTRL3 0x04 | ||
133 | #define RT298_POWER_CTRL2 0x08 | ||
134 | #define RT298_I2S_CTRL1 0x09 | ||
135 | #define RT298_I2S_CTRL2 0x0a | ||
136 | #define RT298_CLK_DIV 0x0b | ||
137 | #define RT298_DC_GAIN 0x0d | ||
138 | #define RT298_POWER_CTRL3 0x0f | ||
139 | #define RT298_MIC1_DET_CTRL 0x19 | ||
140 | #define RT298_MISC_CTRL1 0x20 | ||
141 | #define RT298_IRQ_CTRL 0x33 | ||
142 | #define RT298_WIND_FILTER_CTRL 0x46 | ||
143 | #define RT298_PLL_CTRL1 0x49 | ||
144 | #define RT298_CBJ_CTRL1 0x4f | ||
145 | #define RT298_CBJ_CTRL2 0x50 | ||
146 | #define RT298_PLL_CTRL 0x63 | ||
147 | #define RT298_DEPOP_CTRL1 0x66 | ||
148 | #define RT298_DEPOP_CTRL2 0x67 | ||
149 | #define RT298_DEPOP_CTRL3 0x68 | ||
150 | #define RT298_DEPOP_CTRL4 0x69 | ||
151 | |||
152 | /* SPDIF (0x06) */ | ||
153 | #define RT298_SPDIF_SEL_SFT 0 | ||
154 | #define RT298_SPDIF_SEL_PCM0 0 | ||
155 | #define RT298_SPDIF_SEL_PCM1 1 | ||
156 | #define RT298_SPDIF_SEL_SPOUT 2 | ||
157 | #define RT298_SPDIF_SEL_PP 3 | ||
158 | |||
159 | /* RECMIX (0x0b) */ | ||
160 | #define RT298_M_REC_BEEP_SFT 0 | ||
161 | #define RT298_M_REC_LINE1_SFT 1 | ||
162 | #define RT298_M_REC_MIC1_SFT 2 | ||
163 | #define RT298_M_REC_I2S_SFT 3 | ||
164 | |||
165 | /* Front (0x0c) */ | ||
166 | #define RT298_M_FRONT_DAC_SFT 0 | ||
167 | #define RT298_M_FRONT_REC_SFT 1 | ||
168 | |||
169 | /* SPK-OUT (0x14) */ | ||
170 | #define RT298_M_SPK_MUX_SFT 14 | ||
171 | #define RT298_SPK_SEL_MASK 0x1 | ||
172 | #define RT298_SPK_SEL_SFT 0 | ||
173 | #define RT298_SPK_SEL_F 0 | ||
174 | #define RT298_SPK_SEL_S 1 | ||
175 | |||
176 | /* HP-OUT (0x21) */ | ||
177 | #define RT298_M_HP_MUX_SFT 14 | ||
178 | #define RT298_HP_SEL_MASK 0x1 | ||
179 | #define RT298_HP_SEL_SFT 0 | ||
180 | #define RT298_HP_SEL_F 0 | ||
181 | #define RT298_HP_SEL_S 1 | ||
182 | |||
183 | /* ADC (0x22) (0x23) */ | ||
184 | #define RT298_ADC_SEL_MASK 0x7 | ||
185 | #define RT298_ADC_SEL_SFT 0 | ||
186 | #define RT298_ADC_SEL_SURR 0 | ||
187 | #define RT298_ADC_SEL_FRONT 1 | ||
188 | #define RT298_ADC_SEL_DMIC 2 | ||
189 | #define RT298_ADC_SEL_BEEP 4 | ||
190 | #define RT298_ADC_SEL_LINE1 5 | ||
191 | #define RT298_ADC_SEL_I2S 6 | ||
192 | #define RT298_ADC_SEL_MIC1 7 | ||
193 | |||
194 | #define RT298_SCLK_S_MCLK 0 | ||
195 | #define RT298_SCLK_S_PLL 1 | ||
196 | |||
197 | enum { | ||
198 | RT298_AIF1, | ||
199 | RT298_AIF2, | ||
200 | RT298_AIFS, | ||
201 | }; | ||
202 | |||
203 | int rt298_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); | ||
204 | |||
205 | #endif /* __RT298_H__ */ | ||
206 | |||
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 058167c80d71..d8771020299d 100644 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c | |||
@@ -1725,7 +1725,6 @@ static int rt5631_i2c_remove(struct i2c_client *client) | |||
1725 | static struct i2c_driver rt5631_i2c_driver = { | 1725 | static struct i2c_driver rt5631_i2c_driver = { |
1726 | .driver = { | 1726 | .driver = { |
1727 | .name = "rt5631", | 1727 | .name = "rt5631", |
1728 | .owner = THIS_MODULE, | ||
1729 | .of_match_table = of_match_ptr(rt5631_i2c_dt_ids), | 1728 | .of_match_table = of_match_ptr(rt5631_i2c_dt_ids), |
1730 | }, | 1729 | }, |
1731 | .probe = rt5631_i2c_probe, | 1730 | .probe = rt5631_i2c_probe, |
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index ff72cd8c236e..e6691a12ca3d 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -2276,7 +2276,6 @@ static int rt5640_i2c_remove(struct i2c_client *i2c) | |||
2276 | static struct i2c_driver rt5640_i2c_driver = { | 2276 | static struct i2c_driver rt5640_i2c_driver = { |
2277 | .driver = { | 2277 | .driver = { |
2278 | .name = "rt5640", | 2278 | .name = "rt5640", |
2279 | .owner = THIS_MODULE, | ||
2280 | .acpi_match_table = ACPI_PTR(rt5640_acpi_match), | 2279 | .acpi_match_table = ACPI_PTR(rt5640_acpi_match), |
2281 | .of_match_table = of_match_ptr(rt5640_of_match), | 2280 | .of_match_table = of_match_ptr(rt5640_of_match), |
2282 | }, | 2281 | }, |
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 1fd21cae7a65..e0954fa2d69b 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c | |||
@@ -3473,7 +3473,6 @@ static void rt5645_i2c_shutdown(struct i2c_client *i2c) | |||
3473 | static struct i2c_driver rt5645_i2c_driver = { | 3473 | static struct i2c_driver rt5645_i2c_driver = { |
3474 | .driver = { | 3474 | .driver = { |
3475 | .name = "rt5645", | 3475 | .name = "rt5645", |
3476 | .owner = THIS_MODULE, | ||
3477 | .acpi_match_table = ACPI_PTR(rt5645_acpi_match), | 3476 | .acpi_match_table = ACPI_PTR(rt5645_acpi_match), |
3478 | }, | 3477 | }, |
3479 | .probe = rt5645_i2c_probe, | 3478 | .probe = rt5645_i2c_probe, |
diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c index a3506e193abc..872121015dfc 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c | |||
@@ -1806,7 +1806,6 @@ static int rt5651_i2c_remove(struct i2c_client *i2c) | |||
1806 | static struct i2c_driver rt5651_i2c_driver = { | 1806 | static struct i2c_driver rt5651_i2c_driver = { |
1807 | .driver = { | 1807 | .driver = { |
1808 | .name = "rt5651", | 1808 | .name = "rt5651", |
1809 | .owner = THIS_MODULE, | ||
1810 | }, | 1809 | }, |
1811 | .probe = rt5651_i2c_probe, | 1810 | .probe = rt5651_i2c_probe, |
1812 | .remove = rt5651_i2c_remove, | 1811 | .remove = rt5651_i2c_remove, |
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c index a9123d414178..8f9ab2b493ec 100644 --- a/sound/soc/codecs/rt5670.c +++ b/sound/soc/codecs/rt5670.c | |||
@@ -3043,7 +3043,6 @@ static int rt5670_i2c_remove(struct i2c_client *i2c) | |||
3043 | static struct i2c_driver rt5670_i2c_driver = { | 3043 | static struct i2c_driver rt5670_i2c_driver = { |
3044 | .driver = { | 3044 | .driver = { |
3045 | .name = "rt5670", | 3045 | .name = "rt5670", |
3046 | .owner = THIS_MODULE, | ||
3047 | .acpi_match_table = ACPI_PTR(rt5670_acpi_match), | 3046 | .acpi_match_table = ACPI_PTR(rt5670_acpi_match), |
3048 | }, | 3047 | }, |
3049 | .probe = rt5670_i2c_probe, | 3048 | .probe = rt5670_i2c_probe, |
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 31d969ac1192..03afec78a170 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c | |||
@@ -5273,7 +5273,6 @@ static int rt5677_i2c_remove(struct i2c_client *i2c) | |||
5273 | static struct i2c_driver rt5677_i2c_driver = { | 5273 | static struct i2c_driver rt5677_i2c_driver = { |
5274 | .driver = { | 5274 | .driver = { |
5275 | .name = "rt5677", | 5275 | .name = "rt5677", |
5276 | .owner = THIS_MODULE, | ||
5277 | }, | 5276 | }, |
5278 | .probe = rt5677_i2c_probe, | 5277 | .probe = rt5677_i2c_probe, |
5279 | .remove = rt5677_i2c_remove, | 5278 | .remove = rt5677_i2c_remove, |
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index e673f6ceb521..f3e646757215 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -1601,7 +1601,6 @@ MODULE_DEVICE_TABLE(of, sgtl5000_dt_ids); | |||
1601 | static struct i2c_driver sgtl5000_i2c_driver = { | 1601 | static struct i2c_driver sgtl5000_i2c_driver = { |
1602 | .driver = { | 1602 | .driver = { |
1603 | .name = "sgtl5000", | 1603 | .name = "sgtl5000", |
1604 | .owner = THIS_MODULE, | ||
1605 | .of_match_table = sgtl5000_dt_ids, | 1604 | .of_match_table = sgtl5000_dt_ids, |
1606 | }, | 1605 | }, |
1607 | .probe = sgtl5000_i2c_probe, | 1606 | .probe = sgtl5000_i2c_probe, |
diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c index f30de7639bb9..5d94d6c7ad33 100644 --- a/sound/soc/codecs/ssm2518.c +++ b/sound/soc/codecs/ssm2518.c | |||
@@ -815,7 +815,6 @@ MODULE_DEVICE_TABLE(i2c, ssm2518_i2c_ids); | |||
815 | static struct i2c_driver ssm2518_driver = { | 815 | static struct i2c_driver ssm2518_driver = { |
816 | .driver = { | 816 | .driver = { |
817 | .name = "ssm2518", | 817 | .name = "ssm2518", |
818 | .owner = THIS_MODULE, | ||
819 | }, | 818 | }, |
820 | .probe = ssm2518_i2c_probe, | 819 | .probe = ssm2518_i2c_probe, |
821 | .remove = ssm2518_i2c_remove, | 820 | .remove = ssm2518_i2c_remove, |
diff --git a/sound/soc/codecs/ssm2602-i2c.c b/sound/soc/codecs/ssm2602-i2c.c index 0d9779d6bfda..173ba85ff59e 100644 --- a/sound/soc/codecs/ssm2602-i2c.c +++ b/sound/soc/codecs/ssm2602-i2c.c | |||
@@ -52,7 +52,6 @@ MODULE_DEVICE_TABLE(of, ssm2602_of_match); | |||
52 | static struct i2c_driver ssm2602_i2c_driver = { | 52 | static struct i2c_driver ssm2602_i2c_driver = { |
53 | .driver = { | 53 | .driver = { |
54 | .name = "ssm2602", | 54 | .name = "ssm2602", |
55 | .owner = THIS_MODULE, | ||
56 | .of_match_table = ssm2602_of_match, | 55 | .of_match_table = ssm2602_of_match, |
57 | }, | 56 | }, |
58 | .probe = ssm2602_i2c_probe, | 57 | .probe = ssm2602_i2c_probe, |
diff --git a/sound/soc/codecs/ssm4567.c b/sound/soc/codecs/ssm4567.c index 84a4f5ad8064..e619d5651b09 100644 --- a/sound/soc/codecs/ssm4567.c +++ b/sound/soc/codecs/ssm4567.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * Licensed under the GPL-2. | 10 | * Licensed under the GPL-2. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/acpi.h> | ||
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
15 | #include <linux/i2c.h> | 16 | #include <linux/i2c.h> |
@@ -173,6 +174,12 @@ static const struct snd_soc_dapm_widget ssm4567_dapm_widgets[] = { | |||
173 | SND_SOC_DAPM_SWITCH("Amplifier Boost", SSM4567_REG_POWER_CTRL, 3, 1, | 174 | SND_SOC_DAPM_SWITCH("Amplifier Boost", SSM4567_REG_POWER_CTRL, 3, 1, |
174 | &ssm4567_amplifier_boost_control), | 175 | &ssm4567_amplifier_boost_control), |
175 | 176 | ||
177 | SND_SOC_DAPM_SIGGEN("Sense"), | ||
178 | |||
179 | SND_SOC_DAPM_PGA("Current Sense", SSM4567_REG_POWER_CTRL, 4, 1, NULL, 0), | ||
180 | SND_SOC_DAPM_PGA("Voltage Sense", SSM4567_REG_POWER_CTRL, 5, 1, NULL, 0), | ||
181 | SND_SOC_DAPM_PGA("VBAT Sense", SSM4567_REG_POWER_CTRL, 6, 1, NULL, 0), | ||
182 | |||
176 | SND_SOC_DAPM_OUTPUT("OUT"), | 183 | SND_SOC_DAPM_OUTPUT("OUT"), |
177 | }; | 184 | }; |
178 | 185 | ||
@@ -180,6 +187,13 @@ static const struct snd_soc_dapm_route ssm4567_routes[] = { | |||
180 | { "OUT", NULL, "Amplifier Boost" }, | 187 | { "OUT", NULL, "Amplifier Boost" }, |
181 | { "Amplifier Boost", "Switch", "DAC" }, | 188 | { "Amplifier Boost", "Switch", "DAC" }, |
182 | { "OUT", NULL, "DAC" }, | 189 | { "OUT", NULL, "DAC" }, |
190 | |||
191 | { "Current Sense", NULL, "Sense" }, | ||
192 | { "Voltage Sense", NULL, "Sense" }, | ||
193 | { "VBAT Sense", NULL, "Sense" }, | ||
194 | { "Capture Sense", NULL, "Current Sense" }, | ||
195 | { "Capture Sense", NULL, "Voltage Sense" }, | ||
196 | { "Capture Sense", NULL, "VBAT Sense" }, | ||
183 | }; | 197 | }; |
184 | 198 | ||
185 | static int ssm4567_hw_params(struct snd_pcm_substream *substream, | 199 | static int ssm4567_hw_params(struct snd_pcm_substream *substream, |
@@ -387,6 +401,14 @@ static struct snd_soc_dai_driver ssm4567_dai = { | |||
387 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | | 401 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | |
388 | SNDRV_PCM_FMTBIT_S32, | 402 | SNDRV_PCM_FMTBIT_S32, |
389 | }, | 403 | }, |
404 | .capture = { | ||
405 | .stream_name = "Capture Sense", | ||
406 | .channels_min = 1, | ||
407 | .channels_max = 1, | ||
408 | .rates = SNDRV_PCM_RATE_8000_192000, | ||
409 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | | ||
410 | SNDRV_PCM_FMTBIT_S32, | ||
411 | }, | ||
390 | .ops = &ssm4567_dai_ops, | 412 | .ops = &ssm4567_dai_ops, |
391 | }; | 413 | }; |
392 | 414 | ||
@@ -456,10 +478,20 @@ static const struct i2c_device_id ssm4567_i2c_ids[] = { | |||
456 | }; | 478 | }; |
457 | MODULE_DEVICE_TABLE(i2c, ssm4567_i2c_ids); | 479 | MODULE_DEVICE_TABLE(i2c, ssm4567_i2c_ids); |
458 | 480 | ||
481 | #ifdef CONFIG_ACPI | ||
482 | |||
483 | static const struct acpi_device_id ssm4567_acpi_match[] = { | ||
484 | { "INT343B", 0 }, | ||
485 | {}, | ||
486 | }; | ||
487 | MODULE_DEVICE_TABLE(acpi, ssm4567_acpi_match); | ||
488 | |||
489 | #endif | ||
490 | |||
459 | static struct i2c_driver ssm4567_driver = { | 491 | static struct i2c_driver ssm4567_driver = { |
460 | .driver = { | 492 | .driver = { |
461 | .name = "ssm4567", | 493 | .name = "ssm4567", |
462 | .owner = THIS_MODULE, | 494 | .acpi_match_table = ACPI_PTR(ssm4567_acpi_match), |
463 | }, | 495 | }, |
464 | .probe = ssm4567_i2c_probe, | 496 | .probe = ssm4567_i2c_probe, |
465 | .remove = ssm4567_i2c_remove, | 497 | .remove = ssm4567_i2c_remove, |
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 60eff36260cb..a9844b2ac829 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
@@ -1144,7 +1144,6 @@ MODULE_DEVICE_TABLE(i2c, sta32x_i2c_id); | |||
1144 | static struct i2c_driver sta32x_i2c_driver = { | 1144 | static struct i2c_driver sta32x_i2c_driver = { |
1145 | .driver = { | 1145 | .driver = { |
1146 | .name = "sta32x", | 1146 | .name = "sta32x", |
1147 | .owner = THIS_MODULE, | ||
1148 | .of_match_table = of_match_ptr(st32x_dt_ids), | 1147 | .of_match_table = of_match_ptr(st32x_dt_ids), |
1149 | }, | 1148 | }, |
1150 | .probe = sta32x_i2c_probe, | 1149 | .probe = sta32x_i2c_probe, |
diff --git a/sound/soc/codecs/sta350.c b/sound/soc/codecs/sta350.c index bd819a3f205a..33a4612f0a07 100644 --- a/sound/soc/codecs/sta350.c +++ b/sound/soc/codecs/sta350.c | |||
@@ -1264,7 +1264,6 @@ MODULE_DEVICE_TABLE(i2c, sta350_i2c_id); | |||
1264 | static struct i2c_driver sta350_i2c_driver = { | 1264 | static struct i2c_driver sta350_i2c_driver = { |
1265 | .driver = { | 1265 | .driver = { |
1266 | .name = "sta350", | 1266 | .name = "sta350", |
1267 | .owner = THIS_MODULE, | ||
1268 | .of_match_table = of_match_ptr(st350_dt_ids), | 1267 | .of_match_table = of_match_ptr(st350_dt_ids), |
1269 | }, | 1268 | }, |
1270 | .probe = sta350_i2c_probe, | 1269 | .probe = sta350_i2c_probe, |
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 4f70378b2cfb..3430f444c1ae 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c | |||
@@ -379,7 +379,6 @@ MODULE_DEVICE_TABLE(i2c, sta529_i2c_id); | |||
379 | static struct i2c_driver sta529_i2c_driver = { | 379 | static struct i2c_driver sta529_i2c_driver = { |
380 | .driver = { | 380 | .driver = { |
381 | .name = "sta529", | 381 | .name = "sta529", |
382 | .owner = THIS_MODULE, | ||
383 | }, | 382 | }, |
384 | .probe = sta529_i2c_probe, | 383 | .probe = sta529_i2c_probe, |
385 | .remove = sta529_i2c_remove, | 384 | .remove = sta529_i2c_remove, |
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 4f25a7d0efa2..083b6b3e6cd2 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
@@ -769,7 +769,6 @@ MODULE_DEVICE_TABLE(of, tas2552_of_match); | |||
769 | static struct i2c_driver tas2552_i2c_driver = { | 769 | static struct i2c_driver tas2552_i2c_driver = { |
770 | .driver = { | 770 | .driver = { |
771 | .name = "tas2552", | 771 | .name = "tas2552", |
772 | .owner = THIS_MODULE, | ||
773 | .of_match_table = of_match_ptr(tas2552_of_match), | 772 | .of_match_table = of_match_ptr(tas2552_of_match), |
774 | .pm = &tas2552_pm, | 773 | .pm = &tas2552_pm, |
775 | }, | 774 | }, |
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 32942bed34b1..0a49fc851577 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c | |||
@@ -994,7 +994,6 @@ static int tas5086_i2c_remove(struct i2c_client *i2c) | |||
994 | static struct i2c_driver tas5086_i2c_driver = { | 994 | static struct i2c_driver tas5086_i2c_driver = { |
995 | .driver = { | 995 | .driver = { |
996 | .name = "tas5086", | 996 | .name = "tas5086", |
997 | .owner = THIS_MODULE, | ||
998 | .of_match_table = of_match_ptr(tas5086_dt_ids), | 997 | .of_match_table = of_match_ptr(tas5086_dt_ids), |
999 | }, | 998 | }, |
1000 | .id_table = tas5086_i2c_id, | 999 | .id_table = tas5086_i2c_id, |
diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c index aab0af681e8c..86d05f01e5f9 100644 --- a/sound/soc/codecs/tfa9879.c +++ b/sound/soc/codecs/tfa9879.c | |||
@@ -314,7 +314,6 @@ MODULE_DEVICE_TABLE(i2c, tfa9879_i2c_id); | |||
314 | static struct i2c_driver tfa9879_i2c_driver = { | 314 | static struct i2c_driver tfa9879_i2c_driver = { |
315 | .driver = { | 315 | .driver = { |
316 | .name = "tfa9879", | 316 | .name = "tfa9879", |
317 | .owner = THIS_MODULE, | ||
318 | }, | 317 | }, |
319 | .probe = tfa9879_i2c_probe, | 318 | .probe = tfa9879_i2c_probe, |
320 | .remove = tfa9879_i2c_remove, | 319 | .remove = tfa9879_i2c_remove, |
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index c4c960f592a1..48dd9b2cd0fa 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c | |||
@@ -1283,7 +1283,6 @@ MODULE_DEVICE_TABLE(i2c, aic31xx_i2c_id); | |||
1283 | static struct i2c_driver aic31xx_i2c_driver = { | 1283 | static struct i2c_driver aic31xx_i2c_driver = { |
1284 | .driver = { | 1284 | .driver = { |
1285 | .name = "tlv320aic31xx-codec", | 1285 | .name = "tlv320aic31xx-codec", |
1286 | .owner = THIS_MODULE, | ||
1287 | .of_match_table = of_match_ptr(tlv320aic31xx_of_match), | 1286 | .of_match_table = of_match_ptr(tlv320aic31xx_of_match), |
1288 | }, | 1287 | }, |
1289 | .probe = aic31xx_i2c_probe, | 1288 | .probe = aic31xx_i2c_probe, |
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index ad6cb90e5f9b..f2d3191961e1 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -871,7 +871,6 @@ MODULE_DEVICE_TABLE(of, aic32x4_of_id); | |||
871 | static struct i2c_driver aic32x4_i2c_driver = { | 871 | static struct i2c_driver aic32x4_i2c_driver = { |
872 | .driver = { | 872 | .driver = { |
873 | .name = "tlv320aic32x4", | 873 | .name = "tlv320aic32x4", |
874 | .owner = THIS_MODULE, | ||
875 | .of_match_table = aic32x4_of_id, | 874 | .of_match_table = aic32x4_of_id, |
876 | }, | 875 | }, |
877 | .probe = aic32x4_i2c_probe, | 876 | .probe = aic32x4_i2c_probe, |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index a7cf19b53fb2..125a93517cdb 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1825,7 +1825,6 @@ MODULE_DEVICE_TABLE(of, tlv320aic3x_of_match); | |||
1825 | static struct i2c_driver aic3x_i2c_driver = { | 1825 | static struct i2c_driver aic3x_i2c_driver = { |
1826 | .driver = { | 1826 | .driver = { |
1827 | .name = "tlv320aic3x-codec", | 1827 | .name = "tlv320aic3x-codec", |
1828 | .owner = THIS_MODULE, | ||
1829 | .of_match_table = of_match_ptr(tlv320aic3x_of_match), | 1828 | .of_match_table = of_match_ptr(tlv320aic3x_of_match), |
1830 | }, | 1829 | }, |
1831 | .probe = aic3x_i2c_probe, | 1830 | .probe = aic3x_i2c_probe, |
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index d67a311f0e75..781398fb2841 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -1585,7 +1585,6 @@ MODULE_DEVICE_TABLE(i2c, tlv320dac33_i2c_id); | |||
1585 | static struct i2c_driver tlv320dac33_i2c_driver = { | 1585 | static struct i2c_driver tlv320dac33_i2c_driver = { |
1586 | .driver = { | 1586 | .driver = { |
1587 | .name = "tlv320dac33-codec", | 1587 | .name = "tlv320dac33-codec", |
1588 | .owner = THIS_MODULE, | ||
1589 | }, | 1588 | }, |
1590 | .probe = dac33_i2c_probe, | 1589 | .probe = dac33_i2c_probe, |
1591 | .remove = dac33_i2c_remove, | 1590 | .remove = dac33_i2c_remove, |
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 6fac9e034c48..265c4c38804d 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c | |||
@@ -488,7 +488,6 @@ MODULE_DEVICE_TABLE(of, tpa6130a2_of_match); | |||
488 | static struct i2c_driver tpa6130a2_i2c_driver = { | 488 | static struct i2c_driver tpa6130a2_i2c_driver = { |
489 | .driver = { | 489 | .driver = { |
490 | .name = "tpa6130a2", | 490 | .name = "tpa6130a2", |
491 | .owner = THIS_MODULE, | ||
492 | .of_match_table = of_match_ptr(tpa6130a2_of_match), | 491 | .of_match_table = of_match_ptr(tpa6130a2_of_match), |
493 | }, | 492 | }, |
494 | .probe = tpa6130a2_probe, | 493 | .probe = tpa6130a2_probe, |
diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 12232d7db4c5..43568435c208 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c | |||
@@ -23,11 +23,13 @@ | |||
23 | #include "ts3a227e.h" | 23 | #include "ts3a227e.h" |
24 | 24 | ||
25 | struct ts3a227e { | 25 | struct ts3a227e { |
26 | struct device *dev; | ||
26 | struct regmap *regmap; | 27 | struct regmap *regmap; |
27 | struct snd_soc_jack *jack; | 28 | struct snd_soc_jack *jack; |
28 | bool plugged; | 29 | bool plugged; |
29 | bool mic_present; | 30 | bool mic_present; |
30 | unsigned int buttons_held; | 31 | unsigned int buttons_held; |
32 | int irq; | ||
31 | }; | 33 | }; |
32 | 34 | ||
33 | /* Button values to be reported on the jack */ | 35 | /* Button values to be reported on the jack */ |
@@ -189,16 +191,28 @@ static irqreturn_t ts3a227e_interrupt(int irq, void *data) | |||
189 | struct ts3a227e *ts3a227e = (struct ts3a227e *)data; | 191 | struct ts3a227e *ts3a227e = (struct ts3a227e *)data; |
190 | struct regmap *regmap = ts3a227e->regmap; | 192 | struct regmap *regmap = ts3a227e->regmap; |
191 | unsigned int int_reg, kp_int_reg, acc_reg, i; | 193 | unsigned int int_reg, kp_int_reg, acc_reg, i; |
194 | struct device *dev = ts3a227e->dev; | ||
195 | int ret; | ||
192 | 196 | ||
193 | /* Check for plug/unplug. */ | 197 | /* Check for plug/unplug. */ |
194 | regmap_read(regmap, TS3A227E_REG_INTERRUPT, &int_reg); | 198 | ret = regmap_read(regmap, TS3A227E_REG_INTERRUPT, &int_reg); |
199 | if (ret) { | ||
200 | dev_err(dev, "failed to clear interrupt ret=%d\n", ret); | ||
201 | return IRQ_NONE; | ||
202 | } | ||
203 | |||
195 | if (int_reg & (DETECTION_COMPLETE_EVENT | INS_REM_EVENT)) { | 204 | if (int_reg & (DETECTION_COMPLETE_EVENT | INS_REM_EVENT)) { |
196 | regmap_read(regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); | 205 | regmap_read(regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); |
197 | ts3a227e_new_jack_state(ts3a227e, acc_reg); | 206 | ts3a227e_new_jack_state(ts3a227e, acc_reg); |
198 | } | 207 | } |
199 | 208 | ||
200 | /* Report any key events. */ | 209 | /* Report any key events. */ |
201 | regmap_read(regmap, TS3A227E_REG_KP_INTERRUPT, &kp_int_reg); | 210 | ret = regmap_read(regmap, TS3A227E_REG_KP_INTERRUPT, &kp_int_reg); |
211 | if (ret) { | ||
212 | dev_err(dev, "failed to clear key interrupt ret=%d\n", ret); | ||
213 | return IRQ_NONE; | ||
214 | } | ||
215 | |||
202 | for (i = 0; i < TS3A227E_NUM_BUTTONS; i++) { | 216 | for (i = 0; i < TS3A227E_NUM_BUTTONS; i++) { |
203 | if (kp_int_reg & PRESS_MASK(i)) | 217 | if (kp_int_reg & PRESS_MASK(i)) |
204 | ts3a227e->buttons_held |= (1 << i); | 218 | ts3a227e->buttons_held |= (1 << i); |
@@ -283,6 +297,8 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c, | |||
283 | return -ENOMEM; | 297 | return -ENOMEM; |
284 | 298 | ||
285 | i2c_set_clientdata(i2c, ts3a227e); | 299 | i2c_set_clientdata(i2c, ts3a227e); |
300 | ts3a227e->dev = dev; | ||
301 | ts3a227e->irq = i2c->irq; | ||
286 | 302 | ||
287 | ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config); | 303 | ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config); |
288 | if (IS_ERR(ts3a227e->regmap)) | 304 | if (IS_ERR(ts3a227e->regmap)) |
@@ -320,6 +336,32 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c, | |||
320 | return 0; | 336 | return 0; |
321 | } | 337 | } |
322 | 338 | ||
339 | #ifdef CONFIG_PM_SLEEP | ||
340 | static int ts3a227e_suspend(struct device *dev) | ||
341 | { | ||
342 | struct ts3a227e *ts3a227e = dev_get_drvdata(dev); | ||
343 | |||
344 | dev_dbg(ts3a227e->dev, "suspend disable irq\n"); | ||
345 | disable_irq(ts3a227e->irq); | ||
346 | |||
347 | return 0; | ||
348 | } | ||
349 | |||
350 | static int ts3a227e_resume(struct device *dev) | ||
351 | { | ||
352 | struct ts3a227e *ts3a227e = dev_get_drvdata(dev); | ||
353 | |||
354 | dev_dbg(ts3a227e->dev, "resume enable irq\n"); | ||
355 | enable_irq(ts3a227e->irq); | ||
356 | |||
357 | return 0; | ||
358 | } | ||
359 | #endif | ||
360 | |||
361 | static const struct dev_pm_ops ts3a227e_pm = { | ||
362 | SET_SYSTEM_SLEEP_PM_OPS(ts3a227e_suspend, ts3a227e_resume) | ||
363 | }; | ||
364 | |||
323 | static const struct i2c_device_id ts3a227e_i2c_ids[] = { | 365 | static const struct i2c_device_id ts3a227e_i2c_ids[] = { |
324 | { "ts3a227e", 0 }, | 366 | { "ts3a227e", 0 }, |
325 | { } | 367 | { } |
@@ -335,7 +377,7 @@ MODULE_DEVICE_TABLE(of, ts3a227e_of_match); | |||
335 | static struct i2c_driver ts3a227e_driver = { | 377 | static struct i2c_driver ts3a227e_driver = { |
336 | .driver = { | 378 | .driver = { |
337 | .name = "ts3a227e", | 379 | .name = "ts3a227e", |
338 | .owner = THIS_MODULE, | 380 | .pm = &ts3a227e_pm, |
339 | .of_match_table = of_match_ptr(ts3a227e_of_match), | 381 | .of_match_table = of_match_ptr(ts3a227e_of_match), |
340 | }, | 382 | }, |
341 | .probe = ts3a227e_i2c_probe, | 383 | .probe = ts3a227e_i2c_probe, |
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 6e159f59d219..5cafb16ccf1a 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -810,7 +810,6 @@ MODULE_DEVICE_TABLE(i2c, uda1380_i2c_id); | |||
810 | static struct i2c_driver uda1380_i2c_driver = { | 810 | static struct i2c_driver uda1380_i2c_driver = { |
811 | .driver = { | 811 | .driver = { |
812 | .name = "uda1380-codec", | 812 | .name = "uda1380-codec", |
813 | .owner = THIS_MODULE, | ||
814 | }, | 813 | }, |
815 | .probe = uda1380_i2c_probe, | 814 | .probe = uda1380_i2c_probe, |
816 | .remove = uda1380_i2c_remove, | 815 | .remove = uda1380_i2c_remove, |
diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c index 048f00568260..ec45c5b220b1 100644 --- a/sound/soc/codecs/wm1250-ev1.c +++ b/sound/soc/codecs/wm1250-ev1.c | |||
@@ -251,7 +251,6 @@ MODULE_DEVICE_TABLE(i2c, wm1250_ev1_i2c_id); | |||
251 | static struct i2c_driver wm1250_ev1_i2c_driver = { | 251 | static struct i2c_driver wm1250_ev1_i2c_driver = { |
252 | .driver = { | 252 | .driver = { |
253 | .name = "wm1250-ev1", | 253 | .name = "wm1250-ev1", |
254 | .owner = THIS_MODULE, | ||
255 | }, | 254 | }, |
256 | .probe = wm1250_ev1_probe, | 255 | .probe = wm1250_ev1_probe, |
257 | .remove = wm1250_ev1_remove, | 256 | .remove = wm1250_ev1_remove, |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index 21d5402e343f..786abd02b140 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -942,7 +942,6 @@ MODULE_DEVICE_TABLE(i2c, wm2000_i2c_id); | |||
942 | static struct i2c_driver wm2000_i2c_driver = { | 942 | static struct i2c_driver wm2000_i2c_driver = { |
943 | .driver = { | 943 | .driver = { |
944 | .name = "wm2000", | 944 | .name = "wm2000", |
945 | .owner = THIS_MODULE, | ||
946 | }, | 945 | }, |
947 | .probe = wm2000_i2c_probe, | 946 | .probe = wm2000_i2c_probe, |
948 | .remove = wm2000_i2c_remove, | 947 | .remove = wm2000_i2c_remove, |
diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index c83083285e53..d4fa224d68b1 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c | |||
@@ -2495,7 +2495,6 @@ MODULE_DEVICE_TABLE(i2c, wm2200_i2c_id); | |||
2495 | static struct i2c_driver wm2200_i2c_driver = { | 2495 | static struct i2c_driver wm2200_i2c_driver = { |
2496 | .driver = { | 2496 | .driver = { |
2497 | .name = "wm2200", | 2497 | .name = "wm2200", |
2498 | .owner = THIS_MODULE, | ||
2499 | .pm = &wm2200_pm, | 2498 | .pm = &wm2200_pm, |
2500 | }, | 2499 | }, |
2501 | .probe = wm2200_i2c_probe, | 2500 | .probe = wm2200_i2c_probe, |
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 4c10cd88c1af..b9594d6feb71 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -2722,7 +2722,6 @@ MODULE_DEVICE_TABLE(i2c, wm5100_i2c_id); | |||
2722 | static struct i2c_driver wm5100_i2c_driver = { | 2722 | static struct i2c_driver wm5100_i2c_driver = { |
2723 | .driver = { | 2723 | .driver = { |
2724 | .name = "wm5100", | 2724 | .name = "wm5100", |
2725 | .owner = THIS_MODULE, | ||
2726 | .pm = &wm5100_pm, | 2725 | .pm = &wm5100_pm, |
2727 | }, | 2726 | }, |
2728 | .probe = wm5100_i2c_probe, | 2727 | .probe = wm5100_i2c_probe, |
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index dac5beb4d023..3cff5a699e57 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -690,7 +690,6 @@ MODULE_DEVICE_TABLE(i2c, wm8510_i2c_id); | |||
690 | static struct i2c_driver wm8510_i2c_driver = { | 690 | static struct i2c_driver wm8510_i2c_driver = { |
691 | .driver = { | 691 | .driver = { |
692 | .name = "wm8510", | 692 | .name = "wm8510", |
693 | .owner = THIS_MODULE, | ||
694 | .of_match_table = wm8510_of_match, | 693 | .of_match_table = wm8510_of_match, |
695 | }, | 694 | }, |
696 | .probe = wm8510_i2c_probe, | 695 | .probe = wm8510_i2c_probe, |
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 43ea8ae5f871..5f8fde56e68b 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c | |||
@@ -534,7 +534,6 @@ MODULE_DEVICE_TABLE(i2c, wm8523_i2c_id); | |||
534 | static struct i2c_driver wm8523_i2c_driver = { | 534 | static struct i2c_driver wm8523_i2c_driver = { |
535 | .driver = { | 535 | .driver = { |
536 | .name = "wm8523", | 536 | .name = "wm8523", |
537 | .owner = THIS_MODULE, | ||
538 | .of_match_table = wm8523_of_match, | 537 | .of_match_table = wm8523_of_match, |
539 | }, | 538 | }, |
540 | .probe = wm8523_i2c_probe, | 539 | .probe = wm8523_i2c_probe, |
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 759a7928ac3e..abf60355f7f7 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -978,7 +978,6 @@ MODULE_DEVICE_TABLE(i2c, wm8580_i2c_id); | |||
978 | static struct i2c_driver wm8580_i2c_driver = { | 978 | static struct i2c_driver wm8580_i2c_driver = { |
979 | .driver = { | 979 | .driver = { |
980 | .name = "wm8580", | 980 | .name = "wm8580", |
981 | .owner = THIS_MODULE, | ||
982 | .of_match_table = wm8580_of_match, | 981 | .of_match_table = wm8580_of_match, |
983 | }, | 982 | }, |
984 | .probe = wm8580_i2c_probe, | 983 | .probe = wm8580_i2c_probe, |
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index cc8251f09f8a..44b9e0ae7451 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c | |||
@@ -478,7 +478,6 @@ MODULE_DEVICE_TABLE(i2c, wm8711_i2c_id); | |||
478 | static struct i2c_driver wm8711_i2c_driver = { | 478 | static struct i2c_driver wm8711_i2c_driver = { |
479 | .driver = { | 479 | .driver = { |
480 | .name = "wm8711", | 480 | .name = "wm8711", |
481 | .owner = THIS_MODULE, | ||
482 | .of_match_table = wm8711_of_match, | 481 | .of_match_table = wm8711_of_match, |
483 | }, | 482 | }, |
484 | .probe = wm8711_i2c_probe, | 483 | .probe = wm8711_i2c_probe, |
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index f1a173e6ec33..cd7b02413ccf 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c | |||
@@ -319,7 +319,6 @@ MODULE_DEVICE_TABLE(i2c, wm8728_i2c_id); | |||
319 | static struct i2c_driver wm8728_i2c_driver = { | 319 | static struct i2c_driver wm8728_i2c_driver = { |
320 | .driver = { | 320 | .driver = { |
321 | .name = "wm8728", | 321 | .name = "wm8728", |
322 | .owner = THIS_MODULE, | ||
323 | .of_match_table = wm8728_of_match, | 322 | .of_match_table = wm8728_of_match, |
324 | }, | 323 | }, |
325 | .probe = wm8728_i2c_probe, | 324 | .probe = wm8728_i2c_probe, |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 915ea11ad4b6..4846842522f3 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -789,7 +789,6 @@ MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); | |||
789 | static struct i2c_driver wm8731_i2c_driver = { | 789 | static struct i2c_driver wm8731_i2c_driver = { |
790 | .driver = { | 790 | .driver = { |
791 | .name = "wm8731", | 791 | .name = "wm8731", |
792 | .owner = THIS_MODULE, | ||
793 | .of_match_table = wm8731_of_match, | 792 | .of_match_table = wm8731_of_match, |
794 | }, | 793 | }, |
795 | .probe = wm8731_i2c_probe, | 794 | .probe = wm8731_i2c_probe, |
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index 6ad606fd8b69..b54a7b78f562 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c | |||
@@ -657,7 +657,6 @@ MODULE_DEVICE_TABLE(i2c, wm8737_i2c_id); | |||
657 | static struct i2c_driver wm8737_i2c_driver = { | 657 | static struct i2c_driver wm8737_i2c_driver = { |
658 | .driver = { | 658 | .driver = { |
659 | .name = "wm8737", | 659 | .name = "wm8737", |
660 | .owner = THIS_MODULE, | ||
661 | .of_match_table = wm8737_of_match, | 660 | .of_match_table = wm8737_of_match, |
662 | }, | 661 | }, |
663 | .probe = wm8737_i2c_probe, | 662 | .probe = wm8737_i2c_probe, |
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index b34623786e35..430fa7ded713 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c | |||
@@ -633,7 +633,6 @@ MODULE_DEVICE_TABLE(i2c, wm8741_i2c_id); | |||
633 | static struct i2c_driver wm8741_i2c_driver = { | 633 | static struct i2c_driver wm8741_i2c_driver = { |
634 | .driver = { | 634 | .driver = { |
635 | .name = "wm8741", | 635 | .name = "wm8741", |
636 | .owner = THIS_MODULE, | ||
637 | .of_match_table = wm8741_of_match, | 636 | .of_match_table = wm8741_of_match, |
638 | }, | 637 | }, |
639 | .probe = wm8741_i2c_probe, | 638 | .probe = wm8741_i2c_probe, |
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index 56d89b0865fa..873933a7966f 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -826,7 +826,6 @@ MODULE_DEVICE_TABLE(i2c, wm8750_i2c_id); | |||
826 | static struct i2c_driver wm8750_i2c_driver = { | 826 | static struct i2c_driver wm8750_i2c_driver = { |
827 | .driver = { | 827 | .driver = { |
828 | .name = "wm8750", | 828 | .name = "wm8750", |
829 | .owner = THIS_MODULE, | ||
830 | .of_match_table = wm8750_of_match, | 829 | .of_match_table = wm8750_of_match, |
831 | }, | 830 | }, |
832 | .probe = wm8750_i2c_probe, | 831 | .probe = wm8750_i2c_probe, |
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index feb2997a377a..b5e50ffbf99f 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1609,7 +1609,6 @@ MODULE_DEVICE_TABLE(i2c, wm8753_i2c_id); | |||
1609 | static struct i2c_driver wm8753_i2c_driver = { | 1609 | static struct i2c_driver wm8753_i2c_driver = { |
1610 | .driver = { | 1610 | .driver = { |
1611 | .name = "wm8753", | 1611 | .name = "wm8753", |
1612 | .owner = THIS_MODULE, | ||
1613 | .of_match_table = wm8753_of_match, | 1612 | .of_match_table = wm8753_of_match, |
1614 | }, | 1613 | }, |
1615 | .probe = wm8753_i2c_probe, | 1614 | .probe = wm8753_i2c_probe, |
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index ece9b4456767..592866dd60c7 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c | |||
@@ -536,7 +536,6 @@ MODULE_DEVICE_TABLE(i2c, wm8776_i2c_id); | |||
536 | static struct i2c_driver wm8776_i2c_driver = { | 536 | static struct i2c_driver wm8776_i2c_driver = { |
537 | .driver = { | 537 | .driver = { |
538 | .name = "wm8776", | 538 | .name = "wm8776", |
539 | .owner = THIS_MODULE, | ||
540 | .of_match_table = wm8776_of_match, | 539 | .of_match_table = wm8776_of_match, |
541 | }, | 540 | }, |
542 | .probe = wm8776_i2c_probe, | 541 | .probe = wm8776_i2c_probe, |
diff --git a/sound/soc/codecs/wm8804-i2c.c b/sound/soc/codecs/wm8804-i2c.c index 6596f5f3a0c3..f27464c2c5ba 100644 --- a/sound/soc/codecs/wm8804-i2c.c +++ b/sound/soc/codecs/wm8804-i2c.c | |||
@@ -49,7 +49,6 @@ MODULE_DEVICE_TABLE(of, wm8804_of_match); | |||
49 | static struct i2c_driver wm8804_i2c_driver = { | 49 | static struct i2c_driver wm8804_i2c_driver = { |
50 | .driver = { | 50 | .driver = { |
51 | .name = "wm8804", | 51 | .name = "wm8804", |
52 | .owner = THIS_MODULE, | ||
53 | .pm = &wm8804_pm, | 52 | .pm = &wm8804_pm, |
54 | .of_match_table = wm8804_of_match, | 53 | .of_match_table = wm8804_of_match, |
55 | }, | 54 | }, |
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index f3759ec5a863..98900aa66dc3 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
@@ -1312,7 +1312,6 @@ MODULE_DEVICE_TABLE(i2c, wm8900_i2c_id); | |||
1312 | static struct i2c_driver wm8900_i2c_driver = { | 1312 | static struct i2c_driver wm8900_i2c_driver = { |
1313 | .driver = { | 1313 | .driver = { |
1314 | .name = "wm8900", | 1314 | .name = "wm8900", |
1315 | .owner = THIS_MODULE, | ||
1316 | }, | 1315 | }, |
1317 | .probe = wm8900_i2c_probe, | 1316 | .probe = wm8900_i2c_probe, |
1318 | .remove = wm8900_i2c_remove, | 1317 | .remove = wm8900_i2c_remove, |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index b5322c1544fb..b011253459af 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -2193,7 +2193,6 @@ MODULE_DEVICE_TABLE(i2c, wm8903_i2c_id); | |||
2193 | static struct i2c_driver wm8903_i2c_driver = { | 2193 | static struct i2c_driver wm8903_i2c_driver = { |
2194 | .driver = { | 2194 | .driver = { |
2195 | .name = "wm8903", | 2195 | .name = "wm8903", |
2196 | .owner = THIS_MODULE, | ||
2197 | .of_match_table = wm8903_of_match, | 2196 | .of_match_table = wm8903_of_match, |
2198 | }, | 2197 | }, |
2199 | .probe = wm8903_i2c_probe, | 2198 | .probe = wm8903_i2c_probe, |
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 265a4a58a2d1..145f5f9d581b 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -2292,7 +2292,6 @@ MODULE_DEVICE_TABLE(i2c, wm8904_i2c_id); | |||
2292 | static struct i2c_driver wm8904_i2c_driver = { | 2292 | static struct i2c_driver wm8904_i2c_driver = { |
2293 | .driver = { | 2293 | .driver = { |
2294 | .name = "wm8904", | 2294 | .name = "wm8904", |
2295 | .owner = THIS_MODULE, | ||
2296 | .of_match_table = of_match_ptr(wm8904_of_match), | 2295 | .of_match_table = of_match_ptr(wm8904_of_match), |
2297 | }, | 2296 | }, |
2298 | .probe = wm8904_i2c_probe, | 2297 | .probe = wm8904_i2c_probe, |
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 98ef0ba5c2a4..f6f9395ea38e 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c | |||
@@ -787,7 +787,6 @@ MODULE_DEVICE_TABLE(i2c, wm8940_i2c_id); | |||
787 | static struct i2c_driver wm8940_i2c_driver = { | 787 | static struct i2c_driver wm8940_i2c_driver = { |
788 | .driver = { | 788 | .driver = { |
789 | .name = "wm8940", | 789 | .name = "wm8940", |
790 | .owner = THIS_MODULE, | ||
791 | }, | 790 | }, |
792 | .probe = wm8940_i2c_probe, | 791 | .probe = wm8940_i2c_probe, |
793 | .remove = wm8940_i2c_remove, | 792 | .remove = wm8940_i2c_remove, |
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 2d591c24704b..12e4435f00f8 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -1009,7 +1009,6 @@ MODULE_DEVICE_TABLE(i2c, wm8955_i2c_id); | |||
1009 | static struct i2c_driver wm8955_i2c_driver = { | 1009 | static struct i2c_driver wm8955_i2c_driver = { |
1010 | .driver = { | 1010 | .driver = { |
1011 | .name = "wm8955", | 1011 | .name = "wm8955", |
1012 | .owner = THIS_MODULE, | ||
1013 | }, | 1012 | }, |
1014 | .probe = wm8955_i2c_probe, | 1013 | .probe = wm8955_i2c_probe, |
1015 | .remove = wm8955_i2c_remove, | 1014 | .remove = wm8955_i2c_remove, |
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 94c5c4681ce5..1ed0720b41f0 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c | |||
@@ -1216,7 +1216,6 @@ MODULE_DEVICE_TABLE(of, wm8960_of_match); | |||
1216 | static struct i2c_driver wm8960_i2c_driver = { | 1216 | static struct i2c_driver wm8960_i2c_driver = { |
1217 | .driver = { | 1217 | .driver = { |
1218 | .name = "wm8960", | 1218 | .name = "wm8960", |
1219 | .owner = THIS_MODULE, | ||
1220 | .of_match_table = wm8960_of_match, | 1219 | .of_match_table = wm8960_of_match, |
1221 | }, | 1220 | }, |
1222 | .probe = wm8960_i2c_probe, | 1221 | .probe = wm8960_i2c_probe, |
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index a057662632ff..20a010344fd5 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -982,7 +982,6 @@ MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id); | |||
982 | static struct i2c_driver wm8961_i2c_driver = { | 982 | static struct i2c_driver wm8961_i2c_driver = { |
983 | .driver = { | 983 | .driver = { |
984 | .name = "wm8961", | 984 | .name = "wm8961", |
985 | .owner = THIS_MODULE, | ||
986 | }, | 985 | }, |
987 | .probe = wm8961_i2c_probe, | 986 | .probe = wm8961_i2c_probe, |
988 | .remove = wm8961_i2c_remove, | 987 | .remove = wm8961_i2c_remove, |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index c5748fd4f296..40c4617e3ef1 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -3878,7 +3878,6 @@ MODULE_DEVICE_TABLE(of, wm8962_of_match); | |||
3878 | static struct i2c_driver wm8962_i2c_driver = { | 3878 | static struct i2c_driver wm8962_i2c_driver = { |
3879 | .driver = { | 3879 | .driver = { |
3880 | .name = "wm8962", | 3880 | .name = "wm8962", |
3881 | .owner = THIS_MODULE, | ||
3882 | .of_match_table = wm8962_of_match, | 3881 | .of_match_table = wm8962_of_match, |
3883 | .pm = &wm8962_pm, | 3882 | .pm = &wm8962_pm, |
3884 | }, | 3883 | }, |
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index b51184c4e816..2cdde32c43c6 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c | |||
@@ -710,7 +710,6 @@ MODULE_DEVICE_TABLE(i2c, wm8971_i2c_id); | |||
710 | static struct i2c_driver wm8971_i2c_driver = { | 710 | static struct i2c_driver wm8971_i2c_driver = { |
711 | .driver = { | 711 | .driver = { |
712 | .name = "wm8971", | 712 | .name = "wm8971", |
713 | .owner = THIS_MODULE, | ||
714 | }, | 713 | }, |
715 | .probe = wm8971_i2c_probe, | 714 | .probe = wm8971_i2c_probe, |
716 | .remove = wm8971_i2c_remove, | 715 | .remove = wm8971_i2c_remove, |
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index 33b16a7ba82e..0a60677397b3 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c | |||
@@ -634,7 +634,6 @@ MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id); | |||
634 | static struct i2c_driver wm8974_i2c_driver = { | 634 | static struct i2c_driver wm8974_i2c_driver = { |
635 | .driver = { | 635 | .driver = { |
636 | .name = "wm8974", | 636 | .name = "wm8974", |
637 | .owner = THIS_MODULE, | ||
638 | }, | 637 | }, |
639 | .probe = wm8974_i2c_probe, | 638 | .probe = wm8974_i2c_probe, |
640 | .remove = wm8974_i2c_remove, | 639 | .remove = wm8974_i2c_remove, |
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index cfc8cdf49970..d36d6001fbb7 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c | |||
@@ -1072,7 +1072,6 @@ MODULE_DEVICE_TABLE(i2c, wm8978_i2c_id); | |||
1072 | static struct i2c_driver wm8978_i2c_driver = { | 1072 | static struct i2c_driver wm8978_i2c_driver = { |
1073 | .driver = { | 1073 | .driver = { |
1074 | .name = "wm8978", | 1074 | .name = "wm8978", |
1075 | .owner = THIS_MODULE, | ||
1076 | }, | 1075 | }, |
1077 | .probe = wm8978_i2c_probe, | 1076 | .probe = wm8978_i2c_probe, |
1078 | .remove = wm8978_i2c_remove, | 1077 | .remove = wm8978_i2c_remove, |
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index 2fdd2c6cc09d..f6861cc4c321 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c | |||
@@ -1133,7 +1133,6 @@ MODULE_DEVICE_TABLE(i2c, wm8983_i2c_id); | |||
1133 | static struct i2c_driver wm8983_i2c_driver = { | 1133 | static struct i2c_driver wm8983_i2c_driver = { |
1134 | .driver = { | 1134 | .driver = { |
1135 | .name = "wm8983", | 1135 | .name = "wm8983", |
1136 | .owner = THIS_MODULE, | ||
1137 | }, | 1136 | }, |
1138 | .probe = wm8983_i2c_probe, | 1137 | .probe = wm8983_i2c_probe, |
1139 | .remove = wm8983_i2c_remove, | 1138 | .remove = wm8983_i2c_remove, |
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index 8a85f5004d41..9c3c1517a4f3 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c | |||
@@ -1144,7 +1144,6 @@ MODULE_DEVICE_TABLE(i2c, wm8985_i2c_id); | |||
1144 | static struct i2c_driver wm8985_i2c_driver = { | 1144 | static struct i2c_driver wm8985_i2c_driver = { |
1145 | .driver = { | 1145 | .driver = { |
1146 | .name = "wm8985", | 1146 | .name = "wm8985", |
1147 | .owner = THIS_MODULE, | ||
1148 | }, | 1147 | }, |
1149 | .probe = wm8985_i2c_probe, | 1148 | .probe = wm8985_i2c_probe, |
1150 | .remove = wm8985_i2c_remove, | 1149 | .remove = wm8985_i2c_remove, |
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index f13a995af277..c88ce99ce9e1 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c | |||
@@ -919,7 +919,6 @@ MODULE_DEVICE_TABLE(i2c, wm8988_i2c_id); | |||
919 | static struct i2c_driver wm8988_i2c_driver = { | 919 | static struct i2c_driver wm8988_i2c_driver = { |
920 | .driver = { | 920 | .driver = { |
921 | .name = "wm8988", | 921 | .name = "wm8988", |
922 | .owner = THIS_MODULE, | ||
923 | }, | 922 | }, |
924 | .probe = wm8988_i2c_probe, | 923 | .probe = wm8988_i2c_probe, |
925 | .remove = wm8988_i2c_remove, | 924 | .remove = wm8988_i2c_remove, |
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 1993fd2a6f15..83d72d8bc51b 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -1356,7 +1356,6 @@ MODULE_DEVICE_TABLE(i2c, wm8990_i2c_id); | |||
1356 | static struct i2c_driver wm8990_i2c_driver = { | 1356 | static struct i2c_driver wm8990_i2c_driver = { |
1357 | .driver = { | 1357 | .driver = { |
1358 | .name = "wm8990", | 1358 | .name = "wm8990", |
1359 | .owner = THIS_MODULE, | ||
1360 | }, | 1359 | }, |
1361 | .probe = wm8990_i2c_probe, | 1360 | .probe = wm8990_i2c_probe, |
1362 | .remove = wm8990_i2c_remove, | 1361 | .remove = wm8990_i2c_remove, |
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c index 44a677720828..709d16e338d9 100644 --- a/sound/soc/codecs/wm8991.c +++ b/sound/soc/codecs/wm8991.c | |||
@@ -1363,7 +1363,6 @@ MODULE_DEVICE_TABLE(i2c, wm8991_i2c_id); | |||
1363 | static struct i2c_driver wm8991_i2c_driver = { | 1363 | static struct i2c_driver wm8991_i2c_driver = { |
1364 | .driver = { | 1364 | .driver = { |
1365 | .name = "wm8991", | 1365 | .name = "wm8991", |
1366 | .owner = THIS_MODULE, | ||
1367 | }, | 1366 | }, |
1368 | .probe = wm8991_i2c_probe, | 1367 | .probe = wm8991_i2c_probe, |
1369 | .remove = wm8991_i2c_remove, | 1368 | .remove = wm8991_i2c_remove, |
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 8a8db8605dc2..3f4dfb95d2d7 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -1742,7 +1742,6 @@ MODULE_DEVICE_TABLE(i2c, wm8993_i2c_id); | |||
1742 | static struct i2c_driver wm8993_i2c_driver = { | 1742 | static struct i2c_driver wm8993_i2c_driver = { |
1743 | .driver = { | 1743 | .driver = { |
1744 | .name = "wm8993", | 1744 | .name = "wm8993", |
1745 | .owner = THIS_MODULE, | ||
1746 | }, | 1745 | }, |
1747 | .probe = wm8993_i2c_probe, | 1746 | .probe = wm8993_i2c_probe, |
1748 | .remove = wm8993_i2c_remove, | 1747 | .remove = wm8993_i2c_remove, |
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 505b65f5734f..eda52a96c1fa 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c | |||
@@ -2298,7 +2298,6 @@ MODULE_DEVICE_TABLE(i2c, wm8995_i2c_id); | |||
2298 | static struct i2c_driver wm8995_i2c_driver = { | 2298 | static struct i2c_driver wm8995_i2c_driver = { |
2299 | .driver = { | 2299 | .driver = { |
2300 | .name = "wm8995", | 2300 | .name = "wm8995", |
2301 | .owner = THIS_MODULE, | ||
2302 | }, | 2301 | }, |
2303 | .probe = wm8995_i2c_probe, | 2302 | .probe = wm8995_i2c_probe, |
2304 | .remove = wm8995_i2c_remove, | 2303 | .remove = wm8995_i2c_remove, |
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 3dd063f682b2..29b6688fb6ee 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -3100,7 +3100,6 @@ MODULE_DEVICE_TABLE(i2c, wm8996_i2c_id); | |||
3100 | static struct i2c_driver wm8996_i2c_driver = { | 3100 | static struct i2c_driver wm8996_i2c_driver = { |
3101 | .driver = { | 3101 | .driver = { |
3102 | .name = "wm8996", | 3102 | .name = "wm8996", |
3103 | .owner = THIS_MODULE, | ||
3104 | }, | 3103 | }, |
3105 | .probe = wm8996_i2c_probe, | 3104 | .probe = wm8996_i2c_probe, |
3106 | .remove = wm8996_i2c_remove, | 3105 | .remove = wm8996_i2c_remove, |
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 8a8b1c0f9142..011516eec4b5 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -1378,7 +1378,6 @@ MODULE_DEVICE_TABLE(i2c, wm9081_i2c_id); | |||
1378 | static struct i2c_driver wm9081_i2c_driver = { | 1378 | static struct i2c_driver wm9081_i2c_driver = { |
1379 | .driver = { | 1379 | .driver = { |
1380 | .name = "wm9081", | 1380 | .name = "wm9081", |
1381 | .owner = THIS_MODULE, | ||
1382 | }, | 1381 | }, |
1383 | .probe = wm9081_i2c_probe, | 1382 | .probe = wm9081_i2c_probe, |
1384 | .remove = wm9081_i2c_remove, | 1383 | .remove = wm9081_i2c_remove, |
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index 13d23fc797db..12baf725d4a5 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c | |||
@@ -636,7 +636,6 @@ MODULE_DEVICE_TABLE(i2c, wm9090_id); | |||
636 | static struct i2c_driver wm9090_i2c_driver = { | 636 | static struct i2c_driver wm9090_i2c_driver = { |
637 | .driver = { | 637 | .driver = { |
638 | .name = "wm9090", | 638 | .name = "wm9090", |
639 | .owner = THIS_MODULE, | ||
640 | }, | 639 | }, |
641 | .probe = wm9090_i2c_probe, | 640 | .probe = wm9090_i2c_probe, |
642 | .remove = wm9090_i2c_remove, | 641 | .remove = wm9090_i2c_remove, |