|
@@ -259,3 +259,52 @@ core_initcall(omap_serial_early_init);
|
|
|
/**
|
|
|
* omap_serial_init_port() - initialize single serial port
|
|
|
* @bdata: port specific board data pointer
|
|
|
+ * @info: platform specific data pointer
|
|
|
+ *
|
|
|
+ * This function initialies serial driver for given port only.
|
|
|
+ * Platforms can call this function instead of omap_serial_init()
|
|
|
+ * if they don't plan to use all available UARTs as serial ports.
|
|
|
+ *
|
|
|
+ * Don't mix calls to omap_serial_init_port() and omap_serial_init(),
|
|
|
+ * use only one of the two.
|
|
|
+ */
|
|
|
+void __init omap_serial_init_port(struct omap_board_data *bdata,
|
|
|
+ struct omap_uart_port_info *info)
|
|
|
+{
|
|
|
+ struct omap_uart_state *uart;
|
|
|
+ struct omap_hwmod *oh;
|
|
|
+ struct platform_device *pdev;
|
|
|
+ void *pdata = NULL;
|
|
|
+ u32 pdata_size = 0;
|
|
|
+ char *name;
|
|
|
+ struct omap_uart_port_info omap_up;
|
|
|
+
|
|
|
+ if (WARN_ON(!bdata))
|
|
|
+ return;
|
|
|
+ if (WARN_ON(bdata->id < 0))
|
|
|
+ return;
|
|
|
+ if (WARN_ON(bdata->id >= num_uarts))
|
|
|
+ return;
|
|
|
+
|
|
|
+ list_for_each_entry(uart, &uart_list, node)
|
|
|
+ if (bdata->id == uart->num)
|
|
|
+ break;
|
|
|
+ if (!info)
|
|
|
+ info = omap_serial_default_info;
|
|
|
+
|
|
|
+ oh = uart->oh;
|
|
|
+ name = DRIVER_NAME;
|
|
|
+
|
|
|
+ omap_up.dma_enabled = info->dma_enabled;
|
|
|
+ omap_up.uartclk = OMAP24XX_BASE_BAUD * 16;
|
|
|
+ omap_up.flags = UPF_BOOT_AUTOCONF;
|
|
|
+ omap_up.get_context_loss_count = omap_pm_get_dev_context_loss_count;
|
|
|
+ omap_up.set_forceidle = omap_uart_set_smartidle;
|
|
|
+ omap_up.set_noidle = omap_uart_set_noidle;
|
|
|
+ omap_up.enable_wakeup = omap_uart_enable_wakeup;
|
|
|
+ omap_up.dma_rx_buf_size = info->dma_rx_buf_size;
|
|
|
+ omap_up.dma_rx_timeout = info->dma_rx_timeout;
|
|
|
+ omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate;
|
|
|
+ omap_up.autosuspend_timeout = info->autosuspend_timeout;
|
|
|
+ omap_up.DTR_gpio = info->DTR_gpio;
|
|
|
+ omap_up.DTR_inverted = info->DTR_inverted;
|