linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Arun Murthy <arun.murthy@stericsson.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-pwm@vger.kernel.org, Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH] pwm: ab8500: Fix register offset calculation to not depend on probe order
Date: Tue, 6 Jul 2021 00:35:45 +0200	[thread overview]
Message-ID: <CACRpkdYz2aUZKSrMSzcAK2o1JJSXUFgHdYhVWdtKHt1N6_-rZg@mail.gmail.com> (raw)
In-Reply-To: <20210705165510.443580-1-u.kleine-koenig@pengutronix.de>

On Mon, Jul 5, 2021 at 6:55 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> The assumption that lead to commit 5e5da1e9fbee ("pwm: ab8500:
> Explicitly allocate pwm chip base dynamically") was wrong: The
> pwm-ab8500 devices are not directly instantiated from device tree, but
> from the ab8500 mfd driver. So the pdev->id isn't -1, but a number
> between 1 and 3. Now that pwmchip ids are always allocated dynamically,
> this cannot easily be reverted.
>
> Introduce a new member in the driver data struct that tracks the
> hardware id and use this to calculate the register offset.
>
> Side-note: Using chip->base to calculate the offset was never robust
> because if there was already a PWM with id 1 at the time ab8500-pwm.1
> was probed, the associated pwmchip would get assigned chip->base = 2 (or
> something bigger).
>
> Fixes: 5e5da1e9fbee ("pwm: ab8500: Explicitly allocate pwm chip base dynamically")
> Fixes: 6173f8f4ed9c ("pwm: Move AB8500 PWM driver to PWM framework")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This looks good to me so:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

It seems we may have a vibrator motor connected to this on one
of our reference designs, so I am trying to figure out if I can test
this properly.

Yours,
Linus Walleij

      reply	other threads:[~2021-07-05 22:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 16:55 [PATCH] pwm: ab8500: Fix register offset calculation to not depend on probe order Uwe Kleine-König
2021-07-05 22:35 ` Linus Walleij [this message]

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=CACRpkdYz2aUZKSrMSzcAK2o1JJSXUFgHdYhVWdtKHt1N6_-rZg@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=arnd@arndb.de \
    --cc=arun.murthy@stericsson.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).