By implementing a frame counter, print out fewer debug messages (the
firmware may contain hundreds of frames).

Signed-off-by: Nick Dyer <nick.d...@itdev.co.uk>
Acked-by: Benson Leung <ble...@chromium.org>
Acked-by: Yufeng Shen <mile...@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torok...@gmail.com>
---
 drivers/input/touchscreen/atmel_mxt_ts.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c 
b/drivers/input/touchscreen/atmel_mxt_ts.c
index 049d48a..b263ec3 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1432,6 +1432,7 @@ static int mxt_load_fw(struct device *dev, const char *fn)
        unsigned int frame_size;
        unsigned int pos = 0;
        unsigned int retry = 0;
+       unsigned int frame = 0;
        int ret;
 
        ret = request_firmware(&fw, fn, dev);
@@ -1491,9 +1492,12 @@ static int mxt_load_fw(struct device *dev, const char 
*fn)
                } else {
                        retry = 0;
                        pos += frame_size;
+                       frame++;
                }
 
-               dev_dbg(dev, "Updated %d bytes / %zd bytes\n", pos, fw->size);
+               if (frame % 50 == 0)
+                       dev_dbg(dev, "Sent %d frames, %d/%zd bytes\n",
+                               frame, pos, fw->size);
        }
 
        /* Wait for flash. */
@@ -1502,6 +1506,8 @@ static int mxt_load_fw(struct device *dev, const char *fn)
        if (ret)
                goto disable_irq;
 
+       dev_dbg(dev, "Sent %d frames, %d bytes\n", frame, pos);
+
        /*
         * Wait for device to reset. Some bootloader versions do not assert
         * the CHG line after bootloading has finished, so ignore potential
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to