Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4b3f523 authored by Linus Walleij's avatar Linus Walleij
Browse files

pinctrl: nomadik: decomission non-DT boot path



After the patches deleting the last board registering this
pin controller as a platform device has been deleted,
proceed to remove the non-DT boot patch and depend on
OF being available and the device to be coming up by
a DT node.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8d993397
Loading
Loading
Loading
Loading
+22 −58
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@
 * Copyright (C) 2008,2009 STMicroelectronics
 * Copyright (C) 2008,2009 STMicroelectronics
 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
 *   Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com>
 *   Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com>
 * Copyright (C) 2011 Linus Walleij <linus.walleij@linaro.org>
 * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org>
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * it under the terms of the GNU General Public License version 2 as
@@ -1240,7 +1240,7 @@ static const struct irq_domain_ops nmk_gpio_irq_simple_ops = {


static int nmk_gpio_probe(struct platform_device *dev)
static int nmk_gpio_probe(struct platform_device *dev)
{
{
	struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
	struct nmk_gpio_platform_data *pdata;
	struct device_node *np = dev->dev.of_node;
	struct device_node *np = dev->dev.of_node;
	struct nmk_gpio_chip *nmk_chip;
	struct nmk_gpio_chip *nmk_chip;
	struct gpio_chip *chip;
	struct gpio_chip *chip;
@@ -1248,16 +1248,9 @@ static int nmk_gpio_probe(struct platform_device *dev)
	struct clk *clk;
	struct clk *clk;
	int secondary_irq;
	int secondary_irq;
	void __iomem *base;
	void __iomem *base;
	int irq_start = 0;
	int irq;
	int irq;
	int ret;
	int ret;


	if (!pdata && !np) {
		dev_err(&dev->dev, "No platform data or device tree found\n");
		return -ENODEV;
	}

	if (np) {
	pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
	pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
	if (!pdata)
	if (!pdata)
		return -ENOMEM;
		return -ENOMEM;
@@ -1272,7 +1265,6 @@ static int nmk_gpio_probe(struct platform_device *dev)


	pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
	pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
	pdata->num_gpio = NMK_GPIO_PER_CHIP;
	pdata->num_gpio = NMK_GPIO_PER_CHIP;
	}


	irq = platform_get_irq(dev, 0);
	irq = platform_get_irq(dev, 0);
	if (irq < 0)
	if (irq < 0)
@@ -1321,10 +1313,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
	clk_enable(nmk_chip->clk);
	clk_enable(nmk_chip->clk);
	nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI);
	nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI);
	clk_disable(nmk_chip->clk);
	clk_disable(nmk_chip->clk);

#ifdef CONFIG_OF_GPIO
	chip->of_node = np;
	chip->of_node = np;
#endif


	ret = gpiochip_add(&nmk_chip->chip);
	ret = gpiochip_add(&nmk_chip->chip);
	if (ret)
	if (ret)
@@ -1336,10 +1325,8 @@ static int nmk_gpio_probe(struct platform_device *dev)


	platform_set_drvdata(dev, nmk_chip);
	platform_set_drvdata(dev, nmk_chip);


	if (!np)
		irq_start = pdata->first_irq;
	nmk_chip->domain = irq_domain_add_simple(np,
	nmk_chip->domain = irq_domain_add_simple(np,
				NMK_GPIO_PER_CHIP, irq_start,
				NMK_GPIO_PER_CHIP, 0,
				&nmk_gpio_irq_simple_ops, nmk_chip);
				&nmk_gpio_irq_simple_ops, nmk_chip);
	if (!nmk_chip->domain) {
	if (!nmk_chip->domain) {
		dev_err(&dev->dev, "failed to create irqdomain\n");
		dev_err(&dev->dev, "failed to create irqdomain\n");
@@ -2072,11 +2059,10 @@ static int nmk_pinctrl_resume(struct platform_device *pdev)


static int nmk_pinctrl_probe(struct platform_device *pdev)
static int nmk_pinctrl_probe(struct platform_device *pdev)
{
{
	const struct platform_device_id *platid = platform_get_device_id(pdev);
	const struct of_device_id *match;
	struct device_node *np = pdev->dev.of_node;
	struct device_node *np = pdev->dev.of_node;
	struct device_node *prcm_np;
	struct device_node *prcm_np;
	struct nmk_pinctrl *npct;
	struct nmk_pinctrl *npct;
	struct resource *res;
	unsigned int version = 0;
	unsigned int version = 0;
	int i;
	int i;


@@ -2084,16 +2070,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
	if (!npct)
	if (!npct)
		return -ENOMEM;
		return -ENOMEM;


	if (platid)
		version = platid->driver_data;
	else if (np) {
		const struct of_device_id *match;

	match = of_match_device(nmk_pinctrl_match, &pdev->dev);
	match = of_match_device(nmk_pinctrl_match, &pdev->dev);
	if (!match)
	if (!match)
		return -ENODEV;
		return -ENODEV;
	version = (unsigned int) match->data;
	version = (unsigned int) match->data;
	}


	/* Poke in other ASIC variants here */
	/* Poke in other ASIC variants here */
	if (version == PINCTRL_NMK_STN8815)
	if (version == PINCTRL_NMK_STN8815)
@@ -2103,17 +2083,9 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
	if (version == PINCTRL_NMK_DB8540)
	if (version == PINCTRL_NMK_DB8540)
		nmk_pinctrl_db8540_init(&npct->soc);
		nmk_pinctrl_db8540_init(&npct->soc);


	if (np) {
	prcm_np = of_parse_phandle(np, "prcm", 0);
	prcm_np = of_parse_phandle(np, "prcm", 0);
	if (prcm_np)
	if (prcm_np)
		npct->prcm_base = of_iomap(prcm_np, 0);
		npct->prcm_base = of_iomap(prcm_np, 0);
	}

	/* Allow platform passed information to over-write DT. */
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (res)
		npct->prcm_base = devm_ioremap(&pdev->dev, res->start,
					       resource_size(res));
	if (!npct->prcm_base) {
	if (!npct->prcm_base) {
		if (version == PINCTRL_NMK_STN8815) {
		if (version == PINCTRL_NMK_STN8815) {
			dev_info(&pdev->dev,
			dev_info(&pdev->dev,
@@ -2172,13 +2144,6 @@ static struct platform_driver nmk_gpio_driver = {
	.probe = nmk_gpio_probe,
	.probe = nmk_gpio_probe,
};
};


static const struct platform_device_id nmk_pinctrl_id[] = {
	{ "pinctrl-stn8815", PINCTRL_NMK_STN8815 },
	{ "pinctrl-db8500", PINCTRL_NMK_DB8500 },
	{ "pinctrl-db8540", PINCTRL_NMK_DB8540 },
	{ }
};

static struct platform_driver nmk_pinctrl_driver = {
static struct platform_driver nmk_pinctrl_driver = {
	.driver = {
	.driver = {
		.owner = THIS_MODULE,
		.owner = THIS_MODULE,
@@ -2186,7 +2151,6 @@ static struct platform_driver nmk_pinctrl_driver = {
		.of_match_table = nmk_pinctrl_match,
		.of_match_table = nmk_pinctrl_match,
	},
	},
	.probe = nmk_pinctrl_probe,
	.probe = nmk_pinctrl_probe,
	.id_table = nmk_pinctrl_id,
#ifdef CONFIG_PM
#ifdef CONFIG_PM
	.suspend = nmk_pinctrl_suspend,
	.suspend = nmk_pinctrl_suspend,
	.resume = nmk_pinctrl_resume,
	.resume = nmk_pinctrl_resume,