From patchwork Wed Feb 12 10:13:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 3636861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 50CB29F334 for ; Wed, 12 Feb 2014 10:55:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79FB020165 for ; Wed, 12 Feb 2014 10:55:46 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E1342012E for ; Wed, 12 Feb 2014 10:55:45 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDWpm-00060u-65; Wed, 12 Feb 2014 10:14:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDWpW-0004EN-Qy; Wed, 12 Feb 2014 10:14:10 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDWpU-0004D9-6v for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2014 10:14:08 +0000 Received: from pizza.hi.pengutronix.de ([2001:6f8:1178:2:ca9c:dcff:febd:f1b5]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WDWp3-0003ql-4E; Wed, 12 Feb 2014 11:13:41 +0100 Message-ID: <1392200017.5536.32.camel@pizza.hi.pengutronix.de> Subject: Re: [RFC PATCH 1/4] ARM: imx6: gpc: Add PU power domain for GPU/VPU From: Philipp Zabel To: Shawn Guo Date: Wed, 12 Feb 2014 11:13:37 +0100 In-Reply-To: <20140212071731.GH31484@S2101-09.ap.freescale.net> References: <1392125231-28387-1-git-send-email-p.zabel@pengutronix.de> <1392125231-28387-2-git-send-email-p.zabel@pengutronix.de> <20140212071731.GH31484@S2101-09.ap.freescale.net> X-Mailer: Evolution 3.8.5-2+b1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:ca9c:dcff:febd:f1b5 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140212_051408_578419_645D6FC8 X-CRM114-Status: GOOD ( 18.40 ) X-Spam-Score: -2.6 (--) Cc: Mark Rutland , devicetree@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Shawn, thanks you for the comments. Am Mittwoch, den 12.02.2014, 15:17 +0800 schrieb Shawn Guo: > > +static int imx6q_pm_pu_power_off(struct generic_pm_domain *genpd) > > +{ > > + u32 val; > > + int iso, iso2sw; > > + > > + /* GPU3D, GPU2D, and VPU clocks should be disabled here */ > > The comment should be dropped? Ok. [...] > > +static int imx_gpc_probe(struct platform_device *pdev) > > +{ > > + struct device_node *np; > > + int ret; > > + > > + np = of_get_child_by_name(pdev->dev.of_node, "power-domain"); > > + if (!np) { > > + dev_err(&pdev->dev, "missing power-domain node\n"); > > + return -EINVAL; > > + } > > + > > + pu_reg = devm_regulator_get(&pdev->dev, "pu"); > > + if (IS_ERR(pu_reg)) { > > + ret = PTR_ERR(pu_reg); > > + dev_err(&pdev->dev, "failed to get pu regulator: %d\n", ret); > > + return ret; > > + } > > + > > + /* The regulator is initially enabled */ > > + ret = regulator_enable(pu_reg); > > That means the PU power domain will be always on when neither GPU nor > VPU is enabled? You are right, if there is no device in the power domain, it will never be disabled by the genpd framework. Disabling the domain by default should help: > > + if (ret < 0) { > > + dev_err(&pdev->dev, "failed to enable pu regulator: %d\n", ret); > > + return ret; > > + } > > + > > + imx6q_pu_domain.of_node = np; > > + pm_genpd_init(&imx6q_pu_domain, NULL, false); > > + bus_register_notifier(&platform_bus_type, &imx6q_platform_nb); return 0; > > + > > + return 0; > > +} > > + > > +static struct of_device_id imx_gpc_dt_ids[] = { > > + { .compatible = "fsl,imx6q-gpc" }, > > + { } > > +}; > > + > > +static struct platform_driver imx_gpc_driver = { > > + .driver = { > > + .name = "imx-gpc", > > + .owner = THIS_MODULE, > > + .of_match_table = imx_gpc_dt_ids, > > + }, > > + .probe = imx_gpc_probe, > > +}; > > + > > +static int __init imx_pgc_init(void) > > +{ > > + return platform_driver_register(&imx_gpc_driver); > > +} > > +subsys_initcall(imx_pgc_init); > > -- > > 1.8.5.3 > > regards Philipp diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index 65e0f2c..2fc4ea1 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -356,7 +356,8 @@ static int imx_gpc_probe(struct platform_device *pdev) } imx6q_pu_domain.of_node = np; - pm_genpd_init(&imx6q_pu_domain, NULL, false); + imx6q_pm_pu_power_off(&imx6q_pu_domain); + pm_genpd_init(&imx6q_pu_domain, NULL, true); bus_register_notifier(&platform_bus_type, &imx6q_platform_nb);