From bd1204cb51f15d202f95222e873a94ed5d07b784 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 27 Apr 2015 22:13:24 +0200 Subject: ASoC: Route all bias level updates through the core Use the new snd_soc_codec_force_bias_level() helper function to invoke the bias_level callback of a driver instead of calling the callback by hand. Currently the effect of this is the same, but having all bias level updates go through a central place will allow us to move more of the bias level management into the DAPM core. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 69528ae..b1e681a 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2520,7 +2520,7 @@ static int rt5645_probe(struct snd_soc_codec *codec) break; } - rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF); + snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200); -- cgit v1.1 From f4bf8d770b58862c2af9d17adc2fee05bef8f2c0 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 27 Apr 2015 22:13:25 +0200 Subject: ASoC: Move bias level update to the core All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index b1e681a..ea58367 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2409,7 +2409,6 @@ static int rt5645_set_bias_level(struct snd_soc_codec *codec, default: break; } - codec->dapm.bias_level = level; return 0; } -- cgit v1.1 From a3bd92519879ddc3052140e6776173f266c934eb Mon Sep 17 00:00:00 2001 From: "Fang, Yang A" Date: Thu, 23 Apr 2015 16:35:17 -0700 Subject: ASoC: rt5645: Add ACPI match ID This patch adds the ACPI match ID for rt5645/5650 codec Signed-off-by: Fang, Yang A Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 69528ae..61ca49f 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -2656,6 +2657,15 @@ static const struct i2c_device_id rt5645_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id); +#ifdef CONFIG_ACPI +static struct acpi_device_id rt5645_acpi_match[] = { + { "10EC5645", 0 }, + { "10EC5650", 0 }, + {}, +}; +MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match); +#endif + static int rt5645_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -2872,6 +2882,7 @@ static struct i2c_driver rt5645_i2c_driver = { .driver = { .name = "rt5645", .owner = THIS_MODULE, + .acpi_match_table = ACPI_PTR(rt5645_acpi_match), }, .probe = rt5645_i2c_probe, .remove = rt5645_i2c_remove, -- cgit v1.1 From 5023281b1870fdc99bddf95a7bc00b801801d13e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 21 Apr 2015 12:19:49 +0800 Subject: ASoC: rt5645: Fix mask for setting RT5645_DMIC_2_DP_GPIO12 bit Current code uses wrong mask when setting RT5645_DMIC_2_DP_GPIO12 bit, fix it. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 61ca49f..be4d741 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2780,7 +2780,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, case RT5645_DMIC_DATA_GPIO12: regmap_update_bits(rt5645->regmap, RT5645_DMIC_CTRL1, - RT5645_DMIC_1_DP_MASK, RT5645_DMIC_2_DP_GPIO12); + RT5645_DMIC_2_DP_MASK, RT5645_DMIC_2_DP_GPIO12); regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1, RT5645_GP12_PIN_MASK, RT5645_GP12_PIN_DMIC2_SDA); -- cgit v1.1 From 692768c4b28ddfc96f5ff752048826b859bd71ca Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Thu, 14 May 2015 08:43:31 +0800 Subject: ASoC: rt5645: Rename HP control to Headphone Use the standard name "Headphone" instead of "HP" for better userspace integration. Signed-off-by: Nicolas Boichat Acked-by: Bard Liao Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index be4d741..bc925f0 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -464,9 +464,9 @@ static const struct snd_kcontrol_new rt5645_snd_controls[] = { RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, out_vol_tlv), /* Headphone Output Volume */ - SOC_DOUBLE("HP Channel Switch", RT5645_HP_VOL, + SOC_DOUBLE("Headphone Channel Switch", RT5645_HP_VOL, RT5645_VOL_L_SFT, RT5645_VOL_R_SFT, 1, 1), - SOC_DOUBLE_TLV("HP Playback Volume", RT5645_HP_VOL, + SOC_DOUBLE_TLV("Headphone Playback Volume", RT5645_HP_VOL, RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, out_vol_tlv), /* OUTPUT Control */ -- cgit v1.1 From 7ea3470a7277380248135a592a849e1c27960b2f Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 5 Jun 2015 18:42:12 +0800 Subject: ASoC: rt5645: Init jack_detect_work before registering irq Prevents frequent panic on boot, if the irq handler rt5645_irq gets called before the workqueue rt5645_jack_detect_work is initialized. Signed-off-by: Nicolas Boichat Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/rt5645.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc/codecs/rt5645.c') diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index bc925f0..c823014 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2837,6 +2837,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, } } + INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work); + if (rt5645->i2c->irq) { ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING @@ -2855,8 +2857,6 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, dev_err(&i2c->dev, "Fail gpio_direction hp_det_gpio\n"); } - INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work); - return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5645, rt5645_dai, ARRAY_SIZE(rt5645_dai)); } -- cgit v1.1