Commit d2de9601 authored by Baolin Wang's avatar Baolin Wang Committed by Greg Kroah-Hartman

serial: sprd: Fix the indentation issue

Make the macros' definition and code have the same correct indentation.
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Acked-by: default avatarChunyan Zhang <chunyan.zhang@spreadtrum.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dd22161e
...@@ -68,24 +68,24 @@ ...@@ -68,24 +68,24 @@
#define SPRD_LCR_DATA_LEN6 0x4 #define SPRD_LCR_DATA_LEN6 0x4
#define SPRD_LCR_DATA_LEN7 0x8 #define SPRD_LCR_DATA_LEN7 0x8
#define SPRD_LCR_DATA_LEN8 0xc #define SPRD_LCR_DATA_LEN8 0xc
#define SPRD_LCR_PARITY (BIT(0) | BIT(1)) #define SPRD_LCR_PARITY (BIT(0) | BIT(1))
#define SPRD_LCR_PARITY_EN 0x2 #define SPRD_LCR_PARITY_EN 0x2
#define SPRD_LCR_EVEN_PAR 0x0 #define SPRD_LCR_EVEN_PAR 0x0
#define SPRD_LCR_ODD_PAR 0x1 #define SPRD_LCR_ODD_PAR 0x1
/* control register 1 */ /* control register 1 */
#define SPRD_CTL1 0x001C #define SPRD_CTL1 0x001C
#define RX_HW_FLOW_CTL_THLD BIT(6) #define RX_HW_FLOW_CTL_THLD BIT(6)
#define RX_HW_FLOW_CTL_EN BIT(7) #define RX_HW_FLOW_CTL_EN BIT(7)
#define TX_HW_FLOW_CTL_EN BIT(8) #define TX_HW_FLOW_CTL_EN BIT(8)
#define RX_TOUT_THLD_DEF 0x3E00 #define RX_TOUT_THLD_DEF 0x3E00
#define RX_HFC_THLD_DEF 0x40 #define RX_HFC_THLD_DEF 0x40
/* fifo threshold register */ /* fifo threshold register */
#define SPRD_CTL2 0x0020 #define SPRD_CTL2 0x0020
#define THLD_TX_EMPTY 0x40 #define THLD_TX_EMPTY 0x40
#define THLD_TX_EMPTY_SHIFT 8 #define THLD_TX_EMPTY_SHIFT 8
#define THLD_RX_FULL 0x40 #define THLD_RX_FULL 0x40
/* config baud rate register */ /* config baud rate register */
#define SPRD_CLKD0 0x0024 #define SPRD_CLKD0 0x0024
...@@ -95,11 +95,11 @@ ...@@ -95,11 +95,11 @@
#define SPRD_CLKD1_SHIFT 16 #define SPRD_CLKD1_SHIFT 16
/* interrupt mask status register */ /* interrupt mask status register */
#define SPRD_IMSR 0x002C #define SPRD_IMSR 0x002C
#define SPRD_IMSR_RX_FIFO_FULL BIT(0) #define SPRD_IMSR_RX_FIFO_FULL BIT(0)
#define SPRD_IMSR_TX_FIFO_EMPTY BIT(1) #define SPRD_IMSR_TX_FIFO_EMPTY BIT(1)
#define SPRD_IMSR_BREAK_DETECT BIT(7) #define SPRD_IMSR_BREAK_DETECT BIT(7)
#define SPRD_IMSR_TIMEOUT BIT(13) #define SPRD_IMSR_TIMEOUT BIT(13)
struct sprd_uart_port { struct sprd_uart_port {
struct uart_port port; struct uart_port port;
...@@ -229,7 +229,7 @@ static inline void sprd_rx(struct uart_port *port) ...@@ -229,7 +229,7 @@ static inline void sprd_rx(struct uart_port *port)
port->icount.rx++; port->icount.rx++;
if (lsr & (SPRD_LSR_BI | SPRD_LSR_PE | if (lsr & (SPRD_LSR_BI | SPRD_LSR_PE |
SPRD_LSR_FE | SPRD_LSR_OE)) SPRD_LSR_FE | SPRD_LSR_OE))
if (handle_lsr_errors(port, &lsr, &flag)) if (handle_lsr_errors(port, &lsr, &flag))
continue; continue;
if (uart_handle_sysrq_char(port, ch)) if (uart_handle_sysrq_char(port, ch))
...@@ -292,8 +292,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) ...@@ -292,8 +292,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id)
if (ims & SPRD_IMSR_TIMEOUT) if (ims & SPRD_IMSR_TIMEOUT)
serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT); serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);
if (ims & (SPRD_IMSR_RX_FIFO_FULL | if (ims & (SPRD_IMSR_RX_FIFO_FULL | SPRD_IMSR_BREAK_DETECT |
SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT)) SPRD_IMSR_TIMEOUT))
sprd_rx(port); sprd_rx(port);
if (ims & SPRD_IMSR_TX_FIFO_EMPTY) if (ims & SPRD_IMSR_TX_FIFO_EMPTY)
...@@ -333,7 +333,7 @@ static int sprd_startup(struct uart_port *port) ...@@ -333,7 +333,7 @@ static int sprd_startup(struct uart_port *port)
sp = container_of(port, struct sprd_uart_port, port); sp = container_of(port, struct sprd_uart_port, port);
snprintf(sp->name, sizeof(sp->name), "sprd_serial%d", port->line); snprintf(sp->name, sizeof(sp->name), "sprd_serial%d", port->line);
ret = devm_request_irq(port->dev, port->irq, sprd_handle_irq, ret = devm_request_irq(port->dev, port->irq, sprd_handle_irq,
IRQF_SHARED, sp->name, port); IRQF_SHARED, sp->name, port);
if (ret) { if (ret) {
dev_err(port->dev, "fail to request serial irq %d, ret=%d\n", dev_err(port->dev, "fail to request serial irq %d, ret=%d\n",
port->irq, ret); port->irq, ret);
...@@ -361,8 +361,8 @@ static void sprd_shutdown(struct uart_port *port) ...@@ -361,8 +361,8 @@ static void sprd_shutdown(struct uart_port *port)
} }
static void sprd_set_termios(struct uart_port *port, static void sprd_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *termios,
struct ktermios *old) struct ktermios *old)
{ {
unsigned int baud, quot; unsigned int baud, quot;
unsigned int lcr = 0, fc; unsigned int lcr = 0, fc;
...@@ -480,8 +480,7 @@ static void sprd_config_port(struct uart_port *port, int flags) ...@@ -480,8 +480,7 @@ static void sprd_config_port(struct uart_port *port, int flags)
port->type = PORT_SPRD; port->type = PORT_SPRD;
} }
static int sprd_verify_port(struct uart_port *port, static int sprd_verify_port(struct uart_port *port, struct serial_struct *ser)
struct serial_struct *ser)
{ {
if (ser->type != PORT_SPRD) if (ser->type != PORT_SPRD)
return -EINVAL; return -EINVAL;
...@@ -531,7 +530,7 @@ static void sprd_console_putchar(struct uart_port *port, int ch) ...@@ -531,7 +530,7 @@ static void sprd_console_putchar(struct uart_port *port, int ch)
} }
static void sprd_console_write(struct console *co, const char *s, static void sprd_console_write(struct console *co, const char *s,
unsigned int count) unsigned int count)
{ {
struct uart_port *port = &sprd_port[co->index]->port; struct uart_port *port = &sprd_port[co->index]->port;
int locked = 1; int locked = 1;
...@@ -594,7 +593,7 @@ static void sprd_putc(struct uart_port *port, int c) ...@@ -594,7 +593,7 @@ static void sprd_putc(struct uart_port *port, int c)
unsigned int timeout = SPRD_TIMEOUT; unsigned int timeout = SPRD_TIMEOUT;
while (timeout-- && while (timeout-- &&
!(readl(port->membase + SPRD_LSR) & SPRD_LSR_TX_OVER)) !(readl(port->membase + SPRD_LSR) & SPRD_LSR_TX_OVER))
cpu_relax(); cpu_relax();
writeb(c, port->membase + SPRD_TXD); writeb(c, port->membase + SPRD_TXD);
...@@ -607,9 +606,8 @@ static void sprd_early_write(struct console *con, const char *s, unsigned int n) ...@@ -607,9 +606,8 @@ static void sprd_early_write(struct console *con, const char *s, unsigned int n)
uart_console_write(&dev->port, s, n, sprd_putc); uart_console_write(&dev->port, s, n, sprd_putc);
} }
static int __init sprd_early_console_setup( static int __init sprd_early_console_setup(struct earlycon_device *device,
struct earlycon_device *device, const char *opt)
const char *opt)
{ {
if (!device->port.membase) if (!device->port.membase)
return -ENODEV; return -ENODEV;
...@@ -691,8 +689,8 @@ static int sprd_probe(struct platform_device *pdev) ...@@ -691,8 +689,8 @@ static int sprd_probe(struct platform_device *pdev)
index = sprd_probe_dt_alias(index, &pdev->dev); index = sprd_probe_dt_alias(index, &pdev->dev);
sprd_port[index] = devm_kzalloc(&pdev->dev, sprd_port[index] = devm_kzalloc(&pdev->dev, sizeof(*sprd_port[index]),
sizeof(*sprd_port[index]), GFP_KERNEL); GFP_KERNEL);
if (!sprd_port[index]) if (!sprd_port[index])
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment