Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1781494pxb; Mon, 22 Feb 2021 10:40:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy19lkLftJP51F/h5km/OSsWO2dLXIDxrwHcu7ct5e+MpFjJ7FJ+G8JXFudx/H334o0GnA1 X-Received: by 2002:a05:6402:499:: with SMTP id k25mr23964721edv.294.1614019227181; Mon, 22 Feb 2021 10:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614019227; cv=none; d=google.com; s=arc-20160816; b=YrCPPUfE9WzSdAbrckWC0yO/rs/bKrIlv7rFp+N/g40hpxhkmanCkbh/NLMOHtMtTZ s9kVUgrP6/XX9Q/zQvGSy55LZzH6kXdops4unvF1mmlYrO4wtwedWePL6N7w8NaNSFMO CwxlT4voUys3yq+NcXtadxCw9jUpqjATRVw2QtKtmbMdr9MzHWG5s/iJ0IVpW8pOwDxf ossn/zKCxdjJxD4QNTkVP3C/w5ILmLBGq8ao9l8CoxOdCf92B+oppnYU7oGKQnspVELQ VZXJdkW0K/ooL2zJri9uSWlzfiL4fe7puaZXlVU8em/O5+LuZRXnNGXvT4ju2CQZFuJ5 0SzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=j6yRI9y+6KOnhkLd7UVcZYD7pytyvYc0rhjGDUzBNpk=; b=Re3jKTZV48aA7pDYfCSalg+/sSstOiBAqwKWEpfKABzAyksQpFQeq/DHyt13/hJjys F9BWwT6Ha5LgeNdYHLD/AXdbJAqYGE0WigKEs4SqRgSDN6wPmCWYeP8QaERUNlcN7IFp miy/iv98Cdfpq9kjpl7Jwi0J7Zao6pRK28GtcUOqY4HhW2js9/f75Spe9upXk8t0/KPr 97E681Wxh5tQwH0HaV5X6NfF+eayXmad5OyPWF6EsiVmOYjVcuS0EzERzUMfNrufqeUc 8MEEvyn11MAwTd72/BvUFY9IoiwR3NVh4Ln/6kjQUbdCQ6CKTUznxfm74Xm+jCaHN3qE 6r1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si12458391edv.67.2021.02.22.10.40.00; Mon, 22 Feb 2021 10:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbhBVSjR (ORCPT + 99 others); Mon, 22 Feb 2021 13:39:17 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:55036 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbhBVSi6 (ORCPT ); Mon, 22 Feb 2021 13:38:58 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 791CFFB02; Mon, 22 Feb 2021 19:38:15 +0100 (CET) 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 RDN2vddEVoRq; Mon, 22 Feb 2021 19:38:12 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id BB22940258; Mon, 22 Feb 2021 19:38:11 +0100 (CET) From: =?UTF-8?q?Guido=20G=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 v4 1/1] phy: fsl-imx8-mipi-dphy: Hook into runtime pm Date: Mon, 22 Feb 2021 19:38:11 +0100 Message-Id: X-Mailer: git-send-email 2.30.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 hen 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 --- drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 10 ++++++++++ 1 file changed, 10 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..5de175695834 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,6 +470,8 @@ 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)) { dev_err(dev, "Failed to create phy %ld\n", PTR_ERR(phy)); @@ -481,8 +484,15 @@ static int mixel_dphy_probe(struct platform_device *pdev) 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, -- 2.30.0