FS#8519 - Headphone detection for iPod 2G is broken
Attached to Project:
Rockbox
Opened by Mark Fawcus (yapper) - Saturday, 26 January 2008, 19:28 GMT
Last edited by Marc Guay (Marc_Guay) - Monday, 21 April 2008, 01:12 GMT
Opened by Mark Fawcus (yapper) - Saturday, 26 January 2008, 19:28 GMT
Last edited by Marc Guay (Marc_Guay) - Monday, 21 April 2008, 01:12 GMT
|
DetailsCurrently button-1g-3g.c looks at GPIO C bit 0, but it appears (through experimentation on a 2G and from http://ipodlinux.org/GPIO) that the 2G and 3G models use GPIO B bit 0 (and the 1G appears to not support detection).
|
This task depends upon
Closed by Marc Guay (Marc_Guay)
Monday, 21 April 2008, 01:12 GMT
Reason for closing: Duplicate
Additional comments about closing: Patch is here: FS#8920
Monday, 21 April 2008, 01:12 GMT
Reason for closing: Duplicate
Additional comments about closing: Patch is here:
Complications (to me) in fixing this across the 1G/2G/3G include:
The 1G seems to use GPIO B bit 0 for scrollwheel enable, and the same bit is used by the 2G for headphone detection
The 1G and 2G seem to be logically grouped in the code
I'm not sure if the 3G is also broken.
I was thinking of proposing something like:
bool headphones_inserted(void)
{
#ifdef IPOD_1G2G
return (GPIOB_INPUT_VAL & 0x1)?true:false;
#else
return (GPIOC_INPUT_VAL & 0x1)?true:false;
#endif
}
to leave the 3G untouched, but this also means that the 1G will be seeing the scrollwheel enable state. Maybe someone who has more experience can unravel a solution.
bool headphones_inserted(void)
{
#ifdef IPOD_1G2G
if ((IPOD_HW_REVISION >> 16) == 2)
{
return (GPIOB_INPUT_VAL & 0x1)?true:false;
}
else
{
/* 1G has no headphone detection, so fake insertion */
return (true);
}
#else
return (GPIOC_INPUT_VAL & 0x1)?true:false;
#endif
}
I've filed a patch for this under
FS#8920that leaves the 3G detection method unchanged, and fixes it for the 2G.