Lines Matching refs:client

118 static int write_reg(struct i2c_client *client, u8 reg, u8 value, u8 channel)  in write_reg()  argument
120 return i2c_smbus_write_byte_data(client, reg | (channel << 6), value); in write_reg()
123 static int write_regs(struct i2c_client *client, const u8 *regs, u8 channel) in write_regs() argument
129 ret = i2c_smbus_write_byte_data(client, in write_regs()
137 static int read_reg(struct i2c_client *client, u8 reg, u8 channel) in read_reg() argument
139 return i2c_smbus_read_byte_data(client, (reg) | (channel << 6)); in read_reg()
179 struct i2c_client *client = v4l2_get_subdevdata(&state->sd); in tw2804_g_volatile_ctrl() local
183 ctrl->val = read_reg(client, TW2804_REG_GAIN, 0); in tw2804_g_volatile_ctrl()
187 ctrl->val = read_reg(client, TW2804_REG_CHROMA_GAIN, 0); in tw2804_g_volatile_ctrl()
191 ctrl->val = read_reg(client, TW2804_REG_BLUE_BALANCE, 0); in tw2804_g_volatile_ctrl()
195 ctrl->val = read_reg(client, TW2804_REG_RED_BALANCE, 0); in tw2804_g_volatile_ctrl()
204 struct i2c_client *client = v4l2_get_subdevdata(&state->sd); in tw2804_s_ctrl() local
211 reg = read_reg(client, addr, state->channel); in tw2804_s_ctrl()
218 return write_reg(client, addr, reg, state->channel); in tw2804_s_ctrl()
222 reg = read_reg(client, addr, state->channel); in tw2804_s_ctrl()
226 return write_reg(client, addr, reg, state->channel); in tw2804_s_ctrl()
229 return write_reg(client, TW2804_REG_GAIN, ctrl->val, 0); in tw2804_s_ctrl()
232 return write_reg(client, TW2804_REG_CHROMA_GAIN, ctrl->val, 0); in tw2804_s_ctrl()
235 return write_reg(client, TW2804_REG_BLUE_BALANCE, ctrl->val, 0); in tw2804_s_ctrl()
238 return write_reg(client, TW2804_REG_RED_BALANCE, ctrl->val, 0); in tw2804_s_ctrl()
241 return write_reg(client, TW2804_REG_BRIGHTNESS, in tw2804_s_ctrl()
245 return write_reg(client, TW2804_REG_CONTRAST, in tw2804_s_ctrl()
249 return write_reg(client, TW2804_REG_SATURATION, in tw2804_s_ctrl()
253 return write_reg(client, TW2804_REG_HUE, in tw2804_s_ctrl()
265 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw2804_s_std() local
281 write_regs(client, regs, dec->channel); in tw2804_s_std()
290 struct i2c_client *client = v4l2_get_subdevdata(sd); in tw2804_s_video_routing() local
295 dev_err(&client->dev, in tw2804_s_video_routing()
300 dev_dbg(&client->dev, "initializing TW2804 channel %d\n", in tw2804_s_video_routing()
303 write_regs(client, global_registers, 0) < 0) { in tw2804_s_video_routing()
304 dev_err(&client->dev, in tw2804_s_video_routing()
308 if (write_regs(client, channel_registers, dec->channel) < 0) { in tw2804_s_video_routing()
309 dev_err(&client->dev, in tw2804_s_video_routing()
322 reg = read_reg(client, 0x22, dec->channel); in tw2804_s_video_routing()
329 reg = write_reg(client, 0x22, reg, dec->channel); in tw2804_s_video_routing()
358 static int tw2804_probe(struct i2c_client *client, in tw2804_probe() argument
361 struct i2c_adapter *adapter = client->adapter; in tw2804_probe()
370 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); in tw2804_probe()
374 v4l2_i2c_subdev_init(sd, client, &tw2804_ops); in tw2804_probe()
414 v4l_info(client, "chip found @ 0x%02x (%s)\n", in tw2804_probe()
415 client->addr << 1, client->adapter->name); in tw2804_probe()
420 static int tw2804_remove(struct i2c_client *client) in tw2804_remove() argument
422 struct v4l2_subdev *sd = i2c_get_clientdata(client); in tw2804_remove()