Lines Matching +full:sensor +full:- +full:gain

1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/media/i2c/ccs/ccs-quirk.c
8 * Copyright (C) 2011--2012 Nokia Corporation
15 #include "ccs-limits.h"
17 static int ccs_write_addr_8s(struct ccs_sensor *sensor, in ccs_write_addr_8s() argument
20 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in ccs_write_addr_8s()
23 for (; len > 0; len--, regs++) { in ccs_write_addr_8s()
24 rval = ccs_write_addr(sensor, regs->reg, regs->val); in ccs_write_addr_8s()
26 dev_err(&client->dev, in ccs_write_addr_8s()
28 rval, regs->reg, regs->val); in ccs_write_addr_8s()
36 static int jt8ew9_limits(struct ccs_sensor *sensor) in jt8ew9_limits() argument
38 if (sensor->minfo.revision_number < 0x0300) in jt8ew9_limits()
39 sensor->frame_skip = 1; in jt8ew9_limits()
41 /* Below 24 gain doesn't have effect at all, */ in jt8ew9_limits()
43 ccs_replace_limit(sensor, CCS_L_ANALOG_GAIN_CODE_MIN, 0, 59); in jt8ew9_limits()
44 ccs_replace_limit(sensor, CCS_L_ANALOG_GAIN_CODE_MAX, 0, 6000); in jt8ew9_limits()
49 static int jt8ew9_post_poweron(struct ccs_sensor *sensor) in jt8ew9_post_poweron() argument
58 { 0x3258, 0x70 }, /* Analog Gain Control Toshiba Recommendation Setting */ in jt8ew9_post_poweron()
59 { 0x3259, 0x70 }, /* Analog Gain Control Toshiba Recommendation Setting */ in jt8ew9_post_poweron()
60 { 0x325f, 0x7c }, /* Analog Gain Control Toshiba Recommendation Setting */ in jt8ew9_post_poweron()
84 return ccs_write_addr_8s(sensor, regs, ARRAY_SIZE(regs)); in jt8ew9_post_poweron()
92 static int imx125es_post_poweron(struct ccs_sensor *sensor) in imx125es_post_poweron() argument
98 * 0x00 - HS mode, 0x01 - LP11 in imx125es_post_poweron()
105 return ccs_write_addr_8s(sensor, regs, ARRAY_SIZE(regs)); in imx125es_post_poweron()
112 static int jt8ev1_limits(struct ccs_sensor *sensor) in jt8ev1_limits() argument
114 ccs_replace_limit(sensor, CCS_L_X_ADDR_MAX, 0, 4271); in jt8ev1_limits()
115 ccs_replace_limit(sensor, CCS_L_MIN_LINE_BLANKING_PCK_BIN, 0, 184); in jt8ev1_limits()
120 static int jt8ev1_post_poweron(struct ccs_sensor *sensor) in jt8ev1_post_poweron() argument
122 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in jt8ev1_post_poweron()
129 { 0x3301, 0x06 }, /* For analog bias for sensor */ in jt8ev1_post_poweron()
151 rval = ccs_write_addr_8s(sensor, regs, ARRAY_SIZE(regs)); in jt8ev1_post_poweron()
155 switch (sensor->hwcfg.ext_clk) { in jt8ev1_post_poweron()
157 return ccs_write_addr_8s(sensor, regs_96, in jt8ev1_post_poweron()
160 dev_warn(&client->dev, "no MSRs for %d Hz ext_clk\n", in jt8ev1_post_poweron()
161 sensor->hwcfg.ext_clk); in jt8ev1_post_poweron()
166 static int jt8ev1_pre_streamon(struct ccs_sensor *sensor) in jt8ev1_pre_streamon() argument
168 return ccs_write_addr(sensor, 0x3328, 0x00); in jt8ev1_pre_streamon()
171 static int jt8ev1_post_streamoff(struct ccs_sensor *sensor) in jt8ev1_post_streamoff() argument
176 rval = ccs_write_addr(sensor, 0x3205, 0x04); in jt8ev1_post_streamoff()
184 rval = ccs_write_addr(sensor, 0x3205, 0x00); in jt8ev1_post_streamoff()
188 return ccs_write_addr(sensor, 0x3328, 0x80); in jt8ev1_post_streamoff()
191 static int jt8ev1_init(struct ccs_sensor *sensor) in jt8ev1_init() argument
193 sensor->pll.flags |= CCS_PLL_FLAG_LANE_SPEED_MODEL | in jt8ev1_init()
195 sensor->pll.vt_lanes = 1; in jt8ev1_init()
196 sensor->pll.op_lanes = sensor->pll.csi2.lanes; in jt8ev1_init()
209 static int tcm8500md_limits(struct ccs_sensor *sensor) in tcm8500md_limits() argument
211 ccs_replace_limit(sensor, CCS_L_MIN_PLL_IP_CLK_FREQ_MHZ, 0, 2700000); in tcm8500md_limits()