[PATCH 16/22] Input: atmel_mxt_ts - improve bootloader progress output

From: Nick Dyer
Date: Mon Mar 17 2014 - 13:34:18 EST


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

Signed-off-by: Nick Dyer <nick.dyer@xxxxxxxxxxx>
Acked-by: Benson Leung <bleung@xxxxxxxxxxxx>
Acked-by: Yufeng Shen <miletus@xxxxxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
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-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/