V4L/DVB (6208): pvrusb2: Implement programmatic means to extract prom contents
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / pvrusb2 / pvrusb2-debugifc.c
index e9da9bb8f8dea1f8901b1428c48b2cc1ce95c8cc..6f135f4a2497d89d55d760d6f6f812cc87a5253f 100644 (file)
@@ -397,10 +397,22 @@ static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
                count -= scnt; buf += scnt;
                if (!wptr) return -EINVAL;
                if (debugifc_match_keyword(wptr,wlen,"fetch")) {
-                       pvr2_hdw_cpufw_set_enabled(hdw,!0);
+                       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);
+                               } else {
+                                       return -EINVAL;
+                               }
+                       }
+                       pvr2_hdw_cpufw_set_enabled(hdw,0,!0);
                        return 0;
                } else if (debugifc_match_keyword(wptr,wlen,"done")) {
-                       pvr2_hdw_cpufw_set_enabled(hdw,0);
+                       pvr2_hdw_cpufw_set_enabled(hdw,0,0);
                        return 0;
                } else {
                        return -EINVAL;