linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Tony Lindgren <tony@atomide.com>, Alan Cox <alan@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: [RFC 23/24] SERIAL: omap: move driver private definitions and structures to driver
Date: Sat, 06 Oct 2012 13:46:48 +0100	[thread overview]
Message-ID: <E1TKTmK-0002nu-1Q@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20121006123803.GD15246@n2100.arm.linux.org.uk>

struct uart_omap_port and struct uart_omap_dma, and associated
definitions are private to the driver, so there's no point them sitting
in an include file under arch/arm.  Move them into the driver itself.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/plat-omap/include/plat/omap-serial.h |   87 ------------------------
 drivers/tty/serial/omap-serial.c              |   88 +++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 87 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 6403441..bad00f1 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -32,35 +32,9 @@
  */
 #define OMAP_SERIAL_NAME	"ttyO"
 
-#define OMAP_MODE13X_SPEED	230400
-
-#define OMAP_UART_SCR_TX_EMPTY	0x08
-
-/* WER = 0x7F
- * Enable module level wakeup in WER reg
- */
-#define OMAP_UART_WER_MOD_WKUP	0X7F
-
-/* Enable XON/XOFF flow control on output */
-#define OMAP_UART_SW_TX		0x08
-
-/* Enable XON/XOFF flow control on input */
-#define OMAP_UART_SW_RX		0x02
-
 #define OMAP_UART_SYSC_RESET	0X07
-#define OMAP_UART_TCR_TRIG	0X0F
-#define OMAP_UART_SW_CLR	0XF0
 #define OMAP_UART_FIFO_CLR	0X06
 
-#define OMAP_UART_DMA_CH_FREE	-1
-
-#define OMAP_MAX_HSUART_PORTS	4
-
-#define MSR_SAVE_FLAGS		UART_MSR_ANY_DELTA
-
-#define UART_ERRATA_i202_MDR1_ACCESS	BIT(0)
-#define UART_ERRATA_i291_DMA_FORCEIDLE	BIT(1)
-
 struct omap_uart_port_info {
 	bool			dma_enabled;	/* To specify DMA Mode */
 	unsigned int		uartclk;	/* UART clock rate */
@@ -76,65 +50,4 @@ struct omap_uart_port_info {
 	void (*enable_wakeup)(struct platform_device *, bool);
 };
 
-struct uart_omap_dma {
-	u8			uart_dma_tx;
-	u8			uart_dma_rx;
-	int			rx_dma_channel;
-	int			tx_dma_channel;
-	dma_addr_t		rx_buf_dma_phys;
-	dma_addr_t		tx_buf_dma_phys;
-	unsigned int		uart_base;
-	/*
-	 * Buffer for rx dma.It is not required for tx because the buffer
-	 * comes from port structure.
-	 */
-	unsigned char		*rx_buf;
-	unsigned int		prev_rx_dma_pos;
-	int			tx_buf_size;
-	int			tx_dma_used;
-	int			rx_dma_used;
-	spinlock_t		tx_lock;
-	spinlock_t		rx_lock;
-	/* timer to poll activity on rx dma */
-	struct timer_list	rx_timer;
-	unsigned int		rx_buf_size;
-	unsigned int		rx_poll_rate;
-	unsigned int		rx_timeout;
-};
-
-struct uart_omap_port {
-	struct uart_port	port;
-	struct uart_omap_dma	uart_dma;
-	struct platform_device	*pdev;
-
-	unsigned char		ier;
-	unsigned char		lcr;
-	unsigned char		mcr;
-	unsigned char		fcr;
-	unsigned char		efr;
-	unsigned char		dll;
-	unsigned char		dlh;
-	unsigned char		mdr1;
-	unsigned char		scr;
-
-	int			use_dma;
-	/*
-	 * Some bits in registers are cleared on a read, so they must
-	 * be saved whenever the register is read but the bits will not
-	 * be immediately processed.
-	 */
-	unsigned int		lsr_break_flag;
-	unsigned char		msr_saved_flags;
-	char			name[20];
-	unsigned long		port_activity;
-	u32			context_loss_cnt;
-	u32			errata;
-	u8			wakeups_enabled;
-
-	struct pm_qos_request	pm_qos_request;
-	u32			latency;
-	u32			calc_latency;
-	struct work_struct	qos_work;
-};
-
 #endif /* __OMAP_SERIAL_H__ */
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index a5482da..fad157c 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -44,6 +44,8 @@
 #include <plat/dmtimer.h>
 #include <plat/omap-serial.h>
 
+#define OMAP_MAX_HSUART_PORTS	4
+
 #define UART_BUILD_REVISION(x, y)	(((x) << 8) | (y))
 
 #define OMAP_UART_REV_42 0x0402
@@ -51,6 +53,9 @@
 #define OMAP_UART_REV_52 0x0502
 #define OMAP_UART_REV_63 0x0603
 
+#define UART_ERRATA_i202_MDR1_ACCESS	BIT(0)
+#define UART_ERRATA_i291_DMA_FORCEIDLE	BIT(1)
+
 #define DEFAULT_CLK_SPEED 48000000 /* 48Mhz*/
 
 /* SCR register bitmasks */
@@ -71,6 +76,89 @@
 #define OMAP_UART_MVR_MAJ_SHIFT		8
 #define OMAP_UART_MVR_MIN_MASK		0x3f
 
+#define OMAP_UART_DMA_CH_FREE	-1
+
+#define MSR_SAVE_FLAGS		UART_MSR_ANY_DELTA
+#define OMAP_MODE13X_SPEED	230400
+
+#define OMAP_UART_SCR_TX_EMPTY	0x08
+
+/* WER = 0x7F
+ * Enable module level wakeup in WER reg
+ */
+#define OMAP_UART_WER_MOD_WKUP	0X7F
+
+/* Enable XON/XOFF flow control on output */
+#define OMAP_UART_SW_TX		0x08
+
+/* Enable XON/XOFF flow control on input */
+#define OMAP_UART_SW_RX		0x02
+
+#define OMAP_UART_SW_CLR	0xF0
+
+#define OMAP_UART_TCR_TRIG	0x0F
+
+struct uart_omap_dma {
+	u8			uart_dma_tx;
+	u8			uart_dma_rx;
+	int			rx_dma_channel;
+	int			tx_dma_channel;
+	dma_addr_t		rx_buf_dma_phys;
+	dma_addr_t		tx_buf_dma_phys;
+	unsigned int		uart_base;
+	/*
+	 * Buffer for rx dma.It is not required for tx because the buffer
+	 * comes from port structure.
+	 */
+	unsigned char		*rx_buf;
+	unsigned int		prev_rx_dma_pos;
+	int			tx_buf_size;
+	int			tx_dma_used;
+	int			rx_dma_used;
+	spinlock_t		tx_lock;
+	spinlock_t		rx_lock;
+	/* timer to poll activity on rx dma */
+	struct timer_list	rx_timer;
+	unsigned int		rx_buf_size;
+	unsigned int		rx_poll_rate;
+	unsigned int		rx_timeout;
+};
+
+struct uart_omap_port {
+	struct uart_port	port;
+	struct uart_omap_dma	uart_dma;
+	struct platform_device	*pdev;
+
+	unsigned char		ier;
+	unsigned char		lcr;
+	unsigned char		mcr;
+	unsigned char		fcr;
+	unsigned char		efr;
+	unsigned char		dll;
+	unsigned char		dlh;
+	unsigned char		mdr1;
+	unsigned char		scr;
+
+	int			use_dma;
+	/*
+	 * Some bits in registers are cleared on a read, so they must
+	 * be saved whenever the register is read but the bits will not
+	 * be immediately processed.
+	 */
+	unsigned int		lsr_break_flag;
+	unsigned char		msr_saved_flags;
+	char			name[20];
+	unsigned long		port_activity;
+	u32			context_loss_cnt;
+	u32			errata;
+	u8			wakeups_enabled;
+
+	struct pm_qos_request	pm_qos_request;
+	u32			latency;
+	u32			calc_latency;
+	struct work_struct	qos_work;
+};
+
 static struct uart_omap_port *serial_omap_port(struct uart_port *port)
 {
 	return container_of(port, struct uart_omap_port, port);
-- 
1.7.4.4


  parent reply	other threads:[~2012-10-06 12:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06 12:38 [RFC 00/24] OMAP serial driver flow control fixes, and preparation for DMA engine conversion Russell King - ARM Linux
2012-10-06 12:39 ` [RFC 01/24] SERIAL: omap: fix set_mctrl() breakage Russell King
2012-10-06 12:39 ` [RFC 02/24] SERIAL: omap: fix bit masks for software flow control Russell King
2012-10-06 12:40 ` [RFC 03/24] SERIAL: omap: remove setting of EFR SCD bit Russell King
2012-10-06 12:40 ` [RFC 04/24] SERIAL: omap: fix MCR TCRTLR bit handling Russell King
2012-10-06 12:40 ` [RFC 05/24] SERIAL: omap: no need to re-read EFR Russell King
2012-10-06 12:41 ` [RFC 06/24] SERIAL: omap: allow hardware assisted rts/cts modes to be disabled Russell King
2012-10-06 12:41 ` [RFC 07/24] SERIAL: omap: allow hardware assisted IXANY mode " Russell King
2012-10-06 12:41 ` [RFC 08/24] SERIAL: core: use local variable uport in uart_set_termios() Russell King
2012-10-06 12:42 ` [RFC 09/24] SERIAL: core: add hardware assisted s/w flow control support Russell King
2012-10-06 12:42 ` [RFC 10/24] SERIAL: core: add hardware assisted h/w " Russell King
2012-10-06 12:42 ` [RFC 11/24] SERIAL: core: add throttle/unthrottle callbacks for hardware assisted flow control Russell King
2012-10-06 12:43 ` [RFC 12/24] SERIAL: omap: fix " Russell King
2012-10-06 12:43 ` [RFC 13/24] SERIAL: omap: configure xon/xoff before setting modem control lines Russell King
2012-10-06 12:43 ` [RFC 14/24] SERIAL: omap: serial_omap_configure_xonxoff() contents into set_termios Russell King
2012-10-06 12:44 ` [RFC 15/24] SERIAL: omap: don't read back LCR/MCR/EFR Russell King
2012-10-06 12:44 ` [RFC 16/24] SERIAL: omap: simplify Russell King
2012-10-06 12:44 ` [RFC 17/24] SERIAL: omap: always set TCR Russell King
2012-10-06 12:45 ` [RFC 18/24] SERIAL: omap: move xon/xoff setting earlier Russell King
2012-10-06 12:45 ` [RFC 19/24] SERIAL: omap: simplify (2) Russell King
2012-10-06 12:45 ` [RFC 20/24] SERIAL: core: add xmit buffer allocation callbacks Russell King
2012-10-06 15:49   ` Alan Cox
2012-10-06 16:51     ` Russell King - ARM Linux
2012-10-06 12:46 ` [RFC 21/24] SERIAL: omap: use tx buffer allocation API Russell King
2012-10-06 12:46 ` [RFC 22/24] SERIAL: omap: typesafe conversion from uart_port to uart_omap_port Russell King
2012-10-06 12:46 ` Russell King [this message]
2012-10-06 12:47 ` [RFC 24/24] SERIAL: omap: remove OMAP_UART_SYSC_RESET and OMAP_UART_FIFO_CLR Russell King
2012-10-06 14:23 ` [RFC 00/24] OMAP serial driver flow control fixes, and preparation for DMA engine conversion Russell King - ARM Linux
2012-10-06 14:39 ` Russell King - ARM Linux
2012-10-06 15:35 ` Russell King - ARM Linux
2012-10-06 15:50 ` Alan Cox
2012-10-09 13:34 ` Sourav
2012-10-10 18:29   ` Kevin Hilman
2012-10-11  9:43     ` Sourav
2012-10-11  9:54       ` Russell King - ARM Linux
2012-10-11 10:21         ` Sourav
2012-10-11 11:08           ` Russell King - ARM Linux
2012-10-11 14:05           ` Jon Hunter
2012-10-12 14:51           ` Grazvydas Ignotas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1TKTmK-0002nu-1Q@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).