for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) { /* Static mapping, never released */
serial_platform_data[i].membase =
ioremap(serial_platform_data[i].mapbase, SZ_2K); if (!serial_platform_data[i].membase) {
printk(KERN_ERR "Could not ioremap uart%i\n", i); continue;
} switch (i) { case0:
uart1_ck = clk_get(NULL, "uart1_ck"); if (IS_ERR(uart1_ck))
printk("Could not get uart1_ck\n"); else {
clk_prepare_enable(uart1_ck); if (cpu_is_omap15xx())
clk_set_rate(uart1_ck, 12000000);
} break; case1:
uart2_ck = clk_get(NULL, "uart2_ck"); if (IS_ERR(uart2_ck))
printk("Could not get uart2_ck\n"); else {
clk_prepare_enable(uart2_ck); if (cpu_is_omap15xx())
clk_set_rate(uart2_ck, 12000000); else
clk_set_rate(uart2_ck, 48000000);
} break; case2:
uart3_ck = clk_get(NULL, "uart3_ck"); if (IS_ERR(uart3_ck))
printk("Could not get uart3_ck\n"); else {
clk_prepare_enable(uart3_ck); if (cpu_is_omap15xx())
clk_set_rate(uart3_ck, 12000000);
} break;
}
omap_serial_reset(&serial_platform_data[i]);
}
}
#ifdef CONFIG_OMAP_SERIAL_WAKE
static irqreturn_t omap_serial_wake_interrupt(int irq, void *dev_id)
{ /* Need to do something with serial port right after wake-up? */ return IRQ_HANDLED;
}
if (uart1_ck != NULL) { if (enable)
omap_cfg_reg(V14_16XX_GPIO37); else
omap_cfg_reg(V14_16XX_UART1_RX);
} if (uart2_ck != NULL) { if (enable)
omap_cfg_reg(R9_16XX_GPIO18); else
omap_cfg_reg(R9_16XX_UART2_RX);
} if (uart3_ck != NULL) { if (enable)
omap_cfg_reg(L14_16XX_GPIO49); else
omap_cfg_reg(L14_16XX_UART3_RX);
}
}
staticvoid __init omap_serial_set_port_wakeup(int idx)
{ struct gpio_desc *d; int ret;
d = gpiod_get_index(NULL, "wakeup", idx, GPIOD_IN); if (IS_ERR(d)) {
pr_err("Unable to get UART wakeup GPIO descriptor\n"); return;
}
ret = request_irq(gpiod_to_irq(d), &omap_serial_wake_interrupt,
IRQF_TRIGGER_RISING, "serial wakeup", NULL); if (ret) {
gpiod_put(d);
pr_err("No interrupt for UART%d wake GPIO\n", idx + 1); return;
}
enable_irq_wake(gpiod_to_irq(d));
}
int __init omap_serial_wakeup_init(void)
{ if (!cpu_is_omap16xx()) return0;
if (uart1_ck != NULL)
omap_serial_set_port_wakeup(0); if (uart2_ck != NULL)
omap_serial_set_port_wakeup(1); if (uart3_ck != NULL)
omap_serial_set_port_wakeup(2);
return0;
}
#endif/* CONFIG_OMAP_SERIAL_WAKE */
staticint __init omap_init(void)
{ if (!cpu_class_is_omap1()) return -ENODEV;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.