Thread (5 messages) 5 messages, 3 authors, 2011-07-06

[PATCH v3 1/2] serial/imx: get rid of the uses of cpu_is_mx1()

From: Shawn Guo <hidden>
Date: 2011-07-06 16:50:08
Also in: linux-devicetree, linux-serial

On Wed, Jul 06, 2011 at 06:37:40PM +0200, Sascha Hauer wrote:
On Thu, Jul 07, 2011 at 12:30:13AM +0800, Shawn Guo wrote:
quoted
The patch removes all the uses of cpu_is_mx1().  Instead, it uses
the .id_table of platform_driver to distinguish the uart device type,
IMX1_UART and IMX21_UART.  The IMX21_UART type runs on all i.mx
except i.mx1.

A couple of !cpu_is_mx1() logic gets turned into IS_IMX21_UART,
as the codes wrapped there are really IMX21 type uart specific.

It also removes macro MX1_UCR3_REF25 and MX1_UCR3_REF30 which are
not used anywhere.
Two typos and one minor nitpick, otherwise I'm fine with it. Should go
via the i.MX tree rather than the serial tree. Alan?

quoted
Signed-off-by: Shawn Guo <redacted>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Alan Cox <redacted>
Acked-by: Grant Likely <redacted>
---
 arch/arm/mach-imx/clock-imx1.c                |    6 +-
 arch/arm/mach-imx/clock-imx21.c               |    8 ++--
 arch/arm/mach-imx/clock-imx25.c               |   11 ++--
 arch/arm/mach-imx/clock-imx27.c               |   13 +++--
 arch/arm/mach-imx/clock-imx31.c               |   11 ++--
 arch/arm/mach-imx/clock-imx35.c               |    7 ++-
 arch/arm/mach-mx5/clock-mx51-mx53.c           |   18 ++++---
 arch/arm/plat-mxc/devices/platform-imx-uart.c |    7 ++-
 drivers/tty/serial/imx.c                      |   66 ++++++++++++++++++++-----
 9 files changed, 97 insertions(+), 50 deletions(-)
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index a65838f..42ef76a 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -272,11 +272,12 @@ DEFINE_CLOCK(can2_clk,	 1, CCM_CGCR1,  3, get_rate_ipg, NULL, NULL);
 	},
 
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
index cfce8c9..a425a5a 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c
@@ -152,7 +152,7 @@ struct platform_device *__init imx_add_imx_uart_3irq(
 		},
 	};
 
-	return imx_add_platform_device("imx-uart", data->id, res,
+	return imx_add_platform_device("imx1-uart", data->id, res,
 			ARRAY_SIZE(res), pdata, sizeof(*pdata));
 }
 
@@ -172,6 +172,7 @@ struct platform_device *__init imx_add_imx_uart_1irq(
 		},
 	};
 
-	return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res),
-			pdata, sizeof(*pdata));
+	/* i.mx21 type uart runs on all i.mx expcept i.mx1 */
s/expcept/except/
quoted
 #define  UCR3_AIRINTEN   (1<<5)  /* Async IR wake interrupt enable */
 #define  UCR3_AWAKEN	 (1<<4)  /* Async wake interrupt enable */
-#define  MX1_UCR3_REF25 	 (1<<3)  /* Ref freq 25 MHz, only on mx1 */
-#define  MX1_UCR3_REF30 	 (1<<2)  /* Ref Freq 30 MHz, only on mx1 */
-#define  MX2_UCR3_RXDMUXSEL	 (1<<2)  /* RXD Muxed Input Select, on mx2/mx3 */
+#define  IMX21_UCR3_RXDMUXSEL	 (1<<2)  /* RXD Muxed Input Select */
 #define  UCR3_INVT  	 (1<<1)  /* Inverted Infrared transmission */
 #define  UCR3_BPEN  	 (1<<0)  /* Preset registers enable */
 #define  UCR4_CTSTL_SHF  10      /* CTS trigger level shift */
@@ -181,6 +179,18 @@
 
 #define UART_NR 8
 
+/* i.mx21 type uart runs on all i.mx expcept i.mx1 */
ditto
quoted
 
+#define UTS (sport->devdata->uts_reg)
+#define IS_IMX1_UART()	(sport->devdata->devtype == IMX1_UART)
+#define IS_IMX21_UART()	(sport->devdata->devtype == IMX21_UART)
Can we make this a static inline function?
Ok, will resend it right now to get these fixed.

-- 
Regards,
Shawn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help