diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-01 11:42:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-01 11:42:21 -0400 |
commit | eb7046e9bf466cebfcfbcdf640e41d9e3a80086c (patch) | |
tree | 7d998f56e306de4c1a78355f219e38b75cfe3866 /drivers/platform/x86/intel_int0002_vgpio.c | |
parent | 5b7449810ae6d652629c550d3974c8453836d229 (diff) | |
parent | 3b692c55e58d06ba9b17c66784cab5a95ba5be9b (diff) |
Merge tag 'platform-drivers-x86-v4.20-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Darren Hart:
- Move the Dell dcdbas and dell_rbu drivers into platform/drivers/x86
as they are closely coupled with other drivers in this location.
- Improve _init* usage for acerhdf and fix some usage issues with
messages and module parameters.
- Simplify asus-wmi by calling ACPI/WMI methods directly, eliminating
workqueue overhead, eliminate double reporting of keyboard backlight.
- Fix wake from USB failure on Bay Trail devices (intel_int0002_vgpio).
- Notify intel_telemetry users when IPC1 device is not enabled.
- Update various drivers with new laptop model IDs.
- Update several intel drivers to use SPDX identifers and order headers
alphabetically.
* tag 'platform-drivers-x86-v4.20-1' of git://git.infradead.org/linux-platform-drivers-x86: (64 commits)
HID: asus: only support backlight when it's not driven by WMI
platform/x86: asus-wmi: export function for evaluating WMI methods
platform/x86: asus-wmi: Only notify kbd LED hw_change by fn-key pressed
platform/x86: wmi: declare device_type structure as constant
platform/x86: ideapad: Add Y530-15ICH to no_hw_rfkill
platform/x86: Add Intel AtomISP2 dummy / power-management driver
platform/x86: touchscreen_dmi: Add min-x and min-y settings for various models
platform/x86: touchscreen_dmi: Add info for the Onda V80 Plus v3 tablet
platform/x86: touchscreen_dmi: Add info for the Trekstor Primetab T13B tablet
platform/x86: intel_telemetry: Get rid of custom macro
platform/x86: intel_telemetry: report debugfs failure
MAINTAINERS: intel_telemetry: Update maintainers info
platform/x86: Add LG Gram laptop special features driver
platform/x86: asus-wmi: Simplify the keyboard brightness updating process
platform/x86: touchscreen_dmi: Add info for the Trekstor Primebook C11 convertible
platform/x86: mlx-platform: Properly use mlxplat_mlxcpld_msn201x_items
MAINTAINERS: intel_pmc_core: Update MAINTAINERS
firmware: dcdbas: include linux/io.h
platform/x86: intel-wmi-thunderbolt: Add dynamic debugging
platform/x86: intel-wmi-thunderbolt: Convert to use SPDX identifier
...
Diffstat (limited to 'drivers/platform/x86/intel_int0002_vgpio.c')
-rw-r--r-- | drivers/platform/x86/intel_int0002_vgpio.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c index e89ad4964dc1..4b8f7305fc8a 100644 --- a/drivers/platform/x86/intel_int0002_vgpio.c +++ b/drivers/platform/x86/intel_int0002_vgpio.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Intel INT0002 "Virtual GPIO" driver | 3 | * Intel INT0002 "Virtual GPIO" driver |
3 | * | 4 | * |
@@ -9,10 +10,6 @@ | |||
9 | * | 10 | * |
10 | * Author: Dyut Kumar Sil <dyut.k.sil@intel.com> | 11 | * Author: Dyut Kumar Sil <dyut.k.sil@intel.com> |
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | * | ||
16 | * Some peripherals on Bay Trail and Cherry Trail platforms signal a Power | 13 | * Some peripherals on Bay Trail and Cherry Trail platforms signal a Power |
17 | * Management Event (PME) to the Power Management Controller (PMC) to wakeup | 14 | * Management Event (PME) to the Power Management Controller (PMC) to wakeup |
18 | * the system. When this happens software needs to clear the PME bus 0 status | 15 | * the system. When this happens software needs to clear the PME bus 0 status |
@@ -57,11 +54,7 @@ | |||
57 | #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } | 54 | #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } |
58 | 55 | ||
59 | static const struct x86_cpu_id int0002_cpu_ids[] = { | 56 | static const struct x86_cpu_id int0002_cpu_ids[] = { |
60 | /* | 57 | ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */ |
61 | * Limit ourselves to Cherry Trail for now, until testing shows we | ||
62 | * need to handle the INT0002 device on Baytrail too. | ||
63 | * ICPU(INTEL_FAM6_ATOM_SILVERMONT), * Valleyview, Bay Trail * | ||
64 | */ | ||
65 | ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */ | 58 | ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */ |
66 | {} | 59 | {} |
67 | }; | 60 | }; |
@@ -110,6 +103,21 @@ static void int0002_irq_mask(struct irq_data *data) | |||
110 | outl(gpe_en_reg, GPE0A_EN_PORT); | 103 | outl(gpe_en_reg, GPE0A_EN_PORT); |
111 | } | 104 | } |
112 | 105 | ||
106 | static int int0002_irq_set_wake(struct irq_data *data, unsigned int on) | ||
107 | { | ||
108 | struct gpio_chip *chip = irq_data_get_irq_chip_data(data); | ||
109 | struct platform_device *pdev = to_platform_device(chip->parent); | ||
110 | int irq = platform_get_irq(pdev, 0); | ||
111 | |||
112 | /* Propagate to parent irq */ | ||
113 | if (on) | ||
114 | enable_irq_wake(irq); | ||
115 | else | ||
116 | disable_irq_wake(irq); | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
113 | static irqreturn_t int0002_irq(int irq, void *data) | 121 | static irqreturn_t int0002_irq(int irq, void *data) |
114 | { | 122 | { |
115 | struct gpio_chip *chip = data; | 123 | struct gpio_chip *chip = data; |
@@ -132,6 +140,7 @@ static struct irq_chip int0002_irqchip = { | |||
132 | .irq_ack = int0002_irq_ack, | 140 | .irq_ack = int0002_irq_ack, |
133 | .irq_mask = int0002_irq_mask, | 141 | .irq_mask = int0002_irq_mask, |
134 | .irq_unmask = int0002_irq_unmask, | 142 | .irq_unmask = int0002_irq_unmask, |
143 | .irq_set_wake = int0002_irq_set_wake, | ||
135 | }; | 144 | }; |
136 | 145 | ||
137 | static int int0002_probe(struct platform_device *pdev) | 146 | static int int0002_probe(struct platform_device *pdev) |
@@ -216,4 +225,4 @@ module_platform_driver(int0002_driver); | |||
216 | 225 | ||
217 | MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); | 226 | MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); |
218 | MODULE_DESCRIPTION("Intel INT0002 Virtual GPIO driver"); | 227 | MODULE_DESCRIPTION("Intel INT0002 Virtual GPIO driver"); |
219 | MODULE_LICENSE("GPL"); | 228 | MODULE_LICENSE("GPL v2"); |