From e3efe3bedb6592465d9a2bd116d5e611dae362c3 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 31 Mar 2014 12:25:24 -0600 Subject: ASoC: alc5632: fix uninit var in alc5632_probe() alc5632_probe() returns ret, yet it is not initialized or set anywhere. This ends up causing the function to appear to fail, and audio not to work on the Toshiba AC100, with my compiler at least. This function used to set ret in all cases, but recent cleanup removed that. Fixes: 5d6be5aa6bec ("ASoC: codec: Simplify ASoC probe code.") Signed-off-by: Stephen Warren Reviewed-by: Thierry Reding Signed-off-by: Mark Brown --- sound/soc/codecs/alc5632.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index ec071a6306e..3ee8d4e41a9 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c @@ -1061,7 +1061,6 @@ static int alc5632_resume(struct snd_soc_codec *codec) static int alc5632_probe(struct snd_soc_codec *codec) { struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); - int ret; /* power on device */ alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); @@ -1075,7 +1074,7 @@ static int alc5632_probe(struct snd_soc_codec *codec) return -EINVAL; } - return ret; + return 0; } /* power down chip */ -- cgit v1.2.3-70-g09d2 From c31b0cb1f1a19bc551875e07e9dd7c531ac3580e Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 31 Mar 2014 12:38:16 -0600 Subject: ASoC: alc5632: add an of_match table Add a device tree match table. This serves to make the driver's support of device tree more explicit. Perhaps the fallback for DT matching to using the i2c_device_id table will go away one day, since it fails in face of devices from different vendors with the same name. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/codecs/alc5632.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index 3ee8d4e41a9..85942ca36cb 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c @@ -1190,11 +1190,18 @@ static const struct i2c_device_id alc5632_i2c_table[] = { }; MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); +static const struct of_device_id alc5632_of_match[] = { + { .compatible = "realtek,alc5632", }, + { } +}; +MODULE_DEVICE_TABLE(of, alc5632_of_match); + /* i2c codec control layer */ static struct i2c_driver alc5632_i2c_driver = { .driver = { .name = "alc5632", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(alc5632_of_match), }, .probe = alc5632_i2c_probe, .remove = alc5632_i2c_remove, -- cgit v1.2.3-70-g09d2 From 2951f93f431a2fc8956a3b13882dc07cb5b8b2b9 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 31 Mar 2014 12:38:18 -0600 Subject: ASoC: max98090: add an of_match table Add a device tree match table. This serves to make the driver's support of device tree more explicit. Perhaps the fallback for DT matching to using the i2c_device_id table will go away one day, since it fails in face of devices from different vendors with the same name. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/codecs/max98090.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 361862d4fa6..83a773c11dd 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2406,11 +2406,18 @@ static const struct i2c_device_id max98090_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); +static const struct of_device_id max98090_of_match[] = { + { .compatible = "maxim,max98090", }, + { } +}; +MODULE_DEVICE_TABLE(of, max98090_of_match); + static struct i2c_driver max98090_i2c_driver = { .driver = { .name = "max98090", .owner = THIS_MODULE, .pm = &max98090_pm, + .of_match_table = of_match_ptr(max98090_of_match), }, .probe = max98090_i2c_probe, .remove = max98090_i2c_remove, -- cgit v1.2.3-70-g09d2 From 06b4b813058f6092ded5d7e0d92d4c34d92975bd Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 4 Apr 2014 11:04:35 +0800 Subject: ASoC: cs42xx8: Check return value of regmap_read and report correct chipid value Fix checking return value of regmap_read(). Also fix reporting the chip_id value. CS42XX8_CHIPID_CHIP_ID_MASK is 0xF0, so the chip_id value is (val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4). Signed-off-by: Axel Lin Acked-by: Paul Handrigan Acked-by: Brian Austin Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/codecs/cs42xx8.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index 082299a4e2f..85020322eee 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c @@ -495,17 +495,16 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap) regcache_cache_bypass(cs42xx8->regmap, true); /* Validate the chip ID */ - regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); - if (val < 0) { - dev_err(dev, "failed to get device ID: %x", val); - ret = -EINVAL; + ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); + if (ret < 0) { + dev_err(dev, "failed to get device ID, ret = %d", ret); goto err_enable; } /* The top four bits of the chip ID should be 0000 */ - if ((val & CS42XX8_CHIPID_CHIP_ID_MASK) != 0x00) { + if (((val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4) != 0x00) { dev_err(dev, "unmatched chip ID: %d\n", - val & CS42XX8_CHIPID_CHIP_ID_MASK); + (val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4); ret = -EINVAL; goto err_enable; } -- cgit v1.2.3-70-g09d2 From a14bf88749c5b54bb9c636bcd47c26ea79560ce5 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 6 Apr 2014 00:04:35 +0800 Subject: ASoC: cs42l52: Fix mask for REVID BIT[0:2] of register 01h is REVID, so the mask for REVID should be 0x7. Also updates the code to use CS42L52_CHIP_REV_MASK. Signed-off-by: Axel Lin Acked-by: Brian Austin Signed-off-by: Mark Brown --- sound/soc/codecs/cs42l52.c | 2 +- sound/soc/codecs/cs42l52.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index f0ca6bee677..460d35547a6 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -1259,7 +1259,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client, } dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n", - reg & 0xFF); + reg & CS42L52_CHIP_REV_MASK); /* Set Platform Data */ if (cs42l52->pdata.mica_diff_cfg) diff --git a/sound/soc/codecs/cs42l52.h b/sound/soc/codecs/cs42l52.h index 6fb8f00f419..ac445993e6b 100644 --- a/sound/soc/codecs/cs42l52.h +++ b/sound/soc/codecs/cs42l52.h @@ -37,7 +37,7 @@ #define CS42L52_CHIP_REV_A0 0x00 #define CS42L52_CHIP_REV_A1 0x01 #define CS42L52_CHIP_REV_B0 0x02 -#define CS42L52_CHIP_REV_MASK 0x03 +#define CS42L52_CHIP_REV_MASK 0x07 #define CS42L52_PWRCTL1 0x02 #define CS42L52_PWRCTL1_PDN_ALL 0x9F -- cgit v1.2.3-70-g09d2 From 05b0006734f2aa728331bfe169f105c4b386858a Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 3 Apr 2014 19:56:32 +0800 Subject: ASoC: da732x: Print correct major id DA732X_ID_MAJOR_MASK is 0xF0, so the major id is (reg & DA732X_ID_MAJOR_MASK) >> 4. Signed-off-by: Axel Lin Acked-by: Adam Thomson Signed-off-by: Mark Brown --- sound/soc/codecs/da732x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/soc/codecs') diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index 7d168ec71cd..48f3fef6848 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c @@ -1571,7 +1571,8 @@ static int da732x_i2c_probe(struct i2c_client *i2c, } dev_info(&i2c->dev, "Revision: %d.%d\n", - (reg & DA732X_ID_MAJOR_MASK), (reg & DA732X_ID_MINOR_MASK)); + (reg & DA732X_ID_MAJOR_MASK) >> 4, + (reg & DA732X_ID_MINOR_MASK)); ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da732x, da732x_dai, ARRAY_SIZE(da732x_dai)); -- cgit v1.2.3-70-g09d2