linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@baylibre.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH v2 1/2] soc: amlogic: add Meson GX VPU Domains driver
Date: Sun, 29 Oct 2017 15:59:03 +0100	[thread overview]
Message-ID: <7h60ayvw3s.fsf@baylibre.com> (raw)
In-Reply-To: <1509208817-30632-2-git-send-email-narmstrong@baylibre.com> (Neil Armstrong's message of "Sat, 28 Oct 2017 18:40:16 +0200")

Hi Neil,

Neil Armstrong <narmstrong@baylibre.com> writes:

> The Video Processing Unit needs a specific Power Domain powering scheme
> this driver handles this as a PM Power Domain driver.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

[...]

> +static inline
> +struct meson_gx_pwrc_vpu *genpd_to_pd(struct generic_pm_domain *d)
> +{
> +	return container_of(d, struct meson_gx_pwrc_vpu, genpd);
> +}
> +
> +static int meson_gx_pwrc_vpu_power_off(struct generic_pm_domain *genpd)
> +{
> +	struct meson_gx_pwrc_vpu *pd = genpd_to_pd(genpd);
> +	int i;
> +
> +	regmap_update_bits(pd->regmap_ao, AO_RTI_GEN_PWR_SLEEP0,
> +			   GEN_PWR_VPU_HDMI_ISO, GEN_PWR_VPU_HDMI_ISO);
> +	udelay(20);

Some minor nits/questions.  I know the vendor code does it this way,
but...

> +	/* Power Down Memories */
> +	for (i = 0; i < 32; i += 2) {
> +		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG0,
> +				   0x2 << i, 0x3 << i);
> +		udelay(5);
> +	}

several of these bits are marked "reserved" in the datasheet.  Have you tried
without writing to the reserved bits?

> +	for (i = 0; i < 32; i += 2) {
> +		regmap_update_bits(pd->regmap_hhi, HHI_VPU_MEM_PD_REG1,
> +				   0x2 << i, 0x3 << i);
> +		udelay(5);
> +	}

ditto

> +	for (i = 8; i < 16; i++) {
> +		regmap_update_bits(pd->regmap_hhi, HHI_MEM_PD_REG0,
> +				   BIT(i), BIT(i));
> +		udelay(5);
> +	}

Do these really have to be written one bit at a time?

I'm actually OK to merge things like this, since it also captures the
sequences used by the vendor kernel, but I'm just curious if you did any
of the other experiments.

If you can try those experiments, we can take them as follow-on patches.

Kevin

  reply	other threads:[~2017-10-29 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28 16:40 [RESEND PATCH v2 0/2] soc: amlogic: add support for Meson GX VPU Domains Neil Armstrong
2017-10-28 16:40 ` [RESEND PATCH v2 1/2] soc: amlogic: add Meson GX VPU Domains driver Neil Armstrong
2017-10-29 14:59   ` Kevin Hilman [this message]
2017-10-28 16:40 ` [RESEND PATCH v2 2/2] dt-bindings: power: add amlogic meson power domain bindings Neil Armstrong
  -- strict thread matches above, loose matches on Subject: below --
2017-10-28 16:36 [RESEND PATCH v2 0/2] soc: amlogic: add support for Meson GX VPU Domains Neil Armstrong
2017-10-28 16:36 ` [RESEND PATCH v2 1/2] soc: amlogic: add Meson GX VPU Domains driver Neil Armstrong
2017-10-30 15:40   ` Ulf Hansson
2017-10-30 16:47     ` Neil Armstrong
2017-10-30 16:56     ` Kevin Hilman

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=7h60ayvw3s.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).