mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
@ 2022-03-25 16:54 Stephen Kitt
  2022-03-28  7:48 ` Sa, Nuno
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Kitt @ 2022-03-25 16:54 UTC (permalink / raw)
  To: Lars-Peter Clausen, Nuno Sá, Liam Girdwood, Mark Brown
  Cc: Wolfram Sang, linux-kernel, Stephen Kitt

As part of the ongoing i2c transition to the simple probe
("probe_new"), this patch uses i2c_match_id to retrieve the
driver_data for the probed device. The id parameter is thus no longer
necessary and the simple probe can be used instead.

Signed-off-by: Stephen Kitt <steve@sk2.org>
---
 sound/soc/codecs/ad193x-i2c.c   | 6 +++---
 sound/soc/codecs/adau1761-i2c.c | 8 +++++---
 sound/soc/codecs/adau1781-i2c.c | 8 +++++---
 sound/soc/codecs/adau1977-i2c.c | 8 +++++---
 sound/soc/codecs/ssm2602-i2c.c  | 8 +++++---
 5 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/ad193x-i2c.c b/sound/soc/codecs/ad193x-i2c.c
index 3d509a65e4ca..4cb8d87f9011 100644
--- a/sound/soc/codecs/ad193x-i2c.c
+++ b/sound/soc/codecs/ad193x-i2c.c
@@ -20,10 +20,10 @@ static const struct i2c_device_id ad193x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ad193x_id);
 
-static int ad193x_i2c_probe(struct i2c_client *client,
-			    const struct i2c_device_id *id)
+static int ad193x_i2c_probe(struct i2c_client *client)
 {
 	struct regmap_config config;
+	const struct i2c_device_id *id = i2c_match_id(ad193x_id, client);
 
 	config = ad193x_regmap_config;
 	config.val_bits = 8;
@@ -38,7 +38,7 @@ static struct i2c_driver ad193x_i2c_driver = {
 	.driver = {
 		.name = "ad193x",
 	},
-	.probe    = ad193x_i2c_probe,
+	.probe_new = ad193x_i2c_probe,
 	.id_table = ad193x_id,
 };
 module_i2c_driver(ad193x_i2c_driver);
diff --git a/sound/soc/codecs/adau1761-i2c.c b/sound/soc/codecs/adau1761-i2c.c
index c8fce37e5cfa..0683caf86aea 100644
--- a/sound/soc/codecs/adau1761-i2c.c
+++ b/sound/soc/codecs/adau1761-i2c.c
@@ -14,10 +14,12 @@
 
 #include "adau1761.h"
 
-static int adau1761_i2c_probe(struct i2c_client *client,
-	const struct i2c_device_id *id)
+static const struct i2c_device_id adau1761_i2c_ids[];
+
+static int adau1761_i2c_probe(struct i2c_client *client)
 {
 	struct regmap_config config;
+	const struct i2c_device_id *id = i2c_match_id(adau1761_i2c_ids, client);
 
 	config = adau1761_regmap_config;
 	config.val_bits = 8;
@@ -59,7 +61,7 @@ static struct i2c_driver adau1761_i2c_driver = {
 		.name = "adau1761",
 		.of_match_table = of_match_ptr(adau1761_i2c_dt_ids),
 	},
-	.probe = adau1761_i2c_probe,
+	.probe_new = adau1761_i2c_probe,
 	.remove = adau1761_i2c_remove,
 	.id_table = adau1761_i2c_ids,
 };
diff --git a/sound/soc/codecs/adau1781-i2c.c b/sound/soc/codecs/adau1781-i2c.c
index 1c476429ad99..e046de0ebcc7 100644
--- a/sound/soc/codecs/adau1781-i2c.c
+++ b/sound/soc/codecs/adau1781-i2c.c
@@ -14,10 +14,12 @@
 
 #include "adau1781.h"
 
-static int adau1781_i2c_probe(struct i2c_client *client,
-	const struct i2c_device_id *id)
+static const struct i2c_device_id adau1781_i2c_ids[];
+
+static int adau1781_i2c_probe(struct i2c_client *client)
 {
 	struct regmap_config config;
+	const struct i2c_device_id *id = i2c_match_id(adau1781_i2c_ids, client);
 
 	config = adau1781_regmap_config;
 	config.val_bits = 8;
@@ -55,7 +57,7 @@ static struct i2c_driver adau1781_i2c_driver = {
 		.name = "adau1781",
 		.of_match_table = of_match_ptr(adau1781_i2c_dt_ids),
 	},
-	.probe = adau1781_i2c_probe,
+	.probe_new = adau1781_i2c_probe,
 	.remove = adau1781_i2c_remove,
 	.id_table = adau1781_i2c_ids,
 };
diff --git a/sound/soc/codecs/adau1977-i2c.c b/sound/soc/codecs/adau1977-i2c.c
index 82a49c85d536..9f137a0634d5 100644
--- a/sound/soc/codecs/adau1977-i2c.c
+++ b/sound/soc/codecs/adau1977-i2c.c
@@ -14,10 +14,12 @@
 
 #include "adau1977.h"
 
-static int adau1977_i2c_probe(struct i2c_client *client,
-	const struct i2c_device_id *id)
+static const struct i2c_device_id adau1977_i2c_ids[];
+
+static int adau1977_i2c_probe(struct i2c_client *client)
 {
 	struct regmap_config config;
+	const struct i2c_device_id *id = i2c_match_id(adau1977_i2c_ids, client);
 
 	config = adau1977_regmap_config;
 	config.val_bits = 8;
@@ -40,7 +42,7 @@ static struct i2c_driver adau1977_i2c_driver = {
 	.driver = {
 		.name = "adau1977",
 	},
-	.probe = adau1977_i2c_probe,
+	.probe_new = adau1977_i2c_probe,
 	.id_table = adau1977_i2c_ids,
 };
 module_i2c_driver(adau1977_i2c_driver);
diff --git a/sound/soc/codecs/ssm2602-i2c.c b/sound/soc/codecs/ssm2602-i2c.c
index afab81383d3a..3c85772901f5 100644
--- a/sound/soc/codecs/ssm2602-i2c.c
+++ b/sound/soc/codecs/ssm2602-i2c.c
@@ -13,15 +13,17 @@
 
 #include "ssm2602.h"
 
+static const struct i2c_device_id ssm2602_i2c_id[];
+
 /*
  * ssm2602 2 wire address is determined by GPIO5
  * state during powerup.
  *    low  = 0x1a
  *    high = 0x1b
  */
-static int ssm2602_i2c_probe(struct i2c_client *client,
-			     const struct i2c_device_id *id)
+static int ssm2602_i2c_probe(struct i2c_client *client)
 {
+	const struct i2c_device_id *id = i2c_match_id(ssm2602_i2c_id, client);
 	return ssm2602_probe(&client->dev, id->driver_data,
 		devm_regmap_init_i2c(client, &ssm2602_regmap_config));
 }
@@ -47,7 +49,7 @@ static struct i2c_driver ssm2602_i2c_driver = {
 		.name = "ssm2602",
 		.of_match_table = ssm2602_of_match,
 	},
-	.probe = ssm2602_i2c_probe,
+	.probe_new = ssm2602_i2c_probe,
 	.id_table = ssm2602_i2c_id,
 };
 module_i2c_driver(ssm2602_i2c_driver);
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
  2022-03-25 16:54 [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe Stephen Kitt
@ 2022-03-28  7:48 ` Sa, Nuno
  2022-03-30  9:38 ` Wolfram Sang
  2022-04-05  9:31 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Sa, Nuno @ 2022-03-28  7:48 UTC (permalink / raw)
  To: Stephen Kitt, Lars-Peter Clausen, Liam Girdwood, Mark Brown
  Cc: Wolfram Sang, linux-kernel

> From: Stephen Kitt <steve@sk2.org>
> Sent: Friday, March 25, 2022 5:55 PM
> To: Lars-Peter Clausen <lars@metafoo.de>; Sa, Nuno
> <Nuno.Sa@analog.com>; Liam Girdwood <lgirdwood@gmail.com>;
> Mark Brown <broonie@kernel.org>
> Cc: Wolfram Sang <wsa@kernel.org>; linux-kernel@vger.kernel.org;
> Stephen Kitt <steve@sk2.org>
> Subject: [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and
> simple i2c probe
> 
> [External]
> 
> As part of the ongoing i2c transition to the simple probe
> ("probe_new"), this patch uses i2c_match_id to retrieve the
> driver_data for the probed device. The id parameter is thus no longer
> necessary and the simple probe can be used instead.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>
> ---

Reviewed-by: Nuno Sá <nuno.sa@analog.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
  2022-03-25 16:54 [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe Stephen Kitt
  2022-03-28  7:48 ` Sa, Nuno
@ 2022-03-30  9:38 ` Wolfram Sang
  2022-04-05  9:31 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2022-03-30  9:38 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Lars-Peter Clausen, Nuno Sá,
	Liam Girdwood, Mark Brown, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

On Fri, Mar 25, 2022 at 05:54:52PM +0100, Stephen Kitt wrote:
> As part of the ongoing i2c transition to the simple probe
> ("probe_new"), this patch uses i2c_match_id to retrieve the
> driver_data for the probed device. The id parameter is thus no longer
> necessary and the simple probe can be used instead.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>

I think the device tables should be moved up.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
  2022-03-25 16:54 [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe Stephen Kitt
  2022-03-28  7:48 ` Sa, Nuno
  2022-03-30  9:38 ` Wolfram Sang
@ 2022-04-05  9:31 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-04-05  9:31 UTC (permalink / raw)
  To: Lars-Peter Clausen, Liam Girdwood, steve, nuno.sa; +Cc: wsa, linux-kernel

On Fri, 25 Mar 2022 17:54:52 +0100, Stephen Kitt wrote:
> As part of the ongoing i2c transition to the simple probe
> ("probe_new"), this patch uses i2c_match_id to retrieve the
> driver_data for the probed device. The id parameter is thus no longer
> necessary and the simple probe can be used instead.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe
      commit: e5cd0623d7879eb98059223b9eb233a686d58b40

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-05 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 16:54 [PATCH] ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe Stephen Kitt
2022-03-28  7:48 ` Sa, Nuno
2022-03-30  9:38 ` Wolfram Sang
2022-04-05  9:31 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®