Thread (5 messages) flat view 5 messages, 4 authors, 2021-04-03

Re: [PATCH v5 1/2] pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander

From: Linus Walleij <hidden>
Date: 2021-01-26 14:49:25
Also in: linux-gpio, lkml, phone-devel

On Mon, Jan 25, 2021 at 7:22 PM AngeloGioacchino Del Regno
[off-list ref] wrote:
The Awinic AW9523(B) is a multi-function I2C gpio expander in a
TQFN-24L package, featuring PWM (max 37mA per pin, or total max
power 3.2Watts) for LED driving capability.

It has two ports with 8 pins per port (for a total of 16 pins),
configurable as either PWM with 1/256 stepping or GPIO input/output,
1.8V logic input; each GPIO can be configured as input or output
independently from each other.

This IC also has an internal interrupt controller, which is capable
of generating an interrupt for each GPIO, depending on the
configuration, and will raise an interrupt on the INTN pin to
advertise this to an external interrupt controller.

Signed-off-by: AngeloGioacchino Del Regno <redacted>
(...)
+static int aw9523_gpio_irq_type(struct irq_data *d, unsigned int type)
+{
+       switch (type) {
+       case IRQ_TYPE_NONE:
+       case IRQ_TYPE_EDGE_BOTH:
+               return 0;
+       default:
+               return -EINVAL;
+       };
+}
This looks better.
+static int aw9523_init_irq(struct aw9523 *awi, int irq)
+{
(...)
+       gpioirq = &awi->gpio.irq;
+       gpioirq->chip = irqchip;
+       gpioirq->parent_handler = NULL;
+       gpioirq->num_parents = 0;
+       gpioirq->parents = NULL;
+       gpioirq->default_type = IRQ_TYPE_LEVEL_MASK;
This looks wrong. IRQ_TYPE_EDGE_BOTH?

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help