Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1311675
| From | Johan Hovold <johan@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver |
| Date | 2016-01-18 18:00 +0100 |
| Message-ID | <qSljS-3pb-47@gated-at.bofh.it> (permalink) |
| References | <qSknL-2GX-5@gated-at.bofh.it> <qSknL-2GX-3@gated-at.bofh.it> <qSkH8-33d-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jan 18, 2016 at 05:14:42PM +0100, Michael Trimarchi wrote:
> Hi
>
> On Mon, Jan 18, 2016 at 4:57 PM, Jacob Siverskog
> <jacob@teenage.engineering> wrote:
> > The PCM179x family supports both SPI and I2C. This patch adds support
> > for the I2C interface.
> >
> > Reviewed-by: Johan Hovold <johan@kernel.org>
> > Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
> > ---
> > +const struct of_device_id pcm179x_of_match[] = {
> > + { .compatible = "ti,pcm1792a", },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, pcm179x_of_match);
> > +
>
> can match go in the common part?
For matching purposes it could, but that would prevent the OF-aliases
from being defined for the driver modules.
There are a couple of codec drivers that have taken this route, and it
works as long as they also define a legacy (e.g. i2c_device_id) table
that modalias autoloading can fall back to.
But having having the common module carry the OF-aliases does not seem
like the right thing to do (e.g. as the common module cannot drive
anything on its own) even if it avoids a copy of the OF id table.
> > +static const struct i2c_device_id pcm179x_i2c_ids[] = {
> > + { "pcm179x", 0 },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(i2c, pcm179x_i2c_ids);
> > +
> > +static struct i2c_driver pcm179x_i2c_driver = {
> > + .driver = {
> > + .name = "pcm179x",
> > + .of_match_table = of_match_ptr(pcm179x_of_match),
> > + },
> > + .id_table = pcm179x_i2c_ids,
> > + .probe = pcm179x_i2c_probe,
> > + .remove = pcm179x_i2c_remove,
> > +};
> > +
> > +module_i2c_driver(pcm179x_i2c_driver);
Thanks,
Johan
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Jacob Siverskog <jacob@teenage.engineering> - 2016-01-18 17:00 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Michael Trimarchi <michael@amarulasolutions.com> - 2016-01-18 17:20 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Johan Hovold <johan@kernel.org> - 2016-01-18 18:00 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Mark Brown <broonie@kernel.org> - 2016-01-19 13:30 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Johan Hovold <johan@kernel.org> - 2016-01-19 15:20 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Mark Brown <broonie@kernel.org> - 2016-01-19 17:40 +0100
Re: [PATCH 2/3] ASoC: pcm179x: Add I2C interface driver Johan Hovold <johan@kernel.org> - 2016-01-21 12:00 +0100
csiph-web