linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yingjoe Chen <yingjoe.chen@mediatek.com>
To: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Sherman Yin <syin@broadcom.com>,
	Biao Huang <biao.huang@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	srv_heupstream@mediatek.com,
	Eddie Huang <eddie.huang@mediatek.com>
Subject: Re: [PATCH 1/2] pinctrl: mediatek: fix direction control issue
Date: Tue, 16 Feb 2016 16:54:29 +0800	[thread overview]
Message-ID: <1455612869.11448.22.camel@mtksdaap41> (raw)
In-Reply-To: <1455242831.35628.15.camel@mussux00>

On Thu, 2016-02-11 at 18:07 -0800, Hongzhou Yang wrote:
> On Fri, 2016-02-05 at 14:52 +0100, Linus Walleij wrote:
> > On Thu, Feb 4, 2016 at 4:03 AM, Hongzhou Yang
> > <hongzhou.yang@mediatek.com> wrote:
> > > On Wed, 2016-02-03 at 09:24 +0800, Biao Huang wrote:
> > >> Since input-enable/disable and input-schmitt-enable/disable are
> > >> workable when gpio direction is input, so add direction setting
> > >> when do input-enable/disable and input-schmitt-enable/disable
> > >> properties.
> > >>
> > >> Signed-off-by: Biao Huang <biao.huang@mediatek.com>
> > >> ---
> > >>  drivers/pinctrl/mediatek/pinctrl-mtk-common.c |    2 ++
> > >>  1 file changed, 2 insertions(+)
> > >>
> > >> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > >> index 8cac73d..6eb01c9 100644
> > >> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > >> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > >> @@ -352,6 +352,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev,
> > >>               ret = mtk_pconf_set_pull_select(pctl, pin, true, false, arg);
> > >>               break;
> > >>       case PIN_CONFIG_INPUT_ENABLE:
> > >> +             mtk_pmx_gpio_set_direction(pctldev, NULL, pin, true);
> > >>               ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param);
> > >
> > > Hi Linus,
> > >
> > > From pinctrl-bindings.txt, 'input-enable' property defined as following:
> > > input-enable        - enable input on pin (no effect on output)
> > >
> > > Since input enable and input direction are two different settings on our
> > > SOC,
> > 
> > What does this mean? How can input have a "direction"?
> > 
> > Isn't the direction of an input always inbound, into the SoC?
> > 
> > Please elaborate.
> 
> Sorry for the late reply.
> There are two conditions if external device input data into SOC.
> 1. Change GPIO direction to input.
> 2. Switch on input.
> 
> 
> > > could you tell me the exact meaning of this property? Input enable
> > > only? Or set input direction at the same time?
> > 
> > This was added in commit 8ba3f4d00078e7a49c60c0bd6298f29402c3a0a0
> > "pinctrl: Adds slew-rate, input-enable/disable"
> > by Sherman Yin so let's ask him first.
> 
> Thanks for this info.
> From Sherman's comment, PIN_CONFIG_INPUT_ENABLE seems only to stand for
> the condition 2.
> 
> * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input.  Note that this does
> not affect the pin's ability to drive output.  1 enables input, 0
> disables input.
> 
> Then I get confuse if we can change direction under this property.

Hi,

To make it more clear, for a GPIO pin to get input on MTK chip, we must:

- Enable input for the pad (input-enable)
- Set mux to GPIO mode
- Set GPIO direction to input

Currently user need to add a dts node to set pinmux to GPIO mode with
input-enable property, the driver need to call gpio_direction_input to
set direction.

Since input-enable and GPIO direction are 2 different things, we now
think this patch is inappropriate. Instead, user should not required to
add pinmux node in dts if all he want is use it as plain GPIO input.
Patch [2/2] remove the need to set it to GPIO mode, Biao will send a new
patch to remove the need for input-enable.

Joe.C



  reply	other threads:[~2016-02-16  8:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  1:24 [PATCH 0/2] pinctrl: mediatek: Add direction control and gpio_request_enable Support Biao Huang
     [not found] ` <1454462686-770-1-git-send-email-biao.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-02-03  1:24   ` [PATCH 1/2] pinctrl: mediatek: fix direction control issue Biao Huang
     [not found]     ` <1454462686-770-2-git-send-email-biao.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2016-02-04  3:03       ` Hongzhou Yang
2016-02-05 13:52         ` Linus Walleij
2016-02-12  2:07           ` Hongzhou Yang
2016-02-16  8:54             ` Yingjoe Chen [this message]
2016-02-16 12:28               ` Linus Walleij
2016-02-05 13:56     ` Linus Walleij
2016-02-03  1:24 ` [PATCH 2/2] pinctrl: mediatek: Add gpio_request_enable support Biao Huang
2016-02-05 13:58   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455612869.11448.22.camel@mtksdaap41 \
    --to=yingjoe.chen@mediatek.com \
    --cc=biao.huang@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=hongzhou.yang@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=syin@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).