gpioiic FDT overlays for sun8i-h3
Emmanuel Vadot
manu at bidouilliste.com
Thu Nov 28 14:20:14 UTC 2019
On Thu, 28 Nov 2019 15:29:01 +0200
Nick Kostirya via freebsd-arm <freebsd-arm at freebsd.org> wrote:
> Hello.
> I want use gpioiic on Nanopi NEO with PA0 and PA2 pins.
> Nanopi NEO will be master.
> Help me, please, to write overlay.
> I write:
>
> /dts-v1/;
> /plugin/;
>
> / {
> compatible = "allwinner,sun8i-h3";
> };
>
> &{/soc/} {
> gpio: gpio {
> gpio-controller;
>
> gpioiic0 {
> compatible = "gpioiic";
> gpios = <&gpio 00 1 0 &gpio 02 1 0>; /* Attach to GPIO pins 00 and 02. Set them initially as inputs. */
> scl = <0>; /* GPIO pin 00 (PA0) */
> sda = <1>; /* GPIO pin 02 (PA2) */
>
> };
> };
> };
>
> But it is not worked.
> Tell me, please, where I was wrong.
I've never tested gpioiic but it seems that it needs to be a child of
the gpio controller as the busdev is get via device_get_parent. It also
doesn't seems to use a 'gpios' property, only scl/sda pin number, which
means that you can only use it on one gpio controller (i.e. you can't
have scl on one gpio controller and sda on another).
Try this but I haven't even compiled it :
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun8i-h3";
};
&{/soc/pinctrl at 1c20800} {
gpioiic0 {
compatible = "gpioiic";
scl = <0>; /* GPIO pin 00 (PA0) */
sda = <2>; /* GPIO pin 02 (PA2) */
};
};
--
Emmanuel Vadot <manu at bidouilliste.com>
More information about the freebsd-arm
mailing list