All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Sean Nyekjaer <sean.nyekjaer@prevas.dk>, linux-iio@vger.kernel.org
Cc: devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: ad5755: add support for dt bindings
Date: Tue, 2 Feb 2016 16:33:00 +0100	[thread overview]
Message-ID: <56B0CC2C.6020809@metafoo.de> (raw)
In-Reply-To: <1454416574-6645-1-git-send-email-sean.nyekjaer@prevas.dk>

On 02/02/2016 01:36 PM, Sean Nyekjaer wrote:
> Still missing a way to provide default modes and settings
> for the driver from dt, but I see this as a start.
> 
> Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>

Hi,

Thanks for the patch.

> ---
>  drivers/iio/dac/ad5755.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
> index bfb350a..e1b6e78 100644
> --- a/drivers/iio/dac/ad5755.c
> +++ b/drivers/iio/dac/ad5755.c
> @@ -607,6 +607,16 @@ static const struct spi_device_id ad5755_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad5755_id);
>  
> +static const struct of_device_id ad5755_of_match[] = {
> +	{ .compatible = "adi,ad5755" },
> +	{ .compatible = "adi,ad5755-1" },
> +	{ .compatible = "adi,ad5757" },
> +	{ .compatible = "adi,ad5735" },
> +	{ .compatible = "adi,ad5737" },

This needs to set the ID for the device type, so that the driver gets
instantiated for the correct devicetype. And in the probe function check if
the driver was probed via DT (by checking spi->dev.of_node) and if it does
get the ID from the of_device_id rather the spi_device_id.

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, ad5755_of_match);
> +
>  static struct spi_driver ad5755_driver = {
>  	.driver = {
>  		.name = "ad5755",
> 


WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Sean Nyekjaer
	<sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] iio: ad5755: add support for dt bindings
Date: Tue, 2 Feb 2016 16:33:00 +0100	[thread overview]
Message-ID: <56B0CC2C.6020809@metafoo.de> (raw)
In-Reply-To: <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>

On 02/02/2016 01:36 PM, Sean Nyekjaer wrote:
> Still missing a way to provide default modes and settings
> for the driver from dt, but I see this as a start.
> 
> Signed-off-by: Sean Nyekjaer <sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>

Hi,

Thanks for the patch.

> ---
>  drivers/iio/dac/ad5755.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
> index bfb350a..e1b6e78 100644
> --- a/drivers/iio/dac/ad5755.c
> +++ b/drivers/iio/dac/ad5755.c
> @@ -607,6 +607,16 @@ static const struct spi_device_id ad5755_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad5755_id);
>  
> +static const struct of_device_id ad5755_of_match[] = {
> +	{ .compatible = "adi,ad5755" },
> +	{ .compatible = "adi,ad5755-1" },
> +	{ .compatible = "adi,ad5757" },
> +	{ .compatible = "adi,ad5735" },
> +	{ .compatible = "adi,ad5737" },

This needs to set the ID for the device type, so that the driver gets
instantiated for the correct devicetype. And in the probe function check if
the driver was probed via DT (by checking spi->dev.of_node) and if it does
get the ID from the of_device_id rather the spi_device_id.

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, ad5755_of_match);
> +
>  static struct spi_driver ad5755_driver = {
>  	.driver = {
>  		.name = "ad5755",
> 

  parent reply	other threads:[~2016-02-02 15:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 12:36 [PATCH 1/2] iio: ad5755: add support for dt bindings Sean Nyekjaer
2016-02-02 12:36 ` Sean Nyekjaer
2016-02-02 12:36 ` [PATCH 2/2] iio: ad5755: Add DT binding documentation Sean Nyekjaer
2016-02-02 12:36   ` Sean Nyekjaer
2016-02-02 21:55   ` Rob Herring
2016-02-02 21:55     ` Rob Herring
2016-02-02 15:33 ` Lars-Peter Clausen [this message]
2016-02-02 15:33   ` [PATCH 1/2] iio: ad5755: add support for dt bindings Lars-Peter Clausen
2016-02-02 15:57   ` Sean Nyekjær
2016-02-02 15:57     ` Sean Nyekjær
2016-02-02 16:37     ` Lars-Peter Clausen
2016-02-02 16:37       ` Lars-Peter Clausen
2016-02-03  9:29       ` Sean Nyekjær
2016-02-03  9:29         ` Sean Nyekjær

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=56B0CC2C.6020809@metafoo.de \
    --to=lars@metafoo.de \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=sean.nyekjaer@prevas.dk \
    /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.