I’m back porting a working custom I2C device from RPi with a 6.something kernel to Jetson. It communicates the availability of data with an interrupt pin. GPIO04 was chosen for that. However I’m get a failure when I’m trying to register the interrupt “Failed to request IRQ 308”
My relevant bit of device tree overlay is the following:
#define OPENEMC_IRQ_PIN TEGRA234_AON_GPIO(CC,1) /* GPIO04 aka PCC.01*/
/dts-v1/;
/plugin/;
/ {
overlay-name = "openemc overlay";
jetson-header-name = "Jetson 40pin Header";
compatible = "nvidia,tegra234";
fragment@0 {
target-path = "/";
__overlay__ {
gpio@c2f0000{//aka AON_GPIO
openemc_interrupt_hog{
status = "okay";
gpio-hog;
input;
gpios = <OPENEMC_IRQ_PIN 0>;
line-name = "openemc-interrupt";
};
};
i2c@c240000{
#address-cells = <1>;
#size-cells = <0>;
openemc@10 {
compatible = "openemc,openemc";
reg = <0x10>;
interrupt-parent = <&tegra_aon_gpio>;
interrupts = <OPENEMC_IRQ_PIN IRQ_TYPE_EDGE_FALLING>;
...
In the kernel module I’m trying to register the IRQ with
ret = devm_request_threaded_irq(emc->dev, emc->irq, NULL,
openemc_irq_handler, IRQF_ONESHOT,
dev_name(emc->dev), emc);
if (ret < 0) {
dev_err(emc->dev, "Failed to request IRQ %d\n", emc->irq);
return ret;
}
emc→irq is i2c→irq as passed by the i2c_client struct in the probe.
Does anybody know what is going wrong?