blob: eda792801ddb36bff410d7d06a0eadb3865fe1c4
1 | /* |
2 | * Copyright (C) 2017 Amlogic, Inc. All rights reserved. |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or |
7 | * (at your option) any later version. |
8 | * |
9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License along |
15 | * with this program; if not, write to the Free Software Foundation, Inc., |
16 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | * |
18 | * Description: |
19 | */ |
20 | #ifndef _AML_DVB_H_ |
21 | #define _AML_DVB_H_ |
22 | |
23 | #include "aml_dmx.h" |
24 | #include "aml_dsc.h" |
25 | #include "hw_demux/hwdemux.h" |
26 | #include "hw_demux/demod_gt.h" |
27 | |
28 | #define CHAIN_PATH_COUNT 5 |
29 | #define DMX_DEV_COUNT 5 |
30 | #define DSC_DEV_COUNT 2 |
31 | #define FE_DEV_COUNT 2 |
32 | |
33 | struct aml_tuner { |
34 | struct tuner_config cfg; |
35 | unsigned int i2c_adapter_id; |
36 | struct i2c_adapter *i2c_adp; |
37 | }; |
38 | |
39 | struct aml_dvb { |
40 | struct dvb_device dvb_dev; |
41 | struct dvb_adapter dvb_adapter; |
42 | |
43 | struct device *dev; |
44 | struct platform_device *pdev; |
45 | |
46 | HWDMX_Demux *hwdmx[CHAIN_PATH_COUNT]; |
47 | SWDMX_TsParser *tsp[CHAIN_PATH_COUNT]; |
48 | SWDMX_Descrambler *swdsc[CHAIN_PATH_COUNT]; |
49 | SWDMX_Demux *swdmx[CHAIN_PATH_COUNT]; |
50 | |
51 | struct aml_dmx dmx[DMX_DEV_COUNT]; |
52 | struct aml_dsc dsc[DSC_DEV_COUNT]; |
53 | |
54 | struct mutex mutex; |
55 | spinlock_t slock; |
56 | |
57 | int ts_out_invert; |
58 | |
59 | unsigned int tuner_num; |
60 | unsigned int tuner_cur; |
61 | struct aml_tuner *tuners; |
62 | bool tuner_attached; |
63 | }; |
64 | |
65 | struct aml_dvb *aml_get_dvb_device(void); |
66 | |
67 | #endif |
68 |