diff options
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-audio.c')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-audio.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c index 740908f8027d..6c44bd9c1704 100644 --- a/drivers/media/video/cx25840/cx25840-audio.c +++ b/drivers/media/video/cx25840/cx25840-audio.c | |||
@@ -23,11 +23,13 @@ | |||
23 | 23 | ||
24 | #include "cx25840.h" | 24 | #include "cx25840.h" |
25 | 25 | ||
26 | inline static int set_audclk_freq(struct i2c_client *client, | 26 | static int set_audclk_freq(struct i2c_client *client, u32 freq) |
27 | enum v4l2_audio_clock_freq freq) | ||
28 | { | 27 | { |
29 | struct cx25840_state *state = i2c_get_clientdata(client); | 28 | struct cx25840_state *state = i2c_get_clientdata(client); |
30 | 29 | ||
30 | if (freq != 32000 && freq != 44100 && freq != 48000) | ||
31 | return -EINVAL; | ||
32 | |||
31 | /* assert soft reset */ | 33 | /* assert soft reset */ |
32 | cx25840_and_or(client, 0x810, ~0x1, 0x01); | 34 | cx25840_and_or(client, 0x810, ~0x1, 0x01); |
33 | 35 | ||
@@ -38,7 +40,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
38 | switch (state->audio_input) { | 40 | switch (state->audio_input) { |
39 | case AUDIO_TUNER: | 41 | case AUDIO_TUNER: |
40 | switch (freq) { | 42 | switch (freq) { |
41 | case V4L2_AUDCLK_32_KHZ: | 43 | case 32000: |
42 | /* VID_PLL and AUX_PLL */ | 44 | /* VID_PLL and AUX_PLL */ |
43 | cx25840_write4(client, 0x108, 0x0f040610); | 45 | cx25840_write4(client, 0x108, 0x0f040610); |
44 | 46 | ||
@@ -51,7 +53,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
51 | cx25840_write4(client, 0x90c, 0x7ff70108); | 53 | cx25840_write4(client, 0x90c, 0x7ff70108); |
52 | break; | 54 | break; |
53 | 55 | ||
54 | case V4L2_AUDCLK_441_KHZ: | 56 | case 44100: |
55 | /* VID_PLL and AUX_PLL */ | 57 | /* VID_PLL and AUX_PLL */ |
56 | cx25840_write4(client, 0x108, 0x0f040910); | 58 | cx25840_write4(client, 0x108, 0x0f040910); |
57 | 59 | ||
@@ -64,7 +66,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
64 | cx25840_write4(client, 0x90c, 0x596d0108); | 66 | cx25840_write4(client, 0x90c, 0x596d0108); |
65 | break; | 67 | break; |
66 | 68 | ||
67 | case V4L2_AUDCLK_48_KHZ: | 69 | case 48000: |
68 | /* VID_PLL and AUX_PLL */ | 70 | /* VID_PLL and AUX_PLL */ |
69 | cx25840_write4(client, 0x108, 0x0f040a10); | 71 | cx25840_write4(client, 0x108, 0x0f040a10); |
70 | 72 | ||
@@ -84,7 +86,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
84 | case AUDIO_INTERN: | 86 | case AUDIO_INTERN: |
85 | case AUDIO_RADIO: | 87 | case AUDIO_RADIO: |
86 | switch (freq) { | 88 | switch (freq) { |
87 | case V4L2_AUDCLK_32_KHZ: | 89 | case 32000: |
88 | /* VID_PLL and AUX_PLL */ | 90 | /* VID_PLL and AUX_PLL */ |
89 | cx25840_write4(client, 0x108, 0x0f04081e); | 91 | cx25840_write4(client, 0x108, 0x0f04081e); |
90 | 92 | ||
@@ -103,7 +105,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
103 | cx25840_write(client, 0x127, 0x54); | 105 | cx25840_write(client, 0x127, 0x54); |
104 | break; | 106 | break; |
105 | 107 | ||
106 | case V4L2_AUDCLK_441_KHZ: | 108 | case 44100: |
107 | /* VID_PLL and AUX_PLL */ | 109 | /* VID_PLL and AUX_PLL */ |
108 | cx25840_write4(client, 0x108, 0x0f040918); | 110 | cx25840_write4(client, 0x108, 0x0f040918); |
109 | 111 | ||
@@ -119,7 +121,7 @@ inline static int set_audclk_freq(struct i2c_client *client, | |||
119 | cx25840_write4(client, 0x90c, 0x85730108); | 121 | cx25840_write4(client, 0x90c, 0x85730108); |
120 | break; | 122 | break; |
121 | 123 | ||
122 | case V4L2_AUDCLK_48_KHZ: | 124 | case 48000: |
123 | /* VID_PLL and AUX_PLL */ | 125 | /* VID_PLL and AUX_PLL */ |
124 | cx25840_write4(client, 0x108, 0x0f040a18); | 126 | cx25840_write4(client, 0x108, 0x0f040a18); |
125 | 127 | ||
@@ -317,7 +319,7 @@ int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg) | |||
317 | case AUDC_SET_INPUT: | 319 | case AUDC_SET_INPUT: |
318 | return set_input(client, *(int *)arg); | 320 | return set_input(client, *(int *)arg); |
319 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: | 321 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: |
320 | return set_audclk_freq(client, *(enum v4l2_audio_clock_freq *)arg); | 322 | return set_audclk_freq(client, *(u32 *)arg); |
321 | case VIDIOC_G_CTRL: | 323 | case VIDIOC_G_CTRL: |
322 | switch (ctrl->id) { | 324 | switch (ctrl->id) { |
323 | case V4L2_CID_AUDIO_VOLUME: | 325 | case V4L2_CID_AUDIO_VOLUME: |