xref: /linux/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-common.h (revision 58d416351e6df1a41d415958ccdd8eb9c2173fed)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * c8sectpfe-common.h - C8SECTPFE STi DVB driver
4  *
5  * Copyright (c) STMicroelectronics 2015
6  *
7  *   Author: Peter Griffin <peter.griffin@linaro.org>
8  *
9  */
10 #ifndef _C8SECTPFE_COMMON_H_
11 #define _C8SECTPFE_COMMON_H_
12 
13 #include <linux/dvb/dmx.h>
14 #include <linux/dvb/frontend.h>
15 #include <linux/gpio.h>
16 #include <linux/version.h>
17 
18 #include <media/dmxdev.h>
19 #include <media/dvb_demux.h>
20 #include <media/dvb_frontend.h>
21 #include <media/dvb_net.h>
22 
23 /* Maximum number of channels */
24 #define C8SECTPFE_MAXADAPTER (4)
25 #define C8SECTPFE_MAXCHANNEL 64
26 #define STPTI_MAXCHANNEL 64
27 
28 #define MAX_INPUTBLOCKS 7
29 
30 struct c8sectpfe;
31 struct stdemux;
32 
33 struct stdemux {
34 	struct dvb_demux	dvb_demux;
35 	struct dmxdev		dmxdev;
36 	struct dmx_frontend	hw_frontend;
37 	struct dmx_frontend	mem_frontend;
38 	int			tsin_index;
39 	int			running_feed_count;
40 	struct			c8sectpfei *c8sectpfei;
41 };
42 
43 struct c8sectpfe {
44 	struct stdemux demux[MAX_INPUTBLOCKS];
45 	struct mutex lock;
46 	struct dvb_adapter adapter;
47 	struct device *device;
48 	int mapping;
49 	int num_feeds;
50 };
51 
52 /* Channel registration */
53 int c8sectpfe_tuner_register_frontend(struct c8sectpfe **c8sectpfe,
54 					struct c8sectpfei *fei,
55 					void *start_feed,
56 					void *stop_feed);
57 
58 void c8sectpfe_tuner_unregister_frontend(struct c8sectpfe *c8sectpfe,
59 						struct c8sectpfei *fei);
60 
61 #endif
62