[PATCH 0/2] mcp23s08: add get_direction and PIN_CONFIG_OUTPUT support.

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

 



Motivation for these two patches is setting mcp23s08 outputs on boot from the
device tree.

gpio-hog was already functional with mcp23s08, however libgpio incorrectly
showed pins with output-high or output-low hogs as inputs since the driver did
not implement gpio_chip->get_direction().

Many other drivers also support setting pins to output-high or output-low via
pinmux. In contrast to gpio-hog, using pinmux to set the pin state on boot
allows the state to be changed later from user space. mcp23s08 did not support
this since PIN_CONFIG_OUTPUT was not implemented in
pinconf_ops->pin_config_set().

One issue with the second patch is that pins set to output-high or output-low
via pinmux still show up as inputs in libgpio after boot. This is because the
pin direction gets cached in gpio_desc.flags in devm_gpiochip_add_data().
However output-high/-low in pimux only gets applied after that. I am not sure
what would be the best approach to fix this.

Tomaz Solc (2):
  pinctrl: mcp23s08: implement get_direction()
  pinctrl: mcp23s08: support for PIN_CONFIG_OUTPUT.

 .../bindings/pinctrl/pinctrl-mcp23s08.txt     | 12 ++--
 drivers/pinctrl/pinctrl-mcp23s08.c            | 72 ++++++++++++++++---
 2 files changed, 68 insertions(+), 16 deletions(-)

-- 
2.20.1




[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