Lines Matching refs:otp_ptr
2432 struct ov8858_otp_info_r1a *otp_ptr = ov8858->otp_r1a; in ov8858_apply_otp_r1a() local
2448 if ((otp_ptr->flag & 0x40) && golden_bg_ratio && golden_rg_ratio) { in ov8858_apply_otp_r1a()
2449 if (otp_ptr->light_rg == 0) in ov8858_apply_otp_r1a()
2454 rg = otp_ptr->rg_ratio; in ov8858_apply_otp_r1a()
2456 rg = otp_ptr->rg_ratio * in ov8858_apply_otp_r1a()
2457 (otp_ptr->light_rg + 512) / 1024; in ov8858_apply_otp_r1a()
2459 if (otp_ptr->light_bg == 0) in ov8858_apply_otp_r1a()
2464 bg = otp_ptr->bg_ratio; in ov8858_apply_otp_r1a()
2466 bg = otp_ptr->bg_ratio * in ov8858_apply_otp_r1a()
2467 (otp_ptr->light_bg + 512) / 1024; in ov8858_apply_otp_r1a()
2504 if ((otp_ptr->flag & 0x10) && lsc_cfg->enable) { in ov8858_apply_otp_r1a()
2508 for (i = 0; i < ARRAY_SIZE(otp_ptr->lenc); i++) { in ov8858_apply_otp_r1a()
2510 otp_ptr->lenc[i]); in ov8858_apply_otp_r1a()
2512 i, otp_ptr->lenc[i]); in ov8858_apply_otp_r1a()
2523 struct ov8858_otp_info_r2a *otp_ptr = ov8858->otp_r2a; in ov8858_apply_otp_r2a() local
2539 if ((otp_ptr->flag & 0xC0) && golden_bg_ratio && golden_rg_ratio) { in ov8858_apply_otp_r2a()
2540 rg = otp_ptr->rg_ratio; in ov8858_apply_otp_r2a()
2541 bg = otp_ptr->bg_ratio; in ov8858_apply_otp_r2a()
2577 if ((otp_ptr->flag & 0x10) && lsc_cfg->enable) { in ov8858_apply_otp_r2a()
2581 for (i = 0; i < ARRAY_SIZE(otp_ptr->lenc); i++) { in ov8858_apply_otp_r2a()
2583 otp_ptr->lenc[i]); in ov8858_apply_otp_r2a()
2585 i, otp_ptr->lenc[i]); in ov8858_apply_otp_r2a()
3067 struct ov8858_otp_info_r1a *otp_ptr; in ov8858_otp_read_r1a() local
3071 otp_ptr = kzalloc(sizeof(*otp_ptr), GFP_KERNEL); in ov8858_otp_read_r1a()
3072 if (!otp_ptr) in ov8858_otp_read_r1a()
3087 otp_ptr->flag = 0x80; /* valid info in OTP */ in ov8858_otp_read_r1a()
3088 ov8858_read_1byte(client, addr, &otp_ptr->module_id); in ov8858_otp_read_r1a()
3089 ov8858_read_1byte(client, addr + 1, &otp_ptr->lens_id); in ov8858_otp_read_r1a()
3090 ov8858_read_1byte(client, addr + 2, &otp_ptr->year); in ov8858_otp_read_r1a()
3091 ov8858_read_1byte(client, addr + 3, &otp_ptr->month); in ov8858_otp_read_r1a()
3092 ov8858_read_1byte(client, addr + 4, &otp_ptr->day); in ov8858_otp_read_r1a()
3094 otp_ptr->module_id, in ov8858_otp_read_r1a()
3095 otp_ptr->lens_id, in ov8858_otp_read_r1a()
3096 otp_ptr->year, in ov8858_otp_read_r1a()
3097 otp_ptr->month, in ov8858_otp_read_r1a()
3098 otp_ptr->day); in ov8858_otp_read_r1a()
3113 otp_ptr->flag |= 0x40; /* valid info and AWB in OTP */ in ov8858_otp_read_r1a()
3115 ov8858_read_1byte(client, addr, &otp_ptr->rg_ratio); in ov8858_otp_read_r1a()
3116 otp_ptr->rg_ratio = (otp_ptr->rg_ratio << 2) + in ov8858_otp_read_r1a()
3118 ov8858_read_1byte(client, addr + 1, &otp_ptr->bg_ratio); in ov8858_otp_read_r1a()
3119 otp_ptr->bg_ratio = (otp_ptr->bg_ratio << 2) + in ov8858_otp_read_r1a()
3121 ov8858_read_1byte(client, addr + 2, &otp_ptr->light_rg); in ov8858_otp_read_r1a()
3122 otp_ptr->light_rg = (otp_ptr->light_rg << 2) + in ov8858_otp_read_r1a()
3124 ov8858_read_1byte(client, addr + 3, &otp_ptr->light_bg); in ov8858_otp_read_r1a()
3125 otp_ptr->light_bg = (otp_ptr->light_bg << 2) + in ov8858_otp_read_r1a()
3128 otp_ptr->rg_ratio, otp_ptr->bg_ratio, in ov8858_otp_read_r1a()
3129 otp_ptr->light_rg, otp_ptr->light_bg); in ov8858_otp_read_r1a()
3143 otp_ptr->flag |= 0x20; in ov8858_otp_read_r1a()
3145 ov8858_read_1byte(client, addr, &otp_ptr->vcm_start); in ov8858_otp_read_r1a()
3146 otp_ptr->vcm_start = (otp_ptr->vcm_start << 2) | in ov8858_otp_read_r1a()
3148 ov8858_read_1byte(client, addr + 1, &otp_ptr->vcm_end); in ov8858_otp_read_r1a()
3149 otp_ptr->vcm_end = (otp_ptr->vcm_end << 2) | in ov8858_otp_read_r1a()
3151 otp_ptr->vcm_dir = (temp >> 2) & 0x03; in ov8858_otp_read_r1a()
3153 otp_ptr->vcm_start, in ov8858_otp_read_r1a()
3154 otp_ptr->vcm_end, in ov8858_otp_read_r1a()
3155 otp_ptr->vcm_dir); in ov8858_otp_read_r1a()
3169 otp_ptr->flag |= 0x10; in ov8858_otp_read_r1a()
3171 ov8858_read_1byte(client, addr + i, &otp_ptr->lenc[i]); in ov8858_otp_read_r1a()
3172 dev_dbg(dev, "lsc 0x%x!\n", otp_ptr->lenc[i]); in ov8858_otp_read_r1a()
3179 if (otp_ptr->flag) { in ov8858_otp_read_r1a()
3180 ov8858->otp_r1a = otp_ptr; in ov8858_otp_read_r1a()
3184 kfree(otp_ptr); in ov8858_otp_read_r1a()
3192 struct ov8858_otp_info_r2a *otp_ptr; in ov8858_otp_read_r2a() local
3197 otp_ptr = kzalloc(sizeof(*otp_ptr), GFP_KERNEL); in ov8858_otp_read_r2a()
3198 if (!otp_ptr) in ov8858_otp_read_r2a()
3212 otp_ptr->flag = 0xC0; /* valid info and AWB in OTP */ in ov8858_otp_read_r2a()
3213 ov8858_read_1byte(client, addr, &otp_ptr->module_id); in ov8858_otp_read_r2a()
3214 ov8858_read_1byte(client, addr + 1, &otp_ptr->lens_id); in ov8858_otp_read_r2a()
3215 ov8858_read_1byte(client, addr + 2, &otp_ptr->year); in ov8858_otp_read_r2a()
3216 ov8858_read_1byte(client, addr + 3, &otp_ptr->month); in ov8858_otp_read_r2a()
3217 ov8858_read_1byte(client, addr + 4, &otp_ptr->day); in ov8858_otp_read_r2a()
3219 ov8858_read_1byte(client, addr + 5, &otp_ptr->rg_ratio); in ov8858_otp_read_r2a()
3220 otp_ptr->rg_ratio = (otp_ptr->rg_ratio << 2) + in ov8858_otp_read_r2a()
3222 ov8858_read_1byte(client, addr + 6, &otp_ptr->bg_ratio); in ov8858_otp_read_r2a()
3223 otp_ptr->bg_ratio = (otp_ptr->bg_ratio << 2) + in ov8858_otp_read_r2a()
3227 otp_ptr->module_id, in ov8858_otp_read_r2a()
3228 otp_ptr->lens_id, in ov8858_otp_read_r2a()
3229 otp_ptr->year, in ov8858_otp_read_r2a()
3230 otp_ptr->month, in ov8858_otp_read_r2a()
3231 otp_ptr->day); in ov8858_otp_read_r2a()
3233 otp_ptr->rg_ratio, in ov8858_otp_read_r2a()
3234 otp_ptr->bg_ratio); in ov8858_otp_read_r2a()
3247 otp_ptr->flag |= 0x20; in ov8858_otp_read_r2a()
3249 ov8858_read_1byte(client, addr, &otp_ptr->vcm_start); in ov8858_otp_read_r2a()
3250 otp_ptr->vcm_start = (otp_ptr->vcm_start << 2) | in ov8858_otp_read_r2a()
3252 ov8858_read_1byte(client, addr + 1, &otp_ptr->vcm_end); in ov8858_otp_read_r2a()
3253 otp_ptr->vcm_end = (otp_ptr->vcm_end << 2) | in ov8858_otp_read_r2a()
3255 otp_ptr->vcm_dir = (temp >> 2) & 0x03; in ov8858_otp_read_r2a()
3270 ov8858_read_1byte(client, addr + i, &otp_ptr->lenc[i]); in ov8858_otp_read_r2a()
3271 checksum += otp_ptr->lenc[i]; in ov8858_otp_read_r2a()
3272 dev_dbg(dev, "lsc_info: 0x%x!\n", otp_ptr->lenc[i]); in ov8858_otp_read_r2a()
3275 ov8858_read_1byte(client, addr + 240, &otp_ptr->checksum); in ov8858_otp_read_r2a()
3276 if (otp_ptr->checksum == checksum) in ov8858_otp_read_r2a()
3277 otp_ptr->flag |= 0x10; in ov8858_otp_read_r2a()
3283 if (otp_ptr->flag) { in ov8858_otp_read_r2a()
3284 ov8858->otp_r2a = otp_ptr; in ov8858_otp_read_r2a()
3288 kfree(otp_ptr); in ov8858_otp_read_r2a()