aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/sound/rockchip-i2s.txt1
-rw-r--r--sound/soc/codecs/rt5514.c36
-rw-r--r--sound/soc/codecs/rt5645.c10
-rw-r--r--sound/soc/codecs/rt5677.c7
-rw-r--r--sound/soc/rockchip/rk3288_hdmi_analog.c3
5 files changed, 53 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt
index a6600f6dea64..206aba1b34bb 100644
--- a/Documentation/devicetree/bindings/sound/rockchip-i2s.txt
+++ b/Documentation/devicetree/bindings/sound/rockchip-i2s.txt
@@ -9,6 +9,7 @@ Required properties:
9 - "rockchip,rk3066-i2s": for rk3066 9 - "rockchip,rk3066-i2s": for rk3066
10 - "rockchip,rk3188-i2s", "rockchip,rk3066-i2s": for rk3188 10 - "rockchip,rk3188-i2s", "rockchip,rk3066-i2s": for rk3188
11 - "rockchip,rk3288-i2s", "rockchip,rk3066-i2s": for rk3288 11 - "rockchip,rk3288-i2s", "rockchip,rk3066-i2s": for rk3288
12 - "rockchip,rk3368-i2s", "rockchip,rk3066-i2s": for rk3368
12 - "rockchip,rk3399-i2s", "rockchip,rk3066-i2s": for rk3399 13 - "rockchip,rk3399-i2s", "rockchip,rk3066-i2s": for rk3399
13- reg: physical base address of the controller and length of memory mapped 14- reg: physical base address of the controller and length of memory mapped
14 region. 15 region.
diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c
index b281a46d769d..f91221b1ddf0 100644
--- a/sound/soc/codecs/rt5514.c
+++ b/sound/soc/codecs/rt5514.c
@@ -1084,13 +1084,28 @@ static int rt5514_parse_dt(struct rt5514_priv *rt5514, struct device *dev)
1084 return 0; 1084 return 0;
1085} 1085}
1086 1086
1087static __maybe_unused int rt5514_i2c_resume(struct device *dev)
1088{
1089 struct rt5514_priv *rt5514 = dev_get_drvdata(dev);
1090 unsigned int val;
1091
1092 /*
1093 * Add a bogus read to avoid rt5514's confusion after s2r in case it
1094 * saw glitches on the i2c lines and thought the other side sent a
1095 * start bit.
1096 */
1097 regmap_read(rt5514->regmap, RT5514_VENDOR_ID2, &val);
1098
1099 return 0;
1100}
1101
1087static int rt5514_i2c_probe(struct i2c_client *i2c, 1102static int rt5514_i2c_probe(struct i2c_client *i2c,
1088 const struct i2c_device_id *id) 1103 const struct i2c_device_id *id)
1089{ 1104{
1090 struct rt5514_platform_data *pdata = dev_get_platdata(&i2c->dev); 1105 struct rt5514_platform_data *pdata = dev_get_platdata(&i2c->dev);
1091 struct rt5514_priv *rt5514; 1106 struct rt5514_priv *rt5514;
1092 int ret; 1107 int ret;
1093 unsigned int val; 1108 unsigned int val = ~0;
1094 1109
1095 rt5514 = devm_kzalloc(&i2c->dev, sizeof(struct rt5514_priv), 1110 rt5514 = devm_kzalloc(&i2c->dev, sizeof(struct rt5514_priv),
1096 GFP_KERNEL); 1111 GFP_KERNEL);
@@ -1120,8 +1135,16 @@ static int rt5514_i2c_probe(struct i2c_client *i2c,
1120 return ret; 1135 return ret;
1121 } 1136 }
1122 1137
1123 regmap_read(rt5514->regmap, RT5514_VENDOR_ID2, &val); 1138 /*
1124 if (val != RT5514_DEVICE_ID) { 1139 * The rt5514 can get confused if the i2c lines glitch together, as
1140 * can happen at bootup as regulators are turned off and on. If it's
1141 * in this glitched state the first i2c read will fail, so we'll give
1142 * it one change to retry.
1143 */
1144 ret = regmap_read(rt5514->regmap, RT5514_VENDOR_ID2, &val);
1145 if (ret || val != RT5514_DEVICE_ID)
1146 ret = regmap_read(rt5514->regmap, RT5514_VENDOR_ID2, &val);
1147 if (ret || val != RT5514_DEVICE_ID) {
1125 dev_err(&i2c->dev, 1148 dev_err(&i2c->dev,
1126 "Device with ID register %x is not rt5514\n", val); 1149 "Device with ID register %x is not rt5514\n", val);
1127 return -ENODEV; 1150 return -ENODEV;
@@ -1149,10 +1172,15 @@ static int rt5514_i2c_remove(struct i2c_client *i2c)
1149 return 0; 1172 return 0;
1150} 1173}
1151 1174
1152struct i2c_driver rt5514_i2c_driver = { 1175static const struct dev_pm_ops rt5514_i2_pm_ops = {
1176 SET_SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume)
1177};
1178
1179static struct i2c_driver rt5514_i2c_driver = {
1153 .driver = { 1180 .driver = {
1154 .name = "rt5514", 1181 .name = "rt5514",
1155 .of_match_table = of_match_ptr(rt5514_of_match), 1182 .of_match_table = of_match_ptr(rt5514_of_match),
1183 .pm = &rt5514_i2_pm_ops,
1156 }, 1184 },
1157 .probe = rt5514_i2c_probe, 1185 .probe = rt5514_i2c_probe,
1158 .remove = rt5514_i2c_remove, 1186 .remove = rt5514_i2c_remove,
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index e149f3ce5401..87844a45886a 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3542,6 +3542,15 @@ static const struct i2c_device_id rt5645_i2c_id[] = {
3542}; 3542};
3543MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id); 3543MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id);
3544 3544
3545#ifdef CONFIG_OF
3546static const struct of_device_id rt5645_of_match[] = {
3547 { .compatible = "realtek,rt5645", },
3548 { .compatible = "realtek,rt5650", },
3549 { }
3550};
3551MODULE_DEVICE_TABLE(of, rt5645_of_match);
3552#endif
3553
3545#ifdef CONFIG_ACPI 3554#ifdef CONFIG_ACPI
3546static const struct acpi_device_id rt5645_acpi_match[] = { 3555static const struct acpi_device_id rt5645_acpi_match[] = {
3547 { "10EC5645", 0 }, 3556 { "10EC5645", 0 },
@@ -3912,6 +3921,7 @@ static void rt5645_i2c_shutdown(struct i2c_client *i2c)
3912static struct i2c_driver rt5645_i2c_driver = { 3921static struct i2c_driver rt5645_i2c_driver = {
3913 .driver = { 3922 .driver = {
3914 .name = "rt5645", 3923 .name = "rt5645",
3924 .of_match_table = of_match_ptr(rt5645_of_match),
3915 .acpi_match_table = ACPI_PTR(rt5645_acpi_match), 3925 .acpi_match_table = ACPI_PTR(rt5645_acpi_match),
3916 }, 3926 },
3917 .probe = rt5645_i2c_probe, 3927 .probe = rt5645_i2c_probe,
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index abc802a5a479..65ac4518ad06 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5035,6 +5035,12 @@ static const struct i2c_device_id rt5677_i2c_id[] = {
5035}; 5035};
5036MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); 5036MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id);
5037 5037
5038static const struct of_device_id rt5677_of_match[] = {
5039 { .compatible = "realtek,rt5677", },
5040 { }
5041};
5042MODULE_DEVICE_TABLE(of, rt5677_of_match);
5043
5038static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; 5044static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false };
5039static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; 5045static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false };
5040static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; 5046static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false };
@@ -5294,6 +5300,7 @@ static int rt5677_i2c_remove(struct i2c_client *i2c)
5294static struct i2c_driver rt5677_i2c_driver = { 5300static struct i2c_driver rt5677_i2c_driver = {
5295 .driver = { 5301 .driver = {
5296 .name = "rt5677", 5302 .name = "rt5677",
5303 .of_match_table = rt5677_of_match,
5297 }, 5304 },
5298 .probe = rt5677_i2c_probe, 5305 .probe = rt5677_i2c_probe,
5299 .remove = rt5677_i2c_remove, 5306 .remove = rt5677_i2c_remove,
diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c b/sound/soc/rockchip/rk3288_hdmi_analog.c
index b60abf322ce1..dbc53e48c52c 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -93,6 +93,9 @@ static int rk_hw_params(struct snd_pcm_substream *substream,
93 case 96000: 93 case 96000:
94 mclk = 12288000; 94 mclk = 12288000;
95 break; 95 break;
96 case 192000:
97 mclk = 24576000;
98 break;
96 case 11025: 99 case 11025:
97 case 22050: 100 case 22050:
98 case 44100: 101 case 44100: