Skip to contentSkip to conversation

serial: clps711x: Driver refactor

PATCH New Alexander Shiyan 1 participant 1 message Dec 11, 2013

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

PATCH 1/2 serial: clps711x: Driver refactor

This is a complex patch for refactoring CLPS711X serial driver. Major changes:
- Eliminate <mach/hardware.h> usage.
- Devicetree support.

---
 arch/arm/mach-clps711x/devices.c |  21 ++
 drivers/tty/serial/clps711x.c    | 448 ++++++++++++++++++++++-----------------
 2 files changed, 275 insertions(+), 194 deletions(-)
arch/arm/mach-clps711x/devices.c +21 -0
index fb77d14..2001488 100644
@@ -61,8 +61,29 @@ static void __init clps711x_add_syscon(void)
 						&clps711x_syscon_res[i], 1);
 }
 
+static const struct resource clps711x_uart1_res[] __initconst = {
+	DEFINE_RES_MEM(CLPS711X_PHYS_BASE + UARTDR1, SZ_128),
+	DEFINE_RES_IRQ(IRQ_UTXINT1),
+	DEFINE_RES_IRQ(IRQ_URXINT1),
+};
+
+static const struct resource clps711x_uart2_res[] __initconst = {
+	DEFINE_RES_MEM(CLPS711X_PHYS_BASE + UARTDR2, SZ_128),
+	DEFINE_RES_IRQ(IRQ_UTXINT2),
+	DEFINE_RES_IRQ(IRQ_URXINT2),
+};
+
+static void __init clps711x_add_uart(void)
+{
+	platform_device_register_simple("clps711x-uart", 0, clps711x_uart1_res,
+					ARRAY_SIZE(clps711x_uart1_res));
+	platform_device_register_simple("clps711x-uart", 1, clps711x_uart2_res,
+					ARRAY_SIZE(clps711x_uart2_res));
+};
+
 void __init clps711x_devices_init(void)
 {
 	clps711x_add_gpio();
 	clps711x_add_syscon();
+	clps711x_add_uart();
 }
drivers/tty/serial/clps711x.c +254 -194

653 lines not on this page · raw message

Signature · 1 line
1.8.3.2