videobuf2-dvb.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _VIDEOBUF2_DVB_H_
  3. #define _VIDEOBUF2_DVB_H_
  4. #include <media/dvbdev.h>
  5. #include <media/dmxdev.h>
  6. #include <media/dvb_demux.h>
  7. #include <media/dvb_net.h>
  8. #include <media/dvb_frontend.h>
  9. #include <media/videobuf2-v4l2.h>
  10. /* We don't actually need to include media-device.h here */
  11. struct media_device;
  12. /*
  13. * TODO: This header file should be replaced with videobuf2-core.h
  14. * Currently, vb2_thread is not a stuff of videobuf2-core,
  15. * since vb2_thread has many dependencies on videobuf2-v4l2.
  16. */
  17. struct vb2_dvb {
  18. /* filling that the job of the driver */
  19. char *name;
  20. struct dvb_frontend *frontend;
  21. struct vb2_queue dvbq;
  22. /* vb2-dvb state info */
  23. struct mutex lock;
  24. int nfeeds;
  25. /* vb2_dvb_(un)register manages this */
  26. struct dvb_demux demux;
  27. struct dmxdev dmxdev;
  28. struct dmx_frontend fe_hw;
  29. struct dmx_frontend fe_mem;
  30. struct dvb_net net;
  31. };
  32. struct vb2_dvb_frontend {
  33. struct list_head felist;
  34. int id;
  35. struct vb2_dvb dvb;
  36. };
  37. struct vb2_dvb_frontends {
  38. struct list_head felist;
  39. struct mutex lock;
  40. struct dvb_adapter adapter;
  41. int active_fe_id; /* Indicates which frontend in the felist is in use */
  42. int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
  43. };
  44. int vb2_dvb_register_bus(struct vb2_dvb_frontends *f,
  45. struct module *module,
  46. void *adapter_priv,
  47. struct device *device,
  48. struct media_device *mdev,
  49. short *adapter_nr,
  50. int mfe_shared);
  51. void vb2_dvb_unregister_bus(struct vb2_dvb_frontends *f);
  52. struct vb2_dvb_frontend *vb2_dvb_alloc_frontend(struct vb2_dvb_frontends *f, int id);
  53. void vb2_dvb_dealloc_frontends(struct vb2_dvb_frontends *f);
  54. struct vb2_dvb_frontend *vb2_dvb_get_frontend(struct vb2_dvb_frontends *f, int id);
  55. int vb2_dvb_find_frontend(struct vb2_dvb_frontends *f, struct dvb_frontend *p);
  56. #endif /* _VIDEOBUF2_DVB_H_ */