Hello,
I’m trouble shooting driver for a camera, which is communicating with a camera via i2c.
During configuration I’m writing in to some registers and I’m reading from some registers (e.g. chip id).
I sniffed HW bus and I didn’t seen any read messages (only write).
I also used i2c tracing on linux to verify my measurements, and in deed linux wasn’t sending any i2c_read messages.
In dmesg I don’t see any error or warning.
For writng I uses regmap_write(s_data->regmap, addr, val);
and for reading regmap_read(s_data->regmap, addr, ®_val);
(That is farthest I was able to get with name references).
What is strange is that both commands reruns 0 as successful transfer, and read value is CORRECT. But there wasn’t any read request from linux. (I printed value and return in to dmesg).
I wanted to check what is called when I call regmap_read
, but I was unable to found it, I only got reference to regmap.h. By i2c reference in device tree i2c@546c0000. I would say it uses compatible = “nvidia,tegra210-i2c-vi”, which is in file tegra_vi_i2c.c
.
So I add dev_info prints into tegra_i2c_read_data and tegra_i2c_write_data, and add file in to dynamic_debug/control. But I don’t see added prints in the dmesg. So I’m not sure if it is correct file (but then I don’t understand the device tree ).
Different devices, with different driver, on the the bus i2c-62 are able to send read messages. But my driver for camera is unable to send read on the bus i2c-60, which is same physical bus.
My questions are following:
Where I can found function which is called when I call regmap_read()?
Do you have any idea how it can be i2c_read possible without reading?
And how it can figure it out correct value? I don’t believe that there is some complex caching mechanism.
I’m using Jetson Nano with Kernel 4.9.