Re: [PATCH v5] serial:st-asc: Add ST ASC driver.

2013-06-25 Thread Srinivas KANDAGATLA
On 25/06/13 00:38, Greg Kroah-Hartman wrote:
 On Mon, Jun 24, 2013 at 08:21:43AM +0100, Srinivas KANDAGATLA wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@st.com

 This patch adds support to ASC (asynchronous serial controller)
 driver, which is basically a standard serial driver. This IP is common
 across all the ST parts for settop box platforms.

 ASC is embedded in ST COMMS IP block. It supports Rx  Tx functionality.
 It support all industry standard baud rates.

 Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
 CC: Stephen Gallimore stephen.gallim...@st.com
 CC: Stuart Menefy stuart.men...@st.com
 CC: Arnd Bergmann a...@arndb.de
 ---
 Hi Greg,

 This patch is the part of the driver support for Sti SOCs.
 This patch undergone 3-4 cycles of review in arm-kernel mailing list.
 As Arnd prefered to take only SOC support patches via arm-soc, Am 
 sending this patch seperately.

 If its not too late, can you consider this patch for 3.11 via tty tree?
 
 I would have taken it, but it breaks the build on my machine:
Thanks Greg,

I know the problem, some of the members in struct device are conditional
with PINCTRL support.
I think that's breaking build on your machine.

I will fix it and resend as you suggested.

Thanks,
srini
 
 drivers/tty/serial/st-asc.c: In function ‘asc_serial_resume’:
 drivers/tty/serial/st-asc.c:774:15: error: ‘struct device’ has no member 
 named ‘pins’
 drivers/tty/serial/st-asc.c:775:3: error: implicit declaration of function 
 ‘pinctrl_select_state’ [-Werror=implicit-function-declaration]
 drivers/tty/serial/st-asc.c:775:37: error: ‘struct device’ has no member 
 named ‘pins’
 drivers/tty/serial/st-asc.c:776:16: error: ‘struct device’ has no member 
 named ‘pins’
 
 Please test your patches out on a normal Linux system.

 
 Please feel free to resend this after 3.11-rc1 is out, for inclusion in
 3.12, after you have fixed the build problems.
 
 greg k-h
 
 

___
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss


[PATCH v5] serial:st-asc: Add ST ASC driver.

2013-06-24 Thread Srinivas KANDAGATLA
From: Srinivas Kandagatla srinivas.kandaga...@st.com

This patch adds support to ASC (asynchronous serial controller)
driver, which is basically a standard serial driver. This IP is common
across all the ST parts for settop box platforms.

ASC is embedded in ST COMMS IP block. It supports Rx  Tx functionality.
It support all industry standard baud rates.

Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
CC: Stephen Gallimore stephen.gallim...@st.com
CC: Stuart Menefy stuart.men...@st.com
CC: Arnd Bergmann a...@arndb.de
CC: Greg Kroah-Hartman gre...@linuxfoundation.org
---
Hi Greg,

This patch is the part of the driver support for Sti SOCs.
This patch undergone 3-4 cycles of review in arm-kernel mailing list.
As Arnd prefered to take only SOC support patches via arm-soc, Am 
sending this patch seperately.

If its not too late, can you consider this patch for 3.11 via tty tree?

Thanks,
srini

Changes since v4:
- rebased with tty-next branch from git.kernel.org tty repo.

Changes since v3:
- None.

Changes since v2:
- st-asc driver made POSIX compatible based on Russell K comment.

Changes since RFC:
- modified kconfig to remove default y
- removed all the forward declaration.
- use dynamic major numbering.
- merge header-file in to driver.

 .../devicetree/bindings/tty/serial/st-asc.txt  |   18 +
 drivers/tty/serial/Kconfig |   16 +
 drivers/tty/serial/Makefile|1 +
 drivers/tty/serial/st-asc.c|  939 
 include/uapi/linux/serial_core.h   |3 +
 5 files changed, 977 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/tty/serial/st-asc.txt
 create mode 100644 drivers/tty/serial/st-asc.c

diff --git a/Documentation/devicetree/bindings/tty/serial/st-asc.txt 
b/Documentation/devicetree/bindings/tty/serial/st-asc.txt
new file mode 100644
index 000..75d877f
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/st-asc.txt
@@ -0,0 +1,18 @@
+*st-asc(Serial Port)
+
+Required properties:
+- compatible : Should be st,asc.
+- reg, reg-names, interrupts, interrupt-names  : Standard way to define device
+   resources with names. look in
+   Documentation/devicetree/bindings/resource-names.txt
+
+Optional properties:
+- st,hw-flow-ctrl  bool flag to enable hardware flow control.
+- st,force-m1  bool flat to force asc to be in Mode-1 recommeded
+   for high bit rates (above 19.2K)
+Example:
+serial@fe44{
+compatible= st,asc;
+reg = 0xfe44 0x2c;
+interrupts =  0 209 0;
+};
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 46dd1c7..4e0a3a6 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1497,6 +1497,22 @@ config SERIAL_FSL_LPUART_CONSOLE
  If you have enabled the lpuart serial port on the Freescale SoCs,
  you can make it the console by answering Y to this option.
 
+config SERIAL_ST_ASC
+   tristate ST ASC serial port support
+   select SERIAL_CORE
+   help
+ This driver is for the on-chip Asychronous Serial Controller on
+ STMicroelectronics STi SoCs.
+ ASC is embedded in ST COMMS IP block. It supports Rx  Tx 
functionality.
+ It support all industry standard baud rates.
+
+ If unsure, say N.
+
+config SERIAL_ST_ASC_CONSOLE
+   bool Support for console on ST ASC
+   depends on SERIAL_ST_ASC=y
+   select SERIAL_CORE_CONSOLE
+
 endmenu
 
 endif # TTY
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index cf650f0..47b679c 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_SERIAL_KGDB_NMI) += kgdb_nmi.o
 obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
 obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
 obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
+obj-$(CONFIG_SERIAL_ST_ASC) += st-asc.o
 obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
 obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
 obj-$(CONFIG_SERIAL_TIMBERDALE)+= timbuart.o
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
new file mode 100644
index 000..5edf82f
--- /dev/null
+++ b/drivers/tty/serial/st-asc.c
@@ -0,0 +1,939 @@
+/*
+ * st-asc.c: ST Asynchronous serial controller (ASC) driver
+ *
+ * Copyright (C) 2003-2013 STMicroelectronics (RD) Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#if defined(CONFIG_SERIAL_ST_ASC_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
+#include linux/module.h
+#include linux/serial.h
+#include linux/console.h
+#include 

Re: [PATCH v5] serial:st-asc: Add ST ASC driver.

2013-06-24 Thread Greg Kroah-Hartman
On Mon, Jun 24, 2013 at 08:21:43AM +0100, Srinivas KANDAGATLA wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@st.com
 
 This patch adds support to ASC (asynchronous serial controller)
 driver, which is basically a standard serial driver. This IP is common
 across all the ST parts for settop box platforms.
 
 ASC is embedded in ST COMMS IP block. It supports Rx  Tx functionality.
 It support all industry standard baud rates.
 
 Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
 CC: Stephen Gallimore stephen.gallim...@st.com
 CC: Stuart Menefy stuart.men...@st.com
 CC: Arnd Bergmann a...@arndb.de
 ---
 Hi Greg,
 
 This patch is the part of the driver support for Sti SOCs.
 This patch undergone 3-4 cycles of review in arm-kernel mailing list.
 As Arnd prefered to take only SOC support patches via arm-soc, Am 
 sending this patch seperately.
 
 If its not too late, can you consider this patch for 3.11 via tty tree?

I would have taken it, but it breaks the build on my machine:

drivers/tty/serial/st-asc.c: In function ‘asc_serial_resume’:
drivers/tty/serial/st-asc.c:774:15: error: ‘struct device’ has no member named 
‘pins’
drivers/tty/serial/st-asc.c:775:3: error: implicit declaration of function 
‘pinctrl_select_state’ [-Werror=implicit-function-declaration]
drivers/tty/serial/st-asc.c:775:37: error: ‘struct device’ has no member named 
‘pins’
drivers/tty/serial/st-asc.c:776:16: error: ‘struct device’ has no member named 
‘pins’

Please test your patches out on a normal Linux system.

Please feel free to resend this after 3.11-rc1 is out, for inclusion in
3.12, after you have fixed the build problems.

greg k-h
___
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss