All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, David Lechner <david@lechnology.com>
Subject: Re: [PATCH v2 2/2] iio: adc: ti-ads7950: Add OF device ID table
Date: Wed, 9 Aug 2017 14:26:56 +0100	[thread overview]
Message-ID: <20170809142656.27f1a897@archlinux> (raw)
In-Reply-To: <1501602538.29303.333.camel@linux.intel.com>

On Tue, 01 Aug 2017 18:48:58 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Sat, 2017-07-29 at 01:20 +0300, Andy Shevchenko wrote:
> > The driver doesn't have a struct of_device_id table but supported
> > devices
> > are registered via Device Trees. This is working on the assumption
> > that a
> > SPI device registered via OF will always match a legacy SPI device ID
> > and
> > that the MODALIAS reported will always be of the form spi:<device>.
> > 
> > There is an ACPI method to enumerate such devices via specific ACPI ID
> > and use of compatible strings. It will not work for the drivers which
> > have no OF match ID table present.
> > 
> > Besides this could change in the future so the correct approach is to
> > have an OF device ID table if the devices are registered via OF.
> >   
> 
> Btw, this patch can be applied independently.
> 
> For ACPI case both of them are needed, and order doesn't matter.
Good point.  Applied. 

Thanks,

Jonathan
> 
> > Tested-by: David Lechner <david@lechnology.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/iio/adc/ti-ads7950.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-
> > ads7950.c
> > index ab669af291b7..a376190914ad 100644
> > --- a/drivers/iio/adc/ti-ads7950.c
> > +++ b/drivers/iio/adc/ti-ads7950.c
> > @@ -491,9 +491,27 @@ static const struct spi_device_id ti_ads7950_id[]
> > = {
> >  };
> >  MODULE_DEVICE_TABLE(spi, ti_ads7950_id);
> >  
> > +static const struct of_device_id ads7950_of_table[] = {
> > +	{ .compatible = "ti,ads7950", .data =
> > &ti_ads7950_chip_info[TI_ADS7950] },
> > +	{ .compatible = "ti,ads7951", .data =
> > &ti_ads7950_chip_info[TI_ADS7951] },
> > +	{ .compatible = "ti,ads7952", .data =
> > &ti_ads7950_chip_info[TI_ADS7952] },
> > +	{ .compatible = "ti,ads7953", .data =
> > &ti_ads7950_chip_info[TI_ADS7953] },
> > +	{ .compatible = "ti,ads7954", .data =
> > &ti_ads7950_chip_info[TI_ADS7954] },
> > +	{ .compatible = "ti,ads7955", .data =
> > &ti_ads7950_chip_info[TI_ADS7955] },
> > +	{ .compatible = "ti,ads7956", .data =
> > &ti_ads7950_chip_info[TI_ADS7956] },
> > +	{ .compatible = "ti,ads7957", .data =
> > &ti_ads7950_chip_info[TI_ADS7957] },
> > +	{ .compatible = "ti,ads7958", .data =
> > &ti_ads7950_chip_info[TI_ADS7958] },
> > +	{ .compatible = "ti,ads7959", .data =
> > &ti_ads7950_chip_info[TI_ADS7959] },
> > +	{ .compatible = "ti,ads7960", .data =
> > &ti_ads7950_chip_info[TI_ADS7960] },
> > +	{ .compatible = "ti,ads7961", .data =
> > &ti_ads7950_chip_info[TI_ADS7961] },
> > +	{ },
> > +};
> > +MODULE_DEVICE_TABLE(of, ads7950_of_table);
> > +
> >  static struct spi_driver ti_ads7950_driver = {
> >  	.driver = {
> >  		.name	= "ads7950",
> > +		.of_match_table = ads7950_of_table,
> >  	},
> >  	.probe		= ti_ads7950_probe,
> >  	.remove		= ti_ads7950_remove,  
> 


      reply	other threads:[~2017-08-09 13:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 22:20 [PATCH v2 0/2] iio: ti-ads7950: Make it working on ACPI platforms Andy Shevchenko
2017-07-28 22:20 ` [PATCH v2 1/2] iio: adc: ti-ads7950: Allow to use " Andy Shevchenko
2017-07-30  1:27   ` David Lechner
2017-07-30 13:31     ` Jonathan Cameron
2017-08-01 15:45       ` Andy Shevchenko
2017-08-01 16:21         ` David Lechner
2017-08-01 16:41           ` Andy Shevchenko
2017-08-01 17:09             ` David Lechner
2017-08-01 17:44               ` Andy Shevchenko
2017-08-01 17:15             ` David Lechner
2017-08-01 17:24               ` Andy Shevchenko
2017-08-09 13:24                 ` Jonathan Cameron
2017-08-13 14:25                   ` Andy Shevchenko
2017-08-20 10:48                     ` Jonathan Cameron
2017-07-28 22:20 ` [PATCH v2 2/2] iio: adc: ti-ads7950: Add OF device ID table Andy Shevchenko
2017-08-01 15:48   ` Andy Shevchenko
2017-08-09 13:26     ` Jonathan Cameron [this message]

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=20170809142656.27f1a897@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=david@lechnology.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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.