From patchwork Mon Dec 9 11:57:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soeren Moch X-Patchwork-Id: 11279249 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A0E1139A for ; Mon, 9 Dec 2019 11:58:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 57F032077B for ; Mon, 9 Dec 2019 11:58:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fM+On1RS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=web.de header.i=@web.de header.b="AbJPXu35" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57F032077B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org 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:Date:Subject:To :From: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=qdvR1nYUcQDVJJCaWsvLxxgJMCOjAOb3W69F17JTbQ4=; b=fM+On1RS631XJh 9hRGwAc9wttEDP7Vat6jmev1xlPgqizmSGOSHg91s85Bf2KEkU0/za36I99H9nnwtWVilcgMMyckC ibzZexYuV1wmiBY/pq5O1lH/wz9AeYH5y9CoMgEbptaQhCQ6HqCupLXq7KR9TVqct9d8eT3txCHTQ /b6udEnapOgmZlfKe8Y/lqhUvdOFTTiWjYl5QtwMsVJst/0PteRIytkK7P/Bn7zNB3Eo8ZaynpQn0 3RFOzVUkK2sXha/DhFVaNJm/mzDDEcIZPFdmnegXmTTW4wAKSDLiYMfu2Yat/uCoLasxDPaFMWV7K IXdKCVpDNO4PjLkSAqVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ieHg9-0003NT-8E; Mon, 09 Dec 2019 11:58:17 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ieHg6-0003Ma-La; Mon, 09 Dec 2019 11:58:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1575892687; bh=62z6uy/6WR5j1vgtqdICXgaRlMrLkDw2kYFQchsQQX4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=AbJPXu35r/mj1Kl1py0u+c+fdjS9F0ZheA9EJhQwyiJH2LgDHZ4f/HcwViTbZC9Qc +sF64Ghtu3UmR0ytixvENnBoJ4pBauTStZpwaY8jxPa6f1iiGD7ziKDZiLLelovYV9 BrYC9rvv7ESVrtdNUvX+xvcVdImlFEb9+hSg0Vu8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from localhost.localdomain ([89.204.137.214]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LZvrx-1htN0k2PHx-00ll33; Mon, 09 Dec 2019 12:58:07 +0100 From: Soeren Moch To: Lee Jones Subject: [PATCH] mfd: rk808: Always use poweroff when requested Date: Mon, 9 Dec 2019 12:57:46 +0100 Message-Id: <20191209115746.12953-1-smoch@web.de> X-Mailer: git-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RDJ8DHtKpg7WuW0CE/p+r2OzU+nww2QOuuJxduh46bdAfMa0C1Pb4Im6hGVPSh jIwuyc485gfStufjf6mnTkwErktu/j+uMCIwA9Rleb3mmVDrSbrK0Om+qs/33Q/B0vYuo0Cvj QIJOjnsNFai7KiKOZmT+LYpSlRJvBPQ39zKqeuBUxDceDNPXqHsXsVk4inTXJhH/8py8Ec+mY fiBZF08raV+TTnYOXL4XIuIar5dCn0HUb2JJCEvlz270DMbbTABebwCTsPyJPZmMtvQAenNCj IXbfdyhGMMX7QxoSz9FZk5cUopg5yVG9BVWONEjJYEf7u8LtfF7+HNVgucTDn7DXzL2Y4ETBe j3v89GKLUFmaDGtEjbxSG4uvwg7+sCj892qqWgFPDkApSsGBjOzvBFEWbbTHkwuBA5BbFXNAJ mLlijWCMKRAm9URSoGpJzYGaiBUcl4p0Ci/5Me9VeXjE8QRjQHvFrlTtKua3HYJB9oHcRUn+4 PIoyvU3E5HLp30W9H1e+leJtCqxXdnF8SEvBuyg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191209_035815_035183_F26A59BC X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [212.227.15.3 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (smoch[at]web.de) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Soeren Moch , Heiko Stuebner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org With the device tree property "rockchip,system-power-controller" we explicitly request to use this PMIC to power off the system. So always register our poweroff function, even if some other handler (probably PSCI poweroff) was registered before. Signed-off-by: Soeren Moch Reviewed-by: Heiko Stuebner Acked-by: Robin Murphy --- Cc: Lee Jones Cc: Heiko Stuebner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/mfd/rk808.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index a69a6742ecdc..616e44e7ef98 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -550,7 +550,7 @@ static int rk808_probe(struct i2c_client *client, const struct mfd_cell *cells; int nr_pre_init_regs; int nr_cells; - int pm_off = 0, msb, lsb; + int msb, lsb; unsigned char pmic_id_msb, pmic_id_lsb; int ret; int i; @@ -674,16 +674,9 @@ static int rk808_probe(struct i2c_client *client, goto err_irq; } - pm_off = of_property_read_bool(np, - "rockchip,system-power-controller"); - if (pm_off && !pm_power_off) { + if (of_property_read_bool(np, "rockchip,system-power-controller")) { rk808_i2c_client = client; pm_power_off = rk808->pm_pwroff_fn; - } - - if (pm_off && !pm_power_off_prepare) { - if (!rk808_i2c_client) - rk808_i2c_client = client; pm_power_off_prepare = rk808->pm_pwroff_prep_fn; }