From 7a5130a27722b95f0de965e99e1fd7cb322cafcf Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 27 Sep 2021 17:18:19 +0100 Subject: x1000: fix broken OST2 timer prescaler It turns out the prescaler fields in OST_CTRL are 2 bits wide, not 3. The programming manual (as usual) is ambiguous and its diagram shows 2-bit wide fields, but the bit positions in the text give a 3-bit wide field. Ingenic's Linux code and my own testing shows that they are, in fact, 2 bits wide. This caused the OST2 divisor to be 16 instead of 4; the OST1 divisor was correct. This means that all udelay/mdelay calls took 4x longer than they should've. After this change the OST2 prescaler will be 4, as intended, and udelay/mdelay calls will wait for the intended duration. Change-Id: I2ac0a9190f49b59a840c649bf586131f5f9fde82 --- firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/target/mips/ingenic_x1000/fiiom3k') diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c index 4354257f7b..04e3102d42 100644 --- a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c +++ b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c @@ -45,11 +45,11 @@ #define STATE_SCROLLING 4 /* Assume there's no active touch if no event is reported in this time */ -#define AUTORELEASE_TIME (10000 * OST_TICKS_PER_US) +#define AUTORELEASE_TIME (40 * 1000 * OST_TICKS_PER_US) /* If there's no significant motion on the scrollbar for this time, * then report it as a button press instead */ -#define SCROLL_PRESS_TIME (100000 * OST_TICKS_PER_US) +#define SCROLL_PRESS_TIME (400 * 1000 * OST_TICKS_PER_US) /* If a press on the scrollbar moves more than this during SCROLL_PRESS_TIME, * then we enter scrolling mode. */ -- cgit v1.2.3