diff options
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-audio.c')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-audio.c | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c index 93d74bee292a..d2faeaa79759 100644 --- a/drivers/media/video/cx25840/cx25840-audio.c +++ b/drivers/media/video/cx25840/cx25840-audio.c | |||
@@ -32,7 +32,7 @@ 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 | if (!state->is_cx23885) | 35 | if (!state->is_cx23885 && !state->is_cx231xx) |
36 | cx25840_write(client, 0x127, 0x50); | 36 | cx25840_write(client, 0x127, 0x50); |
37 | 37 | ||
38 | if (state->aud_input != CX25840_AUDIO_SERIAL) { | 38 | if (state->aud_input != CX25840_AUDIO_SERIAL) { |
@@ -43,11 +43,15 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
43 | * so avoid destroying registers. */ | 43 | * so avoid destroying registers. */ |
44 | break; | 44 | break; |
45 | } | 45 | } |
46 | /* VID_PLL and AUX_PLL */ | ||
47 | cx25840_write4(client, 0x108, 0x1006040f); | ||
48 | 46 | ||
49 | /* AUX_PLL_FRAC */ | 47 | if (!state->is_cx231xx) { |
50 | cx25840_write4(client, 0x110, 0x01bb39ee); | 48 | |
49 | /* VID_PLL and AUX_PLL */ | ||
50 | cx25840_write4(client, 0x108, 0x1006040f); | ||
51 | |||
52 | /* AUX_PLL_FRAC */ | ||
53 | cx25840_write4(client, 0x110, 0x01bb39ee); | ||
54 | } | ||
51 | 55 | ||
52 | if (state->is_cx25836) | 56 | if (state->is_cx25836) |
53 | break; | 57 | break; |
@@ -64,11 +68,15 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
64 | * so avoid destroying registers. */ | 68 | * so avoid destroying registers. */ |
65 | break; | 69 | break; |
66 | } | 70 | } |
67 | /* VID_PLL and AUX_PLL */ | ||
68 | cx25840_write4(client, 0x108, 0x1009040f); | ||
69 | 71 | ||
70 | /* AUX_PLL_FRAC */ | 72 | if (!state->is_cx231xx) { |
71 | cx25840_write4(client, 0x110, 0x00ec6bd6); | 73 | |
74 | /* VID_PLL and AUX_PLL */ | ||
75 | cx25840_write4(client, 0x108, 0x1009040f); | ||
76 | |||
77 | /* AUX_PLL_FRAC */ | ||
78 | cx25840_write4(client, 0x110, 0x00ec6bd6); | ||
79 | } | ||
72 | 80 | ||
73 | if (state->is_cx25836) | 81 | if (state->is_cx25836) |
74 | break; | 82 | break; |
@@ -85,11 +93,15 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
85 | * so avoid destroying registers. */ | 93 | * so avoid destroying registers. */ |
86 | break; | 94 | break; |
87 | } | 95 | } |
96 | |||
97 | if (!state->is_cx231xx) { | ||
98 | |||
88 | /* VID_PLL and AUX_PLL */ | 99 | /* VID_PLL and AUX_PLL */ |
89 | cx25840_write4(client, 0x108, 0x100a040f); | 100 | cx25840_write4(client, 0x108, 0x100a040f); |
90 | 101 | ||
91 | /* AUX_PLL_FRAC */ | 102 | /* AUX_PLL_FRAC */ |
92 | cx25840_write4(client, 0x110, 0x0098d6e5); | 103 | cx25840_write4(client, 0x110, 0x0098d6e5); |
104 | } | ||
93 | 105 | ||
94 | if (state->is_cx25836) | 106 | if (state->is_cx25836) |
95 | break; | 107 | break; |
@@ -108,11 +120,15 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
108 | * so avoid destroying registers. */ | 120 | * so avoid destroying registers. */ |
109 | break; | 121 | break; |
110 | } | 122 | } |
123 | |||
124 | if (!state->is_cx231xx) { | ||
125 | |||
111 | /* VID_PLL and AUX_PLL */ | 126 | /* VID_PLL and AUX_PLL */ |
112 | cx25840_write4(client, 0x108, 0x1e08040f); | 127 | cx25840_write4(client, 0x108, 0x1e08040f); |
113 | 128 | ||
114 | /* AUX_PLL_FRAC */ | 129 | /* AUX_PLL_FRAC */ |
115 | cx25840_write4(client, 0x110, 0x012a0869); | 130 | cx25840_write4(client, 0x110, 0x012a0869); |
131 | } | ||
116 | 132 | ||
117 | if (state->is_cx25836) | 133 | if (state->is_cx25836) |
118 | break; | 134 | break; |
@@ -136,11 +152,15 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
136 | break; | 152 | break; |
137 | } | 153 | } |
138 | 154 | ||
155 | |||
156 | if (!state->is_cx231xx) { | ||
157 | |||
139 | /* VID_PLL and AUX_PLL */ | 158 | /* VID_PLL and AUX_PLL */ |
140 | cx25840_write4(client, 0x108, 0x1809040f); | 159 | cx25840_write4(client, 0x108, 0x1809040f); |
141 | 160 | ||
142 | /* AUX_PLL_FRAC */ | 161 | /* AUX_PLL_FRAC */ |
143 | cx25840_write4(client, 0x110, 0x00ec6bd6); | 162 | cx25840_write4(client, 0x110, 0x00ec6bd6); |
163 | } | ||
144 | 164 | ||
145 | if (state->is_cx25836) | 165 | if (state->is_cx25836) |
146 | break; | 166 | break; |
@@ -155,7 +175,7 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
155 | break; | 175 | break; |
156 | 176 | ||
157 | case 48000: | 177 | case 48000: |
158 | if (!state->is_cx23885) { | 178 | if (!state->is_cx23885 && !state->is_cx231xx) { |
159 | /* VID_PLL and AUX_PLL */ | 179 | /* VID_PLL and AUX_PLL */ |
160 | cx25840_write4(client, 0x108, 0x180a040f); | 180 | cx25840_write4(client, 0x108, 0x180a040f); |
161 | 181 | ||
@@ -166,7 +186,7 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq) | |||
166 | if (state->is_cx25836) | 186 | if (state->is_cx25836) |
167 | break; | 187 | break; |
168 | 188 | ||
169 | if (!state->is_cx23885) { | 189 | if (!state->is_cx23885 && !state->is_cx231xx) { |
170 | /* src1_ctl */ | 190 | /* src1_ctl */ |
171 | cx25840_write4(client, 0x8f8, 0x08018000); | 191 | cx25840_write4(client, 0x8f8, 0x08018000); |
172 | 192 | ||
@@ -227,7 +247,7 @@ void cx25840_audio_set_path(struct i2c_client *client) | |||
227 | /* deassert soft reset */ | 247 | /* deassert soft reset */ |
228 | cx25840_and_or(client, 0x810, ~0x1, 0x00); | 248 | cx25840_and_or(client, 0x810, ~0x1, 0x00); |
229 | 249 | ||
230 | if (state->is_cx23885) { | 250 | if (state->is_cx23885 || state->is_cx231xx) { |
231 | /* Ensure the controller is running when we exit */ | 251 | /* Ensure the controller is running when we exit */ |
232 | cx25840_and_or(client, 0x803, ~0x10, 0x10); | 252 | cx25840_and_or(client, 0x803, ~0x10, 0x10); |
233 | } | 253 | } |