mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
rm rk2818_gpio_suspend/rk2818_gpio_resume, use sysdev
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/sysdev.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/gpio.h>
|
||||
@@ -631,7 +632,8 @@ static int gpio_irq_set_wake(unsigned irq, unsigned state)
|
||||
return 0;
|
||||
|
||||
}
|
||||
void rk2818_gpio_resume(void)
|
||||
|
||||
static int rk2818_gpio_resume(struct sys_device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -644,10 +646,11 @@ void rk2818_gpio_resume(void)
|
||||
clk_enable(rk2818gpio_chip[i].bank->clock);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rk2818_gpio_suspend(void)
|
||||
static int rk2818_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -662,7 +665,8 @@ void rk2818_gpio_suspend(void)
|
||||
else if(wakeups[i])
|
||||
rk2818_gpio_write(rk2818gpio_chip[i].regbase,GPIO_INTEN,wakeups[i]);
|
||||
}
|
||||
return;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1201,6 +1205,26 @@ static void rk2818_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
||||
return;
|
||||
}
|
||||
|
||||
static struct sysdev_class rk2818_gpio_sysclass = {
|
||||
.name = "gpio",
|
||||
.suspend = rk2818_gpio_suspend,
|
||||
.resume = rk2818_gpio_resume,
|
||||
};
|
||||
|
||||
static struct sys_device rk2818_gpio_device = {
|
||||
.cls = &rk2818_gpio_sysclass,
|
||||
};
|
||||
|
||||
static int __init rk2818_gpio_sysinit(void)
|
||||
{
|
||||
int ret = sysdev_class_register(&rk2818_gpio_sysclass);
|
||||
if (ret == 0)
|
||||
ret = sysdev_register(&rk2818_gpio_device);
|
||||
return ret;
|
||||
}
|
||||
|
||||
arch_initcall(rk2818_gpio_sysinit);
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Name : rk2818_gpio_init
|
||||
Desc : enable GPIO pin support.
|
||||
|
||||
@@ -179,8 +179,6 @@ struct rk2818_gpio_bank {
|
||||
#ifndef __ASSEMBLY__
|
||||
extern void __init rk2818_gpio_init(struct rk2818_gpio_bank *data, int nr_banks);
|
||||
extern void __init rk2818_gpio_irq_setup(void);
|
||||
extern void rk2818_gpio_suspend(void);
|
||||
extern void rk2818_gpio_resume(void);
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/* wrappers for "new style" GPIO calls. the old RK2818-specfic ones should
|
||||
|
||||
@@ -175,9 +175,9 @@ static int __tcmfunc rk2818_tcm_idle(void)
|
||||
break;
|
||||
}
|
||||
|
||||
__udelay(5 << 8);
|
||||
tcm_udelay(5 << 8, 24);
|
||||
scu_writel(scu_clksel0, SCU_CLKSEL0_CON);
|
||||
__udelay(5);
|
||||
tcm_udelay(5, 24);
|
||||
|
||||
scu_writel(scu_mode, SCU_MODE_CON); // normal
|
||||
|
||||
@@ -187,7 +187,7 @@ static int __tcmfunc rk2818_tcm_idle(void)
|
||||
static void rk2818_idle(void)
|
||||
{
|
||||
unsigned long old_sp;
|
||||
unsigned long tcm_sp = ITCM_END + 1;
|
||||
unsigned long tcm_sp = ITCM_END & ~7;
|
||||
|
||||
asm volatile ("mov %0, sp" : "=r" (old_sp));
|
||||
asm volatile ("mov sp, %0" :: "r" (tcm_sp));
|
||||
@@ -197,13 +197,9 @@ static void rk2818_idle(void)
|
||||
|
||||
static int rk2818_pm_enter(suspend_state_t state)
|
||||
{
|
||||
rk2818_gpio_suspend();
|
||||
|
||||
rk2818_idle();
|
||||
__udelay(40);
|
||||
|
||||
rk2818_gpio_resume();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user