Skip to content

Commit 871f1f2

Browse files
jwrdegoedeandy-shev
authored andcommitted
platform/x86: intel_int0002_vgpio: Only implement irq_set_wake on Bay Trail
Commit c3b8e88 ("platform/x86: intel_int0002_vgpio: Implement irq_set_wake"), was written to fix some wakeup issues on Bay Trail (BYT) devices. We've received a bug report that this causes a suspend regression on some Cherry Trail (CHT) based devices. To fix the issues this causes on CHT devices, this commit modifies the irq_set_wake support so that we only implement irq_set_wake on BYT devices, Fixes: c3b8e88 ("platform/x86: intel_int0002_vgpio: ... irq_set_wake") Reported-and-tested-by: Maxim Mikityanskiy <maxtram95@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 0bbbe97 commit 871f1f2

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

‎drivers/platform/x86/intel_int0002_vgpio.c‎

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@
5151
#define GPE0A_STS_PORT 0x420
5252
#define GPE0A_EN_PORT 0x428
5353

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 }
5558

5659
static const struct x86_cpu_id int0002_cpu_ids[] = {
57-
ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */
58-
ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */
60+
ICPU(INTEL_FAM6_ATOM_SILVERMONT, BAYTRAIL), /* Valleyview, Bay Trail */
61+
ICPU(INTEL_FAM6_ATOM_AIRMONT, CHERRYTRAIL), /* Braswell, Cherry Trail */
5962
{}
6063
};
6164

@@ -135,18 +138,30 @@ static irqreturn_t int0002_irq(int irq, void *data)
135138
return IRQ_HANDLED;
136139
}
137140

138-
static struct irq_chip int0002_irqchip = {
141+
static struct irq_chip int0002_byt_irqchip = {
139142
.name = DRV_NAME,
140143
.irq_ack = int0002_irq_ack,
141144
.irq_mask = int0002_irq_mask,
142145
.irq_unmask = int0002_irq_unmask,
143146
.irq_set_wake = int0002_irq_set_wake,
144147
};
145148

149+
static 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+
146160
static int int0002_probe(struct platform_device *pdev)
147161
{
148162
struct device *dev = &pdev->dev;
149163
const struct x86_cpu_id *cpu_id;
164+
struct irq_chip *irq_chip;
150165
struct gpio_chip *chip;
151166
int irq, ret;
152167

@@ -195,14 +210,19 @@ static int int0002_probe(struct platform_device *pdev)
195210
return ret;
196211
}
197212

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,
199219
IRQ_TYPE_NONE);
200220
if (ret) {
201221
dev_err(dev, "Error adding irqchip: %d\n", ret);
202222
return ret;
203223
}
204224

205-
gpiochip_set_chained_irqchip(chip, &int0002_irqchip, irq, NULL);
225+
gpiochip_set_chained_irqchip(chip, irq_chip, irq, NULL);
206226

207227
return 0;
208228
}

0 commit comments

Comments
 (0)