提交 afe594c7 编写于 作者: L Linus Torvalds

Merge tag 'pinctrl-fixes-v3.7-rc2' of...

Merge tag 'pinctrl-fixes-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
 "A number of pinctrl fixes for the v3.7 series:
   - duplicate includes, section markup, code mishaps
   - erroneous return value in errorpath on the bcm2835 driver
   - remove an unused sirf function that was causing build errors
   - multiple-platform compilation stubs and a missed code review
     comment fixup on the nomadik pin controller"

* tag 'pinctrl-fixes-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl/nomadik: always use the simple irqdomain
  pinctrl/nomadik: provide stubs for legacy Nomadik
  pinctrl: remove duplicated include from pinctrl-xway.c
  pinctrl: sirf: remove sirfsoc_gpio_set_pull function
  pinctrl: fix return value in bcm2835_pinctrl_probe()
  pinctrl: remove duplicated include from pinctrl-bcm2835.c
  pinctrl: bcm2835: Use existing pointer to struct device
  pinctrl: samsung: use __devinit section for init code
#ifndef __MACH_GPIO_H
#define __MACH_GPIO_H
/* Pull up/down values */
enum sirfsoc_gpio_pull {
SIRFSOC_GPIO_PULL_NONE,
SIRFSOC_GPIO_PULL_UP,
SIRFSOC_GPIO_PULL_DOWN,
};
void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode);
#endif
......@@ -29,7 +29,6 @@
#include <linux/irq.h>
#include <linux/irqdesc.h>
#include <linux/irqdomain.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of.h>
......@@ -960,7 +959,7 @@ static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev)
return err;
}
pc->base = devm_request_and_ioremap(&pdev->dev, &iomem);
pc->base = devm_request_and_ioremap(dev, &iomem);
if (!pc->base)
return -EADDRNOTAVAIL;
......@@ -1032,7 +1031,7 @@ static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev)
pc->pctl_dev = pinctrl_register(&bcm2835_pinctrl_desc, dev, pc);
if (!pc->pctl_dev) {
gpiochip_remove(&pc->gpio_chip);
return PTR_ERR(pc->pctl_dev);
return -EINVAL;
}
pc->gpio_range = bcm2835_pinctrl_gpio_range;
......
......@@ -30,7 +30,20 @@
#include <linux/pinctrl/pinconf.h>
/* Since we request GPIOs from ourself */
#include <linux/pinctrl/consumer.h>
/*
* For the U8500 archs, use the PRCMU register interface, for the older
* Nomadik, provide some stubs. The functions using these will only be
* called on the U8500 series.
*/
#ifdef CONFIG_ARCH_U8500
#include <linux/mfd/dbx500-prcmu.h>
#else
static inline u32 prcmu_read(unsigned int reg) {
return 0;
}
static inline void prcmu_write(unsigned int reg, u32 value) {}
static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {}
#endif
#include <asm/mach/irq.h>
......@@ -1268,6 +1281,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
struct clk *clk;
int secondary_irq;
void __iomem *base;
int irq_start = -1;
int irq;
int ret;
......@@ -1371,19 +1385,11 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
platform_set_drvdata(dev, nmk_chip);
if (np) {
/* The DT case will just grab a set of IRQ numbers */
nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
&nmk_gpio_irq_simple_ops, nmk_chip);
} else {
/* Non-DT legacy mode, use hardwired IRQ numbers */
int irq_start;
if (!np)
irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
nmk_chip->domain = irq_domain_add_simple(NULL,
nmk_chip->domain = irq_domain_add_simple(NULL,
NMK_GPIO_PER_CHIP, irq_start,
&nmk_gpio_irq_simple_ops, nmk_chip);
}
if (!nmk_chip->domain) {
dev_err(&dev->dev, "failed to create irqdomain\n");
ret = -ENOSYS;
......
......@@ -513,7 +513,7 @@ static int samsung_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
* Parse the pin names listed in the 'samsung,pins' property and convert it
* into a list of gpio numbers are create a pin group from it.
*/
static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
struct device_node *cfg_np, struct pinctrl_desc *pctl,
unsigned int **pin_list, unsigned int *npins)
{
......@@ -560,7 +560,7 @@ static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
* from device node of the pin-controller. A pin group is formed with all
* the pins listed in the "samsung,pins" property.
*/
static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
static int __devinit samsung_pinctrl_parse_dt(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{
struct device *dev = &pdev->dev;
......@@ -655,7 +655,7 @@ static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
}
/* register the pinctrl interface with the pinctrl subsystem */
static int __init samsung_pinctrl_register(struct platform_device *pdev,
static int __devinit samsung_pinctrl_register(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{
struct pinctrl_desc *ctrldesc = &drvdata->pctl;
......@@ -729,7 +729,7 @@ static int __init samsung_pinctrl_register(struct platform_device *pdev,
}
/* register the gpiolib interface with the gpiolib subsystem */
static int __init samsung_gpiolib_register(struct platform_device *pdev,
static int __devinit samsung_gpiolib_register(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{
struct gpio_chip *gc;
......@@ -762,7 +762,7 @@ static int __init samsung_gpiolib_register(struct platform_device *pdev,
}
/* unregister the gpiolib interface with the gpiolib subsystem */
static int __init samsung_gpiolib_unregister(struct platform_device *pdev,
static int __devinit samsung_gpiolib_unregister(struct platform_device *pdev,
struct samsung_pinctrl_drv_data *drvdata)
{
int ret = gpiochip_remove(drvdata->gc);
......
......@@ -1323,41 +1323,6 @@ static inline struct sirfsoc_gpio_bank *sirfsoc_gpio_to_bank(unsigned int gpio)
return &sgpio_bank[gpio / SIRFSOC_GPIO_BANK_SIZE];
}
void sirfsoc_gpio_set_pull(unsigned gpio, unsigned mode)
{
struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(gpio);
int idx = sirfsoc_gpio_to_offset(gpio);
u32 val, offset;
unsigned long flags;
offset = SIRFSOC_GPIO_CTRL(bank->id, idx);
spin_lock_irqsave(&sgpio_lock, flags);
val = readl(bank->chip.regs + offset);
switch (mode) {
case SIRFSOC_GPIO_PULL_NONE:
val &= ~SIRFSOC_GPIO_CTL_PULL_MASK;
break;
case SIRFSOC_GPIO_PULL_UP:
val |= SIRFSOC_GPIO_CTL_PULL_MASK;
val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
break;
case SIRFSOC_GPIO_PULL_DOWN:
val |= SIRFSOC_GPIO_CTL_PULL_MASK;
val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
break;
default:
break;
}
writel(val, bank->chip.regs + offset);
spin_unlock_irqrestore(&sgpio_lock, flags);
}
EXPORT_SYMBOL(sirfsoc_gpio_set_pull);
static inline struct sirfsoc_gpio_bank *sirfsoc_irqchip_to_bank(struct gpio_chip *chip)
{
return container_of(to_of_mm_gpio_chip(chip), struct sirfsoc_gpio_bank, chip);
......
......@@ -17,8 +17,6 @@
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include "pinctrl-lantiq.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册