From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@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, Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>, Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>, Daniel Baluta <daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Subject: Re: [PATCH v2 4/4] iio: ad5755: Add full DT binding documentation Date: Sat, 6 Feb 2016 18:30:04 +0000 [thread overview] Message-ID: <56B63BAC.2040001@kernel.org> (raw) In-Reply-To: <1454509864-32285-4-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> On 03/02/16 14:31, Sean Nyekjaer wrote: > Signed-off-by: Sean Nyekjaer <sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> Hmm. Complex beast. Going to want Lars to look at this in particular. Also a device tree review would be good on this one. My personal gut feeling is not to wrap up things that are really numeric with names, but rather to provide docs on the valid values for them. Not sure what is the preferred by the device tree guys?? Jonathan > --- > Changes since v1: > - this patch added > > .../devicetree/bindings/iio/dac/ad5755.txt | 83 ++++++++++++++++++++++ > 1 file changed, 83 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt > index 4c91583..3aac20d 100644 > --- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt > +++ b/Documentation/devicetree/bindings/iio/dac/ad5755.txt > @@ -15,10 +15,93 @@ Recommended properties: > - spi-max-frequency: Definition as per > Documentation/devicetree/bindings/spi/spi-bus.txt > > +Optional properties: > +See include/dt-bindings/iio/ad5755.h > + - adi,ext_dc_dc_compenstation_resistor: boolean set if using compensation resistor > + - adi,dc_dc_phase: can be set to > + AD5755_DC_DC_PHASE_ALL_SAME_EDGE > + AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE > + AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE > + AD5755_DC_DC_PHASE_90_DEGREE > + - adi,dc_dc_freq: > + AD5755_DC_DC_FREQ_250kHZ > + AD5755_DC_DC_FREQ_410kHZ > + AD5755_DC_DC_FREQ_650kHZ Can we not just make this numeric with a set of valid values specified in this doc? > + - adi,dc_dc_maxv: > + AD5755_DC_DC_MAXV_23V > + AD5755_DC_DC_MAXV_24V5 > + AD5755_DC_DC_MAXV_27V > + AD5755_DC_DC_MAXV_29V5 Same on this. > + > +Optional for every channel: > + - adi,mode: > + AD5755_MODE_VOLTAGE_0V_5V > + AD5755_MODE_VOLTAGE_0V_10V > + AD5755_MODE_VOLTAGE_PLUSMINUS_5V > + AD5755_MODE_VOLTAGE_PLUSMINUS_10V > + AD5755_MODE_CURRENT_4mA_20mA > + AD5755_MODE_CURRENT_0mA_20mA > + AD5755_MODE_CURRENT_0mA_24mA Again, could break this into two numeric values and have options specified in the doc + reject any invalid ones. > + - adi,ext_current_sense_resistor: boolean set if using external > + current sense resistor > + - adi,enable_voltage_overrange: boolean enable voltage overrange > + - adi,slew: Array of slewrate settings should contain 3 fields: > + 1: Should be either 0 or 1 in order to enable or disable slew > + 2: Slew rate settings: > + AD5755_SLEW_RATE_64k > + AD5755_SLEW_RATE_32k > + AD5755_SLEW_RATE_16k > + AD5755_SLEW_RATE_8k > + AD5755_SLEW_RATE_4k > + AD5755_SLEW_RATE_2k > + AD5755_SLEW_RATE_1k > + AD5755_SLEW_RATE_500 > + AD5755_SLEW_RATE_250 > + AD5755_SLEW_RATE_125 > + AD5755_SLEW_RATE_64 > + AD5755_SLEW_RATE_32 > + AD5755_SLEW_RATE_16 > + AD5755_SLEW_RATE_8 > + AD5755_SLEW_RATE_4 > + AD5755_SLEW_RATE_0_5 > + 3: Slew step size: > + AD5755_SLEW_STEP_SIZE_1 > + AD5755_SLEW_STEP_SIZE_2 > + AD5755_SLEW_STEP_SIZE_4 > + AD5755_SLEW_STEP_SIZE_8 > + AD5755_SLEW_STEP_SIZE_16 > + AD5755_SLEW_STEP_SIZE_32 > + AD5755_SLEW_STEP_SIZE_64 > + AD5755_SLEW_STEP_SIZE_128 > + AD5755_SLEW_STEP_SIZE_256 Same with these. > + > Example: > dac@0 { > compatible = "adi,ad5755"; > reg = <0>; > spi-max-frequency = <1000000>; > spi-cpha; > + adi,dc_dc_phase = <AD5755_DC_DC_PHASE_ALL_SAME_EDGE>; > + adi,dc_dc_freq = <AD5755_DC_DC_FREQ_410kHZ>; > + adi,dc_dc_maxv = <AD5755_DC_DC_MAXV_23V>; > + channel@0 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@1 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@2 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@3 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > }; >
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org> To: Sean Nyekjaer <sean.nyekjaer@prevas.dk>, linux-iio@vger.kernel.org Cc: devicetree@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>, Lars-Peter Clausen <lars@metafoo.de>, Hartmut Knaack <knaack.h@gmx.de>, Daniel Baluta <daniel.baluta@intel.com> Subject: Re: [PATCH v2 4/4] iio: ad5755: Add full DT binding documentation Date: Sat, 6 Feb 2016 18:30:04 +0000 [thread overview] Message-ID: <56B63BAC.2040001@kernel.org> (raw) In-Reply-To: <1454509864-32285-4-git-send-email-sean.nyekjaer@prevas.dk> On 03/02/16 14:31, Sean Nyekjaer wrote: > Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Hmm. Complex beast. Going to want Lars to look at this in particular. Also a device tree review would be good on this one. My personal gut feeling is not to wrap up things that are really numeric with names, but rather to provide docs on the valid values for them. Not sure what is the preferred by the device tree guys?? Jonathan > --- > Changes since v1: > - this patch added > > .../devicetree/bindings/iio/dac/ad5755.txt | 83 ++++++++++++++++++++++ > 1 file changed, 83 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt > index 4c91583..3aac20d 100644 > --- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt > +++ b/Documentation/devicetree/bindings/iio/dac/ad5755.txt > @@ -15,10 +15,93 @@ Recommended properties: > - spi-max-frequency: Definition as per > Documentation/devicetree/bindings/spi/spi-bus.txt > > +Optional properties: > +See include/dt-bindings/iio/ad5755.h > + - adi,ext_dc_dc_compenstation_resistor: boolean set if using compensation resistor > + - adi,dc_dc_phase: can be set to > + AD5755_DC_DC_PHASE_ALL_SAME_EDGE > + AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE > + AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE > + AD5755_DC_DC_PHASE_90_DEGREE > + - adi,dc_dc_freq: > + AD5755_DC_DC_FREQ_250kHZ > + AD5755_DC_DC_FREQ_410kHZ > + AD5755_DC_DC_FREQ_650kHZ Can we not just make this numeric with a set of valid values specified in this doc? > + - adi,dc_dc_maxv: > + AD5755_DC_DC_MAXV_23V > + AD5755_DC_DC_MAXV_24V5 > + AD5755_DC_DC_MAXV_27V > + AD5755_DC_DC_MAXV_29V5 Same on this. > + > +Optional for every channel: > + - adi,mode: > + AD5755_MODE_VOLTAGE_0V_5V > + AD5755_MODE_VOLTAGE_0V_10V > + AD5755_MODE_VOLTAGE_PLUSMINUS_5V > + AD5755_MODE_VOLTAGE_PLUSMINUS_10V > + AD5755_MODE_CURRENT_4mA_20mA > + AD5755_MODE_CURRENT_0mA_20mA > + AD5755_MODE_CURRENT_0mA_24mA Again, could break this into two numeric values and have options specified in the doc + reject any invalid ones. > + - adi,ext_current_sense_resistor: boolean set if using external > + current sense resistor > + - adi,enable_voltage_overrange: boolean enable voltage overrange > + - adi,slew: Array of slewrate settings should contain 3 fields: > + 1: Should be either 0 or 1 in order to enable or disable slew > + 2: Slew rate settings: > + AD5755_SLEW_RATE_64k > + AD5755_SLEW_RATE_32k > + AD5755_SLEW_RATE_16k > + AD5755_SLEW_RATE_8k > + AD5755_SLEW_RATE_4k > + AD5755_SLEW_RATE_2k > + AD5755_SLEW_RATE_1k > + AD5755_SLEW_RATE_500 > + AD5755_SLEW_RATE_250 > + AD5755_SLEW_RATE_125 > + AD5755_SLEW_RATE_64 > + AD5755_SLEW_RATE_32 > + AD5755_SLEW_RATE_16 > + AD5755_SLEW_RATE_8 > + AD5755_SLEW_RATE_4 > + AD5755_SLEW_RATE_0_5 > + 3: Slew step size: > + AD5755_SLEW_STEP_SIZE_1 > + AD5755_SLEW_STEP_SIZE_2 > + AD5755_SLEW_STEP_SIZE_4 > + AD5755_SLEW_STEP_SIZE_8 > + AD5755_SLEW_STEP_SIZE_16 > + AD5755_SLEW_STEP_SIZE_32 > + AD5755_SLEW_STEP_SIZE_64 > + AD5755_SLEW_STEP_SIZE_128 > + AD5755_SLEW_STEP_SIZE_256 Same with these. > + > Example: > dac@0 { > compatible = "adi,ad5755"; > reg = <0>; > spi-max-frequency = <1000000>; > spi-cpha; > + adi,dc_dc_phase = <AD5755_DC_DC_PHASE_ALL_SAME_EDGE>; > + adi,dc_dc_freq = <AD5755_DC_DC_FREQ_410kHZ>; > + adi,dc_dc_maxv = <AD5755_DC_DC_MAXV_23V>; > + channel@0 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@1 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@2 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > + channel@3 { > + adi,mode = <AD5755_MODE_CURRENT_4mA_20mA>; > + adi,ext_current_sense_resistor; > + adi,slew = <0 AD5755_SLEW_RATE_64k AD5755_SLEW_STEP_SIZE_1>; > + }; > }; >
next prev parent reply other threads:[~2016-02-06 18:30 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-02-03 14:31 [PATCH v2 1/4] iio: ad5755: add support for dt bindings Sean Nyekjaer 2016-02-03 14:31 ` Sean Nyekjaer [not found] ` <1454509864-32285-1-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-03 14:31 ` [PATCH v2 2/4] iio: ad5755: Add DT binding documentation Sean Nyekjaer 2016-02-03 14:31 ` Sean Nyekjaer [not found] ` <1454509864-32285-2-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-03 14:31 ` [PATCH v2 3/4] iio: ad5755: added full support for devicetree Sean Nyekjaer 2016-02-03 14:31 ` Sean Nyekjaer [not found] ` <1454509864-32285-3-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-03 14:31 ` [PATCH v2 4/4] iio: ad5755: Add full DT binding documentation Sean Nyekjaer 2016-02-03 14:31 ` Sean Nyekjaer [not found] ` <1454509864-32285-4-git-send-email-sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-06 18:30 ` Jonathan Cameron [this message] 2016-02-06 18:30 ` Jonathan Cameron [not found] ` <56B63BAC.2040001-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 2016-02-08 17:37 ` Rob Herring 2016-02-08 17:37 ` Rob Herring 2016-02-09 8:22 ` [PATCH v2 3/4] iio: ad5755: added full support for devicetree Sean Nyekjær 2016-02-09 8:22 ` Sean Nyekjær [not found] ` <56B9A1B2.6030007-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.org> 2016-02-09 20:30 ` Lars-Peter Clausen 2016-02-09 20:30 ` Lars-Peter Clausen [not found] ` <56BA4C74.9030503-Qo5EllUWu/uELgA04lAiVw@public.gmane.org> 2016-02-16 13:46 ` Sean Nyekjær 2016-02-16 13:46 ` Sean Nyekjær 2016-02-06 18:36 ` [PATCH v2 2/4] iio: ad5755: Add DT binding documentation Jonathan Cameron 2016-02-06 18:36 ` Jonathan Cameron
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=56B63BAC.2040001@kernel.org \ --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \ --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \ --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=sean.nyekjaer-rjjw5hvvQKZaa/9Udqfwiw@public.gmane.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: linkBe 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.