pinctrl: cherryview: Add chv_gpio_clear_triggering() helper function

This is a preparation patch for clearing the interrupt trigger from
chv_gpio_disable_free().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Hans de Goede 2018-12-04 20:42:46 +01:00 committed by Andy Shevchenko
parent 166d6e2adc
commit b6fb6e11b4
1 changed files with 14 additions and 5 deletions

View File

@ -846,6 +846,19 @@ static int chv_pinmux_set_mux(struct pinctrl_dev *pctldev,
return 0; return 0;
} }
static void chv_gpio_clear_triggering(struct chv_pinctrl *pctrl,
unsigned int offset)
{
void __iomem *reg;
u32 value;
reg = chv_padreg(pctrl, offset, CHV_PADCTRL1);
value = readl(reg);
value &= ~CHV_PADCTRL1_INTWAKECFG_MASK;
value &= ~CHV_PADCTRL1_INVRXTX_MASK;
chv_writel(value, reg);
}
static int chv_gpio_request_enable(struct pinctrl_dev *pctldev, static int chv_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range, struct pinctrl_gpio_range *range,
unsigned int offset) unsigned int offset)
@ -876,11 +889,7 @@ static int chv_gpio_request_enable(struct pinctrl_dev *pctldev,
} }
/* Disable interrupt generation */ /* Disable interrupt generation */
reg = chv_padreg(pctrl, offset, CHV_PADCTRL1); chv_gpio_clear_triggering(pctrl, offset);
value = readl(reg);
value &= ~CHV_PADCTRL1_INTWAKECFG_MASK;
value &= ~CHV_PADCTRL1_INVRXTX_MASK;
chv_writel(value, reg);
reg = chv_padreg(pctrl, offset, CHV_PADCTRL0); reg = chv_padreg(pctrl, offset, CHV_PADCTRL0);
value = readl(reg); value = readl(reg);