Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _VIDEOBUF2_DVB_H_
0003 #define _VIDEOBUF2_DVB_H_
0004 
0005 #include <media/dvbdev.h>
0006 #include <media/dmxdev.h>
0007 #include <media/dvb_demux.h>
0008 #include <media/dvb_net.h>
0009 #include <media/dvb_frontend.h>
0010 #include <media/videobuf2-v4l2.h>
0011 
0012 /* We don't actually need to include media-device.h here */
0013 struct media_device;
0014 
0015 /*
0016  * TODO: This header file should be replaced with videobuf2-core.h
0017  * Currently, vb2_thread is not a stuff of videobuf2-core,
0018  * since vb2_thread has many dependencies on videobuf2-v4l2.
0019  */
0020 
0021 struct vb2_dvb {
0022     /* filling that the job of the driver */
0023     char            *name;
0024     struct dvb_frontend *frontend;
0025     struct vb2_queue    dvbq;
0026 
0027     /* video-buf-dvb state info */
0028     struct mutex        lock;
0029     int         nfeeds;
0030 
0031     /* vb2_dvb_(un)register manages this */
0032     struct dvb_demux    demux;
0033     struct dmxdev       dmxdev;
0034     struct dmx_frontend fe_hw;
0035     struct dmx_frontend fe_mem;
0036     struct dvb_net      net;
0037 };
0038 
0039 struct vb2_dvb_frontend {
0040     struct list_head felist;
0041     int id;
0042     struct vb2_dvb dvb;
0043 };
0044 
0045 struct vb2_dvb_frontends {
0046     struct list_head felist;
0047     struct mutex lock;
0048     struct dvb_adapter adapter;
0049     int active_fe_id; /* Indicates which frontend in the felist is in use */
0050     int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
0051 };
0052 
0053 int vb2_dvb_register_bus(struct vb2_dvb_frontends *f,
0054              struct module *module,
0055              void *adapter_priv,
0056              struct device *device,
0057              struct media_device *mdev,
0058              short *adapter_nr,
0059              int mfe_shared);
0060 
0061 void vb2_dvb_unregister_bus(struct vb2_dvb_frontends *f);
0062 
0063 struct vb2_dvb_frontend *vb2_dvb_alloc_frontend(struct vb2_dvb_frontends *f, int id);
0064 void vb2_dvb_dealloc_frontends(struct vb2_dvb_frontends *f);
0065 
0066 struct vb2_dvb_frontend *vb2_dvb_get_frontend(struct vb2_dvb_frontends *f, int id);
0067 int vb2_dvb_find_frontend(struct vb2_dvb_frontends *f, struct dvb_frontend *p);
0068 
0069 #endif          /* _VIDEOBUF2_DVB_H_ */