Commit 1496ec13 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'fixes-for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "Here's a long-pending fixes pull request for arm-soc (I didn't send
  one in the -rc4 cycle).

  The larger deltas are from:

   - A fixup of error paths in the mvsdio driver

   - Header file move for a driver that hadn't been properly converted
     to multiplatform on i.MX, which was causing build failures when
     included

   - Device tree updates for at91 dealing mostly with their new pinctrl
     setup merged in 3.8 and mistakes in those initial configs

  The rest are the normal mix of small fixes all over the place; sunxi,
  omap, imx, mvebu, etc, etc."

* tag 'fixes-for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (40 commits)
  mfd: vexpress-sysreg: Don't skip initialization on probe
  ARM: vexpress: Enable A7 cores in V2P-CA15_A7's Device Tree
  ARM: vexpress: extend the MPIDR range used for pen release check
  ARM: at91/dts: correct comment in at91sam9x5.dtsi for mii
  ARM: at91/at91_dt_defconfig: add at91sam9n12 SoC to DT defconfig
  ARM: at91/at91_dt_defconfig: remove memory specification to cmdline
  ARM: at91/dts: add macb mii pinctrl config for kizbox
  ARM: at91: rm9200: remake the BGA as default version
  ARM: at91: fix gpios on i2c-gpio for RM9200 DT
  ARM: at91/at91sam9x5 DTS: add SCK USART pins
  ARM: at91/at91sam9x5 DTS: correct wrong PIO BANK values on u(s)arts
  ARM: at91/at91-pinctrl documentation: fix typo and add some details
  ARM: kirkwood: fix missing #interrupt-cells property
  mmc: mvsdio: use devm_ API to simplify/correct error paths.
  clk: mvebu/clk-cpu.c: fix memory leakage
  ARM: OMAP2+: omap4-panda: add UART2 muxing for WiLink shared transport
  ARM: OMAP2+: DT node Timer iteration fix
  ARM: OMAP2+: Fix section warning for omap_init_ocp2scp()
  ARM: OMAP2+: fix build break for omapdrm
  ARM: OMAP2: Fix missing omap2xxx_clkt_vps_late_init function calls
  ...
parents ba2ab41f 3836414f
...@@ -124,7 +124,7 @@ void __init of_cpu_clk_setup(struct device_node *node) ...@@ -124,7 +124,7 @@ void __init of_cpu_clk_setup(struct device_node *node)
clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
if (WARN_ON(!clks)) if (WARN_ON(!clks))
return; goto clks_out;
for_each_node_by_type(dn, "cpu") { for_each_node_by_type(dn, "cpu") {
struct clk_init_data init; struct clk_init_data init;
...@@ -134,11 +134,11 @@ void __init of_cpu_clk_setup(struct device_node *node) ...@@ -134,11 +134,11 @@ void __init of_cpu_clk_setup(struct device_node *node)
int cpu, err; int cpu, err;
if (WARN_ON(!clk_name)) if (WARN_ON(!clk_name))
return; goto bail_out;
err = of_property_read_u32(dn, "reg", &cpu); err = of_property_read_u32(dn, "reg", &cpu);
if (WARN_ON(err)) if (WARN_ON(err))
return; goto bail_out;
sprintf(clk_name, "cpu%d", cpu); sprintf(clk_name, "cpu%d", cpu);
parent_clk = of_clk_get(node, 0); parent_clk = of_clk_get(node, 0);
...@@ -167,6 +167,9 @@ void __init of_cpu_clk_setup(struct device_node *node) ...@@ -167,6 +167,9 @@ void __init of_cpu_clk_setup(struct device_node *node)
return; return;
bail_out: bail_out:
kfree(clks); kfree(clks);
while(ncpus--)
kfree(cpuclk[ncpus].clk_name);
clks_out:
kfree(cpuclk); kfree(cpuclk);
} }
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_data/imx-iram.h>
#include <mach/iram.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
......
...@@ -313,19 +313,11 @@ static void vexpress_sysreg_config_complete(unsigned long data) ...@@ -313,19 +313,11 @@ static void vexpress_sysreg_config_complete(unsigned long data)
} }
void __init vexpress_sysreg_early_init(void __iomem *base) void __init vexpress_sysreg_setup(struct device_node *node)
{ {
struct device_node *node = of_find_compatible_node(NULL, NULL, if (WARN_ON(!vexpress_sysreg_base))
"arm,vexpress-sysreg");
if (node)
base = of_iomap(node, 0);
if (WARN_ON(!base))
return; return;
vexpress_sysreg_base = base;
if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE) if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)
vexpress_master_site = VEXPRESS_SITE_DB2; vexpress_master_site = VEXPRESS_SITE_DB2;
else else
...@@ -336,9 +328,23 @@ void __init vexpress_sysreg_early_init(void __iomem *base) ...@@ -336,9 +328,23 @@ void __init vexpress_sysreg_early_init(void __iomem *base)
WARN_ON(!vexpress_sysreg_config_bridge); WARN_ON(!vexpress_sysreg_config_bridge);
} }
void __init vexpress_sysreg_early_init(void __iomem *base)
{
vexpress_sysreg_base = base;
vexpress_sysreg_setup(NULL);
}
void __init vexpress_sysreg_of_early_init(void) void __init vexpress_sysreg_of_early_init(void)
{ {
vexpress_sysreg_early_init(NULL); struct device_node *node = of_find_compatible_node(NULL, NULL,
"arm,vexpress-sysreg");
if (node) {
vexpress_sysreg_base = of_iomap(node, 0);
vexpress_sysreg_setup(node);
} else {
pr_info("vexpress-sysreg: No Device Tree node found.");
}
} }
...@@ -426,9 +432,11 @@ static int vexpress_sysreg_probe(struct platform_device *pdev) ...@@ -426,9 +432,11 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
} }
if (!vexpress_sysreg_base) if (!vexpress_sysreg_base) {
vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start, vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res)); resource_size(res));
vexpress_sysreg_setup(pdev->dev.of_node);
}
if (!vexpress_sysreg_base) { if (!vexpress_sysreg_base) {
dev_err(&pdev->dev, "Failed to obtain base address!\n"); dev_err(&pdev->dev, "Failed to obtain base address!\n");
......
...@@ -50,8 +50,6 @@ struct mvsd_host { ...@@ -50,8 +50,6 @@ struct mvsd_host {
struct timer_list timer; struct timer_list timer;
struct mmc_host *mmc; struct mmc_host *mmc;
struct device *dev; struct device *dev;
struct resource *res;
int irq;
struct clk *clk; struct clk *clk;
int gpio_card_detect; int gpio_card_detect;
int gpio_write_protect; int gpio_write_protect;
...@@ -718,10 +716,6 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -718,10 +716,6 @@ static int __init mvsd_probe(struct platform_device *pdev)
if (!r || irq < 0 || !mvsd_data) if (!r || irq < 0 || !mvsd_data)
return -ENXIO; return -ENXIO;
r = request_mem_region(r->start, SZ_1K, DRIVER_NAME);
if (!r)
return -EBUSY;
mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev); mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
if (!mmc) { if (!mmc) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -731,8 +725,8 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -731,8 +725,8 @@ static int __init mvsd_probe(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->mmc = mmc; host->mmc = mmc;
host->dev = &pdev->dev; host->dev = &pdev->dev;
host->res = r;
host->base_clock = mvsd_data->clock / 2; host->base_clock = mvsd_data->clock / 2;
host->clk = ERR_PTR(-EINVAL);
mmc->ops = &mvsd_ops; mmc->ops = &mvsd_ops;
...@@ -752,7 +746,7 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -752,7 +746,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
spin_lock_init(&host->lock); spin_lock_init(&host->lock);
host->base = ioremap(r->start, SZ_4K); host->base = devm_request_and_ioremap(&pdev->dev, r);
if (!host->base) { if (!host->base) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -765,44 +759,45 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -765,44 +759,45 @@ static int __init mvsd_probe(struct platform_device *pdev)
mvsd_power_down(host); mvsd_power_down(host);
ret = request_irq(irq, mvsd_irq, 0, DRIVER_NAME, host); ret = devm_request_irq(&pdev->dev, irq, mvsd_irq, 0, DRIVER_NAME, host);
if (ret) { if (ret) {
pr_err("%s: cannot assign irq %d\n", DRIVER_NAME, irq); pr_err("%s: cannot assign irq %d\n", DRIVER_NAME, irq);
goto out; goto out;
} else }
host->irq = irq;
/* Not all platforms can gate the clock, so it is not /* Not all platforms can gate the clock, so it is not
an error if the clock does not exists. */ an error if the clock does not exists. */
host->clk = clk_get(&pdev->dev, NULL); host->clk = devm_clk_get(&pdev->dev, NULL);
if (!IS_ERR(host->clk)) { if (!IS_ERR(host->clk))
clk_prepare_enable(host->clk); clk_prepare_enable(host->clk);
}
if (mvsd_data->gpio_card_detect) { if (mvsd_data->gpio_card_detect) {
ret = gpio_request(mvsd_data->gpio_card_detect, ret = devm_gpio_request_one(&pdev->dev,
DRIVER_NAME " cd"); mvsd_data->gpio_card_detect,
GPIOF_IN, DRIVER_NAME " cd");
if (ret == 0) { if (ret == 0) {
gpio_direction_input(mvsd_data->gpio_card_detect);
irq = gpio_to_irq(mvsd_data->gpio_card_detect); irq = gpio_to_irq(mvsd_data->gpio_card_detect);
ret = request_irq(irq, mvsd_card_detect_irq, ret = devm_request_irq(&pdev->dev, irq,
IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING, mvsd_card_detect_irq,
DRIVER_NAME " cd", host); IRQ_TYPE_EDGE_RISING |
IRQ_TYPE_EDGE_FALLING,
DRIVER_NAME " cd", host);
if (ret == 0) if (ret == 0)
host->gpio_card_detect = host->gpio_card_detect =
mvsd_data->gpio_card_detect; mvsd_data->gpio_card_detect;
else else
gpio_free(mvsd_data->gpio_card_detect); devm_gpio_free(&pdev->dev,
mvsd_data->gpio_card_detect);
} }
} }
if (!host->gpio_card_detect) if (!host->gpio_card_detect)
mmc->caps |= MMC_CAP_NEEDS_POLL; mmc->caps |= MMC_CAP_NEEDS_POLL;
if (mvsd_data->gpio_write_protect) { if (mvsd_data->gpio_write_protect) {
ret = gpio_request(mvsd_data->gpio_write_protect, ret = devm_gpio_request_one(&pdev->dev,
DRIVER_NAME " wp"); mvsd_data->gpio_write_protect,
GPIOF_IN, DRIVER_NAME " wp");
if (ret == 0) { if (ret == 0) {
gpio_direction_input(mvsd_data->gpio_write_protect);
host->gpio_write_protect = host->gpio_write_protect =
mvsd_data->gpio_write_protect; mvsd_data->gpio_write_protect;
} }
...@@ -824,26 +819,11 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -824,26 +819,11 @@ static int __init mvsd_probe(struct platform_device *pdev)
return 0; return 0;
out: out:
if (host) { if (mmc) {
if (host->irq) if (!IS_ERR(host->clk))
free_irq(host->irq, host);
if (host->gpio_card_detect) {
free_irq(gpio_to_irq(host->gpio_card_detect), host);
gpio_free(host->gpio_card_detect);
}
if (host->gpio_write_protect)
gpio_free(host->gpio_write_protect);
if (host->base)
iounmap(host->base);
}
if (r)
release_resource(r);
if (mmc)
if (!IS_ERR_OR_NULL(host->clk)) {
clk_disable_unprepare(host->clk); clk_disable_unprepare(host->clk);
clk_put(host->clk);
}
mmc_free_host(mmc); mmc_free_host(mmc);
}
return ret; return ret;
} }
...@@ -852,28 +832,16 @@ static int __exit mvsd_remove(struct platform_device *pdev) ...@@ -852,28 +832,16 @@ static int __exit mvsd_remove(struct platform_device *pdev)
{ {
struct mmc_host *mmc = platform_get_drvdata(pdev); struct mmc_host *mmc = platform_get_drvdata(pdev);
if (mmc) { struct mvsd_host *host = mmc_priv(mmc);
struct mvsd_host *host = mmc_priv(mmc);
if (host->gpio_card_detect) { mmc_remove_host(mmc);
free_irq(gpio_to_irq(host->gpio_card_detect), host); del_timer_sync(&host->timer);
gpio_free(host->gpio_card_detect); mvsd_power_down(host);
}
mmc_remove_host(mmc); if (!IS_ERR(host->clk))
free_irq(host->irq, host); clk_disable_unprepare(host->clk);
if (host->gpio_write_protect) mmc_free_host(mmc);
gpio_free(host->gpio_write_protect);
del_timer_sync(&host->timer);
mvsd_power_down(host);
iounmap(host->base);
release_resource(host->res);
if (!IS_ERR(host->clk)) {
clk_disable_unprepare(host->clk);
clk_put(host->clk);
}
mmc_free_host(mmc);
}
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -139,6 +139,7 @@ struct imxfb_info { ...@@ -139,6 +139,7 @@ struct imxfb_info {
struct clk *clk_ahb; struct clk *clk_ahb;
struct clk *clk_per; struct clk *clk_per;
enum imxfb_type devtype; enum imxfb_type devtype;
bool enabled;
/* /*
* These are the addresses we mapped * These are the addresses we mapped
...@@ -536,6 +537,10 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi) ...@@ -536,6 +537,10 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)
static void imxfb_enable_controller(struct imxfb_info *fbi) static void imxfb_enable_controller(struct imxfb_info *fbi)
{ {
if (fbi->enabled)
return;
pr_debug("Enabling LCD controller\n"); pr_debug("Enabling LCD controller\n");
writel(fbi->screen_dma, fbi->regs + LCDC_SSA); writel(fbi->screen_dma, fbi->regs + LCDC_SSA);
...@@ -556,6 +561,7 @@ static void imxfb_enable_controller(struct imxfb_info *fbi) ...@@ -556,6 +561,7 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
clk_prepare_enable(fbi->clk_ipg); clk_prepare_enable(fbi->clk_ipg);
clk_prepare_enable(fbi->clk_ahb); clk_prepare_enable(fbi->clk_ahb);
clk_prepare_enable(fbi->clk_per); clk_prepare_enable(fbi->clk_per);
fbi->enabled = true;
if (fbi->backlight_power) if (fbi->backlight_power)
fbi->backlight_power(1); fbi->backlight_power(1);
...@@ -565,6 +571,9 @@ static void imxfb_enable_controller(struct imxfb_info *fbi) ...@@ -565,6 +571,9 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
static void imxfb_disable_controller(struct imxfb_info *fbi) static void imxfb_disable_controller(struct imxfb_info *fbi)
{ {
if (!fbi->enabled)
return;
pr_debug("Disabling LCD controller\n"); pr_debug("Disabling LCD controller\n");
if (fbi->backlight_power) if (fbi->backlight_power)
...@@ -575,6 +584,7 @@ static void imxfb_disable_controller(struct imxfb_info *fbi) ...@@ -575,6 +584,7 @@ static void imxfb_disable_controller(struct imxfb_info *fbi)
clk_disable_unprepare(fbi->clk_per); clk_disable_unprepare(fbi->clk_per);
clk_disable_unprepare(fbi->clk_ipg); clk_disable_unprepare(fbi->clk_ipg);
clk_disable_unprepare(fbi->clk_ahb); clk_disable_unprepare(fbi->clk_ahb);
fbi->enabled = false;
writel(0, fbi->regs + LCDC_RMCR); writel(0, fbi->regs + LCDC_RMCR);
} }
...@@ -729,6 +739,8 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev) ...@@ -729,6 +739,8 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
memset(fbi, 0, sizeof(struct imxfb_info)); memset(fbi, 0, sizeof(struct imxfb_info));
fbi->devtype = pdev->id_entry->driver_data;
strlcpy(info->fix.id, IMX_NAME, sizeof(info->fix.id)); strlcpy(info->fix.id, IMX_NAME, sizeof(info->fix.id));
info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.type = FB_TYPE_PACKED_PIXELS;
...@@ -789,7 +801,6 @@ static int __init imxfb_probe(struct platform_device *pdev) ...@@ -789,7 +801,6 @@ static int __init imxfb_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
fbi = info->par; fbi = info->par;
fbi->devtype = pdev->id_entry->driver_data;
if (!fb_mode) if (!fb_mode)
fb_mode = pdata->mode[0].mode.name; fb_mode = pdata->mode[0].mode.name;
......
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