Lines Matching refs:client
220 static int ov6650_reg_read(struct i2c_client *client, u8 reg, u8 *val) in ov6650_reg_read() argument
225 .addr = client->addr, in ov6650_reg_read()
231 ret = i2c_transfer(client->adapter, &msg, 1); in ov6650_reg_read()
236 ret = i2c_transfer(client->adapter, &msg, 1); in ov6650_reg_read()
244 dev_err(&client->dev, "Failed reading register 0x%02x!\n", reg); in ov6650_reg_read()
249 static int ov6650_reg_write(struct i2c_client *client, u8 reg, u8 val) in ov6650_reg_write() argument
254 .addr = client->addr, in ov6650_reg_write()
260 ret = i2c_transfer(client->adapter, &msg, 1); in ov6650_reg_write()
264 dev_err(&client->dev, "Failed writing register 0x%02x!\n", reg); in ov6650_reg_write()
272 static int ov6650_reg_rmw(struct i2c_client *client, u8 reg, u8 set, u8 mask) in ov6650_reg_rmw() argument
277 ret = ov6650_reg_read(client, reg, &val); in ov6650_reg_rmw()
279 dev_err(&client->dev, in ov6650_reg_rmw()
288 ret = ov6650_reg_write(client, reg, val); in ov6650_reg_rmw()
290 dev_err(&client->dev, in ov6650_reg_rmw()
297 static struct ov6650 *to_ov6650(const struct i2c_client *client) in to_ov6650() argument
299 return container_of(i2c_get_clientdata(client), struct ov6650, subdev); in to_ov6650()
313 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6550_g_volatile_ctrl() local
319 ret = ov6650_reg_read(client, REG_GAIN, ®); in ov6550_g_volatile_ctrl()
324 ret = ov6650_reg_read(client, REG_BLUE, ®); in ov6550_g_volatile_ctrl()
326 ret = ov6650_reg_read(client, REG_RED, ®2); in ov6550_g_volatile_ctrl()
333 ret = ov6650_reg_read(client, REG_AECH, ®); in ov6550_g_volatile_ctrl()
346 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6550_s_ctrl() local
351 ret = ov6650_reg_rmw(client, REG_COMB, in ov6550_s_ctrl()
354 ret = ov6650_reg_write(client, REG_GAIN, priv->gain->val); in ov6550_s_ctrl()
357 ret = ov6650_reg_rmw(client, REG_COMB, in ov6550_s_ctrl()
360 ret = ov6650_reg_write(client, REG_BLUE, priv->blue->val); in ov6550_s_ctrl()
362 ret = ov6650_reg_write(client, REG_RED, in ov6550_s_ctrl()
367 return ov6650_reg_rmw(client, REG_SAT, SET_SAT(ctrl->val), in ov6550_s_ctrl()
370 return ov6650_reg_rmw(client, REG_HUE, SET_HUE(ctrl->val), in ov6550_s_ctrl()
373 return ov6650_reg_write(client, REG_BRT, ctrl->val); in ov6550_s_ctrl()
375 ret = ov6650_reg_rmw(client, REG_COMB, ctrl->val == in ov6550_s_ctrl()
378 ret = ov6650_reg_write(client, REG_AECH, in ov6550_s_ctrl()
382 return ov6650_reg_write(client, REG_GAM1, ctrl->val); in ov6550_s_ctrl()
384 return ov6650_reg_rmw(client, REG_COMB, in ov6550_s_ctrl()
387 return ov6650_reg_rmw(client, REG_COMB, in ov6550_s_ctrl()
398 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_get_register() local
407 ret = ov6650_reg_read(client, reg->reg, &val); in ov6650_get_register()
417 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_set_register() local
422 return ov6650_reg_write(client, reg->reg, reg->val); in ov6650_set_register()
428 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_s_power() local
429 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in ov6650_s_power()
430 struct ov6650 *priv = to_ov6650(client); in ov6650_s_power()
432 return soc_camera_set_power(&client->dev, ssdd, priv->clk, on); in ov6650_s_power()
437 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_g_crop() local
438 struct ov6650 *priv = to_ov6650(client); in ov6650_g_crop()
448 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_s_crop() local
449 struct ov6650 *priv = to_ov6650(client); in ov6650_s_crop()
465 ret = ov6650_reg_write(client, REG_HSTRT, rect.left >> 1); in ov6650_s_crop()
468 ret = ov6650_reg_write(client, REG_HSTOP, in ov6650_s_crop()
473 ret = ov6650_reg_write(client, REG_VSTRT, rect.top >> 1); in ov6650_s_crop()
477 ret = ov6650_reg_write(client, REG_VSTOP, in ov6650_s_crop()
505 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_g_fmt() local
506 struct ov6650 *priv = to_ov6650(client); in ov6650_g_fmt()
542 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_s_fmt() local
545 struct ov6650 *priv = to_ov6650(client); in ov6650_s_fmt()
566 dev_dbg(&client->dev, "pixel format GREY8_1X8\n"); in ov6650_s_fmt()
571 dev_dbg(&client->dev, "pixel format YUYV8_2X8_LE\n"); in ov6650_s_fmt()
576 dev_dbg(&client->dev, "pixel format YVYU8_2X8_LE (untested)\n"); in ov6650_s_fmt()
581 dev_dbg(&client->dev, "pixel format YUYV8_2X8_BE\n"); in ov6650_s_fmt()
591 dev_dbg(&client->dev, "pixel format YVYU8_2X8_BE (untested)\n"); in ov6650_s_fmt()
601 dev_dbg(&client->dev, "pixel format SBGGR8_1X8 (untested)\n"); in ov6650_s_fmt()
606 dev_err(&client->dev, "Pixel format not handled: 0x%x\n", code); in ov6650_s_fmt()
628 dev_dbg(&client->dev, "max resolution: QCIF\n"); in ov6650_s_fmt()
632 dev_dbg(&client->dev, "max resolution: CIF\n"); in ov6650_s_fmt()
639 dev_dbg(&client->dev, "8MHz input clock\n"); in ov6650_s_fmt()
642 dev_dbg(&client->dev, "12MHz input clock\n"); in ov6650_s_fmt()
645 dev_dbg(&client->dev, "16MHz input clock\n"); in ov6650_s_fmt()
648 dev_dbg(&client->dev, "24MHz input clock\n"); in ov6650_s_fmt()
651 dev_err(&client->dev, in ov6650_s_fmt()
661 dev_dbg(&client->dev, "using default 24MHz input clock\n"); in ov6650_s_fmt()
667 dev_dbg(&client->dev, "pixel clock divider: %ld.%ld\n", in ov6650_s_fmt()
672 ret = ov6650_reg_rmw(client, REG_COMA, coma_set, coma_mask); in ov6650_s_fmt()
674 ret = ov6650_reg_write(client, REG_CLKRC, clkrc); in ov6650_s_fmt()
676 ret = ov6650_reg_rmw(client, REG_COML, coml_set, coml_mask); in ov6650_s_fmt()
690 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_try_fmt() local
691 struct ov6650 *priv = to_ov6650(client); in ov6650_try_fmt()
731 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_g_parm() local
732 struct ov6650 *priv = to_ov6650(client); in ov6650_g_parm()
744 dev_dbg(&client->dev, "Frame interval: %u/%u s\n", in ov6650_g_parm()
752 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_s_parm() local
753 struct ov6650 *priv = to_ov6650(client); in ov6650_s_parm()
784 ret = ov6650_reg_rmw(client, REG_CLKRC, clkrc, CLKRC_DIV_MASK); in ov6650_s_parm()
794 static int ov6650_reset(struct i2c_client *client) in ov6650_reset() argument
798 dev_dbg(&client->dev, "reset\n"); in ov6650_reset()
800 ret = ov6650_reg_rmw(client, REG_COMA, COMA_RESET, 0); in ov6650_reset()
802 dev_err(&client->dev, in ov6650_reset()
809 static int ov6650_prog_dflt(struct i2c_client *client) in ov6650_prog_dflt() argument
813 dev_dbg(&client->dev, "initializing\n"); in ov6650_prog_dflt()
815 ret = ov6650_reg_write(client, REG_COMA, 0); /* ~COMA_RESET */ in ov6650_prog_dflt()
817 ret = ov6650_reg_rmw(client, REG_COMB, 0, COMB_BAND_FILTER); in ov6650_prog_dflt()
822 static int ov6650_video_probe(struct i2c_client *client) in ov6650_video_probe() argument
824 struct ov6650 *priv = to_ov6650(client); in ov6650_video_probe()
835 ret = ov6650_reg_read(client, REG_PIDH, &pidh); in ov6650_video_probe()
837 ret = ov6650_reg_read(client, REG_PIDL, &pidl); in ov6650_video_probe()
839 ret = ov6650_reg_read(client, REG_MIDH, &midh); in ov6650_video_probe()
841 ret = ov6650_reg_read(client, REG_MIDL, &midl); in ov6650_video_probe()
847 dev_err(&client->dev, "Product ID error 0x%02x:0x%02x\n", in ov6650_video_probe()
853 dev_info(&client->dev, in ov6650_video_probe()
857 ret = ov6650_reset(client); in ov6650_video_probe()
859 ret = ov6650_prog_dflt(client); in ov6650_video_probe()
885 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_g_mbus_config() local
886 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in ov6650_g_mbus_config()
903 struct i2c_client *client = v4l2_get_subdevdata(sd); in ov6650_s_mbus_config() local
904 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in ov6650_s_mbus_config()
909 ret = ov6650_reg_rmw(client, REG_COMJ, COMJ_PCLK_RISING, 0); in ov6650_s_mbus_config()
911 ret = ov6650_reg_rmw(client, REG_COMJ, 0, COMJ_PCLK_RISING); in ov6650_s_mbus_config()
916 ret = ov6650_reg_rmw(client, REG_COMF, COMF_HREF_LOW, 0); in ov6650_s_mbus_config()
918 ret = ov6650_reg_rmw(client, REG_COMF, 0, COMF_HREF_LOW); in ov6650_s_mbus_config()
923 ret = ov6650_reg_rmw(client, REG_COMJ, COMJ_VSYNC_HIGH, 0); in ov6650_s_mbus_config()
925 ret = ov6650_reg_rmw(client, REG_COMJ, 0, COMJ_VSYNC_HIGH); in ov6650_s_mbus_config()
953 static int ov6650_probe(struct i2c_client *client, in ov6650_probe() argument
957 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in ov6650_probe()
961 dev_err(&client->dev, "Missing platform_data for driver\n"); in ov6650_probe()
965 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); in ov6650_probe()
967 dev_err(&client->dev, in ov6650_probe()
972 v4l2_i2c_subdev_init(&priv->subdev, client, &ov6650_subdev_ops); in ov6650_probe()
1019 priv->clk = v4l2_clk_get(&client->dev, "mclk"); in ov6650_probe()
1025 ret = ov6650_video_probe(client); in ov6650_probe()
1035 static int ov6650_remove(struct i2c_client *client) in ov6650_remove() argument
1037 struct ov6650 *priv = to_ov6650(client); in ov6650_remove()