linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support.
@ 2014-02-14 13:20 Marek Belisko
  2014-02-14 13:31 ` Mark Rutland
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Belisko @ 2014-02-14 13:20 UTC (permalink / raw)
  To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, rob,
	jdelvare, linux, grant.likely
  Cc: devicetree, linux-doc, linux-kernel, lm-sensors, hns, Marek Belisko

Signed-off-by: Marek Belisko <marek@goldelico.com>
---
 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt |  9 +++++++++
 drivers/hwmon/twl4030-madc-hwmon.c                             | 10 ++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt

diff --git a/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
new file mode 100644
index 0000000..e8016d1
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
@@ -0,0 +1,9 @@
+TWL4030 MADC hwmon.
+
+Required properties:
+- compatible: "ti,twl4030-madc-hwmon"
+
+Example:
+madc-hwmon {
+	compatible = "ti,twl4030-madc-hwmon";
+};
diff --git a/drivers/hwmon/twl4030-madc-hwmon.c b/drivers/hwmon/twl4030-madc-hwmon.c
index 6c6d440..05fb572 100644
--- a/drivers/hwmon/twl4030-madc-hwmon.c
+++ b/drivers/hwmon/twl4030-madc-hwmon.c
@@ -96,6 +96,15 @@ static const struct attribute_group twl4030_madc_group = {
 	.attrs = twl4030_madc_attributes,
 };
 
+#ifdef CONFIG_OF
+
+static const struct of_device_id of_twl4030_madc_hwmon_match[] = {
+	{ .compatible = "ti,twl4030-madc-hwmon", },
+	{},
+};
+
+#endif
+
 static int twl4030_madc_hwmon_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -134,6 +143,7 @@ static struct platform_driver twl4030_madc_hwmon_driver = {
 	.driver = {
 		   .name = "twl4030_madc_hwmon",
 		   .owner = THIS_MODULE,
+		   .of_match_table = of_match_ptr(of_twl4030_madc_hwmon_match),
 		   },
 };
 
-- 
1.8.3.2


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

* Re: [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support.
  2014-02-14 13:20 [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support Marek Belisko
@ 2014-02-14 13:31 ` Mark Rutland
  2014-02-14 14:08   ` Belisko Marek
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Rutland @ 2014-02-14 13:31 UTC (permalink / raw)
  To: Marek Belisko
  Cc: robh+dt, Pawel Moll, ijc+devicetree, galak, rob, jdelvare, linux,
	grant.likely, devicetree, linux-doc, linux-kernel, lm-sensors,
	hns

On Fri, Feb 14, 2014 at 01:20:58PM +0000, Marek Belisko wrote:
> Signed-off-by: Marek Belisko <marek@goldelico.com>
> ---
>  Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt |  9 +++++++++
>  drivers/hwmon/twl4030-madc-hwmon.c                             | 10 ++++++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> new file mode 100644
> index 0000000..e8016d1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> @@ -0,0 +1,9 @@
> +TWL4030 MADC hwmon.
> +
> +Required properties:
> +- compatible: "ti,twl4030-madc-hwmon"
> +
> +Example:
> +madc-hwmon {
> +	compatible = "ti,twl4030-madc-hwmon";
> +};

Huh?

What is this a binding for? From a look at the driver in mainline this
just calls into functions from the twl4030 madc driver (which doesn't
seem to have a binding).

This doesn't look like a description of hardware, but rather a hack to
get a Linux driver to probe. As far as I can see, no useful information
is given by this binding.

Thanks,
Mark.

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

* Re: [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support.
  2014-02-14 13:31 ` Mark Rutland
@ 2014-02-14 14:08   ` Belisko Marek
  2014-02-16 16:39     ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Belisko Marek @ 2014-02-14 14:08 UTC (permalink / raw)
  To: Mark Rutland
  Cc: robh+dt, Pawel Moll, ijc+devicetree, galak, rob, jdelvare, linux,
	grant.likely, devicetree, linux-doc, linux-kernel, lm-sensors,
	hns

On Fri, Feb 14, 2014 at 2:31 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> On Fri, Feb 14, 2014 at 01:20:58PM +0000, Marek Belisko wrote:
>> Signed-off-by: Marek Belisko <marek@goldelico.com>
>> ---
>>  Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt |  9 +++++++++
>>  drivers/hwmon/twl4030-madc-hwmon.c                             | 10 ++++++++++
>>  2 files changed, 19 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>> new file mode 100644
>> index 0000000..e8016d1
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>> @@ -0,0 +1,9 @@
>> +TWL4030 MADC hwmon.
>> +
>> +Required properties:
>> +- compatible: "ti,twl4030-madc-hwmon"
>> +
>> +Example:
>> +madc-hwmon {
>> +     compatible = "ti,twl4030-madc-hwmon";
>> +};
>
> Huh?
>
> What is this a binding for? From a look at the driver in mainline this
> just calls into functions from the twl4030 madc driver (which doesn't
> seem to have a binding).
I post bindings for twl4030-madc [1]. Without probing this driver
other things will not work (twl4030-madc-battery e.g.).
Is there better way to handle this situation?
>
> This doesn't look like a description of hardware, but rather a hack to
> get a Linux driver to probe. As far as I can see, no useful information
> is given by this binding.
>
> Thanks,
> Mark.

BR,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com

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

* Re: [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support.
  2014-02-14 14:08   ` Belisko Marek
@ 2014-02-16 16:39     ` Guenter Roeck
  2014-02-16 17:44       ` Sebastian Reichel
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2014-02-16 16:39 UTC (permalink / raw)
  To: Belisko Marek, Mark Rutland
  Cc: robh+dt, Pawel Moll, ijc+devicetree, galak, rob, jdelvare,
	grant.likely, devicetree, linux-doc, linux-kernel, lm-sensors,
	hns

On 02/14/2014 06:08 AM, Belisko Marek wrote:
> On Fri, Feb 14, 2014 at 2:31 PM, Mark Rutland <mark.rutland@arm.com> wrote:
>> On Fri, Feb 14, 2014 at 01:20:58PM +0000, Marek Belisko wrote:
>>> Signed-off-by: Marek Belisko <marek@goldelico.com>
>>> ---
>>>   Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt |  9 +++++++++
>>>   drivers/hwmon/twl4030-madc-hwmon.c                             | 10 ++++++++++
>>>   2 files changed, 19 insertions(+)
>>>   create mode 100644 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>>> new file mode 100644
>>> index 0000000..e8016d1
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
>>> @@ -0,0 +1,9 @@
>>> +TWL4030 MADC hwmon.
>>> +
>>> +Required properties:
>>> +- compatible: "ti,twl4030-madc-hwmon"
>>> +
>>> +Example:
>>> +madc-hwmon {
>>> +     compatible = "ti,twl4030-madc-hwmon";
>>> +};
>>
>> Huh?
>>
>> What is this a binding for? From a look at the driver in mainline this
>> just calls into functions from the twl4030 madc driver (which doesn't
>> seem to have a binding).
> I post bindings for twl4030-madc [1]. Without probing this driver
> other things will not work (twl4030-madc-battery e.g.).
> Is there better way to handle this situation?

Since you are converting twl4030-madc to be an iio driver,
can't you simply use the iio_hwmon bridge and declare this driver
obsolete ?

Guenter


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

* Re: [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support.
  2014-02-16 16:39     ` Guenter Roeck
@ 2014-02-16 17:44       ` Sebastian Reichel
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2014-02-16 17:44 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Belisko Marek, Mark Rutland, robh+dt, Pawel Moll, ijc+devicetree,
	galak, rob, jdelvare, grant.likely, devicetree, linux-doc,
	linux-kernel, lm-sensors, hns

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

On Sun, Feb 16, 2014 at 08:39:54AM -0800, Guenter Roeck wrote:
> On 02/14/2014 06:08 AM, Belisko Marek wrote:
> >On Fri, Feb 14, 2014 at 2:31 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> >>On Fri, Feb 14, 2014 at 01:20:58PM +0000, Marek Belisko wrote:
> >>>Signed-off-by: Marek Belisko <marek@goldelico.com>
> >>>---
> >>>  Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt |  9 +++++++++
> >>>  drivers/hwmon/twl4030-madc-hwmon.c                             | 10 ++++++++++
> >>>  2 files changed, 19 insertions(+)
> >>>  create mode 100644 Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> >>>
> >>>diff --git a/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> >>>new file mode 100644
> >>>index 0000000..e8016d1
> >>>--- /dev/null
> >>>+++ b/Documentation/devicetree/bindings/hwmon/twl4030-madc-hwmon.txt
> >>>@@ -0,0 +1,9 @@
> >>>+TWL4030 MADC hwmon.
> >>>+
> >>>+Required properties:
> >>>+- compatible: "ti,twl4030-madc-hwmon"
> >>>+
> >>>+Example:
> >>>+madc-hwmon {
> >>>+     compatible = "ti,twl4030-madc-hwmon";
> >>>+};
> >>
> >>Huh?
> >>
> >>What is this a binding for? From a look at the driver in mainline this
> >>just calls into functions from the twl4030 madc driver (which doesn't
> >>seem to have a binding).
> >I post bindings for twl4030-madc [1]. Without probing this driver
> >other things will not work (twl4030-madc-battery e.g.).
> >Is there better way to handle this situation?
> 
> Since you are converting twl4030-madc to be an iio driver,
> can't you simply use the iio_hwmon bridge and declare this driver
> obsolete ?

He didn't convert the driver, I did. That's why he included this
change.

I was thinking of using the iio_hwmon bridge and deprecating the
madc-hwmon driver. I have not tested this, though (lack of time).

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-02-16 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 13:20 [PATCH] hwmon: twl4030-madc-hwmon: Add device tree support Marek Belisko
2014-02-14 13:31 ` Mark Rutland
2014-02-14 14:08   ` Belisko Marek
2014-02-16 16:39     ` Guenter Roeck
2014-02-16 17:44       ` 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).