1 #ifndef __MTK_UART_INTF_H__
2 #define __MTK_UART_INTF_H__
4 #include "platform_uart.h"
5 #include <linux/platform_device.h>
6 /*---------------------------------------------------------------------------*/
8 /*---------------------------------------------------------------------------*/
9 int fiq_uart_getc(struct platform_device
*pdev
);
10 void fiq_uart_putc(struct platform_device
*pdev
, unsigned int c
);
11 void fiq_uart_fixup(int uart_port
);
12 irqreturn_t
mt_debug_signal_irq(int irq
, void *dev_id
);
13 int mt_fiq_init(void *arg
);
14 /*---------------------------------------------------------------------------*/
15 struct mtk_uart_setting
*get_uart_default_settings(int idx
);
17 void* get_apdma_uart0_base(void);
18 unsigned int get_uart_vfifo_irq_id(int idx
);
19 void set_uart_default_settings(int idx
);
21 unsigned long get_uart_evt_mask(int idx
);
22 void mtk_uart_switch_tx_to_gpio(struct mtk_uart
*uart
);
23 void mtk_uart_switch_to_tx(struct mtk_uart
*uart
);
24 void mtk_uart_switch_rx_to_gpio(struct mtk_uart
*uart
);
25 void mtk_uart_switch_to_rx(struct mtk_uart
*uart
);
26 void set_uart_evt_mask(int idx
, int value
);
27 unsigned long get_uart_lsr_status(int idx
);
28 void set_uart_lsr_status(int idx
, int value
);
29 unsigned char get_modem_status(int idx
);
30 void dump_uart_reg(void);
31 void mtk_uart_console_setting_switch(struct mtk_uart
*uart
);
32 int mtk_uart_vfifo_is_empty(struct mtk_uart_vfifo
*vfifo
);
33 void mtk_uart_tx_vfifo_flush(struct mtk_uart
*uart
, int timeout
);
34 int mtk_uart_vfifo_get_counts(struct mtk_uart_vfifo
*vfifo
);
35 void mtk_uart_dma_vfifo_tx_tasklet(unsigned long arg
);
36 void mtk_uart_dma_vfifo_rx_tasklet(unsigned long arg
);
37 int mtk_uart_vfifo_enable(struct mtk_uart
*uart
, struct mtk_uart_vfifo
*vfifo
);
38 int mtk_uart_vfifo_disable(struct mtk_uart
*uart
, struct mtk_uart_vfifo
*vfifo
);
39 void mtk_uart_vfifo_enable_tx_intr(struct mtk_uart
*uart
);
40 void mtk_uart_vfifo_disable_tx_intr(struct mtk_uart
*uart
);
41 void mtk_uart_vfifo_enable_rx_intr(struct mtk_uart
*uart
);
42 void mtk_uart_vfifo_disable_rx_intr(struct mtk_uart
*uart
);
43 unsigned int mtk_uart_write_allow(struct mtk_uart
*uart
);
44 void mtk_uart_enable_intrs(struct mtk_uart
*uart
, long mask
);
45 void mtk_uart_disable_intrs(struct mtk_uart
*uart
, long mask
);
46 int mtk_uart_vfifo_is_full(struct mtk_uart_vfifo
*vfifo
);
47 void mtk_uart_stop_dma(struct mtk_uart_dma
*dma
);
48 void mtk_uart_reset_dma(struct mtk_uart_dma
*dma
);
49 void mtk_uart_set_mode(struct mtk_uart
*uart
, int mode
);
50 void mtk_uart_set_auto_baud(struct mtk_uart
*uart
);
51 void mtk_uart_baud_setting(struct mtk_uart
*uart
, int baudrate
);
52 void mtk_uart_dma_setup(struct mtk_uart
*uart
, struct mtk_uart_dma
*dma
);
53 int mtk_uart_dma_start(struct mtk_uart
*uart
, struct mtk_uart_dma
*dma
);
54 void mtk_uart_vfifo_write_byte(struct mtk_uart
*uart
, unsigned int byte
);
55 unsigned int mtk_uart_vfifo_read_byte(struct mtk_uart
*uart
);
56 unsigned int mtk_uart_read_status(struct mtk_uart
*uart
);
57 unsigned int mtk_uart_read_allow(struct mtk_uart
*uart
);
58 unsigned int mtk_uart_read_byte(struct mtk_uart
*uart
);
59 void mtk_uart_write_byte(struct mtk_uart
*uart
, unsigned int byte
);
60 unsigned int mtk_uart_filter_line_status(struct mtk_uart
*uart
);
61 void mtk_uart_fifo_set_trig(struct mtk_uart
*uart
, int tx_level
, int rx_level
);
62 void mtk_uart_enable_sleep(struct mtk_uart
*uart
);
63 void mtk_uart_fifo_init(struct mtk_uart
*uart
);
64 void mtk_uart_fifo_flush(struct mtk_uart
*uart
);
65 int mtk_uart_data_ready(struct mtk_uart
*uart
);
66 void mtk_uart_config(struct mtk_uart
*uart
, int datalen
, int stop
, int parity
);
67 void mtk_uart_set_flow_ctrl(struct mtk_uart
*uart
, int mode
);
68 void mtk_uart_power_up(struct mtk_uart
*uart
);
69 void mtk_uart_power_down(struct mtk_uart
*uart
);
70 void mtk_uart_get_modem_status(struct mtk_uart
*uart
);
71 void mtk_uart_rx_pre_handler(struct mtk_uart
*uart
, int intrs
);
72 int mtk_uart_get_interrupt(struct mtk_uart
*uart
);
73 void mtk_uart_intr_last_check(struct mtk_uart
*uart
, int intrs
);
74 void mtk_uart_set_mctrl(struct uart_port
*port
, unsigned int mctrl
);
75 unsigned int mtk_uart_get_mctrl(struct uart_port
*port
);
76 void mtk_uart_stop_rx(struct uart_port
*port
);
77 void mtk_uart_break_ctl(struct uart_port
*port
, int break_state
);
78 void mtk_uart_save(struct mtk_uart
*uart
);
79 void mtk_uart_restore(void);
80 void mtk_uart_vfifo_clear_tx_intr(struct mtk_uart_vfifo
*vfifo
);
81 void mtk_uart_vfifo_clear_rx_intr(struct mtk_uart_vfifo
*vfifo
);
82 void mtk_uart_init_debug_spinlock(void);
83 void reset_tx_raw_data(struct mtk_uart
*uart
);
84 void mtk_uart_enable_dpidle(struct mtk_uart
*uart
);
85 void mtk_uart_disable_dpidle(struct mtk_uart
*uart
);
86 int mtk_uart_plat_info_query(const char str
[]);
87 #endif /* MTK_UART_INTF_H */