Re: [PATCH 0/1] regmap-irq: support chips with separate mask bits for irq edges

2018-12-05 Thread Mark Brown
On Tue, Dec 04, 2018 at 07:15:49PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski 
> 
> I'm working on an MFD driver (and its accompanying drivers in various
> subsystems) for a simple low-power PMIC which exposes a single GPIO
> line. It has a couple of interrupts all bunched together in two

Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff.  This reduces mail volume and ensures that 
any important information is recorded in the changelog rather than being
lost. 


signature.asc
Description: PGP signature


Re: [PATCH 0/1] regmap-irq: support chips with separate mask bits for irq edges

2018-12-05 Thread Mark Brown
On Tue, Dec 04, 2018 at 07:15:49PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski 
> 
> I'm working on an MFD driver (and its accompanying drivers in various
> subsystems) for a simple low-power PMIC which exposes a single GPIO
> line. It has a couple of interrupts all bunched together in two

Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff.  This reduces mail volume and ensures that 
any important information is recorded in the changelog rather than being
lost. 


signature.asc
Description: PGP signature


[PATCH 0/1] regmap-irq: support chips with separate mask bits for irq edges

2018-12-04 Thread Bartosz Golaszewski
From: Bartosz Golaszewski 

I'm working on an MFD driver (and its accompanying drivers in various
subsystems) for a simple low-power PMIC which exposes a single GPIO
line. It has a couple of interrupts all bunched together in two
registers and all of them but the one for GPIO are controlled by
single mask bits. The GPIO interrupt is configured with two separate
bits - one for rising edge and one for falling edge interrupts.

Since the device is relatively simple I would really like to avoid
having to write the entire irq_chip boiler code if regmap_irq_chip
would be perfect in this case.

We already have the type mask fields in struct regmap_irq. This
patch proposes a simple change that reuses them. If the mask_base
and type_base offsets are the same, the enable callback will
use the bits written to the type buffer by the set_type callback
to only enable the requested edge interrupt.

Bartosz Golaszewski (1):
  regmap: irq: handle HW using separate mask bits for edges

 drivers/base/regmap/regmap-irq.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

-- 
2.19.1



[PATCH 0/1] regmap-irq: support chips with separate mask bits for irq edges

2018-12-04 Thread Bartosz Golaszewski
From: Bartosz Golaszewski 

I'm working on an MFD driver (and its accompanying drivers in various
subsystems) for a simple low-power PMIC which exposes a single GPIO
line. It has a couple of interrupts all bunched together in two
registers and all of them but the one for GPIO are controlled by
single mask bits. The GPIO interrupt is configured with two separate
bits - one for rising edge and one for falling edge interrupts.

Since the device is relatively simple I would really like to avoid
having to write the entire irq_chip boiler code if regmap_irq_chip
would be perfect in this case.

We already have the type mask fields in struct regmap_irq. This
patch proposes a simple change that reuses them. If the mask_base
and type_base offsets are the same, the enable callback will
use the bits written to the type buffer by the set_type callback
to only enable the requested edge interrupt.

Bartosz Golaszewski (1):
  regmap: irq: handle HW using separate mask bits for edges

 drivers/base/regmap/regmap-irq.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

-- 
2.19.1