Make enum names consistent

This commit is contained in:
TuxSH 2018-03-05 23:59:46 +01:00
parent 827280ca12
commit a65d380889
5 changed files with 25 additions and 25 deletions

View file

@ -4,7 +4,7 @@
#include "car.h"
#include "timers.h"
static inline uint32_t get_special_clk_reg(car_device_t dev) {
static inline uint32_t get_special_clk_reg(CarDevice dev) {
switch (dev) {
case CARDEVICE_UARTA: return 0x178;
case CARDEVICE_UARTB: return 0x17C;
@ -15,7 +15,7 @@ static inline uint32_t get_special_clk_reg(car_device_t dev) {
}
}
static inline uint32_t get_special_clk_val(car_device_t dev) {
static inline uint32_t get_special_clk_val(CarDevice dev) {
switch (dev) {
case CARDEVICE_UARTA: return 0;
case CARDEVICE_UARTB: return 0;
@ -29,7 +29,7 @@ static inline uint32_t get_special_clk_val(car_device_t dev) {
static uint32_t g_clk_reg_offsets[NUM_CAR_BANKS] = {0x320, 0x328, 0x330, 0x440, 0x448, 0x284, 0x29C};
static uint32_t g_rst_reg_offsets[NUM_CAR_BANKS] = {0x300, 0x308, 0x310, 0x430, 0x438, 0x290, 0x2A8};
void clk_enable(car_device_t dev) {
void clk_enable(CarDevice dev) {
uint32_t special_reg;
if ((special_reg = get_special_clk_reg(dev))) {
MAKE_CAR_REG(special_reg) = get_special_clk_val(dev);
@ -37,30 +37,30 @@ void clk_enable(car_device_t dev) {
MAKE_CAR_REG(g_clk_reg_offsets[dev >> 5]) |= BIT(dev & 0x1F);
}
void clk_disable(car_device_t dev) {
void clk_disable(CarDevice dev) {
MAKE_CAR_REG(g_clk_reg_offsets[dev >> 5] + 0x004) |= BIT(dev & 0x1F);
}
void rst_enable(car_device_t dev) {
void rst_enable(CarDevice dev) {
MAKE_CAR_REG(g_rst_reg_offsets[dev >> 5]) |= BIT(dev & 0x1F);
}
void rst_disable(car_device_t dev) {
void rst_disable(CarDevice dev) {
MAKE_CAR_REG(g_rst_reg_offsets[dev >> 5] + 0x004) |= BIT(dev & 0x1F);
}
void clkrst_enable(car_device_t dev) {
void clkrst_enable(CarDevice dev) {
clk_enable(dev);
rst_disable(dev);
}
void clkrst_disable(car_device_t dev) {
void clkrst_disable(CarDevice dev) {
rst_enable(dev);
clk_disable(dev);
}
void clkrst_reboot(car_device_t dev) {
void clkrst_reboot(CarDevice dev) {
clkrst_disable(dev);
wait(100);
clkrst_enable(dev);

View file

@ -23,16 +23,16 @@ typedef enum {
CARDEVICE_I2C1 = 12,
CARDEVICE_I2C5 = 47,
CARDEVICE_BPMP = 1
} car_device_t;
} CarDevice;
void clk_enable(car_device_t dev);
void clk_disable(car_device_t dev);
void rst_enable(car_device_t dev);
void rst_disable(car_device_t dev);
void clk_enable(CarDevice dev);
void clk_disable(CarDevice dev);
void rst_enable(CarDevice dev);
void rst_disable(CarDevice dev);
void clkrst_enable(car_device_t dev);
void clkrst_disable(car_device_t dev);
void clkrst_enable(CarDevice dev);
void clkrst_disable(CarDevice dev);
void clkrst_reboot(car_device_t dev);
void clkrst_reboot(CarDevice dev);
#endif

View file

@ -10,7 +10,7 @@
static bool g_battery_profile = false;
uint32_t configitem_set(enum ConfigItem item, uint64_t value) {
uint32_t configitem_set(ConfigItem item, uint64_t value) {
if (item != CONFIGITEM_BATTERYPROFILE) {
return 2;
}
@ -49,7 +49,7 @@ uint64_t configitem_get_hardware_type(void) {
return hardware_type;
}
uint32_t configitem_get(enum ConfigItem item, uint64_t *p_outvalue) {
uint32_t configitem_get(ConfigItem item, uint64_t *p_outvalue) {
uint32_t result = 0;
switch (item) {
case CONFIGITEM_DISABLEPROGRAMVERIFICATION:

View file

@ -4,7 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
enum ConfigItem {
typedef enum {
CONFIGITEM_DISABLEPROGRAMVERIFICATION = 1,
CONFIGITEM_DRAMID = 2,
CONFIGITEM_SECURITYENGINEIRQ = 3,
@ -18,10 +18,10 @@ enum ConfigItem {
CONFIGITEM_ISDEBUGMODE = 11,
CONFIGITEM_KERNELMEMORYCONFIGURATION = 12,
CONFIGITEM_BATTERYPROFILE = 13
};
} ConfigItem;
uint32_t configitem_set(enum ConfigItem item, uint64_t value);
uint32_t configitem_get(enum ConfigItem item, uint64_t *p_outvalue);
uint32_t configitem_set(ConfigItem item, uint64_t value);
uint32_t configitem_get(ConfigItem item, uint64_t *p_outvalue);
bool configitem_is_recovery_boot(void);
bool configitem_is_retail(void);

View file

@ -241,13 +241,13 @@ uint32_t smc_wrapper_async(smc_args_t *args, uint32_t (*handler)(smc_args_t *),
uint32_t smc_set_config(smc_args_t *args) {
/* Actual value presumed in X3 on hardware. */
return configitem_set((enum ConfigItem)args->X[1], args->X[3]);
return configitem_set((ConfigItem)args->X[1], args->X[3]);
}
uint32_t smc_get_config(smc_args_t *args) {
uint64_t out_item = 0;
uint32_t result;
result = configitem_get((enum ConfigItem)args->X[1], &out_item);
result = configitem_get((ConfigItem)args->X[1], &out_item);
args->X[1] = out_item;
return result;
}