All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sebastian Reichel <sre@debian.org>,
	Sebastian Reichel <sre@ring0.de>,
	linux-iio@vger.kernel.org
Cc: Rob Herring <rob.herring@calxeda.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Landley <rob@landley.net>, Jonathan Cameron <jic23@cam.ac.uk>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bill Pemberton <wfp5p@virginia.edu>,
	Sachin Kamat <sachin.kamat@linaro.org>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jon Brenner - TAOS <jbrenner@taosinc.com>
Subject: Re: [PATCH] iio:light:tsl2563: Add DT support
Date: Thu, 24 Oct 2013 09:29:42 +0100	[thread overview]
Message-ID: <5268DA76.6060503@kernel.org> (raw)
In-Reply-To: <1382565063-17083-1-git-send-email-sre@debian.org>

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;
>  
> 

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>,
	Sebastian Reichel <sre-GFxCN5SEZAc@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Rob Landley <rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>,
	Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>,
	Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Bill Pemberton <wfp5p-4Ng6DfrEGID2fBVCVOL8/A@public.gmane.org>,
	Sachin Kamat
	<sachin.kamat-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jon Brenner - TAOS
	<jbrenner-yYKgigLBUwlBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH] iio:light:tsl2563: Add DT support
Date: Thu, 24 Oct 2013 09:29:42 +0100	[thread overview]
Message-ID: <5268DA76.6060503@kernel.org> (raw)
In-Reply-To: <1382565063-17083-1-git-send-email-sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>

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-8fiUuRrzOP0dnm+yROfE0A@public.gmane.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;
>  
> 

  reply	other threads:[~2013-10-24  7:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 21:51 [PATCH] iio:light:tsl2563: Add DT support Sebastian Reichel
2013-10-24  8:29 ` Jonathan Cameron [this message]
2013-10-24  8:29   ` Jonathan Cameron
2013-10-24 13:43   ` Sebastian Reichel
2013-10-24 13:43     ` Sebastian Reichel
2013-10-24 13:58     ` Jon Brenner
2013-10-24 15:13       ` Jonathan Cameron
2013-10-24 15:13         ` Jonathan Cameron
2013-10-24 14:27 ` [PATCHv2] " Sebastian Reichel
2013-10-24 14:27   ` Sebastian Reichel
2013-10-25  3:32   ` Kumar Gala
2013-10-25  3:32     ` Kumar Gala
2013-10-25  8:23     ` Sebastian Reichel
2013-10-25  8:37       ` Kumar Gala
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 19:10   ` Grant Likely
2013-10-25 23:09   ` Sebastian Reichel
2013-10-25 23:09     ` Sebastian Reichel
2013-11-23 11:50     ` Jonathan Cameron
2013-11-23 12:06       ` Sebastian Reichel
2013-11-23 12:06         ` Sebastian Reichel

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=5268DA76.6060503@kernel.org \
    --to=jic23@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jbrenner@taosinc.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=sachin.kamat@linaro.org \
    --cc=sre@debian.org \
    --cc=sre@ring0.de \
    --cc=swarren@wwwdotorg.org \
    --cc=wfp5p@virginia.edu \
    /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.