diff options
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-audio.c')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-audio.c | 65 |
1 files changed, 54 insertions, 11 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c index 51fc0af01578..d6421e1e8f6a 100644 --- a/drivers/media/video/cx25840/cx25840-audio.c +++ b/drivers/media/video/cx25840/cx25840-audio.c | |||
@@ -32,11 +32,17 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
32 | 32 | ||
33 | /* common for all inputs and rates */ | 33 | /* common for all inputs and rates */ |
34 | /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ | 34 | /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ |
35 | cx25840_write(client, 0x127, 0x50); | 35 | if (!state->is_cx23885) |
36 | cx25840_write(client, 0x127, 0x50); | ||
36 | 37 | ||
37 | if (state->aud_input != CX25840_AUDIO_SERIAL) { | 38 | if (state->aud_input != CX25840_AUDIO_SERIAL) { |
38 | switch (freq) { | 39 | switch (freq) { |
39 | case 32000: | 40 | case 32000: |
41 | if (state->is_cx23885) { | ||
42 | /* We don't have register values | ||
43 | * so avoid destroying registers. */ | ||
44 | break; | ||
45 | } | ||
40 | /* VID_PLL and AUX_PLL */ | 46 | /* VID_PLL and AUX_PLL */ |
41 | cx25840_write4(client, 0x108, 0x1006040f); | 47 | cx25840_write4(client, 0x108, 0x1006040f); |
42 | 48 | ||
@@ -53,6 +59,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
53 | break; | 59 | break; |
54 | 60 | ||
55 | case 44100: | 61 | case 44100: |
62 | if (state->is_cx23885) { | ||
63 | /* We don't have register values | ||
64 | * so avoid destroying registers. */ | ||
65 | break; | ||
66 | } | ||
56 | /* VID_PLL and AUX_PLL */ | 67 | /* VID_PLL and AUX_PLL */ |
57 | cx25840_write4(client, 0x108, 0x1009040f); | 68 | cx25840_write4(client, 0x108, 0x1009040f); |
58 | 69 | ||
@@ -69,6 +80,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
69 | break; | 80 | break; |
70 | 81 | ||
71 | case 48000: | 82 | case 48000: |
83 | if (state->is_cx23885) { | ||
84 | /* We don't have register values | ||
85 | * so avoid destroying registers. */ | ||
86 | break; | ||
87 | } | ||
72 | /* VID_PLL and AUX_PLL */ | 88 | /* VID_PLL and AUX_PLL */ |
73 | cx25840_write4(client, 0x108, 0x100a040f); | 89 | cx25840_write4(client, 0x108, 0x100a040f); |
74 | 90 | ||
@@ -87,6 +103,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
87 | } else { | 103 | } else { |
88 | switch (freq) { | 104 | switch (freq) { |
89 | case 32000: | 105 | case 32000: |
106 | if (state->is_cx23885) { | ||
107 | /* We don't have register values | ||
108 | * so avoid destroying registers. */ | ||
109 | break; | ||
110 | } | ||
90 | /* VID_PLL and AUX_PLL */ | 111 | /* VID_PLL and AUX_PLL */ |
91 | cx25840_write4(client, 0x108, 0x1e08040f); | 112 | cx25840_write4(client, 0x108, 0x1e08040f); |
92 | 113 | ||
@@ -109,6 +130,12 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
109 | break; | 130 | break; |
110 | 131 | ||
111 | case 44100: | 132 | case 44100: |
133 | if (state->is_cx23885) { | ||
134 | /* We don't have register values | ||
135 | * so avoid destroying registers. */ | ||
136 | break; | ||
137 | } | ||
138 | |||
112 | /* VID_PLL and AUX_PLL */ | 139 | /* VID_PLL and AUX_PLL */ |
113 | cx25840_write4(client, 0x108, 0x1809040f); | 140 | cx25840_write4(client, 0x108, 0x1809040f); |
114 | 141 | ||
@@ -128,22 +155,33 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
128 | break; | 155 | break; |
129 | 156 | ||
130 | case 48000: | 157 | case 48000: |
131 | /* VID_PLL and AUX_PLL */ | 158 | if (!state->is_cx23885) { |
132 | cx25840_write4(client, 0x108, 0x180a040f); | 159 | /* VID_PLL and AUX_PLL */ |
160 | cx25840_write4(client, 0x108, 0x180a040f); | ||
133 | 161 | ||
134 | /* AUX_PLL_FRAC */ | 162 | /* AUX_PLL_FRAC */ |
135 | cx25840_write4(client, 0x110, 0x0098d6e5); | 163 | cx25840_write4(client, 0x110, 0x0098d6e5); |
164 | } | ||
136 | 165 | ||
137 | if (state->is_cx25836) | 166 | if (state->is_cx25836) |
138 | break; | 167 | break; |
139 | 168 | ||
140 | /* src1_ctl = 0x08010000 */ | 169 | if (!state->is_cx23885) { |
141 | cx25840_write4(client, 0x8f8, 0x08018000); | 170 | /* src1_ctl */ |
171 | cx25840_write4(client, 0x8f8, 0x08018000); | ||
142 | 172 | ||
143 | /* src3/4/6_ctl = 0x08020000 */ | 173 | /* src3/4/6_ctl */ |
144 | cx25840_write4(client, 0x900, 0x08015555); | 174 | cx25840_write4(client, 0x900, 0x08015555); |
145 | cx25840_write4(client, 0x904, 0x08015555); | 175 | cx25840_write4(client, 0x904, 0x08015555); |
146 | cx25840_write4(client, 0x90c, 0x08015555); | 176 | cx25840_write4(client, 0x90c, 0x08015555); |
177 | } else { | ||
178 | |||
179 | cx25840_write4(client, 0x8f8, 0x0801867c); | ||
180 | |||
181 | cx25840_write4(client, 0x900, 0x08014faa); | ||
182 | cx25840_write4(client, 0x904, 0x08014faa); | ||
183 | cx25840_write4(client, 0x90c, 0x08014faa); | ||
184 | } | ||
147 | break; | 185 | break; |
148 | } | 186 | } |
149 | } | 187 | } |
@@ -188,6 +226,11 @@ void cx25840_audio_set_path(struct i2c_client *client) | |||
188 | 226 | ||
189 | /* deassert soft reset */ | 227 | /* deassert soft reset */ |
190 | cx25840_and_or(client, 0x810, ~0x1, 0x00); | 228 | cx25840_and_or(client, 0x810, ~0x1, 0x00); |
229 | |||
230 | if (state->is_cx23885) { | ||
231 | /* Ensure the controller is running when we exit */ | ||
232 | cx25840_and_or(client, 0x803, ~0x10, 0x10); | ||
233 | } | ||
191 | } | 234 | } |
192 | 235 | ||
193 | static int get_volume(struct i2c_client *client) | 236 | static int get_volume(struct i2c_client *client) |