reset_source: rename set_reset_source to reset_source_set
To get all reset source related functions into the same function namespace. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
b34140af5b
commit
0099a887c0
|
@ -30,13 +30,13 @@ static void imx1_detect_reset_source(void)
|
|||
|
||||
switch (val) {
|
||||
case RSR_EXR:
|
||||
set_reset_source(RESET_RST);
|
||||
reset_source_set(RESET_RST);
|
||||
return;
|
||||
case RSR_WDR:
|
||||
set_reset_source(RESET_WDG);
|
||||
reset_source_set(RESET_WDG);
|
||||
return;
|
||||
case 0:
|
||||
set_reset_source(RESET_POR);
|
||||
reset_source_set(RESET_POR);
|
||||
return;
|
||||
default:
|
||||
/* else keep the default 'unknown' state */
|
||||
|
|
|
@ -25,15 +25,15 @@ static int pxa_detect_reset_source(void)
|
|||
* Order is important, as many bits can be set together
|
||||
*/
|
||||
if (reg & RCSR_GPR)
|
||||
set_reset_source(RESET_RST);
|
||||
reset_source_set(RESET_RST);
|
||||
else if (reg & RCSR_WDR)
|
||||
set_reset_source(RESET_WDG);
|
||||
reset_source_set(RESET_WDG);
|
||||
else if (reg & RCSR_HWR)
|
||||
set_reset_source(RESET_POR);
|
||||
reset_source_set(RESET_POR);
|
||||
else if (reg & RCSR_SMR)
|
||||
set_reset_source(RESET_WKE);
|
||||
reset_source_set(RESET_WKE);
|
||||
else
|
||||
set_reset_source(RESET_UKWN);
|
||||
reset_source_set(RESET_UKWN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -29,21 +29,21 @@ static int s3c_detect_reset_source(void)
|
|||
u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||
|
||||
if (reg & S3C2440_GSTATUS2_PWRST) {
|
||||
set_reset_source(RESET_POR);
|
||||
reset_source_set(RESET_POR);
|
||||
writel(S3C2440_GSTATUS2_PWRST,
|
||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (reg & S3C2440_GSTATUS2_SLEEPRST) {
|
||||
set_reset_source(RESET_WKE);
|
||||
reset_source_set(RESET_WKE);
|
||||
writel(S3C2440_GSTATUS2_SLEEPRST,
|
||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (reg & S3C2440_GSTATUS2_WDRST) {
|
||||
set_reset_source(RESET_WDG);
|
||||
reset_source_set(RESET_WDG);
|
||||
writel(S3C2440_GSTATUS2_WDRST,
|
||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||
return 0;
|
||||
|
|
|
@ -27,18 +27,18 @@ static const char * const reset_src_names[] = {
|
|||
[RESET_JTAG] = "JTAG",
|
||||
};
|
||||
|
||||
void set_reset_source(enum reset_src_type st)
|
||||
void reset_source_set(enum reset_src_type st)
|
||||
{
|
||||
setenv("global.system.reset", reset_src_names[st]);
|
||||
}
|
||||
EXPORT_SYMBOL(set_reset_source);
|
||||
EXPORT_SYMBOL(reset_source_set);
|
||||
|
||||
/* ensure this runs after the 'global' device is already registerd */
|
||||
static int init_reset_source(void)
|
||||
static int reset_source_init(void)
|
||||
{
|
||||
globalvar_add_simple("system.reset", reset_src_names[RESET_UKWN]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
coredevice_initcall(init_reset_source);
|
||||
coredevice_initcall(reset_source_init);
|
||||
|
|
|
@ -163,20 +163,20 @@ static void __maybe_unused imx28_detect_reset_source(const struct imx28_wd *p)
|
|||
if (reg & MXS_RTC_PERSISTENT0_ALARM_WAKE) {
|
||||
writel(MXS_RTC_PERSISTENT0_ALARM_WAKE,
|
||||
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
||||
set_reset_source(RESET_WKE);
|
||||
reset_source_set(RESET_WKE);
|
||||
return;
|
||||
}
|
||||
set_reset_source(RESET_POR);
|
||||
reset_source_set(RESET_POR);
|
||||
return;
|
||||
}
|
||||
if (reg & MXS_RTC_PERSISTENT0_THM_RST) {
|
||||
writel(MXS_RTC_PERSISTENT0_THM_RST,
|
||||
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
||||
set_reset_source(RESET_RST);
|
||||
reset_source_set(RESET_RST);
|
||||
return;
|
||||
}
|
||||
|
||||
set_reset_source(RESET_RST);
|
||||
reset_source_set(RESET_RST);
|
||||
}
|
||||
|
||||
static int imx28_wd_probe(struct device_d *dev)
|
||||
|
|
|
@ -130,17 +130,17 @@ static void imx_watchdog_detect_reset_source(struct imx_wd *priv)
|
|||
u16 val = readw(priv->base + IMX21_WDOG_WSTR);
|
||||
|
||||
if (val & WSTR_COLDSTART) {
|
||||
set_reset_source(RESET_POR);
|
||||
reset_source_set(RESET_POR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (val & (WSTR_HARDRESET | WSTR_WARMSTART)) {
|
||||
set_reset_source(RESET_RST);
|
||||
reset_source_set(RESET_RST);
|
||||
return;
|
||||
}
|
||||
|
||||
if (val & WSTR_WDOG) {
|
||||
set_reset_source(RESET_WDG);
|
||||
reset_source_set(RESET_WDG);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ enum reset_src_type {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_RESET_SOURCE
|
||||
void set_reset_source(enum reset_src_type);
|
||||
void reset_source_set(enum reset_src_type);
|
||||
#else
|
||||
static inline void set_reset_source(enum reset_src_type unused)
|
||||
static inline void reset_source_set(enum reset_src_type unused)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue