From patchwork Sun Jan 12 01:55:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 11329041 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 67586930 for ; Sun, 12 Jan 2020 01:55:27 +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 4099220880 for ; Sun, 12 Jan 2020 01:55:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="py1bqSfZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4099220880 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=oE7ar3fftuNCui27wVdhhiqEWk4bdnnfHKGg6a5bPTw=; b=py1bqSfZPG3zaxndvE64YSp66Y pYorr+nPxG+V1X4FyEUaeNKwz5D0cuYkKpS/QCzRVmT7wm/hVnp5TiWAMFqvCRECdoQuiSaIW4Vzg teMOcY0efHWuqYJpEcdkyVg5IyUR1GYnnB8bL63T2Ct80WJ2IyJVA04cLZYHqKu3NHgdajkpHDKhw uFlwHKrj439Wz3Sa4D684t7S+Cdh8OokmaQ7w+DPdKs5cjPSvIYZbPCf44zRmFkgzuKwJcAazDcdx iLVyTJW/uzXLHyJETyhS/QUGk/ZdWqnyJo5ktZuhwQSDXeKOUzaKNnh5yV1Skye0BKZLW3tO9Dv+Q koRnDWEw==; 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 1iqSTL-00044X-6R; Sun, 12 Jan 2020 01:55:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqSTH-00042A-Q9 for linux-rockchip@lists.infradead.org; Sun, 12 Jan 2020 01:55:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 98235328; Sat, 11 Jan 2020 17:55:18 -0800 (PST) Received: from DESKTOP-VLO843J.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B605A3F6C4; Sat, 11 Jan 2020 17:55:17 -0800 (PST) From: Robin Murphy To: lee.jones@linaro.org Subject: [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested Date: Sun, 12 Jan 2020 01:55:00 +0000 Message-Id: <233bf172a5310658d703b11be6e637d6c4d46338.1578789410.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200111_175519_893456_0B9436C8 X-CRM114-Status: GOOD ( 15.33 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [217.140.110.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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, smoch@web.de, linux-kernel@vger.kernel.org, heiko@sntech.de MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org From: Soeren Moch 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. This does tend to reveal a warning on shutdown due to the Rockchip I2C driver not implementing an atomic transfer method, however since the write to DEV_OFF takes effect immediately the I2C completion interrupt is moot anyway, and as the very last thing written to the console it is only visible to users going out of their way to capture serial output. Signed-off-by: Soeren Moch Reviewed-by: Heiko Stuebner [ rm: note potential warning in commit message ] Signed-off-by: Robin Murphy --- drivers/mfd/rk808.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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; }