Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336033

[PATCH 2/2] pinctrl: mediatek: add input-enable and direction setting for eint resources

From Biao Huang <biao.huang@mediatek.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] pinctrl: mediatek: add input-enable and direction setting for eint resources
Date 2016-02-17 04:20 +0100
Message-ID <r30OJ-mV-13@gated-at.bofh.it> (permalink)
References <r30OJ-mV-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


To use pin as eint, user should make sure that:
1. pin is set to right mode, this is done in .irq_request_resources
implementation already.
2. direction of the pin is input, which should call GPIO API to set
pin to input gpio.
We add what step 2 do to .irq_request_resources so that user doesn't
need call GPIO API any more when pin for eint usage.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 578897a..342d85b 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -863,6 +863,10 @@ static int mtk_pinctrl_irq_request_resources(struct irq_data *d)
 
 	/* set mux to INT mode */
 	mtk_pmx_set_mode(pctl->pctl_dev, pin->pin.number, pin->eint.eintmux);
+	/* set gpio direction to input */
+	mtk_pmx_gpio_set_direction(pctl->pctl_dev, NULL, pin->pin.number, true);
+	/* set input-enable */
+	mtk_pconf_set_ies_smt(pctl, pin->pin.number, 1, PIN_CONFIG_INPUT_ENABLE);
 
 	return 0;
 }
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] pinctrl: mediatek: add input-enable and direction setting for eint resources Biao Huang <biao.huang@mediatek.com> - 2016-02-17 04:20 +0100
  Re: [PATCH 2/2] pinctrl: mediatek: add input-enable and direction  setting for eint resources Linus Walleij <linus.walleij@linaro.org> - 2016-02-19 00:40 +0100

csiph-web