Lines Matching full:cx

13 static int set_audclk_freq(struct cx18 *cx, u32 freq)  in set_audclk_freq()  argument
15 struct cx18_av_state *state = &cx->av_state; in set_audclk_freq()
63 cx18_av_write4(cx, 0x108, 0x200d040f); in set_audclk_freq()
67 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
71 cx18_av_write4(cx, 0x110, 0x0176740c); in set_audclk_freq()
75 cx18_av_write4(cx, 0x900, 0x0801f77f); in set_audclk_freq()
76 cx18_av_write4(cx, 0x904, 0x0801f77f); in set_audclk_freq()
77 cx18_av_write4(cx, 0x90c, 0x0801f77f); in set_audclk_freq()
80 cx18_av_write(cx, 0x127, 0x60); in set_audclk_freq()
83 cx18_av_write4(cx, 0x12c, 0x11202fff); in set_audclk_freq()
90 cx18_av_write4(cx, 0x128, 0xa00d2ef8); in set_audclk_freq()
98 cx18_av_write4(cx, 0x108, 0x180e040f); in set_audclk_freq()
102 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
106 cx18_av_write4(cx, 0x110, 0x0062a1f2); in set_audclk_freq()
110 cx18_av_write4(cx, 0x900, 0x08016d59); in set_audclk_freq()
111 cx18_av_write4(cx, 0x904, 0x08016d59); in set_audclk_freq()
112 cx18_av_write4(cx, 0x90c, 0x08016d59); in set_audclk_freq()
115 cx18_av_write(cx, 0x127, 0x58); in set_audclk_freq()
118 cx18_av_write4(cx, 0x12c, 0x112092ff); in set_audclk_freq()
125 cx18_av_write4(cx, 0x128, 0xa01d4bf8); in set_audclk_freq()
133 cx18_av_write4(cx, 0x108, 0x160e040f); in set_audclk_freq()
137 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
141 cx18_av_write4(cx, 0x110, 0x005227ad); in set_audclk_freq()
145 cx18_av_write4(cx, 0x900, 0x08014faa); in set_audclk_freq()
146 cx18_av_write4(cx, 0x904, 0x08014faa); in set_audclk_freq()
147 cx18_av_write4(cx, 0x90c, 0x08014faa); in set_audclk_freq()
150 cx18_av_write(cx, 0x127, 0x56); in set_audclk_freq()
153 cx18_av_write4(cx, 0x12c, 0x11205fff); in set_audclk_freq()
160 cx18_av_write4(cx, 0x128, 0xa01193f8); in set_audclk_freq()
170 cx18_av_write4(cx, 0x108, 0x300d040f); in set_audclk_freq()
174 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
178 cx18_av_write4(cx, 0x110, 0x0176740c); in set_audclk_freq()
182 cx18_av_write4(cx, 0x8f8, 0x08010000); in set_audclk_freq()
186 cx18_av_write4(cx, 0x900, 0x08020000); in set_audclk_freq()
187 cx18_av_write4(cx, 0x904, 0x08020000); in set_audclk_freq()
188 cx18_av_write4(cx, 0x90c, 0x08020000); in set_audclk_freq()
191 cx18_av_write(cx, 0x127, 0x70); in set_audclk_freq()
194 cx18_av_write4(cx, 0x12c, 0x11201fff); in set_audclk_freq()
201 cx18_av_write4(cx, 0x128, 0xa00d2ef8); in set_audclk_freq()
209 cx18_av_write4(cx, 0x108, 0x240e040f); in set_audclk_freq()
213 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
217 cx18_av_write4(cx, 0x110, 0x0062a1f2); in set_audclk_freq()
221 cx18_av_write4(cx, 0x8f8, 0x080160cd); in set_audclk_freq()
225 cx18_av_write4(cx, 0x900, 0x08017385); in set_audclk_freq()
226 cx18_av_write4(cx, 0x904, 0x08017385); in set_audclk_freq()
227 cx18_av_write4(cx, 0x90c, 0x08017385); in set_audclk_freq()
230 cx18_av_write(cx, 0x127, 0x64); in set_audclk_freq()
233 cx18_av_write4(cx, 0x12c, 0x112061ff); in set_audclk_freq()
240 cx18_av_write4(cx, 0x128, 0xa01d4bf8); in set_audclk_freq()
248 cx18_av_write4(cx, 0x108, 0x200d040f); in set_audclk_freq()
252 cx18_av_write4(cx, 0x10c, 0x002be2fe); in set_audclk_freq()
256 cx18_av_write4(cx, 0x110, 0x0176740c); in set_audclk_freq()
260 cx18_av_write4(cx, 0x8f8, 0x08018000); in set_audclk_freq()
264 cx18_av_write4(cx, 0x900, 0x08015555); in set_audclk_freq()
265 cx18_av_write4(cx, 0x904, 0x08015555); in set_audclk_freq()
266 cx18_av_write4(cx, 0x90c, 0x08015555); in set_audclk_freq()
269 cx18_av_write(cx, 0x127, 0x60); in set_audclk_freq()
272 cx18_av_write4(cx, 0x12c, 0x11203fff); in set_audclk_freq()
279 cx18_av_write4(cx, 0x128, 0xa01193f8); in set_audclk_freq()
289 void cx18_av_audio_set_path(struct cx18 *cx) in cx18_av_audio_set_path() argument
291 struct cx18_av_state *state = &cx->av_state; in cx18_av_audio_set_path()
295 v = cx18_av_read(cx, 0x803) & ~0x10; in cx18_av_audio_set_path()
296 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in cx18_av_audio_set_path()
299 v = cx18_av_read(cx, 0x810) | 0x01; in cx18_av_audio_set_path()
300 cx18_av_write_expect(cx, 0x810, v, v, 0x0f); in cx18_av_audio_set_path()
303 cx18_av_write(cx, 0x8d3, 0x1f); in cx18_av_audio_set_path()
307 cx18_av_write4(cx, 0x8d0, 0x01011012); in cx18_av_audio_set_path()
314 cx18_av_write4(cx, 0x8d0, 0x1f063870); in cx18_av_audio_set_path()
317 set_audclk_freq(cx, state->audclk_freq); in cx18_av_audio_set_path()
320 v = cx18_av_read(cx, 0x810) & ~0x01; in cx18_av_audio_set_path()
321 cx18_av_write_expect(cx, 0x810, v, v, 0x0f); in cx18_av_audio_set_path()
326 v = cx18_av_read(cx, 0x803) | 0x10; in cx18_av_audio_set_path()
327 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in cx18_av_audio_set_path()
331 static void set_volume(struct cx18 *cx, int volume) in set_volume() argument
344 cx18_av_write(cx, 0x8d4, 228 - (vol * 2)); in set_volume()
347 static void set_bass(struct cx18 *cx, int bass) in set_bass() argument
350 cx18_av_and_or(cx, 0x8d9, ~0x3f, 48 - (bass * 48 / 0xffff)); in set_bass()
353 static void set_treble(struct cx18 *cx, int treble) in set_treble() argument
356 cx18_av_and_or(cx, 0x8db, ~0x3f, 48 - (treble * 48 / 0xffff)); in set_treble()
359 static void set_balance(struct cx18 *cx, int balance) in set_balance() argument
364 cx18_av_and_or(cx, 0x8d5, 0x7f, 0x80); in set_balance()
366 cx18_av_and_or(cx, 0x8d5, ~0x7f, bal & 0x7f); in set_balance()
369 cx18_av_and_or(cx, 0x8d5, 0x7f, 0x00); in set_balance()
371 cx18_av_and_or(cx, 0x8d5, ~0x7f, 0x80 - bal); in set_balance()
375 static void set_mute(struct cx18 *cx, int mute) in set_mute() argument
377 struct cx18_av_state *state = &cx->av_state; in set_mute()
385 v = cx18_av_read(cx, 0x803); in set_mute()
389 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in set_mute()
390 cx18_av_write(cx, 0x8d3, 0x1f); in set_mute()
394 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in set_mute()
398 cx18_av_and_or(cx, 0x8d3, ~0x2, mute ? 0x02 : 0x00); in set_mute()
404 struct cx18 *cx = v4l2_get_subdevdata(sd); in cx18_av_s_clock_freq() local
405 struct cx18_av_state *state = &cx->av_state; in cx18_av_s_clock_freq()
410 v = cx18_av_read(cx, 0x803) & ~0x10; in cx18_av_s_clock_freq()
411 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in cx18_av_s_clock_freq()
412 cx18_av_write(cx, 0x8d3, 0x1f); in cx18_av_s_clock_freq()
414 v = cx18_av_read(cx, 0x810) | 0x1; in cx18_av_s_clock_freq()
415 cx18_av_write_expect(cx, 0x810, v, v, 0x0f); in cx18_av_s_clock_freq()
417 retval = set_audclk_freq(cx, freq); in cx18_av_s_clock_freq()
419 v = cx18_av_read(cx, 0x810) & ~0x1; in cx18_av_s_clock_freq()
420 cx18_av_write_expect(cx, 0x810, v, v, 0x0f); in cx18_av_s_clock_freq()
422 v = cx18_av_read(cx, 0x803) | 0x10; in cx18_av_s_clock_freq()
423 cx18_av_write_expect(cx, 0x803, v, v, 0x1f); in cx18_av_s_clock_freq()
431 struct cx18 *cx = v4l2_get_subdevdata(sd); in cx18_av_audio_s_ctrl() local
435 set_volume(cx, ctrl->val); in cx18_av_audio_s_ctrl()
438 set_bass(cx, ctrl->val); in cx18_av_audio_s_ctrl()
441 set_treble(cx, ctrl->val); in cx18_av_audio_s_ctrl()
444 set_balance(cx, ctrl->val); in cx18_av_audio_s_ctrl()
447 set_mute(cx, ctrl->val); in cx18_av_audio_s_ctrl()