devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/4] soc: Mediatek: Add SCPSYS power domain driver
Date: Mon, 13 Apr 2015 12:55:57 +0200	[thread overview]
Message-ID: <20150413105557.GR9742@pengutronix.de> (raw)
In-Reply-To: <7hbnj9b08m.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>

On Tue, Mar 31, 2015 at 09:27:53AM -0700, Kevin Hilman wrote:
> Hi Sascha,
> 
> Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> writes:
> 
> > This adds a power domain driver for the Mediatek SCPSYS unit.
> >
> > The System Control Processor System (SCPSYS) has several power
> > management related tasks in the system. The tasks include thermal
> > measurement, dynamic voltage frequency scaling (DVFS), interrupt
> > filter and lowlevel sleep control. The System Power Manager (SPM)
> > inside the SCPSYS is for the MTCMOS power domain control.
> >
> > For now this driver only adds power domain support, the more
> > advanced features are not yet supported. The driver implements
> > the generic PM domain device tree bindings, the first user will
> > most likely be the Mediatek AFE audio driver.
> >
> > Signed-off-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> 
> Sorry for the lag, was travelling last week at ELC and not keeping up
> with reviews.
> 
> This version looks pretty good to me, but had one minor
> comment/question...
> 
> [...]
> 
> > +#define NUM_DOMAINS	ARRAY_SIZE(scp_domain_data)
> > +
> > +struct scp;
> > +
> > +struct scp_domain {
> > +	struct generic_pm_domain pmd;
> > +	struct scp_domain_data *data;
> > +	struct scp *scp;
> > +};
> > +
> > +struct scp {
> > +	struct scp_domain domains[NUM_DOMAINS];
> > +	struct generic_pm_domain *pmd[NUM_DOMAINS];
> 
> Why is this genpd pointer needed?  It's just a pointer to the
> .domains.pmd[i] anyways, and IMO makes the code a bit hard to follow.

The driver itself does not need the genpd pointer, but
of_genpd_add_provider_onecell() expects an array of pointers to struct
generic_pm_domain.

I can allocate the array of pointers separately and remove the pmd field
from struct scp to make this a bit more clearer.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  parent reply	other threads:[~2015-04-13 10:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 15:40 [PATCH v1] Mediatek SCPSYS power domain support Sascha Hauer
2015-03-10 15:41 ` [PATCH 1/4] dt-bindings: soc: Add documentation for the MediaTek SCPSYS unit Sascha Hauer
2015-03-10 15:41 ` [PATCH 3/4] ARM64: MediaTek: Add generic pm domain support Sascha Hauer
2015-03-10 15:41 ` [PATCH 4/4] ARM64: MediaTek MT8173: Add SCPSYS device node Sascha Hauer
     [not found] ` <1426002063-25713-1-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-10 15:41   ` [PATCH 2/4] soc: Mediatek: Add SCPSYS power domain driver Sascha Hauer
2015-03-11 11:10     ` Paul Bolle
2015-03-31 16:27     ` Kevin Hilman
     [not found]       ` <7hbnj9b08m.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2015-04-13 10:55         ` Sascha Hauer [this message]
2015-05-08 12:16     ` Matthias Brugger
     [not found]       ` <CABuKBeLvBfeXw+b+SxAEjGA2dzPhYBs-SiJUyP5dUA28R=Rjkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-08 12:19         ` Sascha Hauer
2015-05-08 12:28           ` Matthias Brugger
     [not found]             ` <CABuKBeJ=HrwNMvV5N+6pnBgbB9k7e=8UPi3WWBTnpRFeEbTWvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-08 12:51               ` Sascha Hauer
2015-05-08 15:51                 ` Matthias Brugger
2015-03-26  9:45   ` [PATCH v1] Mediatek SCPSYS power domain support Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2015-05-11 13:11 [PATCH v2] " Sascha Hauer
     [not found] ` <1431349882-12260-1-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-05-11 13:11   ` [PATCH 2/4] soc: Mediatek: Add SCPSYS power domain driver Sascha Hauer
     [not found]     ` <1431349882-12260-3-git-send-email-s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-05-26 22:35       ` Kevin Hilman
2015-05-27  6:24         ` Sascha Hauer
2015-05-28 17:22           ` Kevin Hilman
2015-03-09  8:09 [RFC] Mediatek SCPSYS power domain support Sascha Hauer
2015-03-09  8:10 ` [PATCH 2/4] soc: Mediatek: Add SCPSYS power domain driver Sascha Hauer
2015-03-09 21:35   ` Kevin Hilman
     [not found]     ` <7h61a94zy0.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2015-03-10  9:41       ` Sascha Hauer
2015-03-10 14:40         ` Sascha Hauer
     [not found]           ` <20150310144053.GH24885-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-10 16:00             ` Kevin Hilman
     [not found]         ` <20150310094142.GD24885-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-11  3:16           ` James Liao
2015-03-11  9:03             ` Sascha Hauer
2015-03-11 17:14               ` Kevin Hilman
2015-03-12  7:21                 ` Sascha Hauer

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=20150413105557.GR9742@pengutronix.de \
    --to=s.hauer-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).