Skip to contentSkip to conversation

serial: sc16is7xx

PATCH Superseded [email protected] 2 participants 5 messages Mar 25, 2014 – Mar 26, 2014

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 serial: sc16is7xx

From: Jon Ringle <[email protected]>

The SC16IS7xx is a slave I2C-bus/SPI interface to a single-channel high performance UART. The SC16IS7xx’s internal register set is backward-compatible with the widely used and widely popular 16C450.

The SC16IS7xx also provides additional advanced features such as auto hardware and software flow control, automatic RS-485 support, and software reset.

---
 drivers/tty/serial/Kconfig       |   10 +
 drivers/tty/serial/Makefile      |    1 +
 drivers/tty/serial/sc16is7xx.c   | 1256 ++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |    3 +
 4 files changed, 1270 insertions(+)
 create mode 100644 drivers/tty/serial/sc16is7xx.c
drivers/tty/serial/Kconfig +10 -0
index febd45c..6e8fe23 100644
@@ -1179,6 +1179,16 @@ config SERIAL_SCCNXP_CONSOLE
 	help
 	  Support for console on SCCNXP serial ports.
 
+config SERIAL_SC16IS7XX
+	tristate "SC16IS7xx serial support"
+	select SERIAL_CORE
+	select REGMAP_I2C if I2C
+	default n
+	help
+	  This selects support for SC16IS7xx serial ports.
+	  Supported ICs are SC16IS740, SC16IS741, SC16IS750, SC16IS752,
+	  SC16IS760 and SC16IS762.
+
 config SERIAL_BFIN_SPORT
 	tristate "Blackfin SPORT emulate UART"
 	depends on BLACKFIN
drivers/tty/serial/Makefile +1 -0
index 3068c77..c3bac45 100644
@@ -49,6 +49,7 @@ obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o
 obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
 obj-$(CONFIG_SERIAL_SC26XX) += sc26xx.o
 obj-$(CONFIG_SERIAL_SCCNXP) += sccnxp.o
+obj-$(CONFIG_SERIAL_SC16IS7XX) += sc16is7xx.o
 obj-$(CONFIG_SERIAL_JSM) += jsm/
 obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
 obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
drivers/tty/serial/sc16is7xx.c new file +1256 -0

1,256 lines not on this page · raw message

include/uapi/linux/serial_core.h +3 -0
index b47dba2..a37c79a 100644
@@ -238,4 +238,7 @@
 /* Tilera TILE-Gx UART */
 #define PORT_TILEGX	106
 
+/* SC16IS74xx */
+#define PORT_SC16IS7XX   107
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
1.8.5.4
#1 lore raw

PATCH v2 2/2 serial: sc16is7xx: Add bindings documentation for the SC16IS7XX UARTs

From: Jon Ringle <[email protected]>

This patch adds the devicetree documentation for the NXP SC16IS7XX UARTs.

---
 .../devicetree/bindings/serial/nxp,sc16is7xx.txt   | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +35 -0
new file mode 100644
index 0000000..cd9ae33
@@ -0,0 +1,35 @@
+* NXP SC16IS7xx advanced Universal Asynchronous Receiver-Transmitter (UART)
+
+Required properties:
+- compatible: Should be one of the following:
+  - "nxp,sc16is740" for NXP SC16IS740,
+  - "nxp,sc16is741" for NXP SC16IS741,
+  - "nxp,sc16is750" for NXP SC16IS750,
+  - "nxp,sc16is752" for NXP SC16IS752,
+  - "nxp,sc16is760" for NXP SC16IS760,
+  - "nxp,sc16is762" for NXP SC16IS762.
+- reg: I2C address of the SC16IS7xx device.
+- interrupt-parent: The phandle for the interrupt controller that
+  services interrupts for this IC.
+- interrupts: Specifies the interrupt source of the parent interrupt
+  controller. The format of the interrupt specifier depends on the
+  parent interrupt controller.
+- clocks: phandle to the IC source clock.
+
+Optional properties:
+- gpio-controller: Marks the device node as a GPIO controller.
+- #gpio-cells: Should be two. The first cell is the GPIO number and
+  the second cell is used to specify the GPIO polarity:
+    0 = active high,
+    1 = active low.
+
+Example:
+        sc16is750: sc16is750@51 {
+                compatible = "nxp,sc16is750";
+                reg = <0x51>;
+                clocks = <&clk20m>;
+                interrupt-parent = <&gpio3>;
+                interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
+                gpio-controller;
+                #gpio-cells = <2>;
+        };
Signature · 1 line
1.8.5.4
#2 lore raw

Re: [PATCH v2 2/2] serial: sc16is7xx: Add bindings documentation for the SC16IS7XX UARTs

Quoted 16 lines · On Tue, Mar 25, 2014 at 06:19:24PM +0000, [email protected] wrote:

From: Jon Ringle <[email protected]>

This patch adds the devicetree documentation for the NXP SC16IS7XX UARTs.

---
 .../devicetree/bindings/serial/nxp,sc16is7xx.txt   | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +0 -0
new file mode 100644
index 0000000..cd9ae33

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +10 -0
@@ -0,0 +1,35 @@
+* NXP SC16IS7xx advanced Universal Asynchronous Receiver-Transmitter (UART)
+
+Required properties:
+- compatible: Should be one of the following:
+  - "nxp,sc16is740" for NXP SC16IS740,
+  - "nxp,sc16is741" for NXP SC16IS741,
+  - "nxp,sc16is750" for NXP SC16IS750,
+  - "nxp,sc16is752" for NXP SC16IS752,
+  - "nxp,sc16is760" for NXP SC16IS760,
+  - "nxp,sc16is762" for NXP SC16IS762.

These all look fine.

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt line 16

Quoted 6 lines
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +6 -0
+- reg: I2C address of the SC16IS7xx device.
+- interrupt-parent: The phandle for the interrupt controller that
+  services interrupts for this IC.
+- interrupts: Specifies the interrupt source of the parent interrupt
+  controller. The format of the interrupt specifier depends on the
+  parent interrupt controller.

Just describe what the device-specific interrupt logically is, not what the interrupts property means in general.

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +1 -0
+- clocks: phandle to the IC source clock.

Nit: clocks aren't just referred to with phandles; there's a clock specifier too.

Either correct the type here or don't mention the type at all, given this is a common property.

Quoted 26 lines
Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +18 -0
+
+Optional properties:
+- gpio-controller: Marks the device node as a GPIO controller.
+- #gpio-cells: Should be two. The first cell is the GPIO number and
+  the second cell is used to specify the GPIO polarity:
+    0 = active high,
+    1 = active low.
+
+Example:
+        sc16is750: sc16is750@51 {
+                compatible = "nxp,sc16is750";
+                reg = <0x51>;
+                clocks = <&clk20m>;
+                interrupt-parent = <&gpio3>;
+                interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
+                gpio-controller;
+                #gpio-cells = <2>;
+        };
Signature · 6 lines
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#3 lore raw

Re: [PATCH v2 2/2] serial: sc16is7xx: Add bindings documentation for the SC16IS7XX UARTs

Quoted 10 lines · Mark Rutland

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt line 16

Quoted 5 lines · On Tue, Mar 25, 2014 at 06:19:24PM +0000, [email protected] wrote:

+- interrupt-parent: The phandle for the interrupt controller that

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +4 -0
+  services interrupts for this IC.
+- interrupts: Specifies the interrupt source of the parent interrupt
+  controller. The format of the interrupt specifier depends on the
+  parent interrupt controller.

Just describe what the device-specific interrupt logically is, not what the interrupts property means in general.

Something like this ok?:

-interrupts: Should contain the UART interrupt

Quoted 8 lines
Quoted 1 line

+- clocks: phandle to the IC source clock.

Nit: clocks aren't just referred to with phandles; there's a clock specifier too.

Either correct the type here or don't mention the type at all, given this is a common property.

I'm not sure what to do here. Many of the other devicetree/bindings/serial/*.txt use phandle verbage and also the devicetree/bindings/clock-bindings.txt documentation for clocks refers the type as phandle too:

==Clock consumers==

Required properties:
clocks: List of phandle and clock specifier pairs, one pair
for each clock input to the device. Note: if the clock provider specifies '0' for #clock-cells, then only the phandle portion of the pair will appear.

Is something like this ok?:

clocks: reference to the source clock

Jon

#4 lore raw

Re: [PATCH v2 2/2] serial: sc16is7xx: Add bindings documentation for the SC16IS7XX UARTs

Quoted 8 lines · Jon Ringle
Quoted 7 lines · Mark Rutland
Quoted 5 lines · On Tue, Mar 25, 2014 at 06:19:24PM +0000, [email protected] wrote:

+- interrupt-parent: The phandle for the interrupt controller that

Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt new file +4 -0
+  services interrupts for this IC.
+- interrupts: Specifies the interrupt source of the parent interrupt
+  controller. The format of the interrupt specifier depends on the
+  parent interrupt controller.
Quoted 7 lines
Quoted 3 lines

Just describe what the device-specific interrupt logically is, not what the interrupts property means in general.

Something like this ok?:

-interrupts: Should contain the UART interrupt

Sure.

Quoted 15 lines
Quoted 9 lines
Quoted 2 lines

+- clocks: phandle to the IC source clock.

Nit: clocks aren't just referred to with phandles; there's a clock specifier too.

Either correct the type here or don't mention the type at all, given this is a common property.

I'm not sure what to do here. Many of the other devicetree/bindings/serial/*.txt use phandle verbage and also the devicetree/bindings/clock-bindings.txt documentation for clocks refers the type as phandle too:

Quoted 8 lines

==Clock consumers==

Required properties:
clocks: List of phandle and clock specifier pairs, one pair
for each clock input to the device. Note: if the clock provider specifies '0' for #clock-cells, then only the phandle portion of the pair will appear.

Those bindings which refer to clocks as just being phandles are simply wrong.

While clocks _may_ be simply phandles, that isn't the general case (and when this is the case they can be thought of as having a zero cell clock-specifier). The quoted portion of the core clock bindings describes clocks as consisting of "phandle and and clock specifier pairs", not just phandles.

Quoted 3 lines

Is something like this ok?:

clocks: reference to the source clock

Sure. That'll be fine.

Thanks,
Mark.