From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH] pinctrl: intel: Implements gpio free function Date: Thu, 21 Mar 2019 11:23:30 +0200 Message-ID: <20190321092330.GK9224@smile.fi.intel.com> References: <1553135724-38331-1-git-send-email-zhuchangchun@cvte.com> <20190321084420.GG3622@lahna.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190321084420.GG3622@lahna.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Mika Westerberg Cc: zhuchangchun , linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, hendychu@aliyun.com List-Id: linux-gpio@vger.kernel.org On Thu, Mar 21, 2019 at 10:44:20AM +0200, Mika Westerberg wrote: > On Thu, Mar 21, 2019 at 10:35:24AM +0800, zhuchangchun wrote: > > When we use the gpio to control some peripheral devices,and try to > > export the gpio first,then unexport the gpio, we test the signal with > > oscilloscope,and find the signal can't meet the requirements,because > > after we unexported the gpio,the gpio's register(tx and rx)value can't > > be recovered,and this will infruence the device work flow. > > After you unexport GPIO it can go back to any previous mode it was. If > you need to use it as GPIO then why unexport it in the first place? ...and on top of that GPIO sysfs interface is deprecated. > > We check the gpio's unexport code work flow, then find the gpio's free > > hook function has not been implemented, After we add pinmux_ops' free > > function to set exported gpio to recover its original value,the problem > > is fixed. > > I don't think this is what ->free callback should do (assuming we decide > to implement it since we don't implement ->release either). It is > supposed to reverse effects of ->request which is what it currently does ;-) Exactly! -- With Best Regards, Andy Shevchenko