mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
s5l87xx: Use pointer arithmetic in register address calculation
This allows to reuse a register definition across similar SoCs that have the same layout of registers (same offsets), but are using a different base address for the peripheral. The include guard was also fixed to reflect the new file name of the header. Some registers were renamed in order to match the datasheet and for consistency with the other register numbering. Change-Id: I0192e227a3c467504b8fcd1eb684a7fc861f7896
This commit is contained in:
parent
18fdb41b2c
commit
375a6bc9b1
7 changed files with 872 additions and 888 deletions
|
|
@ -381,7 +381,7 @@ static void s5l_clickwheel_init(void)
|
|||
PDAT10 &= ~2;
|
||||
#elif CONFIG_CPU==S5L8702 || CONFIG_CPU==S5L8720
|
||||
clockgate_enable(CLOCKGATE_CWHEEL, true);
|
||||
PCONE = (PCONE & ~0x00ffff00) | 0x00222200;
|
||||
PCON14 = (PCON14 & ~0x00ffff00) | 0x00222200;
|
||||
WHEEL00 = 0; /* stop s5l8702 controller */
|
||||
WHEELINT = 7;
|
||||
WHEEL10 = 1;
|
||||
|
|
@ -420,7 +420,7 @@ bool headphones_inserted(void)
|
|||
#if CONFIG_CPU==S5L8701
|
||||
return ((PDAT14 & (1 << 5)) != 0);
|
||||
#elif CONFIG_CPU==S5L8702 || CONFIG_CPU==S5L8720
|
||||
return ((PDATA & (1 << 6)) != 0);
|
||||
return ((PDAT10 & (1 << 6)) != 0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -455,7 +455,7 @@ int button_read_device(void)
|
|||
PWRCONEXT |= 1;
|
||||
#elif CONFIG_CPU==S5L8702 || CONFIG_CPU==S5L8720
|
||||
WHEEL00 = 0;
|
||||
PCONE = (PCONE & ~0x00ffff00) | 0x000e0e00;
|
||||
PCON14 = (PCON14 & ~0x00ffff00) | 0x000e0e00;
|
||||
clockgate_enable(CLOCKGATE_CWHEEL, false);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue