diff options
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 15 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap-serial.h | 10 | ||||
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 124 |
3 files changed, 76 insertions, 73 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 25d53b2800c1..9e80d209d138 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -81,8 +81,9 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = { | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | #ifdef CONFIG_PM | 83 | #ifdef CONFIG_PM |
84 | static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) | 84 | static void omap_uart_enable_wakeup(struct device *dev, bool enable) |
85 | { | 85 | { |
86 | struct platform_device *pdev = to_platform_device(dev); | ||
86 | struct omap_device *od = to_omap_device(pdev); | 87 | struct omap_device *od = to_omap_device(pdev); |
87 | 88 | ||
88 | if (!od) | 89 | if (!od) |
@@ -99,15 +100,17 @@ static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) | |||
99 | * in Smartidle Mode When Configured for DMA Operations. | 100 | * in Smartidle Mode When Configured for DMA Operations. |
100 | * WA: configure uart in force idle mode. | 101 | * WA: configure uart in force idle mode. |
101 | */ | 102 | */ |
102 | static void omap_uart_set_noidle(struct platform_device *pdev) | 103 | static void omap_uart_set_noidle(struct device *dev) |
103 | { | 104 | { |
105 | struct platform_device *pdev = to_platform_device(dev); | ||
104 | struct omap_device *od = to_omap_device(pdev); | 106 | struct omap_device *od = to_omap_device(pdev); |
105 | 107 | ||
106 | omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO); | 108 | omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO); |
107 | } | 109 | } |
108 | 110 | ||
109 | static void omap_uart_set_smartidle(struct platform_device *pdev) | 111 | static void omap_uart_set_smartidle(struct device *dev) |
110 | { | 112 | { |
113 | struct platform_device *pdev = to_platform_device(dev); | ||
111 | struct omap_device *od = to_omap_device(pdev); | 114 | struct omap_device *od = to_omap_device(pdev); |
112 | u8 idlemode; | 115 | u8 idlemode; |
113 | 116 | ||
@@ -120,10 +123,10 @@ static void omap_uart_set_smartidle(struct platform_device *pdev) | |||
120 | } | 123 | } |
121 | 124 | ||
122 | #else | 125 | #else |
123 | static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable) | 126 | static void omap_uart_enable_wakeup(struct device *dev, bool enable) |
124 | {} | 127 | {} |
125 | static void omap_uart_set_noidle(struct platform_device *pdev) {} | 128 | static void omap_uart_set_noidle(struct device *dev) {} |
126 | static void omap_uart_set_smartidle(struct platform_device *pdev) {} | 129 | static void omap_uart_set_smartidle(struct device *dev) {} |
127 | #endif /* CONFIG_PM */ | 130 | #endif /* CONFIG_PM */ |
128 | 131 | ||
129 | #ifdef CONFIG_OMAP_MUX | 132 | #ifdef CONFIG_OMAP_MUX |
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index 5cc062620719..90d2d74d1682 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #define __OMAP_SERIAL_H__ | 18 | #define __OMAP_SERIAL_H__ |
19 | 19 | ||
20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/pm_qos.h> | 22 | #include <linux/pm_qos.h> |
23 | 23 | ||
24 | #include <plat/mux.h> | 24 | #include <plat/mux.h> |
@@ -74,9 +74,9 @@ struct omap_uart_port_info { | |||
74 | int DTR_present; | 74 | int DTR_present; |
75 | 75 | ||
76 | int (*get_context_loss_count)(struct device *); | 76 | int (*get_context_loss_count)(struct device *); |
77 | void (*set_forceidle)(struct platform_device *); | 77 | void (*set_forceidle)(struct device *); |
78 | void (*set_noidle)(struct platform_device *); | 78 | void (*set_noidle)(struct device *); |
79 | void (*enable_wakeup)(struct platform_device *, bool); | 79 | void (*enable_wakeup)(struct device *, bool); |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct uart_omap_dma { | 82 | struct uart_omap_dma { |
@@ -108,7 +108,7 @@ struct uart_omap_dma { | |||
108 | struct uart_omap_port { | 108 | struct uart_omap_port { |
109 | struct uart_port port; | 109 | struct uart_port port; |
110 | struct uart_omap_dma uart_dma; | 110 | struct uart_omap_dma uart_dma; |
111 | struct platform_device *pdev; | 111 | struct device *dev; |
112 | 112 | ||
113 | unsigned char ier; | 113 | unsigned char ier; |
114 | unsigned char lcr; | 114 | unsigned char lcr; |
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 3a60b86ab0f4..5af5d228f7d6 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -104,36 +104,36 @@ static inline void serial_omap_clear_fifos(struct uart_omap_port *up) | |||
104 | 104 | ||
105 | static int serial_omap_get_context_loss_count(struct uart_omap_port *up) | 105 | static int serial_omap_get_context_loss_count(struct uart_omap_port *up) |
106 | { | 106 | { |
107 | struct omap_uart_port_info *pdata = up->pdev->dev.platform_data; | 107 | struct omap_uart_port_info *pdata = up->dev->platform_data; |
108 | 108 | ||
109 | if (!pdata->get_context_loss_count) | 109 | if (!pdata->get_context_loss_count) |
110 | return 0; | 110 | return 0; |
111 | 111 | ||
112 | return pdata->get_context_loss_count(&up->pdev->dev); | 112 | return pdata->get_context_loss_count(up->dev); |
113 | } | 113 | } |
114 | 114 | ||
115 | static void serial_omap_set_forceidle(struct uart_omap_port *up) | 115 | static void serial_omap_set_forceidle(struct uart_omap_port *up) |
116 | { | 116 | { |
117 | struct omap_uart_port_info *pdata = up->pdev->dev.platform_data; | 117 | struct omap_uart_port_info *pdata = up->dev->platform_data; |
118 | 118 | ||
119 | if (pdata->set_forceidle) | 119 | if (pdata->set_forceidle) |
120 | pdata->set_forceidle(up->pdev); | 120 | pdata->set_forceidle(up->dev); |
121 | } | 121 | } |
122 | 122 | ||
123 | static void serial_omap_set_noidle(struct uart_omap_port *up) | 123 | static void serial_omap_set_noidle(struct uart_omap_port *up) |
124 | { | 124 | { |
125 | struct omap_uart_port_info *pdata = up->pdev->dev.platform_data; | 125 | struct omap_uart_port_info *pdata = up->dev->platform_data; |
126 | 126 | ||
127 | if (pdata->set_noidle) | 127 | if (pdata->set_noidle) |
128 | pdata->set_noidle(up->pdev); | 128 | pdata->set_noidle(up->dev); |
129 | } | 129 | } |
130 | 130 | ||
131 | static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) | 131 | static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) |
132 | { | 132 | { |
133 | struct omap_uart_port_info *pdata = up->pdev->dev.platform_data; | 133 | struct omap_uart_port_info *pdata = up->dev->platform_data; |
134 | 134 | ||
135 | if (pdata->enable_wakeup) | 135 | if (pdata->enable_wakeup) |
136 | pdata->enable_wakeup(up->pdev, enable); | 136 | pdata->enable_wakeup(up->dev, enable); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* | 139 | /* |
@@ -169,8 +169,8 @@ static void serial_omap_stop_rxdma(struct uart_omap_port *up) | |||
169 | omap_free_dma(up->uart_dma.rx_dma_channel); | 169 | omap_free_dma(up->uart_dma.rx_dma_channel); |
170 | up->uart_dma.rx_dma_channel = OMAP_UART_DMA_CH_FREE; | 170 | up->uart_dma.rx_dma_channel = OMAP_UART_DMA_CH_FREE; |
171 | up->uart_dma.rx_dma_used = false; | 171 | up->uart_dma.rx_dma_used = false; |
172 | pm_runtime_mark_last_busy(&up->pdev->dev); | 172 | pm_runtime_mark_last_busy(up->dev); |
173 | pm_runtime_put_autosuspend(&up->pdev->dev); | 173 | pm_runtime_put_autosuspend(up->dev); |
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
@@ -180,16 +180,16 @@ static void serial_omap_enable_ms(struct uart_port *port) | |||
180 | 180 | ||
181 | dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->port.line); | 181 | dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->port.line); |
182 | 182 | ||
183 | pm_runtime_get_sync(&up->pdev->dev); | 183 | pm_runtime_get_sync(up->dev); |
184 | up->ier |= UART_IER_MSI; | 184 | up->ier |= UART_IER_MSI; |
185 | serial_out(up, UART_IER, up->ier); | 185 | serial_out(up, UART_IER, up->ier); |
186 | pm_runtime_put(&up->pdev->dev); | 186 | pm_runtime_put(up->dev); |
187 | } | 187 | } |
188 | 188 | ||
189 | static void serial_omap_stop_tx(struct uart_port *port) | 189 | static void serial_omap_stop_tx(struct uart_port *port) |
190 | { | 190 | { |
191 | struct uart_omap_port *up = to_uart_omap_port(port); | 191 | struct uart_omap_port *up = to_uart_omap_port(port); |
192 | struct omap_uart_port_info *pdata = up->pdev->dev.platform_data; | 192 | struct omap_uart_port_info *pdata = up->dev->platform_data; |
193 | 193 | ||
194 | if (up->use_dma && | 194 | if (up->use_dma && |
195 | up->uart_dma.tx_dma_channel != OMAP_UART_DMA_CH_FREE) { | 195 | up->uart_dma.tx_dma_channel != OMAP_UART_DMA_CH_FREE) { |
@@ -202,11 +202,11 @@ static void serial_omap_stop_tx(struct uart_port *port) | |||
202 | omap_stop_dma(up->uart_dma.tx_dma_channel); | 202 | omap_stop_dma(up->uart_dma.tx_dma_channel); |
203 | omap_free_dma(up->uart_dma.tx_dma_channel); | 203 | omap_free_dma(up->uart_dma.tx_dma_channel); |
204 | up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE; | 204 | up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE; |
205 | pm_runtime_mark_last_busy(&up->pdev->dev); | 205 | pm_runtime_mark_last_busy(up->dev); |
206 | pm_runtime_put_autosuspend(&up->pdev->dev); | 206 | pm_runtime_put_autosuspend(up->dev); |
207 | } | 207 | } |
208 | 208 | ||
209 | pm_runtime_get_sync(&up->pdev->dev); | 209 | pm_runtime_get_sync(up->dev); |
210 | if (up->ier & UART_IER_THRI) { | 210 | if (up->ier & UART_IER_THRI) { |
211 | up->ier &= ~UART_IER_THRI; | 211 | up->ier &= ~UART_IER_THRI; |
212 | serial_out(up, UART_IER, up->ier); | 212 | serial_out(up, UART_IER, up->ier); |
@@ -215,22 +215,22 @@ static void serial_omap_stop_tx(struct uart_port *port) | |||
215 | if (!up->use_dma && pdata) | 215 | if (!up->use_dma && pdata) |
216 | serial_omap_set_forceidle(up); | 216 | serial_omap_set_forceidle(up); |
217 | 217 | ||
218 | pm_runtime_mark_last_busy(&up->pdev->dev); | 218 | pm_runtime_mark_last_busy(up->dev); |
219 | pm_runtime_put_autosuspend(&up->pdev->dev); | 219 | pm_runtime_put_autosuspend(up->dev); |
220 | } | 220 | } |
221 | 221 | ||
222 | static void serial_omap_stop_rx(struct uart_port *port) | 222 | static void serial_omap_stop_rx(struct uart_port *port) |
223 | { | 223 | { |
224 | struct uart_omap_port *up = to_uart_omap_port(port); | 224 | struct uart_omap_port *up = to_uart_omap_port(port); |
225 | 225 | ||
226 | pm_runtime_get_sync(&up->pdev->dev); | 226 | pm_runtime_get_sync(up->dev); |
227 | if (up->use_dma) | 227 | if (up->use_dma) |
228 | serial_omap_stop_rxdma(up); | 228 | serial_omap_stop_rxdma(up); |
229 | up->ier &= ~UART_IER_RLSI; | 229 | up->ier &= ~UART_IER_RLSI; |
230 | up->port.read_status_mask &= ~UART_LSR_DR; | 230 | up->port.read_status_mask &= ~UART_LSR_DR; |
231 | serial_out(up, UART_IER, up->ier); | 231 | serial_out(up, UART_IER, up->ier); |
232 | pm_runtime_mark_last_busy(&up->pdev->dev); | 232 | pm_runtime_mark_last_busy(up->dev); |
233 | pm_runtime_put_autosuspend(&up->pdev->dev); | 233 | pm_runtime_put_autosuspend(up->dev); |
234 | } | 234 | } |
235 | 235 | ||
236 | static inline void receive_chars(struct uart_omap_port *up, | 236 | static inline void receive_chars(struct uart_omap_port *up, |
@@ -348,11 +348,11 @@ static void serial_omap_start_tx(struct uart_port *port) | |||
348 | int ret = 0; | 348 | int ret = 0; |
349 | 349 | ||
350 | if (!up->use_dma) { | 350 | if (!up->use_dma) { |
351 | pm_runtime_get_sync(&up->pdev->dev); | 351 | pm_runtime_get_sync(up->dev); |
352 | serial_omap_enable_ier_thri(up); | 352 | serial_omap_enable_ier_thri(up); |
353 | serial_omap_set_noidle(up); | 353 | serial_omap_set_noidle(up); |
354 | pm_runtime_mark_last_busy(&up->pdev->dev); | 354 | pm_runtime_mark_last_busy(up->dev); |
355 | pm_runtime_put_autosuspend(&up->pdev->dev); | 355 | pm_runtime_put_autosuspend(up->dev); |
356 | return; | 356 | return; |
357 | } | 357 | } |
358 | 358 | ||
@@ -362,7 +362,7 @@ static void serial_omap_start_tx(struct uart_port *port) | |||
362 | xmit = &up->port.state->xmit; | 362 | xmit = &up->port.state->xmit; |
363 | 363 | ||
364 | if (up->uart_dma.tx_dma_channel == OMAP_UART_DMA_CH_FREE) { | 364 | if (up->uart_dma.tx_dma_channel == OMAP_UART_DMA_CH_FREE) { |
365 | pm_runtime_get_sync(&up->pdev->dev); | 365 | pm_runtime_get_sync(up->dev); |
366 | ret = omap_request_dma(up->uart_dma.uart_dma_tx, | 366 | ret = omap_request_dma(up->uart_dma.uart_dma_tx, |
367 | "UART Tx DMA", | 367 | "UART Tx DMA", |
368 | (void *)uart_tx_dma_callback, up, | 368 | (void *)uart_tx_dma_callback, up, |
@@ -445,11 +445,11 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) | |||
445 | unsigned int iir, lsr; | 445 | unsigned int iir, lsr; |
446 | unsigned long flags; | 446 | unsigned long flags; |
447 | 447 | ||
448 | pm_runtime_get_sync(&up->pdev->dev); | 448 | pm_runtime_get_sync(up->dev); |
449 | iir = serial_in(up, UART_IIR); | 449 | iir = serial_in(up, UART_IIR); |
450 | if (iir & UART_IIR_NO_INT) { | 450 | if (iir & UART_IIR_NO_INT) { |
451 | pm_runtime_mark_last_busy(&up->pdev->dev); | 451 | pm_runtime_mark_last_busy(up->dev); |
452 | pm_runtime_put_autosuspend(&up->pdev->dev); | 452 | pm_runtime_put_autosuspend(up->dev); |
453 | return IRQ_NONE; | 453 | return IRQ_NONE; |
454 | } | 454 | } |
455 | 455 | ||
@@ -473,8 +473,8 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) | |||
473 | transmit_chars(up); | 473 | transmit_chars(up); |
474 | 474 | ||
475 | spin_unlock_irqrestore(&up->port.lock, flags); | 475 | spin_unlock_irqrestore(&up->port.lock, flags); |
476 | pm_runtime_mark_last_busy(&up->pdev->dev); | 476 | pm_runtime_mark_last_busy(up->dev); |
477 | pm_runtime_put_autosuspend(&up->pdev->dev); | 477 | pm_runtime_put_autosuspend(up->dev); |
478 | 478 | ||
479 | up->port_activity = jiffies; | 479 | up->port_activity = jiffies; |
480 | return IRQ_HANDLED; | 480 | return IRQ_HANDLED; |
@@ -486,12 +486,12 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port) | |||
486 | unsigned long flags = 0; | 486 | unsigned long flags = 0; |
487 | unsigned int ret = 0; | 487 | unsigned int ret = 0; |
488 | 488 | ||
489 | pm_runtime_get_sync(&up->pdev->dev); | 489 | pm_runtime_get_sync(up->dev); |
490 | dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->port.line); | 490 | dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->port.line); |
491 | spin_lock_irqsave(&up->port.lock, flags); | 491 | spin_lock_irqsave(&up->port.lock, flags); |
492 | ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; | 492 | ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; |
493 | spin_unlock_irqrestore(&up->port.lock, flags); | 493 | spin_unlock_irqrestore(&up->port.lock, flags); |
494 | pm_runtime_put(&up->pdev->dev); | 494 | pm_runtime_put(up->dev); |
495 | return ret; | 495 | return ret; |
496 | } | 496 | } |
497 | 497 | ||
@@ -501,9 +501,9 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port) | |||
501 | unsigned int status; | 501 | unsigned int status; |
502 | unsigned int ret = 0; | 502 | unsigned int ret = 0; |
503 | 503 | ||
504 | pm_runtime_get_sync(&up->pdev->dev); | 504 | pm_runtime_get_sync(up->dev); |
505 | status = check_modem_status(up); | 505 | status = check_modem_status(up); |
506 | pm_runtime_put(&up->pdev->dev); | 506 | pm_runtime_put(up->dev); |
507 | 507 | ||
508 | dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->port.line); | 508 | dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->port.line); |
509 | 509 | ||
@@ -535,11 +535,11 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
535 | if (mctrl & TIOCM_LOOP) | 535 | if (mctrl & TIOCM_LOOP) |
536 | mcr |= UART_MCR_LOOP; | 536 | mcr |= UART_MCR_LOOP; |
537 | 537 | ||
538 | pm_runtime_get_sync(&up->pdev->dev); | 538 | pm_runtime_get_sync(up->dev); |
539 | up->mcr = serial_in(up, UART_MCR); | 539 | up->mcr = serial_in(up, UART_MCR); |
540 | up->mcr |= mcr; | 540 | up->mcr |= mcr; |
541 | serial_out(up, UART_MCR, up->mcr); | 541 | serial_out(up, UART_MCR, up->mcr); |
542 | pm_runtime_put(&up->pdev->dev); | 542 | pm_runtime_put(up->dev); |
543 | 543 | ||
544 | if (gpio_is_valid(up->DTR_gpio) && | 544 | if (gpio_is_valid(up->DTR_gpio) && |
545 | !!(mctrl & TIOCM_DTR) != up->DTR_active) { | 545 | !!(mctrl & TIOCM_DTR) != up->DTR_active) { |
@@ -558,7 +558,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state) | |||
558 | unsigned long flags = 0; | 558 | unsigned long flags = 0; |
559 | 559 | ||
560 | dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->port.line); | 560 | dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->port.line); |
561 | pm_runtime_get_sync(&up->pdev->dev); | 561 | pm_runtime_get_sync(up->dev); |
562 | spin_lock_irqsave(&up->port.lock, flags); | 562 | spin_lock_irqsave(&up->port.lock, flags); |
563 | if (break_state == -1) | 563 | if (break_state == -1) |
564 | up->lcr |= UART_LCR_SBC; | 564 | up->lcr |= UART_LCR_SBC; |
@@ -566,7 +566,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state) | |||
566 | up->lcr &= ~UART_LCR_SBC; | 566 | up->lcr &= ~UART_LCR_SBC; |
567 | serial_out(up, UART_LCR, up->lcr); | 567 | serial_out(up, UART_LCR, up->lcr); |
568 | spin_unlock_irqrestore(&up->port.lock, flags); | 568 | spin_unlock_irqrestore(&up->port.lock, flags); |
569 | pm_runtime_put(&up->pdev->dev); | 569 | pm_runtime_put(up->dev); |
570 | } | 570 | } |
571 | 571 | ||
572 | static int serial_omap_startup(struct uart_port *port) | 572 | static int serial_omap_startup(struct uart_port *port) |
@@ -585,7 +585,7 @@ static int serial_omap_startup(struct uart_port *port) | |||
585 | 585 | ||
586 | dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line); | 586 | dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line); |
587 | 587 | ||
588 | pm_runtime_get_sync(&up->pdev->dev); | 588 | pm_runtime_get_sync(up->dev); |
589 | /* | 589 | /* |
590 | * Clear the FIFO buffers and disable them. | 590 | * Clear the FIFO buffers and disable them. |
591 | * (they will be reenabled in set_termios()) | 591 | * (they will be reenabled in set_termios()) |
@@ -641,8 +641,8 @@ static int serial_omap_startup(struct uart_port *port) | |||
641 | /* Enable module level wake up */ | 641 | /* Enable module level wake up */ |
642 | serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP); | 642 | serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP); |
643 | 643 | ||
644 | pm_runtime_mark_last_busy(&up->pdev->dev); | 644 | pm_runtime_mark_last_busy(up->dev); |
645 | pm_runtime_put_autosuspend(&up->pdev->dev); | 645 | pm_runtime_put_autosuspend(up->dev); |
646 | up->port_activity = jiffies; | 646 | up->port_activity = jiffies; |
647 | return 0; | 647 | return 0; |
648 | } | 648 | } |
@@ -654,7 +654,7 @@ static void serial_omap_shutdown(struct uart_port *port) | |||
654 | 654 | ||
655 | dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->port.line); | 655 | dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->port.line); |
656 | 656 | ||
657 | pm_runtime_get_sync(&up->pdev->dev); | 657 | pm_runtime_get_sync(up->dev); |
658 | /* | 658 | /* |
659 | * Disable interrupts from this port | 659 | * Disable interrupts from this port |
660 | */ | 660 | */ |
@@ -689,7 +689,7 @@ static void serial_omap_shutdown(struct uart_port *port) | |||
689 | up->uart_dma.rx_buf = NULL; | 689 | up->uart_dma.rx_buf = NULL; |
690 | } | 690 | } |
691 | 691 | ||
692 | pm_runtime_put(&up->pdev->dev); | 692 | pm_runtime_put(up->dev); |
693 | free_irq(up->port.irq, up); | 693 | free_irq(up->port.irq, up); |
694 | } | 694 | } |
695 | 695 | ||
@@ -821,7 +821,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
821 | * Ok, we're now changing the port state. Do it with | 821 | * Ok, we're now changing the port state. Do it with |
822 | * interrupts disabled. | 822 | * interrupts disabled. |
823 | */ | 823 | */ |
824 | pm_runtime_get_sync(&up->pdev->dev); | 824 | pm_runtime_get_sync(up->dev); |
825 | spin_lock_irqsave(&up->port.lock, flags); | 825 | spin_lock_irqsave(&up->port.lock, flags); |
826 | 826 | ||
827 | /* | 827 | /* |
@@ -970,7 +970,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
970 | serial_omap_configure_xonxoff(up, termios); | 970 | serial_omap_configure_xonxoff(up, termios); |
971 | 971 | ||
972 | spin_unlock_irqrestore(&up->port.lock, flags); | 972 | spin_unlock_irqrestore(&up->port.lock, flags); |
973 | pm_runtime_put(&up->pdev->dev); | 973 | pm_runtime_put(up->dev); |
974 | dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line); | 974 | dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line); |
975 | } | 975 | } |
976 | 976 | ||
@@ -983,7 +983,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state, | |||
983 | 983 | ||
984 | dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->port.line); | 984 | dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->port.line); |
985 | 985 | ||
986 | pm_runtime_get_sync(&up->pdev->dev); | 986 | pm_runtime_get_sync(up->dev); |
987 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 987 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
988 | efr = serial_in(up, UART_EFR); | 988 | efr = serial_in(up, UART_EFR); |
989 | serial_out(up, UART_EFR, efr | UART_EFR_ECB); | 989 | serial_out(up, UART_EFR, efr | UART_EFR_ECB); |
@@ -994,14 +994,14 @@ serial_omap_pm(struct uart_port *port, unsigned int state, | |||
994 | serial_out(up, UART_EFR, efr); | 994 | serial_out(up, UART_EFR, efr); |
995 | serial_out(up, UART_LCR, 0); | 995 | serial_out(up, UART_LCR, 0); |
996 | 996 | ||
997 | if (!device_may_wakeup(&up->pdev->dev)) { | 997 | if (!device_may_wakeup(up->dev)) { |
998 | if (!state) | 998 | if (!state) |
999 | pm_runtime_forbid(&up->pdev->dev); | 999 | pm_runtime_forbid(up->dev); |
1000 | else | 1000 | else |
1001 | pm_runtime_allow(&up->pdev->dev); | 1001 | pm_runtime_allow(up->dev); |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | pm_runtime_put(&up->pdev->dev); | 1004 | pm_runtime_put(up->dev); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | static void serial_omap_release_port(struct uart_port *port) | 1007 | static void serial_omap_release_port(struct uart_port *port) |
@@ -1080,10 +1080,10 @@ static void serial_omap_poll_put_char(struct uart_port *port, unsigned char ch) | |||
1080 | { | 1080 | { |
1081 | struct uart_omap_port *up = to_uart_omap_port(port); | 1081 | struct uart_omap_port *up = to_uart_omap_port(port); |
1082 | 1082 | ||
1083 | pm_runtime_get_sync(&up->pdev->dev); | 1083 | pm_runtime_get_sync(up->dev); |
1084 | wait_for_xmitr(up); | 1084 | wait_for_xmitr(up); |
1085 | serial_out(up, UART_TX, ch); | 1085 | serial_out(up, UART_TX, ch); |
1086 | pm_runtime_put(&up->pdev->dev); | 1086 | pm_runtime_put(up->dev); |
1087 | } | 1087 | } |
1088 | 1088 | ||
1089 | static int serial_omap_poll_get_char(struct uart_port *port) | 1089 | static int serial_omap_poll_get_char(struct uart_port *port) |
@@ -1091,13 +1091,13 @@ static int serial_omap_poll_get_char(struct uart_port *port) | |||
1091 | struct uart_omap_port *up = to_uart_omap_port(port); | 1091 | struct uart_omap_port *up = to_uart_omap_port(port); |
1092 | unsigned int status; | 1092 | unsigned int status; |
1093 | 1093 | ||
1094 | pm_runtime_get_sync(&up->pdev->dev); | 1094 | pm_runtime_get_sync(up->dev); |
1095 | status = serial_in(up, UART_LSR); | 1095 | status = serial_in(up, UART_LSR); |
1096 | if (!(status & UART_LSR_DR)) | 1096 | if (!(status & UART_LSR_DR)) |
1097 | return NO_POLL_CHAR; | 1097 | return NO_POLL_CHAR; |
1098 | 1098 | ||
1099 | status = serial_in(up, UART_RX); | 1099 | status = serial_in(up, UART_RX); |
1100 | pm_runtime_put(&up->pdev->dev); | 1100 | pm_runtime_put(up->dev); |
1101 | return status; | 1101 | return status; |
1102 | } | 1102 | } |
1103 | 1103 | ||
@@ -1126,7 +1126,7 @@ serial_omap_console_write(struct console *co, const char *s, | |||
1126 | unsigned int ier; | 1126 | unsigned int ier; |
1127 | int locked = 1; | 1127 | int locked = 1; |
1128 | 1128 | ||
1129 | pm_runtime_get_sync(&up->pdev->dev); | 1129 | pm_runtime_get_sync(up->dev); |
1130 | 1130 | ||
1131 | local_irq_save(flags); | 1131 | local_irq_save(flags); |
1132 | if (up->port.sysrq) | 1132 | if (up->port.sysrq) |
@@ -1160,8 +1160,8 @@ serial_omap_console_write(struct console *co, const char *s, | |||
1160 | if (up->msr_saved_flags) | 1160 | if (up->msr_saved_flags) |
1161 | check_modem_status(up); | 1161 | check_modem_status(up); |
1162 | 1162 | ||
1163 | pm_runtime_mark_last_busy(&up->pdev->dev); | 1163 | pm_runtime_mark_last_busy(up->dev); |
1164 | pm_runtime_put_autosuspend(&up->pdev->dev); | 1164 | pm_runtime_put_autosuspend(up->dev); |
1165 | if (locked) | 1165 | if (locked) |
1166 | spin_unlock(&up->port.lock); | 1166 | spin_unlock(&up->port.lock); |
1167 | local_irq_restore(flags); | 1167 | local_irq_restore(flags); |
@@ -1323,7 +1323,7 @@ static int serial_omap_start_rxdma(struct uart_omap_port *up) | |||
1323 | int ret = 0; | 1323 | int ret = 0; |
1324 | 1324 | ||
1325 | if (up->uart_dma.rx_dma_channel == -1) { | 1325 | if (up->uart_dma.rx_dma_channel == -1) { |
1326 | pm_runtime_get_sync(&up->pdev->dev); | 1326 | pm_runtime_get_sync(up->dev); |
1327 | ret = omap_request_dma(up->uart_dma.uart_dma_rx, | 1327 | ret = omap_request_dma(up->uart_dma.uart_dma_rx, |
1328 | "UART Rx DMA", | 1328 | "UART Rx DMA", |
1329 | (void *)uart_rx_dma_callback, up, | 1329 | (void *)uart_rx_dma_callback, up, |
@@ -1435,7 +1435,7 @@ static void omap_serial_fill_features_erratas(struct uart_omap_port *up) | |||
1435 | minor = (mvr & OMAP_UART_MVR_MIN_MASK); | 1435 | minor = (mvr & OMAP_UART_MVR_MIN_MASK); |
1436 | break; | 1436 | break; |
1437 | default: | 1437 | default: |
1438 | dev_warn(&up->pdev->dev, | 1438 | dev_warn(up->dev, |
1439 | "Unknown %s revision, defaulting to highest\n", | 1439 | "Unknown %s revision, defaulting to highest\n", |
1440 | up->name); | 1440 | up->name); |
1441 | /* highest possible revision */ | 1441 | /* highest possible revision */ |
@@ -1535,7 +1535,7 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1535 | up->DTR_gpio = -EINVAL; | 1535 | up->DTR_gpio = -EINVAL; |
1536 | up->DTR_active = 0; | 1536 | up->DTR_active = 0; |
1537 | 1537 | ||
1538 | up->pdev = pdev; | 1538 | up->dev = &pdev->dev; |
1539 | up->port.dev = &pdev->dev; | 1539 | up->port.dev = &pdev->dev; |
1540 | up->port.type = PORT_OMAP; | 1540 | up->port.type = PORT_OMAP; |
1541 | up->port.iotype = UPIO_MEM; | 1541 | up->port.iotype = UPIO_MEM; |
@@ -1632,7 +1632,7 @@ static int serial_omap_remove(struct platform_device *dev) | |||
1632 | struct uart_omap_port *up = platform_get_drvdata(dev); | 1632 | struct uart_omap_port *up = platform_get_drvdata(dev); |
1633 | 1633 | ||
1634 | if (up) { | 1634 | if (up) { |
1635 | pm_runtime_disable(&up->pdev->dev); | 1635 | pm_runtime_disable(up->dev); |
1636 | uart_remove_one_port(&serial_omap_reg, &up->port); | 1636 | uart_remove_one_port(&serial_omap_reg, &up->port); |
1637 | pm_qos_remove_request(&up->pm_qos_request); | 1637 | pm_qos_remove_request(&up->pm_qos_request); |
1638 | } | 1638 | } |
@@ -1667,7 +1667,7 @@ static void serial_omap_mdr1_errataset(struct uart_omap_port *up, u8 mdr1) | |||
1667 | timeout--; | 1667 | timeout--; |
1668 | if (!timeout) { | 1668 | if (!timeout) { |
1669 | /* Should *never* happen. we warn and carry on */ | 1669 | /* Should *never* happen. we warn and carry on */ |
1670 | dev_crit(&up->pdev->dev, "Errata i202: timedout %x\n", | 1670 | dev_crit(up->dev, "Errata i202: timedout %x\n", |
1671 | serial_in(up, UART_LSR)); | 1671 | serial_in(up, UART_LSR)); |
1672 | break; | 1672 | break; |
1673 | } | 1673 | } |