Commit 1f3bd0f2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  dmaengine: shdma: fix a regression: initialise DMA channels for memcpy
  dmaengine: shdma: Fix up fallout from runtime PM changes.
  Revert "clocksource: sh_cmt: Runtime PM support"
  Revert "clocksource: sh_tmu: Runtime PM support"
  sh: Fix up asm-generic/ptrace.h fallout.
  sh64: Move from P1SEG to CAC_ADDR for consistent sync.
  sh64: asm/pgtable.h needs asm/mmu.h
  sh: asm/tlb.h needs linux/swap.h
  sh: mark DMA slave ID 0 as invalid
  sh: Update shmin to reflect PIO dependency.
  sh: arch/sh/kernel/process_32.c needs linux/prefetch.h.
  sh: add MMCIF runtime PM support on ecovec
  sh: switch ap325rxa to dynamically manage the platform camera
parents bb3d6bf1 a1b2cc50
...@@ -161,7 +161,7 @@ config ARCH_HAS_CPU_IDLE_WAIT ...@@ -161,7 +161,7 @@ config ARCH_HAS_CPU_IDLE_WAIT
config NO_IOPORT config NO_IOPORT
def_bool !PCI def_bool !PCI
depends on !SH_CAYMAN && !SH_SH4202_MICRODEV depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN
config IO_TRAPPED config IO_TRAPPED
bool bool
......
...@@ -359,37 +359,31 @@ static struct soc_camera_link camera_link = { ...@@ -359,37 +359,31 @@ static struct soc_camera_link camera_link = {
.priv = &camera_info, .priv = &camera_info,
}; };
static void dummy_release(struct device *dev) static struct platform_device *camera_device;
static void ap325rxa_camera_release(struct device *dev)
{ {
soc_camera_platform_release(&camera_device);
} }
static struct platform_device camera_device = {
.name = "soc_camera_platform",
.dev = {
.platform_data = &camera_info,
.release = dummy_release,
},
};
static int ap325rxa_camera_add(struct soc_camera_link *icl, static int ap325rxa_camera_add(struct soc_camera_link *icl,
struct device *dev) struct device *dev)
{ {
if (icl != &camera_link || camera_probe() <= 0) int ret = soc_camera_platform_add(icl, dev, &camera_device, &camera_link,
return -ENODEV; ap325rxa_camera_release, 0);
if (ret < 0)
return ret;
camera_info.dev = dev; ret = camera_probe();
if (ret < 0)
soc_camera_platform_del(icl, camera_device, &camera_link);
return platform_device_register(&camera_device); return ret;
} }
static void ap325rxa_camera_del(struct soc_camera_link *icl) static void ap325rxa_camera_del(struct soc_camera_link *icl)
{ {
if (icl != &camera_link) soc_camera_platform_del(icl, camera_device, &camera_link);
return;
platform_device_unregister(&camera_device);
memset(&camera_device.dev.kobj, 0,
sizeof(camera_device.dev.kobj));
} }
#endif /* CONFIG_I2C */ #endif /* CONFIG_I2C */
......
...@@ -885,6 +885,9 @@ static struct platform_device sh_mmcif_device = { ...@@ -885,6 +885,9 @@ static struct platform_device sh_mmcif_device = {
}, },
.num_resources = ARRAY_SIZE(sh_mmcif_resources), .num_resources = ARRAY_SIZE(sh_mmcif_resources),
.resource = sh_mmcif_resources, .resource = sh_mmcif_resources,
.archdata = {
.hwblk_id = HWBLK_MMC,
},
}; };
#endif #endif
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <asm/pgtable-2level.h> #include <asm/pgtable-2level.h>
#endif #endif
#include <asm/page.h> #include <asm/page.h>
#include <asm/mmu.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm/addrspace.h> #include <asm/addrspace.h>
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#define user_mode(regs) (((regs)->sr & 0x40000000)==0) #define user_mode(regs) (((regs)->sr & 0x40000000)==0)
#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) #define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15])
#define GET_FP(regs) ((regs)->regs[14])
#define GET_USP(regs) ((regs)->regs[15]) #define GET_USP(regs) ((regs)->regs[15])
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
...@@ -131,7 +133,7 @@ extern void ptrace_triggered(struct perf_event *bp, int nmi, ...@@ -131,7 +133,7 @@ extern void ptrace_triggered(struct perf_event *bp, int nmi,
static inline unsigned long profile_pc(struct pt_regs *regs) static inline unsigned long profile_pc(struct pt_regs *regs)
{ {
unsigned long pc = instruction_pointer(regs); unsigned long pc = regs->pc;
if (virt_addr_uncached(pc)) if (virt_addr_uncached(pc))
return CAC_ADDR(pc); return CAC_ADDR(pc);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#include <linux/swap.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
......
...@@ -236,6 +236,7 @@ enum { ...@@ -236,6 +236,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SCIF0_TX, SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX, SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX, SHDMA_SLAVE_SCIF1_TX,
......
...@@ -285,6 +285,7 @@ enum { ...@@ -285,6 +285,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SCIF0_TX, SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX, SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX, SHDMA_SLAVE_SCIF1_TX,
......
...@@ -252,6 +252,7 @@ enum { ...@@ -252,6 +252,7 @@ enum {
}; };
enum { enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SDHI_TX, SHDMA_SLAVE_SDHI_TX,
SHDMA_SLAVE_SDHI_RX, SHDMA_SLAVE_SDHI_RX,
SHDMA_SLAVE_MMCIF_TX, SHDMA_SLAVE_MMCIF_TX,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <linux/prefetch.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -82,7 +82,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, ...@@ -82,7 +82,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
void *addr; void *addr;
addr = __in_29bit_mode() ? addr = __in_29bit_mode() ?
(void *)P1SEGADDR((unsigned long)vaddr) : vaddr; (void *)CAC_ADDR((unsigned long)vaddr) : vaddr;
switch (direction) { switch (direction) {
case DMA_FROM_DEVICE: /* invalidate only */ case DMA_FROM_DEVICE: /* invalidate only */
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
...@@ -153,12 +152,10 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) ...@@ -153,12 +152,10 @@ static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate)
{ {
int ret; int ret;
/* wake up device and enable clock */ /* enable clock */
pm_runtime_get_sync(&p->pdev->dev);
ret = clk_enable(p->clk); ret = clk_enable(p->clk);
if (ret) { if (ret) {
dev_err(&p->pdev->dev, "cannot enable clock\n"); dev_err(&p->pdev->dev, "cannot enable clock\n");
pm_runtime_put_sync(&p->pdev->dev);
return ret; return ret;
} }
...@@ -190,9 +187,8 @@ static void sh_cmt_disable(struct sh_cmt_priv *p) ...@@ -190,9 +187,8 @@ static void sh_cmt_disable(struct sh_cmt_priv *p)
/* disable interrupts in CMT block */ /* disable interrupts in CMT block */
sh_cmt_write(p, CMCSR, 0); sh_cmt_write(p, CMCSR, 0);
/* stop clock and mark device as idle */ /* stop clock */
clk_disable(p->clk); clk_disable(p->clk);
pm_runtime_put_sync(&p->pdev->dev);
} }
/* private flags */ /* private flags */
...@@ -664,7 +660,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) ...@@ -664,7 +660,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
if (p) { if (p) {
dev_info(&pdev->dev, "kept as earlytimer\n"); dev_info(&pdev->dev, "kept as earlytimer\n");
pm_runtime_enable(&pdev->dev);
return 0; return 0;
} }
...@@ -679,9 +674,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev) ...@@ -679,9 +674,6 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
kfree(p); kfree(p);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
} }
if (!is_early_platform_device(pdev))
pm_runtime_enable(&pdev->dev);
return ret; return ret;
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
...@@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p) ...@@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p)
{ {
int ret; int ret;
/* wake up device and enable clock */ /* enable clock */
pm_runtime_get_sync(&p->pdev->dev);
ret = clk_enable(p->clk); ret = clk_enable(p->clk);
if (ret) { if (ret) {
dev_err(&p->pdev->dev, "cannot enable clock\n"); dev_err(&p->pdev->dev, "cannot enable clock\n");
pm_runtime_put_sync(&p->pdev->dev);
return ret; return ret;
} }
...@@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p) ...@@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p)
/* disable interrupts in TMU block */ /* disable interrupts in TMU block */
sh_tmu_write(p, TCR, 0x0000); sh_tmu_write(p, TCR, 0x0000);
/* stop clock and mark device as idle */ /* stop clock */
clk_disable(p->clk); clk_disable(p->clk);
pm_runtime_put_sync(&p->pdev->dev);
} }
static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta,
...@@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) ...@@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
if (p) { if (p) {
dev_info(&pdev->dev, "kept as earlytimer\n"); dev_info(&pdev->dev, "kept as earlytimer\n");
pm_runtime_enable(&pdev->dev);
return 0; return 0;
} }
...@@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) ...@@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev)
kfree(p); kfree(p);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
} }
if (!is_early_platform_device(pdev))
pm_runtime_enable(&pdev->dev);
return ret; return ret;
} }
......
...@@ -343,7 +343,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) ...@@ -343,7 +343,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan)
dmae_set_dmars(sh_chan, cfg->mid_rid); dmae_set_dmars(sh_chan, cfg->mid_rid);
dmae_set_chcr(sh_chan, cfg->chcr); dmae_set_chcr(sh_chan, cfg->chcr);
} else if ((sh_dmae_readl(sh_chan, CHCR) & 0xf00) != 0x400) { } else {
dmae_init(sh_chan); dmae_init(sh_chan);
} }
...@@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
/* platform data */ /* platform data */
shdev->pdata = pdata; shdev->pdata = pdata;
platform_set_drvdata(pdev, shdev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
...@@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
platform_set_drvdata(pdev, shdev);
dma_async_device_register(&shdev->common); dma_async_device_register(&shdev->common);
return err; return err;
...@@ -1278,6 +1279,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev) ...@@ -1278,6 +1279,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
if (dmars) if (dmars)
iounmap(shdev->dmars); iounmap(shdev->dmars);
platform_set_drvdata(pdev, NULL);
emapdmars: emapdmars:
iounmap(shdev->chan_reg); iounmap(shdev->chan_reg);
synchronize_rcu(); synchronize_rcu();
...@@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev) ...@@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
iounmap(shdev->dmars); iounmap(shdev->dmars);
iounmap(shdev->chan_reg); iounmap(shdev->chan_reg);
platform_set_drvdata(pdev, NULL);
synchronize_rcu(); synchronize_rcu();
kfree(shdev); kfree(shdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment