aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_int0002_vgpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-10 16:16:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-10 16:16:37 -0400
commitdbbdf54c7206bf3f201f9ddaa5f4dd87835271cc (patch)
tree941dbf0dada73344acdfe891ec1d50a01316566d /drivers/platform/x86/intel_int0002_vgpio.c
parent45ba8d5d061b13494c2a7a7652d51b9da3d9e77a (diff)
parent9c22cc020db637850ba47a14a598d09f706f19ad (diff)
Merge tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Darren Hart: - use MODULE_DEVICE_TABLE across several wmi drivers, keeping wmi_device_id and MODULE_ALIAS() declarations in sync - add several Ideapad models to the no_hw_rfkill list - add support for new Mellanox platforms, including new fan and LED functionality - address Dell keyboard backlight change event and power button release issues - update dell_rbu to use appropriate memory allocation mechanisms - several small fixes and Ice Lake support for intel_pmc_core - fix a suspend regression for Cherry Trail based devices in intel_int0002_vgpio - a few other routine fixes * tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86: (50 commits) MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files platform/x86: ideapad-laptop: Add S130-14IGM to no_hw_rfkill list platform/x86: mlx-platform: Fix access mode for fan_dir attribute platform/x86: mlx-platform: Add UID LED for the next generation systems platform/x86: mlx-platform: Add extra CPLD for next generation systems platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE() platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h modpost: file2alias: define size of alias platform/x86: touchscreen_dmi: Add info for the CHUWI Hi10 Air tablet platform/x86: ideapad-laptop: Add Ideapad 530S-14ARR to no_hw_rfkill list platform/x86: ideapad-laptop: Add Yoga C930 to no_hw_rfkill_list platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown platform/x86: intel_pmc_core: Add Package cstates residency info platform/x86: intel_pmc_core: Add ICL platform support ...
Diffstat (limited to 'drivers/platform/x86/intel_int0002_vgpio.c')
-rw-r--r--drivers/platform/x86/intel_int0002_vgpio.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index 4b8f7305fc8a..1694a9aec77c 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -51,11 +51,14 @@
51#define GPE0A_STS_PORT 0x420 51#define GPE0A_STS_PORT 0x420
52#define GPE0A_EN_PORT 0x428 52#define GPE0A_EN_PORT 0x428
53 53
54#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } 54#define BAYTRAIL 0x01
55#define CHERRYTRAIL 0x02
56
57#define ICPU(model, data) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, data }
55 58
56static const struct x86_cpu_id int0002_cpu_ids[] = { 59static const struct x86_cpu_id int0002_cpu_ids[] = {
57 ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */ 60 ICPU(INTEL_FAM6_ATOM_SILVERMONT, BAYTRAIL), /* Valleyview, Bay Trail */
58 ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */ 61 ICPU(INTEL_FAM6_ATOM_AIRMONT, CHERRYTRAIL), /* Braswell, Cherry Trail */
59 {} 62 {}
60}; 63};
61 64
@@ -135,7 +138,7 @@ static irqreturn_t int0002_irq(int irq, void *data)
135 return IRQ_HANDLED; 138 return IRQ_HANDLED;
136} 139}
137 140
138static struct irq_chip int0002_irqchip = { 141static struct irq_chip int0002_byt_irqchip = {
139 .name = DRV_NAME, 142 .name = DRV_NAME,
140 .irq_ack = int0002_irq_ack, 143 .irq_ack = int0002_irq_ack,
141 .irq_mask = int0002_irq_mask, 144 .irq_mask = int0002_irq_mask,
@@ -143,10 +146,22 @@ static struct irq_chip int0002_irqchip = {
143 .irq_set_wake = int0002_irq_set_wake, 146 .irq_set_wake = int0002_irq_set_wake,
144}; 147};
145 148
149static struct irq_chip int0002_cht_irqchip = {
150 .name = DRV_NAME,
151 .irq_ack = int0002_irq_ack,
152 .irq_mask = int0002_irq_mask,
153 .irq_unmask = int0002_irq_unmask,
154 /*
155 * No set_wake, on CHT the IRQ is typically shared with the ACPI SCI
156 * and we don't want to mess with the ACPI SCI irq settings.
157 */
158};
159
146static int int0002_probe(struct platform_device *pdev) 160static int int0002_probe(struct platform_device *pdev)
147{ 161{
148 struct device *dev = &pdev->dev; 162 struct device *dev = &pdev->dev;
149 const struct x86_cpu_id *cpu_id; 163 const struct x86_cpu_id *cpu_id;
164 struct irq_chip *irq_chip;
150 struct gpio_chip *chip; 165 struct gpio_chip *chip;
151 int irq, ret; 166 int irq, ret;
152 167
@@ -195,14 +210,19 @@ static int int0002_probe(struct platform_device *pdev)
195 return ret; 210 return ret;
196 } 211 }
197 212
198 ret = gpiochip_irqchip_add(chip, &int0002_irqchip, 0, handle_edge_irq, 213 if (cpu_id->driver_data == BAYTRAIL)
214 irq_chip = &int0002_byt_irqchip;
215 else
216 irq_chip = &int0002_cht_irqchip;
217
218 ret = gpiochip_irqchip_add(chip, irq_chip, 0, handle_edge_irq,
199 IRQ_TYPE_NONE); 219 IRQ_TYPE_NONE);
200 if (ret) { 220 if (ret) {
201 dev_err(dev, "Error adding irqchip: %d\n", ret); 221 dev_err(dev, "Error adding irqchip: %d\n", ret);
202 return ret; 222 return ret;
203 } 223 }
204 224
205 gpiochip_set_chained_irqchip(chip, &int0002_irqchip, irq, NULL); 225 gpiochip_set_chained_irqchip(chip, irq_chip, irq, NULL);
206 226
207 return 0; 227 return 0;
208} 228}