pvrusb2-wm8775.c 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. *
  4. * Copyright (C) 2005 Mike Isely <[email protected]>
  5. * Copyright (C) 2004 Aurelien Alleaume <[email protected]>
  6. */
  7. /*
  8. This source file is specifically designed to interface with the
  9. wm8775.
  10. */
  11. #include "pvrusb2-wm8775.h"
  12. #include "pvrusb2-hdw-internal.h"
  13. #include "pvrusb2-debug.h"
  14. #include <linux/videodev2.h>
  15. #include <media/v4l2-common.h>
  16. #include <linux/errno.h>
  17. void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
  18. {
  19. if (hdw->input_dirty || hdw->force_dirty) {
  20. u32 input;
  21. switch (hdw->input_val) {
  22. case PVR2_CVAL_INPUT_RADIO:
  23. input = 1;
  24. break;
  25. default:
  26. /* All other cases just use the second input */
  27. input = 2;
  28. break;
  29. }
  30. pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775 set_input(val=%d route=0x%x)",
  31. hdw->input_val, input);
  32. sd->ops->audio->s_routing(sd, input, 0, 0);
  33. }
  34. }