aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/gp8psk.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/media/dvb/dvb-usb/gp8psk.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/media/dvb/dvb-usb/gp8psk.c')
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
index 45106ac49674..1cb3d9a66e02 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -24,6 +24,33 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DV
24 24
25DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 25DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
26 26
27static int gp8psk_get_fw_version(struct dvb_usb_device *d, u8 *fw_vers)
28{
29 return (gp8psk_usb_in_op(d, GET_FW_VERS, 0, 0, fw_vers, 6));
30}
31
32static int gp8psk_get_fpga_version(struct dvb_usb_device *d, u8 *fpga_vers)
33{
34 return (gp8psk_usb_in_op(d, GET_FPGA_VERS, 0, 0, fpga_vers, 1));
35}
36
37static void gp8psk_info(struct dvb_usb_device *d)
38{
39 u8 fpga_vers, fw_vers[6];
40
41 if (!gp8psk_get_fw_version(d, fw_vers))
42 info("FW Version = %i.%02i.%i (0x%x) Build %4i/%02i/%02i",
43 fw_vers[2], fw_vers[1], fw_vers[0], GP8PSK_FW_VERS(fw_vers),
44 2000 + fw_vers[5], fw_vers[4], fw_vers[3]);
45 else
46 info("failed to get FW version");
47
48 if (!gp8psk_get_fpga_version(d, &fpga_vers))
49 info("FPGA Version = %i", fpga_vers);
50 else
51 info("failed to get FPGA version");
52}
53
27int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) 54int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
28{ 55{
29 int ret = 0,try = 0; 56 int ret = 0,try = 0;
@@ -146,6 +173,7 @@ static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff)
146 gp8psk_usb_out_op(d, CW3K_INIT, 1, 0, NULL, 0); 173 gp8psk_usb_out_op(d, CW3K_INIT, 1, 0, NULL, 0);
147 if (gp8psk_usb_in_op(d, BOOT_8PSK, 1, 0, &buf, 1)) 174 if (gp8psk_usb_in_op(d, BOOT_8PSK, 1, 0, &buf, 1))
148 return -EINVAL; 175 return -EINVAL;
176 gp8psk_info(d);
149 } 177 }
150 178
151 if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) 179 if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM)
@@ -227,6 +255,7 @@ static struct usb_device_id gp8psk_usb_table [] = {
227 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_8PSK_REV_1_WARM) }, 255 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_8PSK_REV_1_WARM) },
228 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_8PSK_REV_2) }, 256 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_8PSK_REV_2) },
229 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_SKYWALKER_1) }, 257 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_SKYWALKER_1) },
258 { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_SKYWALKER_2) },
230/* { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_SKYWALKER_CW3K) }, */ 259/* { USB_DEVICE(USB_VID_GENPIX, USB_PID_GENPIX_SKYWALKER_CW3K) }, */
231 { 0 }, 260 { 0 },
232}; 261};
@@ -258,7 +287,7 @@ static struct dvb_usb_device_properties gp8psk_properties = {
258 287
259 .generic_bulk_ctrl_endpoint = 0x01, 288 .generic_bulk_ctrl_endpoint = 0x01,
260 289
261 .num_device_descs = 3, 290 .num_device_descs = 4,
262 .devices = { 291 .devices = {
263 { .name = "Genpix 8PSK-to-USB2 Rev.1 DVB-S receiver", 292 { .name = "Genpix 8PSK-to-USB2 Rev.1 DVB-S receiver",
264 .cold_ids = { &gp8psk_usb_table[0], NULL }, 293 .cold_ids = { &gp8psk_usb_table[0], NULL },
@@ -272,6 +301,10 @@ static struct dvb_usb_device_properties gp8psk_properties = {
272 .cold_ids = { NULL }, 301 .cold_ids = { NULL },
273 .warm_ids = { &gp8psk_usb_table[3], NULL }, 302 .warm_ids = { &gp8psk_usb_table[3], NULL },
274 }, 303 },
304 { .name = "Genpix SkyWalker-2 DVB-S receiver",
305 .cold_ids = { NULL },
306 .warm_ids = { &gp8psk_usb_table[4], NULL },
307 },
275 { NULL }, 308 { NULL },
276 } 309 }
277}; 310};
@@ -306,6 +339,6 @@ module_init(gp8psk_usb_module_init);
306module_exit(gp8psk_usb_module_exit); 339module_exit(gp8psk_usb_module_exit);
307 340
308MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>"); 341MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>");
309MODULE_DESCRIPTION("Driver for Genpix 8psk-to-USB2 DVB-S"); 342MODULE_DESCRIPTION("Driver for Genpix DVB-S");
310MODULE_VERSION("1.1"); 343MODULE_VERSION("1.1");
311MODULE_LICENSE("GPL"); 344MODULE_LICENSE("GPL");