Enable Pull-Up on gpio when accessed through sysfs?

226 views
Skip to first unread message

Eckhardt Ulrich

unread,
Sep 4, 2016, 11:48:45 AM9/4/16
to linux-sunxi
Hi all,

I want to enable the pull-up resistors for some gpio pins on a BananaPi-R1 when the pins are accessed from user space through /sys/class/gpio/. Therefore I have added the following  to the pio node of the device tree:

&pio {
  ...
   switch3: switch3@0 {
        allwinner,pins = "PI20";
        allwinner,function = "gpio_in";
        allwinner,drive = <SUN4I_PINCTRL_10_MA>;
        allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        gpio = <&pio 8 20 GPIO_ACTIVE_HIGH>;
    };
    ...
};

I could see the corresponding entry in /proc/device-tree/soc@01c00000/pinctrl@01c20800 but the pin (located on the GPIO-J12 jumper) does not show a high state. I would have expected to measure +3.3V at this pin, but I get only some milivolts. So it seems, that enabling the pull up seems not working this way.  The log when enabling the pin:

[   99.024155] sun7i-a20-pinctrl 1c20800.pinctrl: request pin 276 (PI20) for 1c20800.pinctrl:276

I use currently kernel 4.7.0. Do I miss something?

Regards,
Uli


Reply all
Reply to author
Forward
0 new messages