How to use Max14830 as I2c with Dragonboard820c


#1

Hi, I am trying to do similar to this post but on the 820c and with i2c:

I can get to probe the device, but I’m not sure what to put in for values in the device tree properties for:
interrupt-parent = <&gpio12>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>;

Where does 7 for an IRQ come from? I’ve got one Gpio 21 connected to the IRQ pin on the MAX14380. Can anyone explain the above two properties to a device tree newbie?

Thanks,
Kim


#2

interrupt-parent is actually the interrupt controller the IRQ is part of, in your case this is the main apq8016 gpio controller (msmgpio).

interrupt-parent = <&msmgpio>;

interrupts is a list of one or more interrupt indexes, int your case you are connected to the pin 21 of the gpio/interrupt controller.

interrupts = <21 IRQ_TYPE_EDGE_FALLING>;

Note: In apq8016 dtsi, gpio 21 is also used as a LED gpio, if you want to use it as IRQ, you need to disable this node (https://elixir.bootlin.com/linux/v4.19-rc7/source/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi#L302)


#3

Hi Loic,
I am using the apq8096-db820c.dtsi for dragonboard 820c and I don’t see gpio21 being used. Maybe your comment about the LED was for the 410? For the dragonboard 820c do I need to add a node for gpio21 so that msmgpio is still the interrupt-parent?

Thanks,
Kim


#4

Yes you’re right, so GPIO_21 is avalable and you can use msmgpio as parent.


#5

Hi Loic,
I got the driver working and can read/write all 4 uarts! Thanks for the help!
kim