diff --git a/drivers/media/i2c/gc8034.c b/drivers/media/i2c/gc8034.c index 2c1dd377595a..caa71e5e119f 100644 --- a/drivers/media/i2c/gc8034.c +++ b/drivers/media/i2c/gc8034.c @@ -1468,6 +1468,7 @@ static void gc8034_get_otp(struct otp_info *otp, inf->pdaf.flag = 1; inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width; inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height; + inf->pdaf.pd_offset = otp->pdaf_data.pd_offset; inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode; inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir; inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width; diff --git a/drivers/media/i2c/imx586.c b/drivers/media/i2c/imx586.c index c0808d0c5962..7948fe0834a5 100644 --- a/drivers/media/i2c/imx586.c +++ b/drivers/media/i2c/imx586.c @@ -1206,6 +1206,7 @@ static void imx586_get_otp(struct otp_info *otp, inf->pdaf.flag = 1; inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width; inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height; + inf->pdaf.pd_offset = otp->pdaf_data.pd_offset; inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode; inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir; inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width; diff --git a/drivers/media/i2c/otp_eeprom.c b/drivers/media/i2c/otp_eeprom.c index 2fb123ca72ac..315220ec867c 100644 --- a/drivers/media/i2c/otp_eeprom.c +++ b/drivers/media/i2c/otp_eeprom.c @@ -649,6 +649,11 @@ static void rkotp_read_pdaf(struct eeprom_device *eeprom_dev, checksum += otp_ptr->pdaf_data.dccmap_checksum; base_addr += 1; + ret |= read_reg_otp(client, base_addr, + 2, &otp_ptr->pdaf_data.pd_offset); + checksum += otp_ptr->pdaf_data.pd_offset; + base_addr += 2; + memset(pdaf_buf, 0, RK_PDAF_RESERVED_SIZE); ret |= read_reg_otp_buf(client, base_addr, RK_PDAF_RESERVED_SIZE, pdaf_buf); @@ -931,7 +936,7 @@ static int otp_eeprom_show(struct seq_file *p, void *v) seq_printf(p, "flag=%d;\n", dev->otp->pdaf_data.flag); seq_printf(p, "gainmap_width=%d;\n", gainmap_w); seq_printf(p, "gainmap_height=%d;\n", gainmap_h); - + seq_printf(p, "pd_offset=%d\n", dev->otp->pdaf_data.pd_offset); seq_printf(p, "gainmap_table=\n"); for (i = 0; i < gainmap_h; i++) { for (j = 0; j < gainmap_w; j++) { diff --git a/drivers/media/i2c/otp_eeprom.h b/drivers/media/i2c/otp_eeprom.h index 503d27741936..f284e6d59bb5 100644 --- a/drivers/media/i2c/otp_eeprom.h +++ b/drivers/media/i2c/otp_eeprom.h @@ -56,7 +56,7 @@ #define RK_LSC_RESERVED_SIZE 0x0020 #define RK_GAINMAP_SIZE 0x0800 #define RK_DCCMAP_SIZE 0x0200 -#define RK_PDAF_RESERVED_SIZE 0x0020 +#define RK_PDAF_RESERVED_SIZE 0x001e #define RK_AF_RESERVED_SIZE 0x0014 #define RKOTP_MAX_MODULE 0x0008 @@ -151,6 +151,7 @@ struct pdaf_otp_info { u32 dccmap_height; u32 dccmap[RK_DCCMAP_SIZE]; u32 dccmap_checksum; + u32 pd_offset; u32 checksum; u32 size; }; diff --git a/drivers/media/i2c/ov50c40.c b/drivers/media/i2c/ov50c40.c index 55f5b8284836..040dc7ff3fc6 100644 --- a/drivers/media/i2c/ov50c40.c +++ b/drivers/media/i2c/ov50c40.c @@ -6203,6 +6203,7 @@ static void ov50c40_get_otp(struct otp_info *otp, inf->pdaf.flag = 1; inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width; inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height; + inf->pdaf.pd_offset = otp->pdaf_data.pd_offset; inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode; inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir; inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width; diff --git a/drivers/media/i2c/s5kjn1.c b/drivers/media/i2c/s5kjn1.c index 29621d3f43ca..c291c1a3f838 100644 --- a/drivers/media/i2c/s5kjn1.c +++ b/drivers/media/i2c/s5kjn1.c @@ -1265,6 +1265,7 @@ static void s5kjn1_get_otp(struct otp_info *otp, inf->pdaf.flag = 1; inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width; inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height; + inf->pdaf.pd_offset = otp->pdaf_data.pd_offset; inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode; inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir; inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width; diff --git a/include/uapi/linux/rk-camera-module.h b/include/uapi/linux/rk-camera-module.h index b1204b09cdca..7a825afaa279 100644 --- a/include/uapi/linux/rk-camera-module.h +++ b/include/uapi/linux/rk-camera-module.h @@ -326,6 +326,7 @@ struct rkmodule_pdaf_inf { __u32 dccmap_height; __u32 dcc_mode; __u32 dcc_dir; + __u32 pd_offset; __u16 gainmap[RKMODULE_PADF_GAINMAP_LEN]; __u16 dccmap[RKMODULE_PDAF_DCCMAP_LEN]; } __attribute__ ((packed));