@@ -441,7 +441,7 @@ static unsigned int lpuart_get_baud_clk_rate(struct lpuart_port *sport)
441
441
442
442
static void lpuart_stop_tx (struct uart_port * port )
443
443
{
444
- unsigned char temp ;
444
+ u8 temp ;
445
445
446
446
temp = readb (port -> membase + UARTCR2 );
447
447
temp &= ~(UARTCR2_TIE | UARTCR2_TCIE );
@@ -450,7 +450,7 @@ static void lpuart_stop_tx(struct uart_port *port)
450
450
451
451
static void lpuart32_stop_tx (struct uart_port * port )
452
452
{
453
- unsigned long temp ;
453
+ u32 temp ;
454
454
455
455
temp = lpuart32_read (port , UARTCTRL );
456
456
temp &= ~(UARTCTRL_TIE | UARTCTRL_TCIE );
@@ -459,15 +459,15 @@ static void lpuart32_stop_tx(struct uart_port *port)
459
459
460
460
static void lpuart_stop_rx (struct uart_port * port )
461
461
{
462
- unsigned char temp ;
462
+ u8 temp ;
463
463
464
464
temp = readb (port -> membase + UARTCR2 );
465
465
writeb (temp & ~UARTCR2_RE , port -> membase + UARTCR2 );
466
466
}
467
467
468
468
static void lpuart32_stop_rx (struct uart_port * port )
469
469
{
470
- unsigned long temp ;
470
+ u32 temp ;
471
471
472
472
temp = lpuart32_read (port , UARTCTRL );
473
473
lpuart32_write (port , temp & ~UARTCTRL_RE , UARTCTRL );
@@ -642,7 +642,7 @@ static int lpuart_poll_init(struct uart_port *port)
642
642
struct lpuart_port * sport = container_of (port ,
643
643
struct lpuart_port , port );
644
644
unsigned long flags ;
645
- unsigned char temp ;
645
+ u8 temp ;
646
646
647
647
sport -> port .fifosize = 0 ;
648
648
@@ -752,7 +752,7 @@ static inline void lpuart_transmit_buffer(struct lpuart_port *sport)
752
752
static inline void lpuart32_transmit_buffer (struct lpuart_port * sport )
753
753
{
754
754
struct tty_port * tport = & sport -> port .state -> port ;
755
- unsigned long txcnt ;
755
+ u32 txcnt ;
756
756
unsigned char c ;
757
757
758
758
if (sport -> port .x_char ) {
@@ -789,7 +789,7 @@ static void lpuart_start_tx(struct uart_port *port)
789
789
{
790
790
struct lpuart_port * sport = container_of (port ,
791
791
struct lpuart_port , port );
792
- unsigned char temp ;
792
+ u8 temp ;
793
793
794
794
temp = readb (port -> membase + UARTCR2 );
795
795
writeb (temp | UARTCR2_TIE , port -> membase + UARTCR2 );
@@ -806,7 +806,7 @@ static void lpuart_start_tx(struct uart_port *port)
806
806
static void lpuart32_start_tx (struct uart_port * port )
807
807
{
808
808
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
809
- unsigned long temp ;
809
+ u32 temp ;
810
810
811
811
if (sport -> lpuart_dma_tx_use ) {
812
812
if (!lpuart_stopped_or_empty (port ))
@@ -839,8 +839,8 @@ static unsigned int lpuart_tx_empty(struct uart_port *port)
839
839
{
840
840
struct lpuart_port * sport = container_of (port ,
841
841
struct lpuart_port , port );
842
- unsigned char sr1 = readb (port -> membase + UARTSR1 );
843
- unsigned char sfifo = readb (port -> membase + UARTSFIFO );
842
+ u8 sr1 = readb (port -> membase + UARTSR1 );
843
+ u8 sfifo = readb (port -> membase + UARTSFIFO );
844
844
845
845
if (sport -> dma_tx_in_progress )
846
846
return 0 ;
@@ -855,9 +855,9 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port)
855
855
{
856
856
struct lpuart_port * sport = container_of (port ,
857
857
struct lpuart_port , port );
858
- unsigned long stat = lpuart32_read (port , UARTSTAT );
859
- unsigned long sfifo = lpuart32_read (port , UARTFIFO );
860
- unsigned long ctrl = lpuart32_read (port , UARTCTRL );
858
+ u32 stat = lpuart32_read (port , UARTSTAT );
859
+ u32 sfifo = lpuart32_read (port , UARTFIFO );
860
+ u32 ctrl = lpuart32_read (port , UARTCTRL );
861
861
862
862
if (sport -> dma_tx_in_progress )
863
863
return 0 ;
@@ -884,7 +884,7 @@ static void lpuart_rxint(struct lpuart_port *sport)
884
884
{
885
885
unsigned int flg , ignored = 0 , overrun = 0 ;
886
886
struct tty_port * port = & sport -> port .state -> port ;
887
- unsigned char rx , sr ;
887
+ u8 rx , sr ;
888
888
889
889
uart_port_lock (& sport -> port );
890
890
@@ -961,7 +961,7 @@ static void lpuart32_rxint(struct lpuart_port *sport)
961
961
{
962
962
unsigned int flg , ignored = 0 ;
963
963
struct tty_port * port = & sport -> port .state -> port ;
964
- unsigned long rx , sr ;
964
+ u32 rx , sr ;
965
965
bool is_break ;
966
966
967
967
uart_port_lock (& sport -> port );
@@ -1039,7 +1039,7 @@ static void lpuart32_rxint(struct lpuart_port *sport)
1039
1039
static irqreturn_t lpuart_int (int irq , void * dev_id )
1040
1040
{
1041
1041
struct lpuart_port * sport = dev_id ;
1042
- unsigned char sts ;
1042
+ u8 sts ;
1043
1043
1044
1044
sts = readb (sport -> port .membase + UARTSR1 );
1045
1045
@@ -1113,7 +1113,7 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport)
1113
1113
int count , copied ;
1114
1114
1115
1115
if (lpuart_is_32 (sport )) {
1116
- unsigned long sr = lpuart32_read (& sport -> port , UARTSTAT );
1116
+ u32 sr = lpuart32_read (& sport -> port , UARTSTAT );
1117
1117
1118
1118
if (sr & (UARTSTAT_PE | UARTSTAT_FE )) {
1119
1119
/* Clear the error flags */
@@ -1125,10 +1125,10 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport)
1125
1125
sport -> port .icount .frame ++ ;
1126
1126
}
1127
1127
} else {
1128
- unsigned char sr = readb (sport -> port .membase + UARTSR1 );
1128
+ u8 sr = readb (sport -> port .membase + UARTSR1 );
1129
1129
1130
1130
if (sr & (UARTSR1_PE | UARTSR1_FE )) {
1131
- unsigned char cr2 ;
1131
+ u8 cr2 ;
1132
1132
1133
1133
/* Disable receiver during this operation... */
1134
1134
cr2 = readb (sport -> port .membase + UARTCR2 );
@@ -1279,7 +1279,7 @@ static void lpuart32_dma_idleint(struct lpuart_port *sport)
1279
1279
static irqreturn_t lpuart32_int (int irq , void * dev_id )
1280
1280
{
1281
1281
struct lpuart_port * sport = dev_id ;
1282
- unsigned long sts , rxcount ;
1282
+ u32 sts , rxcount ;
1283
1283
1284
1284
sts = lpuart32_read (& sport -> port , UARTSTAT );
1285
1285
rxcount = lpuart32_read (& sport -> port , UARTWATER );
@@ -1411,12 +1411,12 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
1411
1411
dma_async_issue_pending (chan );
1412
1412
1413
1413
if (lpuart_is_32 (sport )) {
1414
- unsigned long temp = lpuart32_read (& sport -> port , UARTBAUD );
1414
+ u32 temp = lpuart32_read (& sport -> port , UARTBAUD );
1415
1415
1416
1416
lpuart32_write (& sport -> port , temp | UARTBAUD_RDMAE , UARTBAUD );
1417
1417
1418
1418
if (sport -> dma_idle_int ) {
1419
- unsigned long ctrl = lpuart32_read (& sport -> port , UARTCTRL );
1419
+ u32 ctrl = lpuart32_read (& sport -> port , UARTCTRL );
1420
1420
1421
1421
lpuart32_write (& sport -> port , ctrl | UARTCTRL_ILIE , UARTCTRL );
1422
1422
}
@@ -1482,7 +1482,7 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio
1482
1482
struct lpuart_port * sport = container_of (port ,
1483
1483
struct lpuart_port , port );
1484
1484
1485
- unsigned long modem = lpuart32_read (& sport -> port , UARTMODIR )
1485
+ u32 modem = lpuart32_read (& sport -> port , UARTMODIR )
1486
1486
& ~(UARTMODIR_TXRTSPOL | UARTMODIR_TXRTSE );
1487
1487
u32 ctrl ;
1488
1488
@@ -1577,7 +1577,7 @@ static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl)
1577
1577
1578
1578
static void lpuart_break_ctl (struct uart_port * port , int break_state )
1579
1579
{
1580
- unsigned char temp ;
1580
+ u8 temp ;
1581
1581
1582
1582
temp = readb (port -> membase + UARTCR2 ) & ~UARTCR2_SBK ;
1583
1583
@@ -1589,7 +1589,7 @@ static void lpuart_break_ctl(struct uart_port *port, int break_state)
1589
1589
1590
1590
static void lpuart32_break_ctl (struct uart_port * port , int break_state )
1591
1591
{
1592
- unsigned long temp ;
1592
+ u32 temp ;
1593
1593
1594
1594
temp = lpuart32_read (port , UARTCTRL );
1595
1595
@@ -1623,8 +1623,7 @@ static void lpuart32_break_ctl(struct uart_port *port, int break_state)
1623
1623
1624
1624
static void lpuart_setup_watermark (struct lpuart_port * sport )
1625
1625
{
1626
- unsigned char val , cr2 ;
1627
- unsigned char cr2_saved ;
1626
+ u8 val , cr2 , cr2_saved ;
1628
1627
1629
1628
cr2 = readb (sport -> port .membase + UARTCR2 );
1630
1629
cr2_saved = cr2 ;
@@ -1657,7 +1656,7 @@ static void lpuart_setup_watermark(struct lpuart_port *sport)
1657
1656
1658
1657
static void lpuart_setup_watermark_enable (struct lpuart_port * sport )
1659
1658
{
1660
- unsigned char cr2 ;
1659
+ u8 cr2 ;
1661
1660
1662
1661
lpuart_setup_watermark (sport );
1663
1662
@@ -1668,8 +1667,7 @@ static void lpuart_setup_watermark_enable(struct lpuart_port *sport)
1668
1667
1669
1668
static void lpuart32_setup_watermark (struct lpuart_port * sport )
1670
1669
{
1671
- unsigned long val , ctrl ;
1672
- unsigned long ctrl_saved ;
1670
+ u32 val , ctrl , ctrl_saved ;
1673
1671
1674
1672
ctrl = lpuart32_read (& sport -> port , UARTCTRL );
1675
1673
ctrl_saved = ctrl ;
@@ -1778,7 +1776,7 @@ static void lpuart_tx_dma_startup(struct lpuart_port *sport)
1778
1776
static void lpuart_rx_dma_startup (struct lpuart_port * sport )
1779
1777
{
1780
1778
int ret ;
1781
- unsigned char cr3 ;
1779
+ u8 cr3 ;
1782
1780
1783
1781
if (uart_console (& sport -> port ))
1784
1782
goto err ;
@@ -1828,7 +1826,7 @@ static void lpuart_hw_setup(struct lpuart_port *sport)
1828
1826
static int lpuart_startup (struct uart_port * port )
1829
1827
{
1830
1828
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1831
- unsigned char temp ;
1829
+ u8 temp ;
1832
1830
1833
1831
/* determine FIFO size and enable FIFO mode */
1834
1832
temp = readb (sport -> port .membase + UARTPFIFO );
@@ -1848,7 +1846,7 @@ static int lpuart_startup(struct uart_port *port)
1848
1846
1849
1847
static void lpuart32_hw_disable (struct lpuart_port * sport )
1850
1848
{
1851
- unsigned long temp ;
1849
+ u32 temp ;
1852
1850
1853
1851
temp = lpuart32_read (& sport -> port , UARTCTRL );
1854
1852
temp &= ~(UARTCTRL_RIE | UARTCTRL_ILIE | UARTCTRL_RE |
@@ -1858,7 +1856,7 @@ static void lpuart32_hw_disable(struct lpuart_port *sport)
1858
1856
1859
1857
static void lpuart32_configure (struct lpuart_port * sport )
1860
1858
{
1861
- unsigned long temp ;
1859
+ u32 temp ;
1862
1860
1863
1861
temp = lpuart32_read (& sport -> port , UARTCTRL );
1864
1862
if (!sport -> lpuart_dma_rx_use )
@@ -1888,7 +1886,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport)
1888
1886
static int lpuart32_startup (struct uart_port * port )
1889
1887
{
1890
1888
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1891
- unsigned long temp ;
1889
+ u32 temp ;
1892
1890
1893
1891
/* determine FIFO size */
1894
1892
temp = lpuart32_read (& sport -> port , UARTFIFO );
@@ -1942,7 +1940,7 @@ static void lpuart_dma_shutdown(struct lpuart_port *sport)
1942
1940
static void lpuart_shutdown (struct uart_port * port )
1943
1941
{
1944
1942
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
1945
- unsigned char temp ;
1943
+ u8 temp ;
1946
1944
unsigned long flags ;
1947
1945
1948
1946
uart_port_lock_irqsave (port , & flags );
@@ -1962,7 +1960,7 @@ static void lpuart32_shutdown(struct uart_port *port)
1962
1960
{
1963
1961
struct lpuart_port * sport =
1964
1962
container_of (port , struct lpuart_port , port );
1965
- unsigned long temp ;
1963
+ u32 temp ;
1966
1964
unsigned long flags ;
1967
1965
1968
1966
uart_port_lock_irqsave (port , & flags );
@@ -1998,7 +1996,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios,
1998
1996
{
1999
1997
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
2000
1998
unsigned long flags ;
2001
- unsigned char cr1 , old_cr1 , old_cr2 , cr3 , cr4 , bdh , modem ;
1999
+ u8 cr1 , old_cr1 , old_cr2 , cr3 , cr4 , bdh , modem ;
2002
2000
unsigned int baud ;
2003
2001
unsigned int old_csize = old ? old -> c_cflag & CSIZE : CS8 ;
2004
2002
unsigned int sbr , brfa ;
@@ -2236,7 +2234,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
2236
2234
{
2237
2235
struct lpuart_port * sport = container_of (port , struct lpuart_port , port );
2238
2236
unsigned long flags ;
2239
- unsigned long ctrl , old_ctrl , bd , modem ;
2237
+ u32 ctrl , old_ctrl , bd , modem ;
2240
2238
unsigned int baud ;
2241
2239
unsigned int old_csize = old ? old -> c_cflag & CSIZE : CS8 ;
2242
2240
@@ -2503,7 +2501,7 @@ static void
2503
2501
lpuart_console_write (struct console * co , const char * s , unsigned int count )
2504
2502
{
2505
2503
struct lpuart_port * sport = lpuart_ports [co -> index ];
2506
- unsigned char old_cr2 , cr2 ;
2504
+ u8 old_cr2 , cr2 ;
2507
2505
unsigned long flags ;
2508
2506
int locked = 1 ;
2509
2507
@@ -2533,7 +2531,7 @@ static void
2533
2531
lpuart32_console_write (struct console * co , const char * s , unsigned int count )
2534
2532
{
2535
2533
struct lpuart_port * sport = lpuart_ports [co -> index ];
2536
- unsigned long old_cr , cr ;
2534
+ u32 old_cr , cr ;
2537
2535
unsigned long flags ;
2538
2536
int locked = 1 ;
2539
2537
@@ -2567,7 +2565,7 @@ static void __init
2567
2565
lpuart_console_get_options (struct lpuart_port * sport , int * baud ,
2568
2566
int * parity , int * bits )
2569
2567
{
2570
- unsigned char cr , bdh , bdl , brfa ;
2568
+ u8 cr , bdh , bdl , brfa ;
2571
2569
unsigned int sbr , uartclk , baud_raw ;
2572
2570
2573
2571
cr = readb (sport -> port .membase + UARTCR2 );
@@ -2616,7 +2614,7 @@ static void __init
2616
2614
lpuart32_console_get_options (struct lpuart_port * sport , int * baud ,
2617
2615
int * parity , int * bits )
2618
2616
{
2619
- unsigned long cr , bd ;
2617
+ u32 cr , bd ;
2620
2618
unsigned int sbr , uartclk , baud_raw ;
2621
2619
2622
2620
cr = lpuart32_read (& sport -> port , UARTCTRL );
@@ -2822,7 +2820,7 @@ static int lpuart_global_reset(struct lpuart_port *sport)
2822
2820
{
2823
2821
struct uart_port * port = & sport -> port ;
2824
2822
void __iomem * global_addr ;
2825
- unsigned long ctrl , bd ;
2823
+ u32 ctrl , bd ;
2826
2824
unsigned int val = 0 ;
2827
2825
int ret ;
2828
2826
@@ -3028,7 +3026,7 @@ static int lpuart_runtime_resume(struct device *dev)
3028
3026
3029
3027
static void serial_lpuart_enable_wakeup (struct lpuart_port * sport , bool on )
3030
3028
{
3031
- unsigned int val , baud ;
3029
+ u32 val , baud ;
3032
3030
3033
3031
if (lpuart_is_32 (sport )) {
3034
3032
val = lpuart32_read (& sport -> port , UARTCTRL );
@@ -3093,7 +3091,7 @@ static int lpuart_suspend_noirq(struct device *dev)
3093
3091
static int lpuart_resume_noirq (struct device * dev )
3094
3092
{
3095
3093
struct lpuart_port * sport = dev_get_drvdata (dev );
3096
- unsigned int val ;
3094
+ u32 val ;
3097
3095
3098
3096
pinctrl_pm_select_default_state (dev );
3099
3097
@@ -3113,7 +3111,8 @@ static int lpuart_resume_noirq(struct device *dev)
3113
3111
static int lpuart_suspend (struct device * dev )
3114
3112
{
3115
3113
struct lpuart_port * sport = dev_get_drvdata (dev );
3116
- unsigned long temp , flags ;
3114
+ u32 temp ;
3115
+ unsigned long flags ;
3117
3116
3118
3117
uart_suspend_port (& lpuart_reg , & sport -> port );
3119
3118
0 commit comments