Преглед на файлове

waterDataStatisticsCrossAssociation connectionSignalSlot.c 朱俊杰 commit at 2021-04-02

朱俊杰 преди 4 години
родител
ревизия
6473155011
променени са 1 файла, в които са добавени 72 реда и са изтрити 0 реда
  1. 72 0
      waterDataStatisticsCrossAssociation/monitoringDataProcessing/connectionSignalSlot.c

+ 72 - 0
waterDataStatisticsCrossAssociation/monitoringDataProcessing/connectionSignalSlot.c

@@ -308,3 +308,75 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
 	omap_up.autosuspend_timeout = info->autosuspend_timeout;
 	omap_up.DTR_gpio = info->DTR_gpio;
 	omap_up.DTR_inverted = info->DTR_inverted;
+	omap_up.DTR_present = info->DTR_present;
+
+	pdata = &omap_up;
+	pdata_size = sizeof(struct omap_uart_port_info);
+
+	if (WARN_ON(!oh))
+		return;
+
+	pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size,
+				 NULL, 0, false);
+	if (IS_ERR(pdev)) {
+		WARN(1, "Could not build omap_device for %s: %s.\n", name,
+		     oh->name);
+		return;
+	}
+
+	if ((console_uart_id == bdata->id) && no_console_suspend)
+		omap_device_disable_idle_on_suspend(pdev);
+
+	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
+
+	if (console_uart_id == bdata->id) {
+		omap_device_enable(pdev);
+		pm_runtime_set_active(&pdev->dev);
+	}
+
+	oh->dev_attr = uart;
+
+	if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads)
+			&& !uart_debug)
+		device_init_wakeup(&pdev->dev, true);
+}
+
+/**
+ * omap_serial_board_init() - initialize all supported serial ports
+ * @info: platform specific data pointer
+ *
+ * Initializes all available UARTs as serial ports. Platforms
+ * can call this function when they want to have default behaviour
+ * for serial ports (e.g initialize them all as serial ports).
+ */
+void __init omap_serial_board_init(struct omap_uart_port_info *info)
+{
+	struct omap_uart_state *uart;
+	struct omap_board_data bdata;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		bdata.id = uart->num;
+		bdata.flags = 0;
+		bdata.pads = NULL;
+		bdata.pads_cnt = 0;
+
+		omap_serial_check_wakeup(&bdata, uart);
+
+		if (!info)
+			omap_serial_init_port(&bdata, NULL);
+		else
+			omap_serial_init_port(&bdata, &info[uart->num]);
+	}
+}
+
+/**
+ * omap_serial_init() - initialize all supported serial ports
+ *
+ * Initializes all available UARTs.
+ * Platforms can call this function when they want to have default behaviour
+ * for serial ports (e.g initialize them all as serial ports).
+ */
+void __init omap_serial_init(void)
+{
+	omap_serial_board_init(NULL);
+}