pvrusb2-ctrl.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. *
  4. * Copyright (C) 2005 Mike Isely <[email protected]>
  5. */
  6. #ifndef __PVRUSB2_CTRL_H
  7. #define __PVRUSB2_CTRL_H
  8. struct pvr2_ctrl;
  9. enum pvr2_ctl_type {
  10. pvr2_ctl_int = 0,
  11. pvr2_ctl_enum = 1,
  12. pvr2_ctl_bitmask = 2,
  13. pvr2_ctl_bool = 3,
  14. };
  15. /* Set the given control. */
  16. int pvr2_ctrl_set_value(struct pvr2_ctrl *,int val);
  17. /* Set/clear specific bits of the given control. */
  18. int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *,int mask,int val);
  19. /* Get the current value of the given control. */
  20. int pvr2_ctrl_get_value(struct pvr2_ctrl *,int *valptr);
  21. /* Retrieve control's type */
  22. enum pvr2_ctl_type pvr2_ctrl_get_type(struct pvr2_ctrl *);
  23. /* Retrieve control's maximum value (int type) */
  24. int pvr2_ctrl_get_max(struct pvr2_ctrl *);
  25. /* Retrieve control's minimum value (int type) */
  26. int pvr2_ctrl_get_min(struct pvr2_ctrl *);
  27. /* Retrieve control's default value (any type) */
  28. int pvr2_ctrl_get_def(struct pvr2_ctrl *, int *valptr);
  29. /* Retrieve control's enumeration count (enum only) */
  30. int pvr2_ctrl_get_cnt(struct pvr2_ctrl *);
  31. /* Retrieve control's valid mask bits (bit mask only) */
  32. int pvr2_ctrl_get_mask(struct pvr2_ctrl *);
  33. /* Retrieve the control's name */
  34. const char *pvr2_ctrl_get_name(struct pvr2_ctrl *);
  35. /* Retrieve the control's desc */
  36. const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *);
  37. /* Retrieve a control enumeration or bit mask value */
  38. int pvr2_ctrl_get_valname(struct pvr2_ctrl *,int,char *,unsigned int,
  39. unsigned int *);
  40. /* Return true if control is writable */
  41. int pvr2_ctrl_is_writable(struct pvr2_ctrl *);
  42. /* Return V4L flags value for control (or zero if there is no v4l control
  43. actually under this control) */
  44. unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *);
  45. /* Return V4L ID for this control or zero if none */
  46. int pvr2_ctrl_get_v4lid(struct pvr2_ctrl *);
  47. /* Return true if control has custom symbolic representation */
  48. int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl *);
  49. /* Convert a given mask/val to a custom symbolic value */
  50. int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl *,
  51. int mask,int val,
  52. char *buf,unsigned int maxlen,
  53. unsigned int *len);
  54. /* Convert a symbolic value to a mask/value pair */
  55. int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl *,
  56. const char *buf,unsigned int len,
  57. int *maskptr,int *valptr);
  58. /* Convert a given mask/val to a symbolic value */
  59. int pvr2_ctrl_value_to_sym(struct pvr2_ctrl *,
  60. int mask,int val,
  61. char *buf,unsigned int maxlen,
  62. unsigned int *len);
  63. /* Convert a symbolic value to a mask/value pair */
  64. int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *,
  65. const char *buf,unsigned int len,
  66. int *maskptr,int *valptr);
  67. /* Convert a given mask/val to a symbolic value - must already be
  68. inside of critical region. */
  69. int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl *,
  70. int mask,int val,
  71. char *buf,unsigned int maxlen,
  72. unsigned int *len);
  73. #endif /* __PVRUSB2_CTRL_H */