Symbol: ov2659
drivers/media/i2c/ov2659.c
1029
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1037
mutex_lock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1039
mutex_unlock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1043
mutex_lock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1044
fmt->format = ov2659->format;
drivers/media/i2c/ov2659.c
1045
mutex_unlock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1048
ov2659->format.code, ov2659->format.width,
drivers/media/i2c/ov2659.c
1049
ov2659->format.height);
drivers/media/i2c/ov2659.c
1090
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1109
mutex_lock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1117
if (ov2659->streaming) {
drivers/media/i2c/ov2659.c
1118
mutex_unlock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1122
ov2659->frame_size = size;
drivers/media/i2c/ov2659.c
1123
ov2659->format = fmt->format;
drivers/media/i2c/ov2659.c
1124
ov2659->format_ctrl_regs =
drivers/media/i2c/ov2659.c
1127
if (ov2659->format.code != MEDIA_BUS_FMT_SBGGR8_1X8)
drivers/media/i2c/ov2659.c
1128
val = ov2659->pdata->link_frequency / 2;
drivers/media/i2c/ov2659.c
1130
val = ov2659->pdata->link_frequency;
drivers/media/i2c/ov2659.c
1132
ret = v4l2_ctrl_s_ctrl_int64(ov2659->link_frequency, val);
drivers/media/i2c/ov2659.c
1139
mutex_unlock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1143
static int ov2659_set_frame_size(struct ov2659 *ov2659)
drivers/media/i2c/ov2659.c
1145
struct i2c_client *client = ov2659->client;
drivers/media/i2c/ov2659.c
1149
return ov2659_write_array(ov2659->client, ov2659->frame_size->regs);
drivers/media/i2c/ov2659.c
1152
static int ov2659_set_format(struct ov2659 *ov2659)
drivers/media/i2c/ov2659.c
1154
struct i2c_client *client = ov2659->client;
drivers/media/i2c/ov2659.c
1158
return ov2659_write_array(ov2659->client, ov2659->format_ctrl_regs);
drivers/media/i2c/ov2659.c
1164
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1169
mutex_lock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1173
if (ov2659->streaming == on)
drivers/media/i2c/ov2659.c
1178
ov2659_set_streaming(ov2659, 0);
drivers/media/i2c/ov2659.c
1179
ov2659->streaming = on;
drivers/media/i2c/ov2659.c
1190
ret = ov2659_set_pixel_clock(ov2659);
drivers/media/i2c/ov2659.c
1192
ret = ov2659_set_frame_size(ov2659);
drivers/media/i2c/ov2659.c
1194
ret = ov2659_set_format(ov2659);
drivers/media/i2c/ov2659.c
1196
ov2659_set_streaming(ov2659, 1);
drivers/media/i2c/ov2659.c
1197
ov2659->streaming = on;
drivers/media/i2c/ov2659.c
1201
mutex_unlock(&ov2659->lock);
drivers/media/i2c/ov2659.c
1205
static int ov2659_set_test_pattern(struct ov2659 *ov2659, int value)
drivers/media/i2c/ov2659.c
1207
struct i2c_client *client = v4l2_get_subdevdata(&ov2659->sd);
drivers/media/i2c/ov2659.c
1230
struct ov2659 *ov2659 =
drivers/media/i2c/ov2659.c
1231
container_of(ctrl->handler, struct ov2659, ctrls);
drivers/media/i2c/ov2659.c
1232
struct i2c_client *client = ov2659->client;
drivers/media/i2c/ov2659.c
1240
return ov2659_set_test_pattern(ov2659, ctrl->val);
drivers/media/i2c/ov2659.c
1260
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1264
gpiod_set_value(ov2659->pwdn_gpio, 1);
drivers/media/i2c/ov2659.c
1266
clk_disable_unprepare(ov2659->clk);
drivers/media/i2c/ov2659.c
1275
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1280
ret = clk_prepare_enable(ov2659->clk);
drivers/media/i2c/ov2659.c
1287
gpiod_set_value(ov2659->pwdn_gpio, 0);
drivers/media/i2c/ov2659.c
1289
if (ov2659->resetb_gpio) {
drivers/media/i2c/ov2659.c
1290
gpiod_set_value(ov2659->resetb_gpio, 1);
drivers/media/i2c/ov2659.c
1292
gpiod_set_value(ov2659->resetb_gpio, 0);
drivers/media/i2c/ov2659.c
1425
struct ov2659 *ov2659;
drivers/media/i2c/ov2659.c
1433
ov2659 = devm_kzalloc(&client->dev, sizeof(*ov2659), GFP_KERNEL);
drivers/media/i2c/ov2659.c
1434
if (!ov2659)
drivers/media/i2c/ov2659.c
1437
ov2659->pdata = pdata;
drivers/media/i2c/ov2659.c
1438
ov2659->client = client;
drivers/media/i2c/ov2659.c
1440
ov2659->clk = devm_v4l2_sensor_clk_get(&client->dev, "xvclk");
drivers/media/i2c/ov2659.c
1441
if (IS_ERR(ov2659->clk))
drivers/media/i2c/ov2659.c
1442
return dev_err_probe(&client->dev, PTR_ERR(ov2659->clk),
drivers/media/i2c/ov2659.c
1445
ov2659->xvclk_frequency = clk_get_rate(ov2659->clk);
drivers/media/i2c/ov2659.c
1446
if (ov2659->xvclk_frequency < 6000000 ||
drivers/media/i2c/ov2659.c
1447
ov2659->xvclk_frequency > 27000000)
drivers/media/i2c/ov2659.c
1451
ov2659->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
drivers/media/i2c/ov2659.c
1453
if (IS_ERR(ov2659->pwdn_gpio))
drivers/media/i2c/ov2659.c
1454
return PTR_ERR(ov2659->pwdn_gpio);
drivers/media/i2c/ov2659.c
1457
ov2659->resetb_gpio = devm_gpiod_get_optional(&client->dev, "reset",
drivers/media/i2c/ov2659.c
1459
if (IS_ERR(ov2659->resetb_gpio))
drivers/media/i2c/ov2659.c
1460
return PTR_ERR(ov2659->resetb_gpio);
drivers/media/i2c/ov2659.c
1462
v4l2_ctrl_handler_init(&ov2659->ctrls, 2);
drivers/media/i2c/ov2659.c
1463
ov2659->link_frequency =
drivers/media/i2c/ov2659.c
1464
v4l2_ctrl_new_std(&ov2659->ctrls, &ov2659_ctrl_ops,
drivers/media/i2c/ov2659.c
1469
v4l2_ctrl_new_std_menu_items(&ov2659->ctrls, &ov2659_ctrl_ops,
drivers/media/i2c/ov2659.c
1474
if (ov2659->ctrls.error) {
drivers/media/i2c/ov2659.c
1476
__func__, ov2659->ctrls.error);
drivers/media/i2c/ov2659.c
1477
v4l2_ctrl_handler_free(&ov2659->ctrls);
drivers/media/i2c/ov2659.c
1478
return ov2659->ctrls.error;
drivers/media/i2c/ov2659.c
1481
ov2659->sd.ctrl_handler = &ov2659->ctrls;
drivers/media/i2c/ov2659.c
1482
sd = &ov2659->sd;
drivers/media/i2c/ov2659.c
1490
ov2659->pad.flags = MEDIA_PAD_FL_SOURCE;
drivers/media/i2c/ov2659.c
1492
ret = media_entity_pads_init(&sd->entity, 1, &ov2659->pad);
drivers/media/i2c/ov2659.c
1494
v4l2_ctrl_handler_free(&ov2659->ctrls);
drivers/media/i2c/ov2659.c
1498
mutex_init(&ov2659->lock);
drivers/media/i2c/ov2659.c
1500
ov2659_get_default_format(&ov2659->format);
drivers/media/i2c/ov2659.c
1501
ov2659->frame_size = &ov2659_framesizes[2];
drivers/media/i2c/ov2659.c
1502
ov2659->format_ctrl_regs = ov2659_formats[0].format_ctrl_regs;
drivers/media/i2c/ov2659.c
1513
ov2659_pll_calc_params(ov2659);
drivers/media/i2c/ov2659.c
1515
ret = v4l2_async_register_subdev(&ov2659->sd);
drivers/media/i2c/ov2659.c
1528
v4l2_ctrl_handler_free(&ov2659->ctrls);
drivers/media/i2c/ov2659.c
1531
mutex_destroy(&ov2659->lock);
drivers/media/i2c/ov2659.c
1538
struct ov2659 *ov2659 = to_ov2659(sd);
drivers/media/i2c/ov2659.c
1540
v4l2_ctrl_handler_free(&ov2659->ctrls);
drivers/media/i2c/ov2659.c
1543
mutex_destroy(&ov2659->lock);
drivers/media/i2c/ov2659.c
817
static inline struct ov2659 *to_ov2659(struct v4l2_subdev *sd)
drivers/media/i2c/ov2659.c
819
return container_of(sd, struct ov2659, sd);
drivers/media/i2c/ov2659.c
891
static void ov2659_pll_calc_params(struct ov2659 *ov2659)
drivers/media/i2c/ov2659.c
893
const struct ov2659_platform_data *pdata = ov2659->pdata;
drivers/media/i2c/ov2659.c
895
struct i2c_client *client = ov2659->client;
drivers/media/i2c/ov2659.c
907
actual = ov2659->xvclk_frequency;
drivers/media/i2c/ov2659.c
924
ov2659->pll.ctrl1 = ctrl1_reg;
drivers/media/i2c/ov2659.c
925
ov2659->pll.ctrl2 = ctrl2_reg;
drivers/media/i2c/ov2659.c
926
ov2659->pll.ctrl3 = ctrl3_reg;
drivers/media/i2c/ov2659.c
933
static int ov2659_set_pixel_clock(struct ov2659 *ov2659)
drivers/media/i2c/ov2659.c
935
struct i2c_client *client = ov2659->client;
drivers/media/i2c/ov2659.c
937
{REG_SC_PLL_CTRL1, ov2659->pll.ctrl1},
drivers/media/i2c/ov2659.c
938
{REG_SC_PLL_CTRL2, ov2659->pll.ctrl2},
drivers/media/i2c/ov2659.c
939
{REG_SC_PLL_CTRL3, ov2659->pll.ctrl3},
drivers/media/i2c/ov2659.c
957
static void ov2659_set_streaming(struct ov2659 *ov2659, int on)
drivers/media/i2c/ov2659.c
959
struct i2c_client *client = ov2659->client;