My guess is that the tegra camera platform driver is reading the tegra-camera-platform
subtree of the device tree in order to probe sensor drivers, and that drivers are probed based on matching .of_match_table
in the driver init struct. Is this correct?
I’m a bit confused about whether or not the sensor driver subtrees should be under i2c@546c0000
directly or under i2c@546c0000/tca9548@77
. Theres an ov5693
node under i2c@546c0000
but also several under i2c@546c0000/tca9548@77
(but the later appear to be for a different board than the “2180” board). So I’m not confident on the appropriate place for those.
In our application we have three sensors that are on i2c adapter numbers 1,2, and 5, and attached to CSIs B,D and F. Below the is main device tree file that I’m compiling to test with our driver.
I’m compling the kernel with CONFIG_VIDEO_I2C_OV5693
disabled, and I’ve added CONFIG_VIDEO_I2C_COYOTE
for our driver. When I boot with this device tree and inspect /proc/device-tree
I do see the presence of the nodes that I’ve added and when I inspect hexdump -C /proc/device-tree/host1x/vi/ports/port\@1/endpoint/remote-endpoint
I see that it is pointing to 0x72, which is what I see when I run hexdump -C /proc/device-tree/host1x/i2c\@546c0000/tca9548\@77/i2c\@0/coyote_b\@35/ports/port\@0/endpoint/phandle
.
However, I still see only one /dev/video0
node and when I grep the kernel log I do not see messages from my drivers probe
function.
#include <tegra210-jetson-tx1-p2597-2180-a01-devkit.dts>
/* camera control gpio definitions */
/ {
host1x {
vi {
ports {
port@0 { // CSI A
status = "disabled";
};
port@1 { // CSI B
status = "okay";
vi_in1: endpoint {
bus-width = <2>;
remote-endpoint = <&coyote_out1>;
};
};
port@2 { // CSI C
status = "disabled";
};
port@3 { // CSI D
status = "okay";
vi_in3: endpoint {
bus-width = <2>;
remote-endpoint = <&coyote_out0>;
};
};
port@4 { // CSI E
status = "disabled";
};
port@5 { // CSI F
status = "okay";
vi_in5: endpoint {
bus-width = <2>;
remote-endpoint = <&coyote_out2>;
};
};
};
};
i2c@546c0000 {
// disable ov5693 (kernel configuration should exclude the driver, so probably shouldn't
// be necessary)
ov5693_c@36 {
status = "disabled";
};
tca9548@77 {
i2c@0 { // I2C_GP0, "adapter" 1
coyote_b@35 { // mux 1
compatible = "acme,coyote";
reg = <0x35>;
avdd-reg = "vana";
iovdd-reg = "vif";
devnode = "video1";
mclk = "cam_mclk1";
// CAM1_RST_L, pin 92 on expansion header, gpio 149
reset-gpios = <&gpio TEGRA_GPIO(S, 5) 0>;
powerdown-gpios = <&gpio TEGRA_GPIO(B, 1) 0>;
xshutdown-gpios = <&gpio TEGRA_GPIO(B, 2) 0>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0>;
coyote_out1: endpoint {
csi-port = <1>;
bus-width = <2>;
remote-endpoint = <&vi_in1>;
};
};
};
};
};
i2c@1 { // I2C_PM, "adapter" 2
coyote_d@35 { // mux 0
compatible = "acme,coyote";
reg = <0x35>;
avdd-reg = "vana";
iovdd-reg = "vif";
devnode = "video0";
mclk = "cam_mclk1";
// CAM0_RST_L, pin 95 on expansion header, gpio 148
reset-gpios = <&gpio TEGRA_GPIO(S, 4) 0>;
powerdown-gpios = <&gpio TEGRA_GPIO(S, 7) 0>;
xshutdown-gpios = <&gpio TEGRA_GPIO(S, 6) 0>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0>;
coyote_out0: endpoint {
csi-port = <3>;
bus-width = <2>;
remote-endpoint = <&vi_in3>;
};
};
};
};
};
i2c@5 { // I2C_CAM, "adapter" 6
coyote_f@35 { // mux 2
compatible = "acme,coyote";
reg = <0x35>;
avdd-reg = "vana";
iovdd-reg = "vif";
devnode = "video2";
mclk = "cam_mclk1";
// CAM1_PWR
reset-gpios = <&gpio TEGRA_GPIO(T, 0) 0>;
powerdown-gpios = <&gpio TEGRA_GPIO(B, 0) 0>;
xshutdown-gpios = <&gpio TEGRA_GPIO(B, 3) 0>;
vana-supply = <&en_vdd_cam_hv_2v8>;
vif-supply = <&en_vdd_cam>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0>;
coyote_out2: endpoint {
csi-port = <5>;
bus-width = <2>;
remote-endpoint = <&vi_in5>;
};
};
};
};
};
};
};
};
tegra-camera-platform {
modules {
module0 {
status = "okay";
badge = "coyote_mux0";
position = "n/a";
orientation = "1";
drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tca9548@77/i2c@1/coyote_d@35";
};
};
module1 {
status = "okay";
badge = "coyote_mux1";
position = "n/a";
orientation = "1";
drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tca9548@77/i2c@2/coyote_b@35";
};
};
module2 {
status = "okay";
badge = "coyote_mux2";
position = "n/a";
orientation = "1";
drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tca9548@77/i2c@5/coyote_f@35";
};
};
};
};
};