* [PATCH 1/2] iio: ad5755: add support for dt bindings @ 2016-02-02 12:36 Sean Nyekjaer [not found] ` <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Sean Nyekjaer @ 2016-02-02 12:36 UTC (permalink / raw) To: linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: Sean Nyekjaer, devicetree-u79uwXL29TY76Z2rM5mHXA 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> --- 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" }, + { } +}; +MODULE_DEVICE_TABLE(of, ad5755_of_match); + static struct spi_driver ad5755_driver = { .driver = { .name = "ad5755", -- 2.7.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>]
* [PATCH 2/2] iio: ad5755: Add DT binding documentation [not found] ` <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> @ 2016-02-02 12:36 ` Sean Nyekjaer [not found] ` <1454416574-6645-2-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-02 15:33 ` [PATCH 1/2] iio: ad5755: add support for dt bindings Lars-Peter Clausen 1 sibling, 1 reply; 7+ messages in thread From: Sean Nyekjaer @ 2016-02-02 12:36 UTC (permalink / raw) To: linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: Sean Nyekjaer, devicetree-u79uwXL29TY76Z2rM5mHXA Signed-off-by: Sean Nyekjaer <sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> --- .../devicetree/bindings/iio/dac/ad5755.txt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/dac/ad5755.txt diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt new file mode 100644 index 0000000..4c91583 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/dac/ad5755.txt @@ -0,0 +1,24 @@ +* Analog Device AD5755 IIO Multi-Channel DAC Linux Driver + +Required properties: + - compatible: Has to contain one of the following: + adi,ad5755 + adi,ad5755-1 + adi,ad5757 + adi,ad5735 + adi,ad5737 + + - reg: spi chip select number for the device + - spi-cpha or spi-cpol: is the only modes that is supported + +Recommended properties: + - spi-max-frequency: Definition as per + Documentation/devicetree/bindings/spi/spi-bus.txt + +Example: +dac@0 { + compatible = "adi,ad5755"; + reg = <0>; + spi-max-frequency = <1000000>; + spi-cpha; +}; -- 2.7.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <1454416574-6645-2-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>]
* Re: [PATCH 2/2] iio: ad5755: Add DT binding documentation [not found] ` <1454416574-6645-2-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> @ 2016-02-02 21:55 ` Rob Herring 0 siblings, 0 replies; 7+ messages in thread From: Rob Herring @ 2016-02-02 21:55 UTC (permalink / raw) To: Sean Nyekjaer Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA On Tue, Feb 02, 2016 at 01:36:14PM +0100, Sean Nyekjaer wrote: > Signed-off-by: Sean Nyekjaer <sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> > --- > .../devicetree/bindings/iio/dac/ad5755.txt | 24 ++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/dac/ad5755.txt Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] iio: ad5755: add support for dt bindings [not found] ` <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-02 12:36 ` [PATCH 2/2] iio: ad5755: Add DT binding documentation Sean Nyekjaer @ 2016-02-02 15:33 ` Lars-Peter Clausen [not found] ` <56B0CC2C.6020809-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> 1 sibling, 1 reply; 7+ messages in thread From: Lars-Peter Clausen @ 2016-02-02 15:33 UTC (permalink / raw) To: Sean Nyekjaer, linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: devicetree-u79uwXL29TY76Z2rM5mHXA 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", > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <56B0CC2C.6020809-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>]
* Re: [PATCH 1/2] iio: ad5755: add support for dt bindings [not found] ` <56B0CC2C.6020809-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> @ 2016-02-02 15:57 ` Sean Nyekjær [not found] ` <56B0D203.3050905-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Sean Nyekjær @ 2016-02-02 15:57 UTC (permalink / raw) To: Lars-Peter Clausen, linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: devicetree-u79uwXL29TY76Z2rM5mHXA On 2016-02-02 16:33, Lars-Peter Clausen wrote: > 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. I was planning on doing that. And I was experimenting with providing modes and settings for every channel from the dt. Is the DAC the only output devices in IIO? I will send an proposal tomorrow :-) And thereby (maybe) pave the way for the runtime mode switching Should we drop the platform data support and only rely on dt? > >> + { } >> +}; >> +MODULE_DEVICE_TABLE(of, ad5755_of_match); >> + >> static struct spi_driver ad5755_driver = { >> .driver = { >> .name = "ad5755", >> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <56B0D203.3050905-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org>]
* Re: [PATCH 1/2] iio: ad5755: add support for dt bindings [not found] ` <56B0D203.3050905-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> @ 2016-02-02 16:37 ` Lars-Peter Clausen [not found] ` <56B0DB5E.7060608-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Lars-Peter Clausen @ 2016-02-02 16:37 UTC (permalink / raw) To: Sean Nyekjær, linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: devicetree-u79uwXL29TY76Z2rM5mHXA On 02/02/2016 04:57 PM, Sean Nyekjær wrote: > > > On 2016-02-02 16:33, Lars-Peter Clausen wrote: >> 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. > I was planning on doing that. > And I was experimenting with providing modes and settings for every channel > from the dt. > Is the DAC the only output devices in IIO? There is also support for programmable potentiometers (sometimes called RDAC), but that's it. > > I will send an proposal tomorrow :-) And thereby (maybe) pave the way for > the runtime mode switching > > Should we drop the platform data support and only rely on dt? No, there might still be some people depending on it. I don't think the burden of continuing to maintain the platform data support is that high. - Lars ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <56B0DB5E.7060608-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>]
* Re: [PATCH 1/2] iio: ad5755: add support for dt bindings [not found] ` <56B0DB5E.7060608-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> @ 2016-02-03 9:29 ` Sean Nyekjær 0 siblings, 0 replies; 7+ messages in thread From: Sean Nyekjær @ 2016-02-03 9:29 UTC (permalink / raw) To: Lars-Peter Clausen, linux-iio-u79uwXL29TY76Z2rM5mHXA Cc: devicetree-u79uwXL29TY76Z2rM5mHXA On 2016-02-02 17:37, Lars-Peter Clausen wrote: > On 02/02/2016 04:57 PM, Sean Nyekjær wrote: >> >> On 2016-02-02 16:33, Lars-Peter Clausen wrote: >>> 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. If I probe the driver via DT the spi_get_device_id(spi)->driver_data returns the type... So this works as it is :-) I'll continue with the proposal... >> I was planning on doing that. >> And I was experimenting with providing modes and settings for every channel >> from the dt. >> Is the DAC the only output devices in IIO? > There is also support for programmable potentiometers (sometimes called > RDAC), but that's it. > >> I will send an proposal tomorrow :-) And thereby (maybe) pave the way for >> the runtime mode switching >> >> Should we drop the platform data support and only rely on dt? > No, there might still be some people depending on it. I don't think the > burden of continuing to maintain the platform data support is that high. > > - Lars ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-02-03 9:29 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-02-02 12:36 [PATCH 1/2] iio: ad5755: add support for dt bindings Sean Nyekjaer [not found] ` <1454416574-6645-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-02 12:36 ` [PATCH 2/2] iio: ad5755: Add DT binding documentation Sean Nyekjaer [not found] ` <1454416574-6645-2-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-02 21:55 ` Rob Herring 2016-02-02 15:33 ` [PATCH 1/2] iio: ad5755: add support for dt bindings Lars-Peter Clausen [not found] ` <56B0CC2C.6020809-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> 2016-02-02 15:57 ` Sean Nyekjær [not found] ` <56B0D203.3050905-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-02 16:37 ` Lars-Peter Clausen [not found] ` <56B0DB5E.7060608-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> 2016-02-03 9:29 ` Sean Nyekjær
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).