mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
Merge branch 'sh/for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: sh7724 ddr self-refresh changes sh: use in-soc KEYSC on se7724 sh: CMT suspend/resume sh: skip disabled LCDC channels
This commit is contained in:
commit
b9d030a123
4 changed files with 106 additions and 6 deletions
|
@ -238,7 +238,7 @@ static struct platform_device ceu1_device = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* KEYSC */
|
/* KEYSC in SoC (Needs SW33-2 set to ON) */
|
||||||
static struct sh_keysc_info keysc_info = {
|
static struct sh_keysc_info keysc_info = {
|
||||||
.mode = SH_KEYSC_MODE_1,
|
.mode = SH_KEYSC_MODE_1,
|
||||||
.scan_timing = 10,
|
.scan_timing = 10,
|
||||||
|
@ -255,12 +255,13 @@ static struct sh_keysc_info keysc_info = {
|
||||||
|
|
||||||
static struct resource keysc_resources[] = {
|
static struct resource keysc_resources[] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
.start = 0x1a204000,
|
.name = "KEYSC",
|
||||||
.end = 0x1a20400f,
|
.start = 0x044b0000,
|
||||||
|
.end = 0x044b000f,
|
||||||
.flags = IORESOURCE_MEM,
|
.flags = IORESOURCE_MEM,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
.start = IRQ0_KEY,
|
.start = 79,
|
||||||
.flags = IORESOURCE_IRQ,
|
.flags = IORESOURCE_IRQ,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,8 +26,30 @@ ENTRY(sh_mobile_standby)
|
||||||
|
|
||||||
tst #SUSP_SH_SF, r0
|
tst #SUSP_SH_SF, r0
|
||||||
bt skip_set_sf
|
bt skip_set_sf
|
||||||
|
#ifdef CONFIG_CPU_SUBTYPE_SH7724
|
||||||
|
/* DBSC: put memory in self-refresh mode */
|
||||||
|
|
||||||
/* SDRAM: disable power down and put in self-refresh mode */
|
mov.l dben_reg, r4
|
||||||
|
mov.l dben_data0, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbrfpdn0_reg, r4
|
||||||
|
mov.l dbrfpdn0_data0, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbcmdcnt_reg, r4
|
||||||
|
mov.l dbcmdcnt_data0, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbcmdcnt_reg, r4
|
||||||
|
mov.l dbcmdcnt_data1, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbrfpdn0_reg, r4
|
||||||
|
mov.l dbrfpdn0_data1, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
#else
|
||||||
|
/* SBSC: disable power down and put in self-refresh mode */
|
||||||
mov.l 1f, r4
|
mov.l 1f, r4
|
||||||
mov.l 2f, r1
|
mov.l 2f, r1
|
||||||
mov.l @r4, r2
|
mov.l @r4, r2
|
||||||
|
@ -35,6 +57,7 @@ ENTRY(sh_mobile_standby)
|
||||||
mov.l 3f, r3
|
mov.l 3f, r3
|
||||||
and r3, r2
|
and r3, r2
|
||||||
mov.l r2, @r4
|
mov.l r2, @r4
|
||||||
|
#endif
|
||||||
|
|
||||||
skip_set_sf:
|
skip_set_sf:
|
||||||
tst #SUSP_SH_SLEEP, r0
|
tst #SUSP_SH_SLEEP, r0
|
||||||
|
@ -84,7 +107,36 @@ done_sleep:
|
||||||
tst #SUSP_SH_SF, r0
|
tst #SUSP_SH_SF, r0
|
||||||
bt skip_restore_sf
|
bt skip_restore_sf
|
||||||
|
|
||||||
/* SDRAM: set auto-refresh mode */
|
#ifdef CONFIG_CPU_SUBTYPE_SH7724
|
||||||
|
/* DBSC: put memory in auto-refresh mode */
|
||||||
|
|
||||||
|
mov.l dbrfpdn0_reg, r4
|
||||||
|
mov.l dbrfpdn0_data0, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
/* sleep 140 ns */
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
|
||||||
|
mov.l dbcmdcnt_reg, r4
|
||||||
|
mov.l dbcmdcnt_data0, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbcmdcnt_reg, r4
|
||||||
|
mov.l dbcmdcnt_data1, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dben_reg, r4
|
||||||
|
mov.l dben_data1, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
|
||||||
|
mov.l dbrfpdn0_reg, r4
|
||||||
|
mov.l dbrfpdn0_data2, r1
|
||||||
|
mov.l r1, @r4
|
||||||
|
#else
|
||||||
|
/* SBSC: set auto-refresh mode */
|
||||||
mov.l 1f, r4
|
mov.l 1f, r4
|
||||||
mov.l @r4, r2
|
mov.l @r4, r2
|
||||||
mov.l 4f, r3
|
mov.l 4f, r3
|
||||||
|
@ -98,15 +150,29 @@ done_sleep:
|
||||||
add r4, r3
|
add r4, r3
|
||||||
or r2, r3
|
or r2, r3
|
||||||
mov.l r3, @r1
|
mov.l r3, @r1
|
||||||
|
#endif
|
||||||
skip_restore_sf:
|
skip_restore_sf:
|
||||||
rts
|
rts
|
||||||
nop
|
nop
|
||||||
|
|
||||||
.balign 4
|
.balign 4
|
||||||
|
#ifdef CONFIG_CPU_SUBTYPE_SH7724
|
||||||
|
dben_reg: .long 0xfd000010 /* DBEN */
|
||||||
|
dben_data0: .long 0
|
||||||
|
dben_data1: .long 1
|
||||||
|
dbrfpdn0_reg: .long 0xfd000040 /* DBRFPDN0 */
|
||||||
|
dbrfpdn0_data0: .long 0
|
||||||
|
dbrfpdn0_data1: .long 1
|
||||||
|
dbrfpdn0_data2: .long 0x00010000
|
||||||
|
dbcmdcnt_reg: .long 0xfd000014 /* DBCMDCNT */
|
||||||
|
dbcmdcnt_data0: .long 2
|
||||||
|
dbcmdcnt_data1: .long 4
|
||||||
|
#else
|
||||||
1: .long 0xfe400008 /* SDCR0 */
|
1: .long 0xfe400008 /* SDCR0 */
|
||||||
2: .long 0x00000400
|
2: .long 0x00000400
|
||||||
3: .long 0xffff7fff
|
3: .long 0xffff7fff
|
||||||
4: .long 0xfffffbff
|
4: .long 0xfffffbff
|
||||||
|
#endif
|
||||||
5: .long 0xa4150020 /* STBCR */
|
5: .long 0xa4150020 /* STBCR */
|
||||||
6: .long 0xfe40001c /* RTCOR */
|
6: .long 0xfe40001c /* RTCOR */
|
||||||
7: .long 0xfe400018 /* RTCNT */
|
7: .long 0xfe400018 /* RTCNT */
|
||||||
|
|
|
@ -40,6 +40,7 @@ struct sh_cmt_priv {
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
unsigned long flags_suspend;
|
||||||
unsigned long match_value;
|
unsigned long match_value;
|
||||||
unsigned long next_match_value;
|
unsigned long next_match_value;
|
||||||
unsigned long max_match_value;
|
unsigned long max_match_value;
|
||||||
|
@ -667,11 +668,38 @@ static int __devexit sh_cmt_remove(struct platform_device *pdev)
|
||||||
return -EBUSY; /* cannot unregister clockevent and clocksource */
|
return -EBUSY; /* cannot unregister clockevent and clocksource */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sh_cmt_suspend(struct device *dev)
|
||||||
|
{
|
||||||
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
struct sh_cmt_priv *p = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
/* save flag state and stop CMT channel */
|
||||||
|
p->flags_suspend = p->flags;
|
||||||
|
sh_cmt_stop(p, p->flags);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int sh_cmt_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
struct sh_cmt_priv *p = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
/* start CMT channel from saved state */
|
||||||
|
sh_cmt_start(p, p->flags_suspend);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct dev_pm_ops sh_cmt_dev_pm_ops = {
|
||||||
|
.suspend = sh_cmt_suspend,
|
||||||
|
.resume = sh_cmt_resume,
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver sh_cmt_device_driver = {
|
static struct platform_driver sh_cmt_device_driver = {
|
||||||
.probe = sh_cmt_probe,
|
.probe = sh_cmt_probe,
|
||||||
.remove = __devexit_p(sh_cmt_remove),
|
.remove = __devexit_p(sh_cmt_remove),
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "sh_cmt",
|
.name = "sh_cmt",
|
||||||
|
.pm = &sh_cmt_dev_pm_ops,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -481,6 +481,9 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
|
||||||
/* tell the board code to enable the panel */
|
/* tell the board code to enable the panel */
|
||||||
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
|
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
|
||||||
ch = &priv->ch[k];
|
ch = &priv->ch[k];
|
||||||
|
if (!ch->enabled)
|
||||||
|
continue;
|
||||||
|
|
||||||
board_cfg = &ch->cfg.board_cfg;
|
board_cfg = &ch->cfg.board_cfg;
|
||||||
if (board_cfg->display_on)
|
if (board_cfg->display_on)
|
||||||
board_cfg->display_on(board_cfg->board_data);
|
board_cfg->display_on(board_cfg->board_data);
|
||||||
|
@ -498,6 +501,8 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
|
||||||
/* clean up deferred io and ask board code to disable panel */
|
/* clean up deferred io and ask board code to disable panel */
|
||||||
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
|
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
|
||||||
ch = &priv->ch[k];
|
ch = &priv->ch[k];
|
||||||
|
if (!ch->enabled)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* deferred io mode:
|
/* deferred io mode:
|
||||||
* flush frame, and wait for frame end interrupt
|
* flush frame, and wait for frame end interrupt
|
||||||
|
|
Loading…
Reference in a new issue