diff options
author | VDR User <user.vdr@gmail.com> | 2010-10-30 14:49:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:38 -0500 |
commit | 9e21ccaa69674e1b0aa887722801258f7de842db (patch) | |
tree | 00d7173c5f465e70b14a91007353f314bf7c1176 /drivers/media/dvb/dvb-usb/gp8psk.c | |
parent | 141bb0dc2d0ad03202aef7c070555cd970ca6bf9 (diff) |
[media] dvb-usb-gp8psk: get firmware and fpga versions
This patch adds retrieval of firmware and FPGA versions of Genpix devices.
That information is useful for users who experience performance differences
with the various firmware versions, and may want to use a specific firmware
that best suits their needs.
Example dmesg output:
gp8psk: FW Version = 2.09.4 (0x20904) Build 2009/04/02
gp8psk: FPGA Version = 1
Signed-off-by: Derek Kelly <user.vdr@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/gp8psk.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index c821293dbc22..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 | ||
25 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 25 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
26 | 26 | ||
27 | static 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 | |||
32 | static 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 | |||
37 | static 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 | |||
27 | int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) | 54 | int 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) |