Re: [PATCH V2] iio: adc: Add Renesas GyroADC driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lars,

On Mon, Jan 9, 2017 at 9:07 PM, Lars-Peter Clausen <lars@xxxxxxxxxx> 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@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux