linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Match data improvements for bq256xx driver
@ 2023-09-02 20:25 Biju Das
  2023-09-02 20:25 ` [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data() Biju Das
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Biju Das @ 2023-09-02 20:25 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Biju Das, linux-pm, linux-kernel, Biju Das, Andy Shevchenko

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

This patch series is only compile tested.

Biju Das (2):
  power: supply: bq256xx: Use i2c_get_match_data()
  power: supply: bq256xx: Some cleanups

 drivers/power/supply/bq256xx_charger.c | 50 +++++++++++++-------------
 1 file changed, 25 insertions(+), 25 deletions(-)

-- 
2.25.1


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

* [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data()
  2023-09-02 20:25 [PATCH 0/2] Match data improvements for bq256xx driver Biju Das
@ 2023-09-02 20:25 ` Biju Das
  2023-09-02 20:25 ` [PATCH 2/2] power: supply: bq256xx: Some cleanups Biju Das
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Biju Das @ 2023-09-02 20:25 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Biju Das, linux-pm, linux-kernel, Biju Das, Andy Shevchenko

Use i2c_get_match_data() for OF/ID/ACPI match instead of ID lookup by
replacing OF/ACPI/ID match data from enum bq256xx_id to
struct bq256xx_chip_info.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/power/supply/bq256xx_charger.c | 44 +++++++++++++-------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index 82d3cd5ee2f9..fda4286323ee 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1702,7 +1702,7 @@ static int bq256xx_probe(struct i2c_client *client)
 
 	bq->client = client;
 	bq->dev = dev;
-	bq->chip_info = &bq256xx_chip_info_tbl[id->driver_data];
+	bq->chip_info = i2c_get_match_data(client);
 
 	mutex_init(&bq->lock);
 
@@ -1771,37 +1771,37 @@ static int bq256xx_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id bq256xx_i2c_ids[] = {
-	{ "bq25600", BQ25600 },
-	{ "bq25600d", BQ25600D },
-	{ "bq25601", BQ25601 },
-	{ "bq25601d", BQ25601D },
-	{ "bq25611d", BQ25611D },
-	{ "bq25618", BQ25618 },
-	{ "bq25619", BQ25619 },
+	{ "bq25600", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600] },
+	{ "bq25600d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600D] },
+	{ "bq25601", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601] },
+	{ "bq25601d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601D] },
+	{ "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] },
+	{ "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] },
+	{ "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] },
 	{},
 };
 MODULE_DEVICE_TABLE(i2c, bq256xx_i2c_ids);
 
 static const struct of_device_id bq256xx_of_match[] = {
-	{ .compatible = "ti,bq25600", .data = (void *)BQ25600 },
-	{ .compatible = "ti,bq25600d", .data = (void *)BQ25600D },
-	{ .compatible = "ti,bq25601", .data = (void *)BQ25601 },
-	{ .compatible = "ti,bq25601d", .data = (void *)BQ25601D },
-	{ .compatible = "ti,bq25611d", .data = (void *)BQ25611D },
-	{ .compatible = "ti,bq25618", .data = (void *)BQ25618 },
-	{ .compatible = "ti,bq25619", .data = (void *)BQ25619 },
+	{ .compatible = "ti,bq25600", .data = &bq256xx_chip_info_tbl[BQ25600] },
+	{ .compatible = "ti,bq25600d", .data = &bq256xx_chip_info_tbl[BQ25600D] },
+	{ .compatible = "ti,bq25601", .data = &bq256xx_chip_info_tbl[BQ25601] },
+	{ .compatible = "ti,bq25601d", .data = &bq256xx_chip_info_tbl[BQ25601D] },
+	{ .compatible = "ti,bq25611d", .data = &bq256xx_chip_info_tbl[BQ25611D] },
+	{ .compatible = "ti,bq25618", .data = &bq256xx_chip_info_tbl[BQ25618] },
+	{ .compatible = "ti,bq25619", .data = &bq256xx_chip_info_tbl[BQ25619] },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bq256xx_of_match);
 
 static const struct acpi_device_id bq256xx_acpi_match[] = {
-	{ "bq25600", BQ25600 },
-	{ "bq25600d", BQ25600D },
-	{ "bq25601", BQ25601 },
-	{ "bq25601d", BQ25601D },
-	{ "bq25611d", BQ25611D },
-	{ "bq25618", BQ25618 },
-	{ "bq25619", BQ25619 },
+	{ "bq25600", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600] },
+	{ "bq25600d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600D] },
+	{ "bq25601", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601] },
+	{ "bq25601d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601D] },
+	{ "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] },
+	{ "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] },
+	{ "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] },
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match);
-- 
2.25.1


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

* [PATCH 2/2] power: supply: bq256xx: Some cleanups
  2023-09-02 20:25 [PATCH 0/2] Match data improvements for bq256xx driver Biju Das
  2023-09-02 20:25 ` [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data() Biju Das
@ 2023-09-02 20:25 ` Biju Das
  2023-09-04 10:12 ` [PATCH 0/2] Match data improvements for bq256xx driver Andy Shevchenko
  2023-09-12 16:19 ` Sebastian Reichel
  3 siblings, 0 replies; 5+ messages in thread
From: Biju Das @ 2023-09-02 20:25 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Biju Das, linux-pm, linux-kernel, Biju Das, Andy Shevchenko

Some cleanups:
 * Remove trailing comma in the terminator entry for OF/ID/ACPI table.
 * Drop a space from terminator entry for OF table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/power/supply/bq256xx_charger.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index fda4286323ee..474201815a27 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1778,7 +1778,7 @@ static const struct i2c_device_id bq256xx_i2c_ids[] = {
 	{ "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] },
 	{ "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] },
 	{ "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] },
-	{},
+	{}
 };
 MODULE_DEVICE_TABLE(i2c, bq256xx_i2c_ids);
 
@@ -1790,7 +1790,7 @@ static const struct of_device_id bq256xx_of_match[] = {
 	{ .compatible = "ti,bq25611d", .data = &bq256xx_chip_info_tbl[BQ25611D] },
 	{ .compatible = "ti,bq25618", .data = &bq256xx_chip_info_tbl[BQ25618] },
 	{ .compatible = "ti,bq25619", .data = &bq256xx_chip_info_tbl[BQ25619] },
-	{ },
+	{}
 };
 MODULE_DEVICE_TABLE(of, bq256xx_of_match);
 
@@ -1802,7 +1802,7 @@ static const struct acpi_device_id bq256xx_acpi_match[] = {
 	{ "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] },
 	{ "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] },
 	{ "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] },
-	{},
+	{}
 };
 MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match);
 
-- 
2.25.1


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

* Re: [PATCH 0/2] Match data improvements for bq256xx driver
  2023-09-02 20:25 [PATCH 0/2] Match data improvements for bq256xx driver Biju Das
  2023-09-02 20:25 ` [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data() Biju Das
  2023-09-02 20:25 ` [PATCH 2/2] power: supply: bq256xx: Some cleanups Biju Das
@ 2023-09-04 10:12 ` Andy Shevchenko
  2023-09-12 16:19 ` Sebastian Reichel
  3 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2023-09-04 10:12 UTC (permalink / raw)
  To: Biju Das; +Cc: Sebastian Reichel, linux-pm, linux-kernel, Biju Das

On Sat, Sep 02, 2023 at 09:25:03PM +0100, Biju Das wrote:
> This patch series aims to add match data improvements for bq256xx driver.
> 
> This patch series is only compile tested.

FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 0/2] Match data improvements for bq256xx driver
  2023-09-02 20:25 [PATCH 0/2] Match data improvements for bq256xx driver Biju Das
                   ` (2 preceding siblings ...)
  2023-09-04 10:12 ` [PATCH 0/2] Match data improvements for bq256xx driver Andy Shevchenko
@ 2023-09-12 16:19 ` Sebastian Reichel
  3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2023-09-12 16:19 UTC (permalink / raw)
  To: Sebastian Reichel, Biju Das
  Cc: linux-pm, linux-kernel, Biju Das, Andy Shevchenko


On Sat, 02 Sep 2023 21:25:03 +0100, Biju Das wrote:
> This patch series aims to add match data improvements for bq256xx driver.
> 
> This patch series is only compile tested.
> 
> Biju Das (2):
>   power: supply: bq256xx: Use i2c_get_match_data()
>   power: supply: bq256xx: Some cleanups
> 
> [...]

Applied, thanks!

[1/2] power: supply: bq256xx: Use i2c_get_match_data()
      commit: f28992902b17245af042913d6cfd6a1cc100bcaf
[2/2] power: supply: bq256xx: Some cleanups
      commit: 02e673e59c3d374924422f74fb229ae4ee6715fc

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


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

end of thread, other threads:[~2023-09-12 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-02 20:25 [PATCH 0/2] Match data improvements for bq256xx driver Biju Das
2023-09-02 20:25 ` [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data() Biju Das
2023-09-02 20:25 ` [PATCH 2/2] power: supply: bq256xx: Some cleanups Biju Das
2023-09-04 10:12 ` [PATCH 0/2] Match data improvements for bq256xx driver Andy Shevchenko
2023-09-12 16:19 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).