diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
commit | e5fd91f1ef340da553f7a79da9540c3db711c937 (patch) | |
tree | b11842027dc6641da63f4bcc524f8678263304a3 /drivers/pinctrl/nomadik | |
parent | 2a9b0348e685a63d97486f6749622b61e9e3292f (diff) |
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/pinctrl/nomadik')
-rw-r--r-- | drivers/pinctrl/nomadik/pinctrl-ab8505.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/nomadik/pinctrl-abx500.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/nomadik/pinctrl-nomadik.c | 66 |
3 files changed, 36 insertions, 36 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-ab8505.c b/drivers/pinctrl/nomadik/pinctrl-ab8505.c index bf0ef4ac3..42c6e1f78 100644 --- a/drivers/pinctrl/nomadik/pinctrl-ab8505.c +++ b/drivers/pinctrl/nomadik/pinctrl-ab8505.c @@ -286,7 +286,7 @@ alternate_functions ab8505_alternate_functions[AB8505_GPIO_MAX_NUMBER + 1] = { ALTERNATE_FUNCTIONS(9, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO9, bit 0 reserved */ ALTERNATE_FUNCTIONS(10, 1, 0, UNUSED, 1, 0, 0), /* GPIO10, altA and altB controlled by bit 0 */ ALTERNATE_FUNCTIONS(11, 2, 1, UNUSED, 0, 0, 0), /* GPIO11, altA controlled by bit 2 */ - ALTERNATE_FUNCTIONS(12, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO12, bit3 reseved */ + ALTERNATE_FUNCTIONS(12, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO12, bit3 reserved */ ALTERNATE_FUNCTIONS(13, 4, 3, 4, 1, 0, 2), /* GPIO13, altA altB and altC controlled by bit 3 and 4 */ ALTERNATE_FUNCTIONS(14, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO14, altA controlled by bit 5 */ ALTERNATE_FUNCTIONS(15, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO15, bit 6 reserved */ diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 23db4c9ac..97681fac0 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -1234,10 +1234,10 @@ static int abx500_gpio_probe(struct platform_device *pdev) abx500_pinctrl_desc.pins = pct->soc->pins; abx500_pinctrl_desc.npins = pct->soc->npins; pct->pctldev = pinctrl_register(&abx500_pinctrl_desc, &pdev->dev, pct); - if (!pct->pctldev) { + if (IS_ERR(pct->pctldev)) { dev_err(&pdev->dev, "could not register abx500 pinctrl driver\n"); - ret = -EINVAL; + ret = PTR_ERR(pct->pctldev); goto out_rem_chip; } dev_info(&pdev->dev, "registered pin controller\n"); diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index a6a22054c..809d88445 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -246,6 +246,7 @@ enum nmk_gpio_slpm { struct nmk_gpio_chip { struct gpio_chip chip; + struct irq_chip irqchip; void __iomem *addr; struct clk *clk; unsigned int bank; @@ -842,18 +843,6 @@ static void nmk_gpio_irq_shutdown(struct irq_data *d) clk_disable(nmk_chip->clk); } -static struct irq_chip nmk_gpio_irq_chip = { - .name = "Nomadik-GPIO", - .irq_ack = nmk_gpio_irq_ack, - .irq_mask = nmk_gpio_irq_mask, - .irq_unmask = nmk_gpio_irq_unmask, - .irq_set_type = nmk_gpio_irq_set_type, - .irq_set_wake = nmk_gpio_irq_set_wake, - .irq_startup = nmk_gpio_irq_startup, - .irq_shutdown = nmk_gpio_irq_shutdown, - .flags = IRQCHIP_MASK_ON_SUSPEND, -}; - static void __nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc, u32 status) { @@ -1077,18 +1066,6 @@ static inline void nmk_gpio_dbg_show_one(struct seq_file *s, #define nmk_gpio_dbg_show NULL #endif -/* This structure is replicated for each GPIO block allocated at probe time */ -static struct gpio_chip nmk_gpio_template = { - .request = nmk_gpio_request, - .free = nmk_gpio_free, - .direction_input = nmk_gpio_make_input, - .get = nmk_gpio_get_input, - .direction_output = nmk_gpio_make_output, - .set = nmk_gpio_set_output, - .dbg_show = nmk_gpio_dbg_show, - .can_sleep = false, -}; - void nmk_gpio_clocks_enable(void) { int i; @@ -1190,6 +1167,7 @@ static int nmk_gpio_probe(struct platform_device *dev) struct device_node *np = dev->dev.of_node; struct nmk_gpio_chip *nmk_chip; struct gpio_chip *chip; + struct irq_chip *irqchip; struct resource *res; struct clk *clk; int latent_irq; @@ -1236,19 +1214,40 @@ static int nmk_gpio_probe(struct platform_device *dev) nmk_chip->bank = dev->id; nmk_chip->clk = clk; nmk_chip->addr = base; - nmk_chip->chip = nmk_gpio_template; nmk_chip->parent_irq = irq; nmk_chip->latent_parent_irq = latent_irq; nmk_chip->sleepmode = supports_sleepmode; spin_lock_init(&nmk_chip->lock); chip = &nmk_chip->chip; + chip->request = nmk_gpio_request; + chip->free = nmk_gpio_free; + chip->direction_input = nmk_gpio_make_input; + chip->get = nmk_gpio_get_input; + chip->direction_output = nmk_gpio_make_output; + chip->set = nmk_gpio_set_output; + chip->dbg_show = nmk_gpio_dbg_show; + chip->can_sleep = false; chip->base = dev->id * NMK_GPIO_PER_CHIP; chip->ngpio = NMK_GPIO_PER_CHIP; chip->label = dev_name(&dev->dev); chip->dev = &dev->dev; chip->owner = THIS_MODULE; + irqchip = &nmk_chip->irqchip; + irqchip->irq_ack = nmk_gpio_irq_ack; + irqchip->irq_mask = nmk_gpio_irq_mask; + irqchip->irq_unmask = nmk_gpio_irq_unmask; + irqchip->irq_set_type = nmk_gpio_irq_set_type; + irqchip->irq_set_wake = nmk_gpio_irq_set_wake; + irqchip->irq_startup = nmk_gpio_irq_startup; + irqchip->irq_shutdown = nmk_gpio_irq_shutdown; + irqchip->flags = IRQCHIP_MASK_ON_SUSPEND; + irqchip->name = kasprintf(GFP_KERNEL, "nmk%u-%u-%u", + dev->id, + chip->base, + chip->base + chip->ngpio - 1); + clk_enable(nmk_chip->clk); nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI); clk_disable(nmk_chip->clk); @@ -1269,8 +1268,8 @@ static int nmk_gpio_probe(struct platform_device *dev) * handler will perform the actual work of handling the parent * interrupt. */ - ret = gpiochip_irqchip_add(&nmk_chip->chip, - &nmk_gpio_irq_chip, + ret = gpiochip_irqchip_add(chip, + irqchip, 0, handle_edge_irq, IRQ_TYPE_EDGE_FALLING); @@ -1280,13 +1279,13 @@ static int nmk_gpio_probe(struct platform_device *dev) return -ENODEV; } /* Then register the chain on the parent IRQ */ - gpiochip_set_chained_irqchip(&nmk_chip->chip, - &nmk_gpio_irq_chip, + gpiochip_set_chained_irqchip(chip, + irqchip, nmk_chip->parent_irq, nmk_gpio_irq_handler); if (nmk_chip->latent_parent_irq > 0) - gpiochip_set_chained_irqchip(&nmk_chip->chip, - &nmk_gpio_irq_chip, + gpiochip_set_chained_irqchip(chip, + irqchip, nmk_chip->latent_parent_irq, nmk_gpio_latent_irq_handler); @@ -1803,6 +1802,7 @@ static const struct pinmux_ops nmk_pinmux_ops = { .set_mux = nmk_pmx_set, .gpio_request_enable = nmk_gpio_request_enable, .gpio_disable_free = nmk_gpio_disable_free, + .strict = true, }; static int nmk_pin_config_get(struct pinctrl_dev *pctldev, unsigned pin, @@ -2029,9 +2029,9 @@ static int nmk_pinctrl_probe(struct platform_device *pdev) npct->dev = &pdev->dev; npct->pctl = pinctrl_register(&nmk_pinctrl_desc, &pdev->dev, npct); - if (!npct->pctl) { + if (IS_ERR(npct->pctl)) { dev_err(&pdev->dev, "could not register Nomadik pinctrl driver\n"); - return -EINVAL; + return PTR_ERR(npct->pctl); } /* We will handle a range of GPIO pins */ |