Message ID | 20190217142914.17433-4-contact@artur-rojek.eu (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/7] iio: inkern: API for reading available iio channel attribute values | expand |
On Sun, Feb 17, 2019 at 03:29:13PM +0100, Artur Rojek wrote: > Add documentation for the ingenic-battery driver, used on JZ47xx SoCs. > > Signed-off-by: Artur Rojek <contact@artur-rojek.eu> > --- > .../bindings/power/supply/ingenic,battery.txt | 31 +++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.txt > > diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt > new file mode 100644 > index 000000000000..66430bf73815 > --- /dev/null > +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt > @@ -0,0 +1,31 @@ > +* Ingenic JZ47xx battery bindings > + > +Required properties: > + > +- compatible: Must be "ingenic,jz4740-battery". > +- io-channels: phandle and IIO specifier pair to the IIO device. > + Format described in iio-bindings.txt. > +- monitored-battery: phandle to a "simple-battery" compatible node. > + > +The "monitored-battery" property must be a phandle to a node using the format > +described in battery.txt, with the following properties being required: > + > +- voltage-min-design-microvolt: Drained battery voltage. > +- voltage-max-design-microvolt: Fully charged battery voltage. > + > +Example: > + > +#include <dt-bindings/iio/adc/ingenic,adc.h> > + > +simple_battery: battery { > + compatible = "simple-battery"; > + voltage-min-design-microvolt = <3600000>; > + voltage-max-design-microvolt = <4200000>; > +}; > + > +ingenic_battery { > + compatible = "ingenic,jz4740-battery"; > + io-channels = <&adc INGENIC_ADC_BATTERY>; > + io-channel-names = "battery"; > + monitored-battery = <&simple_battery>; Isn't this just an ADC monitored battery? What's specific to JZ4740? Maybe a generic binding is appropriate here? Rob
Hi Rob, Le jeu. 28 févr. 2019 à 15:48, Rob Herring <robh@kernel.org> a écrit : > On Sun, Feb 17, 2019 at 03:29:13PM +0100, Artur Rojek wrote: >> Add documentation for the ingenic-battery driver, used on JZ47xx >> SoCs. >> >> Signed-off-by: Artur Rojek <contact@artur-rojek.eu> >> --- >> .../bindings/power/supply/ingenic,battery.txt | 31 >> +++++++++++++++++++ >> 1 file changed, 31 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> >> diff --git >> a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> new file mode 100644 >> index 000000000000..66430bf73815 >> --- /dev/null >> +++ >> b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> @@ -0,0 +1,31 @@ >> +* Ingenic JZ47xx battery bindings >> + >> +Required properties: >> + >> +- compatible: Must be "ingenic,jz4740-battery". >> +- io-channels: phandle and IIO specifier pair to the IIO device. >> + Format described in iio-bindings.txt. >> +- monitored-battery: phandle to a "simple-battery" compatible node. >> + >> +The "monitored-battery" property must be a phandle to a node using >> the format >> +described in battery.txt, with the following properties being >> required: >> + >> +- voltage-min-design-microvolt: Drained battery voltage. >> +- voltage-max-design-microvolt: Fully charged battery voltage. >> + >> +Example: >> + >> +#include <dt-bindings/iio/adc/ingenic,adc.h> >> + >> +simple_battery: battery { >> + compatible = "simple-battery"; >> + voltage-min-design-microvolt = <3600000>; >> + voltage-max-design-microvolt = <4200000>; >> +}; >> + >> +ingenic_battery { >> + compatible = "ingenic,jz4740-battery"; >> + io-channels = <&adc INGENIC_ADC_BATTERY>; >> + io-channel-names = "battery"; >> + monitored-battery = <&simple_battery>; > > Isn't this just an ADC monitored battery? What's specific to JZ4740? > > Maybe a generic binding is appropriate here? > > Rob There is no generic driver, is there? The generic-adc-battery driver isn't OF-compatible and looks like dead code (nothing uses it). -Paul
Hi Rob, thanks for the review. On 2019-02-28 19:48, Rob Herring wrote: > On Sun, Feb 17, 2019 at 03:29:13PM +0100, Artur Rojek wrote: >> Add documentation for the ingenic-battery driver, used on JZ47xx SoCs. >> >> Signed-off-by: Artur Rojek <contact@artur-rojek.eu> >> --- >> .../bindings/power/supply/ingenic,battery.txt | 31 >> +++++++++++++++++++ >> 1 file changed, 31 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> >> diff --git >> a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> new file mode 100644 >> index 000000000000..66430bf73815 >> --- /dev/null >> +++ >> b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt >> @@ -0,0 +1,31 @@ >> +* Ingenic JZ47xx battery bindings >> + >> +Required properties: >> + >> +- compatible: Must be "ingenic,jz4740-battery". >> +- io-channels: phandle and IIO specifier pair to the IIO device. >> + Format described in iio-bindings.txt. >> +- monitored-battery: phandle to a "simple-battery" compatible node. >> + >> +The "monitored-battery" property must be a phandle to a node using >> the format >> +described in battery.txt, with the following properties being >> required: >> + >> +- voltage-min-design-microvolt: Drained battery voltage. >> +- voltage-max-design-microvolt: Fully charged battery voltage. >> + >> +Example: >> + >> +#include <dt-bindings/iio/adc/ingenic,adc.h> >> + >> +simple_battery: battery { >> + compatible = "simple-battery"; >> + voltage-min-design-microvolt = <3600000>; >> + voltage-max-design-microvolt = <4200000>; >> +}; >> + >> +ingenic_battery { >> + compatible = "ingenic,jz4740-battery"; >> + io-channels = <&adc INGENIC_ADC_BATTERY>; >> + io-channel-names = "battery"; >> + monitored-battery = <&simple_battery>; > > Isn't this just an ADC monitored battery? What's specific to JZ4740? > > Maybe a generic binding is appropriate here? This isn't quite a generic driver; see Jonathan's reply to patch 5/7. - Artur > > Rob
diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt new file mode 100644 index 000000000000..66430bf73815 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt @@ -0,0 +1,31 @@ +* Ingenic JZ47xx battery bindings + +Required properties: + +- compatible: Must be "ingenic,jz4740-battery". +- io-channels: phandle and IIO specifier pair to the IIO device. + Format described in iio-bindings.txt. +- monitored-battery: phandle to a "simple-battery" compatible node. + +The "monitored-battery" property must be a phandle to a node using the format +described in battery.txt, with the following properties being required: + +- voltage-min-design-microvolt: Drained battery voltage. +- voltage-max-design-microvolt: Fully charged battery voltage. + +Example: + +#include <dt-bindings/iio/adc/ingenic,adc.h> + +simple_battery: battery { + compatible = "simple-battery"; + voltage-min-design-microvolt = <3600000>; + voltage-max-design-microvolt = <4200000>; +}; + +ingenic_battery { + compatible = "ingenic,jz4740-battery"; + io-channels = <&adc INGENIC_ADC_BATTERY>; + io-channel-names = "battery"; + monitored-battery = <&simple_battery>; +};
Add documentation for the ingenic-battery driver, used on JZ47xx SoCs. Signed-off-by: Artur Rojek <contact@artur-rojek.eu> --- .../bindings/power/supply/ingenic,battery.txt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.txt