Skip to content

Commit

Permalink
Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6
Browse files Browse the repository at this point in the history
Changes queued in gpio/next for the start of the 3.3 merge window

* tag 'gpio-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6:
  gpio: Add decode of WM8994 GPIO configuration
  gpio: Convert GPIO drivers to module_platform_driver
  gpio: Fix typo in comment in Samsung driver
  gpio: Explicitly index samsung_gpio_cfgs
  gpio: Add Linus Walleij as gpio co-maintainer
  of: Add device tree selftests
  of: create of_phandle_args to simplify return of phandle parsing data
  gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags()
  gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags()
  gpiolib: output basic details and consolidate gpio device drivers
  pch_gpio: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor
  pch_gpio: Support new device LAPIS Semiconductor ML7831 IOH
  spi/pl022: make the chip deselect handling thread safe
  spi/pl022: add support for pm_runtime autosuspend
  spi/pl022: disable the PL022 block when unused
  spi/pl022: move device disable to workqueue thread
  spi/pl022: skip default configuration before suspending
  spi/pl022: fix build warnings
  spi/pl022: only enable RX interrupts when TX is complete
  • Loading branch information
torvalds committed Jan 7, 2012
2 parents 7affca3 + d0ad5e8 commit fbce1c2
Show file tree
Hide file tree
Showing 37 changed files with 530 additions and 402 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -2912,6 +2912,7 @@ F: include/linux/gigaset_dev.h

GPIO SUBSYSTEM
M: Grant Likely <grant.likely@secretlab.ca>
M: Linus Walleij <linus.walleij@stericsson.com>
S: Maintained
T: git git://git.secretlab.ca/git/linux-2.6.git
F: Documentation/gpio.txt
Expand Down
37 changes: 37 additions & 0 deletions arch/arm/boot/dts/testcases/tests-phandle.dtsi
@@ -0,0 +1,37 @@

/ {
testcase-data {
phandle-tests {
provider0: provider0 {
#phandle-cells = <0>;
};

provider1: provider1 {
#phandle-cells = <1>;
};

provider2: provider2 {
#phandle-cells = <2>;
};

provider3: provider3 {
#phandle-cells = <3>;
};

consumer-a {
phandle-list = <&provider1 1>,
<&provider2 2 0>,
<0>,
<&provider3 4 4 3>,
<&provider2 5 100>,
<&provider0>,
<&provider1 7>;
phandle-list-names = "first", "second", "third";

phandle-list-bad-phandle = <12345678 0 0>;
phandle-list-bad-args = <&provider2 1 0>,
<&provider3 0>;
};
};
};
};
1 change: 1 addition & 0 deletions arch/arm/boot/dts/testcases/tests.dtsi
@@ -0,0 +1 @@
/include/ "tests-phandle.dtsi"
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/versatile-pb.dts
Expand Up @@ -46,3 +46,5 @@
};
};
};

/include/ "testcases/tests.dtsi"
43 changes: 2 additions & 41 deletions arch/microblaze/kernel/reset.c
Expand Up @@ -19,50 +19,11 @@
static int handle; /* reset pin handle */
static unsigned int reset_val;

static int of_reset_gpio_handle(void)
{
int ret; /* variable which stored handle reset gpio pin */
struct device_node *root; /* root node */
struct device_node *gpio; /* gpio node */
struct gpio_chip *gc;
u32 flags;
const void *gpio_spec;

/* find out root node */
root = of_find_node_by_path("/");

/* give me handle for gpio node to be possible allocate pin */
ret = of_parse_phandles_with_args(root, "hard-reset-gpios",
"#gpio-cells", 0, &gpio, &gpio_spec);
if (ret) {
pr_debug("%s: can't parse gpios property\n", __func__);
goto err0;
}

gc = of_node_to_gpiochip(gpio);
if (!gc) {
pr_debug("%s: gpio controller %s isn't registered\n",
root->full_name, gpio->full_name);
ret = -ENODEV;
goto err1;
}

ret = gc->of_xlate(gc, root, gpio_spec, &flags);
if (ret < 0)
goto err1;

ret += gc->base;
err1:
of_node_put(gpio);
err0:
pr_debug("%s exited with status %d\n", __func__, ret);
return ret;
}

void of_platform_reset_gpio_probe(void)
{
int ret;
handle = of_reset_gpio_handle();
handle = of_get_named_gpio(of_find_node_by_path("/"),
"hard-reset-gpios", 0);

if (!gpio_is_valid(handle)) {
printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n",
Expand Down
42 changes: 8 additions & 34 deletions arch/powerpc/sysdev/qe_lib/gpio.c
Expand Up @@ -139,14 +139,10 @@ struct qe_pin {
struct qe_pin *qe_pin_request(struct device_node *np, int index)
{
struct qe_pin *qe_pin;
struct device_node *gpio_np;
struct gpio_chip *gc;
struct of_mm_gpio_chip *mm_gc;
struct qe_gpio_chip *qe_gc;
int err;
int size;
const void *gpio_spec;
const u32 *gpio_cells;
unsigned long flags;

qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL);
Expand All @@ -155,45 +151,25 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
return ERR_PTR(-ENOMEM);
}

err = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index,
&gpio_np, &gpio_spec);
if (err) {
pr_debug("%s: can't parse gpios property\n", __func__);
err = of_get_gpio(np, index);
if (err < 0)
goto err0;
gc = gpio_to_chip(err);
if (WARN_ON(!gc))
goto err0;
}

if (!of_device_is_compatible(gpio_np, "fsl,mpc8323-qe-pario-bank")) {
if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) {
pr_debug("%s: tried to get a non-qe pin\n", __func__);
err = -EINVAL;
goto err1;
}

gc = of_node_to_gpiochip(gpio_np);
if (!gc) {
pr_debug("%s: gpio controller %s isn't registered\n",
np->full_name, gpio_np->full_name);
err = -ENODEV;
goto err1;
}

gpio_cells = of_get_property(gpio_np, "#gpio-cells", &size);
if (!gpio_cells || size != sizeof(*gpio_cells) ||
*gpio_cells != gc->of_gpio_n_cells) {
pr_debug("%s: wrong #gpio-cells for %s\n",
np->full_name, gpio_np->full_name);
err = -EINVAL;
goto err1;
goto err0;
}

err = gc->of_xlate(gc, np, gpio_spec, NULL);
if (err < 0)
goto err1;

mm_gc = to_of_mm_gpio_chip(gc);
qe_gc = to_qe_gpio_chip(mm_gc);

spin_lock_irqsave(&qe_gc->lock, flags);

err -= gc->base;
if (test_and_set_bit(QE_PIN_REQUESTED, &qe_gc->pin_flags[err]) == 0) {
qe_pin->controller = qe_gc;
qe_pin->num = err;
Expand All @@ -206,8 +182,6 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)

if (!err)
return qe_pin;
err1:
of_node_put(gpio_np);
err0:
kfree(qe_pin);
pr_debug("%s failed with status %d\n", __func__, err);
Expand Down
11 changes: 6 additions & 5 deletions drivers/gpio/Kconfig
Expand Up @@ -387,19 +387,20 @@ config GPIO_LANGWELL
Say Y here to support Intel Langwell/Penwell GPIO.

config GPIO_PCH
tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GPIO"
tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7223/ML7831) GPIO"
depends on PCI && X86
select GENERIC_IRQ_CHIP
help
This driver is for PCH(Platform controller Hub) GPIO of Intel Topcliff
which is an IOH(Input/Output Hub) for x86 embedded processor.
This driver can access PCH GPIO device.

This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
Output Hub), ML7223.
This driver also can be used for LAPIS Semiconductor IOH(Input/
Output Hub), ML7223 and ML7831.
ML7223 IOH is for MP(Media Phone) use.
ML7223 is companion chip for Intel Atom E6xx series.
ML7223 is completely compatible for Intel EG20T PCH.
ML7831 IOH is for general purpose use.
ML7223/ML7831 is companion chip for Intel Atom E6xx series.
ML7223/ML7831 is completely compatible for Intel EG20T PCH.

config GPIO_ML_IOH
tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support"
Expand Down
12 changes: 1 addition & 11 deletions drivers/gpio/gpio-adp5520.c
Expand Up @@ -193,17 +193,7 @@ static struct platform_driver adp5520_gpio_driver = {
.remove = __devexit_p(adp5520_gpio_remove),
};

static int __init adp5520_gpio_init(void)
{
return platform_driver_register(&adp5520_gpio_driver);
}
module_init(adp5520_gpio_init);

static void __exit adp5520_gpio_exit(void)
{
platform_driver_unregister(&adp5520_gpio_driver);
}
module_exit(adp5520_gpio_exit);
module_platform_driver(adp5520_gpio_driver);

MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("GPIO ADP5520 Driver");
Expand Down
5 changes: 2 additions & 3 deletions drivers/gpio/gpio-adp5588.c
Expand Up @@ -418,9 +418,8 @@ static int __devinit adp5588_gpio_probe(struct i2c_client *client,
if (ret)
goto err_irq;

dev_info(&client->dev, "gpios %d..%d (IRQ Base %d) on a %s Rev. %d\n",
gc->base, gc->base + gc->ngpio - 1,
pdata->irq_base, client->name, revid);
dev_info(&client->dev, "IRQ Base: %d Rev.: %d\n",
pdata->irq_base, revid);

if (pdata->setup) {
ret = pdata->setup(client, gc->base, gc->ngpio, pdata->context);
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpio/gpio-bt8xx.c
Expand Up @@ -223,9 +223,6 @@ static int bt8xxgpio_probe(struct pci_dev *dev,
goto err_release_mem;
}

printk(KERN_INFO "bt8xxgpio: Abusing BT8xx card for GPIOs %d to %d\n",
bg->gpio.base, bg->gpio.base + BT8XXGPIO_NR_GPIOS - 1);

return 0;

err_release_mem:
Expand Down
14 changes: 1 addition & 13 deletions drivers/gpio/gpio-cs5535.c
Expand Up @@ -347,7 +347,6 @@ static int __devinit cs5535_gpio_probe(struct platform_device *pdev)
if (err)
goto release_region;

dev_info(&pdev->dev, "GPIO support successfully loaded.\n");
return 0;

release_region:
Expand Down Expand Up @@ -382,18 +381,7 @@ static struct platform_driver cs5535_gpio_driver = {
.remove = __devexit_p(cs5535_gpio_remove),
};

static int __init cs5535_gpio_init(void)
{
return platform_driver_register(&cs5535_gpio_driver);
}

static void __exit cs5535_gpio_exit(void)
{
platform_driver_unregister(&cs5535_gpio_driver);
}

module_init(cs5535_gpio_init);
module_exit(cs5535_gpio_exit);
module_platform_driver(cs5535_gpio_driver);

MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>");
MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver");
Expand Down
12 changes: 1 addition & 11 deletions drivers/gpio/gpio-da9052.c
Expand Up @@ -254,17 +254,7 @@ static struct platform_driver da9052_gpio_driver = {
},
};

static int __init da9052_gpio_init(void)
{
return platform_driver_register(&da9052_gpio_driver);
}
module_init(da9052_gpio_init);

static void __exit da9052_gpio_exit(void)
{
return platform_driver_unregister(&da9052_gpio_driver);
}
module_exit(da9052_gpio_exit);
module_platform_driver(da9052_gpio_driver);

MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
MODULE_DESCRIPTION("DA9052 GPIO Device Driver");
Expand Down
12 changes: 1 addition & 11 deletions drivers/gpio/gpio-generic.c
Expand Up @@ -524,17 +524,7 @@ static struct platform_driver bgpio_driver = {
.remove = __devexit_p(bgpio_pdev_remove),
};

static int __init bgpio_platform_init(void)
{
return platform_driver_register(&bgpio_driver);
}
module_init(bgpio_platform_init);

static void __exit bgpio_platform_exit(void)
{
platform_driver_unregister(&bgpio_driver);
}
module_exit(bgpio_platform_exit);
module_platform_driver(bgpio_driver);

#endif /* CONFIG_GPIO_GENERIC_PLATFORM */

Expand Down
15 changes: 1 addition & 14 deletions drivers/gpio/gpio-janz-ttl.c
Expand Up @@ -201,8 +201,6 @@ static int __devinit ttl_probe(struct platform_device *pdev)
goto out_iounmap_regs;
}

dev_info(&pdev->dev, "module %d: registered GPIO device\n",
pdata->modno);
return 0;

out_iounmap_regs:
Expand Down Expand Up @@ -239,20 +237,9 @@ static struct platform_driver ttl_driver = {
.remove = __devexit_p(ttl_remove),
};

static int __init ttl_init(void)
{
return platform_driver_register(&ttl_driver);
}

static void __exit ttl_exit(void)
{
platform_driver_unregister(&ttl_driver);
}
module_platform_driver(ttl_driver);

MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
MODULE_DESCRIPTION("Janz MODULbus VMOD-TTL Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:janz-ttl");

module_init(ttl_init);
module_exit(ttl_exit);
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-nomadik.c
Expand Up @@ -1150,8 +1150,8 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)

nmk_gpio_init_irq(nmk_chip);

dev_info(&dev->dev, "Bits %i-%i at address %p\n",
nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr);
dev_info(&dev->dev, "at address %p\n",
nmk_chip->addr);
return 0;

out_free:
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpio/gpio-pcf857x.c
Expand Up @@ -290,10 +290,7 @@ static int pcf857x_probe(struct i2c_client *client,
* methods can't be called from sleeping contexts.
*/

dev_info(&client->dev, "gpios %d..%d on a %s%s\n",
gpio->chip.base,
gpio->chip.base + gpio->chip.ngpio - 1,
client->name,
dev_info(&client->dev, "%s\n",
client->irq ? " (irq ignored)" : "");

/* Let platform code set up the GPIOs and their users.
Expand Down
7 changes: 4 additions & 3 deletions drivers/gpio/gpio-pch.c
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 OKI SEMICONDUCTOR Co., LTD.
* Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -49,8 +49,8 @@ struct pch_regs {

enum pch_type_t {
INTEL_EG20T_PCH,
OKISEMI_ML7223m_IOH, /* OKISEMI ML7223 IOH PCIe Bus-m */
OKISEMI_ML7223n_IOH /* OKISEMI ML7223 IOH PCIe Bus-n */
OKISEMI_ML7223m_IOH, /* LAPIS Semiconductor ML7223 IOH PCIe Bus-m */
OKISEMI_ML7223n_IOH /* LAPIS Semiconductor ML7223 IOH PCIe Bus-n */
};

/* Specifies number of GPIO PINS */
Expand Down Expand Up @@ -524,6 +524,7 @@ static DEFINE_PCI_DEVICE_TABLE(pch_gpio_pcidev_id) = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },
{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },
{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) },
{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },
{ 0, }
};
MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id);
Expand Down

0 comments on commit fbce1c2

Please sign in to comment.