V4L/DVB (13496): pvrusb2: Support manual extraction of 16KB FX2 firmware
authorMike Isely <isely@pobox.com>
Wed, 25 Nov 2009 05:52:06 +0000 (02:52 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:42:09 +0000 (18:42 -0200)
This pvrusb2 change is in support of an existing feature used to help
identify and locate newer vendor supplied firmware.  This change makes
the feature work for the newer larger firmware size.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-debugifc.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-hdw.h

index 010018bc8383158a37cad7472daa2d2ea4bdcb8a..ae977668c4969d29fd1e9d983e1b394dbcd9e968 100644 (file)
@@ -252,11 +252,15 @@ static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
                        scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
                        if (scnt && wptr) {
                                count -= scnt; buf += scnt;
-                               if (debugifc_match_keyword(wptr,wlen,"prom")) {
-                                       pvr2_hdw_cpufw_set_enabled(hdw,!0,!0);
-                               } else if (debugifc_match_keyword(wptr,wlen,
-                                                                 "ram")) {
-                                       pvr2_hdw_cpufw_set_enabled(hdw,0,!0);
+                               if (debugifc_match_keyword(wptr, wlen,
+                                                          "prom")) {
+                                       pvr2_hdw_cpufw_set_enabled(hdw, 2, !0);
+                               } else if (debugifc_match_keyword(wptr, wlen,
+                                                                 "ram8k")) {
+                                       pvr2_hdw_cpufw_set_enabled(hdw, 0, !0);
+                               } else if (debugifc_match_keyword(wptr, wlen,
+                                                                 "ram16k")) {
+                                       pvr2_hdw_cpufw_set_enabled(hdw, 1, !0);
                                } else {
                                        return -EINVAL;
                                }
index 9be04772c723d69cab313a02fa3d4859ae8c0293..bd05ec7b1cbe7d1771ac96403c499bd7bc89225e 100644 (file)
@@ -3514,7 +3514,7 @@ static u8 *pvr2_full_eeprom_fetch(struct pvr2_hdw *hdw)
 
 
 void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
-                               int prom_flag,
+                               int mode,
                                int enable_flag)
 {
        int ret;
@@ -3537,11 +3537,12 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
                        break;
                }
 
-               hdw->fw_cpu_flag = (prom_flag == 0);
+               hdw->fw_cpu_flag = (mode != 2);
                if (hdw->fw_cpu_flag) {
+                       hdw->fw_size = (mode == 1) ? 0x4000 : 0x2000;
                        pvr2_trace(PVR2_TRACE_FIRMWARE,
-                                  "Preparing to suck out CPU firmware");
-                       hdw->fw_size = 0x2000;
+                                  "Preparing to suck out CPU firmware"
+                                  " (size=%u)", hdw->fw_size);
                        hdw->fw_buffer = kzalloc(hdw->fw_size,GFP_KERNEL);
                        if (!hdw->fw_buffer) {
                                hdw->fw_size = 0;
index 7b6940554e9a93848fd99b04469b53281156a431..56e70eae20c12e87f14e5dd5c4cdcafdd7e53e42 100644 (file)
@@ -219,7 +219,7 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
    this may prevent the device from running (and leaving this mode may
    imply a device reset). */
 void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *,
-                               int prom_flag,
+                               int mode, /* 0=8KB FX2, 1=16KB FX2, 2=PROM */
                                int enable_flag);
 
 /* Return true if we're in a mode for retrieval CPU firmware */