aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-30 08:34:05 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-30 10:04:36 -0400
commitd6ddaaac8f5c37ad84db3e6e019981f392389cf0 (patch)
tree1b5cb6bd0e4e8ba9b02b81174fb5f3464aabff59 /drivers/acpi
parentcccd420859a419756bc4ed25d52989a47d702561 (diff)
ACPI / scan: always register ACPI LPSS scan handler
Prevent platform devices from being created for ACPI LPSS devices if CONFIG_X86_INTEL_LPSS is unset by compiling out the LPSS scan handler's callbacks only in that case and still compiling its device ID list in and registering the scan handler in either case. This change is based on a prototype from Zhang Rui. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Makefile2
-rw-r--r--drivers/acpi/acpi_lpss.c65
-rw-r--r--drivers/acpi/internal.h4
3 files changed, 46 insertions, 25 deletions
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index f1c9266430d9..ea55e0179f81 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -39,7 +39,7 @@ acpi-y += processor_core.o
39acpi-y += ec.o 39acpi-y += ec.o
40acpi-$(CONFIG_ACPI_DOCK) += dock.o 40acpi-$(CONFIG_ACPI_DOCK) += dock.o
41acpi-y += pci_root.o pci_link.o pci_irq.o 41acpi-y += pci_root.o pci_link.o pci_irq.o
42acpi-$(CONFIG_X86_INTEL_LPSS) += acpi_lpss.o 42acpi-y += acpi_lpss.o
43acpi-y += acpi_platform.o 43acpi-y += acpi_platform.o
44acpi-y += acpi_pnp.o 44acpi-y += acpi_pnp.o
45acpi-y += power.o 45acpi-y += power.o
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index db362a96c38e..51069b260518 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -25,6 +25,10 @@
25 25
26ACPI_MODULE_NAME("acpi_lpss"); 26ACPI_MODULE_NAME("acpi_lpss");
27 27
28#ifdef CONFIG_X86_INTEL_LPSS
29
30#define LPSS_ADDR(desc) ((unsigned long)&desc)
31
28#define LPSS_CLK_SIZE 0x04 32#define LPSS_CLK_SIZE 0x04
29#define LPSS_LTR_SIZE 0x18 33#define LPSS_LTR_SIZE 0x18
30 34
@@ -169,40 +173,48 @@ static struct lpss_device_desc byt_i2c_dev_desc = {
169 .shared_clock = &i2c_clock, 173 .shared_clock = &i2c_clock,
170}; 174};
171 175
176#else
177
178#define LPSS_ADDR(desc) (0UL)
179
180#endif /* CONFIG_X86_INTEL_LPSS */
181
172static const struct acpi_device_id acpi_lpss_device_ids[] = { 182static const struct acpi_device_id acpi_lpss_device_ids[] = {
173 /* Generic LPSS devices */ 183 /* Generic LPSS devices */
174 { "INTL9C60", (unsigned long)&lpss_dma_desc }, 184 { "INTL9C60", LPSS_ADDR(lpss_dma_desc) },
175 185
176 /* Lynxpoint LPSS devices */ 186 /* Lynxpoint LPSS devices */
177 { "INT33C0", (unsigned long)&lpt_dev_desc }, 187 { "INT33C0", LPSS_ADDR(lpt_dev_desc) },
178 { "INT33C1", (unsigned long)&lpt_dev_desc }, 188 { "INT33C1", LPSS_ADDR(lpt_dev_desc) },
179 { "INT33C2", (unsigned long)&lpt_i2c_dev_desc }, 189 { "INT33C2", LPSS_ADDR(lpt_i2c_dev_desc) },
180 { "INT33C3", (unsigned long)&lpt_i2c_dev_desc }, 190 { "INT33C3", LPSS_ADDR(lpt_i2c_dev_desc) },
181 { "INT33C4", (unsigned long)&lpt_uart_dev_desc }, 191 { "INT33C4", LPSS_ADDR(lpt_uart_dev_desc) },
182 { "INT33C5", (unsigned long)&lpt_uart_dev_desc }, 192 { "INT33C5", LPSS_ADDR(lpt_uart_dev_desc) },
183 { "INT33C6", (unsigned long)&lpt_sdio_dev_desc }, 193 { "INT33C6", LPSS_ADDR(lpt_sdio_dev_desc) },
184 { "INT33C7", }, 194 { "INT33C7", },
185 195
186 /* BayTrail LPSS devices */ 196 /* BayTrail LPSS devices */
187 { "80860F09", (unsigned long)&byt_pwm_dev_desc }, 197 { "80860F09", LPSS_ADDR(byt_pwm_dev_desc) },
188 { "80860F0A", (unsigned long)&byt_uart_dev_desc }, 198 { "80860F0A", LPSS_ADDR(byt_uart_dev_desc) },
189 { "80860F0E", (unsigned long)&byt_spi_dev_desc }, 199 { "80860F0E", LPSS_ADDR(byt_spi_dev_desc) },
190 { "80860F14", (unsigned long)&byt_sdio_dev_desc }, 200 { "80860F14", LPSS_ADDR(byt_sdio_dev_desc) },
191 { "80860F41", (unsigned long)&byt_i2c_dev_desc }, 201 { "80860F41", LPSS_ADDR(byt_i2c_dev_desc) },
192 { "INT33B2", }, 202 { "INT33B2", },
193 203
194 { "INT3430", (unsigned long)&lpt_dev_desc }, 204 { "INT3430", LPSS_ADDR(lpt_dev_desc) },
195 { "INT3431", (unsigned long)&lpt_dev_desc }, 205 { "INT3431", LPSS_ADDR(lpt_dev_desc) },
196 { "INT3432", (unsigned long)&lpt_i2c_dev_desc }, 206 { "INT3432", LPSS_ADDR(lpt_i2c_dev_desc) },
197 { "INT3433", (unsigned long)&lpt_i2c_dev_desc }, 207 { "INT3433", LPSS_ADDR(lpt_i2c_dev_desc) },
198 { "INT3434", (unsigned long)&lpt_uart_dev_desc }, 208 { "INT3434", LPSS_ADDR(lpt_uart_dev_desc) },
199 { "INT3435", (unsigned long)&lpt_uart_dev_desc }, 209 { "INT3435", LPSS_ADDR(lpt_uart_dev_desc) },
200 { "INT3436", (unsigned long)&lpt_sdio_dev_desc }, 210 { "INT3436", LPSS_ADDR(lpt_sdio_dev_desc) },
201 { "INT3437", }, 211 { "INT3437", },
202 212
203 { } 213 { }
204}; 214};
205 215
216#ifdef CONFIG_X86_INTEL_LPSS
217
206static int is_memory(struct acpi_resource *res, void *not_used) 218static int is_memory(struct acpi_resource *res, void *not_used)
207{ 219{
208 struct resource r; 220 struct resource r;
@@ -695,3 +707,16 @@ void __init acpi_lpss_init(void)
695 acpi_scan_add_handler(&lpss_handler); 707 acpi_scan_add_handler(&lpss_handler);
696 } 708 }
697} 709}
710
711#else
712
713static struct acpi_scan_handler lpss_handler = {
714 .ids = acpi_lpss_device_ids,
715};
716
717void __init acpi_lpss_init(void)
718{
719 acpi_scan_add_handler(&lpss_handler);
720}
721
722#endif /* CONFIG_X86_INTEL_LPSS */
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 5ad27bf8e4bd..7de5b603f272 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -65,11 +65,7 @@ int acpi_debugfs_init(void);
65#else 65#else
66static inline void acpi_debugfs_init(void) { return; } 66static inline void acpi_debugfs_init(void) { return; }
67#endif 67#endif
68#ifdef CONFIG_X86_INTEL_LPSS
69void acpi_lpss_init(void); 68void acpi_lpss_init(void);
70#else
71static inline void acpi_lpss_init(void) {}
72#endif
73 69
74acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src); 70acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
75bool acpi_queue_hotplug_work(struct work_struct *work); 71bool acpi_queue_hotplug_work(struct work_struct *work);