19 #include <linux/videodev2.h>
20 #include <linux/i2c.h>
78 if (is_cx2583x(state))
115 if (is_cx2583x(state))
152 if (is_cx2583x(state))
191 if (is_cx2583x(state))
232 if (is_cx2583x(state))
273 if (is_cx2583x(state))
294 static inline int cx25836_set_audclk_freq(
struct i2c_client *client,
u32 freq)
296 return cx25840_set_audclk_freq(client, freq);
299 static int cx23885_set_audclk_freq(
struct i2c_client *client,
u32 freq)
301 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
341 static int cx231xx_set_audclk_freq(
struct i2c_client *client,
u32 freq)
343 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
417 static int set_audclk_freq(
struct i2c_client *client,
u32 freq)
419 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
421 if (freq != 32000 && freq != 44100 && freq != 48000)
424 if (is_cx231xx(state))
425 return cx231xx_set_audclk_freq(client, freq);
427 if (is_cx2388x(state))
428 return cx23885_set_audclk_freq(client, freq);
430 if (is_cx2583x(state))
431 return cx25836_set_audclk_freq(client, freq);
433 return cx25840_set_audclk_freq(client, freq);
438 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
440 if (!is_cx2583x(state)) {
465 if (!is_cx2583x(state)) {
476 if (is_cx2388x(state) || is_cx231xx(state))
501 static void set_balance(
struct i2c_client *client,
int balance)
503 int bal = balance >> 8;
519 struct i2c_client *client = v4l2_get_subdevdata(sd);
523 if (!is_cx2583x(state))
529 retval = set_audclk_freq(client, freq);
532 if (!is_cx2583x(state))
541 struct i2c_client *client = v4l2_get_subdevdata(sd);
545 if (state->
mute->val)
546 set_volume(client, 0);
548 set_volume(client, state->
volume->val);
553 48 - (ctrl->
val * 48 / 0xffff));
558 48 - (ctrl->
val * 48 / 0xffff));
561 set_balance(client, ctrl->
val);
570 .s_ctrl = cx25840_audio_s_ctrl,