Symbol: ov7740
drivers/media/i2c/ov7740.c
1007
ov7740->subdev.ctrl_handler = ctrl_hdlr;
drivers/media/i2c/ov7740.c
1012
mutex_destroy(&ov7740->mutex);
drivers/media/i2c/ov7740.c
1016
static void ov7740_free_controls(struct ov7740 *ov7740)
drivers/media/i2c/ov7740.c
1018
v4l2_ctrl_handler_free(ov7740->subdev.ctrl_handler);
drivers/media/i2c/ov7740.c
1019
mutex_destroy(&ov7740->mutex);
drivers/media/i2c/ov7740.c
1031
struct ov7740 *ov7740;
drivers/media/i2c/ov7740.c
1035
ov7740 = devm_kzalloc(&client->dev, sizeof(*ov7740), GFP_KERNEL);
drivers/media/i2c/ov7740.c
1036
if (!ov7740)
drivers/media/i2c/ov7740.c
1039
ov7740->xvclk = devm_v4l2_sensor_clk_get(&client->dev, "xvclk");
drivers/media/i2c/ov7740.c
1040
if (IS_ERR(ov7740->xvclk))
drivers/media/i2c/ov7740.c
1041
return dev_err_probe(&client->dev, PTR_ERR(ov7740->xvclk),
drivers/media/i2c/ov7740.c
1044
ret = ov7740_probe_dt(client, ov7740);
drivers/media/i2c/ov7740.c
1048
ov7740->regmap = devm_regmap_init_sccb(client, &ov7740_regmap_config);
drivers/media/i2c/ov7740.c
1049
if (IS_ERR(ov7740->regmap)) {
drivers/media/i2c/ov7740.c
1050
ret = PTR_ERR(ov7740->regmap);
drivers/media/i2c/ov7740.c
1056
sd = &ov7740->subdev;
drivers/media/i2c/ov7740.c
1062
ov7740->pad.flags = MEDIA_PAD_FL_SOURCE;
drivers/media/i2c/ov7740.c
1064
ret = media_entity_pads_init(&sd->entity, 1, &ov7740->pad);
drivers/media/i2c/ov7740.c
1068
ret = ov7740_set_power(ov7740, 1);
drivers/media/i2c/ov7740.c
1075
ret = ov7740_detect(ov7740);
drivers/media/i2c/ov7740.c
1079
mutex_init(&ov7740->mutex);
drivers/media/i2c/ov7740.c
1081
ret = ov7740_init_controls(ov7740);
drivers/media/i2c/ov7740.c
1088
ov7740->fmt = &ov7740_formats[0];
drivers/media/i2c/ov7740.c
1089
ov7740->frmsize = &ov7740_framesizes[0];
drivers/media/i2c/ov7740.c
1091
ov7740_get_default_format(sd, &ov7740->format);
drivers/media/i2c/ov7740.c
1102
v4l2_ctrl_handler_free(ov7740->subdev.ctrl_handler);
drivers/media/i2c/ov7740.c
1104
ov7740_free_controls(ov7740);
drivers/media/i2c/ov7740.c
1108
ov7740_set_power(ov7740, 0);
drivers/media/i2c/ov7740.c
1109
media_entity_cleanup(&ov7740->subdev.entity);
drivers/media/i2c/ov7740.c
1117
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
1119
mutex_destroy(&ov7740->mutex);
drivers/media/i2c/ov7740.c
1120
v4l2_ctrl_handler_free(ov7740->subdev.ctrl_handler);
drivers/media/i2c/ov7740.c
1121
media_entity_cleanup(&ov7740->subdev.entity);
drivers/media/i2c/ov7740.c
1123
ov7740_free_controls(ov7740);
drivers/media/i2c/ov7740.c
1130
ov7740_set_power(ov7740, 0);
drivers/media/i2c/ov7740.c
1136
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
1138
ov7740_set_power(ov7740, 0);
drivers/media/i2c/ov7740.c
1146
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
1148
return ov7740_set_power(ov7740, 1);
drivers/media/i2c/ov7740.c
270
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
271
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
285
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
286
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
294
static int ov7740_set_power(struct ov7740 *ov7740, int on)
drivers/media/i2c/ov7740.c
299
ret = clk_prepare_enable(ov7740->xvclk);
drivers/media/i2c/ov7740.c
303
if (ov7740->pwdn_gpio)
drivers/media/i2c/ov7740.c
304
gpiod_direction_output(ov7740->pwdn_gpio, 0);
drivers/media/i2c/ov7740.c
306
if (ov7740->resetb_gpio) {
drivers/media/i2c/ov7740.c
307
gpiod_set_value(ov7740->resetb_gpio, 1);
drivers/media/i2c/ov7740.c
309
gpiod_set_value(ov7740->resetb_gpio, 0);
drivers/media/i2c/ov7740.c
313
clk_disable_unprepare(ov7740->xvclk);
drivers/media/i2c/ov7740.c
315
if (ov7740->pwdn_gpio)
drivers/media/i2c/ov7740.c
316
gpiod_direction_output(ov7740->pwdn_gpio, 0);
drivers/media/i2c/ov7740.c
332
static int ov7740_set_white_balance(struct ov7740 *ov7740, int awb)
drivers/media/i2c/ov7740.c
334
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
351
ov7740->blue_balance->val);
drivers/media/i2c/ov7740.c
355
ret = regmap_write(regmap, REG_RGAIN, ov7740->red_balance->val);
drivers/media/i2c/ov7740.c
427
static int ov7740_get_gain(struct ov7740 *ov7740, struct v4l2_ctrl *ctrl)
drivers/media/i2c/ov7740.c
429
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
443
ov7740->gain->val = (value1 << 8) | (value0 & 0xff);
drivers/media/i2c/ov7740.c
448
static int ov7740_get_exp(struct ov7740 *ov7740, struct v4l2_ctrl *ctrl)
drivers/media/i2c/ov7740.c
450
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
464
ov7740->exposure->val = (value1 << 8) | (value0 & 0xff);
drivers/media/i2c/ov7740.c
507
struct ov7740 *ov7740 = container_of(ctrl->handler,
drivers/media/i2c/ov7740.c
508
struct ov7740, ctrl_handler);
drivers/media/i2c/ov7740.c
513
ret = ov7740_get_gain(ov7740, ctrl);
drivers/media/i2c/ov7740.c
516
ret = ov7740_get_exp(ov7740, ctrl);
drivers/media/i2c/ov7740.c
527
struct ov7740 *ov7740 = container_of(ctrl->handler,
drivers/media/i2c/ov7740.c
528
struct ov7740, ctrl_handler);
drivers/media/i2c/ov7740.c
529
struct i2c_client *client = v4l2_get_subdevdata(&ov7740->subdev);
drivers/media/i2c/ov7740.c
530
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
539
ret = ov7740_set_white_balance(ov7740, ctrl->val);
drivers/media/i2c/ov7740.c
562
ret = ov7740_set_gain(regmap, ov7740->gain->val);
drivers/media/i2c/ov7740.c
569
ret = ov7740_set_exp(regmap, ov7740->exposure->val);
drivers/media/i2c/ov7740.c
588
static int ov7740_start_streaming(struct ov7740 *ov7740)
drivers/media/i2c/ov7740.c
592
if (ov7740->fmt) {
drivers/media/i2c/ov7740.c
593
ret = regmap_multi_reg_write(ov7740->regmap,
drivers/media/i2c/ov7740.c
594
ov7740->fmt->regs,
drivers/media/i2c/ov7740.c
595
ov7740->fmt->reg_num);
drivers/media/i2c/ov7740.c
600
if (ov7740->frmsize) {
drivers/media/i2c/ov7740.c
601
ret = regmap_multi_reg_write(ov7740->regmap,
drivers/media/i2c/ov7740.c
602
ov7740->frmsize->regs,
drivers/media/i2c/ov7740.c
603
ov7740->frmsize->reg_num);
drivers/media/i2c/ov7740.c
608
return __v4l2_ctrl_handler_setup(ov7740->subdev.ctrl_handler);
drivers/media/i2c/ov7740.c
613
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
617
mutex_lock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
624
ret = ov7740_start_streaming(ov7740);
drivers/media/i2c/ov7740.c
631
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
637
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
726
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
763
ov7740->format = *fmt;
drivers/media/i2c/ov7740.c
772
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
778
mutex_lock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
791
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
799
ov7740->fmt = ovfmt;
drivers/media/i2c/ov7740.c
800
ov7740->frmsize = fsize;
drivers/media/i2c/ov7740.c
802
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
806
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
814
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
817
mutex_lock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
822
format->format = ov7740->format;
drivers/media/i2c/ov7740.c
824
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
860
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
862
format->width = ov7740->frmsize->width;
drivers/media/i2c/ov7740.c
863
format->height = ov7740->frmsize->height;
drivers/media/i2c/ov7740.c
864
format->colorspace = ov7740->fmt->colorspace;
drivers/media/i2c/ov7740.c
865
format->code = ov7740->fmt->mbus_code;
drivers/media/i2c/ov7740.c
871
struct ov7740 *ov7740 = container_of(sd, struct ov7740, subdev);
drivers/media/i2c/ov7740.c
875
mutex_lock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
877
mutex_unlock(&ov7740->mutex);
drivers/media/i2c/ov7740.c
887
struct ov7740 *ov7740)
drivers/media/i2c/ov7740.c
889
ov7740->resetb_gpio = devm_gpiod_get_optional(&client->dev, "reset",
drivers/media/i2c/ov7740.c
891
if (IS_ERR(ov7740->resetb_gpio)) {
drivers/media/i2c/ov7740.c
893
return PTR_ERR(ov7740->resetb_gpio);
drivers/media/i2c/ov7740.c
896
ov7740->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
drivers/media/i2c/ov7740.c
898
if (IS_ERR(ov7740->pwdn_gpio)) {
drivers/media/i2c/ov7740.c
900
return PTR_ERR(ov7740->pwdn_gpio);
drivers/media/i2c/ov7740.c
906
static int ov7740_detect(struct ov7740 *ov7740)
drivers/media/i2c/ov7740.c
908
struct regmap *regmap = ov7740->regmap;
drivers/media/i2c/ov7740.c
939
static int ov7740_init_controls(struct ov7740 *ov7740)
drivers/media/i2c/ov7740.c
941
struct i2c_client *client = v4l2_get_subdevdata(&ov7740->subdev);
drivers/media/i2c/ov7740.c
942
struct v4l2_ctrl_handler *ctrl_hdlr = &ov7740->ctrl_handler;
drivers/media/i2c/ov7740.c
949
ctrl_hdlr->lock = &ov7740->mutex;
drivers/media/i2c/ov7740.c
950
ov7740->auto_wb = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
953
ov7740->blue_balance = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
956
ov7740->red_balance = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
960
ov7740->brightness = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
963
ov7740->contrast = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
966
ov7740->saturation = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
968
ov7740->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
970
ov7740->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
973
ov7740->gain = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
976
ov7740->auto_gain = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
979
ov7740->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops,
drivers/media/i2c/ov7740.c
982
ov7740->auto_exposure = v4l2_ctrl_new_std_menu(ctrl_hdlr,
drivers/media/i2c/ov7740.c
988
v4l2_ctrl_auto_cluster(3, &ov7740->auto_wb, 0, false);
drivers/media/i2c/ov7740.c
989
v4l2_ctrl_auto_cluster(2, &ov7740->auto_gain, 0, true);
drivers/media/i2c/ov7740.c
990
v4l2_ctrl_auto_cluster(2, &ov7740->auto_exposure,