Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756267AbbHZGzO (ORCPT ); Wed, 26 Aug 2015 02:55:14 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:59794 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751493AbbHZGzM (ORCPT ); Wed, 26 Aug 2015 02:55:12 -0400 X-Listener-Flag: 11101 Message-ID: <1440572108.28149.4.camel@mtksdaap41> Subject: Re: [PATCH v2] soc: mediatek: add scpsys support active_wakeup From: Eddie Huang To: Daniel Kurtz CC: Matthias Brugger , Sascha Hauer , Chunfeng Yun , "linux-arm-kernel@lists.infradead.org" , , "linux-kernel@vger.kernel.org" , srv_heupstream Date: Wed, 26 Aug 2015 14:55:08 +0800 In-Reply-To: References: <1440482440-28700-1-git-send-email-eddie.huang@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2741 Lines: 82 On Wed, 2015-08-26 at 05:11 +0800, Daniel Kurtz wrote: > Hi Eddie, > > On Tue, Aug 25, 2015 at 2:00 PM, Eddie Huang wrote: > > Register gpd_dev_ops.active_wakeup function to support keep power > > during suspend state. And add flag to each power domain to > > decide whether keep power during suspend or not. > > > > Signed-off-by: Chunfeng Yun > > Signed-off-by: Eddie Huang > > Acked-by: Sascha Hauer > > > > --- > > Change in v2: > > Drop .active_wakeup = false lines in scp_domain_data[] array > > > > --- > > drivers/soc/mediatek/mtk-scpsys.c | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c > > index 43a79ed..df2f288 100644 > > --- a/drivers/soc/mediatek/mtk-scpsys.c > > +++ b/drivers/soc/mediatek/mtk-scpsys.c > > @@ -67,6 +67,7 @@ struct scp_domain_data { > > u32 sram_pdn_ack_bits; > > u32 bus_prot_mask; > > enum clk_id clk_id; > > + bool active_wakeup; > > }; > > > > static const struct scp_domain_data scp_domain_data[] __initconst = { > > @@ -127,6 +128,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = { > > .sram_pdn_bits = GENMASK(11, 8), > > .sram_pdn_ack_bits = GENMASK(15, 12), > > .clk_id = MT8173_CLK_NONE, > > + .active_wakeup = true, > > }, > > [MT8173_POWER_DOMAIN_MFG_ASYNC] = { > > .name = "mfg_async", > > @@ -171,6 +173,7 @@ struct scp_domain { > > u32 sram_pdn_bits; > > u32 sram_pdn_ack_bits; > > u32 bus_prot_mask; > > + bool active_wakeup; > > }; > > > > struct scp { > > @@ -370,6 +373,20 @@ out: > > return ret; > > } > > > > +static bool scpsys_active_wakeup(struct device *dev) > > +{ > > + struct generic_pm_domain *genpd; > > + struct scp_domain *scpd; > > + > > + if (IS_ERR_OR_NULL(dev->pm_domain)) > > + return false; > > Is it really possible to get here w/ pm_domain as an ERR or NULL? > If the power core can ensure this cannot happen, then this function > could be a bit simpler. > > Other than that, this patch is: > Reviewed-by: Daniel Kurtz > > -Dan > After checking drivers/base/power/domain.c, I believe check dev->pm_domain here is redundant, I will remove it. Eddie Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/