hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/intel-lpss-acpi.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Intel LPSS ACPI support.
34 *
....@@ -5,22 +6,21 @@
56 *
67 * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
78 * Mika Westerberg <mika.westerberg@linux.intel.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/acpi.h>
1512 #include <linux/ioport.h>
1613 #include <linux/kernel.h>
1714 #include <linux/module.h>
18
-#include <linux/pm.h>
1915 #include <linux/pm_runtime.h>
2016 #include <linux/platform_device.h>
2117 #include <linux/property.h>
2218
2319 #include "intel-lpss.h"
20
+
21
+static const struct intel_lpss_platform_info spt_info = {
22
+ .clk_rate = 120000000,
23
+};
2424
2525 static struct property_entry spt_i2c_properties[] = {
2626 PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230),
....@@ -30,6 +30,19 @@
3030 static const struct intel_lpss_platform_info spt_i2c_info = {
3131 .clk_rate = 120000000,
3232 .properties = spt_i2c_properties,
33
+};
34
+
35
+static struct property_entry uart_properties[] = {
36
+ PROPERTY_ENTRY_U32("reg-io-width", 4),
37
+ PROPERTY_ENTRY_U32("reg-shift", 2),
38
+ PROPERTY_ENTRY_BOOL("snps,uart-16550-compatible"),
39
+ { },
40
+};
41
+
42
+static const struct intel_lpss_platform_info spt_uart_info = {
43
+ .clk_rate = 120000000,
44
+ .clk_con_id = "baudclk",
45
+ .properties = uart_properties,
3346 };
3447
3548 static const struct intel_lpss_platform_info bxt_info = {
....@@ -62,8 +75,17 @@
6275
6376 static const struct acpi_device_id intel_lpss_acpi_ids[] = {
6477 /* SPT */
78
+ { "INT3440", (kernel_ulong_t)&spt_info },
79
+ { "INT3441", (kernel_ulong_t)&spt_info },
80
+ { "INT3442", (kernel_ulong_t)&spt_i2c_info },
81
+ { "INT3443", (kernel_ulong_t)&spt_i2c_info },
82
+ { "INT3444", (kernel_ulong_t)&spt_i2c_info },
83
+ { "INT3445", (kernel_ulong_t)&spt_i2c_info },
6584 { "INT3446", (kernel_ulong_t)&spt_i2c_info },
6685 { "INT3447", (kernel_ulong_t)&spt_i2c_info },
86
+ { "INT3448", (kernel_ulong_t)&spt_uart_info },
87
+ { "INT3449", (kernel_ulong_t)&spt_uart_info },
88
+ { "INT344A", (kernel_ulong_t)&spt_uart_info },
6789 /* BXT */
6890 { "80860AAC", (kernel_ulong_t)&bxt_i2c_info },
6991 { "80860ABC", (kernel_ulong_t)&bxt_info },
....@@ -92,6 +114,9 @@
92114 return -ENOMEM;
93115
94116 info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
117
+ if (!info->mem)
118
+ return -ENODEV;
119
+
95120 info->irq = platform_get_irq(pdev, 0);
96121
97122 ret = intel_lpss_probe(&pdev->dev, info);