.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel LPSS ACPI support. |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
---|
7 | 8 | * 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. |
---|
12 | 9 | */ |
---|
13 | 10 | |
---|
14 | 11 | #include <linux/acpi.h> |
---|
15 | 12 | #include <linux/ioport.h> |
---|
16 | 13 | #include <linux/kernel.h> |
---|
17 | 14 | #include <linux/module.h> |
---|
18 | | -#include <linux/pm.h> |
---|
19 | 15 | #include <linux/pm_runtime.h> |
---|
20 | 16 | #include <linux/platform_device.h> |
---|
21 | 17 | #include <linux/property.h> |
---|
22 | 18 | |
---|
23 | 19 | #include "intel-lpss.h" |
---|
| 20 | + |
---|
| 21 | +static const struct intel_lpss_platform_info spt_info = { |
---|
| 22 | + .clk_rate = 120000000, |
---|
| 23 | +}; |
---|
24 | 24 | |
---|
25 | 25 | static struct property_entry spt_i2c_properties[] = { |
---|
26 | 26 | PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230), |
---|
.. | .. |
---|
30 | 30 | static const struct intel_lpss_platform_info spt_i2c_info = { |
---|
31 | 31 | .clk_rate = 120000000, |
---|
32 | 32 | .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, |
---|
33 | 46 | }; |
---|
34 | 47 | |
---|
35 | 48 | static const struct intel_lpss_platform_info bxt_info = { |
---|
.. | .. |
---|
62 | 75 | |
---|
63 | 76 | static const struct acpi_device_id intel_lpss_acpi_ids[] = { |
---|
64 | 77 | /* 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 }, |
---|
65 | 84 | { "INT3446", (kernel_ulong_t)&spt_i2c_info }, |
---|
66 | 85 | { "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 }, |
---|
67 | 89 | /* BXT */ |
---|
68 | 90 | { "80860AAC", (kernel_ulong_t)&bxt_i2c_info }, |
---|
69 | 91 | { "80860ABC", (kernel_ulong_t)&bxt_info }, |
---|
.. | .. |
---|
92 | 114 | return -ENOMEM; |
---|
93 | 115 | |
---|
94 | 116 | info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
| 117 | + if (!info->mem) |
---|
| 118 | + return -ENODEV; |
---|
| 119 | + |
---|
95 | 120 | info->irq = platform_get_irq(pdev, 0); |
---|
96 | 121 | |
---|
97 | 122 | ret = intel_lpss_probe(&pdev->dev, info); |
---|