26 #include <linux/module.h>
27 #include <linux/types.h>
28 #include <linux/slab.h>
30 #include <asm/uaccess.h>
31 #include <linux/i2c.h>
32 #include <linux/videodev2.h>
64 v4l2_err(sd,
"Invalid register R%d\n", reg);
68 for (i = 0; i < 3; i++)
70 (reg << 1) | (val >> 8), val & 0xff) == 0)
72 v4l2_err(sd,
"I2C: cannot write %03x to register R%d\n", val, reg);
80 tlv320aic23b_write(sd, 8, 0x018);
83 tlv320aic23b_write(sd, 8, 0x022);
86 tlv320aic23b_write(sd, 8, 0x000);
100 tlv320aic23b_write(sd, 0, 0x180);
103 tlv320aic23b_write(sd, 0, 0x119);
109 static int tlv320aic23b_log_status(
struct v4l2_subdev *sd)
120 .s_ctrl = tlv320aic23b_s_ctrl,
124 .log_status = tlv320aic23b_log_status,
135 .s_clock_freq = tlv320aic23b_s_clock_freq,
139 .core = &tlv320aic23b_core_ops,
140 .audio = &tlv320aic23b_audio_ops,
152 static int tlv320aic23b_probe(
struct i2c_client *client,
162 v4l_info(client,
"chip found @ 0x%x (%s)\n",
174 tlv320aic23b_write(sd, 15, 0x000);
176 tlv320aic23b_write(sd, 6, 0x00A);
178 tlv320aic23b_write(sd, 7, 0x049);
180 tlv320aic23b_write(sd, 0, 0x119);
182 tlv320aic23b_write(sd, 8, 0x000);
184 tlv320aic23b_write(sd, 9, 0x001);
190 if (state->
hdl.error) {
191 int err = state->
hdl.error;
201 static int tlv320aic23b_remove(
struct i2c_client *client)
203 struct v4l2_subdev *sd = i2c_get_clientdata(client);
215 {
"tlv320aic23b", 0 },
220 static struct i2c_driver tlv320aic23b_driver = {
223 .name =
"tlv320aic23b",
225 .probe = tlv320aic23b_probe,
226 .remove = tlv320aic23b_remove,
227 .id_table = tlv320aic23b_id,