Skip to contentSkip to conversation

pinctrl for NXP LPC18xx family

PATCH New Joachim Eastwood 2 participants 4 messages Apr 27, 2015 – May 5, 2015

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

v2 cover pinctrl for NXP LPC18xx family

This patch set adds a pinctrl driver for NXP LPC18xx/43xx devices.

The pinctrl driver uses the generic muxing and properties DT bindings as described in pinctrl-bindings.txt. There is still two TODOs left in the pinctrl driver regarding property control of special usb1 pins but I would like it merged regardless of this. Support will be added once I get USB up and running on the MCU.

Checkpatch complains a lot about the driver but that's what you get when you embedd a large function/pin spec table from the data sheet I guess.

Changes since v1:
- minor white space fixes
- split pinctrl/gpio patch set
- rebase on v4.1-rc1

Since there were no comments on v1. I hope that these drivers can make it to Linux 4.1.

There are no dependencies in this patch set. The DTS changes will be sent separately to arm-soc once this patch set goes upstream.

Base support for the NXP LPC18xx family can be found here:
http://marc.info/?l=linux-arm-kernel&m=143016894704253&w=2

Joachim Eastwood (2):
pinctrl: add lpc18xx pinctrl driver
doc: dt: add documentation for lpc1850-scu pinctrl driver

 .../bindings/pinctrl/nxp,lpc1850-scu.txt           |   57 +
 drivers/pinctrl/Kconfig                            |    9 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/pinctrl-lpc18xx.c                  | 1144 ++++++++++++++++++++
 4 files changed, 1211 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,lpc1850-scu.txt
 create mode 100644 drivers/pinctrl/pinctrl-lpc18xx.c
Signature · 1 line
1.8.0
#1 lore raw

PATCH v2 1/2 pinctrl: add lpc18xx pinctrl driver

Pinctrl driver for the System Control Unit (SCU) found on NXP LPC18xx/43xx devices.

Driver uses the generic pinctrl DT bindings for multiplexing and property settings.

---
 drivers/pinctrl/Kconfig           |    9 +
 drivers/pinctrl/Makefile          |    1 +
 drivers/pinctrl/pinctrl-lpc18xx.c | 1144 +++++++++++++++++++++++++++++++++++++
 3 files changed, 1154 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-lpc18xx.c
drivers/pinctrl/Kconfig +9 -0
index aeb5729fbda6..53ae816f494e 100644
@@ -88,6 +88,15 @@ config PINCTRL_LANTIQ
 	select PINMUX
 	select PINCONF
 
+config PINCTRL_LPC18XX
+	bool "NXP LPC18XX/43XX SCU pinctrl driver"
+	depends on OF && (ARCH_LPC18XX || COMPILE_TEST)
+	default ARCH_LPC18XX
+	select PINMUX
+	select GENERIC_PINCONF
+	help
+	  Pinctrl driver for NXP LPC18xx/43xx System Control Unit (SCU).
+
 config PINCTRL_FALCON
 	bool
 	depends on SOC_FALCON
drivers/pinctrl/Makefile +1 -0
index 6eadf04a33b3..6a7b4baa8c94 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_PINCTRL_U300)	+= pinctrl-u300.o
 obj-$(CONFIG_PINCTRL_COH901)	+= pinctrl-coh901.o
 obj-$(CONFIG_PINCTRL_XWAY)	+= pinctrl-xway.o
 obj-$(CONFIG_PINCTRL_LANTIQ)	+= pinctrl-lantiq.o
+obj-$(CONFIG_PINCTRL_LPC18XX)	+= pinctrl-lpc18xx.o
 obj-$(CONFIG_PINCTRL_TB10X)	+= pinctrl-tb10x.o
 obj-$(CONFIG_PINCTRL_ST) 	+= pinctrl-st.o
 obj-$(CONFIG_PINCTRL_ZYNQ)	+= pinctrl-zynq.o
drivers/pinctrl/pinctrl-lpc18xx.c new file +1144 -0

1,144 lines not on this page · raw message

Signature · 1 line
1.8.0
#2 lore raw

PATCH v2 2/2 doc: dt: add documentation for lpc1850-scu pinctrl driver

In reply to Joachim Eastwood
---
 .../bindings/pinctrl/nxp,lpc1850-scu.txt           | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,lpc1850-scu.txt
Documentation/devicetree/bindings/pinctrl/nxp,lpc1850-scu.txt new file +57 -0
new file mode 100644
index 000000000000..df0309c57505
@@ -0,0 +1,57 @@
+NXP LPC18xx/43xx SCU pin controller Device Tree Bindings
+--------------------------------------------------------
+
+Required properties:
+- compatible		: Should be "nxp,lpc1850-scu"
+- reg			: Address and length of the register set for the device
+- clocks		: Clock specifier (see clock bindings for details)
+
+The lpc1850-scu driver uses the generic pin multiplexing and generic pin
+configuration documented in pinctrl-bindings.txt.
+
+The following generic nodes are supported:
+ - function
+ - pins
+ - bias-disable
+ - bias-pull-up
+ - bias-pull-down
+ - drive-strength
+ - input-enable
+ - input-disable
+ - input-schmitt-enable
+ - input-schmitt-disable
+ - slew-rate
+
+Not all pins support all properties so either refer to the NXP 1850/4350
+user manual or the pin table in the pinctrl-lpc18xx driver for supported
+pin properties.
+
+Example:
+pinctrl: pinctrl at 40086000 {
+	compatible = "nxp,lpc1850-scu";
+	reg = <0x40086000 0x1000>;
+	clocks = <&ccu1 CLK_CPU_SCU>;
+
+	i2c0_pins: i2c0-pins {
+		i2c0_pins_cfg {
+			pins = "i2c0_scl", "i2c0_sda";
+			function = "i2c0";
+			input-enable;
+		};
+	};
+
+	uart0_pins: uart0-pins {
+		uart0_rx_cfg {
+			pins = "pf_11";
+			function = "uart0";
+			bias-disable;
+			input-enable;
+		};
+
+		uart0_tx_cfg {
+			pins = "pf_10";
+			function = "uart0";
+			bias-disable;
+		};
+	};
+};
Signature · 1 line
1.8.0
#3 lore raw

v2 cover pinctrl for NXP LPC18xx family

In reply to Joachim Eastwood
Quoted 8 lines · Joachim Eastwood

This patch set adds a pinctrl driver for NXP LPC18xx/43xx devices.

The pinctrl driver uses the generic muxing and properties DT bindings as described in pinctrl-bindings.txt. There is still two TODOs left in the pinctrl driver regarding property control of special usb1 pins but I would like it merged regardless of this. Support will be added once I get USB up and running on the MCU.

Quoted 7 lines

Checkpatch complains a lot about the driver but that's what you get when you embedd a large function/pin spec table from the data sheet I guess.

Changes since v1:
- minor white space fixes
- split pinctrl/gpio patch set
- rebase on v4.1-rc1

Saw this v2 version arrived so took that instead of v1.

Applied.

Yours,
Linus Walleij