From patchwork Wed May 31 01:42:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 687536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDBA2C7EE37 for ; Wed, 31 May 2023 01:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233557AbjEaBm4 (ORCPT ); Tue, 30 May 2023 21:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233617AbjEaBmz (ORCPT ); Tue, 30 May 2023 21:42:55 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B21811F for ; Tue, 30 May 2023 18:42:53 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4f4db9987f8so521148e87.1 for ; Tue, 30 May 2023 18:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685497372; x=1688089372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XVVVClRGQ3W+a4D62JgYgRZeO7k7GdsG/nIGFO07NhE=; b=vOiOxUgpdUx4sO3r01yIUuAfFsasVWnW6N6FiQslNJpkAzZn2R1A6lD9HRtqR+JBLW 3zYHVJIhSHROmwc9tI9JVKkcDRHyyaJgkqhKZ0VZiekQvjsxcrX8ghiK7Nmxhqie8HOz jnTAuTGW9XnuxWmy+Jni8p2YPAvYK7wKrIXJTzrAh/jgmV6/Qmz0nqGrVbIn19PPzYpn NoQcPZ5juDx53GiFfwD9VFG43SORhakvVb1aNClcH9T+ZJeFnl87Iux0dTPY8w5NaocD ZuiXO1FcM9IPu8CANRoP/f/Cs2s9IJyZtqmXXvC3dWFpPRxzck6fwE61o79dIsz8x2qp p05g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685497372; x=1688089372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVVVClRGQ3W+a4D62JgYgRZeO7k7GdsG/nIGFO07NhE=; b=K2KkwZtXAt+CtNlqB9yUAOcfrWxl3yi2UwQtTvvlPiBkrvLEM6PBkpW3HLCt7xuSB9 gGZB2ZXKktKsqcS+WpZcVO1O0gCA+71YuyAQNWIWOLcH0mliybFc2TtSuRbaaBXCsn9e noMl8Oky3cwajRIGveKSD0L08qGf14cxGqaNWB8K3tVD+eBMR7lVmfFChOV9g+K5KB8R /ciif/MmPmX7AbUtsOXBpIUmZOPnKxgOfNrRxpbchrQIFOdrVeLsJ0FLaSaGY3XDSNmB R9fCTZ2UdUu9Ok05n4rkAX9kRByJoMVOBZvh9Ho7WweONtU+RagYOGrV7Ge8KzBLFHeb 8dbg== X-Gm-Message-State: AC+VfDy0gdTHcROPP7zsh/cpGGr6Lzk/47l0+Ge6JVzdi+4/cz8/Gnc+ O3GVJAxC/JbYrLtPP/ZKePaHEA== X-Google-Smtp-Source: ACHHUZ5xKHZHlSFAIUgV9MRQhU+bzS3GEljBXd1Ge5xA/wxIe7ClbRxK19Qjn5/oMZx7aDGwjkLbyg== X-Received: by 2002:ac2:5296:0:b0:4ed:d5ce:7dea with SMTP id q22-20020ac25296000000b004edd5ce7deamr1294562lfm.27.1685497371885; Tue, 30 May 2023 18:42:51 -0700 (PDT) Received: from lothlorien.lan (dzdqv0yyyyyyyyyyybm5y-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::ab2]) by smtp.gmail.com with ESMTPSA id q20-20020ac25294000000b004f3945751b2sm515994lfm.43.2023.05.30.18.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 18:42:51 -0700 (PDT) From: Dmitry Baryshkov To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v3 2/4] power: reset: qcom-pon: add support for pm8941-pon Date: Wed, 31 May 2023 04:42:46 +0300 Message-Id: <20230531014248.3824043-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531014248.3824043-1-dmitry.baryshkov@linaro.org> References: <20230531014248.3824043-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org For PM8941 we don't have a defined field to store the reset reason. Support wrapping pwrkey and resin, but without writing the reset reason. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/power/reset/qcom-pon.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c index ebdcfb28c4a0..1344b361a475 100644 --- a/drivers/power/reset/qcom-pon.c +++ b/drivers/power/reset/qcom-pon.c @@ -17,6 +17,8 @@ #define GEN1_REASON_SHIFT 2 #define GEN2_REASON_SHIFT 1 +#define NO_REASON_SHIFT 0 + struct pm8916_pon { struct device *dev; struct regmap *regmap; @@ -45,6 +47,7 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot, static int pm8916_pon_probe(struct platform_device *pdev) { struct pm8916_pon *pon; + long reason_shift; int error; pon = devm_kzalloc(&pdev->dev, sizeof(*pon), GFP_KERNEL); @@ -64,13 +67,17 @@ static int pm8916_pon_probe(struct platform_device *pdev) if (error) return error; - pon->reboot_mode.dev = &pdev->dev; - pon->reason_shift = (long)of_device_get_match_data(&pdev->dev); - pon->reboot_mode.write = pm8916_reboot_mode_write; - error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode); - if (error) { - dev_err(&pdev->dev, "can't register reboot mode\n"); - return error; + reason_shift = (long)of_device_get_match_data(&pdev->dev); + + if (reason_shift != NO_REASON_SHIFT) { + pon->reboot_mode.dev = &pdev->dev; + pon->reason_shift = reason_shift; + pon->reboot_mode.write = pm8916_reboot_mode_write; + error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode); + if (error) { + dev_err(&pdev->dev, "can't register reboot mode\n"); + return error; + } } platform_set_drvdata(pdev, pon); @@ -80,6 +87,7 @@ static int pm8916_pon_probe(struct platform_device *pdev) static const struct of_device_id pm8916_pon_id_table[] = { { .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT }, + { .compatible = "qcom,pm8941-pon", .data = (void *)NO_REASON_SHIFT }, { .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT }, { .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT }, { .compatible = "qcom,pmk8350-pon", .data = (void *)GEN2_REASON_SHIFT }, From patchwork Wed May 31 01:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 687535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 203BFC83005 for ; Wed, 31 May 2023 01:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233646AbjEaBm6 (ORCPT ); Tue, 30 May 2023 21:42:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjEaBm4 (ORCPT ); Tue, 30 May 2023 21:42:56 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46621F9 for ; Tue, 30 May 2023 18:42:55 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f4b0a0b557so5811604e87.1 for ; Tue, 30 May 2023 18:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685497373; x=1688089373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ePONLKG6w8Sb9ucFxfluXQBvZKdoTzrtXA0KFPUr4P0=; b=o9cSS2QpT4Wsl9SR9B2SslD69sG9DYpVAE9i7hyhzarTk8AkclAH51cTCzfmX6ln4/ PTnNwSnTK3kesILZwZFPs2fxd/O4gxE6FR9zAOgnUiX/1/APaO7Y0rrs1Rw8/3Htdhwu d6PcQugcBh/entClYpOKT+yIhiivQ/kWlM1yX8l74Coeu8iTJ7mH91JJdytoE0rRPMlz EvJR51/pRjqRnSIDrk3neBCce8ZHKySuks1xpbRMn6UU4k/ipL9WHf/Kwbj3Fld/1SeE c0rC4QVURUgMugoZKLnSEL4y8upXUwC7Yf/I8LxZt6jfwgp/eY8sfKdowM0arOrltgqe nSTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685497373; x=1688089373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ePONLKG6w8Sb9ucFxfluXQBvZKdoTzrtXA0KFPUr4P0=; b=Pky1j0qwi10zyR/khnV0E/h4ah8XghV9NXeVaEII4zyNQPUyTslwYCiWyIXO1LyKob gQCwu2EQ6SOSEalMSCUdBpnHq2YJdC0No1UM3GqKUh7LL0qB6h1Iy55ysq1aPCCZSCA8 YBXJCPPI3xFrRY5kyeitvVYgZDIrT6Yv0vajA0cm27LozVX5JIa5p9IAGgyp2376e5PV ghNHdgWMEM8X6JEGhlAc5QpdByWDb14zc3OYPqYxwAm8E6F4kHwSlss8Kn4qm7EpBXeh vGzBPU41SeEjaKQFKM5bHIkCrj0neAoqoppYqL3NKvHNd4VKed9xnKiipmk3nT8HYrIH Edng== X-Gm-Message-State: AC+VfDxhmauemDEvL+7riB9XO5OXN+DtVSjAArW2gHRBEXvVo2yckHge atNEVqbHyqATDndDvEnZiKDy9w== X-Google-Smtp-Source: ACHHUZ6rN08epjLFVRSdRe8/aHjgfq3mu6/vKJMLlFwJfB7csOoyfLgMXdNLW261Y5UZbe60d8+XWw== X-Received: by 2002:ac2:5292:0:b0:4f2:5c4b:e69b with SMTP id q18-20020ac25292000000b004f25c4be69bmr1948255lfm.67.1685497373704; Tue, 30 May 2023 18:42:53 -0700 (PDT) Received: from lothlorien.lan (dzdqv0yyyyyyyyyyybm5y-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::ab2]) by smtp.gmail.com with ESMTPSA id q20-20020ac25294000000b004f3945751b2sm515994lfm.43.2023.05.30.18.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 18:42:53 -0700 (PDT) From: Dmitry Baryshkov To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v3 4/4] ARM: dts: qcom: apq8074-dragonboard: add resin Date: Wed, 31 May 2023 04:42:48 +0300 Message-Id: <20230531014248.3824043-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531014248.3824043-1-dmitry.baryshkov@linaro.org> References: <20230531014248.3824043-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add device nodes for resin (reset, volume-down) device node. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- arch/arm/boot/dts/qcom-apq8074-dragonboard.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts index 7f759b00524b..ce5eb56a5d1d 100644 --- a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts @@ -148,6 +148,11 @@ led@7 { }; }; +&pm8941_resin { + linux,code = ; + status = "okay"; +}; + &pm8941_wled { qcom,cs-out; qcom,switching-freq = <3200>;