ASoC: cs4349: Set .writeable_reg for cs4349_regmap
Subsystems (3)
PATCH 1/2 ASoC: cs4349: Set .writeable_reg for cs4349_regmap
The first valid register index is 1 rather than 0, and the CS4349_CHIPID is readonly. So set .writeable_reg to avoid writing to these registers.
--- sound/soc/codecs/cs4349.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
sound/soc/codecs/cs4349.c +12 -8
@@ -54,14 +54,17 @@ struct cs4349_private {static bool cs4349_readable_register (struct device *dev,unsigned int reg) {switch (reg) { -case CS4349_CHIPID : -case CS4349_MODE : -case CS4349_VMI : -case CS4349_MUTE : -case CS4349_VOLA : -case CS4349_VOLB : -case CS4349_RMPFLT : -case CS4349_MISC : + case CS4349_CHIPID ... CS4349_MISC: +return true; +default : +return false; + } +} + +static bool cs4349_writeable_register (struct device *dev,unsigned int reg) +{ +switch (reg) { + case CS4349_MODE ... CS4349_MISC:return true;default :return false;
@@ -272,6 +275,7 @@ static const struct regmap_config cs4349_regmap = { .reg_defaults = cs4349_reg_defaults, .num_reg_defaults = ARRAY_SIZE(cs4349_reg_defaults), .readable_reg = cs4349_readable_register, + .writeable_reg = cs4349_writeable_register, .cache_type = REGCACHE_RBTREE, };
Signature · 1 line
2.1.0
PATCH 2/2 ASoC: cs4349: Drop platform data support
The struct cs4349_platform_data should be defined in a public header in include/sound/ rather than in sound/soc/codecs folder.
In additional, the platform data support is not properly handled in this driver so remove it now.
--- sound/soc/codecs/cs4349.c | 7 +------ sound/soc/codecs/cs4349.h | 7 ------- 2 files changed, 1 insertion(+), 13 deletions(-)
sound/soc/codecs/cs4349.c +1 -6
@@ -45,7 +45,6 @@ static const struct reg_default cs4349_reg_defaults[] = {/* Private data for the CS4349 */ struct cs4349_private {struct regmap *regmap; -struct cs4349_platform_data pdata;struct gpio_desc *reset_gpio;unsigned int mode;int rate;
@@ -283,8 +282,7 @@ static int cs4349_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) {struct cs4349_private *cs4349; -struct cs4349_platform_data *pdata =dev_get_platdata (&client->dev); -int ret =0 ; +int ret; cs4349 =devm_kzalloc (&client->dev,sizeof (*cs4349),GFP_KERNEL );if (!cs4349)
@@ -297,9 +295,6 @@ static int cs4349_i2c_probe(struct i2c_client *client,return ret; } -if (pdata) - cs4349->pdata = *pdata; -/* Reset the Device */ cs4349->reset_gpio =devm_gpiod_get_optional (&client->dev,"reset" ,GPIOD_OUT_LOW );
sound/soc/codecs/cs4349.h +0 -7
@@ -19,13 +19,6 @@#ifndef __CS4349_H__#define __CS4349_H__ -struct cs4349_platform_data { - -/* GPIO for Reset */ -unsigned int gpio_nreset; - -}; -/* CS4349 registers addresses */ #define CS4349_CHIPID 0x01/* Device and Rev ID, Read Only */ #define CS4349_MODE 0x02/* Mode Control */
Signature · 1 line
2.1.0
Mark Brown
maintainerApplied "ASoC: cs4349: Drop platform data support" to the asoc tree
The patch
ASoC: cs4349: Drop platform data support
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
44251551dfca2117e42349136b871b33c8419a59Mon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Sun, 19 Jul 2015 09:15:38 +0800
Subject: [PATCH] ASoC: cs4349: Drop platform data support
The struct cs4349_platform_data should be defined in a public header in include/sound/ rather than in sound/soc/codecs folder.
In additional, the platform data support is not properly handled in this driver so remove it now.
--- sound/soc/codecs/cs4349.c | 7 +------ sound/soc/codecs/cs4349.h | 7 ------- 2 files changed, 1 insertion(+), 13 deletions(-)
sound/soc/codecs/cs4349.c +1 -6
@@ -45,7 +45,6 @@ static const struct reg_default cs4349_reg_defaults[] = {/* Private data for the CS4349 */ struct cs4349_private {struct regmap *regmap; -struct cs4349_platform_data pdata;struct gpio_desc *reset_gpio;unsigned int mode;int rate;
@@ -281,8 +280,7 @@ static int cs4349_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) {struct cs4349_private *cs4349; -struct cs4349_platform_data *pdata =dev_get_platdata (&client->dev); -int ret =0 ; +int ret; cs4349 =devm_kzalloc (&client->dev,sizeof (*cs4349),GFP_KERNEL );if (!cs4349)
@@ -295,9 +293,6 @@ static int cs4349_i2c_probe(struct i2c_client *client,return ret; } -if (pdata) - cs4349->pdata = *pdata; -/* Reset the Device */ cs4349->reset_gpio =devm_gpiod_get_optional (&client->dev,"reset" ,GPIOD_OUT_LOW );
sound/soc/codecs/cs4349.h +0 -7
@@ -19,13 +19,6 @@#ifndef __CS4349_H__#define __CS4349_H__ -struct cs4349_platform_data { - -/* GPIO for Reset */ -unsigned int gpio_nreset; - -}; -/* CS4349 registers addresses */ #define CS4349_CHIPID 0x01/* Device and Rev ID, Read Only */ #define CS4349_MODE 0x02/* Mode Control */
Signature · 1 line
2.1.4
Mark Brown
maintainerApplied "ASoC: cs4349: Set .writeable_reg for cs4349_regmap" to the asoc tree
In reply to Axel LinThe patch
ASoC: cs4349: Set .writeable_reg for cs4349_regmap
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
0443de7e7e559eab7df2566d0e46940f753db51dMon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Sun, 19 Jul 2015 09:14:23 +0800
Subject: [PATCH] ASoC: cs4349: Set .writeable_reg for cs4349_regmap
The first valid register index is 1 rather than 0, and the CS4349_CHIPID is readonly. So set .writeable_reg to avoid writing to these registers.
--- sound/soc/codecs/cs4349.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
sound/soc/codecs/cs4349.c +12 -8
@@ -54,14 +54,17 @@ struct cs4349_private {static bool cs4349_readable_register (struct device *dev,unsigned int reg) {switch (reg) { -case CS4349_CHIPID : -case CS4349_MODE : -case CS4349_VMI : -case CS4349_MUTE : -case CS4349_VOLA : -case CS4349_VOLB : -case CS4349_RMPFLT : -case CS4349_MISC : + case CS4349_CHIPID ... CS4349_MISC: +return true; +default : +return false; + } +} + +static bool cs4349_writeable_register (struct device *dev,unsigned int reg) +{ +switch (reg) { + case CS4349_MODE ... CS4349_MISC:return true;default :return false;
@@ -270,6 +273,7 @@ static const struct regmap_config cs4349_regmap = { .reg_defaults = cs4349_reg_defaults, .num_reg_defaults = ARRAY_SIZE(cs4349_reg_defaults), .readable_reg = cs4349_readable_register, + .writeable_reg = cs4349_writeable_register, .cache_type = REGCACHE_RBTREE, };
Signature · 1 line
2.1.4
Quoted 8 lines · Axel Lin
The first valid register index is 1 rather than 0, and the
CS4349_CHIPIDis readonly. So set .writeable_reg to avoid writing to these registers.Signed-off-by Axel Lin <[email protected]>--- sound/soc/codecs/cs4349.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
For both patches
Thank you!