GPIO fixes for v3.11:

- Revert the OMAP fixes that caused more problems than they solved.
 - Fix a build error.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (GNU/Linux)
 
 iQIcBAABAgAGBQJR+h+XAAoJEEEQszewGV1zIMYQAK7VFsYq1ZNkzpoTYSkglnaa
 7twmEFqyV4U+jWtJRjpygJ1ZP6uL/ZdI/ouDlvOXlNf0dFJUtaSiqrL1eB2l7OXN
 9t463se/0h4/aoN4i09aN0CiDntmfrFxHnu6xe5oO4ukcw1EJu3gWekKBFZ6lX79
 1cayVAnrk2dudIjpNqBxJP+SzNGOI0yn1Ig+iznXw5JHhfjkZ0Heh1UQYpnVOjjC
 attVs4++lxj7Tj4qkdPibztEnvOzMFV4zAqMFsCiqv/8IqSui9J7zHBYdde05ICZ
 yynf3VWuhDjmhMYkNr+wUbfpBJA75u2ViEc/hKJihTykOOxuU+XvX/KGsBwbK7J+
 EENTzBDZmyH3OYntKHWJlHkFy6Ym6hWPVGIZ3AJoiMFX2SQzWMgqW/yVUvmeWNj+
 2Ds/of9n3VkN9j1dDnAdvrR1TqjpTDHCP+ZSgPSO1X4bBAbWi2HajwvMWZNKUIIP
 md2Qu+KWUuDBoq1FpndJWubmEzfRXAZJn4Ghk2ldoy8Q2zI6pSeG1yUHI0IFTLaD
 QsCpE84lUoBA1isLt9X2nRTNAKwBjb/9+x5VvT4tACd5V2nYk8TKiuE9DCVKDDNd
 7/KNO9p9HgisV+ZqSJyT8hPz42d0PXapKr+jW/dikX+7fXDJj3EY+s/jt0bTQlkS
 1Ut/Dhm0HAAzKBh+dHUV
 =PQ04
 -----END PGP SIGNATURE-----

Merge tag 'gpio-for-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Yet another GPIO pull request, fixing the fix from the last one.  It
  turns out that fixing the boot path for device tree boots on OMAP
  breaks out antique systems (such as OMAP1) and we need to find a
  better way.  So we're reverting that "fix" for the moment and thinking
  about something better.

  Also fixing a build issue on the MSM driver"

* tag 'gpio-for-v3.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio_msm: Fix build error due to missing err.h
  Revert "gpio/omap: don't create an IRQ mapping for every GPIO on DT"
  Revert "gpio/omap: auto request GPIO as input if used as IRQ via DT"
  Revert "gpio/omap: fix build error when OF_GPIO is not defined."
This commit is contained in:
Linus Torvalds 2013-08-02 14:57:24 -07:00
commit 1cb39a6cb9
2 changed files with 15 additions and 70 deletions

View file

@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <mach/msm_gpiomux.h>

View file

@ -1037,18 +1037,6 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
IRQ_NOREQUEST | IRQ_NOPROBE, 0);
}
#if defined(CONFIG_OF_GPIO)
static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip)
{
return chip->of_node != NULL;
}
#else
static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip)
{
return false;
}
#endif
static void omap_gpio_chip_init(struct gpio_bank *bank)
{
int j;
@ -1080,68 +1068,24 @@ static void omap_gpio_chip_init(struct gpio_bank *bank)
gpiochip_add(&bank->chip);
/*
* REVISIT these explicit calls to irq_create_mapping()
* to do the GPIO to IRQ domain mapping for each GPIO in
* the bank can be removed once all OMAP platforms have
* been migrated to Device Tree boot only.
* Since in DT boot irq_create_mapping() is called from
* irq_create_of_mapping() only for the GPIO lines that
* are used as interrupts.
*/
if (!omap_gpio_chip_boot_dt(&bank->chip))
for (j = 0; j < bank->width; j++)
irq_create_mapping(bank->domain, j);
for (j = 0; j < bank->width; j++) {
int irq = irq_create_mapping(bank->domain, j);
irq_set_lockdep_class(irq, &gpio_lock_class);
irq_set_chip_data(irq, bank);
if (bank->is_mpuio) {
omap_mpuio_alloc_gc(bank, irq, bank->width);
} else {
irq_set_chip_and_handler(irq, &gpio_irq_chip,
handle_simple_irq);
set_irq_flags(irq, IRQF_VALID);
}
}
irq_set_chained_handler(bank->irq, gpio_irq_handler);
irq_set_handler_data(bank->irq, bank);
}
static const struct of_device_id omap_gpio_match[];
static int omap_gpio_irq_map(struct irq_domain *d, unsigned int virq,
irq_hw_number_t hwirq)
{
struct gpio_bank *bank = d->host_data;
int gpio;
int ret;
if (!bank)
return -EINVAL;
irq_set_lockdep_class(virq, &gpio_lock_class);
irq_set_chip_data(virq, bank);
if (bank->is_mpuio) {
omap_mpuio_alloc_gc(bank, virq, bank->width);
} else {
irq_set_chip_and_handler(virq, &gpio_irq_chip,
handle_simple_irq);
set_irq_flags(virq, IRQF_VALID);
}
/*
* REVISIT most GPIO IRQ chip drivers need to call
* gpio_request() before a GPIO line can be used as an
* IRQ. Ideally this should be handled by the IRQ core
* but until then this has to be done on a per driver
* basis. Remove this once this is managed by the core.
*/
if (omap_gpio_chip_boot_dt(&bank->chip)) {
gpio = irq_to_gpio(bank, hwirq);
ret = gpio_request_one(gpio, GPIOF_IN, NULL);
if (ret) {
dev_err(bank->dev, "Could not request GPIO%d\n", gpio);
return ret;
}
}
return 0;
}
static struct irq_domain_ops omap_gpio_irq_ops = {
.xlate = irq_domain_xlate_onetwocell,
.map = omap_gpio_irq_map,
};
static int omap_gpio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@ -1207,10 +1151,10 @@ static int omap_gpio_probe(struct platform_device *pdev)
}
bank->domain = irq_domain_add_legacy(node, bank->width, irq_base,
0, &omap_gpio_irq_ops, bank);
0, &irq_domain_simple_ops, NULL);
#else
bank->domain = irq_domain_add_linear(node, bank->width,
&omap_gpio_irq_ops, bank);
&irq_domain_simple_ops, NULL);
#endif
if (!bank->domain) {
dev_err(dev, "Couldn't register an IRQ domain\n");