* [PATCH] iio:light:tsl2563: Add DT support
@ 2013-10-23 21:51 Sebastian Reichel
2013-10-24 8:29 ` Jonathan Cameron
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-23 21:51 UTC (permalink / raw)
To: Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Sebastian Reichel,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
Add Device Tree support for the TSL2563 driver
and document the binding.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
.../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
drivers/iio/light/tsl2563.c | 4 ++++
2 files changed, 23 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
new file mode 100644
index 0000000..b52cf4b
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
@@ -0,0 +1,19 @@
+* TAOS TSL2563 ambient light sensor
+
+Required properties:
+
+ - compatible : should be "taos,tsl2563"
+ - reg : the I2C address of the sensor
+
+Optional properties:
+
+ - cover-comp-gain : integer used as multiplier for gain
+ compensation (default = 1)
+
+Example:
+
+tsl2563@29 {
+ compatible = "taos,tsl2563";
+ reg = <0x29>;
+ cover-comp-gain = <16>;
+};
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index ebb962c..bd30b1d 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
struct iio_dev *indio_dev;
struct tsl2563_chip *chip;
struct tsl2563_platform_data *pdata = client->dev.platform_data;
+ struct device_node *np = client->dev.of_node;
int err = 0;
u8 id = 0;
@@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
if (pdata)
chip->cover_comp_gain = pdata->cover_comp_gain;
+ else if (np)
+ of_property_read_u32_index(np, "cover-comp-gain", 0,
+ &chip->cover_comp_gain);
else
chip->cover_comp_gain = 1;
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
@ 2013-10-24 8:29 ` Jonathan Cameron
2013-10-24 13:43 ` Sebastian Reichel
2013-10-24 14:27 ` [PATCHv2] " Sebastian Reichel
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Jonathan Cameron @ 2013-10-24 8:29 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel, Jon Brenner - TAOS
On 10/23/13 22:51, Sebastian Reichel wrote:
> Add Device Tree support for the TSL2563 driver
> and document the binding.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> ---
> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> drivers/iio/light/tsl2563.c | 4 ++++
> 2 files changed, 23 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> new file mode 100644
> index 0000000..b52cf4b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> @@ -0,0 +1,19 @@
> +* TAOS TSL2563 ambient light sensor
> +
> +Required properties:
> +
> + - compatible : should be "taos,tsl2563"
> + - reg : the I2C address of the sensor
> +
> +Optional properties:
> +
So two options for this one. Either pitch it as a possible general parameter, or
mark it with a vendor prefix. It seems like something fairly general, but in that case it
probably needs a more detailed proposal and explanation of exactly what it is.
Also, is taos listed in vendor-prefixes.txt? Jon, is that the right vendor prefix to use?
I'm guessing you have some non mainline bindings out there already so it would be good
to match those...
> + - cover-comp-gain : integer used as multiplier for gain
> + compensation (default = 1)
> +
> +Example:
> +
> +tsl2563@29 {
> + compatible = "taos,tsl2563";
> + reg = <0x29>;
> + cover-comp-gain = <16>;
> +};
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index ebb962c..bd30b1d 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
> struct iio_dev *indio_dev;
> struct tsl2563_chip *chip;
> struct tsl2563_platform_data *pdata = client->dev.platform_data;
> + struct device_node *np = client->dev.of_node;
> int err = 0;
> u8 id = 0;
>
> @@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
>
> if (pdata)
> chip->cover_comp_gain = pdata->cover_comp_gain;
> + else if (np)
> + of_property_read_u32_index(np, "cover-comp-gain", 0,
> + &chip->cover_comp_gain);
> else
> chip->cover_comp_gain = 1;
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-24 8:29 ` Jonathan Cameron
@ 2013-10-24 13:43 ` Sebastian Reichel
2013-10-24 13:58 ` Jon Brenner
0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-24 13:43 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel, Jon Brenner - TAOS
[-- Attachment #1: Type: text/plain, Size: 1870 bytes --]
On Thu, Oct 24, 2013 at 09:29:42AM +0100, Jonathan Cameron wrote:
> On 10/23/13 22:51, Sebastian Reichel wrote:
> > Add Device Tree support for the TSL2563 driver
> > and document the binding.
> >
> > Signed-off-by: Sebastian Reichel <sre@debian.org>
> > ---
> > .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> > drivers/iio/light/tsl2563.c | 4 ++++
> > 2 files changed, 23 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
> >
> > diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> > new file mode 100644
> > index 0000000..b52cf4b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> > @@ -0,0 +1,19 @@
> > +* TAOS TSL2563 ambient light sensor
> > +
> > +Required properties:
> > +
> > + - compatible : should be "taos,tsl2563"
> > + - reg : the I2C address of the sensor
> > +
> > +Optional properties:
> > +
> So two options for this one. Either pitch it as a possible general parameter, or
> mark it with a vendor prefix. It seems like something fairly general, but in that case it
> probably needs a more detailed proposal and explanation of exactly what it is.
OK, I will add a vendor prefix in a PATCHv2. When I converted the driver
to DT I had a look how this is used and I don't think it's "fairly general".
> Also, is taos listed in vendor-prefixes.txt? Jon, is that the right vendor prefix to use?
> I'm guessing you have some non mainline bindings out there already so it would be good
> to match those...
taos is currently not listed in the vendor-prefixes.txt file. Also
it seems that "TAOS Inc." has been absorbed by "ams AG" in 2011.
So how to proceed with the patch?
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH] iio:light:tsl2563: Add DT support
2013-10-24 13:43 ` Sebastian Reichel
@ 2013-10-24 13:58 ` Jon Brenner
2013-10-24 15:13 ` Jonathan Cameron
0 siblings, 1 reply; 15+ messages in thread
From: Jon Brenner @ 2013-10-24 13:58 UTC (permalink / raw)
To: Sebastian Reichel, Jonathan Cameron
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel
AMS-TAOS
-----Original Message-----
From: Sebastian Reichel [mailto:sre@debian.org]
Sent: Thursday, October 24, 2013 8:43 AM
To: Jonathan Cameron
Cc: linux-iio@vger.kernel.org; Rob Herring; Pawel Moll; Mark Rutland; Stephen Warren; Ian Campbell; Rob Landley; Jonathan Cameron; Peter Meerwald; Greg Kroah-Hartman; Bill Pemberton; Sachin Kamat; devicetree@vger.kernel.org; linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org; Jon Brenner
Subject: Re: [PATCH] iio:light:tsl2563: Add DT support
On Thu, Oct 24, 2013 at 09:29:42AM +0100, Jonathan Cameron wrote:
> On 10/23/13 22:51, Sebastian Reichel wrote:
> > Add Device Tree support for the TSL2563 driver and document the
> > binding.
> >
> > Signed-off-by: Sebastian Reichel <sre@debian.org>
> > ---
> > .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> > drivers/iio/light/tsl2563.c | 4 ++++
> > 2 files changed, 23 insertions(+)
> > create mode 100644
> > Documentation/devicetree/bindings/iio/light/tsl2563.txt
> >
> > diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> > b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> > new file mode 100644
> > index 0000000..b52cf4b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> > @@ -0,0 +1,19 @@
> > +* TAOS TSL2563 ambient light sensor
> > +
> > +Required properties:
> > +
> > + - compatible : should be "taos,tsl2563"
> > + - reg : the I2C address of the sensor
> > +
> > +Optional properties:
> > +
> So two options for this one. Either pitch it as a possible general
> parameter, or mark it with a vendor prefix. It seems like something
> fairly general, but in that case it probably needs a more detailed proposal and explanation of exactly what it is.
OK, I will add a vendor prefix in a PATCHv2. When I converted the driver to DT I had a look how this is used and I don't think it's "fairly general".
> Also, is taos listed in vendor-prefixes.txt? Jon, is that the right vendor prefix to use?
> I'm guessing you have some non mainline bindings out there already so
> it would be good to match those...
taos is currently not listed in the vendor-prefixes.txt file. Also it seems that "TAOS Inc." has been absorbed by "ams AG" in 2011.
So how to proceed with the patch?
-- Sebastian
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCHv2] iio:light:tsl2563: Add DT support
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
2013-10-24 8:29 ` Jonathan Cameron
@ 2013-10-24 14:27 ` Sebastian Reichel
2013-10-25 3:32 ` Kumar Gala
2013-10-25 9:10 ` [PATCHv3] " Sebastian Reichel
2013-10-25 19:10 ` [PATCH] " Grant Likely
3 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-24 14:27 UTC (permalink / raw)
To: Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Sebastian Reichel,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
Add Device Tree support for the TSL2563 driver
and document the binding.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
.../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/iio/light/tsl2563.c | 4 ++++
3 files changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
new file mode 100644
index 0000000..f91e809
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
@@ -0,0 +1,19 @@
+* AMS TAOS TSL2563 ambient light sensor
+
+Required properties:
+
+ - compatible : should be "amstaos,tsl2563"
+ - reg : the I2C address of the sensor
+
+Optional properties:
+
+ - amstaos,cover-comp-gain : integer used as multiplier for gain
+ compensation (default = 1)
+
+Example:
+
+tsl2563@29 {
+ compatible = "amstaos,tsl2563";
+ reg = <0x29>;
+ amstaos,cover-comp-gain = <16>;
+};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2cc3dad..d26c834 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB
ak Asahi Kasei Corp.
altr Altera Corp.
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
+amstaos AMS Taos Inc.
apm Applied Micro Circuits Corporation (APM)
arm ARM Ltd.
atmel Atmel Corporation
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index ebb962c..261660a 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
struct iio_dev *indio_dev;
struct tsl2563_chip *chip;
struct tsl2563_platform_data *pdata = client->dev.platform_data;
+ struct device_node *np = client->dev.of_node;
int err = 0;
u8 id = 0;
@@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
if (pdata)
chip->cover_comp_gain = pdata->cover_comp_gain;
+ else if (np)
+ of_property_read_u32_index(np, "amstaos,cover-comp-gain", 0,
+ &chip->cover_comp_gain);
else
chip->cover_comp_gain = 1;
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-24 13:58 ` Jon Brenner
@ 2013-10-24 15:13 ` Jonathan Cameron
0 siblings, 0 replies; 15+ messages in thread
From: Jonathan Cameron @ 2013-10-24 15:13 UTC (permalink / raw)
To: Jon Brenner, Sebastian Reichel
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel
On 10/24/13 14:58, Jon Brenner wrote:
> AMS-TAOS
amstaos
so lowercase, and based on their being no other hyphenated
names (ST-Ericson is ste for example)
>
> -----Original Message-----
> From: Sebastian Reichel [mailto:sre@debian.org]
> Sent: Thursday, October 24, 2013 8:43 AM
> To: Jonathan Cameron
> Cc: linux-iio@vger.kernel.org; Rob Herring; Pawel Moll; Mark Rutland; Stephen Warren; Ian Campbell; Rob Landley; Jonathan Cameron; Peter Meerwald; Greg Kroah-Hartman; Bill Pemberton; Sachin Kamat; devicetree@vger.kernel.org; linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org; Jon Brenner
> Subject: Re: [PATCH] iio:light:tsl2563: Add DT support
>
> On Thu, Oct 24, 2013 at 09:29:42AM +0100, Jonathan Cameron wrote:
>> On 10/23/13 22:51, Sebastian Reichel wrote:
>>> Add Device Tree support for the TSL2563 driver and document the
>>> binding.
>>>
>>> Signed-off-by: Sebastian Reichel <sre@debian.org>
>>> ---
>>> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
>>> drivers/iio/light/tsl2563.c | 4 ++++
>>> 2 files changed, 23 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/iio/light/tsl2563.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt
>>> b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
>>> new file mode 100644
>>> index 0000000..b52cf4b
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
>>> @@ -0,0 +1,19 @@
>>> +* TAOS TSL2563 ambient light sensor
>>> +
>>> +Required properties:
>>> +
>>> + - compatible : should be "taos,tsl2563"
>>> + - reg : the I2C address of the sensor
>>> +
>>> +Optional properties:
>>> +
>> So two options for this one. Either pitch it as a possible general
>> parameter, or mark it with a vendor prefix. It seems like something
>> fairly general, but in that case it probably needs a more detailed proposal and explanation of exactly what it is.
>
> OK, I will add a vendor prefix in a PATCHv2. When I converted the driver to DT I had a look how this is used and I don't think it's "fairly general".
>
>> Also, is taos listed in vendor-prefixes.txt? Jon, is that the right vendor prefix to use?
>> I'm guessing you have some non mainline bindings out there already so
>> it would be good to match those...
>
> taos is currently not listed in the vendor-prefixes.txt file. Also it seems that "TAOS Inc." has been absorbed by "ams AG" in 2011.
> So how to proceed with the patch?
>
> -- Sebastian
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCHv2] iio:light:tsl2563: Add DT support
2013-10-24 14:27 ` [PATCHv2] " Sebastian Reichel
@ 2013-10-25 3:32 ` Kumar Gala
2013-10-25 8:23 ` Sebastian Reichel
0 siblings, 1 reply; 15+ messages in thread
From: Kumar Gala @ 2013-10-25 3:32 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, linux-iio, Rob Herring, Pawel Moll,
Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
Jonathan Cameron, Peter Meerwald, Greg Kroah-Hartman,
Bill Pemberton, Sachin Kamat, devicetree, linux-doc,
linux-kernel
On Oct 24, 2013, at 9:27 AM, Sebastian Reichel wrote:
> Add Device Tree support for the TSL2563 driver
> and document the binding.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> ---
> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> drivers/iio/light/tsl2563.c | 4 ++++
> 3 files changed, 24 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> new file mode 100644
> index 0000000..f91e809
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> @@ -0,0 +1,19 @@
> +* AMS TAOS TSL2563 ambient light sensor
> +
> +Required properties:
> +
> + - compatible : should be "amstaos,tsl2563"
> + - reg : the I2C address of the sensor
> +
> +Optional properties:
> +
> + - amstaos,cover-comp-gain : integer used as multiplier for gain
> + compensation (default = 1)
> +
> +Example:
> +
> +tsl2563@29 {
> + compatible = "amstaos,tsl2563";
> + reg = <0x29>;
> + amstaos,cover-comp-gain = <16>;
> +};
For the Binding, assuming another patch to add amstoas to the vendor list
Acked-by: Kumar Gala <galak@codeaurora.org>
- k
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCHv2] iio:light:tsl2563: Add DT support
2013-10-25 3:32 ` Kumar Gala
@ 2013-10-25 8:23 ` Sebastian Reichel
2013-10-25 8:37 ` Kumar Gala
0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-25 8:23 UTC (permalink / raw)
To: Kumar Gala
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
On Thu, Oct 24, 2013 at 10:32:36PM -0500, Kumar Gala wrote:
> On Oct 24, 2013, at 9:27 AM, Sebastian Reichel wrote:
> > Add Device Tree support for the TSL2563 driver
> > and document the binding.
> >
> > Signed-off-by: Sebastian Reichel <sre@debian.org>
> > ---
> > .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> > Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> > drivers/iio/light/tsl2563.c | 4 ++++
>
> For the Binding, assuming another patch to add amstoas to the vendor list
I embedded the vendor list update into this patch.
Should I split this into its own patch?
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCHv2] iio:light:tsl2563: Add DT support
2013-10-25 8:23 ` Sebastian Reichel
@ 2013-10-25 8:37 ` Kumar Gala
0 siblings, 0 replies; 15+ messages in thread
From: Kumar Gala @ 2013-10-25 8:37 UTC (permalink / raw)
To: Sebastian Reichel
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel
On Oct 25, 2013, at 3:23 AM, Sebastian Reichel wrote:
> On Thu, Oct 24, 2013 at 10:32:36PM -0500, Kumar Gala wrote:
>> On Oct 24, 2013, at 9:27 AM, Sebastian Reichel wrote:
>>> Add Device Tree support for the TSL2563 driver
>>> and document the binding.
>>>
>>> Signed-off-by: Sebastian Reichel <sre@debian.org>
>>> ---
>>> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
>>> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
>>> drivers/iio/light/tsl2563.c | 4 ++++
>>
>> For the Binding, assuming another patch to add amstoas to the vendor list
>
> I embedded the vendor list update into this patch.
> Should I split this into its own patch?
>
> -- Sebastian
Its fine, but do update the commit comment about that.
- k
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCHv3] iio:light:tsl2563: Add DT support
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
2013-10-24 8:29 ` Jonathan Cameron
2013-10-24 14:27 ` [PATCHv2] " Sebastian Reichel
@ 2013-10-25 9:10 ` Sebastian Reichel
2013-11-23 11:52 ` Jonathan Cameron
2013-10-25 19:10 ` [PATCH] " Grant Likely
3 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-25 9:10 UTC (permalink / raw)
To: Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Kumar Gala,
Sebastian Reichel, Peter Meerwald, Greg Kroah-Hartman,
Bill Pemberton, Sachin Kamat, devicetree, linux-doc,
linux-kernel
Add Device Tree support for the TSL2563 driver,
document the binding and add AMS-TAOS Inc. to the
list of vendor prefixes.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Kumar Gala <galak@codeaurora.org>
---
.../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/iio/light/tsl2563.c | 4 ++++
3 files changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
new file mode 100644
index 0000000..f91e809
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
@@ -0,0 +1,19 @@
+* AMS TAOS TSL2563 ambient light sensor
+
+Required properties:
+
+ - compatible : should be "amstaos,tsl2563"
+ - reg : the I2C address of the sensor
+
+Optional properties:
+
+ - amstaos,cover-comp-gain : integer used as multiplier for gain
+ compensation (default = 1)
+
+Example:
+
+tsl2563@29 {
+ compatible = "amstaos,tsl2563";
+ reg = <0x29>;
+ amstaos,cover-comp-gain = <16>;
+};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 2cc3dad..8cf3edf 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB
ak Asahi Kasei Corp.
altr Altera Corp.
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
+amstaos AMS-Taos Inc.
apm Applied Micro Circuits Corporation (APM)
arm ARM Ltd.
atmel Atmel Corporation
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index ebb962c..261660a 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
struct iio_dev *indio_dev;
struct tsl2563_chip *chip;
struct tsl2563_platform_data *pdata = client->dev.platform_data;
+ struct device_node *np = client->dev.of_node;
int err = 0;
u8 id = 0;
@@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
if (pdata)
chip->cover_comp_gain = pdata->cover_comp_gain;
+ else if (np)
+ of_property_read_u32_index(np, "amstaos,cover-comp-gain", 0,
+ &chip->cover_comp_gain);
else
chip->cover_comp_gain = 1;
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
` (2 preceding siblings ...)
2013-10-25 9:10 ` [PATCHv3] " Sebastian Reichel
@ 2013-10-25 19:10 ` Grant Likely
2013-10-25 23:09 ` Sebastian Reichel
3 siblings, 1 reply; 15+ messages in thread
From: Grant Likely @ 2013-10-25 19:10 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Sebastian Reichel,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
On Wed, 23 Oct 2013 23:51:03 +0200, Sebastian Reichel <sre@debian.org> wrote:
> Add Device Tree support for the TSL2563 driver
> and document the binding.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> ---
> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> drivers/iio/light/tsl2563.c | 4 ++++
> 2 files changed, 23 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> new file mode 100644
> index 0000000..b52cf4b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> @@ -0,0 +1,19 @@
> +* TAOS TSL2563 ambient light sensor
> +
> +Required properties:
> +
> + - compatible : should be "taos,tsl2563"
> + - reg : the I2C address of the sensor
> +
> +Optional properties:
> +
> + - cover-comp-gain : integer used as multiplier for gain
> + compensation (default = 1)
Should be taos,cover-comp-gain
Otherwise looks fine to me.
> +
> +Example:
> +
> +tsl2563@29 {
> + compatible = "taos,tsl2563";
> + reg = <0x29>;
> + cover-comp-gain = <16>;
> +};
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index ebb962c..bd30b1d 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
> struct iio_dev *indio_dev;
> struct tsl2563_chip *chip;
> struct tsl2563_platform_data *pdata = client->dev.platform_data;
> + struct device_node *np = client->dev.of_node;
> int err = 0;
> u8 id = 0;
>
> @@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
>
> if (pdata)
> chip->cover_comp_gain = pdata->cover_comp_gain;
> + else if (np)
> + of_property_read_u32_index(np, "cover-comp-gain", 0,
> + &chip->cover_comp_gain);
of_property_read_u32() should be sufficient. You don't need the _index
variant.
> else
> chip->cover_comp_gain = 1;
>
> --
> 1.8.4.rc3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-25 19:10 ` [PATCH] " Grant Likely
@ 2013-10-25 23:09 ` Sebastian Reichel
2013-11-23 11:50 ` Jonathan Cameron
0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Reichel @ 2013-10-25 23:09 UTC (permalink / raw)
To: Grant Likely
Cc: linux-iio, Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Peter Meerwald,
Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat, devicetree,
linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
Hi Grant,
On Fri, Oct 25, 2013 at 08:10:28PM +0100, Grant Likely wrote:
> > + - cover-comp-gain : integer used as multiplier for gain
> > + compensation (default = 1)
>
> Should be taos,cover-comp-gain
Has been updated to "amstaos,cover-comp-gain" in the latest
patches, see https://lkml.org/lkml/2013/10/25/59
> Otherwise looks fine to me.
Is this an acked-by?
> > + else if (np)
> > + of_property_read_u32_index(np, "cover-comp-gain", 0,
> > + &chip->cover_comp_gain);
>
> of_property_read_u32() should be sufficient. You don't need the _index
> variant.
ah, I missed the function when skipping over linux/of.h.
I will sent another update.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-10-25 23:09 ` Sebastian Reichel
@ 2013-11-23 11:50 ` Jonathan Cameron
2013-11-23 12:06 ` Sebastian Reichel
0 siblings, 1 reply; 15+ messages in thread
From: Jonathan Cameron @ 2013-11-23 11:50 UTC (permalink / raw)
To: Grant Likely, linux-iio, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Rob Landley, Jonathan Cameron,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/26/13 00:09, Sebastian Reichel wrote:
> Hi Grant,
>
> On Fri, Oct 25, 2013 at 08:10:28PM +0100, Grant Likely wrote:
>>> + - cover-comp-gain : integer used as multiplier for gain + compensation (default = 1)
>>
>> Should be taos,cover-comp-gain
>
> Has been updated to "amstaos,cover-comp-gain" in the latest patches, see https://lkml.org/lkml/2013/10/25/59
>
>> Otherwise looks fine to me.
>
> Is this an acked-by?
It's good enough for me to take the patch :)
>
>>> + else if (np) + of_property_read_u32_index(np, "cover-comp-gain", 0, + &chip->cover_comp_gain);
>>
>> of_property_read_u32() should be sufficient. You don't need the _index variant.
>
> ah, I missed the function when skipping over linux/of.h. I will sent another update.
Did you do this? Latest I seem to have is V3 and that doesn't have
this change. I've made the obvious change to your V3 and applied it.
Thanks,
Jonathan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJSkJaFAAoJEFSFNJnE9BaI3MAP/RJhSwcTn54E2bOwPzipVbFY
mEBHnth2qNFTv2xrDobI1xDKaaBWzDdnuYHfNmUshO8rJMFv7UgLWIOhSRlSues9
RHindDLt2t4xl9F2PufQDe66RFzcchqe6PB0+PxwKdSt/tVArP0UnPInMM2vCrqD
k5HPhHgrkbNgBp4y2GyMjnYyQ4bbh+/bUBNQZ+9z0DD7vYqJXqzhywMPnfidM6i5
M5+Fp2COuoJuD4lUI+ccxQVdPYmDiPXPbj95JI8wFebcNie3vyyrkKCfeLm87by9
sK9jEm3n3IGUFOi4w4/7ToMtY/DmLdyhHvRmmnHvD1n4D0VZYVeRZmBeyNyIGv9s
qXpasLgDbFrd1OEQwwYVMCoG6NKqvb67XCS1h58MAQqKnwq6PvQJGIFEFw7raiit
bumIIwkiYqyqHEoLA34fG1Y9eB9SoMfMtMelzwGBty65kDzEy/9rl1nK4Z7lVguj
O1+oMPOW3vK8UiOQ71MqZGd0bqOx0axQDbPMhXt4jo98vNFmNZ8Jboaof7cmJ38R
eDtCZ4YfbtUXdSTqnGN1GLnxexAdja8HbnKKQfR6oN+Oy7o4cqFsTdj+TsL2+4/R
EAhNZSWQm2R8QTyETwL9n/F9vRTQWT8B3kcWGY3qhepnQzWD4k5neGOBFe3kUQQ6
EvUmHyPCWeCmqcnlgoZz
=f7mV
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCHv3] iio:light:tsl2563: Add DT support
2013-10-25 9:10 ` [PATCHv3] " Sebastian Reichel
@ 2013-11-23 11:52 ` Jonathan Cameron
0 siblings, 0 replies; 15+ messages in thread
From: Jonathan Cameron @ 2013-11-23 11:52 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, linux-iio
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Jonathan Cameron, Kumar Gala,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
On 10/25/13 10:10, Sebastian Reichel wrote:
> Add Device Tree support for the TSL2563 driver,
> document the binding and add AMS-TAOS Inc. to the
> list of vendor prefixes.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Kumar Gala <galak@codeaurora.org>
Applied to the togreg branch of iio.git with the minor change Grant pointed out
to not use the indexed version of the of_property_read_u32
Thanks all,
Jonathan
> ---
> .../devicetree/bindings/iio/light/tsl2563.txt | 19 +++++++++++++++++++
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> drivers/iio/light/tsl2563.c | 4 ++++
> 3 files changed, 24 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2563.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> new file mode 100644
> index 0000000..f91e809
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
> @@ -0,0 +1,19 @@
> +* AMS TAOS TSL2563 ambient light sensor
> +
> +Required properties:
> +
> + - compatible : should be "amstaos,tsl2563"
> + - reg : the I2C address of the sensor
> +
> +Optional properties:
> +
> + - amstaos,cover-comp-gain : integer used as multiplier for gain
> + compensation (default = 1)
> +
> +Example:
> +
> +tsl2563@29 {
> + compatible = "amstaos,tsl2563";
> + reg = <0x29>;
> + amstaos,cover-comp-gain = <16>;
> +};
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
> index 2cc3dad..8cf3edf 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB
> ak Asahi Kasei Corp.
> altr Altera Corp.
> amcc Applied Micro Circuits Corporation (APM, formally AMCC)
> +amstaos AMS-Taos Inc.
> apm Applied Micro Circuits Corporation (APM)
> arm ARM Ltd.
> atmel Atmel Corporation
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index ebb962c..261660a 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -699,6 +699,7 @@ static int tsl2563_probe(struct i2c_client *client,
> struct iio_dev *indio_dev;
> struct tsl2563_chip *chip;
> struct tsl2563_platform_data *pdata = client->dev.platform_data;
> + struct device_node *np = client->dev.of_node;
> int err = 0;
> u8 id = 0;
>
> @@ -735,6 +736,9 @@ static int tsl2563_probe(struct i2c_client *client,
>
> if (pdata)
> chip->cover_comp_gain = pdata->cover_comp_gain;
> + else if (np)
> + of_property_read_u32_index(np, "amstaos,cover-comp-gain", 0,
> + &chip->cover_comp_gain);
> else
> chip->cover_comp_gain = 1;
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] iio:light:tsl2563: Add DT support
2013-11-23 11:50 ` Jonathan Cameron
@ 2013-11-23 12:06 ` Sebastian Reichel
0 siblings, 0 replies; 15+ messages in thread
From: Sebastian Reichel @ 2013-11-23 12:06 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Grant Likely, linux-iio, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Rob Landley, Jonathan Cameron,
Peter Meerwald, Greg Kroah-Hartman, Bill Pemberton, Sachin Kamat,
devicetree, linux-doc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]
On Sat, Nov 23, 2013 at 11:50:29AM +0000, Jonathan Cameron wrote:
> On 10/26/13 00:09, Sebastian Reichel wrote:
> > Hi Grant,
> >
> > On Fri, Oct 25, 2013 at 08:10:28PM +0100, Grant Likely wrote:
> >>> + - cover-comp-gain : integer used as multiplier for gain + compensation (default = 1)
> >>
> >> Should be taos,cover-comp-gain
> >
> > Has been updated to "amstaos,cover-comp-gain" in the latest patches, see https://lkml.org/lkml/2013/10/25/59
> >
> >> Otherwise looks fine to me.
> >
> > Is this an acked-by?
> It's good enough for me to take the patch :)
> >
> >>> + else if (np) + of_property_read_u32_index(np, "cover-comp-gain", 0, + &chip->cover_comp_gain);
> >>
> >> of_property_read_u32() should be sufficient. You don't need the _index variant.
> >
> > ah, I missed the function when skipping over linux/of.h. I will sent another update.
>
> Did you do this? Latest I seem to have is V3 and that doesn't have
> this change.
Sorry, I forgot, that I still had work to do for this patch :(
> I've made the obvious change to your V3 and applied it.
Thanks for taking care of it.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-11-23 12:06 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
2013-10-24 8:29 ` Jonathan Cameron
2013-10-24 13:43 ` Sebastian Reichel
2013-10-24 13:58 ` Jon Brenner
2013-10-24 15:13 ` Jonathan Cameron
2013-10-24 14:27 ` [PATCHv2] " Sebastian Reichel
2013-10-25 3:32 ` Kumar Gala
2013-10-25 8:23 ` Sebastian Reichel
2013-10-25 8:37 ` Kumar Gala
2013-10-25 9:10 ` [PATCHv3] " Sebastian Reichel
2013-11-23 11:52 ` Jonathan Cameron
2013-10-25 19:10 ` [PATCH] " Grant Likely
2013-10-25 23:09 ` Sebastian Reichel
2013-11-23 11:50 ` Jonathan Cameron
2013-11-23 12:06 ` 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).