Skip to contentSkip to conversation

gpio-pca953x.c

DISCUSSION Naitik Amin 2 participants 2 messages Nov 12, 2014 – Nov 21, 2014 GPIO

lore
Share & tools
lore
#0 lore raw

HI there,

I am trying to use the gpio driver for pca953x with IRQ enabled config. When the device gets probbed, I gives me an error saying :
"failed to set trigger mode 8"

The probe called,
ret = devm_request_threaded_irq(&client->dev,

					client->irq,
					   NULL,
					   pca953x_irq_handler,
					   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
					   dev_name(&client->dev), chip);

with IRQF_TRIGGER_LOW as a flag

I did some tracing and found out, irq set type, went to gic_set_type in irq- gic.c ( http://lxr.free-electrons.com/source/drivers/irqchip/irq-gic.c#L187 )

But gic_set_type, only wants to see either IRQF_TRIGGER_HIGH OR IRQF_TRIGGER_LOW, thats why it returned.

Questions
1. Is it correct that irq set type went to gic_set_type, bcoz pca953x does provide one of itself.

#1 lore raw
Quoted 8 lines · Naitik Amin

HI there,

I am trying to use the gpio driver for pca953x with IRQ enabled config. When the device gets probbed, I gives me an error saying :
"failed to set trigger mode 8"

The probe called,
ret = devm_request_threaded_irq(&client->dev,

Quoted 7 lines
					client->irq,
					   NULL,
					   pca953x_irq_handler,
					   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
					   dev_name(&client->dev), chip);

with IRQF_TRIGGER_LOW as a flag

try to remove IRQF_TRIGGER_LOW

Quoted 6 lines

I did some tracing and found out, irq set type, went to gic_set_type in irq- gic.c ( http://lxr.free-electrons.com/source/drivers/irqchip/irq-gic.c#L187 )

But gic_set_type, only wants to see either IRQF_TRIGGER_HIGH OR IRQF_TRIGGER_LOW, thats why it returned.

if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)

Quoted 4 lines

Questions
1. Is it correct that irq set type went to gic_set_type, bcoz pca953x does provide one of itself.

Valid IRQ types are IRQ controller specific values.

You don't need all this magic in code any more if you are using DT, which should provide valid configuration of IRQ type.

if not-DT - res.flags should be used.

regards,
-grygorii