Hello ,
I’m developing custom camera driver in Jetson TX2.
New custom camera support i2c communication with 16bit address and 16bit data.
I’m modifying based on reference device driver code (ov5693.c).
first of all, i2c data struct changed.
static struct regmap_config s5k2x5sp_regmap_config = {
.reg_bits = 16,
.val_bits = 16,
};
The val data type was changed in the read/write function of the custom camera sensor register.
static inline int s5k2x5sp_read_reg(struct camera_common_data *s_data,
u16 addr, u16 *val)
static inline int s5k2x_write_reg(struct camera_common_data *s_data, u16 addr, u16 val)
but, in the middle of test compile error message occured as shown below.
/kernel/nvidia/drivers/media/i2c/s5k2x.c:789:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.write_reg = s5k2x_write_reg,
^~~~~~~~~~~~~~~~~~
/kernel/nvidia/drivers/media/i2c/s5k2x.c:789:15: note: (near initialization for ‘s5k2x_common_ops.write_reg’)
/kernel/nvidia/drivers/media/i2c/s5k2x.c:790:14: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.read_reg = s5k2x_read_reg,
so i found “camera_common_sensor_ops” struct in /kernel/nvidia/include/media/camrea_common.h
this struct of write_reg and read_reg declation was not match.
In my opinion the camera_common.h file should not be modified.
How do I modify the i2c data type if it is 16bit ?
struct camera_common_sensor_ops {
u32 numfrmfmts;
const struct camera_common_frmfmt *frmfmt_table;
int (*power_on)(struct camera_common_data *s_data);
int (*power_off)(struct camera_common_data *s_data);
int (*write_reg)(struct camera_common_data *s_data,
u16 addr, u8 val);
int (*read_reg)(struct camera_common_data *s_data,
u16 addr, u8 *val);
struct camera_common_pdata *(*parse_dt)(struct tegracam_device *tc_dev);
int (*power_get)(struct tegracam_device *tc_dev);
int (*power_put)(struct tegracam_device *tc_dev);
int (*get_framesync)(struct camera_common_data *s_data,
struct camera_common_framesync *vshs);
int (*set_mode)(struct tegracam_device *tc_dev);
int (*start_streaming)(struct tegracam_device *tc_dev);
int (*stop_streaming)(struct tegracam_device *tc_dev);
};