aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pinctrl/pinctrl-exynos.c12
-rw-r--r--drivers/pinctrl/pinctrl-exynos.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
index 447818d9851b..c2fa85f18764 100644
--- a/drivers/pinctrl/pinctrl-exynos.c
+++ b/drivers/pinctrl/pinctrl-exynos.c
@@ -76,9 +76,11 @@ static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
76 struct samsung_pinctrl_drv_data *d = irqd->domain->host_data; 76 struct samsung_pinctrl_drv_data *d = irqd->domain->host_data;
77 struct samsung_pin_ctrl *ctrl = d->ctrl; 77 struct samsung_pin_ctrl *ctrl = d->ctrl;
78 struct exynos_geint_data *edata = irq_data_get_irq_handler_data(irqd); 78 struct exynos_geint_data *edata = irq_data_get_irq_handler_data(irqd);
79 struct samsung_pin_bank *bank = edata->bank;
79 unsigned int shift = EXYNOS_EINT_CON_LEN * edata->pin; 80 unsigned int shift = EXYNOS_EINT_CON_LEN * edata->pin;
80 unsigned int con, trig_type; 81 unsigned int con, trig_type;
81 unsigned long reg_con = ctrl->geint_con + edata->eint_offset; 82 unsigned long reg_con = ctrl->geint_con + edata->eint_offset;
83 unsigned int mask;
82 84
83 switch (type) { 85 switch (type) {
84 case IRQ_TYPE_EDGE_RISING: 86 case IRQ_TYPE_EDGE_RISING:
@@ -110,6 +112,16 @@ static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
110 con &= ~(EXYNOS_EINT_CON_MASK << shift); 112 con &= ~(EXYNOS_EINT_CON_MASK << shift);
111 con |= trig_type << shift; 113 con |= trig_type << shift;
112 writel(con, d->virt_base + reg_con); 114 writel(con, d->virt_base + reg_con);
115
116 reg_con = bank->pctl_offset;
117 shift = edata->pin * bank->func_width;
118 mask = (1 << bank->func_width) - 1;
119
120 con = readl(d->virt_base + reg_con);
121 con &= ~(mask << shift);
122 con |= EXYNOS_EINT_FUNC << shift;
123 writel(con, d->virt_base + reg_con);
124
113 return 0; 125 return 0;
114} 126}
115 127
diff --git a/drivers/pinctrl/pinctrl-exynos.h b/drivers/pinctrl/pinctrl-exynos.h
index 5f27ba974a3a..31d0a06174e4 100644
--- a/drivers/pinctrl/pinctrl-exynos.h
+++ b/drivers/pinctrl/pinctrl-exynos.h
@@ -144,6 +144,7 @@ enum exynos4210_gpio_xc_start {
144#define EXYNOS_WKUP_EMASK_OFFSET 0xF00 144#define EXYNOS_WKUP_EMASK_OFFSET 0xF00
145#define EXYNOS_WKUP_EPEND_OFFSET 0xF40 145#define EXYNOS_WKUP_EPEND_OFFSET 0xF40
146#define EXYNOS_SVC_OFFSET 0xB08 146#define EXYNOS_SVC_OFFSET 0xB08
147#define EXYNOS_EINT_FUNC 0xF
147 148
148/* helpers to access interrupt service register */ 149/* helpers to access interrupt service register */
149#define EXYNOS_SVC_GROUP_SHIFT 3 150#define EXYNOS_SVC_GROUP_SHIFT 3