[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zks5gJ7H6ZuWr_Xm@hovoldconsulting.com>
Date: Mon, 20 May 2024 13:52:32 +0200
From: Johan Hovold <johan@...nel.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Johan Hovold <johan+linaro@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Bjorn Andersson <andersson@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
linux-input@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org, Steev Klimaszewski <steev@...i.org>
Subject: Re: [PATCH v2 4/7] HID: i2c-hid: elan: fix reset suspend current
leakage
On Mon, May 20, 2024 at 01:44:06PM +0200, Johan Hovold wrote:
> On Fri, May 10, 2024 at 04:36:08PM -0700, Doug Anderson wrote:
> > On Tue, May 7, 2024 at 7:48 AM Johan Hovold <johan+linaro@...nel.org> wrote:
> > > @@ -67,7 +77,14 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops)
> > > struct i2c_hid_of_elan *ihid_elan =
> > > container_of(ops, struct i2c_hid_of_elan, ops);
> > >
> > > - gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1);
> > > + /*
> > > + * Do not assert reset when the hardware allows for it to remain
> > > + * deasserted regardless of the state of the (shared) power supply to
> > > + * avoid wasting power when the supply is left on.
> > > + */
> > > + if (!ihid_elan->no_reset_on_power_off)
> > > + gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1);
> > > +
> > > if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms)
> > > msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms);
> >
> > Shouldn't the above two lines be inside the "if
> > (!ihid_elan->no_reset_on_power_off)" test? If you're not setting the
> > reset GPIO then you don't need to do the delay, right?
>
> Yes, I guess you're right. The off-delay is weird and not normally used,
> but apparently it is needed by some panel-follower use case. AFAICT it's
> not even related to the reset line, just a hack to add a delay before
> the panel is reset by some other driver (see f2f43bf15d7a ("HID:
> i2c-hid: elan: Add ili9882t timing")).
>
> I think that's why I just looked the other way and left this little
> oddity here unchanged.
Hit send too soon.
Since this hack does not appear to be related to the reset line, I think
it's correct to not have it depend on whether the reset line is asserted
or not (e.g. as there could be 'panel-followers' with
'no_reset_on_power_off'):
The datasheet specifies there should be 60ms between touch SDA
sleep and panel RESX. Doug's series[1] allows panels and
touchscreens to power on/off together, so we can add the 65 ms
delay in i2c_hid_core_suspend before panel_unprepare.
The power-off delay variable should probably be renamed, but that's a
separate change.
So I think v2 of this series is good to go.
Johan
Powered by blists - more mailing lists