Re: [PATCH] mfd: palmas: provide irq flags through DT/platform data

From: Mark Brown
Date: Fri Mar 01 2013 - 07:44:33 EST


On Fri, Mar 01, 2013 at 06:04:56PM +0530, Laxman Dewangan wrote:

> Currently driver sets the irq type to IRQF_TRIGGER_LOW which is
> causing interrupt registration failure in ARM based SoCs as:
> [ 0.208479] genirq: Setting trigger mode 8 for irq 118 failed (gic_set_type+0x0/0xf0)
> [ 0.208513] dummy 0-0059: Failed to request IRQ 118: -22

This can't be a generic problem on ARM systems, I'm pretty sure the
primary users of palmas would've noticed, this is more of a new feature
isn't it?

> + /* Change interrupt line output polarity */
> + ret = palmas_read(palmas, PALMAS_PU_PD_OD_BASE,
> + PALMAS_POLARITY_CTRL, &reg);
> + if (ret < 0) {
> + dev_err(palmas->dev, "POLARITY_CTRL read failed: %d\n", ret);
> + goto err;
> + }
> +
> + if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH)
> + reg |= PALMAS_POLARITY_CTRL_INT_POLARITY;
> + else
> + reg &= ~PALMAS_POLARITY_CTRL_INT_POLARITY;
> + ret = palmas_write(palmas, PALMAS_PU_PD_OD_BASE,
> + PALMAS_POLARITY_CTRL, reg);
> + if (ret < 0) {
> + dev_err(palmas->dev, "POLARITY_CTRL write failed: %d\n", ret);
> + goto err;
> + }

Isn't there a read/modify/write call for palmas?

Otherwise looks good; I wonder if we even need the platform data though
I can't see it hurting.

Attachment: signature.asc
Description: Digital signature