Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp752295imu; Wed, 9 Jan 2019 05:54:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qBeEd7cErRXuVI3N+4rXmHSt+dokA3Etn2NjRiL7aTBacXMQPwQuwlrHNujCkqE6shC3+ X-Received: by 2002:a17:902:654a:: with SMTP id d10mr6008268pln.324.1547042040644; Wed, 09 Jan 2019 05:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547042040; cv=none; d=google.com; s=arc-20160816; b=YI2tFDvhZs/c9lPJ0HjpCwpxcnGm2vbAxuTS1O10J/ba74vs8hIc/pbkW1XiMIfkmt DN538Do0+T18OgZx4QWmtZ8XPzXTP5gB4/ukDJh5zWgIThFfwFbdaMqyxCNXbW6TMRT5 F7jQ3pkZTsk1OvNfbyY7cJQvSOp8EN1qv8ERez/GZrb40gE3WzvDmm+/AywgewZtnlu/ W+OEt1L+ZY/BdoGGRqxej0XS7l6J1v8yxtKiWhzeR+djTJVvnH+13fnLQIqktCLH2/Nl ruXwCjY6Zx8OqnuiYZmlomR2iy++YpQWFQC+08goA67E75hkpG9+gHjjWF7k0VNVE6r4 QARQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bWH3UIgut27HjduH2ZkM/kvB333ab9Ni/mMxMp3vGb0=; b=EOkUF+Vz3XNjKEzsGxdQbt0E12N6ms5sLz89OSP0VHD/VQ3Qmd3C3iaSRoyhnAS+hl r2F3yeFyh0pktC3QfZ3vtkICh1h80t1SJDaBJ/u9rrfWRtd8yCTpHsYsqaSaBWFlau14 eY5Q53zfUlaWVU9QW6VwIHFZgKV4k8LFddnXRy1Txv9fBgYMox3KomkwHP55rz6i4TC+ LYjpz4mFxMdEUIf6x97Y1EAcy+2k+/o4oHyL0JpeqUjSvJSif+2a6HL2+5HbhvV8z4RG V/JX4Qw24s0Fddp90SJjt4DUSpJEdTT0uV/BZfiR9I6yTYwN35XFplM3kU/vmF8P1SIu PEeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si18404844pgi.531.2019.01.09.05.53.45; Wed, 09 Jan 2019 05:54:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731021AbfAINLo convert rfc822-to-8bit (ORCPT + 99 others); Wed, 9 Jan 2019 08:11:44 -0500 Received: from gloria.sntech.de ([185.11.138.130]:45912 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbfAINLo (ORCPT ); Wed, 9 Jan 2019 08:11:44 -0500 Received: from ip5f5a6320.dynamic.kabel-deutschland.de ([95.90.99.32] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ghDe0-0005T9-3q; Wed, 09 Jan 2019 14:11:40 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Stefan Mavrodiev Cc: Stefan Mavrodiev , linux-rockchip@lists.infradead.org, Lee Jones , open list Subject: Re: [PATCH 1/1] mfd: rk808: Prepare rk805 for poweroff Date: Wed, 09 Jan 2019 14:11:39 +0100 Message-ID: <3397477.pQfoUNday9@diego> In-Reply-To: <489e70a8-dbe7-e248-972e-c7de4e0f2c1a@gmail.com> References: <1538465910-27233-1-git-send-email-stefan@olimex.com> <1917869.4NZ4yPfKWV@diego> <489e70a8-dbe7-e248-972e-c7de4e0f2c1a@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 9. Januar 2019, 14:10:34 CET schrieb Stefan Mavrodiev: > On 1/9/19 3:07 PM, Heiko St?bner wrote: > > Hi Stefan, Lee, > > > > Am Dienstag, 2. Oktober 2018, 09:38:29 CET schrieb Stefan Mavrodiev: > >> RK805 has SLEEP signal, which can put the device into SLEEP or OFF > >> mode. The default is SLEEP mode. > >> > >> However, when the kernel performs power-off (actually the ATF) the > >> device will not go fully off and this will result in higher power > >> consumption and inability to wake the device with RTC alarm. > >> > >> The solution is to enable pm_power_off_prepare function, which will > >> configure SLEEP pin for OFF function. > >> > >> Signed-off-by: Stefan Mavrodiev > > > > just found this while cleaning my inbox and this change looks > > significant and it seems hasn't been applied yet. > > > > I guess this is still relevant, right? > > Yes, but I guess it's out-of-sync with the latest kernel. you could rebase and resend it :-) > >> --- > >> > >> drivers/mfd/rk808.c | 24 ++++++++++++++++++++++++ > >> 1 file changed, 24 insertions(+) > >> > >> diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c > >> index 216fbf6..50f3f78 100644 > >> --- a/drivers/mfd/rk808.c > >> +++ b/drivers/mfd/rk808.c > >> @@ -387,6 +387,25 @@ static void rk805_device_shutdown(void) > >> > >> dev_err(&rk808_i2c_client->dev, "power off error!\n"); > >> > >> } > >> > >> +static void rk805_device_shutdown_prepare(void) > >> +{ > >> + int ret; > >> + struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client); > >> + > >> + if (!rk808) { > >> + dev_warn(&rk808_i2c_client->dev, > >> + "have no rk805, so do nothing here\n"); > >> + > >> + return; > >> + } > >> + > >> + ret = regmap_update_bits(rk808->regmap, > >> + RK805_GPIO_IO_POL_REG, > >> + SLP_SD_MSK, SHUTDOWN_FUN); > >> + if (ret) > >> + dev_err(&rk808_i2c_client->dev, "power off error!\n"); > >> +} > >> + > >> > >> static void rk808_device_shutdown(void) > >> { > >> > >> int ret; > >> > >> @@ -549,6 +568,10 @@ static int rk808_probe(struct i2c_client *client, > >> > >> if (pm_off && !pm_power_off) { > >> > >> rk808_i2c_client = client; > >> pm_power_off = pm_pwroff_fn; > >> > >> + } else if (pm_off && !pm_power_off_prepare && > >> + rk808->variant == RK805_ID) { > >> + rk808_i2c_client = client; > >> + pm_power_off_prepare = rk805_device_shutdown_prepare; > >> > >> } > >> > >> return 0; > >> > >> @@ -564,6 +587,7 @@ static int rk808_remove(struct i2c_client *client) > >> > >> regmap_del_irq_chip(client->irq, rk808->irq_data); > >> pm_power_off = NULL; > >> > >> + pm_power_off_prepare = NULL; > >> > >> return 0; > >> > >> }