cx18-av-audio.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. /*
  2. * cx18 ADEC audio functions
  3. *
  4. * Derived from cx25840-audio.c
  5. *
  6. * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
  7. * Copyright (C) 2008 Andy Walls <awalls@radix.net>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. * 02110-1301, USA.
  23. */
  24. #include "cx18-driver.h"
  25. static int set_audclk_freq(struct cx18 *cx, u32 freq)
  26. {
  27. struct cx18_av_state *state = &cx->av_state;
  28. if (freq != 32000 && freq != 44100 && freq != 48000)
  29. return -EINVAL;
  30. /*
  31. * The PLL parameters are based on the external crystal frequency that
  32. * would ideally be:
  33. *
  34. * NTSC Color subcarrier freq * 8 =
  35. * 4.5 MHz/286 * 455/2 * 8 = 28.63636363... MHz
  36. *
  37. * The accidents of history and rationale that explain from where this
  38. * combination of magic numbers originate can be found in:
  39. *
  40. * [1] Abrahams, I. C., "Choice of Chrominance Subcarrier Frequency in
  41. * the NTSC Standards", Proceedings of the I-R-E, January 1954, pp 79-80
  42. *
  43. * [2] Abrahams, I. C., "The 'Frequency Interleaving' Principle in the
  44. * NTSC Standards", Proceedings of the I-R-E, January 1954, pp 81-83
  45. *
  46. * As Mike Bradley has rightly pointed out, it's not the exact crystal
  47. * frequency that matters, only that all parts of the driver and
  48. * firmware are using the same value (close to the ideal value).
  49. *
  50. * Since I have a strong suspicion that, if the firmware ever assumes a
  51. * crystal value at all, it will assume 28.636360 MHz, the crystal
  52. * freq used in calculations in this driver will be:
  53. *
  54. * xtal_freq = 28.636360 MHz
  55. *
  56. * an error of less than 0.13 ppm which is way, way better than any off
  57. * the shelf crystal will have for accuracy anyway.
  58. *
  59. * Below I aim to run the PLLs' VCOs near 400 MHz to minimze error.
  60. *
  61. * Many thanks to Jeff Campbell and Mike Bradley for their extensive
  62. * investigation, experimentation, testing, and suggested solutions of
  63. * of audio/video sync problems with SVideo and CVBS captures.
  64. */
  65. if (state->aud_input > CX18_AV_AUDIO_SERIAL2) {
  66. switch (freq) {
  67. case 32000:
  68. /*
  69. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  70. * AUX_PLL Integer = 0x0d, AUX PLL Post Divider = 0x20
  71. */
  72. cx18_av_write4(cx, 0x108, 0x200d040f);
  73. /* VID_PLL Fraction = 0x2be2fe */
  74. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  75. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  76. /* AUX_PLL Fraction = 0x176740c */
  77. /* xtal * 0xd.bb3a060/0x20 = 32000 * 384: 393 MHz p-pd*/
  78. cx18_av_write4(cx, 0x110, 0x0176740c);
  79. /* src3/4/6_ctl */
  80. /* 0x1.f77f = (4 * xtal/8*2/455) / 32000 */
  81. cx18_av_write4(cx, 0x900, 0x0801f77f);
  82. cx18_av_write4(cx, 0x904, 0x0801f77f);
  83. cx18_av_write4(cx, 0x90c, 0x0801f77f);
  84. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x20 */
  85. cx18_av_write(cx, 0x127, 0x60);
  86. /* AUD_COUNT = 0x2fff = 8 samples * 4 * 384 - 1 */
  87. cx18_av_write4(cx, 0x12c, 0x11202fff);
  88. /*
  89. * EN_AV_LOCK = 0
  90. * VID_COUNT = 0x0d2ef8 = 107999.000 * 8 =
  91. * ((8 samples/32,000) * (13,500,000 * 8) * 4 - 1) * 8
  92. */
  93. cx18_av_write4(cx, 0x128, 0xa00d2ef8);
  94. break;
  95. case 44100:
  96. /*
  97. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  98. * AUX_PLL Integer = 0x0e, AUX PLL Post Divider = 0x18
  99. */
  100. cx18_av_write4(cx, 0x108, 0x180e040f);
  101. /* VID_PLL Fraction = 0x2be2fe */
  102. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  103. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  104. /* AUX_PLL Fraction = 0x062a1f2 */
  105. /* xtal * 0xe.3150f90/0x18 = 44100 * 384: 406 MHz p-pd*/
  106. cx18_av_write4(cx, 0x110, 0x0062a1f2);
  107. /* src3/4/6_ctl */
  108. /* 0x1.6d59 = (4 * xtal/8*2/455) / 44100 */
  109. cx18_av_write4(cx, 0x900, 0x08016d59);
  110. cx18_av_write4(cx, 0x904, 0x08016d59);
  111. cx18_av_write4(cx, 0x90c, 0x08016d59);
  112. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x18 */
  113. cx18_av_write(cx, 0x127, 0x58);
  114. /* AUD_COUNT = 0x92ff = 49 samples * 2 * 384 - 1 */
  115. cx18_av_write4(cx, 0x12c, 0x112092ff);
  116. /*
  117. * EN_AV_LOCK = 0
  118. * VID_COUNT = 0x1d4bf8 = 239999.000 * 8 =
  119. * ((49 samples/44,100) * (13,500,000 * 8) * 2 - 1) * 8
  120. */
  121. cx18_av_write4(cx, 0x128, 0xa01d4bf8);
  122. break;
  123. case 48000:
  124. /*
  125. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  126. * AUX_PLL Integer = 0x0e, AUX PLL Post Divider = 0x16
  127. */
  128. cx18_av_write4(cx, 0x108, 0x160e040f);
  129. /* VID_PLL Fraction = 0x2be2fe */
  130. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  131. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  132. /* AUX_PLL Fraction = 0x05227ad */
  133. /* xtal * 0xe.2913d68/0x16 = 48000 * 384: 406 MHz p-pd*/
  134. cx18_av_write4(cx, 0x110, 0x005227ad);
  135. /* src3/4/6_ctl */
  136. /* 0x1.4faa = (4 * xtal/8*2/455) / 48000 */
  137. cx18_av_write4(cx, 0x900, 0x08014faa);
  138. cx18_av_write4(cx, 0x904, 0x08014faa);
  139. cx18_av_write4(cx, 0x90c, 0x08014faa);
  140. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x16 */
  141. cx18_av_write(cx, 0x127, 0x56);
  142. /* AUD_COUNT = 0x5fff = 4 samples * 16 * 384 - 1 */
  143. cx18_av_write4(cx, 0x12c, 0x11205fff);
  144. /*
  145. * EN_AV_LOCK = 0
  146. * VID_COUNT = 0x1193f8 = 143999.000 * 8 =
  147. * ((4 samples/48,000) * (13,500,000 * 8) * 16 - 1) * 8
  148. */
  149. cx18_av_write4(cx, 0x128, 0xa01193f8);
  150. break;
  151. }
  152. } else {
  153. switch (freq) {
  154. case 32000:
  155. /*
  156. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  157. * AUX_PLL Integer = 0x0d, AUX PLL Post Divider = 0x30
  158. */
  159. cx18_av_write4(cx, 0x108, 0x300d040f);
  160. /* VID_PLL Fraction = 0x2be2fe */
  161. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  162. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  163. /* AUX_PLL Fraction = 0x176740c */
  164. /* xtal * 0xd.bb3a060/0x30 = 32000 * 256: 393 MHz p-pd*/
  165. cx18_av_write4(cx, 0x110, 0x0176740c);
  166. /* src1_ctl */
  167. /* 0x1.0000 = 32000/32000 */
  168. cx18_av_write4(cx, 0x8f8, 0x08010000);
  169. /* src3/4/6_ctl */
  170. /* 0x2.0000 = 2 * (32000/32000) */
  171. cx18_av_write4(cx, 0x900, 0x08020000);
  172. cx18_av_write4(cx, 0x904, 0x08020000);
  173. cx18_av_write4(cx, 0x90c, 0x08020000);
  174. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x30 */
  175. cx18_av_write(cx, 0x127, 0x70);
  176. /* AUD_COUNT = 0x1fff = 8 samples * 4 * 256 - 1 */
  177. cx18_av_write4(cx, 0x12c, 0x11201fff);
  178. /*
  179. * EN_AV_LOCK = 0
  180. * VID_COUNT = 0x0d2ef8 = 107999.000 * 8 =
  181. * ((8 samples/32,000) * (13,500,000 * 8) * 4 - 1) * 8
  182. */
  183. cx18_av_write4(cx, 0x128, 0xa00d2ef8);
  184. break;
  185. case 44100:
  186. /*
  187. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  188. * AUX_PLL Integer = 0x0e, AUX PLL Post Divider = 0x24
  189. */
  190. cx18_av_write4(cx, 0x108, 0x240e040f);
  191. /* VID_PLL Fraction = 0x2be2fe */
  192. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  193. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  194. /* AUX_PLL Fraction = 0x062a1f2 */
  195. /* xtal * 0xe.3150f90/0x24 = 44100 * 256: 406 MHz p-pd*/
  196. cx18_av_write4(cx, 0x110, 0x0062a1f2);
  197. /* src1_ctl */
  198. /* 0x1.60cd = 44100/32000 */
  199. cx18_av_write4(cx, 0x8f8, 0x080160cd);
  200. /* src3/4/6_ctl */
  201. /* 0x1.7385 = 2 * (32000/44100) */
  202. cx18_av_write4(cx, 0x900, 0x08017385);
  203. cx18_av_write4(cx, 0x904, 0x08017385);
  204. cx18_av_write4(cx, 0x90c, 0x08017385);
  205. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x24 */
  206. cx18_av_write(cx, 0x127, 0x64);
  207. /* AUD_COUNT = 0x61ff = 49 samples * 2 * 256 - 1 */
  208. cx18_av_write4(cx, 0x12c, 0x112061ff);
  209. /*
  210. * EN_AV_LOCK = 0
  211. * VID_COUNT = 0x1d4bf8 = 239999.000 * 8 =
  212. * ((49 samples/44,100) * (13,500,000 * 8) * 2 - 1) * 8
  213. */
  214. cx18_av_write4(cx, 0x128, 0xa01d4bf8);
  215. break;
  216. case 48000:
  217. /*
  218. * VID_PLL Integer = 0x0f, VID_PLL Post Divider = 0x04
  219. * AUX_PLL Integer = 0x0d, AUX PLL Post Divider = 0x20
  220. */
  221. cx18_av_write4(cx, 0x108, 0x200d040f);
  222. /* VID_PLL Fraction = 0x2be2fe */
  223. /* xtal * 0xf.15f17f0/4 = 108 MHz: 432 MHz pre-postdiv*/
  224. cx18_av_write4(cx, 0x10c, 0x002be2fe);
  225. /* AUX_PLL Fraction = 0x176740c */
  226. /* xtal * 0xd.bb3a060/0x20 = 48000 * 256: 393 MHz p-pd*/
  227. cx18_av_write4(cx, 0x110, 0x0176740c);
  228. /* src1_ctl */
  229. /* 0x1.8000 = 48000/32000 */
  230. cx18_av_write4(cx, 0x8f8, 0x08018000);
  231. /* src3/4/6_ctl */
  232. /* 0x1.5555 = 2 * (32000/48000) */
  233. cx18_av_write4(cx, 0x900, 0x08015555);
  234. cx18_av_write4(cx, 0x904, 0x08015555);
  235. cx18_av_write4(cx, 0x90c, 0x08015555);
  236. /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x20 */
  237. cx18_av_write(cx, 0x127, 0x60);
  238. /* AUD_COUNT = 0x3fff = 4 samples * 16 * 256 - 1 */
  239. cx18_av_write4(cx, 0x12c, 0x11203fff);
  240. /*
  241. * EN_AV_LOCK = 0
  242. * VID_COUNT = 0x1193f8 = 143999.000 * 8 =
  243. * ((4 samples/48,000) * (13,500,000 * 8) * 16 - 1) * 8
  244. */
  245. cx18_av_write4(cx, 0x128, 0xa01193f8);
  246. break;
  247. }
  248. }
  249. state->audclk_freq = freq;
  250. return 0;
  251. }
  252. void cx18_av_audio_set_path(struct cx18 *cx)
  253. {
  254. struct cx18_av_state *state = &cx->av_state;
  255. u8 v;
  256. /* stop microcontroller */
  257. v = cx18_av_read(cx, 0x803) & ~0x10;
  258. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  259. /* assert soft reset */
  260. v = cx18_av_read(cx, 0x810) | 0x01;
  261. cx18_av_write_expect(cx, 0x810, v, v, 0x0f);
  262. /* Mute everything to prevent the PFFT! */
  263. cx18_av_write(cx, 0x8d3, 0x1f);
  264. if (state->aud_input <= CX18_AV_AUDIO_SERIAL2) {
  265. /* Set Path1 to Serial Audio Input */
  266. cx18_av_write4(cx, 0x8d0, 0x01011012);
  267. /* The microcontroller should not be started for the
  268. * non-tuner inputs: autodetection is specific for
  269. * TV audio. */
  270. } else {
  271. /* Set Path1 to Analog Demod Main Channel */
  272. cx18_av_write4(cx, 0x8d0, 0x1f063870);
  273. }
  274. set_audclk_freq(cx, state->audclk_freq);
  275. /* deassert soft reset */
  276. v = cx18_av_read(cx, 0x810) & ~0x01;
  277. cx18_av_write_expect(cx, 0x810, v, v, 0x0f);
  278. if (state->aud_input > CX18_AV_AUDIO_SERIAL2) {
  279. /* When the microcontroller detects the
  280. * audio format, it will unmute the lines */
  281. v = cx18_av_read(cx, 0x803) | 0x10;
  282. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  283. }
  284. }
  285. static int get_volume(struct cx18 *cx)
  286. {
  287. /* Volume runs +18dB to -96dB in 1/2dB steps
  288. * change to fit the msp3400 -114dB to +12dB range */
  289. /* check PATH1_VOLUME */
  290. int vol = 228 - cx18_av_read(cx, 0x8d4);
  291. vol = (vol / 2) + 23;
  292. return vol << 9;
  293. }
  294. static void set_volume(struct cx18 *cx, int volume)
  295. {
  296. /* First convert the volume to msp3400 values (0-127) */
  297. int vol = volume >> 9;
  298. /* now scale it up to cx18_av values
  299. * -114dB to -96dB maps to 0
  300. * this should be 19, but in my testing that was 4dB too loud */
  301. if (vol <= 23)
  302. vol = 0;
  303. else
  304. vol -= 23;
  305. /* PATH1_VOLUME */
  306. cx18_av_write(cx, 0x8d4, 228 - (vol * 2));
  307. }
  308. static int get_bass(struct cx18 *cx)
  309. {
  310. /* bass is 49 steps +12dB to -12dB */
  311. /* check PATH1_EQ_BASS_VOL */
  312. int bass = cx18_av_read(cx, 0x8d9) & 0x3f;
  313. bass = (((48 - bass) * 0xffff) + 47) / 48;
  314. return bass;
  315. }
  316. static void set_bass(struct cx18 *cx, int bass)
  317. {
  318. /* PATH1_EQ_BASS_VOL */
  319. cx18_av_and_or(cx, 0x8d9, ~0x3f, 48 - (bass * 48 / 0xffff));
  320. }
  321. static int get_treble(struct cx18 *cx)
  322. {
  323. /* treble is 49 steps +12dB to -12dB */
  324. /* check PATH1_EQ_TREBLE_VOL */
  325. int treble = cx18_av_read(cx, 0x8db) & 0x3f;
  326. treble = (((48 - treble) * 0xffff) + 47) / 48;
  327. return treble;
  328. }
  329. static void set_treble(struct cx18 *cx, int treble)
  330. {
  331. /* PATH1_EQ_TREBLE_VOL */
  332. cx18_av_and_or(cx, 0x8db, ~0x3f, 48 - (treble * 48 / 0xffff));
  333. }
  334. static int get_balance(struct cx18 *cx)
  335. {
  336. /* balance is 7 bit, 0 to -96dB */
  337. /* check PATH1_BAL_LEVEL */
  338. int balance = cx18_av_read(cx, 0x8d5) & 0x7f;
  339. /* check PATH1_BAL_LEFT */
  340. if ((cx18_av_read(cx, 0x8d5) & 0x80) == 0)
  341. balance = 0x80 - balance;
  342. else
  343. balance = 0x80 + balance;
  344. return balance << 8;
  345. }
  346. static void set_balance(struct cx18 *cx, int balance)
  347. {
  348. int bal = balance >> 8;
  349. if (bal > 0x80) {
  350. /* PATH1_BAL_LEFT */
  351. cx18_av_and_or(cx, 0x8d5, 0x7f, 0x80);
  352. /* PATH1_BAL_LEVEL */
  353. cx18_av_and_or(cx, 0x8d5, ~0x7f, bal & 0x7f);
  354. } else {
  355. /* PATH1_BAL_LEFT */
  356. cx18_av_and_or(cx, 0x8d5, 0x7f, 0x00);
  357. /* PATH1_BAL_LEVEL */
  358. cx18_av_and_or(cx, 0x8d5, ~0x7f, 0x80 - bal);
  359. }
  360. }
  361. static int get_mute(struct cx18 *cx)
  362. {
  363. /* check SRC1_MUTE_EN */
  364. return cx18_av_read(cx, 0x8d3) & 0x2 ? 1 : 0;
  365. }
  366. static void set_mute(struct cx18 *cx, int mute)
  367. {
  368. struct cx18_av_state *state = &cx->av_state;
  369. u8 v;
  370. if (state->aud_input > CX18_AV_AUDIO_SERIAL2) {
  371. /* Must turn off microcontroller in order to mute sound.
  372. * Not sure if this is the best method, but it does work.
  373. * If the microcontroller is running, then it will undo any
  374. * changes to the mute register. */
  375. v = cx18_av_read(cx, 0x803);
  376. if (mute) {
  377. /* disable microcontroller */
  378. v &= ~0x10;
  379. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  380. cx18_av_write(cx, 0x8d3, 0x1f);
  381. } else {
  382. /* enable microcontroller */
  383. v |= 0x10;
  384. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  385. }
  386. } else {
  387. /* SRC1_MUTE_EN */
  388. cx18_av_and_or(cx, 0x8d3, ~0x2, mute ? 0x02 : 0x00);
  389. }
  390. }
  391. int cx18_av_s_clock_freq(struct v4l2_subdev *sd, u32 freq)
  392. {
  393. struct cx18 *cx = v4l2_get_subdevdata(sd);
  394. struct cx18_av_state *state = &cx->av_state;
  395. int retval;
  396. u8 v;
  397. if (state->aud_input > CX18_AV_AUDIO_SERIAL2) {
  398. v = cx18_av_read(cx, 0x803) & ~0x10;
  399. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  400. cx18_av_write(cx, 0x8d3, 0x1f);
  401. }
  402. v = cx18_av_read(cx, 0x810) | 0x1;
  403. cx18_av_write_expect(cx, 0x810, v, v, 0x0f);
  404. retval = set_audclk_freq(cx, freq);
  405. v = cx18_av_read(cx, 0x810) & ~0x1;
  406. cx18_av_write_expect(cx, 0x810, v, v, 0x0f);
  407. if (state->aud_input > CX18_AV_AUDIO_SERIAL2) {
  408. v = cx18_av_read(cx, 0x803) | 0x10;
  409. cx18_av_write_expect(cx, 0x803, v, v, 0x1f);
  410. }
  411. return retval;
  412. }
  413. int cx18_av_audio_g_ctrl(struct cx18 *cx, struct v4l2_control *ctrl)
  414. {
  415. switch (ctrl->id) {
  416. case V4L2_CID_AUDIO_VOLUME:
  417. ctrl->value = get_volume(cx);
  418. break;
  419. case V4L2_CID_AUDIO_BASS:
  420. ctrl->value = get_bass(cx);
  421. break;
  422. case V4L2_CID_AUDIO_TREBLE:
  423. ctrl->value = get_treble(cx);
  424. break;
  425. case V4L2_CID_AUDIO_BALANCE:
  426. ctrl->value = get_balance(cx);
  427. break;
  428. case V4L2_CID_AUDIO_MUTE:
  429. ctrl->value = get_mute(cx);
  430. break;
  431. default:
  432. return -EINVAL;
  433. }
  434. return 0;
  435. }
  436. int cx18_av_audio_s_ctrl(struct cx18 *cx, struct v4l2_control *ctrl)
  437. {
  438. switch (ctrl->id) {
  439. case V4L2_CID_AUDIO_VOLUME:
  440. set_volume(cx, ctrl->value);
  441. break;
  442. case V4L2_CID_AUDIO_BASS:
  443. set_bass(cx, ctrl->value);
  444. break;
  445. case V4L2_CID_AUDIO_TREBLE:
  446. set_treble(cx, ctrl->value);
  447. break;
  448. case V4L2_CID_AUDIO_BALANCE:
  449. set_balance(cx, ctrl->value);
  450. break;
  451. case V4L2_CID_AUDIO_MUTE:
  452. set_mute(cx, ctrl->value);
  453. break;
  454. default:
  455. return -EINVAL;
  456. }
  457. return 0;
  458. }