mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
ipod: Small cleanup of piezo code on PP502x-based iPods
Basically use proper register names instead of magic values. PP5002-based ipods (ie ipod1g-3g) use UART1 to drive the piezo vs PWM of the newer models. Change-Id: Ia333717a825ac6a0ebf43850fc31fca34178dd88
This commit is contained in:
parent
b09ce21023
commit
1ab63c3d92
3 changed files with 13 additions and 10 deletions
|
|
@ -43,22 +43,22 @@ static inline void piezo_hw_init(void)
|
|||
{
|
||||
#ifndef SIMULATOR
|
||||
/*logf("PIEZO: hw_init");*/
|
||||
outl(inl(0x70000010) & ~0xc, 0x70000010);
|
||||
outl(inl(0x6000600c) | 0x20000, 0x6000600c); /* enable device */
|
||||
DEV_INIT1 &= ~0xc;
|
||||
DEV_EN |= DEV_PWM;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void piezo_hw_tick(unsigned int form_and_period)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
outl(0x80000000 | form_and_period, 0x7000a000); /* set pitch */
|
||||
PWM0_CTRL = 0x80000000 | form_and_period;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void piezo_hw_stop(void)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
outl(0x0, 0x7000a000); /* piezo off */
|
||||
PWM0_CTRL = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue