diff options
-rw-r--r-- | arch/sh/configs/rts7751r2d1_defconfig | 2 | ||||
-rw-r--r-- | arch/sh/configs/rts7751r2dplus_defconfig | 2 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7751.c | 5 | ||||
-rw-r--r-- | arch/sh/include/cpu-sh4/cpu/dma-register.h | 2 | ||||
-rw-r--r-- | drivers/dma/shdma.c | 27 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 27 |
6 files changed, 40 insertions, 25 deletions
diff --git a/arch/sh/configs/rts7751r2d1_defconfig b/arch/sh/configs/rts7751r2d1_defconfig index fba1f62d56e7..dba024d72a89 100644 --- a/arch/sh/configs/rts7751r2d1_defconfig +++ b/arch/sh/configs/rts7751r2d1_defconfig | |||
@@ -877,7 +877,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | |||
877 | # | 877 | # |
878 | # CONFIG_SERIAL_MAX3100 is not set | 878 | # CONFIG_SERIAL_MAX3100 is not set |
879 | CONFIG_SERIAL_SH_SCI=y | 879 | CONFIG_SERIAL_SH_SCI=y |
880 | CONFIG_SERIAL_SH_SCI_NR_UARTS=1 | 880 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 |
881 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | 881 | CONFIG_SERIAL_SH_SCI_CONSOLE=y |
882 | CONFIG_SERIAL_CORE=y | 882 | CONFIG_SERIAL_CORE=y |
883 | CONFIG_SERIAL_CORE_CONSOLE=y | 883 | CONFIG_SERIAL_CORE_CONSOLE=y |
diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig index a8d538f06e67..6d511d06cbf6 100644 --- a/arch/sh/configs/rts7751r2dplus_defconfig +++ b/arch/sh/configs/rts7751r2dplus_defconfig | |||
@@ -963,7 +963,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | |||
963 | # | 963 | # |
964 | # CONFIG_SERIAL_MAX3100 is not set | 964 | # CONFIG_SERIAL_MAX3100 is not set |
965 | CONFIG_SERIAL_SH_SCI=y | 965 | CONFIG_SERIAL_SH_SCI=y |
966 | CONFIG_SERIAL_SH_SCI_NR_UARTS=1 | 966 | CONFIG_SERIAL_SH_SCI_NR_UARTS=2 |
967 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | 967 | CONFIG_SERIAL_SH_SCI_CONSOLE=y |
968 | CONFIG_SERIAL_CORE=y | 968 | CONFIG_SERIAL_CORE=y |
969 | CONFIG_SERIAL_CORE_CONSOLE=y | 969 | CONFIG_SERIAL_CORE_CONSOLE=y |
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c index 17811e5d287b..f98141b3b7d7 100644 --- a/arch/sh/drivers/pci/pci-sh7751.c +++ b/arch/sh/drivers/pci/pci-sh7751.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include "pci-sh4.h" | 18 | #include "pci-sh4.h" |
19 | #include <asm/addrspace.h> | 19 | #include <asm/addrspace.h> |
20 | #include <asm/sizes.h> | ||
20 | 21 | ||
21 | static int __init __area_sdram_check(struct pci_channel *chan, | 22 | static int __init __area_sdram_check(struct pci_channel *chan, |
22 | unsigned int area) | 23 | unsigned int area) |
@@ -47,8 +48,8 @@ static int __init __area_sdram_check(struct pci_channel *chan, | |||
47 | static struct resource sh7751_pci_resources[] = { | 48 | static struct resource sh7751_pci_resources[] = { |
48 | { | 49 | { |
49 | .name = "SH7751_IO", | 50 | .name = "SH7751_IO", |
50 | .start = SH7751_PCI_IO_BASE, | 51 | .start = 0x1000, |
51 | .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1, | 52 | .end = SZ_4M - 1, |
52 | .flags = IORESOURCE_IO | 53 | .flags = IORESOURCE_IO |
53 | }, { | 54 | }, { |
54 | .name = "SH7751_mem", | 55 | .name = "SH7751_mem", |
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-register.h b/arch/sh/include/cpu-sh4/cpu/dma-register.h index 55f9fec082d4..de2359533994 100644 --- a/arch/sh/include/cpu-sh4/cpu/dma-register.h +++ b/arch/sh/include/cpu-sh4/cpu/dma-register.h | |||
@@ -76,7 +76,7 @@ enum { | |||
76 | } | 76 | } |
77 | 77 | ||
78 | #define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \ | 78 | #define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \ |
79 | ((((i) >> 2) & 3) << CHCR_TS_HIGH_SHIFT)) | 79 | (((i) & 0xc) << CHCR_TS_HIGH_SHIFT)) |
80 | 80 | ||
81 | #else /* CONFIG_CPU_SH4A */ | 81 | #else /* CONFIG_CPU_SH4A */ |
82 | 82 | ||
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 7cc31b3f40d8..6f25a20de99f 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -290,6 +290,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) | |||
290 | struct sh_dmae_chan *sh_chan = to_sh_chan(chan); | 290 | struct sh_dmae_chan *sh_chan = to_sh_chan(chan); |
291 | struct sh_desc *desc; | 291 | struct sh_desc *desc; |
292 | struct sh_dmae_slave *param = chan->private; | 292 | struct sh_dmae_slave *param = chan->private; |
293 | int ret; | ||
293 | 294 | ||
294 | pm_runtime_get_sync(sh_chan->dev); | 295 | pm_runtime_get_sync(sh_chan->dev); |
295 | 296 | ||
@@ -301,11 +302,15 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) | |||
301 | struct sh_dmae_slave_config *cfg; | 302 | struct sh_dmae_slave_config *cfg; |
302 | 303 | ||
303 | cfg = sh_dmae_find_slave(sh_chan, param->slave_id); | 304 | cfg = sh_dmae_find_slave(sh_chan, param->slave_id); |
304 | if (!cfg) | 305 | if (!cfg) { |
305 | return -EINVAL; | 306 | ret = -EINVAL; |
307 | goto efindslave; | ||
308 | } | ||
306 | 309 | ||
307 | if (test_and_set_bit(param->slave_id, sh_dmae_slave_used)) | 310 | if (test_and_set_bit(param->slave_id, sh_dmae_slave_used)) { |
308 | return -EBUSY; | 311 | ret = -EBUSY; |
312 | goto etestused; | ||
313 | } | ||
309 | 314 | ||
310 | param->config = cfg; | 315 | param->config = cfg; |
311 | 316 | ||
@@ -334,10 +339,20 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) | |||
334 | } | 339 | } |
335 | spin_unlock_bh(&sh_chan->desc_lock); | 340 | spin_unlock_bh(&sh_chan->desc_lock); |
336 | 341 | ||
337 | if (!sh_chan->descs_allocated) | 342 | if (!sh_chan->descs_allocated) { |
338 | pm_runtime_put(sh_chan->dev); | 343 | ret = -ENOMEM; |
344 | goto edescalloc; | ||
345 | } | ||
339 | 346 | ||
340 | return sh_chan->descs_allocated; | 347 | return sh_chan->descs_allocated; |
348 | |||
349 | edescalloc: | ||
350 | if (param) | ||
351 | clear_bit(param->slave_id, sh_dmae_slave_used); | ||
352 | etestused: | ||
353 | efindslave: | ||
354 | pm_runtime_put(sh_chan->dev); | ||
355 | return ret; | ||
341 | } | 356 | } |
342 | 357 | ||
343 | /* | 358 | /* |
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index e14bd0749129..e8c769944812 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -695,6 +695,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev, | |||
695 | * 1) Enable Runtime PM | 695 | * 1) Enable Runtime PM |
696 | * 2) Force Runtime PM Resume since hardware is accessed from probe() | 696 | * 2) Force Runtime PM Resume since hardware is accessed from probe() |
697 | */ | 697 | */ |
698 | priv->dev = &pdev->dev; | ||
698 | pm_runtime_enable(priv->dev); | 699 | pm_runtime_enable(priv->dev); |
699 | pm_runtime_resume(priv->dev); | 700 | pm_runtime_resume(priv->dev); |
700 | return 0; | 701 | return 0; |
@@ -957,25 +958,24 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
957 | 958 | ||
958 | if (!pdev->dev.platform_data) { | 959 | if (!pdev->dev.platform_data) { |
959 | dev_err(&pdev->dev, "no platform data defined\n"); | 960 | dev_err(&pdev->dev, "no platform data defined\n"); |
960 | error = -EINVAL; | 961 | return -EINVAL; |
961 | goto err0; | ||
962 | } | 962 | } |
963 | 963 | ||
964 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 964 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
965 | i = platform_get_irq(pdev, 0); | 965 | i = platform_get_irq(pdev, 0); |
966 | if (!res || i < 0) { | 966 | if (!res || i < 0) { |
967 | dev_err(&pdev->dev, "cannot get platform resources\n"); | 967 | dev_err(&pdev->dev, "cannot get platform resources\n"); |
968 | error = -ENOENT; | 968 | return -ENOENT; |
969 | goto err0; | ||
970 | } | 969 | } |
971 | 970 | ||
972 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 971 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
973 | if (!priv) { | 972 | if (!priv) { |
974 | dev_err(&pdev->dev, "cannot allocate device data\n"); | 973 | dev_err(&pdev->dev, "cannot allocate device data\n"); |
975 | error = -ENOMEM; | 974 | return -ENOMEM; |
976 | goto err0; | ||
977 | } | 975 | } |
978 | 976 | ||
977 | platform_set_drvdata(pdev, priv); | ||
978 | |||
979 | error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, | 979 | error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, |
980 | dev_name(&pdev->dev), priv); | 980 | dev_name(&pdev->dev), priv); |
981 | if (error) { | 981 | if (error) { |
@@ -984,8 +984,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
984 | } | 984 | } |
985 | 985 | ||
986 | priv->irq = i; | 986 | priv->irq = i; |
987 | priv->dev = &pdev->dev; | ||
988 | platform_set_drvdata(pdev, priv); | ||
989 | pdata = pdev->dev.platform_data; | 987 | pdata = pdev->dev.platform_data; |
990 | 988 | ||
991 | j = 0; | 989 | j = 0; |
@@ -1099,9 +1097,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1099 | info = ch->info; | 1097 | info = ch->info; |
1100 | 1098 | ||
1101 | if (info->fbdefio) { | 1099 | if (info->fbdefio) { |
1102 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * | 1100 | ch->sglist = vmalloc(sizeof(struct scatterlist) * |
1103 | info->fix.smem_len >> PAGE_SHIFT); | 1101 | info->fix.smem_len >> PAGE_SHIFT); |
1104 | if (!priv->ch->sglist) { | 1102 | if (!ch->sglist) { |
1105 | dev_err(&pdev->dev, "cannot allocate sglist\n"); | 1103 | dev_err(&pdev->dev, "cannot allocate sglist\n"); |
1106 | goto err1; | 1104 | goto err1; |
1107 | } | 1105 | } |
@@ -1126,9 +1124,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1126 | } | 1124 | } |
1127 | 1125 | ||
1128 | return 0; | 1126 | return 0; |
1129 | err1: | 1127 | err1: |
1130 | sh_mobile_lcdc_remove(pdev); | 1128 | sh_mobile_lcdc_remove(pdev); |
1131 | err0: | 1129 | |
1132 | return error; | 1130 | return error; |
1133 | } | 1131 | } |
1134 | 1132 | ||
@@ -1139,7 +1137,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1139 | int i; | 1137 | int i; |
1140 | 1138 | ||
1141 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | 1139 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) |
1142 | if (priv->ch[i].info->dev) | 1140 | if (priv->ch[i].info && priv->ch[i].info->dev) |
1143 | unregister_framebuffer(priv->ch[i].info); | 1141 | unregister_framebuffer(priv->ch[i].info); |
1144 | 1142 | ||
1145 | sh_mobile_lcdc_stop(priv); | 1143 | sh_mobile_lcdc_stop(priv); |
@@ -1162,7 +1160,8 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1162 | if (priv->dot_clk) | 1160 | if (priv->dot_clk) |
1163 | clk_put(priv->dot_clk); | 1161 | clk_put(priv->dot_clk); |
1164 | 1162 | ||
1165 | pm_runtime_disable(priv->dev); | 1163 | if (priv->dev) |
1164 | pm_runtime_disable(priv->dev); | ||
1166 | 1165 | ||
1167 | if (priv->base) | 1166 | if (priv->base) |
1168 | iounmap(priv->base); | 1167 | iounmap(priv->base); |