From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "zhuchangchun@cvte.com" <zhuchangchun@cvte.com>
Cc: "andriy.shevchenko" <andriy.shevchenko@linux.intel.com>,
"linus.walleij" <linus.walleij@linaro.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
hendychu <hendychu@aliyun.com>
Subject: Re: Re: [PATCH] pinctrl: intel: Implements gpio free function
Date: Thu, 21 Mar 2019 15:56:42 +0200 [thread overview]
Message-ID: <20190321135642.GK3622@lahna.fi.intel.com> (raw)
In-Reply-To: <2019032121342663125658@cvte.com>
On Thu, Mar 21, 2019 at 09:35:26PM +0800, zhuchangchun@cvte.com wrote:
> --> I know your meaning, even though I've did following actions
> instead of unexport,
>
> # echo 0 > /sys/class/gpio/gpioXX/value
> # echo in > /sys/class/gpio/gpioXX/direction
>
> the padcfg0 value still can not roll back,because after export the
> gpio,the following
>
> action as padcfg0 settings was done.
>
> Exactly TX and RX register have been set as below in GPIO request:
>
> /* Disable TX buffer and enable RX (this will be input) */
>
> value &= ~PADCFG0_GPIORXDIS;
>
> value |= PADCFG0_GPIOTXDIS;
>
> this will infruence next reboot gpio signal.
>
> And could you pls see my ->free function implementation?
I checked it and you do this:
+ value |= PADCFG0_GPIORXDIS;
+ value &= ~PADCFG0_GPIOTXDIS;
which pretty much turns the pin GPIO output unconditionally. I don't
really think it is good idea. May work in your case but may cause
problems with others.
If you want to keep it as output and leave the value 1 (high) before you
issue reboot, I don't think you need to do anything via sysfs (as the
pin is already in that state and issuing reboot command should not
change anything because the driver does not have ->shutdown callback.
In other words, your peripheral expects reset GPIO to be asserted (high)
during reboot so unless the boot firmware resets the pin I don't see why
leaving it as is does not work for you.
next prev parent reply other threads:[~2019-03-21 13:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 2:35 [PATCH] pinctrl: intel: Implements gpio free function zhuchangchun
2019-03-21 8:44 ` Mika Westerberg
2019-03-21 9:23 ` Andy Shevchenko
2019-03-22 18:32 ` Enrico Weigelt, metux IT consult
2019-03-22 19:06 ` Andy Shevchenko
2019-03-25 9:36 ` Enrico Weigelt, metux IT consult
2019-03-25 11:45 ` Andy Shevchenko
2019-04-03 4:13 ` Linus Walleij
2019-04-04 10:51 ` Enrico Weigelt, metux IT consult
2019-04-04 11:52 ` Andy Shevchenko
2019-04-04 16:03 ` Linus Walleij
[not found] ` <2019032119195575582546@cvte.com>
2019-03-21 12:03 ` Mika Westerberg
[not found] ` <2019032120213955866649@cvte.com>
2019-03-21 12:36 ` Mika Westerberg
[not found] ` <2019032121342663125658@cvte.com>
2019-03-21 13:56 ` Mika Westerberg [this message]
[not found] ` <2019032211131426883268@cvte.com>
2019-03-22 10:42 ` Mika Westerberg
[not found] ` <2019032314505202825175@cvte.com>
2019-03-23 16:48 ` andriy.shevchenko
[not found] ` <2019032517511048990383@cvte.com>
2019-03-25 11:48 ` andriy.shevchenko
2019-03-22 18:35 ` Enrico Weigelt, metux IT consult
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=20190321135642.GK3622@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hendychu@aliyun.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhuchangchun@cvte.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