ASoC: cs4265: Fix part number ID error message
Subsystems (3)
PATCH RESEND 2/2 ASoC: cs4265: Move reset_gpio to local scope
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
There is no need to keep 'struct gpio_desc *reset_gpio' inside the private structure becase reset_gpio is only used inside the probe() function.
Move it to a local scope.
--- sound/soc/codecs/cs4265.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/codecs/cs4265.c +7 -7
@@ -29,7 +29,6 @@struct cs4265_private {struct regmap *regmap; -struct gpio_desc *reset_gpio;u8 format;u32 sysclk; };
@@ -573,6 +572,7 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, const struct i2c_device_id *id) {struct cs4265_private *cs4265; +struct gpio_desc *reset_gpio;int ret;unsigned int devid =0 ;unsigned int reg;
@@ -589,14 +589,14 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client,return ret; } - cs4265->reset_gpio =devm_gpiod_get_optional (&i2c_client->dev, -"reset" ,GPIOD_OUT_LOW ); -if (IS_ERR (cs4265->reset_gpio)) -return PTR_ERR (cs4265->reset_gpio); + reset_gpio =devm_gpiod_get_optional (&i2c_client->dev,"reset" , +GPIOD_OUT_LOW ); +if (IS_ERR (reset_gpio)) +return PTR_ERR (reset_gpio); -if (cs4265->reset_gpio) { +if (reset_gpio) {mdelay (1 ); -gpiod_set_value_cansleep (cs4265->reset_gpio,1 ); +gpiod_set_value_cansleep (reset_gpio,1 ); }i2c_set_clientdata (i2c_client, cs4265);
Signature · 1 line
2.25.1
PATCH RESEND 1/2 ASoC: cs4265: Fix part number ID error message
From: Fabio Estevam <[email protected]>
The Chip ID - Register 01h contains the following description as per the CS4265 datasheet:
"Bits 7 through 4 are the part number ID, which is 1101b (0Dh)"
The current error message is incorrect as it prints CS4265_CHIP_ID, which is the register number, instead of printing the expected part number ID value.
To make it clearer, also do a shift by 4, so that the error message would become:
[ 4.218083] cs4265 1-004f: CS4265 Part Number ID: 0x0 Expected: 0xd
---
Sorry, I am resending because I was not subscribed in the alsa-list from the other e-mail account.
sound/soc/codecs/cs4265.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4265.c +2 -2
@@ -611,8 +611,8 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client,if (devid !=CS4265_CHIP_ID_VAL ) { ret = -ENODEV ;dev_err (&i2c_client->dev, -"CS4265 Device ID (%X). Expected %X\n" , - devid,CS4265_CHIP_ID ); +"CS4265 Part Number ID: 0x%x Expected: 0x%x\n" , + devid >>4 ,CS4265_CHIP_ID_VAL >>4 );return ret; } dev_info(&i2c_client->dev,
Signature · 1 line
2.25.1
Quoted 11 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
The Chip ID - Register 01h contains the following description as per the CS4265 datasheet:
"Bits 7 through 4 are the part number ID, which is 1101b (0Dh)"
The current error message is incorrect as it prints
CS4265_CHIP_ID, which is the register number, instead of printing the expected part number ID value.
Quoted 7 lines
To make it clearer, also do a shift by 4, so that the error message would become:
[ 4.218083] cs4265 1-004f: CS4265 Part Number ID: 0x0 Expected: 0xdSigned-off-by Fabio Estevam <[email protected]>---
Thanks,
Charles
Re: [PATCH RESEND 2/2] ASoC: cs4265: Move reset_gpio to local scope
In reply to Fabio EstevamQuoted 10 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
There is no need to keep 'struct
gpio_desc*reset_gpio' inside the private structure becasereset_gpiois only used inside theprobe()function.Move it to a local scope.
Signed-off-by Fabio Estevam <[email protected]>---
Patch looks fine, but I do have a slight doubt would it perhaps be better to add a remove function that puts the device back into reset, thus keeping the private member? Feels like it might be a nicer state to leave the chip in if the driver unbinds.
Thanks,
Charles
Mark Brown
maintainerRe: (subset) [PATCH RESEND 1/2] ASoC: cs4265: Fix part number ID error message
In reply to Fabio EstevamQuoted 8 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
The Chip ID - Register 01h contains the following description as per the CS4265 datasheet:
"Bits 7 through 4 are the part number ID, which is 1101b (0Dh)"
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: cs4265: Fix part number ID error message
commit: 8f85317292f1d99e8a70a400a46ee697d64e3326
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