From 152ec1946c8263431470162482c2d3a608541c80 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 13 Oct 2024 11:25:17 +0200 Subject: [PATCH] ipod 4g/color: Fix unresponsive buttons after booting The iPod 4g and color always ignored the very first button press after booting, i.e. you needed to either press another button or scroll for a bit first. Not sure whether any other PP iPods exhibit the same behavior, although it is not reproducible on an iPod video. This patch basically copies the code from FS#5230 that fixed unresponsive buttons whenever the HOLD switch was turned off (committed as a5961c944b). Change-Id: I8d3444094e5d000e0f8e30e39a23f054abeeb0f5 --- firmware/target/arm/ipod/button-clickwheel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c index 8f238936e7..9308b7664e 100644 --- a/firmware/target/arm/ipod/button-clickwheel.c +++ b/firmware/target/arm/ipod/button-clickwheel.c @@ -327,7 +327,13 @@ void ipod_4g_button_int(void) void button_init_device(void) { opto_i2c_init(); - + + /* fixes first button press being ignored */ +#if defined(IPOD_4G) || defined(IPOD_COLOR) + outl(inl(0x7000c100) & ~0x60000000, 0x7000c100); + outl(inl(0x7000c104) | 0x04000000, 0x7000c104); + outl(inl(0x7000c100) | 0x60000000, 0x7000c100); +#endif /* hold button - enable as input */ GPIOA_ENABLE |= 0x20; GPIOA_OUTPUT_EN &= ~0x20;