diff options
author | Igor M. Liplianin <liplianin@me.by> | 2009-11-16 20:22:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:43 -0500 |
commit | b699c2712b1ddcc3ef4491adde00a47a880fde97 (patch) | |
tree | 446f12baedad897f614de8b09c01855894a133c0 | |
parent | fa26ae3e8260530121e6e0e57427468a9f0038d7 (diff) |
V4L/DVB (13407): Add Prof 7301 PCI DVB-S2 card
Add Prof 7301 PCI DVB-S2 card
The card based on stv0903 demod, stb6100 tuner.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | Documentation/video4linux/CARDLIST.cx88 | 1 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stb6100_proc.h | 138 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_core.c | 3 | ||||
-rw-r--r-- | drivers/media/video/cx88/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 17 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 54 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 1 |
9 files changed, 220 insertions, 0 deletions
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 3385f8b094a5..7ec3c4e4b60f 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -81,3 +81,4 @@ | |||
81 | 80 -> Hauppauge WinTV-IR Only [0070:9290] | 81 | 80 -> Hauppauge WinTV-IR Only [0070:9290] |
82 | 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] | 82 | 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] |
83 | 82 -> WinFast DTV2000 H rev. J [107d:6f2b] | 83 | 82 -> WinFast DTV2000 H rev. J [107d:6f2b] |
84 | 83 -> Prof 7301 DVB-S/S2 [b034:3034] | ||
diff --git a/drivers/media/dvb/frontends/stb6100_proc.h b/drivers/media/dvb/frontends/stb6100_proc.h new file mode 100644 index 000000000000..112163a48622 --- /dev/null +++ b/drivers/media/dvb/frontends/stb6100_proc.h | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | STB6100 Silicon Tuner wrapper | ||
3 | Copyright (C)2009 Igor M. Liplianin (liplianin@me.by) | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency) | ||
21 | { | ||
22 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
23 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
24 | struct tuner_state state; | ||
25 | int err = 0; | ||
26 | |||
27 | if (&fe->ops) | ||
28 | frontend_ops = &fe->ops; | ||
29 | if (&frontend_ops->tuner_ops) | ||
30 | tuner_ops = &frontend_ops->tuner_ops; | ||
31 | if (tuner_ops->get_state) { | ||
32 | if (frontend_ops->i2c_gate_ctrl) | ||
33 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
34 | |||
35 | err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &state); | ||
36 | if (err < 0) { | ||
37 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
38 | return err; | ||
39 | } | ||
40 | |||
41 | if (frontend_ops->i2c_gate_ctrl) | ||
42 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
43 | |||
44 | *frequency = state.frequency; | ||
45 | } | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency) | ||
51 | { | ||
52 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
53 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
54 | struct tuner_state state; | ||
55 | int err = 0; | ||
56 | |||
57 | state.frequency = frequency; | ||
58 | if (&fe->ops) | ||
59 | frontend_ops = &fe->ops; | ||
60 | if (&frontend_ops->tuner_ops) | ||
61 | tuner_ops = &frontend_ops->tuner_ops; | ||
62 | if (tuner_ops->set_state) { | ||
63 | if (frontend_ops->i2c_gate_ctrl) | ||
64 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
65 | |||
66 | err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &state); | ||
67 | if (err < 0) { | ||
68 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
69 | return err; | ||
70 | } | ||
71 | |||
72 | if (frontend_ops->i2c_gate_ctrl) | ||
73 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
74 | |||
75 | } | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth) | ||
81 | { | ||
82 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
83 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
84 | struct tuner_state state; | ||
85 | int err = 0; | ||
86 | |||
87 | if (&fe->ops) | ||
88 | frontend_ops = &fe->ops; | ||
89 | if (&frontend_ops->tuner_ops) | ||
90 | tuner_ops = &frontend_ops->tuner_ops; | ||
91 | if (tuner_ops->get_state) { | ||
92 | if (frontend_ops->i2c_gate_ctrl) | ||
93 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
94 | |||
95 | err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &state); | ||
96 | if (err < 0) { | ||
97 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
98 | return err; | ||
99 | } | ||
100 | |||
101 | if (frontend_ops->i2c_gate_ctrl) | ||
102 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
103 | |||
104 | *bandwidth = state.bandwidth; | ||
105 | } | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth) | ||
111 | { | ||
112 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
113 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
114 | struct tuner_state state; | ||
115 | int err = 0; | ||
116 | |||
117 | state.bandwidth = bandwidth; | ||
118 | if (&fe->ops) | ||
119 | frontend_ops = &fe->ops; | ||
120 | if (&frontend_ops->tuner_ops) | ||
121 | tuner_ops = &frontend_ops->tuner_ops; | ||
122 | if (tuner_ops->set_state) { | ||
123 | if (frontend_ops->i2c_gate_ctrl) | ||
124 | frontend_ops->i2c_gate_ctrl(fe, 1); | ||
125 | |||
126 | err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &state); | ||
127 | if (err < 0) { | ||
128 | printk(KERN_ERR "%s: Invalid parameter\n", __func__); | ||
129 | return err; | ||
130 | } | ||
131 | |||
132 | if (frontend_ops->i2c_gate_ctrl) | ||
133 | frontend_ops->i2c_gate_ctrl(fe, 0); | ||
134 | |||
135 | } | ||
136 | |||
137 | return 0; | ||
138 | } | ||
diff --git a/drivers/media/dvb/frontends/stv0900.h b/drivers/media/dvb/frontends/stv0900.h index 446bdfc8ad10..29c3fa85c227 100644 --- a/drivers/media/dvb/frontends/stv0900.h +++ b/drivers/media/dvb/frontends/stv0900.h | |||
@@ -49,6 +49,8 @@ struct stv0900_config { | |||
49 | u8 tun2_maddress; | 49 | u8 tun2_maddress; |
50 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ | 50 | u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */ |
51 | u8 tun2_adc; | 51 | u8 tun2_adc; |
52 | /* Set device param to start dma */ | ||
53 | int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | #if defined(CONFIG_DVB_STV0900) || (defined(CONFIG_DVB_STV0900_MODULE) \ | 56 | #if defined(CONFIG_DVB_STV0900) || (defined(CONFIG_DVB_STV0900_MODULE) \ |
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index e2062048f433..df49ea0983bc 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -1494,6 +1494,9 @@ static enum dvbfe_search stv0900_search(struct dvb_frontend *fe, | |||
1494 | if (!(INRANGE(100000, c->symbol_rate, 70000000))) | 1494 | if (!(INRANGE(100000, c->symbol_rate, 70000000))) |
1495 | return DVBFE_ALGO_SEARCH_FAILED; | 1495 | return DVBFE_ALGO_SEARCH_FAILED; |
1496 | 1496 | ||
1497 | if (state->config->set_ts_params) | ||
1498 | state->config->set_ts_params(fe, 0); | ||
1499 | |||
1497 | p_result.locked = FALSE; | 1500 | p_result.locked = FALSE; |
1498 | p_search.path = demod; | 1501 | p_search.path = demod; |
1499 | p_search.frequency = c->frequency; | 1502 | p_search.frequency = c->frequency; |
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index 49952980dab3..c7e5851d3486 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig | |||
@@ -61,6 +61,8 @@ config VIDEO_CX88_DVB | |||
61 | select DVB_STV0299 if !DVB_FE_CUSTOMISE | 61 | select DVB_STV0299 if !DVB_FE_CUSTOMISE |
62 | select DVB_STV0288 if !DVB_FE_CUSTOMISE | 62 | select DVB_STV0288 if !DVB_FE_CUSTOMISE |
63 | select DVB_STB6000 if !DVB_FE_CUSTOMISE | 63 | select DVB_STB6000 if !DVB_FE_CUSTOMISE |
64 | select DVB_STV0900 if !DVB_FE_CUSTOMISE | ||
65 | select DVB_STB6100 if !DVB_FE_CUSTOMISE | ||
64 | select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE | 66 | select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE |
65 | ---help--- | 67 | ---help--- |
66 | This adds support for DVB/ATSC cards based on the | 68 | This adds support for DVB/ATSC cards based on the |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 7330a2d70439..d844f2aaa01d 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -2075,6 +2075,18 @@ static const struct cx88_board cx88_boards[] = { | |||
2075 | }, | 2075 | }, |
2076 | .mpeg = CX88_MPEG_DVB, | 2076 | .mpeg = CX88_MPEG_DVB, |
2077 | }, | 2077 | }, |
2078 | [CX88_BOARD_PROF_7301] = { | ||
2079 | .name = "Prof 7301 DVB-S/S2", | ||
2080 | .tuner_type = UNSET, | ||
2081 | .radio_type = UNSET, | ||
2082 | .tuner_addr = ADDR_UNSET, | ||
2083 | .radio_addr = ADDR_UNSET, | ||
2084 | .input = { { | ||
2085 | .type = CX88_VMUX_DVB, | ||
2086 | .vmux = 0, | ||
2087 | } }, | ||
2088 | .mpeg = CX88_MPEG_DVB, | ||
2089 | }, | ||
2078 | }; | 2090 | }; |
2079 | 2091 | ||
2080 | /* ------------------------------------------------------------------ */ | 2092 | /* ------------------------------------------------------------------ */ |
@@ -2535,6 +2547,10 @@ static const struct cx88_subid cx88_subids[] = { | |||
2535 | .subvendor = 0x107d, | 2547 | .subvendor = 0x107d, |
2536 | .subdevice = 0x6618, | 2548 | .subdevice = 0x6618, |
2537 | .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL, | 2549 | .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL, |
2550 | }, { | ||
2551 | .subvendor = 0xb034, | ||
2552 | .subdevice = 0x3034, | ||
2553 | .card = CX88_BOARD_PROF_7301, | ||
2538 | }, | 2554 | }, |
2539 | }; | 2555 | }; |
2540 | 2556 | ||
@@ -3211,6 +3227,7 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3211 | case CX88_BOARD_TBS_8920: | 3227 | case CX88_BOARD_TBS_8920: |
3212 | case CX88_BOARD_PROF_6200: | 3228 | case CX88_BOARD_PROF_6200: |
3213 | case CX88_BOARD_PROF_7300: | 3229 | case CX88_BOARD_PROF_7300: |
3230 | case CX88_BOARD_PROF_7301: | ||
3214 | case CX88_BOARD_SATTRADE_ST4200: | 3231 | case CX88_BOARD_SATTRADE_ST4200: |
3215 | cx_write(MO_GP0_IO, 0x8000); | 3232 | cx_write(MO_GP0_IO, 0x8000); |
3216 | msleep(100); | 3233 | msleep(100); |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 9df71d0244a8..b14296923250 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -53,6 +53,9 @@ | |||
53 | #include "stv0288.h" | 53 | #include "stv0288.h" |
54 | #include "stb6000.h" | 54 | #include "stb6000.h" |
55 | #include "cx24116.h" | 55 | #include "cx24116.h" |
56 | #include "stv0900.h" | ||
57 | #include "stb6100.h" | ||
58 | #include "stb6100_proc.h" | ||
56 | 59 | ||
57 | MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); | 60 | MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); |
58 | MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); | 61 | MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); |
@@ -573,6 +576,15 @@ static int cx24116_set_ts_param(struct dvb_frontend *fe, | |||
573 | return 0; | 576 | return 0; |
574 | } | 577 | } |
575 | 578 | ||
579 | static int stv0900_set_ts_param(struct dvb_frontend *fe, | ||
580 | int is_punctured) | ||
581 | { | ||
582 | struct cx8802_dev *dev = fe->dvb->priv; | ||
583 | dev->ts_gen_cntrl = 0; | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | |||
576 | static int cx24116_reset_device(struct dvb_frontend *fe) | 588 | static int cx24116_reset_device(struct dvb_frontend *fe) |
577 | { | 589 | { |
578 | struct cx8802_dev *dev = fe->dvb->priv; | 590 | struct cx8802_dev *dev = fe->dvb->priv; |
@@ -601,6 +613,23 @@ static struct cx24116_config tevii_s460_config = { | |||
601 | .reset_device = cx24116_reset_device, | 613 | .reset_device = cx24116_reset_device, |
602 | }; | 614 | }; |
603 | 615 | ||
616 | static struct stv0900_config prof_7301_stv0900_config = { | ||
617 | .demod_address = 0x6a, | ||
618 | /* demod_mode = 0,*/ | ||
619 | .xtal = 27000000, | ||
620 | .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ | ||
621 | .diseqc_mode = 2,/* 2/3 PWM */ | ||
622 | .tun1_maddress = 0,/* 0x60 */ | ||
623 | .tun1_adc = 0,/* 2 Vpp */ | ||
624 | .path1_mode = 3, | ||
625 | .set_ts_params = stv0900_set_ts_param, | ||
626 | }; | ||
627 | |||
628 | static struct stb6100_config prof_7301_stb6100_config = { | ||
629 | .tuner_address = 0x60, | ||
630 | .refclock = 27000000, | ||
631 | }; | ||
632 | |||
604 | static struct stv0299_config tevii_tuner_sharp_config = { | 633 | static struct stv0299_config tevii_tuner_sharp_config = { |
605 | .demod_address = 0x68, | 634 | .demod_address = 0x68, |
606 | .inittab = sharp_z0194a_inittab, | 635 | .inittab = sharp_z0194a_inittab, |
@@ -1149,6 +1178,31 @@ static int dvb_register(struct cx8802_dev *dev) | |||
1149 | goto frontend_detach; | 1178 | goto frontend_detach; |
1150 | } | 1179 | } |
1151 | break; | 1180 | break; |
1181 | case CX88_BOARD_PROF_7301:{ | ||
1182 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
1183 | |||
1184 | fe0->dvb.frontend = dvb_attach(stv0900_attach, | ||
1185 | &prof_7301_stv0900_config, | ||
1186 | &core->i2c_adap, 0); | ||
1187 | if (fe0->dvb.frontend != NULL) { | ||
1188 | if (!dvb_attach(stb6100_attach, fe0->dvb.frontend, | ||
1189 | &prof_7301_stb6100_config, | ||
1190 | &core->i2c_adap)) | ||
1191 | goto frontend_detach; | ||
1192 | |||
1193 | tuner_ops = &fe0->dvb.frontend->ops.tuner_ops; | ||
1194 | tuner_ops->set_frequency = stb6100_set_freq; | ||
1195 | tuner_ops->get_frequency = stb6100_get_freq; | ||
1196 | tuner_ops->set_bandwidth = stb6100_set_bandw; | ||
1197 | tuner_ops->get_bandwidth = stb6100_get_bandw; | ||
1198 | |||
1199 | core->prev_set_voltage = | ||
1200 | fe0->dvb.frontend->ops.set_voltage; | ||
1201 | fe0->dvb.frontend->ops.set_voltage = | ||
1202 | tevii_dvbs_set_voltage; | ||
1203 | } | ||
1204 | break; | ||
1205 | } | ||
1152 | default: | 1206 | default: |
1153 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", | 1207 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", |
1154 | core->name); | 1208 | core->name); |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index c0047c1960cc..47c03019357d 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -308,6 +308,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
308 | case CX88_BOARD_TBS_8920: | 308 | case CX88_BOARD_TBS_8920: |
309 | case CX88_BOARD_TBS_8910: | 309 | case CX88_BOARD_TBS_8910: |
310 | case CX88_BOARD_PROF_7300: | 310 | case CX88_BOARD_PROF_7300: |
311 | case CX88_BOARD_PROF_7301: | ||
311 | case CX88_BOARD_PROF_6200: | 312 | case CX88_BOARD_PROF_6200: |
312 | ir_codes = &ir_codes_tbs_nec_table; | 313 | ir_codes = &ir_codes_tbs_nec_table; |
313 | ir_type = IR_TYPE_PD; | 314 | ir_type = IR_TYPE_PD; |
@@ -457,6 +458,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
457 | case CX88_BOARD_TBS_8920: | 458 | case CX88_BOARD_TBS_8920: |
458 | case CX88_BOARD_TBS_8910: | 459 | case CX88_BOARD_TBS_8910: |
459 | case CX88_BOARD_PROF_7300: | 460 | case CX88_BOARD_PROF_7300: |
461 | case CX88_BOARD_PROF_7301: | ||
460 | case CX88_BOARD_PROF_6200: | 462 | case CX88_BOARD_PROF_6200: |
461 | ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); | 463 | ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); |
462 | 464 | ||
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index d5cea41f4207..e1c521710103 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -238,6 +238,7 @@ extern struct sram_channel cx88_sram_channels[]; | |||
238 | #define CX88_BOARD_HAUPPAUGE_IRONLY 80 | 238 | #define CX88_BOARD_HAUPPAUGE_IRONLY 80 |
239 | #define CX88_BOARD_WINFAST_DTV1800H 81 | 239 | #define CX88_BOARD_WINFAST_DTV1800H 81 |
240 | #define CX88_BOARD_WINFAST_DTV2000H_J 82 | 240 | #define CX88_BOARD_WINFAST_DTV2000H_J 82 |
241 | #define CX88_BOARD_PROF_7301 83 | ||
241 | 242 | ||
242 | enum cx88_itype { | 243 | enum cx88_itype { |
243 | CX88_VMUX_COMPOSITE1 = 1, | 244 | CX88_VMUX_COMPOSITE1 = 1, |