return IRQ_HANDLED;
}
+static int ccg_request_irq(struct ucsi_ccg *uc)
+{
+ unsigned long flags = IRQF_ONESHOT;
+
+ if (!has_acpi_companion(uc->dev))
+ flags |= IRQF_TRIGGER_HIGH;
+
+ return request_threaded_irq(uc->irq, NULL, ccg_irq_handler, flags, dev_name(uc->dev), uc);
+}
+
static void ccg_pm_workaround_work(struct work_struct *pm_work)
{
ccg_irq_handler(0, container_of(pm_work, struct ucsi_ccg, pm_work));
return status;
}
- status = request_threaded_irq(uc->irq, NULL, ccg_irq_handler,
- IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
- dev_name(dev), uc);
+ status = ccg_request_irq(uc);
if (status < 0) {
dev_err(dev, "request_threaded_irq failed - %d\n", status);
return status;
uc->dev = dev;
uc->client = client;
+ uc->irq = client->irq;
mutex_init(&uc->lock);
init_completion(&uc->complete);
INIT_WORK(&uc->work, ccg_update_firmware);
ucsi_set_drvdata(uc->ucsi, uc);
- status = request_threaded_irq(client->irq, NULL, ccg_irq_handler,
- IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
- dev_name(dev), uc);
+ status = ccg_request_irq(uc);
if (status < 0) {
dev_err(uc->dev, "request_threaded_irq failed - %d\n", status);
goto out_ucsi_destroy;
}
- uc->irq = client->irq;
-
status = ucsi_register(uc->ucsi);
if (status)
goto out_free_irq;