[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbVekP0kFpwexpb3NhqRSouNW7FhhRpSK0yRQTrJAGt4A@mail.gmail.com>
Date: Wed, 9 Nov 2022 10:08:51 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Hans de Goede <hdegoede@...hat.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Thierry Reding <thierry.reding@...il.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-pwm@...r.kernel.org, Andy Shevchenko <andy@...nel.org>
Subject: Re: [PATCH v2 6/6] pinctrl: intel: Enumerate PWM device when
community has a capabilitty
On Tue, Nov 8, 2022 at 3:22 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> Some of the Communities may have PWM capability. In such cases,
> enumerate PWM device via respective driver. User is still responsible
> for setting correct pin muxing for the line that needs to output the
> signal.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
So:
> +#include <linux/platform_data/x86/pwm-lpss.h>
(...)
> +static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
> + struct intel_community *community)
> +{
> + static const struct pwm_lpss_boardinfo info = {
> + .clk_rate = 19200000,
> + .npwm = 1,
> + .base_unit_bits = 22,
> + .bypass = true,
> + };
> + struct pwm_lpss_chip *pwm;
> +
> + if (!(community->features & PINCTRL_FEATURE_PWM))
> + return 0;
> +
> + pwm = pwm_lpss_probe(pctrl->dev, community->regs + PWMC, &info);
> + if (IS_ERR(pwm) && PTR_ERR(pwm) != -ENODEV)
> + return PTR_ERR(pwm);
This is alike a boardfile embedded into the pin control driver.
It's a bit backwards since we usually go the other direction, i.e. probe
a PWM driver or whatever and then that driver request its resources
that are assigned from e.g. DT or ACPI, and in this case that would
mean it request its pin control handle and the pins get set up.
I guess I can be convinced that this hack is the lesser evil :D
What is it in the platform that makes this kind of hacks necessary?
Inconsistent description in ACPI or is the PWM device simply
missing from the DSDT (or whatever is the right form in ACPI)
in already shipped devices that need it?
Or is it simply impossible to describe the PWM device in ACPI?
Yours,
Linus Walleij
Powered by blists - more mailing lists