1 /* linux/drivers/serial/samsung.h
3 * Driver for Samsung SoC onboard UARTs.
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 struct s3c24xx_uart_info {
16 unsigned int fifosize;
17 unsigned long rx_fifomask;
18 unsigned long rx_fifoshift;
19 unsigned long rx_fifofull;
20 unsigned long tx_fifomask;
21 unsigned long tx_fifoshift;
22 unsigned long tx_fifofull;
24 /* clock source control */
26 int (*get_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk);
27 int (*set_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk);
30 int (*reset_port)(struct uart_port *, struct s3c2410_uartcfg *);
33 struct s3c24xx_uart_port {
34 unsigned char rx_claimed;
35 unsigned char tx_claimed;
37 struct s3c24xx_uart_info *info;
38 struct s3c24xx_uart_clksrc *clksrc;
41 struct uart_port port;
44 /* conversion functions */
46 #define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata(__dev)
47 #define s3c24xx_dev_to_cfg(__dev) (struct s3c2410_uartcfg *)((__dev)->platform_data)
49 /* register access controls */
51 #define portaddr(port, reg) ((port)->membase + (reg))
53 #define rd_regb(port, reg) (__raw_readb(portaddr(port, reg)))
54 #define rd_regl(port, reg) (__raw_readl(portaddr(port, reg)))
56 #define wr_regb(port, reg, val) __raw_writeb(val, portaddr(port, reg))
57 #define wr_regl(port, reg, val) __raw_writel(val, portaddr(port, reg))
59 extern int s3c24xx_serial_probe(struct platform_device *dev,
60 struct s3c24xx_uart_info *uart);
62 extern int s3c24xx_serial_remove(struct platform_device *dev);
64 extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
65 struct s3c24xx_uart_info *uart);
67 extern int s3c24xx_serial_init(struct platform_driver *drv,
68 struct s3c24xx_uart_info *info);
70 #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
72 #define s3c24xx_console_init(__drv, __inf) \
73 static int __init s3c_serial_console_init(void) \
75 return s3c24xx_serial_initconsole(__drv, __inf); \
78 console_initcall(s3c_serial_console_init)
81 #define s3c24xx_console_init(drv, inf) extern void no_console(void)
84 #ifdef CONFIG_SERIAL_SAMSUNG_DEBUG
86 extern void printascii(const char *);
88 static void dbg(const char *fmt, ...)
94 vsprintf(buff, fmt, va);
101 #define dbg(x...) do { } while (0)