Part Number: BEAGLEBK
Tool/software: Linux
Greetings. My question is somewhat similar to this. My setup is BBB and cheap chinese board with MPU6050 gyroscope. I2C wires from gyroscope connected to I2C2 of BBB and interrupt line connected to GPIO1_16. I would like to get it working with default driver, that is already within kernel. Docs on binding this driver into device tree says, that for we should provide structure like this:
mpu6050@68 {
compatible = "invensense,mpu6050";
reg = <0x68>;
interrupt-parent = <&gpio1>;
interrupts = <18 IRQ_TYPE_EDGE_RISING>;
mount-matrix = "1", "1", "1","0", "0","0","0","0", "0";
};
However, this binding says nothing about how corresponding GPIO pin is configured and IRQ is enabled. Furthermore, I see that invsense mpu6050 driver doesn't perform any GPIO handling. I assume that initialization of the IRQ should be perform by some other driver. So far I have following questions:
1. I assume, that I should specify <&gpio1> as interrupt-parrent, but how do I find out, which IRQ line number should I use?
2. Should I add any other node to device tree, in order to get GPIO1 16 pin configured as input and corresponding interrupt enabled? If this is possible, are there any example of corresponding binding? What driver or what subsystem is responsible for handling such configurations?
3. If we take look at gpio1 in am33xx.dtsi it is marked as interrupt-controller, and it uses line 98 of intc, which is root interrupt controller. Does all interrupt lines have unique numbers, or they should be unique only within single interrupt controller?
4. If we look through bb.org overlays we can see nodes like this:
target = <&ocp>;
__overlay__ {
P1_34_pinmux {
status = "disabled";
};
};
What is the purpose of such nodes? I can't find the driver, that uses data, contained in those nodes.
To be clear: I am not searching for particular solution, I am rather interested in general approach to solve problems like these.