2023-08-31 22:42:40

by Biju Das

[permalink] [raw]
Subject: [PATCH v3 0/3] Match data improvements for tlv320aic32x4 driver

This patch series aims to add match data improvements for tlv320aic32x4
driver.

This patch series is only compile tested.

v2->v3:
* Added Rb tag from Andy for patch#1 and patch#2
* Simplified aic32x4_spi_probe() in patch#3.
v1->v2:
* Created patch#1 for adding enum aic32x4_type to aic32x4_probe() and
drop using dev_set_drvdata() from tlv320aic32x4_{i2c,spi} drivers.
* Return value of i2c_get_match_data() passed to type paramemter in
aic32x4_probe().

Biju Das (3):
ASoC: codec: tlv320aic32x4: Add enum aic32x4_type to aic32x4_probe()
ASoC: tlv320aic32x4-i2c: Simplify probe()
ASoC: tlv320aic32x4-spi: Simplify probe()

sound/soc/codecs/tlv320aic32x4-i2c.c | 19 +++----------------
sound/soc/codecs/tlv320aic32x4-spi.c | 18 +++---------------
sound/soc/codecs/tlv320aic32x4.c | 5 +++--
sound/soc/codecs/tlv320aic32x4.h | 3 ++-
4 files changed, 11 insertions(+), 34 deletions(-)

--
2.25.1



2023-09-01 21:01:17

by Biju Das

[permalink] [raw]
Subject: [PATCH v3 2/3] ASoC: tlv320aic32x4-i2c: Simplify probe()

Simplify probe() by replacing of_match_node() and i2c_match_id() with
i2c_get_match_data().

Signed-off-by: Biju Das <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
v2->v3:
* Added Rb tag from Andy.
v1->v2:
* Return value of i2c_get_match_data() passed to type paramemter in
aic32x4_probe().
---
sound/soc/codecs/tlv320aic32x4-i2c.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4-i2c.c b/sound/soc/codecs/tlv320aic32x4-i2c.c
index 713f3f63b5e3..b27b5ae1e4b2 100644
--- a/sound/soc/codecs/tlv320aic32x4-i2c.c
+++ b/sound/soc/codecs/tlv320aic32x4-i2c.c
@@ -16,9 +16,6 @@

#include "tlv320aic32x4.h"

-static const struct of_device_id aic32x4_of_id[];
-static const struct i2c_device_id aic32x4_i2c_id[];
-
static int aic32x4_i2c_probe(struct i2c_client *i2c)
{
struct regmap *regmap;
@@ -30,18 +27,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c)
config.val_bits = 8;

regmap = devm_regmap_init_i2c(i2c, &config);
-
- if (i2c->dev.of_node) {
- const struct of_device_id *oid;
-
- oid = of_match_node(aic32x4_of_id, i2c->dev.of_node);
- type = (uintptr_t)oid->data;
- } else {
- const struct i2c_device_id *id;
-
- id = i2c_match_id(aic32x4_i2c_id, i2c);
- type = id->driver_data;
- }
+ type = (uintptr_t)i2c_get_match_data(i2c);

return aic32x4_probe(&i2c->dev, regmap, type);
}
--
2.25.1


2023-09-04 05:31:54

by Biju Das

[permalink] [raw]
Subject: [PATCH v3 3/3] ASoC: tlv320aic32x4-spi: Simplify probe()

Simplify probe() by replacing of_match_node() and spi_get_device_id() with
spi_get_device_match_data().

Signed-off-by: Biju Das <[email protected]>
---
v3:
* New patch
---
sound/soc/codecs/tlv320aic32x4-spi.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic32x4-spi.c b/sound/soc/codecs/tlv320aic32x4-spi.c
index 81c05030dd3b..d5976c91766e 100644
--- a/sound/soc/codecs/tlv320aic32x4-spi.c
+++ b/sound/soc/codecs/tlv320aic32x4-spi.c
@@ -16,8 +16,6 @@

#include "tlv320aic32x4.h"

-static const struct of_device_id aic32x4_of_id[];
-
static int aic32x4_spi_probe(struct spi_device *spi)
{
struct regmap *regmap;
@@ -31,18 +29,7 @@ static int aic32x4_spi_probe(struct spi_device *spi)
config.read_flag_mask = 0x01;

regmap = devm_regmap_init_spi(spi, &config);
-
- if (spi->dev.of_node) {
- const struct of_device_id *oid;
-
- oid = of_match_node(aic32x4_of_id, spi->dev.of_node);
- type = (uintptr_t)oid->data;
- } else {
- const struct spi_device_id *id_entry;
-
- id_entry = spi_get_device_id(spi);
- type = id_entry->driver_data;
- }
+ type = (uintptr_t)spi_get_device_match_data(spi);

return aic32x4_probe(&spi->dev, regmap, type);
}
--
2.25.1

2023-09-12 02:38:48

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] Match data improvements for tlv320aic32x4 driver

On Thu, 31 Aug 2023 20:46:19 +0100, Biju Das wrote:
> This patch series aims to add match data improvements for tlv320aic32x4
> driver.
>
> This patch series is only compile tested.
>
> v2->v3:
> * Added Rb tag from Andy for patch#1 and patch#2
> * Simplified aic32x4_spi_probe() in patch#3.
> v1->v2:
> * Created patch#1 for adding enum aic32x4_type to aic32x4_probe() and
> drop using dev_set_drvdata() from tlv320aic32x4_{i2c,spi} drivers.
> * Return value of i2c_get_match_data() passed to type paramemter in
> aic32x4_probe().
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: codec: tlv320aic32x4: Add enum aic32x4_type to aic32x4_probe()
commit: cac1636e214930b01b2f8ac9867771486554271a
[2/3] ASoC: tlv320aic32x4-i2c: Simplify probe()
commit: d44f7bc9d181a2bec0dcff694d00b08c8f99284d
[3/3] ASoC: tlv320aic32x4-spi: Simplify probe()
commit: c6d86149db94c0289b0e5950fa23c5b19031ab8d

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