diff options
Diffstat (limited to 'drivers/pinctrl/samsung/pinctrl-exynos.c')
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-exynos.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 731530a9ce38..c8d0de7ea160 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -31,6 +31,8 @@ #include <linux/err.h> #include <linux/soc/samsung/exynos-pmu.h> +#include <dt-bindings/pinctrl/samsung.h> + #include "pinctrl-samsung.h" #include "pinctrl-exynos.h" @@ -149,15 +151,10 @@ static int exynos_irq_set_type(struct irq_data *irqd, unsigned int type) static int exynos_irq_request_resources(struct irq_data *irqd) { - struct irq_chip *chip = irq_data_get_irq_chip(irqd); - struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); const struct samsung_pin_bank_type *bank_type = bank->type; - unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; - unsigned long reg_con = our_chip->eint_con + bank->eint_offset; - unsigned long flags; - unsigned int mask; - unsigned int con; + unsigned long reg_con, flags; + unsigned int shift, mask, con; int ret; ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq); @@ -174,10 +171,10 @@ static int exynos_irq_request_resources(struct irq_data *irqd) spin_lock_irqsave(&bank->slock, flags); - con = readl(bank->eint_base + reg_con); + con = readl(bank->pctl_base + reg_con); con &= ~(mask << shift); - con |= EXYNOS_EINT_FUNC << shift; - writel(con, bank->eint_base + reg_con); + con |= EXYNOS_PIN_FUNC_EINT << shift; + writel(con, bank->pctl_base + reg_con); spin_unlock_irqrestore(&bank->slock, flags); @@ -186,15 +183,10 @@ static int exynos_irq_request_resources(struct irq_data *irqd) static void exynos_irq_release_resources(struct irq_data *irqd) { - struct irq_chip *chip = irq_data_get_irq_chip(irqd); - struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip); struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); const struct samsung_pin_bank_type *bank_type = bank->type; - unsigned int shift = EXYNOS_EINT_CON_LEN * irqd->hwirq; - unsigned long reg_con = our_chip->eint_con + bank->eint_offset; - unsigned long flags; - unsigned int mask; - unsigned int con; + unsigned long reg_con, flags; + unsigned int shift, mask, con; reg_con = bank->pctl_offset + bank_type->reg_offset[PINCFG_TYPE_FUNC]; shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; @@ -202,10 +194,10 @@ static void exynos_irq_release_resources(struct irq_data *irqd) spin_lock_irqsave(&bank->slock, flags); - con = readl(bank->eint_base + reg_con); + con = readl(bank->pctl_base + reg_con); con &= ~(mask << shift); - con |= FUNC_INPUT << shift; - writel(con, bank->eint_base + reg_con); + con |= EXYNOS_PIN_FUNC_INPUT << shift; + writel(con, bank->pctl_base + reg_con); spin_unlock_irqrestore(&bank->slock, flags); |