Skip to content

Commit

Permalink
pm: bf609: cleanup smc nor flash
Browse files Browse the repository at this point in the history
drop smc pin state change code, pin state will be saved in pinctrl-adi2 driver
cleanup nor flash init/exit for pm suspend/resume

Signed-off-by: Steven Miao <[email protected]>
  • Loading branch information
realmz committed Jul 26, 2014
1 parent 9a3c414 commit c6a26ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 0 additions & 3 deletions arch/blackfin/mach-bf609/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,6 @@ int bf609_nor_flash_init(struct platform_device *pdev)
{
#define CONFIG_SMC_GCTL_VAL 0x00000010

if (!devm_pinctrl_get_select_default(&pdev->dev))
return -EBUSY;
bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL);
bfin_write32(SMC_B0CTL, 0x01002011);
bfin_write32(SMC_B0TIM, 0x08170977);
Expand All @@ -709,7 +707,6 @@ int bf609_nor_flash_init(struct platform_device *pdev)

void bf609_nor_flash_exit(struct platform_device *pdev)
{
devm_pinctrl_put(pdev->dev.pins->p);
bfin_write32(SMC_GCTL, 0);
}

Expand Down
5 changes: 3 additions & 2 deletions arch/blackfin/mach-bf609/include/mach/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define __MACH_BF609_PM_H__

#include <linux/suspend.h>
#include <linux/platform_device.h>

extern int bfin609_pm_enter(suspend_state_t state);
extern int bf609_pm_prepare(void);
Expand All @@ -19,6 +20,6 @@ void bf609_hibernate(void);
void bfin_sec_raise_irq(unsigned int sid);
void coreb_enable(void);

int bf609_nor_flash_init(void);
void bf609_nor_flash_exit(void);
int bf609_nor_flash_init(struct platform_device *pdev);
void bf609_nor_flash_exit(struct platform_device *pdev);
#endif
4 changes: 2 additions & 2 deletions arch/blackfin/mach-bf609/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ static struct bfin_cpu_pm_fns bf609_cpu_pm = {
#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
static int smc_pm_syscore_suspend(void)
{
bf609_nor_flash_exit();
bf609_nor_flash_exit(NULL);
return 0;
}

static void smc_pm_syscore_resume(void)
{
bf609_nor_flash_init();
bf609_nor_flash_init(NULL);
}

static struct syscore_ops smc_pm_syscore_ops = {
Expand Down

0 comments on commit c6a26ce

Please sign in to comment.