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 ret = tw9910_mask_set(client, VVBI, 0x10, 0x10); in tw9910_s_std()
530 ret = tw9910_mask_set(client, VVBI, 0x10, 0x00); in tw9910_s_std()
533 ret = i2c_smbus_write_byte_data(client, CROP_HI, in tw9910_s_std()
539 ret = i2c_smbus_write_byte_data(client, VDELAY_LO, in tw9910_s_std()
542 ret = i2c_smbus_write_byte_data(client, VACTIVE_LO, in tw9910_s_std()
552 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_register() local
559 ret = i2c_smbus_read_byte_data(client, reg->reg); in tw9910_g_register()
575 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_register() local
581 return i2c_smbus_write_byte_data(client, reg->reg, reg->val); in tw9910_s_register()
587 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_power() local
588 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_s_power()
589 struct tw9910_priv *priv = to_tw9910(client); in tw9910_s_power()
591 return soc_camera_set_power(&client->dev, ssdd, priv->clk, on); in tw9910_s_power()
596 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_set_frame() local
597 struct tw9910_priv *priv = to_tw9910(client); in tw9910_set_frame()
611 tw9910_reset(client); in tw9910_set_frame()
620 ret = tw9910_mask_set(client, OPFORM, LEN, val); in tw9910_set_frame()
648 ret = tw9910_mask_set(client, VBICNTL, RTSEL_MASK, val); in tw9910_set_frame()
655 ret = tw9910_set_scale(client, priv->scale); in tw9910_set_frame()
662 ret = tw9910_set_hsync(client); in tw9910_set_frame()
673 tw9910_reset(client); in tw9910_set_frame()
681 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_crop() local
682 struct tw9910_priv *priv = to_tw9910(client); in tw9910_g_crop()
700 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_cropcap() local
701 struct tw9910_priv *priv = to_tw9910(client); in tw9910_cropcap()
725 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_get_fmt() local
726 struct tw9910_priv *priv = to_tw9910(client); in tw9910_get_fmt()
776 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_set_fmt() local
777 struct tw9910_priv *priv = to_tw9910(client); in tw9910_set_fmt()
786 dev_err(&client->dev, "Field type %d invalid.\n", mf->field); in tw9910_set_fmt()
809 static int tw9910_video_probe(struct i2c_client *client) in tw9910_video_probe() argument
811 struct tw9910_priv *priv = to_tw9910(client); in tw9910_video_probe()
820 dev_err(&client->dev, "bus width error\n"); in tw9910_video_probe()
832 id = i2c_smbus_read_byte_data(client, ID); in tw9910_video_probe()
838 dev_err(&client->dev, in tw9910_video_probe()
845 dev_info(&client->dev, in tw9910_video_probe()
878 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_g_mbus_config() local
879 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_g_mbus_config()
894 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw9910_s_mbus_config() local
895 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_s_mbus_config()
911 return i2c_smbus_write_byte_data(client, OUTCTR1, val); in tw9910_s_mbus_config()
947 static int tw9910_probe(struct i2c_client *client, in tw9910_probe() argument
954 to_i2c_adapter(client->dev.parent); in tw9910_probe()
955 struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); in tw9910_probe()
959 dev_err(&client->dev, "TW9910: missing platform data!\n"); in tw9910_probe()
966 dev_err(&client->dev, in tw9910_probe()
972 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); in tw9910_probe()
978 v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops); in tw9910_probe()
980 priv->clk = v4l2_clk_get(&client->dev, "mclk"); in tw9910_probe()
984 ret = tw9910_video_probe(client); in tw9910_probe()
991 static int tw9910_remove(struct i2c_client *client) in tw9910_remove() argument
993 struct tw9910_priv *priv = to_tw9910(client); in tw9910_remove()