devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] hwmon: lm92: Add devicetree support
@ 2015-07-22 16:30 Denis Carikli
       [not found] ` <1437582620-2294-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Denis Carikli @ 2015-07-22 16:30 UTC (permalink / raw)
  To: Jean Delvare, Rob Herring
  Cc: Eric Bénard, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Denis Carikli

Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
---
 drivers/hwmon/lm92.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
index cfaf70b..a1e10cd 100644
--- a/drivers/hwmon/lm92.c
+++ b/drivers/hwmon/lm92.c
@@ -44,6 +44,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/jiffies.h>
 
 /*
@@ -386,6 +387,13 @@ static int lm92_probe(struct i2c_client *new_client,
  * Module and driver stuff
  */
 
+#ifdef CONFIG_OF
+static const struct of_device_id lm92_of_match[] = {
+	{ .compatible = "national,lm92", },
+};
+MODULE_DEVICE_TABLE(of, lm92_of_match);
+#endif
+
 static const struct i2c_device_id lm92_id[] = {
 	{ "lm92", 0 },
 	/* max6635 could be added here */
@@ -397,6 +405,7 @@ static struct i2c_driver lm92_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm92",
+		.of_match_table = of_match_ptr(lm92_of_match),
 	},
 	.probe		= lm92_probe,
 	.id_table	= lm92_id,
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/3] hwmon: ads7828: Add devicetree support
       [not found] ` <1437582620-2294-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
@ 2015-07-22 16:30   ` Denis Carikli
       [not found]     ` <1437582620-2294-2-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
  2015-07-22 16:30   ` [PATCH 3/3] hwmon: ads7828: Add devicetree documentation Denis Carikli
  2015-07-22 16:36   ` [lm-sensors] [PATCH 1/3] hwmon: lm92: Add devicetree support Guenter Roeck
  2 siblings, 1 reply; 6+ messages in thread
From: Denis Carikli @ 2015-07-22 16:30 UTC (permalink / raw)
  To: Jean Delvare, Rob Herring
  Cc: Eric Bénard, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Denis Carikli

Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
---
 drivers/hwmon/ads7828.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 6c99ee7..a2d297f 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -31,6 +31,7 @@
 #include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_data/ads7828.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
@@ -160,6 +161,15 @@ static int ads7828_probe(struct i2c_client *client,
 	return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id ads7828_of_match[] = {
+	{ .compatible = "ti,ads7828", .data = (void *) ads7828, },
+	{ .compatible = "ti,ads7830", .data = (void *) ads7830, },
+
+};
+MODULE_DEVICE_TABLE(of, ads7828_of_match);
+#endif
+
 static const struct i2c_device_id ads7828_device_ids[] = {
 	{ "ads7828", ads7828 },
 	{ "ads7830", ads7830 },
@@ -170,6 +180,7 @@ MODULE_DEVICE_TABLE(i2c, ads7828_device_ids);
 static struct i2c_driver ads7828_driver = {
 	.driver = {
 		.name = "ads7828",
+		.of_match_table = of_match_ptr(ads7828_of_match),
 	},
 
 	.id_table = ads7828_device_ids,
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/3] hwmon: ads7828: Add devicetree documentation
       [not found] ` <1437582620-2294-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
  2015-07-22 16:30   ` [PATCH 2/3] hwmon: ads7828: " Denis Carikli
@ 2015-07-22 16:30   ` Denis Carikli
       [not found]     ` <1437582620-2294-3-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
  2015-07-22 16:36   ` [lm-sensors] [PATCH 1/3] hwmon: lm92: Add devicetree support Guenter Roeck
  2 siblings, 1 reply; 6+ messages in thread
From: Denis Carikli @ 2015-07-22 16:30 UTC (permalink / raw)
  To: Jean Delvare, Rob Herring
  Cc: Eric Bénard, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Denis Carikli

Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
---
 Documentation/devicetree/bindings/i2c/trivial-devices.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 00f8652..d77d412 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -95,6 +95,8 @@ stm,m41t00		Serial Access TIMEKEEPER
 stm,m41t62		Serial real-time clock (RTC) with alarm
 stm,m41t80		M41T80 - SERIAL ACCESS RTC WITH ALARMS
 taos,tsl2550		Ambient Light Sensor with SMBUS/Two Wire Serial Interface
+ti,ads7828		8-Channels, 12-bit ADC
+ti,ads7830		8-Channels, 8-bit ADC
 ti,tsc2003		I2C Touch-Screen Controller
 ti,tmp102		Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
 ti,tmp103		Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [lm-sensors] [PATCH 1/3] hwmon: lm92: Add devicetree support
       [not found] ` <1437582620-2294-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
  2015-07-22 16:30   ` [PATCH 2/3] hwmon: ads7828: " Denis Carikli
  2015-07-22 16:30   ` [PATCH 3/3] hwmon: ads7828: Add devicetree documentation Denis Carikli
@ 2015-07-22 16:36   ` Guenter Roeck
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-07-22 16:36 UTC (permalink / raw)
  To: Denis Carikli, Jean Delvare, Rob Herring
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Eric Bénard,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 07/22/2015 09:30 AM, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
> ---

i2c drivers do not need explicit devicetree support.

Guenter

>   drivers/hwmon/lm92.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
> index cfaf70b..a1e10cd 100644
> --- a/drivers/hwmon/lm92.c
> +++ b/drivers/hwmon/lm92.c
> @@ -44,6 +44,7 @@
>   #include <linux/hwmon-sysfs.h>
>   #include <linux/err.h>
>   #include <linux/mutex.h>
> +#include <linux/of.h>
>   #include <linux/jiffies.h>
>
>   /*
> @@ -386,6 +387,13 @@ static int lm92_probe(struct i2c_client *new_client,
>    * Module and driver stuff
>    */
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id lm92_of_match[] = {
> +	{ .compatible = "national,lm92", },
> +};
> +MODULE_DEVICE_TABLE(of, lm92_of_match);
> +#endif
> +
>   static const struct i2c_device_id lm92_id[] = {
>   	{ "lm92", 0 },
>   	/* max6635 could be added here */
> @@ -397,6 +405,7 @@ static struct i2c_driver lm92_driver = {
>   	.class		= I2C_CLASS_HWMON,
>   	.driver = {
>   		.name	= "lm92",
> +		.of_match_table = of_match_ptr(lm92_of_match),
>   	},
>   	.probe		= lm92_probe,
>   	.id_table	= lm92_id,
>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [lm-sensors] [PATCH 2/3] hwmon: ads7828: Add devicetree support
       [not found]     ` <1437582620-2294-2-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
@ 2015-07-22 16:37       ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-07-22 16:37 UTC (permalink / raw)
  To: Denis Carikli, Jean Delvare, Rob Herring
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Eric Bénard,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 07/22/2015 09:30 AM, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
> ---

i2c drivers do not need explicit devicetree support.

Guenter

>   drivers/hwmon/ads7828.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
> index 6c99ee7..a2d297f 100644
> --- a/drivers/hwmon/ads7828.c
> +++ b/drivers/hwmon/ads7828.c
> @@ -31,6 +31,7 @@
>   #include <linux/i2c.h>
>   #include <linux/init.h>
>   #include <linux/module.h>
> +#include <linux/of.h>
>   #include <linux/platform_data/ads7828.h>
>   #include <linux/regmap.h>
>   #include <linux/slab.h>
> @@ -160,6 +161,15 @@ static int ads7828_probe(struct i2c_client *client,
>   	return PTR_ERR_OR_ZERO(hwmon_dev);
>   }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id ads7828_of_match[] = {
> +	{ .compatible = "ti,ads7828", .data = (void *) ads7828, },
> +	{ .compatible = "ti,ads7830", .data = (void *) ads7830, },
> +
> +};
> +MODULE_DEVICE_TABLE(of, ads7828_of_match);
> +#endif
> +
>   static const struct i2c_device_id ads7828_device_ids[] = {
>   	{ "ads7828", ads7828 },
>   	{ "ads7830", ads7830 },
> @@ -170,6 +180,7 @@ MODULE_DEVICE_TABLE(i2c, ads7828_device_ids);
>   static struct i2c_driver ads7828_driver = {
>   	.driver = {
>   		.name = "ads7828",
> +		.of_match_table = of_match_ptr(ads7828_of_match),
>   	},
>
>   	.id_table = ads7828_device_ids,
>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [lm-sensors] [PATCH 3/3] hwmon: ads7828: Add devicetree documentation
       [not found]     ` <1437582620-2294-3-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
@ 2015-07-22 16:38       ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2015-07-22 16:38 UTC (permalink / raw)
  To: Denis Carikli, Jean Delvare, Rob Herring
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Eric Bénard,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA

On 07/22/2015 09:30 AM, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>

Acked-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

You should probably send this patch to the i2c mailing list.

Guenter

> ---
>   Documentation/devicetree/bindings/i2c/trivial-devices.txt | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> index 00f8652..d77d412 100644
> --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> @@ -95,6 +95,8 @@ stm,m41t00		Serial Access TIMEKEEPER
>   stm,m41t62		Serial real-time clock (RTC) with alarm
>   stm,m41t80		M41T80 - SERIAL ACCESS RTC WITH ALARMS
>   taos,tsl2550		Ambient Light Sensor with SMBUS/Two Wire Serial Interface
> +ti,ads7828		8-Channels, 12-bit ADC
> +ti,ads7830		8-Channels, 8-bit ADC
>   ti,tsc2003		I2C Touch-Screen Controller
>   ti,tmp102		Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
>   ti,tmp103		Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-07-22 16:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 16:30 [PATCH 1/3] hwmon: lm92: Add devicetree support Denis Carikli
     [not found] ` <1437582620-2294-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
2015-07-22 16:30   ` [PATCH 2/3] hwmon: ads7828: " Denis Carikli
     [not found]     ` <1437582620-2294-2-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
2015-07-22 16:37       ` [lm-sensors] " Guenter Roeck
2015-07-22 16:30   ` [PATCH 3/3] hwmon: ads7828: Add devicetree documentation Denis Carikli
     [not found]     ` <1437582620-2294-3-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
2015-07-22 16:38       ` [lm-sensors] " Guenter Roeck
2015-07-22 16:36   ` [lm-sensors] [PATCH 1/3] hwmon: lm92: Add devicetree support Guenter Roeck

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).