diff options
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 466fc722fa0f..9992dbfdfdb3 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -107,28 +107,6 @@ struct omap_uart_state { | |||
107 | static LIST_HEAD(uart_list); | 107 | static LIST_HEAD(uart_list); |
108 | static u8 num_uarts; | 108 | static u8 num_uarts; |
109 | 109 | ||
110 | static int uart_idle_hwmod(struct omap_device *od) | ||
111 | { | ||
112 | omap_hwmod_idle(od->hwmods[0]); | ||
113 | |||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | static int uart_enable_hwmod(struct omap_device *od) | ||
118 | { | ||
119 | omap_hwmod_enable(od->hwmods[0]); | ||
120 | |||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static struct omap_device_pm_latency omap_uart_latency[] = { | ||
125 | { | ||
126 | .deactivate_func = uart_idle_hwmod, | ||
127 | .activate_func = uart_enable_hwmod, | ||
128 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static inline unsigned int __serial_read_reg(struct uart_port *up, | 110 | static inline unsigned int __serial_read_reg(struct uart_port *up, |
133 | int offset) | 111 | int offset) |
134 | { | 112 | { |
@@ -711,7 +689,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
711 | { | 689 | { |
712 | struct omap_uart_state *uart; | 690 | struct omap_uart_state *uart; |
713 | struct omap_hwmod *oh; | 691 | struct omap_hwmod *oh; |
714 | struct omap_device *od; | 692 | struct platform_device *pdev; |
715 | void *pdata = NULL; | 693 | void *pdata = NULL; |
716 | u32 pdata_size = 0; | 694 | u32 pdata_size = 0; |
717 | char *name; | 695 | char *name; |
@@ -799,20 +777,19 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
799 | if (WARN_ON(!oh)) | 777 | if (WARN_ON(!oh)) |
800 | return; | 778 | return; |
801 | 779 | ||
802 | od = omap_device_build(name, uart->num, oh, pdata, pdata_size, | 780 | pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, |
803 | omap_uart_latency, | 781 | NULL, 0, false); |
804 | ARRAY_SIZE(omap_uart_latency), false); | 782 | WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n", |
805 | WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n", | ||
806 | name, oh->name); | 783 | name, oh->name); |
807 | 784 | ||
808 | omap_device_disable_idle_on_suspend(od); | 785 | omap_device_disable_idle_on_suspend(pdev); |
809 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); | 786 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); |
810 | 787 | ||
811 | uart->irq = oh->mpu_irqs[0].irq; | 788 | uart->irq = oh->mpu_irqs[0].irq; |
812 | uart->regshift = 2; | 789 | uart->regshift = 2; |
813 | uart->mapbase = oh->slaves[0]->addr->pa_start; | 790 | uart->mapbase = oh->slaves[0]->addr->pa_start; |
814 | uart->membase = omap_hwmod_get_mpu_rt_va(oh); | 791 | uart->membase = omap_hwmod_get_mpu_rt_va(oh); |
815 | uart->pdev = &od->pdev; | 792 | uart->pdev = pdev; |
816 | 793 | ||
817 | oh->dev_attr = uart; | 794 | oh->dev_attr = uart; |
818 | 795 | ||
@@ -846,8 +823,8 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
846 | 823 | ||
847 | if ((cpu_is_omap34xx() && uart->padconf) || | 824 | if ((cpu_is_omap34xx() && uart->padconf) || |
848 | (uart->wk_en && uart->wk_mask)) { | 825 | (uart->wk_en && uart->wk_mask)) { |
849 | device_init_wakeup(&od->pdev.dev, true); | 826 | device_init_wakeup(&pdev->dev, true); |
850 | DEV_CREATE_FILE(&od->pdev.dev, &dev_attr_sleep_timeout); | 827 | DEV_CREATE_FILE(&pdev->dev, &dev_attr_sleep_timeout); |
851 | } | 828 | } |
852 | 829 | ||
853 | /* Enable the MDR1 errata for OMAP3 */ | 830 | /* Enable the MDR1 errata for OMAP3 */ |