diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 55 | ||||
-rw-r--r-- | drivers/input/keyboard/corgikbd.c | 6 | ||||
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 6 | ||||
-rw-r--r-- | drivers/input/keyboard/tosakbd.c | 6 | ||||
-rw-r--r-- | drivers/mmc/host/pxamci.c | 4 | ||||
-rw-r--r-- | drivers/serial/pxa.c | 5 |
6 files changed, 55 insertions, 27 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 44d838410f15..8b38ed0379d5 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -60,19 +60,21 @@ struct pxa_i2c { | |||
60 | u32 icrlog[32]; | 60 | u32 icrlog[32]; |
61 | 61 | ||
62 | void __iomem *reg_base; | 62 | void __iomem *reg_base; |
63 | unsigned int reg_shift; | ||
63 | 64 | ||
64 | unsigned long iobase; | 65 | unsigned long iobase; |
65 | unsigned long iosize; | 66 | unsigned long iosize; |
66 | 67 | ||
67 | int irq; | 68 | int irq; |
68 | int use_pio; | 69 | unsigned int use_pio :1; |
70 | unsigned int fast_mode :1; | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | #define _IBMR(i2c) ((i2c)->reg_base + 0) | 73 | #define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift)) |
72 | #define _IDBR(i2c) ((i2c)->reg_base + 8) | 74 | #define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift)) |
73 | #define _ICR(i2c) ((i2c)->reg_base + 0x10) | 75 | #define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift)) |
74 | #define _ISR(i2c) ((i2c)->reg_base + 0x18) | 76 | #define _ISR(i2c) ((i2c)->reg_base + (0xc << (i2c)->reg_shift)) |
75 | #define _ISAR(i2c) ((i2c)->reg_base + 0x20) | 77 | #define _ISAR(i2c) ((i2c)->reg_base + (0x10 << (i2c)->reg_shift)) |
76 | 78 | ||
77 | /* | 79 | /* |
78 | * I2C Slave mode address | 80 | * I2C Slave mode address |
@@ -188,14 +190,14 @@ static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c) | |||
188 | 190 | ||
189 | static void i2c_pxa_abort(struct pxa_i2c *i2c) | 191 | static void i2c_pxa_abort(struct pxa_i2c *i2c) |
190 | { | 192 | { |
191 | unsigned long timeout = jiffies + HZ/4; | 193 | int i = 250; |
192 | 194 | ||
193 | if (i2c_pxa_is_slavemode(i2c)) { | 195 | if (i2c_pxa_is_slavemode(i2c)) { |
194 | dev_dbg(&i2c->adap.dev, "%s: called in slave mode\n", __func__); | 196 | dev_dbg(&i2c->adap.dev, "%s: called in slave mode\n", __func__); |
195 | return; | 197 | return; |
196 | } | 198 | } |
197 | 199 | ||
198 | while (time_before(jiffies, timeout) && (readl(_IBMR(i2c)) & 0x1) == 0) { | 200 | while ((i > 0) && (readl(_IBMR(i2c)) & 0x1) == 0) { |
199 | unsigned long icr = readl(_ICR(i2c)); | 201 | unsigned long icr = readl(_ICR(i2c)); |
200 | 202 | ||
201 | icr &= ~ICR_START; | 203 | icr &= ~ICR_START; |
@@ -205,7 +207,8 @@ static void i2c_pxa_abort(struct pxa_i2c *i2c) | |||
205 | 207 | ||
206 | show_state(i2c); | 208 | show_state(i2c); |
207 | 209 | ||
208 | msleep(1); | 210 | mdelay(1); |
211 | i --; | ||
209 | } | 212 | } |
210 | 213 | ||
211 | writel(readl(_ICR(i2c)) & ~(ICR_MA | ICR_START | ICR_STOP), | 214 | writel(readl(_ICR(i2c)) & ~(ICR_MA | ICR_START | ICR_STOP), |
@@ -364,7 +367,7 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c) | |||
364 | writel(i2c->slave_addr, _ISAR(i2c)); | 367 | writel(i2c->slave_addr, _ISAR(i2c)); |
365 | 368 | ||
366 | /* set control register values */ | 369 | /* set control register values */ |
367 | writel(I2C_ICR_INIT, _ICR(i2c)); | 370 | writel(I2C_ICR_INIT | (i2c->fast_mode ? ICR_FM : 0), _ICR(i2c)); |
368 | 371 | ||
369 | #ifdef CONFIG_I2C_PXA_SLAVE | 372 | #ifdef CONFIG_I2C_PXA_SLAVE |
370 | dev_info(&i2c->adap.dev, "Enabling slave mode\n"); | 373 | dev_info(&i2c->adap.dev, "Enabling slave mode\n"); |
@@ -907,12 +910,6 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num | |||
907 | struct pxa_i2c *i2c = adap->algo_data; | 910 | struct pxa_i2c *i2c = adap->algo_data; |
908 | int ret, i; | 911 | int ret, i; |
909 | 912 | ||
910 | /* If the I2C controller is disabled we need to reset it (probably due | ||
911 | to a suspend/resume destroying state). We do this here as we can then | ||
912 | avoid worrying about resuming the controller before its users. */ | ||
913 | if (!(readl(_ICR(i2c)) & ICR_IUE)) | ||
914 | i2c_pxa_reset(i2c); | ||
915 | |||
916 | for (i = adap->retries; i >= 0; i--) { | 913 | for (i = adap->retries; i >= 0; i--) { |
917 | ret = i2c_pxa_do_xfer(i2c, msgs, num); | 914 | ret = i2c_pxa_do_xfer(i2c, msgs, num); |
918 | if (ret != I2C_RETRY) | 915 | if (ret != I2C_RETRY) |
@@ -993,6 +990,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
993 | ret = -EIO; | 990 | ret = -EIO; |
994 | goto eremap; | 991 | goto eremap; |
995 | } | 992 | } |
993 | i2c->reg_shift = (cpu_is_pxa3xx() && (dev->id == 1)) ? 0 : 1; | ||
996 | 994 | ||
997 | i2c->iobase = res->start; | 995 | i2c->iobase = res->start; |
998 | i2c->iosize = res_len(res); | 996 | i2c->iosize = res_len(res); |
@@ -1013,6 +1011,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1013 | if (plat) { | 1011 | if (plat) { |
1014 | i2c->adap.class = plat->class; | 1012 | i2c->adap.class = plat->class; |
1015 | i2c->use_pio = plat->use_pio; | 1013 | i2c->use_pio = plat->use_pio; |
1014 | i2c->fast_mode = plat->fast_mode; | ||
1016 | } | 1015 | } |
1017 | 1016 | ||
1018 | if (i2c->use_pio) { | 1017 | if (i2c->use_pio) { |
@@ -1082,9 +1081,33 @@ static int __exit i2c_pxa_remove(struct platform_device *dev) | |||
1082 | return 0; | 1081 | return 0; |
1083 | } | 1082 | } |
1084 | 1083 | ||
1084 | #ifdef CONFIG_PM | ||
1085 | static int i2c_pxa_suspend_late(struct platform_device *dev, pm_message_t state) | ||
1086 | { | ||
1087 | struct pxa_i2c *i2c = platform_get_drvdata(dev); | ||
1088 | clk_disable(i2c->clk); | ||
1089 | return 0; | ||
1090 | } | ||
1091 | |||
1092 | static int i2c_pxa_resume_early(struct platform_device *dev) | ||
1093 | { | ||
1094 | struct pxa_i2c *i2c = platform_get_drvdata(dev); | ||
1095 | |||
1096 | clk_enable(i2c->clk); | ||
1097 | i2c_pxa_reset(i2c); | ||
1098 | |||
1099 | return 0; | ||
1100 | } | ||
1101 | #else | ||
1102 | #define i2c_pxa_suspend_late NULL | ||
1103 | #define i2c_pxa_resume_early NULL | ||
1104 | #endif | ||
1105 | |||
1085 | static struct platform_driver i2c_pxa_driver = { | 1106 | static struct platform_driver i2c_pxa_driver = { |
1086 | .probe = i2c_pxa_probe, | 1107 | .probe = i2c_pxa_probe, |
1087 | .remove = __exit_p(i2c_pxa_remove), | 1108 | .remove = __exit_p(i2c_pxa_remove), |
1109 | .suspend_late = i2c_pxa_suspend_late, | ||
1110 | .resume_early = i2c_pxa_resume_early, | ||
1088 | .driver = { | 1111 | .driver = { |
1089 | .name = "pxa2xx-i2c", | 1112 | .name = "pxa2xx-i2c", |
1090 | .owner = THIS_MODULE, | 1113 | .owner = THIS_MODULE, |
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 134e67bf6a90..c8ed065ea0cb 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -80,9 +80,9 @@ struct corgikbd { | |||
80 | #define KB_ACTIVATE_DELAY 10 | 80 | #define KB_ACTIVATE_DELAY 10 |
81 | 81 | ||
82 | /* Helper functions for reading the keyboard matrix | 82 | /* Helper functions for reading the keyboard matrix |
83 | * Note: We should really be using pxa_gpio_mode to alter GPDR but it | 83 | * Note: We should really be using the generic gpio functions to alter |
84 | * requires a function call per GPIO bit which is excessive | 84 | * GPDR but it requires a function call per GPIO bit which is |
85 | * when we need to access 12 bits at once multiple times. | 85 | * excessive when we need to access 12 bits at once, multiple times. |
86 | * These functions must be called within local_irq_save()/local_irq_restore() | 86 | * These functions must be called within local_irq_save()/local_irq_restore() |
87 | * or similar. | 87 | * or similar. |
88 | */ | 88 | */ |
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index de67b8e0a799..c48b76a46a58 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -101,9 +101,9 @@ struct spitzkbd { | |||
101 | #define KB_ACTIVATE_DELAY 10 | 101 | #define KB_ACTIVATE_DELAY 10 |
102 | 102 | ||
103 | /* Helper functions for reading the keyboard matrix | 103 | /* Helper functions for reading the keyboard matrix |
104 | * Note: We should really be using pxa_gpio_mode to alter GPDR but it | 104 | * Note: We should really be using the generic gpio functions to alter |
105 | * requires a function call per GPIO bit which is excessive | 105 | * GPDR but it requires a function call per GPIO bit which is |
106 | * when we need to access 11 bits at once, multiple times. | 106 | * excessive when we need to access 11 bits at once, multiple times. |
107 | * These functions must be called within local_irq_save()/local_irq_restore() | 107 | * These functions must be called within local_irq_save()/local_irq_restore() |
108 | * or similar. | 108 | * or similar. |
109 | */ | 109 | */ |
diff --git a/drivers/input/keyboard/tosakbd.c b/drivers/input/keyboard/tosakbd.c index 44cb50af3ce9..677276b12020 100644 --- a/drivers/input/keyboard/tosakbd.c +++ b/drivers/input/keyboard/tosakbd.c | |||
@@ -59,9 +59,9 @@ struct tosakbd { | |||
59 | 59 | ||
60 | 60 | ||
61 | /* Helper functions for reading the keyboard matrix | 61 | /* Helper functions for reading the keyboard matrix |
62 | * Note: We should really be using pxa_gpio_mode to alter GPDR but it | 62 | * Note: We should really be using the generic gpio functions to alter |
63 | * requires a function call per GPIO bit which is excessive | 63 | * GPDR but it requires a function call per GPIO bit which is |
64 | * when we need to access 12 bits at once, multiple times. | 64 | * excessive when we need to access 12 bits at once, multiple times. |
65 | * These functions must be called within local_irq_save()/local_irq_restore() | 65 | * These functions must be called within local_irq_save()/local_irq_restore() |
66 | * or similar. | 66 | * or similar. |
67 | */ | 67 | */ |
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 55093ad132ca..ebfaa9960939 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
@@ -520,7 +520,7 @@ static int pxamci_probe(struct platform_device *pdev) | |||
520 | /* | 520 | /* |
521 | * Block length register is only 10 bits before PXA27x. | 521 | * Block length register is only 10 bits before PXA27x. |
522 | */ | 522 | */ |
523 | mmc->max_blk_size = (cpu_is_pxa21x() || cpu_is_pxa25x()) ? 1023 : 2048; | 523 | mmc->max_blk_size = cpu_is_pxa25x() ? 1023 : 2048; |
524 | 524 | ||
525 | /* | 525 | /* |
526 | * Block count register is 16 bits. | 526 | * Block count register is 16 bits. |
@@ -554,7 +554,7 @@ static int pxamci_probe(struct platform_device *pdev) | |||
554 | MMC_VDD_32_33|MMC_VDD_33_34; | 554 | MMC_VDD_32_33|MMC_VDD_33_34; |
555 | mmc->caps = 0; | 555 | mmc->caps = 0; |
556 | host->cmdat = 0; | 556 | host->cmdat = 0; |
557 | if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) { | 557 | if (!cpu_is_pxa25x()) { |
558 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; | 558 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; |
559 | host->cmdat |= CMDAT_SDIO_INT_EN; | 559 | host->cmdat |= CMDAT_SDIO_INT_EN; |
560 | if (cpu_is_pxa300() || cpu_is_pxa310()) | 560 | if (cpu_is_pxa300() || cpu_is_pxa310()) |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index f7a0d37c4221..abc00be55433 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -534,6 +534,11 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios, | |||
534 | 534 | ||
535 | serial_out(up, UART_IER, up->ier); | 535 | serial_out(up, UART_IER, up->ier); |
536 | 536 | ||
537 | if (termios->c_cflag & CRTSCTS) | ||
538 | up->mcr |= UART_MCR_AFE; | ||
539 | else | ||
540 | up->mcr &= ~UART_MCR_AFE; | ||
541 | |||
537 | serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ | 542 | serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ |
538 | serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */ | 543 | serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */ |
539 | serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ | 544 | serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ |