@@ -933,6 +933,7 @@ max17042_get_of_pdata(struct max17042_chip *chip)
pdata->vmin = INT_MIN;
if (of_property_read_s32(np, "maxim,over-volt", &pdata->vmax))
pdata->vmax = INT_MAX;
+ pdata->is_irq_shared = of_property_read_bool(np, "shared-irq");
return pdata;
}
@@ -1109,7 +1110,7 @@ static int max17042_probe(struct i2c_client *client)
* On ACPI systems the IRQ may be handled by ACPI-event code,
* so we need to share (if the ACPI code is willing to share).
*/
- if (acpi_id)
+ if (acpi_id || chip->pdata->is_irq_shared)
flags |= IRQF_SHARED | IRQF_PROBE_SHARED;
ret = devm_request_threaded_irq(&client->dev, client->irq,
@@ -250,6 +250,7 @@ struct max17042_platform_data {
int num_init_data; /* Number of enties in init_data array */
bool enable_current_sense;
bool enable_por_init; /* Use POR init from Maxim appnote */
+ bool is_irq_shared;
/*
* R_sns in micro-ohms.
If shared-irq specified in device tree, request irq as shared. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> --- drivers/power/supply/max17042_battery.c | 3 ++- include/linux/power/max17042_battery.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)