devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Chen-Yu Tsai <wens@csie.org>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-iio@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH 1/2] iio: sun4i-lradc: Add binding documentation
Date: Sat, 2 Jul 2016 11:32:07 +0200	[thread overview]
Message-ID: <777642fd-5e77-206f-a503-23bbf187e6f3@redhat.com> (raw)
In-Reply-To: <CAGb2v66PzgVqVGxs4FSQkkX=2hX42UmftahOgJmepv4wA-mwnw@mail.gmail.com>

Hi,

On 02-07-16 11:12, Chen-Yu Tsai wrote:
> Hi,
>
> On Sat, Jul 2, 2016 at 5:00 AM, Alexandre Belloni
> <alexandre.belloni@free-electrons.com> wrote:
>> Document the bindings for the Allwinner LRADC.
>
> We already have Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
> and I'm pretty sure Hans (CC-ed) argued that this is not a generic ADC
> block.

Right, this block is used on many tablets and some dev boards to
provide buttons (as in the hid type) and the block is designed for
this purpose, giving an irq when the adc level crosses a certain
threshold.

Sure it can be used in a more generic way, but that is not its
primary goal.

So any generic purpose adc driver must not break the current
use-case (which is already used in mainline kernel dts files
in plenty of cases).

I believe that the best way to deal with this is to add an
"allwinner,general-purpose-mode" flag to the existing binding
(as well as document general purpose mode in the existing
binding rather then in a new binding doc).

That seems to be the right thing to do purely looking at this
from a dt binding pov.

For the implementation of this we can simpy have 2 drivers,
then both drivers can check the flag and if present return
-ENODEV from the existing input driver and likewise if not
present return -ENODEV from the iio driver.

We may actually use a similar solution for the touchscreen
controller which can also be alternatively used as a generic
purpose adc.

Regards,

Hans



> Any plans to reconcile the different bindings?
>
> Thanks
> ChenYu
>
>>
>> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> ---
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: devicetree@vger.kernel.org
>>
>>  .../devicetree/bindings/iio/adc/sun4i-lradc.txt       | 19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/iio/adc/sun4i-lradc.txt
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/sun4i-lradc.txt b/Documentation/devicetree/bindings/iio/adc/sun4i-lradc.txt
>> new file mode 100644
>> index 000000000000..c75a6067b8a5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/adc/sun4i-lradc.txt
>> @@ -0,0 +1,19 @@
>> +Allwinner sun4i Low Resolution ADC
>> +----------------------------------
>> +
>> +Required properties:
>> + - compatible: "allwinner,sun4i-a10-lradc"
>> + - reg: mmio address range of the chip
>> + - interrupts: interrupt to which the chip is connected
>> + - vref-supply: powersupply for the lradc reference voltage
>> + - #io-channel-cells = <1>; As ADC has multiple outputs
>> +
>> +Example:
>> +
>> +       lradc: lradc@01c22800 {
>> +               compatible = "allwinner,sun4i-a10-lradc";
>> +               reg = <0x01c22800 0x100>;
>> +               interrupts = <31>;
>> +               vref-supply = <&reg_vcc3v0>;
>> +               #io-channel-cells = <1>;
>> +       };
>> --
>> 2.8.1
>>

  reply	other threads:[~2016-07-02  9:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 21:00 [PATCH 1/2] iio: sun4i-lradc: Add binding documentation Alexandre Belloni
     [not found] ` <1467406855-9677-1-git-send-email-alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-02  9:12   ` Chen-Yu Tsai
2016-07-02  9:32     ` Hans de Goede [this message]
     [not found]       ` <777642fd-5e77-206f-a503-23bbf187e6f3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-02 11:02         ` Maxime Ripard
2016-07-02 11:45           ` Hans de Goede
     [not found]             ` <9b02394e-b38b-c804-780b-e9707c292486-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-02 13:32               ` Alexandre Belloni
     [not found]                 ` <20160702133243.GB20045-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2016-07-02 13:46                   ` Maxime Ripard
2016-07-02 13:35     ` Alexandre Belloni
     [not found]       ` <20160702133528.GC20045-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2016-07-02 19:46         ` Hans de Goede
     [not found]           ` <b23bd147-0d68-a6a6-14c0-5047af35e6b7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-02 20:43             ` Alexandre Belloni
2016-07-03 12:01       ` 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=777642fd-5e77-206f-a503-23bbf187e6f3@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=robh+dt@kernel.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 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).