diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2007-02-24 06:31:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:14 -0500 |
commit | c46b65621007a2ede49464d227f64dd3a909a109 (patch) | |
tree | bdb1b8f9c0f8012a5004bdac9ead76afbd2e8d5e /drivers/media/dvb/frontends/stb6100.h | |
parent | e50e8e3338788359d63f0a1ea2e038dd48415754 (diff) |
V4L/DVB (9377): Add STB6100 Support
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stb6100.h')
-rw-r--r-- | drivers/media/dvb/frontends/stb6100.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stb6100.h b/drivers/media/dvb/frontends/stb6100.h new file mode 100644 index 000000000000..771914a8a1cc --- /dev/null +++ b/drivers/media/dvb/frontends/stb6100.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | STB6100 Silicon Tuner | ||
3 | Copyright (C) Manu Abraham (abraham.manu@gmail.com) | ||
4 | |||
5 | Copyright (C) ST Microelectronics | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __STB_6100_REG_H | ||
23 | #define __STB_6100_REG_H | ||
24 | |||
25 | #include <linux/dvb/frontend.h> | ||
26 | #include "dvb_frontend.h" | ||
27 | |||
28 | #define STB6100_LD 0x00 | ||
29 | #define STB6100_LD_LOCK (1 << 0) | ||
30 | |||
31 | #define STB6100_VCO 0x01 | ||
32 | #define STB6100_VCO_OSCH (0x01 << 7) | ||
33 | #define STB6100_VCO_OSCH_SHIFT 7 | ||
34 | #define STB6100_VCO_OCK (0x03 << 5) | ||
35 | #define STB6100_VCO_OCK_SHIFT 5 | ||
36 | #define STB6100_VCO_ODIV (0x01 << 4) | ||
37 | #define STB6100_VCO_ODIV_SHIFT 4 | ||
38 | #define STB6100_VCO_OSM (0x0f << 0) | ||
39 | |||
40 | #define STB6100_NI 0x02 | ||
41 | #define STB6100_NF_LSB 0x03 | ||
42 | |||
43 | #define STB6100_K 0x04 | ||
44 | #define STB6100_K_PSD2 (0x01 << 2) | ||
45 | #define STB6100_K_PSD2_SHIFT 2 | ||
46 | #define STB6100_K_NF_MSB (0x03 << 0) | ||
47 | |||
48 | #define STB6100_G 0x05 | ||
49 | #define STB6100_G_G (0x0f << 0) | ||
50 | #define STB6100_G_GCT (0x07 << 5) | ||
51 | |||
52 | #define STB6100_F 0x06 | ||
53 | #define STB6100_F_F (0x1f << 0) | ||
54 | |||
55 | #define STB6100_DLB 0x07 | ||
56 | |||
57 | #define STB6100_TEST1 0x08 | ||
58 | |||
59 | #define STB6100_FCCK 0x09 | ||
60 | #define STB6100_FCCK_FCCK (0x01 << 6) | ||
61 | |||
62 | #define STB6100_LPEN 0x0a | ||
63 | #define STB6100_LPEN_LPEN (0x01 << 4) | ||
64 | #define STB6100_LPEN_SYNP (0x01 << 5) | ||
65 | #define STB6100_LPEN_OSCP (0x01 << 6) | ||
66 | #define STB6100_LPEN_BEN (0x01 << 7) | ||
67 | |||
68 | #define STB6100_TEST3 0x0b | ||
69 | |||
70 | #define STB6100_NUMREGS 0x0c | ||
71 | |||
72 | |||
73 | #define INRANGE(val, x, y) (((x <= val) && (val <= y)) || \ | ||
74 | ((y <= val) && (val <= x)) ? 1 : 0) | ||
75 | |||
76 | #define CHKRANGE(val, x, y) (((val >= x) && (val < y)) ? 1 : 0) | ||
77 | |||
78 | struct stb6100_config { | ||
79 | u8 tuner_address; | ||
80 | u32 refclock; | ||
81 | }; | ||
82 | |||
83 | struct stb6100_state { | ||
84 | struct i2c_adapter *i2c; | ||
85 | |||
86 | const struct stb6100_config *config; | ||
87 | struct dvb_tuner_ops ops; | ||
88 | struct dvb_frontend *frontend; | ||
89 | struct tuner_state status; | ||
90 | |||
91 | u32 frequency; | ||
92 | u32 srate; | ||
93 | u32 bandwidth; | ||
94 | u32 reference; | ||
95 | }; | ||
96 | |||
97 | struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe, | ||
98 | struct stb6100_config* config, | ||
99 | struct i2c_adapter *i2c); | ||
100 | |||
101 | #endif | ||