From patchwork Fri Apr 9 11:40:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 12193935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63107C433B4 for ; Fri, 9 Apr 2021 11:48:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DD7E610CC for ; Fri, 9 Apr 2021 11:48:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DD7E610CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lARtTYyVcgqlBx960A4th8DMDq982sQdb+cTJ+ZTi1c=; b=ie5V0xql/SNfLVT+DVKkcckfN oVDHqMhaRCRNhf+h9tGtatXJCqlUh4wsJU9nDEOfMctErkCaACEFPkSoJuNI60Mtm7y6wKWdAn1gd 4z1YdOWfu08fFf38WJRz3APl8frOA7cMNqmdrzU0GLAQauesfaFC0bfGX7IuPJiLnTEJ0p+U8lBzY LI1X5/priX4yKRKnc7M7cMHCLvJq4YWNDog2utrREtz/11al6uFq/fHOyY0McQCuqGR8LUfKS3NWv fb0uCTTcbyYVyXdTH+mVR1vDoysAqTka+YWOnnDx4sijsiqTKvKKbbReOn7xq1TmRqmhtXbB8lpEX YPxPOmJiQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbc-000fAV-UW; Fri, 09 Apr 2021 11:47:21 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbI-000f96-P0 for linux-arm-kernel@desiato.infradead.org; Fri, 09 Apr 2021 11:47:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:Content-ID:Content-Description; bh=kljFFSs/cikhexI4Be1IuwX0hnehyre4M1T17anYWUM=; b=PTwFvGH9a1SqfQli5UgJAAyxhf dLoxFa7JG9qt9hm1dNIjv/6IQq/PpMBixuTjidun12xcXRhzl8JSW4+JofITDtQyUuRs4o2R84Sx6 WA8je87nZcE2PKD9c5hPGybcmWtrHWMDFCbS4A6F59Q2YC5QkcWwjIPM+AL0oZBYrn13iX03hWGaQ UjOdo19djotXOedeqj6gVx0sL0eDYcU6wZUd81p4r9ZcAjtlgaTsBobj5bCPJFf4xGdy57ikCB28U J+/eIi2qMbDZcnKXhrA3J31oZsEIip2QkB0GGDKGEveJ7azo6iJFiDSmB7R7gwOz7BfF32aWZwd4m T3GKteWQ==; Received: from honk.sigxcpu.org ([24.134.29.49]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUpbE-004ToP-RQ for linux-arm-kernel@lists.infradead.org; Fri, 09 Apr 2021 11:46:59 +0000 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 427E4FB02; Fri, 9 Apr 2021 13:40:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HZbjt4djQ3cO; Fri, 9 Apr 2021 13:40:23 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id A8AB840627; Fri, 9 Apr 2021 13:40:21 +0200 (CEST) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Kishon Vijay Abraham I , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Robert Chiras , Sam Ravnborg , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Liu Ying Subject: [PATCH v5 2/2] phy: fsl-imx8-mipi-dphy: Hook into runtime pm Date: Fri, 9 Apr 2021 13:40:21 +0200 Message-Id: X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_044657_074904_0583771B X-CRM114-Status: GOOD ( 16.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This allows us to shut down the mipi power domain on the imx8. The alternative would be to drop the dphy from the mipi power domain in the SOCs device tree and only have the DSI host controller visible there but since the PD is mostly about the PHY that would defeat it's purpose. This allows to shut off the power domain when blanking the LCD panel: pm_genpd_summary before: domain status slaves /device runtime status ---------------------------------------------------------------------- mipi on /devices/platform/soc@0/soc@0:bus@30800000/30a00300.dphy unsupported /devices/platform/soc@0/soc@0:bus@30800000/30a00000.mipi_dsi suspended after: mipi off-0 /devices/platform/soc@0/soc@0:bus@30800000/30a00300.dphy suspended /devices/platform/soc@0/soc@0:bus@30800000/30a00000.mipi_dsi suspended Signed-off-by: Guido Günther Reviewed-by: Liu Ying --- drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c index a95572b397ca..f89a0c458499 100644 --- a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c +++ b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* DPHY registers */ @@ -469,20 +470,32 @@ static int mixel_dphy_probe(struct platform_device *pdev) dev_set_drvdata(dev, priv); + pm_runtime_enable(dev); + phy = devm_phy_create(dev, np, &mixel_dphy_phy_ops); if (IS_ERR(phy)) { + pm_runtime_disable(&pdev->dev); dev_err(dev, "Failed to create phy %ld\n", PTR_ERR(phy)); return PTR_ERR(phy); } phy_set_drvdata(phy, priv); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(phy_provider)) + pm_runtime_disable(&pdev->dev); return PTR_ERR_OR_ZERO(phy_provider); } +static int mixel_dphy_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + return 0; +} + static struct platform_driver mixel_dphy_driver = { .probe = mixel_dphy_probe, + .remove = mixel_dphy_remove, .driver = { .name = "mixel-mipi-dphy", .of_match_table = mixel_dphy_of_match,