Lines Matching refs:client
331 static struct tw9910_priv *to_tw9910(const struct i2c_client *client) in to_tw9910() argument
333 return container_of(i2c_get_clientdata(client), struct tw9910_priv, in to_tw9910()
337 static int tw9910_mask_set(struct i2c_client *client, u8 command, in tw9910_mask_set() argument
340 s32 val = i2c_smbus_read_byte_data(client, command); in tw9910_mask_set()
347 return i2c_smbus_write_byte_data(client, command, val); in tw9910_mask_set()
350 static int tw9910_set_scale(struct i2c_client *client, in tw9910_set_scale() argument
355 ret = i2c_smbus_write_byte_data(client, SCALE_HI, in tw9910_set_scale()
361 ret = i2c_smbus_write_byte_data(client, HSCALE_LO, in tw9910_set_scale()
366 ret = i2c_smbus_write_byte_data(client, VSCALE_LO, in tw9910_set_scale()
372 static int tw9910_set_hsync(struct i2c_client *client) in tw9910_set_hsync() argument
374 struct tw9910_priv *priv = to_tw9910(client); in tw9910_set_hsync()
378 ret = i2c_smbus_write_byte_data(client, HSBEGIN, in tw9910_set_hsync()
384 ret = i2c_smbus_write_byte_data(client, HSEND, in tw9910_set_hsync()
392 ret = tw9910_mask_set(client, HSLOWCTL, 0x77, in tw9910_set_hsync()
399 static void tw9910_reset(struct i2c_client *client) in tw9910_reset() argument
401 tw9910_mask_set(client, ACNTL1, SRESET, SRESET); in tw9910_reset()
405 static int tw9910_power(struct i2c_client *client, int enable) in tw9910_power() argument
419 ret = tw9910_mask_set(client, ACNTL1, ACNTL1_PDN_MASK, acntl1); in tw9910_power()
423 return tw9910_mask_set(client, ACNTL2, ACNTL2_PDN_MASK, acntl2); in tw9910_power()
461 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_stream() local
462 struct tw9910_priv *priv = to_tw9910(client); in tw9910_s_stream()
475 dev_err(&client->dev, "un-supported revision\n"); in tw9910_s_stream()
482 dev_err(&client->dev, "norm select error\n"); in tw9910_s_stream()
486 dev_dbg(&client->dev, "%s %dx%d\n", in tw9910_s_stream()
492 ret = tw9910_mask_set(client, OPFORM, OEN_TRI_SEL_MASK, val); in tw9910_s_stream()
496 return tw9910_power(client, enable); in tw9910_s_stream()
501 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_std() local
502 struct tw9910_priv *priv = to_tw9910(client); in tw9910_g_std()
511 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_std() local
512 struct tw9910_priv *priv = to_tw9910(client); in tw9910_s_std()
526 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_register() local
533 ret = i2c_smbus_read_byte_data(client, reg->reg); in tw9910_g_register()
549 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_register() local
555 return i2c_smbus_write_byte_data(client, reg->reg, reg->val); in tw9910_s_register()
561 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_power() local
562 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_s_power()
563 struct tw9910_priv *priv = to_tw9910(client); in tw9910_s_power()
565 return soc_camera_set_power(&client->dev, ssdd, priv->clk, on); in tw9910_s_power()
570 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_set_frame() local
571 struct tw9910_priv *priv = to_tw9910(client); in tw9910_set_frame()
585 tw9910_reset(client); in tw9910_set_frame()
594 ret = tw9910_mask_set(client, OPFORM, LEN, val); in tw9910_set_frame()
622 ret = tw9910_mask_set(client, VBICNTL, RTSEL_MASK, val); in tw9910_set_frame()
629 ret = tw9910_set_scale(client, priv->scale); in tw9910_set_frame()
636 ret = tw9910_set_hsync(client); in tw9910_set_frame()
647 tw9910_reset(client); in tw9910_set_frame()
655 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_crop() local
656 struct tw9910_priv *priv = to_tw9910(client); in tw9910_g_crop()
674 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_cropcap() local
675 struct tw9910_priv *priv = to_tw9910(client); in tw9910_cropcap()
697 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_fmt() local
698 struct tw9910_priv *priv = to_tw9910(client); in tw9910_g_fmt()
743 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_try_fmt() local
744 struct tw9910_priv *priv = to_tw9910(client); in tw9910_try_fmt()
750 dev_err(&client->dev, "Field type %d invalid.\n", mf->field); in tw9910_try_fmt()
770 static int tw9910_video_probe(struct i2c_client *client) in tw9910_video_probe() argument
772 struct tw9910_priv *priv = to_tw9910(client); in tw9910_video_probe()
781 dev_err(&client->dev, "bus width error\n"); in tw9910_video_probe()
793 id = i2c_smbus_read_byte_data(client, ID); in tw9910_video_probe()
799 dev_err(&client->dev, in tw9910_video_probe()
806 dev_info(&client->dev, in tw9910_video_probe()
837 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_mbus_config() local
838 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_g_mbus_config()
853 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_mbus_config() local
854 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_s_mbus_config()
870 return i2c_smbus_write_byte_data(client, OUTCTR1, val); in tw9910_s_mbus_config()
903 static int tw9910_probe(struct i2c_client *client, in tw9910_probe() argument
910 to_i2c_adapter(client->dev.parent); in tw9910_probe()
911 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_probe()
915 dev_err(&client->dev, "TW9910: missing platform data!\n"); in tw9910_probe()
922 dev_err(&client->dev, in tw9910_probe()
928 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); in tw9910_probe()
934 v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops); in tw9910_probe()
936 priv->clk = v4l2_clk_get(&client->dev, "mclk"); in tw9910_probe()
940 ret = tw9910_video_probe(client); in tw9910_probe()
947 static int tw9910_remove(struct i2c_client *client) in tw9910_remove() argument
949 struct tw9910_priv *priv = to_tw9910(client); in tw9910_remove()