blob: 4998c96caebee5cb8e3d38fa2962b7b8ec642839 [file] [log] [blame]
Igor M. Liplianin349bcf02011-01-25 17:01:00 -03001/*
2 * altera-ci.c
3 *
4 * CI driver in conjunction with NetUp Dual DVB-T/C RF CI card
5 *
6 * Copyright (C) 2010 NetUP Inc.
7 * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 *
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24#ifndef __ALTERA_CI_H
25#define __ALTERA_CI_H
26
Mauro Carvalho Chehab1c593902013-03-21 16:29:08 -030027#include <linux/kconfig.h>
28
Igor M. Liplianin349bcf02011-01-25 17:01:00 -030029#define ALT_DATA 0x000000ff
30#define ALT_TDI 0x00008000
31#define ALT_TDO 0x00004000
32#define ALT_TCK 0x00002000
33#define ALT_RDY 0x00001000
34#define ALT_RD 0x00000800
35#define ALT_WR 0x00000400
36#define ALT_AD_RG 0x00000200
37#define ALT_CS 0x00000100
38
39struct altera_ci_config {
40 void *dev;/* main dev, for example cx23885_dev */
41 void *adapter;/* for CI to connect to */
42 struct dvb_demux *demux;/* for hardware PID filter to connect to */
43 int (*fpga_rw) (void *dev, int ad_rg, int val, int rw);
44};
45
Mauro Carvalho Chehab1c593902013-03-21 16:29:08 -030046#if IS_ENABLED(CONFIG_MEDIA_ALTERA_CI)
Igor M. Liplianin349bcf02011-01-25 17:01:00 -030047
48extern int altera_ci_init(struct altera_ci_config *config, int ci_nr);
49extern void altera_ci_release(void *dev, int ci_nr);
50extern int altera_ci_irq(void *dev);
51extern int altera_ci_tuner_reset(void *dev, int ci_nr);
52
53#else
54
55static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr)
56{
57 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
58 return 0;
59}
60
61static inline void altera_ci_release(void *dev, int ci_nr)
62{
63 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Igor M. Liplianin349bcf02011-01-25 17:01:00 -030064}
65
66static inline int altera_ci_irq(void *dev)
67{
68 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
69 return 0;
70}
71
Hans Verkuilfa9448d2011-03-06 09:49:37 -030072static inline int altera_ci_tuner_reset(void *dev, int ci_nr)
Igor M. Liplianin349bcf02011-01-25 17:01:00 -030073{
74 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
75 return 0;
76}
77
78#endif
79#if 0
80static inline int altera_hw_filt_init(struct altera_ci_config *config,
81 int hw_filt_nr)
82{
83 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
84 return 0;
85}
86
87static inline void altera_hw_filt_release(void *dev, int filt_nr)
88{
89 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Igor M. Liplianin349bcf02011-01-25 17:01:00 -030090}
91
92static inline int altera_pid_feed_control(void *dev, int filt_nr,
93 struct dvb_demux_feed *dvbdmxfeed, int onoff)
94{
95 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
96 return 0;
97}
98
99#endif /* CONFIG_MEDIA_ALTERA_CI */
100
101#endif /* __ALTERA_CI_H */