Lines Matching full:sd

117 	struct v4l2_subdev sd;  member
122 static inline struct saa7706h_state *to_state(struct v4l2_subdev *sd) in to_state() argument
124 return container_of(sd, struct saa7706h_state, sd); in to_state()
144 static int saa7706h_set_reg24(struct v4l2_subdev *sd, u16 reg, u32 val) in saa7706h_set_reg24() argument
146 struct i2c_client *client = v4l2_get_subdevdata(sd); in saa7706h_set_reg24()
159 static int saa7706h_set_reg24_err(struct v4l2_subdev *sd, u16 reg, u32 val, in saa7706h_set_reg24_err() argument
162 return *err ? *err : saa7706h_set_reg24(sd, reg, val); in saa7706h_set_reg24_err()
165 static int saa7706h_set_reg16(struct v4l2_subdev *sd, u16 reg, u16 val) in saa7706h_set_reg16() argument
167 struct i2c_client *client = v4l2_get_subdevdata(sd); in saa7706h_set_reg16()
179 static int saa7706h_set_reg16_err(struct v4l2_subdev *sd, u16 reg, u16 val, in saa7706h_set_reg16_err() argument
182 return *err ? *err : saa7706h_set_reg16(sd, reg, val); in saa7706h_set_reg16_err()
185 static int saa7706h_get_reg16(struct v4l2_subdev *sd, u16 reg) in saa7706h_get_reg16() argument
187 struct i2c_client *client = v4l2_get_subdevdata(sd); in saa7706h_get_reg16()
212 static int saa7706h_unmute(struct v4l2_subdev *sd) in saa7706h_unmute() argument
214 struct saa7706h_state *state = to_state(sd); in saa7706h_unmute()
217 err = saa7706h_set_reg16_err(sd, SAA7706H_REG_CTRL, in saa7706h_unmute()
224 err = saa7706h_set_reg16_err(sd, SAA7706H_REG_CTRL, in saa7706h_unmute()
227 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_EVALUATION, 0, &err); in saa7706h_unmute()
229 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_CL_GEN1, 0x040022, &err); in saa7706h_unmute()
231 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_CL_GEN2, in saa7706h_unmute()
234 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_CL_GEN4, 0x024080, &err); in saa7706h_unmute()
236 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_SEL, 0x200080, &err); in saa7706h_unmute()
238 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_IAC, 0xf4caed, &err); in saa7706h_unmute()
240 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_CLK_SET, 0x124334, &err); in saa7706h_unmute()
242 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_CLK_COEFF, 0x004a1a, in saa7706h_unmute()
245 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_INPUT_SENS, 0x0071c7, in saa7706h_unmute()
248 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_PHONE_NAV_AUDIO, in saa7706h_unmute()
251 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_IO_CONF_DSP2, 0x001ff8, in saa7706h_unmute()
254 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_STATUS_DSP2, 0x080003, in saa7706h_unmute()
257 err = saa7706h_set_reg24_err(sd, SAA7706H_REG_PC_DSP2, 0x000004, &err); in saa7706h_unmute()
259 err = saa7706h_set_reg16_err(sd, SAA7706H_DSP1_MOD0, 0x0c6c, &err); in saa7706h_unmute()
261 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_MPTR0, 0x000b4b, &err); in saa7706h_unmute()
263 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP1_MODPNTR, 0x000600, &err); in saa7706h_unmute()
265 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP1_MODPNTR, 0x0000c0, &err); in saa7706h_unmute()
267 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_CONTLLCW, 0x000819, in saa7706h_unmute()
270 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_CONTLLCW, 0x00085a, in saa7706h_unmute()
273 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_BUSAMP, 0x7fffff, in saa7706h_unmute()
276 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_FDACPNTR, 0x2000cb, in saa7706h_unmute()
279 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_IIS1PNTR, 0x2000cb, in saa7706h_unmute()
282 err = saa7706h_set_reg16_err(sd, SAA7706H_DSP2_YMEM_PVGA, 0x0f80, &err); in saa7706h_unmute()
284 err = saa7706h_set_reg16_err(sd, SAA7706H_DSP2_YMEM_PVAT1, 0x0800, in saa7706h_unmute()
287 err = saa7706h_set_reg16_err(sd, SAA7706H_DSP2_YMEM_PVAT, 0x0800, &err); in saa7706h_unmute()
289 err = saa7706h_set_reg24_err(sd, SAA7706H_DSP2_XMEM_CONTLLCW, 0x000905, in saa7706h_unmute()
296 static int saa7706h_mute(struct v4l2_subdev *sd) in saa7706h_mute() argument
298 struct saa7706h_state *state = to_state(sd); in saa7706h_mute()
301 err = saa7706h_set_reg16(sd, SAA7706H_REG_CTRL, in saa7706h_mute()
317 return saa7706h_mute(&state->sd); in saa7706h_s_ctrl()
318 return saa7706h_unmute(&state->sd); in saa7706h_s_ctrl()
337 struct v4l2_subdev *sd; in saa7706h_probe() local
350 sd = &state->sd; in saa7706h_probe()
351 v4l2_i2c_subdev_init(sd, client, &empty_ops); in saa7706h_probe()
356 sd->ctrl_handler = &state->hdl; in saa7706h_probe()
362 err = saa7706h_get_reg16(sd, SAA7706H_DSP1_ROM_VER); in saa7706h_probe()
366 v4l2_warn(sd, "Unknown DSP1 ROM code version: 0x%x\n", err); in saa7706h_probe()
370 err = saa7706h_mute(sd); in saa7706h_probe()
377 v4l2_device_unregister_subdev(sd); in saa7706h_probe()
379 kfree(to_state(sd)); in saa7706h_probe()
388 struct v4l2_subdev *sd = i2c_get_clientdata(client); in saa7706h_remove() local
389 struct saa7706h_state *state = to_state(sd); in saa7706h_remove()
391 saa7706h_mute(sd); in saa7706h_remove()
392 v4l2_device_unregister_subdev(sd); in saa7706h_remove()
394 kfree(to_state(sd)); in saa7706h_remove()