mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
s5l8702: CONSTify the clocking setup
Change-Id: I88f7a2e176606b718d778a5a4a5756c4c4b58c03
This commit is contained in:
parent
afa096e8b9
commit
fb8b52eaf1
3 changed files with 6 additions and 6 deletions
|
@ -183,10 +183,10 @@ int soc_get_hsdiv(void)
|
|||
}
|
||||
|
||||
/* each target/app could define its own clk_modes table */
|
||||
struct clocking_mode *clk_modes;
|
||||
const struct clocking_mode *clk_modes;
|
||||
int cur_level = -1;
|
||||
|
||||
void clocking_init(struct clocking_mode *modes, int level)
|
||||
void clocking_init(const struct clocking_mode *modes, int level)
|
||||
{
|
||||
/* at this point, CK16_SYS should be already configured
|
||||
and enabled by emCORE/bootloader */
|
||||
|
@ -196,14 +196,14 @@ void clocking_init(struct clocking_mode *modes, int level)
|
|||
cur_level = level;
|
||||
|
||||
/* start initial level */
|
||||
struct clocking_mode *m = clk_modes + cur_level;
|
||||
const struct clocking_mode *m = clk_modes + cur_level;
|
||||
soc_set_hsdiv(m->hsdiv);
|
||||
soc_set_system_divs(m->cdiv, m->hdiv, m->hprat);
|
||||
}
|
||||
|
||||
void set_clocking_level(int level)
|
||||
{
|
||||
struct clocking_mode *cur, *next;
|
||||
const struct clocking_mode *cur, *next;
|
||||
|
||||
int step = (level < cur_level) ? -1 : 1;
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ struct clocking_mode
|
|||
uint8_t hsdiv; /* TBC: SM1_Clk = HClk / hsdiv, hsdiv >= 1 */
|
||||
};
|
||||
|
||||
void clocking_init(struct clocking_mode *modes, int init_level);
|
||||
void clocking_init(const struct clocking_mode *modes, int init_level);
|
||||
void set_clocking_level(int level);
|
||||
unsigned get_system_freqs(unsigned *cclk, unsigned *hclk, unsigned *pclk);
|
||||
void clockgate_enable(int gate, bool enable);
|
||||
|
|
|
@ -110,7 +110,7 @@ default_interrupt(INT_IRQ63);
|
|||
|
||||
static int current_irq;
|
||||
|
||||
static struct clocking_mode clk_modes[] =
|
||||
static const struct clocking_mode clk_modes[] =
|
||||
{
|
||||
/* cdiv hdiv hprat hsdiv */ /* CClk HClk PClk SM1Clk FPS */
|
||||
{ 1, 2, 2, 4 }, /* 216 108 54 27 42 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue