All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saravanan Sekar <sravanhome@gmail.com>
To: sre@kernel.org, lee@kernel.org, jic23@kernel.org,
	lars@metafoo.de, andy.shevchenko@gmail.com
Cc: linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
	Saravanan Sekar <sravanhome@gmail.com>
Subject: [PATCH v6 3/7] mfd: mp2629: introduce chip id machanism to distinguish chip
Date: Wed, 23 Nov 2022 18:54:21 +0100	[thread overview]
Message-ID: <20221123175425.564042-4-sravanhome@gmail.com> (raw)
In-Reply-To: <20221123175425.564042-1-sravanhome@gmail.com>

Introduce chip id machanism to distinguish chip

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/mfd/mp2629.c       | 4 +++-
 include/linux/mfd/mp2629.h | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/mp2629.c b/drivers/mfd/mp2629.c
index f4c5aa06f38c..a3fc02ad5ec1 100644
--- a/drivers/mfd/mp2629.c
+++ b/drivers/mfd/mp2629.c
@@ -13,6 +13,7 @@
 #include <linux/mfd/mp2629.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
@@ -43,6 +44,7 @@ static int mp2629_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	ddata->dev = &client->dev;
+	ddata->chip_id = (uintptr_t)device_get_match_data(&client->dev);
 	i2c_set_clientdata(client, ddata);
 
 	ddata->regmap = devm_regmap_init_i2c(client, &mp2629_regmap_config);
@@ -60,7 +62,7 @@ static int mp2629_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id mp2629_of_match[] = {
-	{ .compatible = "mps,mp2629"},
+	{ .compatible = "mps,mp2629", .data = (void *)CHIP_ID_MP2629 },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mp2629_of_match);
diff --git a/include/linux/mfd/mp2629.h b/include/linux/mfd/mp2629.h
index 89b706900b57..072c8181b48b 100644
--- a/include/linux/mfd/mp2629.h
+++ b/include/linux/mfd/mp2629.h
@@ -9,9 +9,14 @@
 #include <linux/device.h>
 #include <linux/regmap.h>
 
+enum mp2xx_chip_id {
+	CHIP_ID_MP2629,
+};
+
 struct mp2629_data {
 	struct device *dev;
 	struct regmap *regmap;
+	enum mp2xx_chip_id chip_id;
 };
 
 enum mp2629_adc_chan {
-- 
2.34.1


  parent reply	other threads:[~2022-11-23 17:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 17:54 [PATCH v6 0/7] Add support for mp2733 battery charger Saravanan Sekar
2022-11-23 17:54 ` [PATCH v6 1/7] mfd: mp2629: fix failed to get iio channel by device name Saravanan Sekar
2023-01-19 15:00   ` Lee Jones
2022-11-23 17:54 ` [PATCH v6 2/7] power: supply: fix wrong interpretation of register value Saravanan Sekar
2022-11-24 21:45   ` Sebastian Reichel
2022-11-23 17:54 ` Saravanan Sekar [this message]
2023-01-19 15:06   ` [PATCH v6 3/7] mfd: mp2629: introduce chip id machanism to distinguish chip Lee Jones
2022-11-23 17:54 ` [PATCH v6 4/7] mfd: mp2629: Add support for mps mp2733 battery charger Saravanan Sekar
2023-01-19 15:08   ` Lee Jones
2022-11-23 17:54 ` [PATCH v6 5/7] iio: adc: mp2629: restrict input voltage mask for mp2629 Saravanan Sekar
2022-11-23 17:54 ` [PATCH v6 6/7] power: supply: Add support for mp2733 battery charger Saravanan Sekar
2022-11-23 17:54 ` [PATCH v6 7/7] power: supply: mp2629: Add USB fast charge settings Saravanan Sekar
2022-12-06 16:05 ` [PATCH v6 0/7] Add support for mp2733 battery charger saravanan sekar
2022-12-11 11:50   ` Jonathan Cameron
2023-01-03 12:37     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221123175425.564042-4-sravanhome@gmail.com \
    --to=sravanhome@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lee@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.