media: staging: media: zoran: remove detect_guest_activity
authorCorentin Labbe <clabbe@baylibre.com>
Tue, 18 May 2021 12:41:09 +0000 (14:41 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 2 Jun 2021 12:01:53 +0000 (14:01 +0200)
The detect_guest_activity function is no longer used, so lets removed it.

[hverkuil: remove dump_guests() as well as that too is now unused]

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/zoran/zoran_device.c
drivers/staging/media/zoran/zoran_device.h

index cf788d9..5b12a73 100644 (file)
@@ -148,71 +148,6 @@ int post_office_read(struct zoran *zr, unsigned int guest, unsigned int reg)
 }
 
 /*
- * detect guests
- */
-
-static void dump_guests(struct zoran *zr)
-{
-       if (zr36067_debug > 2) {
-               int i, guest[8];
-
-               /* do not print random data */
-               guest[0] = 0;
-
-               for (i = 1; i < 8; i++) /* Don't read jpeg codec here */
-                       guest[i] = post_office_read(zr, i, 0);
-
-               pci_info(zr->pci_dev, "Guests: %*ph\n", 8, guest);
-       }
-}
-
-void detect_guest_activity(struct zoran *zr)
-{
-       int timeout, i, j, res, guest[8], guest0[8], change[8][3];
-       ktime_t t0, t1;
-
-       /* do not print random data */
-       guest[0] = 0;
-       guest0[0] = 0;
-
-       dump_guests(zr);
-       pci_info(zr->pci_dev, "Detecting guests activity, please wait...\n");
-       for (i = 1; i < 8; i++) /* Don't read jpeg codec here */
-               guest0[i] = guest[i] = post_office_read(zr, i, 0);
-
-       timeout = 0;
-       j = 0;
-       t0 = ktime_get();
-       while (timeout < 10000) {
-               udelay(10);
-               timeout++;
-               for (i = 1; (i < 8) && (j < 8); i++) {
-                       res = post_office_read(zr, i, 0);
-                       if (res != guest[i]) {
-                               t1 = ktime_get();
-                               change[j][0] = ktime_to_us(ktime_sub(t1, t0));
-                               t0 = t1;
-                               change[j][1] = i;
-                               change[j][2] = res;
-                               j++;
-                               guest[i] = res;
-                       }
-               }
-               if (j >= 8)
-                       break;
-       }
-
-       pci_info(zr->pci_dev, "Guests: %*ph\n", 8, guest0);
-
-       if (j == 0) {
-               pci_info(zr->pci_dev, "No activity detected.\n");
-               return;
-       }
-       for (i = 0; i < j; i++)
-               pci_info(zr->pci_dev, "%6d: %d => 0x%02x\n", change[i][0], change[i][1], change[i][2]);
-}
-
-/*
  * JPEG Codec access
  */
 
index 24be19a..6c5d702 100644 (file)
@@ -20,8 +20,6 @@ extern int post_office_wait(struct zoran *zr);
 extern int post_office_write(struct zoran *zr, unsigned int guest, unsigned int reg, unsigned int value);
 extern int post_office_read(struct zoran *zr, unsigned int guest, unsigned int reg);
 
-extern void detect_guest_activity(struct zoran *zr);
-
 extern void jpeg_codec_sleep(struct zoran *zr, int sleep);
 extern int jpeg_codec_reset(struct zoran *zr);