Skip to contentSkip to conversation

Add single register pin controller driver

PATCH New Felix Brack 2 participants 2 messages Mar 22, 2017 – Mar 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add single register pin controller driver

This patch adds a pin controller driver supporting devices using a single configuration register per pin.

---

Changes in v4:
- add James Balean's modifications according to v3 to this patch

Changes in v3:
The use of pinctrl_ops.set_state_simple wile defining CONFIG_PINCTRL_FULL seems to be wrong.
- use pinctrl_ops.set_state instead of pinctrl_ops.set_state_simple

Changes in v2:
- add a comment on function single_configure_pins() explaining the function and its parameters
- use fdt_getprop() to simplify retrieval of property 'pinctrl-single,pins' from FDT
- change the return value of single_ofdata_to_platdata() to -EINVAL in case of failure
- change the driver name from pcs_pinctrl to single_pinctrl
- minor reformatting to comply with coding style

 drivers/pinctrl/Kconfig          |  10 +++
 drivers/pinctrl/Makefile         |   1 +
 drivers/pinctrl/pinctrl-single.c | 142 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-single.c
drivers/pinctrl/Kconfig +10 -0
index efcb4c0..32bda65 100644
@@ -175,6 +175,16 @@ config PIC32_PINCTRL
 	  by a device tree node which contains both GPIO defintion and pin control
 	  functions.
 
+config PINCTRL_SINGLE
+	bool "Single register pin-control and pin-multiplex driver"
+	depends on DM
+	help
+	  This enables pinctrl driver for systems using a single register for
+	  pin configuration and multiplexing. TI's AM335X SoCs are examples of
+	  such systems.
+	  Depending on the platform make sure to also enable OF_TRANSLATE and
+	  eventually SPL_OF_TRANSLATE to get correct address translations.
+
 endif
 
 source "drivers/pinctrl/meson/Kconfig"
drivers/pinctrl/Makefile +1 -0
index 512112a..f148f94 100644
@@ -16,3 +16,4 @@ obj-$(CONFIG_PIC32_PINCTRL)	+= pinctrl_pic32.o
 obj-$(CONFIG_PINCTRL_EXYNOS)	+= exynos/
 obj-$(CONFIG_PINCTRL_MESON)	+= meson/
 obj-$(CONFIG_PINCTRL_MVEBU)	+= mvebu/
+obj-$(CONFIG_PINCTRL_SINGLE)	+= pinctrl-single.o
drivers/pinctrl/pinctrl-single.c new file +142 -0

142 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 1/1 Add single register pin controller driver

Quoted 23 lines · Felix Brack

This patch adds a pin controller driver supporting devices using a single configuration register per pin.

---

Changes in v4:
- add James Balean's modifications according to v3 to this patch

Changes in v3:
The use of pinctrl_ops.set_state_simple wile defining CONFIG_PINCTRL_FULL seems to be wrong.
- use pinctrl_ops.set_state instead of pinctrl_ops.set_state_simple

Changes in v2:
- add a comment on function single_configure_pins() explaining the function and its parameters
- use fdt_getprop() to simplify retrieval of property 'pinctrl-single,pins' from FDT
- change the return value of single_ofdata_to_platdata() to -EINVAL in case of failure
- change the driver name from pcs_pinctrl to single_pinctrl
- minor reformatting to comply with coding style

Quoted 5 lines
 drivers/pinctrl/Kconfig          |  10 +++
 drivers/pinctrl/Makefile         |   1 +
 drivers/pinctrl/pinctrl-single.c | 142 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-single.c

Applied to u-boot-dm, thanks!