From patchwork Mon Sep 3 20:08:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jasper Mattsson X-Patchwork-Id: 10586355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A3F55A4 for ; Mon, 3 Sep 2018 20:09:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 195DE292F1 for ; Mon, 3 Sep 2018 20:09:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DA70292F6; Mon, 3 Sep 2018 20:09:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B42EB292F1 for ; Mon, 3 Sep 2018 20:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IerW8lLS8G14EqR4fUaoXDHjZtp+Lt3PB8Qbus6j5jQ=; b=AlTwDszZh4bLtG nl0MQcsPZUVuLul1zHSyRzsR5655ZIqA8UduXo5hn240MXHNvEsOYME3YUhopWAKN3KnJBki37uzB zfCBb5caS3T70sTu6EpJKc95l9y79T65oL5s6QhtqII+aKO0pyA9Kdks4ixkbCQDCkayW6ch4bx0f MBhTEvlY7RIyWyGgMhr8NSvMM8rg2G6yScLRqd1e6NQiQNBcZDV3CRgIvtFVREYFBDewkYBPDYYNy n1lmIn8kQYQIcb52CKrdq/xeKGEkMm8OISmEj2BdsJqfXxll269o4Eklfv41axtgScNT/kTVBOjL2 pf1MMAo3+/V34HQVI7AA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fwv9g-00076S-En for patchwork-linux-mediatek@patchwork.kernel.org; Mon, 03 Sep 2018 20:09:00 +0000 Received: from xn--njmtys-xxab.info ([178.62.196.236]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fwv9d-00073l-P5 for linux-mediatek@lists.infradead.org; Mon, 03 Sep 2018 20:08:59 +0000 Received: by xn--njmtys-xxab.info (Postfix, from userid 1000) id 0330143FEA; Mon, 3 Sep 2018 23:08:17 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=njomotys.info; s=mail; t=1536005297; bh=bIfJFHQHjmz6eUiHHha1+JMzQ+jymGfddd+oY2rgu1A=; h=Date:From:To:Cc:Subject; b=jAzoF5x17GCMvoXK01vUyFVcf5i+nJZGCaM+degSEvZYc2nFMvZGzuNCgenQX5TkX tNd2gmC0UKOIvwVZBkMxj1WHyTPExoSMuhrYdeCZyVEtBZLUaoU2D27FWL8WJOOh9m B87C+gZdKWiSMVWXuS6MhViAQXgbAWLaIUh1ioQs= Date: Mon, 3 Sep 2018 23:08:16 +0300 From: Jasper Mattsson To: linux-mediatek@lists.infradead.org Subject: [PATCH 2/3] soc: mediatek: Allow gaps in SCP PDs Message-ID: <20180903200816.GA6752@xn--njmtys-xxab.info> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180903_130857_967721_20DC9FB6 X-CRM114-Status: UNSURE ( 7.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The power domains array for MT6797 contains gaps, since most MFG-related power domains are missing. This causes a lookup for a regulator with a NULL name fail, and this will cause the probe of SCPSYS to fail. This patch skips gaps in the array by detecting if the power domain name is NULL. This could all be easily solved by reordering the #defines in dt-bindings, but that could break existing DTBs. Signed-off-by: Jasper Mattsson --- drivers/soc/mediatek/mtk-scpsys.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index 4808d71c5..c60a17e56 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -402,6 +402,9 @@ static struct scp *init_scp(struct platform_device *pdev, struct scp_domain *scpd = &scp->domains[i]; const struct scp_domain_data *data = &scp_domain_data[i]; + if (!data->name) + continue; + scpd->supply = devm_regulator_get_optional(&pdev->dev, data->name); if (IS_ERR(scpd->supply)) { if (PTR_ERR(scpd->supply) == -ENODEV) @@ -420,6 +423,9 @@ static struct scp *init_scp(struct platform_device *pdev, struct generic_pm_domain *genpd = &scpd->genpd; const struct scp_domain_data *data = &scp_domain_data[i]; + if (!data->name) + continue; + pd_data->domains[i] = genpd; scpd->scp = scp; @@ -457,6 +463,9 @@ static void mtk_register_power_domains(struct platform_device *pdev, struct scp_domain *scpd = &scp->domains[i]; struct generic_pm_domain *genpd = &scpd->genpd; + if (!genpd->name) + continue; + /* * Initially turn on all domains to make the domains usable * with !CONFIG_PM and to get the hardware in sync with the