1 /*
2  * CIMaX SP2/HF CI driver
3  *
4  * Copyright (C) 2014 Olli Salonen <olli.salonen@iki.fi>
5  *
6  *    This program is free software; you can redistribute it and/or modify
7  *    it under the terms of the GNU General Public License as published by
8  *    the Free Software Foundation; either version 2 of the License, or
9  *    (at your option) any later version.
10  *
11  *    This program is distributed in the hope that it will be useful,
12  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *    GNU General Public License for more details.
15  */
16 
17 #ifndef SP2_PRIV_H
18 #define SP2_PRIV_H
19 
20 #include "sp2.h"
21 #include <media/dvb_frontend.h>
22 
23 /* state struct */
24 struct sp2 {
25 	int status;
26 	struct i2c_client *client;
27 	struct dvb_adapter *dvb_adap;
28 	struct dvb_ca_en50221 ca;
29 	int module_access_type;
30 	unsigned long next_status_checked_time;
31 	void *priv;
32 	void *ci_control;
33 };
34 
35 #define SP2_CI_ATTR_ACS		0x00
36 #define SP2_CI_IO_ACS		0x04
37 #define SP2_CI_WR		0
38 #define SP2_CI_RD		1
39 
40 /* Module control register (0x00 module A, 0x09 module B) bits */
41 #define SP2_MOD_CTL_DET		0x01
42 #define SP2_MOD_CTL_AUTO	0x02
43 #define SP2_MOD_CTL_ACS0	0x04
44 #define SP2_MOD_CTL_ACS1	0x08
45 #define SP2_MOD_CTL_HAD		0x10
46 #define SP2_MOD_CTL_TSIEN	0x20
47 #define SP2_MOD_CTL_TSOEN	0x40
48 #define SP2_MOD_CTL_RST		0x80
49 
50 #endif
51