ov965x            417 drivers/media/i2c/ov9650.c 	return &container_of(ctrl->handler, struct ov965x, ctrls.handler)->sd;
ov965x            420 drivers/media/i2c/ov9650.c static inline struct ov965x *to_ov965x(struct v4l2_subdev *sd)
ov965x            422 drivers/media/i2c/ov9650.c 	return container_of(sd, struct ov965x, sd);
ov965x            425 drivers/media/i2c/ov9650.c static int ov965x_read(struct ov965x *ov965x, u8 addr, u8 *val)
ov965x            430 drivers/media/i2c/ov9650.c 	ret = regmap_read(ov965x->regmap, addr, &buf);
ov965x            436 drivers/media/i2c/ov9650.c 	v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02x. (%d)\n",
ov965x            442 drivers/media/i2c/ov9650.c static int ov965x_write(struct ov965x *ov965x, u8 addr, u8 val)
ov965x            446 drivers/media/i2c/ov9650.c 	ret = regmap_write(ov965x->regmap, addr, val);
ov965x            448 drivers/media/i2c/ov9650.c 	v4l2_dbg(2, debug, &ov965x->sd, "%s: 0x%02x @ 0x%02X (%d)\n",
ov965x            454 drivers/media/i2c/ov9650.c static int ov965x_write_array(struct ov965x *ov965x,
ov965x            460 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, regs[i].addr, regs[i].value);
ov965x            465 drivers/media/i2c/ov9650.c static int ov965x_set_default_gamma_curve(struct ov965x *ov965x)
ov965x            478 drivers/media/i2c/ov9650.c 		int ret = ov965x_write(ov965x, addr, gamma_curve[i]);
ov965x            488 drivers/media/i2c/ov9650.c static int ov965x_set_color_matrix(struct ov965x *ov965x)
ov965x            498 drivers/media/i2c/ov9650.c 		int ret = ov965x_write(ov965x, addr, mtx[i]);
ov965x            508 drivers/media/i2c/ov9650.c static int __ov965x_set_power(struct ov965x *ov965x, int on)
ov965x            511 drivers/media/i2c/ov9650.c 		int ret = clk_prepare_enable(ov965x->clk);
ov965x            516 drivers/media/i2c/ov9650.c 		gpiod_set_value_cansleep(ov965x->gpios[GPIO_PWDN], 0);
ov965x            517 drivers/media/i2c/ov9650.c 		gpiod_set_value_cansleep(ov965x->gpios[GPIO_RST], 0);
ov965x            520 drivers/media/i2c/ov9650.c 		gpiod_set_value_cansleep(ov965x->gpios[GPIO_RST], 1);
ov965x            521 drivers/media/i2c/ov9650.c 		gpiod_set_value_cansleep(ov965x->gpios[GPIO_PWDN], 1);
ov965x            523 drivers/media/i2c/ov9650.c 		clk_disable_unprepare(ov965x->clk);
ov965x            526 drivers/media/i2c/ov9650.c 	ov965x->streaming = 0;
ov965x            533 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x            538 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x            539 drivers/media/i2c/ov9650.c 	if (ov965x->power == !on) {
ov965x            540 drivers/media/i2c/ov9650.c 		ret = __ov965x_set_power(ov965x, on);
ov965x            542 drivers/media/i2c/ov9650.c 			ret = ov965x_write_array(ov965x,
ov965x            544 drivers/media/i2c/ov9650.c 			ov965x->apply_frame_fmt = 1;
ov965x            545 drivers/media/i2c/ov9650.c 			ov965x->ctrls.update = 1;
ov965x            549 drivers/media/i2c/ov9650.c 		ov965x->power += on ? 1 : -1;
ov965x            551 drivers/media/i2c/ov9650.c 	WARN_ON(ov965x->power < 0);
ov965x            552 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x            560 drivers/media/i2c/ov9650.c static void ov965x_update_exposure_ctrl(struct ov965x *ov965x)
ov965x            562 drivers/media/i2c/ov9650.c 	struct v4l2_ctrl *ctrl = ov965x->ctrls.exposure;
ov965x            567 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x            568 drivers/media/i2c/ov9650.c 	if (WARN_ON(!ctrl || !ov965x->frame_size)) {
ov965x            569 drivers/media/i2c/ov9650.c 		mutex_unlock(&ov965x->lock);
ov965x            572 drivers/media/i2c/ov9650.c 	clkrc = DEF_CLKRC + ov965x->fiv->clkrc_div;
ov965x            574 drivers/media/i2c/ov9650.c 	fint = ov965x->mclk_frequency * ((clkrc >> 7) + 1) /
ov965x            578 drivers/media/i2c/ov9650.c 	max = ov965x->frame_size->max_exp_lines * trow;
ov965x            579 drivers/media/i2c/ov9650.c 	ov965x->exp_row_interval = trow;
ov965x            580 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x            582 drivers/media/i2c/ov9650.c 	v4l2_dbg(1, debug, &ov965x->sd, "clkrc: %#x, fi: %lu, tr: %lu, %d\n",
ov965x            591 drivers/media/i2c/ov9650.c 		v4l2_err(&ov965x->sd, "Exposure ctrl range update failed\n");
ov965x            594 drivers/media/i2c/ov9650.c static int ov965x_set_banding_filter(struct ov965x *ov965x, int value)
ov965x            600 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_COM8, &reg);
ov965x            606 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_COM8, reg);
ov965x            610 drivers/media/i2c/ov9650.c 	if (WARN_ON(!ov965x->fiv))
ov965x            617 drivers/media/i2c/ov9650.c 	mbd = (1000UL * ov965x->fiv->interval.denominator *
ov965x            618 drivers/media/i2c/ov9650.c 	       ov965x->frame_size->max_exp_lines) /
ov965x            619 drivers/media/i2c/ov9650.c 	       ov965x->fiv->interval.numerator;
ov965x            622 drivers/media/i2c/ov9650.c 	return ov965x_write(ov965x, REG_MBD, mbd);
ov965x            625 drivers/media/i2c/ov9650.c static int ov965x_set_white_balance(struct ov965x *ov965x, int awb)
ov965x            630 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_COM8, &reg);
ov965x            633 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_COM8, reg);
ov965x            636 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_BLUE,
ov965x            637 drivers/media/i2c/ov9650.c 				   ov965x->ctrls.blue_balance->val);
ov965x            640 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_RED,
ov965x            641 drivers/media/i2c/ov9650.c 				   ov965x->ctrls.red_balance->val);
ov965x            649 drivers/media/i2c/ov9650.c static int ov965x_set_brightness(struct ov965x *ov965x, int val)
ov965x            668 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, regs[0][i],
ov965x            673 drivers/media/i2c/ov9650.c static int ov965x_set_gain(struct ov965x *ov965x, int auto_gain)
ov965x            675 drivers/media/i2c/ov9650.c 	struct ov965x_ctrls *ctrls = &ov965x->ctrls;
ov965x            683 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_COM8, &reg);
ov965x            690 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_COM8, reg);
ov965x            714 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_GAIN, rgain & 0xff);
ov965x            717 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_VREF, &reg);
ov965x            722 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_VREF, reg);
ov965x            732 drivers/media/i2c/ov9650.c static int ov965x_set_sharpness(struct ov965x *ov965x, unsigned int value)
ov965x            737 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_COM14, &com14);
ov965x            740 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_EDGE, &edge);
ov965x            751 drivers/media/i2c/ov9650.c 	ret = ov965x_write(ov965x, REG_COM14, com14);
ov965x            758 drivers/media/i2c/ov9650.c 	return ov965x_write(ov965x, REG_EDGE, edge);
ov965x            761 drivers/media/i2c/ov9650.c static int ov965x_set_exposure(struct ov965x *ov965x, int exp)
ov965x            763 drivers/media/i2c/ov9650.c 	struct ov965x_ctrls *ctrls = &ov965x->ctrls;
ov965x            769 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_COM8, &reg);
ov965x            776 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_COM8, reg);
ov965x            783 drivers/media/i2c/ov9650.c 					 / ov965x->exp_row_interval;
ov965x            788 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_COM1, exposure & 0x3);
ov965x            790 drivers/media/i2c/ov9650.c 			ret = ov965x_write(ov965x, REG_AECH,
ov965x            793 drivers/media/i2c/ov9650.c 			ret = ov965x_write(ov965x, REG_AECHM,
ov965x            796 drivers/media/i2c/ov9650.c 		ctrls->exposure->val = ((exposure * ov965x->exp_row_interval)
ov965x            802 drivers/media/i2c/ov9650.c 	v4l2_ctrl_activate(ov965x->ctrls.brightness, !exp);
ov965x            806 drivers/media/i2c/ov9650.c static int ov965x_set_flip(struct ov965x *ov965x)
ov965x            810 drivers/media/i2c/ov9650.c 	if (ov965x->ctrls.hflip->val)
ov965x            813 drivers/media/i2c/ov9650.c 	if (ov965x->ctrls.vflip->val)
ov965x            816 drivers/media/i2c/ov9650.c 	return ov965x_write(ov965x, REG_MVFP, mvfp);
ov965x            822 drivers/media/i2c/ov9650.c static int ov965x_set_saturation(struct ov965x *ov965x, int val)
ov965x            840 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, addr + i, regs[val][i]);
ov965x            845 drivers/media/i2c/ov9650.c static int ov965x_set_test_pattern(struct ov965x *ov965x, int value)
ov965x            850 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_COM23, &reg);
ov965x            854 drivers/media/i2c/ov9650.c 	return ov965x_write(ov965x, REG_COM23, reg);
ov965x            857 drivers/media/i2c/ov9650.c static int __g_volatile_ctrl(struct ov965x *ov965x, struct v4l2_ctrl *ctrl)
ov965x            863 drivers/media/i2c/ov9650.c 	if (!ov965x->power)
ov965x            870 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_GAIN, &reg0);
ov965x            873 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_VREF, &reg1);
ov965x            878 drivers/media/i2c/ov9650.c 		ov965x->ctrls.gain->val = m * (16 + (gain & 0xf));
ov965x            884 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_COM1, &reg0);
ov965x            887 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_AECH, &reg1);
ov965x            890 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_AECHM, &reg2);
ov965x            895 drivers/media/i2c/ov9650.c 		ov965x->ctrls.exposure->val = ((exposure *
ov965x            896 drivers/media/i2c/ov9650.c 				ov965x->exp_row_interval) + 50) / 100;
ov965x            906 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x            911 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x            912 drivers/media/i2c/ov9650.c 	ret = __g_volatile_ctrl(ov965x, ctrl);
ov965x            913 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x            920 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x            924 drivers/media/i2c/ov9650.c 		 ctrl->name, ctrl->val, ov965x->power);
ov965x            926 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x            931 drivers/media/i2c/ov9650.c 	if (ov965x->power == 0) {
ov965x            932 drivers/media/i2c/ov9650.c 		mutex_unlock(&ov965x->lock);
ov965x            938 drivers/media/i2c/ov9650.c 		ret = ov965x_set_white_balance(ov965x, ctrl->val);
ov965x            942 drivers/media/i2c/ov9650.c 		ret = ov965x_set_brightness(ov965x, ctrl->val);
ov965x            946 drivers/media/i2c/ov9650.c 		ret = ov965x_set_exposure(ov965x, ctrl->val);
ov965x            950 drivers/media/i2c/ov9650.c 		ret = ov965x_set_gain(ov965x, ctrl->val);
ov965x            954 drivers/media/i2c/ov9650.c 		ret = ov965x_set_flip(ov965x);
ov965x            958 drivers/media/i2c/ov9650.c 		ret = ov965x_set_banding_filter(ov965x, ctrl->val);
ov965x            962 drivers/media/i2c/ov9650.c 		ret = ov965x_set_saturation(ov965x, ctrl->val);
ov965x            966 drivers/media/i2c/ov9650.c 		ret = ov965x_set_sharpness(ov965x, ctrl->val);
ov965x            970 drivers/media/i2c/ov9650.c 		ret = ov965x_set_test_pattern(ov965x, ctrl->val);
ov965x            974 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x            988 drivers/media/i2c/ov9650.c static int ov965x_initialize_controls(struct ov965x *ov965x)
ov965x            991 drivers/media/i2c/ov9650.c 	struct ov965x_ctrls *ctrls = &ov965x->ctrls;
ov965x           1056 drivers/media/i2c/ov9650.c 	ov965x->sd.ctrl_handler = hdl;
ov965x           1109 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1111 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1112 drivers/media/i2c/ov9650.c 	fi->interval = ov965x->fiv->interval;
ov965x           1113 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1118 drivers/media/i2c/ov9650.c static int __ov965x_set_frame_interval(struct ov965x *ov965x,
ov965x           1121 drivers/media/i2c/ov9650.c 	struct v4l2_mbus_framefmt *mbus_fmt = &ov965x->format;
ov965x           1145 drivers/media/i2c/ov9650.c 	ov965x->fiv = fiv;
ov965x           1147 drivers/media/i2c/ov9650.c 	v4l2_dbg(1, debug, &ov965x->sd, "Changed frame interval to %u us\n",
ov965x           1156 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1162 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1163 drivers/media/i2c/ov9650.c 	ret = __ov965x_set_frame_interval(ov965x, fi);
ov965x           1164 drivers/media/i2c/ov9650.c 	ov965x->apply_frame_fmt = 1;
ov965x           1165 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1173 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1182 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1183 drivers/media/i2c/ov9650.c 	fmt->format = ov965x->format;
ov965x           1184 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1220 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1234 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1242 drivers/media/i2c/ov9650.c 		if (ov965x->streaming) {
ov965x           1245 drivers/media/i2c/ov9650.c 			ov965x->frame_size = size;
ov965x           1246 drivers/media/i2c/ov9650.c 			ov965x->format = fmt->format;
ov965x           1247 drivers/media/i2c/ov9650.c 			ov965x->tslb_reg = ov965x_formats[index].tslb_reg;
ov965x           1248 drivers/media/i2c/ov9650.c 			ov965x->apply_frame_fmt = 1;
ov965x           1257 drivers/media/i2c/ov9650.c 		__ov965x_set_frame_interval(ov965x, &fiv);
ov965x           1259 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1262 drivers/media/i2c/ov9650.c 		ov965x_update_exposure_ctrl(ov965x);
ov965x           1267 drivers/media/i2c/ov9650.c static int ov965x_set_frame_size(struct ov965x *ov965x)
ov965x           1272 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, frame_size_reg_addr[i],
ov965x           1273 drivers/media/i2c/ov9650.c 				   ov965x->frame_size->regs[i]);
ov965x           1277 drivers/media/i2c/ov9650.c static int __ov965x_set_params(struct ov965x *ov965x)
ov965x           1279 drivers/media/i2c/ov9650.c 	struct ov965x_ctrls *ctrls = &ov965x->ctrls;
ov965x           1283 drivers/media/i2c/ov9650.c 	if (ov965x->apply_frame_fmt) {
ov965x           1284 drivers/media/i2c/ov9650.c 		reg = DEF_CLKRC + ov965x->fiv->clkrc_div;
ov965x           1285 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_CLKRC, reg);
ov965x           1288 drivers/media/i2c/ov9650.c 		ret = ov965x_set_frame_size(ov965x);
ov965x           1291 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_TSLB, &reg);
ov965x           1295 drivers/media/i2c/ov9650.c 		reg |= ov965x->tslb_reg;
ov965x           1296 drivers/media/i2c/ov9650.c 		ret = ov965x_write(ov965x, REG_TSLB, reg);
ov965x           1300 drivers/media/i2c/ov9650.c 	ret = ov965x_set_default_gamma_curve(ov965x);
ov965x           1303 drivers/media/i2c/ov9650.c 	ret = ov965x_set_color_matrix(ov965x);
ov965x           1310 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_COM11, &reg);
ov965x           1313 drivers/media/i2c/ov9650.c 	ret = ov965x_write(ov965x, REG_COM11, reg);
ov965x           1320 drivers/media/i2c/ov9650.c 	return ov965x_set_banding_filter(ov965x, ctrls->light_freq->val);
ov965x           1325 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1326 drivers/media/i2c/ov9650.c 	struct ov965x_ctrls *ctrls = &ov965x->ctrls;
ov965x           1331 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1332 drivers/media/i2c/ov9650.c 	if (ov965x->streaming == !on) {
ov965x           1334 drivers/media/i2c/ov9650.c 			ret = __ov965x_set_params(ov965x);
ov965x           1341 drivers/media/i2c/ov9650.c 			mutex_unlock(&ov965x->lock);
ov965x           1344 drivers/media/i2c/ov9650.c 			mutex_lock(&ov965x->lock);
ov965x           1349 drivers/media/i2c/ov9650.c 			ret = ov965x_write(ov965x, REG_COM2,
ov965x           1353 drivers/media/i2c/ov9650.c 		ov965x->streaming += on ? 1 : -1;
ov965x           1355 drivers/media/i2c/ov9650.c 	WARN_ON(ov965x->streaming < 0);
ov965x           1356 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1407 drivers/media/i2c/ov9650.c static int ov965x_configure_gpios_pdata(struct ov965x *ov965x,
ov965x           1412 drivers/media/i2c/ov9650.c 	struct device *dev = regmap_get_device(ov965x->regmap);
ov965x           1417 drivers/media/i2c/ov9650.c 	for (i = 0; i < ARRAY_SIZE(ov965x->gpios); i++) {
ov965x           1426 drivers/media/i2c/ov9650.c 		v4l2_dbg(1, debug, &ov965x->sd, "set gpio %d to 1\n", gpio);
ov965x           1430 drivers/media/i2c/ov9650.c 		ov965x->gpios[i] = gpio_to_desc(gpio);
ov965x           1436 drivers/media/i2c/ov9650.c static int ov965x_configure_gpios(struct ov965x *ov965x)
ov965x           1438 drivers/media/i2c/ov9650.c 	struct device *dev = regmap_get_device(ov965x->regmap);
ov965x           1440 drivers/media/i2c/ov9650.c 	ov965x->gpios[GPIO_PWDN] = devm_gpiod_get_optional(dev, "powerdown",
ov965x           1442 drivers/media/i2c/ov9650.c 	if (IS_ERR(ov965x->gpios[GPIO_PWDN])) {
ov965x           1444 drivers/media/i2c/ov9650.c 		return PTR_ERR(ov965x->gpios[GPIO_PWDN]);
ov965x           1447 drivers/media/i2c/ov9650.c 	ov965x->gpios[GPIO_RST] = devm_gpiod_get_optional(dev, "reset",
ov965x           1449 drivers/media/i2c/ov9650.c 	if (IS_ERR(ov965x->gpios[GPIO_RST])) {
ov965x           1451 drivers/media/i2c/ov9650.c 		return PTR_ERR(ov965x->gpios[GPIO_RST]);
ov965x           1459 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1463 drivers/media/i2c/ov9650.c 	mutex_lock(&ov965x->lock);
ov965x           1464 drivers/media/i2c/ov9650.c 	ret = __ov965x_set_power(ov965x, 1);
ov965x           1471 drivers/media/i2c/ov9650.c 	ret = ov965x_read(ov965x, REG_PID, &pid);
ov965x           1473 drivers/media/i2c/ov9650.c 		ret = ov965x_read(ov965x, REG_VER, &ver);
ov965x           1475 drivers/media/i2c/ov9650.c 	__ov965x_set_power(ov965x, 0);
ov965x           1478 drivers/media/i2c/ov9650.c 		ov965x->id = OV965X_ID(pid, ver);
ov965x           1479 drivers/media/i2c/ov9650.c 		if (ov965x->id == OV9650_ID || ov965x->id == OV9652_ID) {
ov965x           1480 drivers/media/i2c/ov9650.c 			v4l2_info(sd, "Found OV%04X sensor\n", ov965x->id);
ov965x           1483 drivers/media/i2c/ov9650.c 				 ov965x->id, ret);
ov965x           1488 drivers/media/i2c/ov9650.c 	mutex_unlock(&ov965x->lock);
ov965x           1497 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x;
ov965x           1505 drivers/media/i2c/ov9650.c 	ov965x = devm_kzalloc(&client->dev, sizeof(*ov965x), GFP_KERNEL);
ov965x           1506 drivers/media/i2c/ov9650.c 	if (!ov965x)
ov965x           1509 drivers/media/i2c/ov9650.c 	ov965x->regmap = devm_regmap_init_sccb(client, &ov965x_regmap_config);
ov965x           1510 drivers/media/i2c/ov9650.c 	if (IS_ERR(ov965x->regmap)) {
ov965x           1512 drivers/media/i2c/ov9650.c 		return PTR_ERR(ov965x->regmap);
ov965x           1520 drivers/media/i2c/ov9650.c 		ov965x->mclk_frequency = pdata->mclk_frequency;
ov965x           1522 drivers/media/i2c/ov9650.c 		ret = ov965x_configure_gpios_pdata(ov965x, pdata);
ov965x           1526 drivers/media/i2c/ov9650.c 		ov965x->clk = devm_clk_get(&client->dev, NULL);
ov965x           1527 drivers/media/i2c/ov9650.c 		if (IS_ERR(ov965x->clk))
ov965x           1528 drivers/media/i2c/ov9650.c 			return PTR_ERR(ov965x->clk);
ov965x           1529 drivers/media/i2c/ov9650.c 		ov965x->mclk_frequency = clk_get_rate(ov965x->clk);
ov965x           1531 drivers/media/i2c/ov9650.c 		ret = ov965x_configure_gpios(ov965x);
ov965x           1541 drivers/media/i2c/ov9650.c 	mutex_init(&ov965x->lock);
ov965x           1543 drivers/media/i2c/ov9650.c 	sd = &ov965x->sd;
ov965x           1551 drivers/media/i2c/ov9650.c 	ov965x->pad.flags = MEDIA_PAD_FL_SOURCE;
ov965x           1553 drivers/media/i2c/ov9650.c 	ret = media_entity_pads_init(&sd->entity, 1, &ov965x->pad);
ov965x           1557 drivers/media/i2c/ov9650.c 	ret = ov965x_initialize_controls(ov965x);
ov965x           1561 drivers/media/i2c/ov9650.c 	ov965x_get_default_format(&ov965x->format);
ov965x           1562 drivers/media/i2c/ov9650.c 	ov965x->frame_size = &ov965x_framesizes[0];
ov965x           1563 drivers/media/i2c/ov9650.c 	ov965x->fiv = &ov965x_intervals[0];
ov965x           1570 drivers/media/i2c/ov9650.c 	ov965x_update_exposure_ctrl(ov965x);
ov965x           1582 drivers/media/i2c/ov9650.c 	mutex_destroy(&ov965x->lock);
ov965x           1589 drivers/media/i2c/ov9650.c 	struct ov965x *ov965x = to_ov965x(sd);
ov965x           1594 drivers/media/i2c/ov9650.c 	mutex_destroy(&ov965x->lock);