Default pin direction after exporting/requesting

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

 



Hi,

While playing with sunxi SoC based board GPIOs I found out that after exporting a GPIO it's direction is set to "in" but it's not able to actually sense any value unless I manually write "in" to /sys/class/gpioX/direction.

This is because on those SoCs default GPIO function is "disabled" and it is not changed when GPIO is exported. Since "direction" only supports two stated (in/out) there is no way this state could be represented. I see this as a bug and would like to fix this but I'm not sure what would be preffered way.

- write my own "request" handler instead of using "gpiochip_generic_request" for "gpio_chip" structre (this was my first try but sunxi dev wasn't convinced it's a good place for this change)

- keep using "gpiochip_generic_request" and write "gpio_request_enable" handler for "pinmux_ops"

- change higher layers, like gpiolib, to enforce setting gpio direction as input when exporting/requesting GPIO

Or maybe there is even better way of doing that? I couldn't find any documentation that clearly states what state should GPIO be in after requesting/exporting but clearly at least gpiolib sysfs interface expect it to be set as input.

Best regards,
Krzysztof Adamski
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux