pvrusb2-wm8775.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. */
  17. /*
  18. This source file is specifically designed to interface with the
  19. wm8775.
  20. */
  21. #include "pvrusb2-wm8775.h"
  22. #include "pvrusb2-hdw-internal.h"
  23. #include "pvrusb2-debug.h"
  24. #include <linux/videodev2.h>
  25. #include <media/v4l2-common.h>
  26. #include <linux/errno.h>
  27. void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
  28. {
  29. if (hdw->input_dirty || hdw->force_dirty) {
  30. u32 input;
  31. switch (hdw->input_val) {
  32. case PVR2_CVAL_INPUT_RADIO:
  33. input = 1;
  34. break;
  35. default:
  36. /* All other cases just use the second input */
  37. input = 2;
  38. break;
  39. }
  40. pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775 set_input(val=%d route=0x%x)",
  41. hdw->input_val, input);
  42. sd->ops->audio->s_routing(sd, input, 0, 0);
  43. }
  44. }