Symbol: ov8858
drivers/media/i2c/ov8858.c
124
static inline struct ov8858 *sd_to_ov8858(struct v4l2_subdev *sd)
drivers/media/i2c/ov8858.c
1241
static int ov8858_write(struct ov8858 *ov8858, u32 reg, u32 val, int *err)
drivers/media/i2c/ov8858.c
1243
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
126
return container_of(sd, struct ov8858, subdev);
drivers/media/i2c/ov8858.c
1269
static int ov8858_write_array(struct ov8858 *ov8858, const struct regval *regs)
drivers/media/i2c/ov8858.c
1275
ov8858_write(ov8858, OV8858_REG_8BIT(regs[i].addr),
drivers/media/i2c/ov8858.c
1282
static int ov8858_read(struct ov8858 *ov8858, u32 reg, u32 *val)
drivers/media/i2c/ov8858.c
1284
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1323
static int ov8858_start_stream(struct ov8858 *ov8858,
drivers/media/i2c/ov8858.c
1331
ret = ov8858_write_array(ov8858, ov8858->global_regs);
drivers/media/i2c/ov8858.c
1340
reg_list = ov8858->num_lanes == 4
drivers/media/i2c/ov8858.c
1344
ret = ov8858_write_array(ov8858, reg_list);
drivers/media/i2c/ov8858.c
1351
ret = __v4l2_ctrl_handler_setup(&ov8858->ctrl_handler);
drivers/media/i2c/ov8858.c
1355
ret = ov8858_write(ov8858, OV8858_REG_SC_CTRL0100,
drivers/media/i2c/ov8858.c
1366
static int ov8858_stop_stream(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1368
return ov8858_write(ov8858, OV8858_REG_SC_CTRL0100,
drivers/media/i2c/ov8858.c
1375
struct ov8858 *ov8858 = sd_to_ov8858(sd);
drivers/media/i2c/ov8858.c
1386
ret = ov8858_start_stream(ov8858, state);
drivers/media/i2c/ov8858.c
1393
ov8858_stop_stream(ov8858);
drivers/media/i2c/ov8858.c
1415
struct ov8858 *ov8858 = sd_to_ov8858(sd);
drivers/media/i2c/ov8858.c
1436
__v4l2_ctrl_modify_range(ov8858->hblank, h_blank, h_blank, 1,
drivers/media/i2c/ov8858.c
1440
__v4l2_ctrl_modify_range(ov8858->vblank, vblank_def,
drivers/media/i2c/ov8858.c
1514
static int ov8858_enable_test_pattern(struct ov8858 *ov8858, u32 pattern)
drivers/media/i2c/ov8858.c
1523
return ov8858_write(ov8858, OV8858_REG_TEST_PATTERN, val, NULL);
drivers/media/i2c/ov8858.c
1528
struct ov8858 *ov8858 = container_of(ctrl->handler,
drivers/media/i2c/ov8858.c
1529
struct ov8858, ctrl_handler);
drivers/media/i2c/ov8858.c
1531
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1544
state = v4l2_subdev_get_locked_active_state(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1552
__v4l2_ctrl_modify_range(ov8858->exposure,
drivers/media/i2c/ov8858.c
1553
ov8858->exposure->minimum, max_exp,
drivers/media/i2c/ov8858.c
1554
ov8858->exposure->step,
drivers/media/i2c/ov8858.c
1555
ov8858->exposure->default_value);
drivers/media/i2c/ov8858.c
1565
ret = ov8858_write(ov8858, OV8858_REG_LONG_EXPO,
drivers/media/i2c/ov8858.c
1569
ret = ov8858_write(ov8858, OV8858_REG_LONG_GAIN,
drivers/media/i2c/ov8858.c
1582
ret = ov8858_write(ov8858, OV8858_REG_LONG_DIGIGAIN,
drivers/media/i2c/ov8858.c
1586
ret = ov8858_write(ov8858, OV8858_REG_VTS,
drivers/media/i2c/ov8858.c
1590
ret = ov8858_enable_test_pattern(ov8858, ctrl->val);
drivers/media/i2c/ov8858.c
1612
static int ov8858_power_on(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1614
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1619
if (clk_get_rate(ov8858->xvclk) != OV8858_XVCLK_FREQ)
drivers/media/i2c/ov8858.c
1622
ret = clk_prepare_enable(ov8858->xvclk);
drivers/media/i2c/ov8858.c
1629
ov8858->supplies);
drivers/media/i2c/ov8858.c
1642
gpiod_set_value_cansleep(ov8858->reset_gpio, 0);
drivers/media/i2c/ov8858.c
1644
gpiod_set_value_cansleep(ov8858->pwdn_gpio, 0);
drivers/media/i2c/ov8858.c
1650
clk_disable_unprepare(ov8858->xvclk);
drivers/media/i2c/ov8858.c
1655
static void ov8858_power_off(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1657
gpiod_set_value_cansleep(ov8858->pwdn_gpio, 1);
drivers/media/i2c/ov8858.c
1658
clk_disable_unprepare(ov8858->xvclk);
drivers/media/i2c/ov8858.c
1659
gpiod_set_value_cansleep(ov8858->reset_gpio, 1);
drivers/media/i2c/ov8858.c
1662
ov8858->supplies);
drivers/media/i2c/ov8858.c
1669
struct ov8858 *ov8858 = sd_to_ov8858(sd);
drivers/media/i2c/ov8858.c
1671
return ov8858_power_on(ov8858);
drivers/media/i2c/ov8858.c
1678
struct ov8858 *ov8858 = sd_to_ov8858(sd);
drivers/media/i2c/ov8858.c
1680
ov8858_power_off(ov8858);
drivers/media/i2c/ov8858.c
1694
static int ov8858_init_ctrls(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1696
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1697
struct v4l2_ctrl_handler *handler = &ov8858->ctrl_handler;
drivers/media/i2c/ov8858.c
1716
pixel_rate = OV8858_LINK_FREQ * 2 * ov8858->num_lanes / 10;
drivers/media/i2c/ov8858.c
1721
ov8858->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK,
drivers/media/i2c/ov8858.c
1723
if (ov8858->hblank)
drivers/media/i2c/ov8858.c
1724
ov8858->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
drivers/media/i2c/ov8858.c
1727
ov8858->vblank = v4l2_ctrl_new_std(handler, &ov8858_ctrl_ops,
drivers/media/i2c/ov8858.c
1733
ov8858->exposure = v4l2_ctrl_new_std(handler, &ov8858_ctrl_ops,
drivers/media/i2c/ov8858.c
1767
ov8858->subdev.ctrl_handler = handler;
drivers/media/i2c/ov8858.c
1778
static int ov8858_check_sensor_id(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1780
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1784
ret = ov8858_read(ov8858, OV8858_REG_CHIP_ID, &id);
drivers/media/i2c/ov8858.c
1793
ret = ov8858_read(ov8858, OV8858_REG_SUB_ID, &id);
drivers/media/i2c/ov8858.c
1801
ov8858->global_regs = ov8858->num_lanes == 4
drivers/media/i2c/ov8858.c
1804
} else if (ov8858->num_lanes == 2) {
drivers/media/i2c/ov8858.c
1809
ov8858->global_regs = ov8858_global_regs_r1a;
drivers/media/i2c/ov8858.c
1820
static int ov8858_configure_regulators(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1822
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1826
ov8858->supplies[i].supply = ov8858_supply_names[i];
drivers/media/i2c/ov8858.c
1830
ov8858->supplies);
drivers/media/i2c/ov8858.c
1833
static int ov8858_parse_of(struct ov8858 *ov8858)
drivers/media/i2c/ov8858.c
1836
struct i2c_client *client = v4l2_get_subdevdata(&ov8858->subdev);
drivers/media/i2c/ov8858.c
1854
ov8858->num_lanes = vep.bus.mipi_csi2.num_data_lanes;
drivers/media/i2c/ov8858.c
1855
switch (ov8858->num_lanes) {
drivers/media/i2c/ov8858.c
1861
ov8858->num_lanes);
drivers/media/i2c/ov8858.c
1872
struct ov8858 *ov8858;
drivers/media/i2c/ov8858.c
1875
ov8858 = devm_kzalloc(dev, sizeof(*ov8858), GFP_KERNEL);
drivers/media/i2c/ov8858.c
1876
if (!ov8858)
drivers/media/i2c/ov8858.c
1879
ov8858->xvclk = devm_v4l2_sensor_clk_get(dev, "xvclk");
drivers/media/i2c/ov8858.c
1880
if (IS_ERR(ov8858->xvclk))
drivers/media/i2c/ov8858.c
1881
return dev_err_probe(dev, PTR_ERR(ov8858->xvclk),
drivers/media/i2c/ov8858.c
1884
ov8858->reset_gpio = devm_gpiod_get_optional(dev, "reset",
drivers/media/i2c/ov8858.c
1886
if (IS_ERR(ov8858->reset_gpio))
drivers/media/i2c/ov8858.c
1887
return dev_err_probe(dev, PTR_ERR(ov8858->reset_gpio),
drivers/media/i2c/ov8858.c
1890
ov8858->pwdn_gpio = devm_gpiod_get_optional(dev, "powerdown",
drivers/media/i2c/ov8858.c
1892
if (IS_ERR(ov8858->pwdn_gpio))
drivers/media/i2c/ov8858.c
1893
return dev_err_probe(dev, PTR_ERR(ov8858->pwdn_gpio),
drivers/media/i2c/ov8858.c
1896
v4l2_i2c_subdev_init(&ov8858->subdev, client, &ov8858_subdev_ops);
drivers/media/i2c/ov8858.c
1897
ov8858->subdev.internal_ops = &ov8858_internal_ops;
drivers/media/i2c/ov8858.c
1899
ret = ov8858_configure_regulators(ov8858);
drivers/media/i2c/ov8858.c
1903
ret = ov8858_parse_of(ov8858);
drivers/media/i2c/ov8858.c
1907
ret = ov8858_init_ctrls(ov8858);
drivers/media/i2c/ov8858.c
1911
sd = &ov8858->subdev;
drivers/media/i2c/ov8858.c
1913
ov8858->pad.flags = MEDIA_PAD_FL_SOURCE;
drivers/media/i2c/ov8858.c
1915
ret = media_entity_pads_init(&sd->entity, 1, &ov8858->pad);
drivers/media/i2c/ov8858.c
1919
sd->state_lock = ov8858->ctrl_handler.lock;
drivers/media/i2c/ov8858.c
1926
ret = ov8858_power_on(ov8858);
drivers/media/i2c/ov8858.c
1934
ret = ov8858_check_sensor_id(ov8858);
drivers/media/i2c/ov8858.c
1954
ov8858_power_off(ov8858);
drivers/media/i2c/ov8858.c
1958
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
drivers/media/i2c/ov8858.c
1966
struct ov8858 *ov8858 = sd_to_ov8858(sd);
drivers/media/i2c/ov8858.c
1970
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
drivers/media/i2c/ov8858.c
1974
ov8858_power_off(ov8858);