All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Marek Vasut <marek.vasut@gmail.com>,
	linux-iio@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms+renesas@verge.net.au>
Subject: Re: [PATCH V2] iio: adc: Add Renesas GyroADC driver
Date: Mon, 9 Jan 2017 21:25:24 +0100	[thread overview]
Message-ID: <CAMuHMdXPazdh5VQbTQx84c+z+KOHb=CRHtM6fFVHrCrxax2TuA@mail.gmail.com> (raw)
In-Reply-To: <60a9397a-aaa6-2a0d-9acc-79cd967f6938@metafoo.de>

Hi Lars,

On Mon, Jan 9, 2017 at 9:07 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 01/09/2017 02:47 PM, Marek Vasut wrote:
>> On 01/09/2017 02:45 PM, Lars-Peter Clausen wrote:
>>> On 01/09/2017 01:03 AM, Marek Vasut wrote:
>>> [...]
>>>> +- renesas,gyroadc-mode:    GyroADC mode of operation, must be either of:
>>>> +                   1 - MB88101A mode, 12bit sampling, 4 channels
>>>> +                   2 - ADCS7476 mode, 15bit sampling, 8 channels
>>>> +                   3 - MAX1162 mode,  16bit sampling, 8 channels
>>>
>>> So is this a ADC, or is this just a specialized SPI controller that
>>> interfaces to an external ADC?
>>
>> It's a special SPI controller, except one cannot access the SPI bus
>> directly. It sends out clock and reads in the data from the ADC .
>
> OK, thanks for the clarification. The commit message does not mention this
> at the moment and makes it sound like this is a built-in ADC.
>
> Also the renesas,gyroadc-mode property is more of a driver configuration
> setting rather than a description of the hardware, at least it is not very
> DT-ish.
>
> I'd go with something like
>
>
>         &adc {
>                 compatible = "renesas,r8a7791-gyroadc";
>                 ...
>
>                 adc@0 {
>                         reg = <0>;
>                         compatible = "maxim,max1162";
>
>                         ref-supply = <&vref_max1162>;

vref-supply?

>                 };
>
>                 ... repeat for each front-end ADC.
>
>         };
>
> That's much more idiomatic which makes it e.g. easier to understand for
> someone who does not know the specifics of the binding.
>
> It also makes it more extensible and portable in terms of the same binding
> for similar devices.
>
> Internally in the driver you can still use your mode variable initializing
> it based on the compatible string of the subnode.

Thanks, that sounds like a great idea!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2017-01-09 20:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09  0:03 [PATCH V2] iio: adc: Add Renesas GyroADC driver Marek Vasut
2017-01-09 12:13 ` Geert Uytterhoeven
2017-01-09 14:16   ` Marek Vasut
2017-01-09 14:32     ` Geert Uytterhoeven
2017-01-09 17:30       ` Marek Vasut
2017-01-09 18:30         ` Geert Uytterhoeven
2017-01-10 18:20           ` Marek Vasut
2017-01-09 13:45 ` Lars-Peter Clausen
2017-01-09 13:47   ` Marek Vasut
2017-01-09 20:07     ` Lars-Peter Clausen
2017-01-09 20:25       ` Geert Uytterhoeven [this message]
2017-01-09 20:27         ` Lars-Peter Clausen
2017-01-09 20:41           ` Geert Uytterhoeven
2017-01-09 20:48             ` Lars-Peter Clausen
2017-01-09 20:56       ` Marek Vasut
2017-01-09 21:02         ` Lars-Peter Clausen
2017-01-09 21:02           ` Lars-Peter Clausen
2017-01-09 21:55           ` Marek Vasut
2017-01-09 22:14             ` Geert Uytterhoeven
2017-01-10 18:35               ` Marek Vasut
2017-01-10 18:41                 ` Geert Uytterhoeven
2017-01-10 18:52                   ` Marek Vasut
2017-01-10 19:06                     ` Geert Uytterhoeven
2017-01-10 21:37                       ` Marek Vasut
2017-01-09 13:51   ` Geert Uytterhoeven

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='CAMuHMdXPazdh5VQbTQx84c+z+KOHb=CRHtM6fFVHrCrxax2TuA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=geert+renesas@glider.be \
    --cc=horms+renesas@verge.net.au \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    /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.