All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Ruslan Zalata <rz@fabmicro.ru>, Jean Delvare <jdelvare@suse.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v2] hwmon: (sun4i-lradc) Add driver for LRADC found on Allwinner A13/A20 SoC
Date: Mon, 2 May 2022 09:21:13 -0700	[thread overview]
Message-ID: <3a58097d-5c18-cee5-133b-18c61e94c62c@roeck-us.net> (raw)
In-Reply-To: <20220502133927.4wqhru4es32gws2b@houat>

On 5/2/22 06:39, Maxime Ripard wrote:
> On Mon, May 02, 2022 at 06:31:56AM -0700, Guenter Roeck wrote:
>> On 5/2/22 04:00, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Thu, Apr 28, 2022 at 09:09:03PM +0000, Ruslan Zalata wrote:
>>>> Some Allwinner SoCs like A13, A20 or T2 are equipped with two-channel
>>>> low rate (6 bit) ADC that is often used for extra keys. There's a driver
>>>> for that already implementing standard input device, but it has these
>>>> limitations: 1) it cannot be used for general ADC data equisition, and
>>>> 2) it uses only one LRADC channel of two available.
>>>>
>>>> This driver provides basic hwmon interface to both channels of LRADC on
>>>> such Allwinner SoCs.
>>>>
>>>> Signed-off-by: Ruslan Zalata <rz@fabmicro.ru>
>>>> ---
>>>>    MAINTAINERS                       |   6 +
>>>>    drivers/hwmon/Kconfig             |  13 ++
>>>>    drivers/hwmon/Makefile            |   1 +
>>>>    drivers/hwmon/sun4i-lradc-hwmon.c | 280 ++++++++++++++++++++++++++++++
>>>>    4 files changed, 300 insertions(+)
>>>>    create mode 100644 drivers/hwmon/sun4i-lradc-hwmon.c
>>>>
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 5e8c2f61176..d9c71e94133 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -18861,6 +18861,12 @@ S:	Maintained
>>>>    F:	Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
>>>>    F:	drivers/input/keyboard/sun4i-lradc-keys.c
>>>> +SUN4I LOW RES ADC HWMON DRIVER
>>>> +M:	Ruslan Zalata <rz@fabmicro.ru>
>>>> +L:	linux-hwmon@vger.kernel.org
>>>> +S:	Maintained
>>>> +F:	drivers/hwmon/sun4i-lradc-hwmon.c
>>>> +
>>>>    SUNDANCE NETWORK DRIVER
>>>>    M:	Denis Kirjanov <kda@linux-powerpc.org>
>>>>    L:	netdev@vger.kernel.org
>>>> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
>>>> index 68a8a27ab3b..86776488a81 100644
>>>> --- a/drivers/hwmon/Kconfig
>>>> +++ b/drivers/hwmon/Kconfig
>>>> @@ -1691,6 +1691,19 @@ config SENSORS_SIS5595
>>>>    	  This driver can also be built as a module. If so, the module
>>>>    	  will be called sis5595.
>>>> +config SENSORS_SUN4I_LRADC
>>>> +	tristate "Allwinner A13/A20 LRADC hwmon"
>>>> +	depends on ARCH_SUNXI && !KEYBOARD_SUN4I_LRADC
>>>> +	help
>>>> +	  Say y here to support the LRADC found in Allwinner A13/A20 SoCs.
>>>> +	  Both channels are supported.
>>>> +
>>>> +	  This driver can also be built as module. If so, the module
>>>> +	  will be called sun4i-lradc-hwmon.
>>>> +
>>>> +	  This option is not compatible with KEYBOARD_SUN4I_LRADC, one
>>>> +	  of these must be used at a time.
>>>
>>> How do you plan on enforcing that?
>>>
>> 	depends on ARCH_SUNXI && !KEYBOARD_SUN4I_LRADC
> 
> Right, but that just doesn't fly for any generic distro / build-system.
> 

That is correct. Alternative might be to use devicetree bindings, which
presumably will be needed anyway to tell the driver(s) what to bind to.

Guenter

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Ruslan Zalata <rz@fabmicro.ru>, Jean Delvare <jdelvare@suse.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH v2] hwmon: (sun4i-lradc) Add driver for LRADC found on Allwinner A13/A20 SoC
Date: Mon, 2 May 2022 09:21:13 -0700	[thread overview]
Message-ID: <3a58097d-5c18-cee5-133b-18c61e94c62c@roeck-us.net> (raw)
In-Reply-To: <20220502133927.4wqhru4es32gws2b@houat>

On 5/2/22 06:39, Maxime Ripard wrote:
> On Mon, May 02, 2022 at 06:31:56AM -0700, Guenter Roeck wrote:
>> On 5/2/22 04:00, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Thu, Apr 28, 2022 at 09:09:03PM +0000, Ruslan Zalata wrote:
>>>> Some Allwinner SoCs like A13, A20 or T2 are equipped with two-channel
>>>> low rate (6 bit) ADC that is often used for extra keys. There's a driver
>>>> for that already implementing standard input device, but it has these
>>>> limitations: 1) it cannot be used for general ADC data equisition, and
>>>> 2) it uses only one LRADC channel of two available.
>>>>
>>>> This driver provides basic hwmon interface to both channels of LRADC on
>>>> such Allwinner SoCs.
>>>>
>>>> Signed-off-by: Ruslan Zalata <rz@fabmicro.ru>
>>>> ---
>>>>    MAINTAINERS                       |   6 +
>>>>    drivers/hwmon/Kconfig             |  13 ++
>>>>    drivers/hwmon/Makefile            |   1 +
>>>>    drivers/hwmon/sun4i-lradc-hwmon.c | 280 ++++++++++++++++++++++++++++++
>>>>    4 files changed, 300 insertions(+)
>>>>    create mode 100644 drivers/hwmon/sun4i-lradc-hwmon.c
>>>>
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 5e8c2f61176..d9c71e94133 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -18861,6 +18861,12 @@ S:	Maintained
>>>>    F:	Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
>>>>    F:	drivers/input/keyboard/sun4i-lradc-keys.c
>>>> +SUN4I LOW RES ADC HWMON DRIVER
>>>> +M:	Ruslan Zalata <rz@fabmicro.ru>
>>>> +L:	linux-hwmon@vger.kernel.org
>>>> +S:	Maintained
>>>> +F:	drivers/hwmon/sun4i-lradc-hwmon.c
>>>> +
>>>>    SUNDANCE NETWORK DRIVER
>>>>    M:	Denis Kirjanov <kda@linux-powerpc.org>
>>>>    L:	netdev@vger.kernel.org
>>>> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
>>>> index 68a8a27ab3b..86776488a81 100644
>>>> --- a/drivers/hwmon/Kconfig
>>>> +++ b/drivers/hwmon/Kconfig
>>>> @@ -1691,6 +1691,19 @@ config SENSORS_SIS5595
>>>>    	  This driver can also be built as a module. If so, the module
>>>>    	  will be called sis5595.
>>>> +config SENSORS_SUN4I_LRADC
>>>> +	tristate "Allwinner A13/A20 LRADC hwmon"
>>>> +	depends on ARCH_SUNXI && !KEYBOARD_SUN4I_LRADC
>>>> +	help
>>>> +	  Say y here to support the LRADC found in Allwinner A13/A20 SoCs.
>>>> +	  Both channels are supported.
>>>> +
>>>> +	  This driver can also be built as module. If so, the module
>>>> +	  will be called sun4i-lradc-hwmon.
>>>> +
>>>> +	  This option is not compatible with KEYBOARD_SUN4I_LRADC, one
>>>> +	  of these must be used at a time.
>>>
>>> How do you plan on enforcing that?
>>>
>> 	depends on ARCH_SUNXI && !KEYBOARD_SUN4I_LRADC
> 
> Right, but that just doesn't fly for any generic distro / build-system.
> 

That is correct. Alternative might be to use devicetree bindings, which
presumably will be needed anyway to tell the driver(s) what to bind to.

Guenter

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-02 16:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 21:09 [PATCH v2] hwmon: (sun4i-lradc) Add driver for LRADC found on Allwinner A13/A20 SoC Ruslan Zalata
2022-04-28 21:30 ` Guenter Roeck
2022-04-28 21:30   ` Guenter Roeck
2022-04-29  0:28   ` Ruslan Zalata
2022-04-29  0:28     ` Ruslan Zalata
2022-04-29  5:32     ` Guenter Roeck
2022-04-29  5:32       ` Guenter Roeck
2022-04-29  6:03       ` Guenter Roeck
2022-04-29  6:03         ` Guenter Roeck
2022-05-02 23:47         ` Ruslan Zalata
2022-05-02 23:47           ` Ruslan Zalata
2022-04-29 13:24   ` Jonathan Cameron
2022-04-29 13:24     ` Jonathan Cameron
2022-05-02 23:20     ` Ruslan Zalata
2022-05-02 23:20       ` Ruslan Zalata
2022-05-02 11:00 ` Maxime Ripard
2022-05-02 11:00   ` Maxime Ripard
2022-05-02 11:15   ` Icenowy Zheng
2022-05-02 11:15     ` Icenowy Zheng
2022-05-02 11:21     ` Maxime Ripard
2022-05-02 11:21       ` Maxime Ripard
2022-05-03  2:02       ` Guenter Roeck
2022-05-03  2:02         ` Guenter Roeck
2022-05-03 15:26         ` Ruslan Zalata
2022-05-03 15:26           ` Ruslan Zalata
2022-05-03 16:14           ` Maxime Ripard
2022-05-03 16:14             ` Maxime Ripard
2022-05-03 21:37             ` Ruslan Zalata
2022-05-03 21:37               ` Ruslan Zalata
2022-05-04 14:12               ` Maxime Ripard
2022-05-04 14:12                 ` Maxime Ripard
2022-05-02 13:31   ` Guenter Roeck
2022-05-02 13:31     ` Guenter Roeck
2022-05-02 13:39     ` Maxime Ripard
2022-05-02 13:39       ` Maxime Ripard
2022-05-02 16:21       ` Guenter Roeck [this message]
2022-05-02 16:21         ` Guenter Roeck
2022-05-03  8:50   ` Ruslan Zalata
2022-05-03  8:50     ` Ruslan Zalata
2022-05-03 16:07     ` Maxime Ripard
2022-05-03 16:07       ` Maxime Ripard
2022-05-04 19:33 Jamie Cuthbert
2022-05-04 19:33 Jamie Cuthbert

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=3a58097d-5c18-cee5-133b-18c61e94c62c@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maxime@cerno.tech \
    --cc=rz@fabmicro.ru \
    --cc=samuel@sholland.org \
    --cc=wens@csie.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.