Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2220977ybh; Mon, 9 Mar 2020 01:19:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsdWpof5SVIeeg7BGIXPMxRrRn4srfuUlXQr4hqdvqmikFfHJfk4aunPhLGyOGxIAXya+qV X-Received: by 2002:a05:6830:1b6e:: with SMTP id d14mr12067372ote.117.1583741982901; Mon, 09 Mar 2020 01:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583741982; cv=none; d=google.com; s=arc-20160816; b=AK/Mm8pu5jpJiz/HnwGg9zPsXDokZJh3rd6PAKptikaqWAEKhaNQtQu9aR8GGfV8jP ZwdKDmZuizEnSdF5CQZwdP7C3Iii//QJ9eXAQpuECtQgahJ+nMIsgeE/r2OQXrcQ851D J4CoF6N+hNgYICVcR3kcULlgDr5zrO3cIaE5NUwQPiDlOY0ebT46k52MzbTywM5q9F0/ VgP94sVOdOuo2PEIE8U+UgwTFDp68EkCX6qgy2/GtQTOeOo0k+VnKFY1aWm0D1N2Sijn RqidxSoRWVAVTPRA/caY9Iw5XNQbDQFORHg1DCGjfKryB30+lXHUa1/kDG0IaFAFc0IE eRAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=0dwzfZBdNlOZMuJhJ5m0U1KGetNN67/bhUzuOF6YkZk=; b=FZPQJMOw9KTpzsOJcSS5lpYojpH84mIPRK1rqKgPPFNUZYl4Hh8dC/rq39mDLjVuAp QbmSqbrrnAlsW+L+uCP4sQ+QaQjmNvGiDolTkS6bPNbrFYK5q4tJabEzt5JhKE7pCemI XRh4L9vSY5KUoZkIEq2buoaouS8j8jgoPy92ejcP/myygxP+hmqxb0REjKyO9icQd1/V YP68H5p6IpMu3rUzT5/X+NJ+gvEAV5BViiELQIw+Us9V8rI7MBEZjscv4c5nj6FNj6iF nOombrCg98LJJW3biWHwI0eXRVIMxCGzYDiefs+WmIYg8Zd8nY2LOa+E0CUZD1jMN7wJ S3kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GWFO1xvX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si6023048ota.239.2020.03.09.01.19.30; Mon, 09 Mar 2020 01:19:42 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GWFO1xvX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbgCIITJ (ORCPT + 99 others); Mon, 9 Mar 2020 04:19:09 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:55154 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgCIITJ (ORCPT ); Mon, 9 Mar 2020 04:19:09 -0400 Received: by mail-pj1-f68.google.com with SMTP id np16so4035990pjb.4; Mon, 09 Mar 2020 01:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=0dwzfZBdNlOZMuJhJ5m0U1KGetNN67/bhUzuOF6YkZk=; b=GWFO1xvXViZGSxx6IuIEj+83xa59xbFeYUTUPtEHlRzAfU1UOsdwdT36XBZpifD1Ek uRA7Pu4Q7O7JQk8rg0Gfv2dtrJJfI9QGZHBVa23IeE24HZbestU81oNR8PDB32/XUpxV AHp+8QlixL3ZNiiVGTDngidzn3OupWGCCm2KxTlTJMB3MA8Hhc7W1McqxaRaBJCCPQhb 2C8e1tHhcQ1IWZi7MeCdhCvDpoWuposU7gDauj9lf7F3QvJTuo8TaGAqPgF+Aeflv69m O5QHU0TfnyN7GOM4v8Q2bLz7SU2Ib6IsQoM+mkGTodq93blD9E6s7CbZWPpAO5Ngiqgb Q2hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=0dwzfZBdNlOZMuJhJ5m0U1KGetNN67/bhUzuOF6YkZk=; b=S79e7G35jCZdxoV4vjMVm7kUdp1w7DdB4Fa01wj9VxvkT0kk+puop6jEbt4muX5+P3 lGeKJg1DBv+mL7szpyAveFUfj2HY8uZgMC2S5+fBR28B0xfgQXa8oSU3N7pAVDKnNWoz PWTjXN8rIusZJNy/hn7kyXFSWb5ps/JaTpZXUD1wJEm5jOThzKhtaASDSgwQADcR2Xj0 8l1Hd6412o4uNuglbfjjS2iVabwr0qOWT9P+1BilTcnK6KT4FeVz3lvfLfL1JFwl8cLP lbD2c72qkIPxRPWEOF5NslnuwHi3V8l6JP8lBxNYEbUD19LhHqJ2nGP2lFVVhI7fy8TU 49hA== X-Gm-Message-State: ANhLgQ0q2AwMYSZUed2aHuPU2LVpFDZ0GjAPUiZFDEUCvtXbj8eQanKV 1ozMz1ruc1zyKddkNQu87uQ= X-Received: by 2002:a17:90a:a786:: with SMTP id f6mr1883293pjq.169.1583741947919; Mon, 09 Mar 2020 01:19:07 -0700 (PDT) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 193sm21862277pfu.181.2020.03.09.01.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Mar 2020 01:19:07 -0700 (PDT) From: Baolin Wang To: sre@kernel.org Cc: baolin.wang7@gmail.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, kernel-team@android.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] power: reset: sc27xx: Power off the external subsystems' connection Date: Mon, 9 Mar 2020 16:18:44 +0800 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sherry Zong When powering off the whole system, we should power off some external subsystems' connection firstly, otherwise some external subsystems will hold some power and result in powering down abnormally. Signed-off-by: Sherry Zong Signed-off-by: Baolin Wang --- drivers/power/reset/sc27xx-poweroff.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/power/reset/sc27xx-poweroff.c b/drivers/power/reset/sc27xx-poweroff.c index 29fb08b..2bedd4c 100644 --- a/drivers/power/reset/sc27xx-poweroff.c +++ b/drivers/power/reset/sc27xx-poweroff.c @@ -13,6 +13,8 @@ #define SC27XX_PWR_PD_HW 0xc2c #define SC27XX_PWR_OFF_EN BIT(0) +#define SC27XX_SLP_CTRL 0xdf0 +#define SC27XX_LDO_XTL_EN BIT(3) static struct regmap *regmap; @@ -40,6 +42,9 @@ static void sc27xx_poweroff_shutdown(void) static void sc27xx_poweroff_do_poweroff(void) { + /* Disable the external subsys connection's power firstly */ + regmap_write(regmap, SC27XX_SLP_CTRL, SC27XX_LDO_XTL_EN); + regmap_write(regmap, SC27XX_PWR_PD_HW, SC27XX_PWR_OFF_EN); } -- 1.9.1