瀏覽代碼

waterDataDiscreteRateMining waterPressureDifference.c 朱俊杰 commit at 2020-10-12

朱俊杰 4 年之前
父節點
當前提交
1c67651172
共有 1 個文件被更改,包括 70 次插入0 次删除
  1. 70 0
      waterDataDiscreteRateMining/standardDeviationCalculation/waterPressureDifference.c

+ 70 - 0
waterDataDiscreteRateMining/standardDeviationCalculation/waterPressureDifference.c

@@ -123,3 +123,73 @@ static struct resource thermal_resources[] = {
 		.start		= 0xFFC48000,
 		.end		= 0xFFC48038 - 1,
 		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device thermal_device = {
+	.name		= "rcar_thermal",
+	.resource	= thermal_resources,
+	.num_resources	= ARRAY_SIZE(thermal_resources),
+};
+
+/* HSPI */
+static struct resource hspi_resources[] = {
+	[0] = {
+		.start		= 0xFFFC7000,
+		.end		= 0xFFFC7018 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device hspi_device = {
+	.name	= "sh-hspi",
+	.id	= 0,
+	.resource	= hspi_resources,
+	.num_resources	= ARRAY_SIZE(hspi_resources),
+};
+
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+	[0] = {
+		.start		= 0xffe70000,
+		.end		= 0xffe70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= 0xfff70000,
+		.end		= 0xfff70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device usb_phy_device = {
+	.name		= "rcar_usb_phy",
+	.resource	= usb_phy_resources,
+	.num_resources	= ARRAY_SIZE(usb_phy_resources),
+};
+
+static struct platform_device *marzen_devices[] __initdata = {
+	&eth_device,
+	&sdhi0_device,
+	&thermal_device,
+	&hspi_device,
+	&usb_phy_device,
+};
+
+/* USB */
+static struct usb_phy *phy;
+static int usb_power_on(struct platform_device *pdev)
+{
+	if (!phy)
+		return -EIO;
+
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
+	usb_phy_init(phy);
+
+	return 0;
+}
+
+static void usb_power_off(struct platform_device *pdev)
+{