From patchwork Wed Jul 14 09:58:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 476448 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp405004jao; Wed, 14 Jul 2021 02:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDtiMr9FuNgjOsY1eheGUOns1WPQGhQ/kYITQOF49wsupMFjIWiCJiW4h5Xsf8r0/gbN+C X-Received: by 2002:a05:6e02:1354:: with SMTP id k20mr100898ilr.169.1626256749529; Wed, 14 Jul 2021 02:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626256749; cv=none; d=google.com; s=arc-20160816; b=m8Y2emLhOYnMmLjHXiDWlu2WflILhCcZGMpfPPLXS5Wc0Tm9zDmA8uSgiR0pzKyksA zBOjQjVTfaBftqowReYvapEZ4BKPdWK1rRZubZjbcQWJaGH3G9MPlBU6g1hsdxQ/Kngz TeygFBoPvXqma39vVfn7Aj4VRqWFbn2mGIBXmJMOTvdY5Ya5s3MCBAdnVRTW1w3ppbwq bEg6NmQSHlpXH/kjly+/q8VGLomgFYKkYTwStGi0CsyFFAkT96vVfBfP4WdJ4L3Q1dvA KALaabBKf3q2ARwcrjnMOp7EL0V8lOZwdnvsLO2NeAOAGI9H/6fAIuQxx0jY65quEH7+ M7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ToADbup+MfTcTpglli3NLkX2Wd5wYfKIe/K2kf6rNBQ=; b=Urtp0FVSCrSZL1DJY4jeTiXnz3g+q1RxRfkzMk3P1NpgEv26V5IN+emjmG5coPZYu0 xHPrIdwduEYSrywonqtsHVJjbrTi4Y+0jgHvGONxlU+5HD6XfdW4OnBtf5D6tqmJqQRK t3zGmzKY7YOw1iWVozWVgvA6XmwwRXmB9hqpJFVTn2tULvbofWNQjwBvyg0Nyqi5h/Al kiIvbk6292NHVnivgXW3d29c4Jk2eJGKJWay/T6Bxw4AaHY4aOn43e0VgkdCgy+MZVMK NBQLSSTnZQw/T/3mvdi26EpJM8bOfIq+vR0y5DrLyhH35ByBsolSCzo6d3l6gH/J3hK+ 77zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bm0nGwXC; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si1711344ilq.87.2021.07.14.02.59.09; Wed, 14 Jul 2021 02:59:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bm0nGwXC; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239023AbhGNKB7 (ORCPT + 1 other); Wed, 14 Jul 2021 06:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238963AbhGNKB7 (ORCPT ); Wed, 14 Jul 2021 06:01:59 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDAC2C06175F for ; Wed, 14 Jul 2021 02:59:07 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso1380986pjp.2 for ; Wed, 14 Jul 2021 02:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ToADbup+MfTcTpglli3NLkX2Wd5wYfKIe/K2kf6rNBQ=; b=Bm0nGwXC1+3vIZuFsqmqFFkDVyv4H+yw/oCyHEFUNrjUwzDfFhEinIq6VEJHhumP8q 8YBEt3k77xz7rNVpBszjuY1GRRmlGGrhe3exOvxWRAPLCPqSTRFvjYqRAibBQ+3eGaCC ZlULeS6pAbg0adnyqaTjgGlKt2hfzwPDTM4EozrdgDTcPF1yUFQqiR7TdvsOTsAaUKjm lk9Lvfzpimn4v2LVUPsayU8Gbjhh8dWeFNYleEKdZ2lIrJAQCaYsVXzwObZjmJN6ZzoY QMVbl5Hj4/n8344XpSP65M8nMT5OmUBLSyPvNUFCjK/ayPZCFX40Vrv3T1KwMxf/qAoY RFhA== 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; bh=ToADbup+MfTcTpglli3NLkX2Wd5wYfKIe/K2kf6rNBQ=; b=L2XlvgUuPdh5P9g4c5RC2EPy4O5IsnnIJkhjGPLEF1CoflSmgk3nEQK0042GdZfmKu OHylGeGRxCwkU1zcJVsstkoe06cqGpiprr7VNYkOHH0yGRVVvxwsynjp1VPWAeKrEI3h 5Ck87KLDEohWXiKkyTqemWXAOEAd/YPgYQLS1YRoAR8q0QgbccaIXWSACDlhaFP52tkh 6vlHABeDbrIH6bOot1qiwcbR7EO3/RWCwI6K+kWdRN+Uy0b5LdQcXc3HkumTGlsRN6uK DryetywU3UF5S6dtrPYb9Ia8EsmCnptas4fIJtGlCp51u6EKywEQGN8Vmf0A+meSVi+0 bLaQ== X-Gm-Message-State: AOAM531WY4xyRWag6FCiQwk3vPrdGVDVF2/aer0ukJuNUEcnxHIIMM7+ 0oIc4Bw4Fc57fmejLQI8XNLW+UmtfDFDUg== X-Received: by 2002:a17:902:7042:b029:12b:2b94:30 with SMTP id h2-20020a1709027042b029012b2b940030mr7210927plt.9.1626256747422; Wed, 14 Jul 2021 02:59:07 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id g1sm2283304pgs.23.2021.07.14.02.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 02:59:07 -0700 (PDT) From: Shawn Guo To: Dmitry Torokhov Cc: Luca Weiss , Bjorn Andersson , Matteo Croce , Andrew Morton , Petr Mladek , "Rafael J . Wysocki" , linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH v2 1/2] reboot: Export symbol 'reboot_mode' Date: Wed, 14 Jul 2021 17:58:48 +0800 Message-Id: <20210714095850.27185-2-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714095850.27185-1-shawn.guo@linaro.org> References: <20210714095850.27185-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some drivers like Qualcomm pm8941-pwrkey need to access 'reboot_mode' for triggering reboot between cold and warm mode. Export the symbol, so that drivers built as module can still access the symbol. Signed-off-by: Shawn Guo --- kernel/reboot.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/kernel/reboot.c b/kernel/reboot.c index a6ad5eb2fa73..31bf2611ee12 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -32,6 +32,7 @@ EXPORT_SYMBOL(cad_pid); #define DEFAULT_REBOOT_MODE #endif enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE; +EXPORT_SYMBOL_GPL(reboot_mode); enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED; /* From patchwork Wed Jul 14 09:58:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 476450 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp405077jao; Wed, 14 Jul 2021 02:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTl4FC+otNtq7zpwkHi1P8ITobWXKhd/0HRISJ5Vy2Vl0ajYPXrI5W8Hwpu7ijYphrJRBj X-Received: by 2002:a92:c143:: with SMTP id b3mr3313207ilh.145.1626256755490; Wed, 14 Jul 2021 02:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626256755; cv=none; d=google.com; s=arc-20160816; b=TXurI3MDsEh9EAnKBuwUp6Hgw2NXDFJpCvvXYpHAJXsJq6Zy2SzS6sIjVieXyi+FNf HQNDuwofHcqHAG1YgdFhaVdv2J9jRRFcZ0W5d3oV6yXNW4lGTkSqD5DjuvXAEKsOqOBg 7PAwSsJylLIYx1MdpzeaaLeOuBVGnSu6uztsRRzuVt+peul0WfcPzKA9fQ9Mb3PGGLAy vTTX4+1KTyZfHHGzw3S9l3mDXJKoYTe/vic7LWDlvGeMQaQGiW/bPmzoZU9C3oWvhsv8 1C2GewMllqw++HKZJlCHpWS1N+AXqf6jWuQnYv1BrGXsKgIVyQc4Dpt0j4uz5j5kxitD eZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=l1bjuoaTVbYtnhNI71QZX5Bx6fnm6uPZuv4M80rHUjI=; b=VP0gmKyBKcX8N6rDa6gH2EgUFfWhwU5t4XUhcZeTtU9pzSXROChdnpgbirEO/da+w5 OnEQnz3lZIVewXaAlc+LqWw+v/Oo0y+h3xq2TR0CMF8jVR216utaMk66KsD7EAL8AoPh uWapGKMqaZ7BjL5LQEG6nX4RFoo+Iv0CLMQ1FCK3rdGRvJ8iw+rDPUogXqNdqj+2atag oWhQsY1awQtmVlAWdj5COnw6gEJqnVfXWBSitv+yqJn1HH+YFt949Wjmd6adU/AGaRel DnQjyJpMuoyyL7SUPfeb9kOrpYar+IalrobbjVxt9HsVIUk34G9GDhBTsVGgO3VirX8p Enzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EM4ks1xn; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si2060081jan.83.2021.07.14.02.59.15; Wed, 14 Jul 2021 02:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EM4ks1xn; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239017AbhGNKCC (ORCPT + 1 other); Wed, 14 Jul 2021 06:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239029AbhGNKCC (ORCPT ); Wed, 14 Jul 2021 06:02:02 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB1FC06175F for ; Wed, 14 Jul 2021 02:59:10 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id c15so1218326pls.13 for ; Wed, 14 Jul 2021 02:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l1bjuoaTVbYtnhNI71QZX5Bx6fnm6uPZuv4M80rHUjI=; b=EM4ks1xnAhxy/oyMPK+YmsxsS8bDIyg6oX+je8bM1orlDBciQn00YRtWkJ0vI93Prn U8/+BVyPocLBJLw91waPql/4SmUgMaS5kDcPbxb9Pqb56PehJDlipv5vKTuglcl4oYUB BY/uh9Gt3fJZDwJL3gVTrRsLNyQoTaI3jKQxgiaUy54G3AeuLrdn8Qf931iK5E1atSz7 qNHHsRAmujlZBUVJfgVhXfUv9e9xKxY79+WaKIxRqyBNFZxkPFG8pmsVUXptDTdlI1o7 swi/NTWbePwxQwz7qTU/7E1Sqpb/Awqp8F+b9t+etHf/aiZ/PTLqyCrm9y7HhlCGp++s sToQ== 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; bh=l1bjuoaTVbYtnhNI71QZX5Bx6fnm6uPZuv4M80rHUjI=; b=kYnoP81n7v+47OFfA26aGNy3ZRyq9y4dLbzXA0/WxIqkLWwafOKW52+aYA087kyi85 6erbqFAsUctT4U+RJ0DG50COVWlwKQGGpsisH+pB2zDlMMWE1O5u2j73+313dFNjwEY7 1BPYLCT2c4UCwS90pvH6qWq++znhVCE4urtau4ya6O0Bihs+5Gpz728wzXmCAtvRasl4 QlRXmd0sru1OWfcQZJkLGIt8Y87Iv77CtgZWQgZ4q3pLbEjyhCb4B8jAhtbchysY3u0P Hg94+a/49NyoQH9q+6orCajnoVkRSLCwii7Afw2Hr3npG3G4D5soJdGMcukOE2auoT7r BDVA== X-Gm-Message-State: AOAM530T6dwAdjj/t/75WPk0dRIxMs4Qa2laSXN0cXrB5gxqxWL18GHC sDpWcCGojt659oBsKRzu/XwUug== X-Received: by 2002:a17:902:d217:b029:105:e265:65c7 with SMTP id t23-20020a170902d217b0290105e26565c7mr7203320ply.16.1626256750527; Wed, 14 Jul 2021 02:59:10 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id g1sm2283304pgs.23.2021.07.14.02.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 02:59:10 -0700 (PDT) From: Shawn Guo To: Dmitry Torokhov Cc: Luca Weiss , Bjorn Andersson , Matteo Croce , Andrew Morton , Petr Mladek , "Rafael J . Wysocki" , linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH v2 2/2] Input: pm8941-pwrkey - Respect reboot_mode for warm reset Date: Wed, 14 Jul 2021 17:58:49 +0800 Message-Id: <20210714095850.27185-3-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714095850.27185-1-shawn.guo@linaro.org> References: <20210714095850.27185-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On some devices, e.g. Sony Xperia M4 Aqua, warm reset is used to reboot device into bootloader and recovery mode. Instead of always doing hard reset, add a check on reboot_mode for possible warm reset. Signed-off-by: Shawn Guo --- drivers/input/misc/pm8941-pwrkey.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 Tested-by: Luca Weiss diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index cf8104454e74..9b14d6eb1918 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -27,6 +27,7 @@ #define PON_PS_HOLD_RST_CTL2 0x5b #define PON_PS_HOLD_ENABLE BIT(7) #define PON_PS_HOLD_TYPE_MASK 0x0f +#define PON_PS_HOLD_TYPE_WARM_RESET 1 #define PON_PS_HOLD_TYPE_SHUTDOWN 4 #define PON_PS_HOLD_TYPE_HARD_RESET 7 @@ -93,7 +94,10 @@ static int pm8941_reboot_notify(struct notifier_block *nb, break; case SYS_RESTART: default: - reset_type = PON_PS_HOLD_TYPE_HARD_RESET; + if (reboot_mode == REBOOT_WARM) + reset_type = PON_PS_HOLD_TYPE_WARM_RESET; + else + reset_type = PON_PS_HOLD_TYPE_HARD_RESET; break; }