From: narmstrong@baylibre.com (Neil Armstrong)
To: linus-amlogic@lists.infradead.org
Subject: [RESEND PATCH v2 1/4] pwm: Add support for Meson PWM Controller
Date: Mon, 22 Aug 2016 14:16:52 +0200 [thread overview]
Message-ID: <ad2f719e-9236-96fd-3bea-ce20c487c67f@baylibre.com> (raw)
In-Reply-To: <1471718083-11516-2-git-send-email-narmstrong@baylibre.com>
Hi Thierry,
On 08/20/2016 08:34 PM, Neil Armstrong wrote:
> Add support for the PWM controller found in the Amlogic SoCs.
> This driver supports the Meson8b and GXBB SoCs.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
> drivers/pwm/Kconfig | 9 +
> drivers/pwm/Makefile | 1 +
> drivers/pwm/pwm-meson.c | 491 ++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 501 insertions(+)
> create mode 100644 drivers/pwm/pwm-meson.c
>
[...]
> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
> new file mode 100644
> index 0000000..9e7ecf5
> --- /dev/null
> +++ b/drivers/pwm/pwm-meson.c
[...]
> +
> +static const char * const pwm_parents[] = {
> + "xtal", "vid_pll", "fclk_div4", "fclk_div3", NULL
> +};
Aww, crap, it's "vid_pll" on meson8b and "hdmi_pll" for gxbb.
I'll add it to DT mach data.
> +static int meson_pwm_enable(struct pwm_chip *chip,
> + struct pwm_device *pwm)
> +{
> + struct meson_pwm_chip *pwm_data = to_meson_pwm_chip(chip);
> + unsigned int id = pwm->hwpwm;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&pwm_data->lock, flags);
> + switch (id) {
> + case PWM_A:
> + writel(readl(pwm_data->base + REG_MISC_AB) | MISC_A_EN,
> + pwm_data->base + REG_MISC_AB);
Found an issue here, the HW requires to re-write the clock counts register even if the value is correct.
Let's got for a v3 !
> + break;
> +
> + case PWM_B:
> + writel(readl(pwm_data->base + REG_MISC_AB) | MISC_B_EN,
> + pwm_data->base + REG_MISC_AB);
> + break;
> +
> + default:
> + break;
> + }
> + spin_unlock_irqrestore(&pwm_data->lock, flags);
> +
> + return 0;
> +}
Is it worth rewriting the driver using the apply callback ?
I'll wish to have it for 4.9 if possible, do you think it's possible ?
Neil
next prev parent reply other threads:[~2016-08-22 12:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-20 18:34 [RESEND PATCH v2 0/4] pwm: Add Amlogic Meson SoC " Neil Armstrong
2016-08-20 18:34 ` [RESEND PATCH v2 1/4] pwm: Add support for Meson " Neil Armstrong
2016-08-22 12:16 ` Neil Armstrong [this message]
2016-08-20 18:34 ` [RESEND PATCH v2 2/4] dt-bindings: pwm: Add bindings " Neil Armstrong
2016-08-20 18:34 ` [RESEND PATCH v2 3/4] ARM64: dts: meson-gxbb: Add Meson GXBB PWM Controller nodes Neil Armstrong
2016-08-20 18:34 ` [RESEND PATCH v2 4/4] ARM: dts: meson8b: Add Meson8b " Neil Armstrong
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=ad2f719e-9236-96fd-3bea-ce20c487c67f@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=linus-amlogic@lists.infradead.org \
/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
all inboxes | Powered by JetHome®