Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Alexandre Courbot
On Fri, Apr 11, 2014 at 12:42 AM, Stephen Warren  wrote:
> On 04/10/2014 01:04 AM, Alexandre Courbot wrote:
>> Stephen, any news about this patch? I'm waiting for it to be merged in
>> order to resend some Tegra DTs, but still cannot see it in -next.
>
> To be honest, this became too painful to work on just to fix a warning
> at boot which has no practical side-effect in our case. The best thing
> to do is just merge your DTs for 3.16, and keep ignoring the warning
> just like we always have on Dalmore. Hopefully at some point I (or
> someone) will run out of higher priority work items and get back to this.

Ok, fine by me. I will wait for -rc1, see if I can enable more devices
with 3.16 and send you the updated DTs soon after.

Thanks,
Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Stephen Warren
On 04/10/2014 01:04 AM, Alexandre Courbot wrote:
> Stephen, any news about this patch? I'm waiting for it to be merged in
> order to resend some Tegra DTs, but still cannot see it in -next.

To be honest, this became too painful to work on just to fix a warning
at boot which has no practical side-effect in our case. The best thing
to do is just merge your DTs for 3.16, and keep ignoring the warning
just like we always have on Dalmore. Hopefully at some point I (or
someone) will run out of higher priority work items and get back to this.

> Thanks,
> Alex.
> 
> On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren  wrote:
>> From: Stephen Warren 
>>
>> Implement the new DT property ti,irq-externally-inverted, and add an
>> equivalent platform data field to match. This allows the driver to
>> correctly automatically configure the IRQ output polarity when the board
>> or SoC contains an inverter between the Palmas IRQ output and IRQ
>> controller input.
>>
>> Signed-off-by: Stephen Warren 
>> ---
>> v3:
>> * Use an IRQD flag to represent the data, rather than a custom DT property.
>> v2:
>> * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
>> ---
>>  drivers/mfd/palmas.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
>> index d280d789e55a..3281d4103e9d 100644
>> --- a/drivers/mfd/palmas.c
>> +++ b/drivers/mfd/palmas.c
>> @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
>> *i2c,
>> return -EINVAL;
>> }
>>
>> -   pdata->irq_flags = irqd_get_trigger_type(irq_data);
>> +   pdata->irq_flags = irqd_get_trigger_type(irq_data) |
>> +  irqd_get_src_dst_inverted(irq_data);
>> dev_info(>dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
>> return 0;
>>  }
>> @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
>> reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
>> else
>> reg = 0;
>> +   if (pdata->irq_flags & IRQ_SRC_DST_INVERTED)
>> +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
>> ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
>> PALMAS_POLARITY_CTRL, 
>> PALMAS_POLARITY_CTRL_INT_POLARITY,
>> reg);
>> --
>> 1.8.1.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Lee Jones
> Stephen, any news about this patch? I'm waiting for it to be merged in
> order to resend some Tegra DTs, but still cannot see it in -next.

I doubt it's been applied.

No one got back to me with reference to how to deal with the set [1],
so I certainly didn't apply it.

[1] http://www.spinics.net/lists/arm-kernel/msg312694.html

> On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren  wrote:
> > From: Stephen Warren 
> >
> > Implement the new DT property ti,irq-externally-inverted, and add an
> > equivalent platform data field to match. This allows the driver to
> > correctly automatically configure the IRQ output polarity when the board
> > or SoC contains an inverter between the Palmas IRQ output and IRQ
> > controller input.
> >
> > Signed-off-by: Stephen Warren 
> > ---
> > v3:
> > * Use an IRQD flag to represent the data, rather than a custom DT property.
> > v2:
> > * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
> > ---
> >  drivers/mfd/palmas.c | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
> > index d280d789e55a..3281d4103e9d 100644
> > --- a/drivers/mfd/palmas.c
> > +++ b/drivers/mfd/palmas.c
> > @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
> > *i2c,
> > return -EINVAL;
> > }
> >
> > -   pdata->irq_flags = irqd_get_trigger_type(irq_data);
> > +   pdata->irq_flags = irqd_get_trigger_type(irq_data) |
> > +  irqd_get_src_dst_inverted(irq_data);
> > dev_info(>dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
> > return 0;
> >  }
> > @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
> > reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
> > else
> > reg = 0;
> > +   if (pdata->irq_flags & IRQ_SRC_DST_INVERTED)
> > +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
> > ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
> > PALMAS_POLARITY_CTRL, 
> > PALMAS_POLARITY_CTRL_INT_POLARITY,
> > reg);
> >

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Alexandre Courbot
Stephen, any news about this patch? I'm waiting for it to be merged in
order to resend some Tegra DTs, but still cannot see it in -next.

Thanks,
Alex.

On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Implement the new DT property ti,irq-externally-inverted, and add an
> equivalent platform data field to match. This allows the driver to
> correctly automatically configure the IRQ output polarity when the board
> or SoC contains an inverter between the Palmas IRQ output and IRQ
> controller input.
>
> Signed-off-by: Stephen Warren 
> ---
> v3:
> * Use an IRQD flag to represent the data, rather than a custom DT property.
> v2:
> * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
> ---
>  drivers/mfd/palmas.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
> index d280d789e55a..3281d4103e9d 100644
> --- a/drivers/mfd/palmas.c
> +++ b/drivers/mfd/palmas.c
> @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
> *i2c,
> return -EINVAL;
> }
>
> -   pdata->irq_flags = irqd_get_trigger_type(irq_data);
> +   pdata->irq_flags = irqd_get_trigger_type(irq_data) |
> +  irqd_get_src_dst_inverted(irq_data);
> dev_info(>dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
> return 0;
>  }
> @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
> reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
> else
> reg = 0;
> +   if (pdata->irq_flags & IRQ_SRC_DST_INVERTED)
> +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
> ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
> PALMAS_POLARITY_CTRL, 
> PALMAS_POLARITY_CTRL_INT_POLARITY,
> reg);
> --
> 1.8.1.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Alexandre Courbot
Stephen, any news about this patch? I'm waiting for it to be merged in
order to resend some Tegra DTs, but still cannot see it in -next.

Thanks,
Alex.

On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 Implement the new DT property ti,irq-externally-inverted, and add an
 equivalent platform data field to match. This allows the driver to
 correctly automatically configure the IRQ output polarity when the board
 or SoC contains an inverter between the Palmas IRQ output and IRQ
 controller input.

 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 v3:
 * Use an IRQD flag to represent the data, rather than a custom DT property.
 v2:
 * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
 ---
  drivers/mfd/palmas.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index d280d789e55a..3281d4103e9d 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c
 @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
 *i2c,
 return -EINVAL;
 }

 -   pdata-irq_flags = irqd_get_trigger_type(irq_data);
 +   pdata-irq_flags = irqd_get_trigger_type(irq_data) |
 +  irqd_get_src_dst_inverted(irq_data);
 dev_info(i2c-dev, Irq flag is 0x%08x\n, pdata-irq_flags);
 return 0;
  }
 @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
 reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
 else
 reg = 0;
 +   if (pdata-irq_flags  IRQ_SRC_DST_INVERTED)
 +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
 ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
 PALMAS_POLARITY_CTRL, 
 PALMAS_POLARITY_CTRL_INT_POLARITY,
 reg);
 --
 1.8.1.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-tegra in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Lee Jones
 Stephen, any news about this patch? I'm waiting for it to be merged in
 order to resend some Tegra DTs, but still cannot see it in -next.

I doubt it's been applied.

No one got back to me with reference to how to deal with the set [1],
so I certainly didn't apply it.

[1] http://www.spinics.net/lists/arm-kernel/msg312694.html

 On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren swar...@wwwdotorg.org wrote:
  From: Stephen Warren swar...@nvidia.com
 
  Implement the new DT property ti,irq-externally-inverted, and add an
  equivalent platform data field to match. This allows the driver to
  correctly automatically configure the IRQ output polarity when the board
  or SoC contains an inverter between the Palmas IRQ output and IRQ
  controller input.
 
  Signed-off-by: Stephen Warren swar...@nvidia.com
  ---
  v3:
  * Use an IRQD flag to represent the data, rather than a custom DT property.
  v2:
  * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
  ---
   drivers/mfd/palmas.c | 5 -
   1 file changed, 4 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
  index d280d789e55a..3281d4103e9d 100644
  --- a/drivers/mfd/palmas.c
  +++ b/drivers/mfd/palmas.c
  @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
  *i2c,
  return -EINVAL;
  }
 
  -   pdata-irq_flags = irqd_get_trigger_type(irq_data);
  +   pdata-irq_flags = irqd_get_trigger_type(irq_data) |
  +  irqd_get_src_dst_inverted(irq_data);
  dev_info(i2c-dev, Irq flag is 0x%08x\n, pdata-irq_flags);
  return 0;
   }
  @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
  reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
  else
  reg = 0;
  +   if (pdata-irq_flags  IRQ_SRC_DST_INVERTED)
  +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
  ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
  PALMAS_POLARITY_CTRL, 
  PALMAS_POLARITY_CTRL_INT_POLARITY,
  reg);
 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Stephen Warren
On 04/10/2014 01:04 AM, Alexandre Courbot wrote:
 Stephen, any news about this patch? I'm waiting for it to be merged in
 order to resend some Tegra DTs, but still cannot see it in -next.

To be honest, this became too painful to work on just to fix a warning
at boot which has no practical side-effect in our case. The best thing
to do is just merge your DTs for 3.16, and keep ignoring the warning
just like we always have on Dalmore. Hopefully at some point I (or
someone) will run out of higher priority work items and get back to this.

 Thanks,
 Alex.
 
 On Tue, Mar 4, 2014 at 4:51 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 Implement the new DT property ti,irq-externally-inverted, and add an
 equivalent platform data field to match. This allows the driver to
 correctly automatically configure the IRQ output polarity when the board
 or SoC contains an inverter between the Palmas IRQ output and IRQ
 controller input.

 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 v3:
 * Use an IRQD flag to represent the data, rather than a custom DT property.
 v2:
 * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
 ---
  drivers/mfd/palmas.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

 diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
 index d280d789e55a..3281d4103e9d 100644
 --- a/drivers/mfd/palmas.c
 +++ b/drivers/mfd/palmas.c
 @@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client 
 *i2c,
 return -EINVAL;
 }

 -   pdata-irq_flags = irqd_get_trigger_type(irq_data);
 +   pdata-irq_flags = irqd_get_trigger_type(irq_data) |
 +  irqd_get_src_dst_inverted(irq_data);
 dev_info(i2c-dev, Irq flag is 0x%08x\n, pdata-irq_flags);
 return 0;
  }
 @@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
 reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
 else
 reg = 0;
 +   if (pdata-irq_flags  IRQ_SRC_DST_INVERTED)
 +   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
 ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
 PALMAS_POLARITY_CTRL, 
 PALMAS_POLARITY_CTRL_INT_POLARITY,
 reg);
 --
 1.8.1.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-tegra in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-04-10 Thread Alexandre Courbot
On Fri, Apr 11, 2014 at 12:42 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 On 04/10/2014 01:04 AM, Alexandre Courbot wrote:
 Stephen, any news about this patch? I'm waiting for it to be merged in
 order to resend some Tegra DTs, but still cannot see it in -next.

 To be honest, this became too painful to work on just to fix a warning
 at boot which has no practical side-effect in our case. The best thing
 to do is just merge your DTs for 3.16, and keep ignoring the warning
 just like we always have on Dalmore. Hopefully at some point I (or
 someone) will run out of higher priority work items and get back to this.

Ok, fine by me. I will wait for -rc1, see if I can enable more devices
with 3.16 and send you the updated DTs soon after.

Thanks,
Alex.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-03-04 Thread Lee Jones
> From: Stephen Warren 
> 
> Implement the new DT property ti,irq-externally-inverted, and add an
> equivalent platform data field to match. This allows the driver to
> correctly automatically configure the IRQ output polarity when the board
> or SoC contains an inverter between the Palmas IRQ output and IRQ
> controller input.
> 
> Signed-off-by: Stephen Warren 
> ---
> v3:
> * Use an IRQD flag to represent the data, rather than a custom DT property.
> v2:
> * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
> ---
>  drivers/mfd/palmas.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Looks good to me. Let me know how you want to deal with this. I'm
happy to create an immutable branch for everyone to pull from.

Acked-by: Lee Jones 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-03-04 Thread Lee Jones
 From: Stephen Warren swar...@nvidia.com
 
 Implement the new DT property ti,irq-externally-inverted, and add an
 equivalent platform data field to match. This allows the driver to
 correctly automatically configure the IRQ output polarity when the board
 or SoC contains an inverter between the Palmas IRQ output and IRQ
 controller input.
 
 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 v3:
 * Use an IRQD flag to represent the data, rather than a custom DT property.
 v2:
 * Split V1's patch 1/2 into separate patches 1/3 and 2/3.
 ---
  drivers/mfd/palmas.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

Looks good to me. Let me know how you want to deal with this. I'm
happy to create an immutable branch for everyone to pull from.

Acked-by: Lee Jones lee.jo...@linaro.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-03-03 Thread Stephen Warren
From: Stephen Warren 

Implement the new DT property ti,irq-externally-inverted, and add an
equivalent platform data field to match. This allows the driver to
correctly automatically configure the IRQ output polarity when the board
or SoC contains an inverter between the Palmas IRQ output and IRQ
controller input.

Signed-off-by: Stephen Warren 
---
v3:
* Use an IRQD flag to represent the data, rather than a custom DT property.
v2:
* Split V1's patch 1/2 into separate patches 1/3 and 2/3.
---
 drivers/mfd/palmas.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index d280d789e55a..3281d4103e9d 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client *i2c,
return -EINVAL;
}
 
-   pdata->irq_flags = irqd_get_trigger_type(irq_data);
+   pdata->irq_flags = irqd_get_trigger_type(irq_data) |
+  irqd_get_src_dst_inverted(irq_data);
dev_info(>dev, "Irq flag is 0x%08x\n", pdata->irq_flags);
return 0;
 }
@@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
else
reg = 0;
+   if (pdata->irq_flags & IRQ_SRC_DST_INVERTED)
+   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
PALMAS_POLARITY_CTRL, PALMAS_POLARITY_CTRL_INT_POLARITY,
reg);
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 4/5] mfd: palmas: support IRQ inversion at the board level

2014-03-03 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Implement the new DT property ti,irq-externally-inverted, and add an
equivalent platform data field to match. This allows the driver to
correctly automatically configure the IRQ output polarity when the board
or SoC contains an inverter between the Palmas IRQ output and IRQ
controller input.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
v3:
* Use an IRQD flag to represent the data, rather than a custom DT property.
v2:
* Split V1's patch 1/2 into separate patches 1/3 and 2/3.
---
 drivers/mfd/palmas.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index d280d789e55a..3281d4103e9d 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -292,7 +292,8 @@ static int palmas_set_pdata_irq_flag(struct i2c_client *i2c,
return -EINVAL;
}
 
-   pdata-irq_flags = irqd_get_trigger_type(irq_data);
+   pdata-irq_flags = irqd_get_trigger_type(irq_data) |
+  irqd_get_src_dst_inverted(irq_data);
dev_info(i2c-dev, Irq flag is 0x%08x\n, pdata-irq_flags);
return 0;
 }
@@ -447,6 +448,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
else
reg = 0;
+   if (pdata-irq_flags  IRQ_SRC_DST_INVERTED)
+   reg ^= PALMAS_POLARITY_CTRL_INT_POLARITY;
ret = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE,
PALMAS_POLARITY_CTRL, PALMAS_POLARITY_CTRL_INT_POLARITY,
reg);
-- 
1.8.1.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/