Merge tag 'omap-for-v3.13/yet-more-dt-regressions-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
A rather big fix for a regression where we have dropped omap4 hwmod data earlier but are not initializing it from device tree. In addition to this fix we eventually also be fix the issues in the .dts files and drivers, but that's too intrusive for the -rc cycle and must be done later on. Also a fix for a regression where we now are wrongly trying to initialize devices on secure omaps like n900 and n9* when booted using device tree. We need to set aes, sham and timer12 to disabled mode for secure devices as they are claimed by the firmware running in the secure mode. And two more legacy booting vs device tree based booting fixes for am3517 that I did not notice earlier until Nishant Menon reported these to me few days ago. With these we're good to go having v3.13 working both for legacy booting and device tree based booting, and we can then go ahed and drop the legacy booting for mach-omap2 for v3.14. * tag 'omap-for-v3.13/yet-more-dt-regressions-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (494 commits) ARM: dts: Fix booting for secure omaps ARM: OMAP2+: Fix the machine entry for am3517 ARM: dts: Fix missing entries for am3517 ARM: OMAP2+: Fix overwriting hwmod data with data from device tree +Linux 3.13-rc3
This commit is contained in:
@@ -158,7 +158,7 @@ static int bcm_kona_gpio_get(struct gpio_chip *chip, unsigned gpio)
|
||||
spin_unlock_irqrestore(&kona_gpio->lock, flags);
|
||||
|
||||
/* return the specified bit status */
|
||||
return !!(val & bit);
|
||||
return !!(val & BIT(bit));
|
||||
}
|
||||
|
||||
static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
|
||||
|
@@ -70,10 +70,14 @@ static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
||||
u32 val;
|
||||
struct of_mm_gpio_chip *mm = to_of_mm_gpio_chip(gc);
|
||||
struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm);
|
||||
u32 out_mask, out_shadow;
|
||||
|
||||
val = in_be32(mm->regs + GPIO_DAT) & ~in_be32(mm->regs + GPIO_DIR);
|
||||
out_mask = in_be32(mm->regs + GPIO_DIR);
|
||||
|
||||
return (val | mpc8xxx_gc->data) & mpc8xxx_gpio2mask(gpio);
|
||||
val = in_be32(mm->regs + GPIO_DAT) & ~out_mask;
|
||||
out_shadow = mpc8xxx_gc->data & out_mask;
|
||||
|
||||
return (val | out_shadow) & mpc8xxx_gpio2mask(gpio);
|
||||
}
|
||||
|
||||
static int mpc8xxx_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
||||
|
@@ -102,7 +102,7 @@ struct msm_gpio_dev {
|
||||
DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO);
|
||||
DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
|
||||
struct irq_domain *domain;
|
||||
unsigned int summary_irq;
|
||||
int summary_irq;
|
||||
void __iomem *msm_tlmm_base;
|
||||
};
|
||||
|
||||
|
@@ -79,7 +79,7 @@ struct mvebu_gpio_chip {
|
||||
spinlock_t lock;
|
||||
void __iomem *membase;
|
||||
void __iomem *percpu_membase;
|
||||
unsigned int irqbase;
|
||||
int irqbase;
|
||||
struct irq_domain *domain;
|
||||
int soc_variant;
|
||||
};
|
||||
|
@@ -286,11 +286,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
if (!chip->base)
|
||||
return -ENOMEM;
|
||||
|
||||
chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR,
|
||||
irq_base, &pl061_domain_ops, chip);
|
||||
if (!chip->domain)
|
||||
return -ENODEV;
|
||||
|
||||
spin_lock_init(&chip->lock);
|
||||
|
||||
chip->gc.request = pl061_gpio_request;
|
||||
@@ -320,6 +315,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
irq_set_chained_handler(irq, pl061_irq_handler);
|
||||
irq_set_handler_data(irq, chip);
|
||||
|
||||
chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR,
|
||||
irq_base, &pl061_domain_ops, chip);
|
||||
if (!chip->domain)
|
||||
return -ENODEV;
|
||||
|
||||
for (i = 0; i < PL061_GPIO_NR; i++) {
|
||||
if (pdata) {
|
||||
if (pdata->directions & (1 << i))
|
||||
|
@@ -381,7 +381,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
|
||||
if (!p->irq_domain) {
|
||||
ret = -ENXIO;
|
||||
dev_err(&pdev->dev, "cannot initialize irq domain\n");
|
||||
goto err1;
|
||||
goto err0;
|
||||
}
|
||||
|
||||
if (devm_request_irq(&pdev->dev, irq->start,
|
||||
|
@@ -132,6 +132,7 @@ static int tb10x_gpio_direction_out(struct gpio_chip *chip,
|
||||
int mask = BIT(offset);
|
||||
int val = TB10X_GPIO_DIR_OUT << offset;
|
||||
|
||||
tb10x_gpio_set(chip, offset, value);
|
||||
tb10x_set_bits(tb10x_gpio, OFFSET_TO_REG_DDR, mask, val);
|
||||
|
||||
return 0;
|
||||
|
@@ -105,3 +105,4 @@ module_platform_driver(ucb1400_gpio_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Philips UCB1400 GPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:ucb1400_gpio");
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/idr.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/gpio.h>
|
||||
@@ -1308,6 +1309,18 @@ struct gpio_chip *gpiochip_find(void *data,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gpiochip_find);
|
||||
|
||||
static int gpiochip_match_name(struct gpio_chip *chip, void *data)
|
||||
{
|
||||
const char *name = data;
|
||||
|
||||
return !strcmp(chip->label, name);
|
||||
}
|
||||
|
||||
static struct gpio_chip *find_chip_by_name(const char *name)
|
||||
{
|
||||
return gpiochip_find((void *)name, gpiochip_match_name);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PINCTRL
|
||||
|
||||
/**
|
||||
@@ -1341,8 +1354,10 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip,
|
||||
ret = pinctrl_get_group_pins(pctldev, pin_group,
|
||||
&pin_range->range.pins,
|
||||
&pin_range->range.npins);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
kfree(pin_range);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pinctrl_add_gpio_range(pctldev, &pin_range->range);
|
||||
|
||||
@@ -2260,26 +2275,10 @@ void gpiod_add_table(struct gpiod_lookup *table, size_t size)
|
||||
mutex_unlock(&gpio_lookup_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller must have a acquired gpio_lookup_lock
|
||||
*/
|
||||
static struct gpio_chip *find_chip_by_name(const char *name)
|
||||
{
|
||||
struct gpio_chip *chip = NULL;
|
||||
|
||||
list_for_each_entry(chip, &gpio_lookup_list, list) {
|
||||
if (chip->label == NULL)
|
||||
continue;
|
||||
if (!strcmp(chip->label, name))
|
||||
break;
|
||||
}
|
||||
|
||||
return chip;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
|
||||
unsigned int idx, unsigned long *flags)
|
||||
unsigned int idx,
|
||||
enum gpio_lookup_flags *flags)
|
||||
{
|
||||
char prop_name[32]; /* 32 is max size of property name */
|
||||
enum of_gpio_flags of_flags;
|
||||
@@ -2297,20 +2296,22 @@ static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
|
||||
return desc;
|
||||
|
||||
if (of_flags & OF_GPIO_ACTIVE_LOW)
|
||||
*flags |= GPIOF_ACTIVE_LOW;
|
||||
*flags |= GPIO_ACTIVE_LOW;
|
||||
|
||||
return desc;
|
||||
}
|
||||
#else
|
||||
static struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,
|
||||
unsigned int idx, unsigned long *flags)
|
||||
unsigned int idx,
|
||||
enum gpio_lookup_flags *flags)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
|
||||
unsigned int idx, unsigned long *flags)
|
||||
unsigned int idx,
|
||||
enum gpio_lookup_flags *flags)
|
||||
{
|
||||
struct acpi_gpio_info info;
|
||||
struct gpio_desc *desc;
|
||||
@@ -2320,13 +2321,14 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
|
||||
return desc;
|
||||
|
||||
if (info.gpioint && info.active_low)
|
||||
*flags |= GPIOF_ACTIVE_LOW;
|
||||
*flags |= GPIO_ACTIVE_LOW;
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
|
||||
unsigned int idx, unsigned long *flags)
|
||||
unsigned int idx,
|
||||
enum gpio_lookup_flags *flags)
|
||||
{
|
||||
const char *dev_id = dev ? dev_name(dev) : NULL;
|
||||
struct gpio_desc *desc = ERR_PTR(-ENODEV);
|
||||
@@ -2366,7 +2368,7 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (chip->ngpio >= p->chip_hwnum) {
|
||||
if (chip->ngpio <= p->chip_hwnum) {
|
||||
dev_warn(dev, "GPIO chip %s has %d GPIOs\n",
|
||||
chip->label, chip->ngpio);
|
||||
continue;
|
||||
@@ -2416,9 +2418,9 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
||||
const char *con_id,
|
||||
unsigned int idx)
|
||||
{
|
||||
struct gpio_desc *desc;
|
||||
struct gpio_desc *desc = NULL;
|
||||
int status;
|
||||
unsigned long flags = 0;
|
||||
enum gpio_lookup_flags flags = 0;
|
||||
|
||||
dev_dbg(dev, "GPIO lookup for consumer %s\n", con_id);
|
||||
|
||||
@@ -2429,13 +2431,23 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
||||
} else if (IS_ENABLED(CONFIG_ACPI) && dev && ACPI_HANDLE(dev)) {
|
||||
dev_dbg(dev, "using ACPI for GPIO lookup\n");
|
||||
desc = acpi_find_gpio(dev, con_id, idx, &flags);
|
||||
} else {
|
||||
}
|
||||
|
||||
/*
|
||||
* Either we are not using DT or ACPI, or their lookup did not return
|
||||
* a result. In that case, use platform lookup as a fallback.
|
||||
*/
|
||||
if (!desc || IS_ERR(desc)) {
|
||||
struct gpio_desc *pdesc;
|
||||
dev_dbg(dev, "using lookup tables for GPIO lookup");
|
||||
desc = gpiod_find(dev, con_id, idx, &flags);
|
||||
pdesc = gpiod_find(dev, con_id, idx, &flags);
|
||||
/* If used as fallback, do not replace the previous error */
|
||||
if (!IS_ERR(pdesc) || !desc)
|
||||
desc = pdesc;
|
||||
}
|
||||
|
||||
if (IS_ERR(desc)) {
|
||||
dev_warn(dev, "lookup for GPIO %s failed\n", con_id);
|
||||
dev_dbg(dev, "lookup for GPIO %s failed\n", con_id);
|
||||
return desc;
|
||||
}
|
||||
|
||||
@@ -2444,8 +2456,12 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
||||
if (status < 0)
|
||||
return ERR_PTR(status);
|
||||
|
||||
if (flags & GPIOF_ACTIVE_LOW)
|
||||
if (flags & GPIO_ACTIVE_LOW)
|
||||
set_bit(FLAG_ACTIVE_LOW, &desc->flags);
|
||||
if (flags & GPIO_OPEN_DRAIN)
|
||||
set_bit(FLAG_OPEN_DRAIN, &desc->flags);
|
||||
if (flags & GPIO_OPEN_SOURCE)
|
||||
set_bit(FLAG_OPEN_SOURCE, &desc->flags);
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user