From: Stefan Wahren <stefan.wahren@i2se.com>
To: Harald Geyer <harald@ccbib.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>, Marek Vasut <marex@denx.de>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] iio: mxs-lradc: Add regulators for current sources
Date: Tue, 3 May 2016 13:07:32 +0200 [thread overview]
Message-ID: <57288674.9050601@i2se.com> (raw)
In-Reply-To: <1461333147-11873-2-git-send-email-harald@ccbib.org>
Hi Harald,
Am 22.04.2016 um 15:52 schrieb Harald Geyer:
> The hardware has two current sources ISRC0 and ISRC1 to allow measuring
> resistors without additional circuitry. This commit makes them available
> as regulators.
>
> Tested on an imx233-olinuxino board.
>
> Signed-off-by: Harald Geyer <harald@ccbib.org>
> ---
> The current regulator API doesn't fit this type of device very well: Typically
> consumers will want to set a defined current, ie. min_uA == max_uA, but they
> can't without help from configuration data, because the valid values aren't
> reported by the API for current regulators. I have been thinking about
> extending the API, but currently AFAIK no such consumers exist and most
> users, like myself, will force the regulator to a defined value in
> devicetree anyway.
>
> .../bindings/staging/iio/adc/mxs-lradc.txt | 29 ++++
> drivers/iio/adc/Kconfig | 1 +
> drivers/iio/adc/mxs-lradc.c | 152 +++++++++++++++++++++
> 3 files changed, 182 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> index 555fb11..983952c 100644
> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> @@ -19,6 +19,15 @@ Optional properties:
> - fsl,settling: delay between plate switch to next sample. Allowed value is
> 1 ... 2047. It counts at 2 kHz and its default is
> 10 (= 5 ms)
> +- ISRC0: A node describing the regulator of internal current source 0
> +- ISRC1: A node describing the regulator of internal current source 1
> +
> +Required properties for the ISRCx sub-nodes:
> +- regulator-max-microamp: See standard regulator binding documentation.
> + Valid values are from 0 to 300 in steps of 20.
> +
> +Optional properties for the ISRCx sub-nodes:
> +Any standard regulator properties that apply to current regulators.
>
> Example for i.MX23 SoC:
>
> @@ -31,6 +40,16 @@ Example for i.MX23 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc1: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
IMHO the binding should represent the direct connection between the
current source and the physical channel. I think a node label isn't
enough. Unfortunately i don't have an idea to do it the "right way".
> };
>
> Example for i.MX28 SoC:
> @@ -44,4 +63,14 @@ Example for i.MX28 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc6: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
> };
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 5937030..1968d1c 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -319,6 +319,7 @@ config MXS_LRADC
> tristate "Freescale i.MX23/i.MX28 LRADC"
> depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
> depends on INPUT
> + depends on REGULATOR
Any chance to avoid this dependency for an optional feature?
Stefan
> select STMP_DEVICE
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
WARNING: multiple messages have this Message-ID (diff)
From: stefan.wahren@i2se.com (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] iio: mxs-lradc: Add regulators for current sources
Date: Tue, 3 May 2016 13:07:32 +0200 [thread overview]
Message-ID: <57288674.9050601@i2se.com> (raw)
In-Reply-To: <1461333147-11873-2-git-send-email-harald@ccbib.org>
Hi Harald,
Am 22.04.2016 um 15:52 schrieb Harald Geyer:
> The hardware has two current sources ISRC0 and ISRC1 to allow measuring
> resistors without additional circuitry. This commit makes them available
> as regulators.
>
> Tested on an imx233-olinuxino board.
>
> Signed-off-by: Harald Geyer <harald@ccbib.org>
> ---
> The current regulator API doesn't fit this type of device very well: Typically
> consumers will want to set a defined current, ie. min_uA == max_uA, but they
> can't without help from configuration data, because the valid values aren't
> reported by the API for current regulators. I have been thinking about
> extending the API, but currently AFAIK no such consumers exist and most
> users, like myself, will force the regulator to a defined value in
> devicetree anyway.
>
> .../bindings/staging/iio/adc/mxs-lradc.txt | 29 ++++
> drivers/iio/adc/Kconfig | 1 +
> drivers/iio/adc/mxs-lradc.c | 152 +++++++++++++++++++++
> 3 files changed, 182 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> index 555fb11..983952c 100644
> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> @@ -19,6 +19,15 @@ Optional properties:
> - fsl,settling: delay between plate switch to next sample. Allowed value is
> 1 ... 2047. It counts at 2 kHz and its default is
> 10 (= 5 ms)
> +- ISRC0: A node describing the regulator of internal current source 0
> +- ISRC1: A node describing the regulator of internal current source 1
> +
> +Required properties for the ISRCx sub-nodes:
> +- regulator-max-microamp: See standard regulator binding documentation.
> + Valid values are from 0 to 300 in steps of 20.
> +
> +Optional properties for the ISRCx sub-nodes:
> +Any standard regulator properties that apply to current regulators.
>
> Example for i.MX23 SoC:
>
> @@ -31,6 +40,16 @@ Example for i.MX23 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc1: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
IMHO the binding should represent the direct connection between the
current source and the physical channel. I think a node label isn't
enough. Unfortunately i don't have an idea to do it the "right way".
> };
>
> Example for i.MX28 SoC:
> @@ -44,4 +63,14 @@ Example for i.MX28 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc6: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
> };
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 5937030..1968d1c 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -319,6 +319,7 @@ config MXS_LRADC
> tristate "Freescale i.MX23/i.MX28 LRADC"
> depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
> depends on INPUT
> + depends on REGULATOR
Any chance to avoid this dependency for an optional feature?
Stefan
> select STMP_DEVICE
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
To: Harald Geyer <harald-95f8Dae0BrPYtjvyW6yDsg@public.gmane.org>
Cc: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/3] iio: mxs-lradc: Add regulators for current sources
Date: Tue, 3 May 2016 13:07:32 +0200 [thread overview]
Message-ID: <57288674.9050601@i2se.com> (raw)
In-Reply-To: <1461333147-11873-2-git-send-email-harald-95f8Dae0BrPYtjvyW6yDsg@public.gmane.org>
Hi Harald,
Am 22.04.2016 um 15:52 schrieb Harald Geyer:
> The hardware has two current sources ISRC0 and ISRC1 to allow measuring
> resistors without additional circuitry. This commit makes them available
> as regulators.
>
> Tested on an imx233-olinuxino board.
>
> Signed-off-by: Harald Geyer <harald-95f8Dae0BrPYtjvyW6yDsg@public.gmane.org>
> ---
> The current regulator API doesn't fit this type of device very well: Typically
> consumers will want to set a defined current, ie. min_uA == max_uA, but they
> can't without help from configuration data, because the valid values aren't
> reported by the API for current regulators. I have been thinking about
> extending the API, but currently AFAIK no such consumers exist and most
> users, like myself, will force the regulator to a defined value in
> devicetree anyway.
>
> .../bindings/staging/iio/adc/mxs-lradc.txt | 29 ++++
> drivers/iio/adc/Kconfig | 1 +
> drivers/iio/adc/mxs-lradc.c | 152 +++++++++++++++++++++
> 3 files changed, 182 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> index 555fb11..983952c 100644
> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> @@ -19,6 +19,15 @@ Optional properties:
> - fsl,settling: delay between plate switch to next sample. Allowed value is
> 1 ... 2047. It counts at 2 kHz and its default is
> 10 (= 5 ms)
> +- ISRC0: A node describing the regulator of internal current source 0
> +- ISRC1: A node describing the regulator of internal current source 1
> +
> +Required properties for the ISRCx sub-nodes:
> +- regulator-max-microamp: See standard regulator binding documentation.
> + Valid values are from 0 to 300 in steps of 20.
> +
> +Optional properties for the ISRCx sub-nodes:
> +Any standard regulator properties that apply to current regulators.
>
> Example for i.MX23 SoC:
>
> @@ -31,6 +40,16 @@ Example for i.MX23 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc1: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
IMHO the binding should represent the direct connection between the
current source and the physical channel. I think a node label isn't
enough. Unfortunately i don't have an idea to do it the "right way".
> };
>
> Example for i.MX28 SoC:
> @@ -44,4 +63,14 @@ Example for i.MX28 SoC:
> fsl,ave-ctrl = <4>;
> fsl,ave-delay = <2>;
> fsl,settling = <10>;
> +
> + isrc_lradc0: ISRC0 {
> + regulator-max-microamp = <300>;
> + };
> +
> + isrc_lradc6: ISRC1 {
> + regulator-max-microamp = <120>;
> + regulator-min-microamp = <120>;
> + regulator-always-on;
> + };
> };
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 5937030..1968d1c 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -319,6 +319,7 @@ config MXS_LRADC
> tristate "Freescale i.MX23/i.MX28 LRADC"
> depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
> depends on INPUT
> + depends on REGULATOR
Any chance to avoid this dependency for an optional feature?
Stefan
> select STMP_DEVICE
> select IIO_BUFFER
> select IIO_TRIGGERED_BUFFER
next prev parent reply other threads:[~2016-05-03 11:08 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 13:52 [PATCH 0/3] mxs-lradc: Add support for current sources Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` [PATCH 1/3] iio: mxs-lradc: Add regulators " Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 15:50 ` Marek Vasut
2016-04-22 15:50 ` Marek Vasut
2016-04-22 15:50 ` Marek Vasut
2016-04-22 17:00 ` Ksenija Stanojević
2016-04-22 17:00 ` Ksenija Stanojević
2016-04-22 17:00 ` Ksenija Stanojević
2016-04-22 19:23 ` Harald Geyer
2016-04-22 19:23 ` Harald Geyer
2016-04-22 19:23 ` Harald Geyer
2016-04-23 21:08 ` Jonathan Cameron
2016-04-23 21:08 ` Jonathan Cameron
2016-04-23 21:08 ` Jonathan Cameron
2016-04-22 16:11 ` Harald Geyer
2016-04-22 16:11 ` Harald Geyer
2016-04-22 16:11 ` Harald Geyer
2016-05-03 11:07 ` Stefan Wahren [this message]
2016-05-03 11:07 ` Stefan Wahren
2016-05-03 11:07 ` Stefan Wahren
2016-05-03 11:22 ` Harald Geyer
2016-05-03 11:22 ` Harald Geyer
2016-05-03 11:22 ` Harald Geyer
2016-05-04 7:15 ` Jonathan Cameron
2016-05-04 7:15 ` Jonathan Cameron
2016-05-04 7:15 ` Jonathan Cameron
2016-05-04 11:38 ` Harald Geyer
2016-05-04 11:38 ` Harald Geyer
2016-05-04 11:38 ` Harald Geyer
2016-04-22 13:52 ` [PATCH 2/3] ARM: dts: imx23: Provide regulators for the current sources of the LRADC Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` [PATCH 3/3] ARM: dts: imx28: " Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-22 13:52 ` Harald Geyer
2016-04-29 15:12 ` [PATCH 0/3] mxs-lradc: Add support for current sources Stefan Wahren
2016-04-29 15:12 ` Stefan Wahren
2016-04-29 15:12 ` Stefan Wahren
2016-04-29 17:45 ` Harald Geyer
2016-04-29 17:45 ` Harald Geyer
2016-04-29 17:45 ` Harald Geyer
2016-05-01 18:02 ` Jonathan Cameron
2016-05-01 18:02 ` Jonathan Cameron
2016-05-01 18:02 ` Jonathan Cameron
2016-05-02 12:25 ` Harald Geyer
2016-05-02 12:25 ` Harald Geyer
2016-05-02 12:25 ` Harald Geyer
2016-05-02 12:29 ` Stefan Wahren
2016-05-02 12:29 ` Stefan Wahren
2016-05-02 12:29 ` Stefan Wahren
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=57288674.9050601@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=devicetree@vger.kernel.org \
--cc=harald@ccbib.org \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=marex@denx.de \
--cc=shawnguo@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.