pvrusb2-wm8775.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. *
  3. *
  4. * Copyright (C) 2005 Mike Isely <isely@pobox.com>
  5. * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. /*
  22. This source file is specifically designed to interface with the
  23. wm8775.
  24. */
  25. #include "pvrusb2-wm8775.h"
  26. #include "pvrusb2-hdw-internal.h"
  27. #include "pvrusb2-debug.h"
  28. #include <linux/videodev2.h>
  29. #include <media/v4l2-common.h>
  30. #include <linux/errno.h>
  31. #include <linux/slab.h>
  32. void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
  33. {
  34. if (hdw->input_dirty || hdw->force_dirty) {
  35. struct v4l2_routing route;
  36. memset(&route, 0, sizeof(route));
  37. switch (hdw->input_val) {
  38. case PVR2_CVAL_INPUT_RADIO:
  39. route.input = 1;
  40. break;
  41. default:
  42. /* All other cases just use the second input */
  43. route.input = 2;
  44. break;
  45. }
  46. pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775"
  47. " set_input(val=%d route=0x%x)",
  48. hdw->input_val, route.input);
  49. sd->ops->audio->s_routing(sd, &route);
  50. }
  51. }
  52. /*
  53. Stuff for Emacs to see, in order to encourage consistent editing style:
  54. *** Local Variables: ***
  55. *** mode: c ***
  56. *** fill-column: 70 ***
  57. *** tab-width: 8 ***
  58. *** c-basic-offset: 8 ***
  59. *** End: ***
  60. */