public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: rtq6056: Fix the manual device instantiation via sysfs
@ 2026-04-21  1:41 cy_huang
  2026-04-21  1:56 ` ChiYuan Huang
  0 siblings, 1 reply; 2+ messages in thread
From: cy_huang @ 2026-04-21  1:41 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Kevin Tung,
	ChiYuan Huang, Lucas Tsai, kevin.tung, linux-iio, linux-kernel,
	stable

From: Kevin Tung <kevin.tung.openbmc@gmail.com>

Add i2c_device_id to support sysfs manual device instantiation.

Fixes: 89a1034cd841 ("iio: adc: rtq6056: Add support for the whole RTQ6056 family")
Signed-off-by: Kevin Tung <kevin.tung.openbmc@gmail.com>
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Cc: <stable@vger.kernel.org>
---
Hi, Jonathan:

For some BSP limit, still some user instantiate rtq6056 deivce via sysfs.
Therefore, add old style i2c id to make it compatible for this kind of usage.

BR,
ChiYuan.
---
 drivers/iio/adc/rtq6056.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/rtq6056.c b/drivers/iio/adc/rtq6056.c
index 2bf3a09ac6b0..e7036dc7d7b9 100644
--- a/drivers/iio/adc/rtq6056.c
+++ b/drivers/iio/adc/rtq6056.c
@@ -728,7 +728,7 @@ static int rtq6056_probe(struct i2c_client *i2c)
 	if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_WORD_DATA))
 		return -EOPNOTSUPP;
 
-	devdata = device_get_match_data(dev);
+	devdata = i2c_get_match_data(i2c);
 	if (!devdata)
 		return dev_err_probe(dev, -EINVAL, "Invalid dev data\n");
 
@@ -878,6 +878,13 @@ static const struct of_device_id rtq6056_device_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rtq6056_device_match);
 
+static const struct i2c_device_id rtq6056_id[] = {
+	{ "rtq6056", (kernel_ulong_t)&rtq6056_devdata },
+	{ "rtq6059", (kernel_ulong_t)&rtq6059_devdata },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, rtq6056_id);
+
 static struct i2c_driver rtq6056_driver = {
 	.driver = {
 		.name = "rtq6056",
@@ -885,6 +892,7 @@ static struct i2c_driver rtq6056_driver = {
 		.pm = pm_ptr(&rtq6056_pm_ops),
 	},
 	.probe = rtq6056_probe,
+	.id_table = rtq6056_id,
 };
 module_i2c_driver(rtq6056_driver);
 
-- 
2.34.1


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

* Re: [PATCH] iio: adc: rtq6056: Fix the manual device instantiation via sysfs
  2026-04-21  1:41 [PATCH] iio: adc: rtq6056: Fix the manual device instantiation via sysfs cy_huang
@ 2026-04-21  1:56 ` ChiYuan Huang
  0 siblings, 0 replies; 2+ messages in thread
From: ChiYuan Huang @ 2026-04-21  1:56 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Kevin Tung,
	Lucas Tsai, kevin.tung, linux-iio, linux-kernel, stable

On Tue, Apr 21, 2026 at 09:41:17AM +0800, cy_huang@richtek.com wrote:
> From: Kevin Tung <kevin.tung.openbmc@gmail.com>
> 
> Add i2c_device_id to support sysfs manual device instantiation.
> 
> Fixes: 89a1034cd841 ("iio: adc: rtq6056: Add support for the whole RTQ6056 family")
> Signed-off-by: Kevin Tung <kevin.tung.openbmc@gmail.com>
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
> Cc: <stable@vger.kernel.org>
> ---
> Hi, Jonathan:
> 
> For some BSP limit, still some user instantiate rtq6056 deivce via sysfs.
> Therefore, add old style i2c id to make it compatible for this kind of usage.
> 
> BR,
> ChiYuan.
Hi,

Please ignore this patch. I have seen Kevin submit the patch in the
following link.
https://lore.kernel.org/lkml/20260420-rtq6056_support_sysfs_instantiation-v1-1-483ccee27b63@gmail.com/
> ---
>  drivers/iio/adc/rtq6056.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> -- 
> 2.34.1
> 

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

end of thread, other threads:[~2026-04-21  1:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21  1:41 [PATCH] iio: adc: rtq6056: Fix the manual device instantiation via sysfs cy_huang
2026-04-21  1:56 ` ChiYuan Huang

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