Skip to content

Commit

Permalink
Add set_clock_rate
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Nov 28, 2021
1 parent d1f4701 commit ef330ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/info.c
Expand Up @@ -57,6 +57,13 @@ unsigned int get_clock_rate(int clk_id) {
}
}

void set_clock_rate(int clk_id, unsigned int value) {
RPI_PropertyInit();
RPI_PropertyAddTag(TAG_SET_CLOCK_RATE, clk_id, value, 0);
RPI_PropertyProcess();
}


void set_clock_rates(unsigned int cpu, unsigned int core, unsigned int sdram) {
static unsigned int old_core = -1;
static unsigned int old_cpu = -1;
Expand Down
1 change: 1 addition & 0 deletions src/info.h
Expand Up @@ -22,6 +22,7 @@ extern int get_speed();
extern char *get_info_string();

extern unsigned int get_clock_rate(int clk_id);
extern void set_clock_rate(int clk_id, unsigned int value);
extern void set_clock_rates(unsigned int cpu, unsigned int core, unsigned int sdram);

int get_revision();
Expand Down

0 comments on commit ef330ca

Please sign in to comment.