All of lore.kernel.org
 help / color / mirror / Atom feed
From: Merlijn Wajer <merlijn@wizzup.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-omap <linux-omap@vger.kernel.org>,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
	Dev Null <devnull@uvos.xyz>, Pavel Machek <pavel@ucw.cz>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: Nokia N900 increased power draw with panel-sony-acx565akm loaded v5.9 and v5.10
Date: Thu, 16 Dec 2021 14:06:42 +0100	[thread overview]
Message-ID: <968dbb4a-3944-7226-d686-379a442be7ef@wizzup.org> (raw)
In-Reply-To: <20211213131023.ese6lrkayj4qopfa@earth.universe>

Hi Sebastian,

On 13/12/2021 14:10, Sebastian Reichel wrote:
> Hi,
> 
> On Fri, Dec 10, 2021 at 08:18:35PM +0100, Merlijn Wajer wrote:
> 
>> Any hints on what could cause this extra power draw? Maybe the panel is
>> waiting for something? I suppose it's potentially feasible that with
>> more modules and userspace loaded the panel idles properly, but I
>> currently don't have a way to measure that.
> 
> First of all: I do not have documentation for that panel. Before my
> patch what happened was that gpiod_get() initialized the reset GPIO
> as OUTPUT_LOW. Immediately afterwards it is configured as OUTPUT_HIGH
> in acx565akm_detect(). So there are 2 options:
> 
> 1. The reset GPIO was low before the driver probe starts. In that
>    case everything is fine with or without 7c4bada12d320 and there
>    is no expected change in behaviour. The GPIO is just toggled
>    slightly earlier.
> 
> 2. The reset GPIO was output-high before the driver probe starts
>    (e.g. because bootloader used the panel, kexec, ...). In that
>    case the reset GPIO will be low for just a very short time (just
>    a few instructions). Usually panels have a minimum time required
>    for reset lines to be asserted. In acx565akm_power_off() it is
>    hinted, that 100ms should be ok.
> 
> My patch fixes the behaviour, so that reset is no longer asserted
> for less than 100ms in the second case by not asserting it at all.
> That also means, that the LCD is not reset when it has already been
> configured before the probe routine is called. An alternative would
> be the following patch, which does the reset and ensures minimum
> reset times are ok:
> 
> ------------------------------------------------------
> git diff drivers/gpu/drm/panel/panel-sony-acx565akm.c
> diff --git a/drivers/gpu/drm/panel/panel-sony-acx565akm.c b/drivers/gpu/drm/panel/panel-sony-acx565akm.c
> index ba0b3ead150f..2a8c0f7342ce 100644
> --- a/drivers/gpu/drm/panel/panel-sony-acx565akm.c
> +++ b/drivers/gpu/drm/panel/panel-sony-acx565akm.c
> @@ -629,11 +629,12 @@ static int acx565akm_probe(struct spi_device *spi)
>         lcd->spi = spi;
>         mutex_init(&lcd->mutex);
>  
> -       lcd->reset_gpio = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_HIGH);
> +       lcd->reset_gpio = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW);
>         if (IS_ERR(lcd->reset_gpio)) {
>                 dev_err(&spi->dev, "failed to get reset GPIO\n");
>                 return PTR_ERR(lcd->reset_gpio);
>         }
> +       msleep(100); /* ensure minimum reset assertion time */
>  
>         ret = acx565akm_detect(lcd);
>         if (ret < 0) {
> ------------------------------------------------------

With this additional patch applied the device seems to idle at lower
power usage in the test environment I described in my previous email.
That is, it idles at at 42mW with the panel probed, as opposed to 60mW
with the panel probed. I also just booted to my Maemo Leste environment
and the panel still comes up fine and seems to behave fine.

Is there additional testing I can perform to make sure this patch is the
right one?

Thanks,
Regards,
Merlijn

  reply	other threads:[~2021-12-16 13:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 19:18 Nokia N900 increased power draw with panel-sony-acx565akm loaded v5.9 and v5.10 Merlijn Wajer
2021-12-10 19:59 ` Andreas Kemnade
2021-12-10 20:30   ` Merlijn Wajer
2021-12-13 13:10 ` Sebastian Reichel
2021-12-16 13:06   ` Merlijn Wajer [this message]
2022-01-06 12:53     ` Merlijn Wajer
2022-01-06 16:36       ` Ivaylo Dimitrov

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=968dbb4a-3944-7226-d686-379a442be7ef@wizzup.org \
    --to=merlijn@wizzup.org \
    --cc=devnull@uvos.xyz \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.