From patchwork Tue Nov 2 15:22:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12599113 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2CB0C433FE for ; Tue, 2 Nov 2021 15:22:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86B8660EB4 for ; Tue, 2 Nov 2021 15:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234311AbhKBPY5 (ORCPT ); Tue, 2 Nov 2021 11:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbhKBPY5 (ORCPT ); Tue, 2 Nov 2021 11:24:57 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0B14C061714; Tue, 2 Nov 2021 08:22:21 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id p16so43716325lfa.2; Tue, 02 Nov 2021 08:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZRWxCmCFDqIDU/+vKEVCg40RJnSVkH+e7mS2lPOP/bk=; b=fgWUWLBDBQzniNNEiyRdZvCnr4uRGHfviNJ3+2wnyobh6kSOAiuVhYKHF9/2qXQCzP 7ymx2kxOU+SgN+K3ZFlWWqk4WlCotSyY66Ytf/EBFwwfwGxIBV4A1osfZpmis7dhYu0Y g0bDGLMdFAT0jYixkeTaq8EmLrXPVlzfo6h/zzXXzLBgx3DDZz4CcGZB+NGFlKonU960 U2gZC/cnNw8N8ScqxsjYbLjxYY1f3c4rGoc7jL40lqXUpUnKU8yJBnX+oMd8qnfYH6VP 9zVNc6fhEM4Sk9fst2yyDbuJZUl6p0p3uZyni4cSN6bHigrmG/Qz65SEfm22MwJJWSod M1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZRWxCmCFDqIDU/+vKEVCg40RJnSVkH+e7mS2lPOP/bk=; b=I9kfFgAE84Vy9kC5vybtE8QM9xOJEJMG8d/8cL7fTbWXbMxb1W/qqEmZO6TcQajJiH WNAPTs0Sqi0bEWp5viIAzumRGU0YIsYehEwg+Sfi9572XAPSxFnHWZqDRqByAzKwClVM s5yKu3ZDaKsfNYwcImyC+w5LxQHjIRHtPTbL7/z2sWaLAf9WmGcr0Bw5r1SReJQ2A1XN vXSaW1A24+8JsYjTorzKTzgtpbKzaok7suSBM4KKpy9Qud0vHBFXV5tQ/jbnstrJZwQF vliv2aXL4J9JDZwcKMP84kf20QqcXCivYnv5WKjr54vUrGPbRbU9sBo95g+PedBN4BO8 DYCQ== X-Gm-Message-State: AOAM531OlyeB+FheN1lG6HwKhpmS6QIgpEnoJmU1HHqo45daWSU5HJv/ F6RcbQZCA5HV3yMntwKMwHY= X-Google-Smtp-Source: ABdhPJxcoUG/2HtmFlZpzLf6dL4GqVJEo16yhgjX5bBUu9gkSTJ+URRHbWo/sDJwSqlmJRE6TmgPXw== X-Received: by 2002:a05:6512:acc:: with SMTP id n12mr34927392lfu.524.1635866540364; Tue, 02 Nov 2021 08:22:20 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id a24sm250952lfr.151.2021.11.02.08.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 08:22:19 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Sebastian Reichel , Rob Herring Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones , Wim Van Sebroeck , Guenter Roeck , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RFC 1/3] dt-bindings: power: reset: syscon-reboot: use non-deprecated example Date: Tue, 2 Nov 2021 16:22:05 +0100 Message-Id: <20211102152207.11891-2-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211102152207.11891-1-zajec5@gmail.com> References: <20211102152207.11891-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafał Miłecki Usage of "regmap" property has been deprecated by the commit 2140d68d69d4 ("dt-bindings: power: reset: Unrequire regmap property in syscon-reboot node"). Rewrite example to help people using non-deprecated binding. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring --- .../bindings/power/reset/syscon-reboot.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml index da2509724812..ebae55683d39 100644 --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml @@ -59,9 +59,13 @@ allOf: examples: - | - reboot { - compatible = "syscon-reboot"; - regmap = <®mapnode>; - offset = <0x0>; - mask = <0x1>; + system-controller@12020000 { + compatible = "hisilicon,hi3519-sysctrl", "syscon"; + reg = <0x12020000 0x1000>; + + reboot { + compatible = "syscon-reboot"; + offset = <0x4>; + mask = <0xdeadbeef>; + }; }; From patchwork Tue Nov 2 15:22:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12599115 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52E1FC433F5 for ; Tue, 2 Nov 2021 15:22:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AAA360F24 for ; Tue, 2 Nov 2021 15:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234323AbhKBPY7 (ORCPT ); Tue, 2 Nov 2021 11:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbhKBPY7 (ORCPT ); Tue, 2 Nov 2021 11:24:59 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA373C061714; Tue, 2 Nov 2021 08:22:23 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id bq11so43668246lfb.10; Tue, 02 Nov 2021 08:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1YHGtBoC/Q+g9ByAL6ZbJf5/4fBkm5FjpScxQdxcQMM=; b=R++1nrZ4CaOf6LVPE0lbPrJI3kBbl3CbDATa5TTus2fbNw3Usfzsg89rWvl06vyZos FcIcgyddbbPXHp2AFzeiosRzVHcYizyesoCIPgKPjFGIK68riQCMlx9SpDLzyoJbcU2b RRFZWb07QGnYJrV3isc0u79tzUrYhyZyQebmrFcyKJrk2t1+9zAQAqkN3EswkjH1pBHA +OOaSl023Ey1jnlhi3uRLc45FS5MgthjpdIMXC1Pp9qIWiJb5CObh4Srro19y94U+cSH Y29TB9fPe7b764FAAlG8OLfUbw+xuZ7Lawdt1QX1CBUhcsv+jEbXVo/3dyUvd7CjNrMi ua5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1YHGtBoC/Q+g9ByAL6ZbJf5/4fBkm5FjpScxQdxcQMM=; b=A7bCeIUBreAiSnjt9SB0e1XvHExPMuf8b5y4bZcFdw04qdVzn4sUYqw0apGV0IIX4R RrJs5Cz4aqbSja1SYeTasaPH4qC3+sZIV3OxuJ1GgK+a8f4eZRsNXzTqQyLVE0h10JbK RmZ1m1lur/FoHqyDN4Fvl3Xrw1MiRGZFphz7kX4u5ptxzz2F5tLGTFSePpybUPyGzngd 5lwZit0thQTyycZBJZKxoMehhLHn7dlQdWBnY0rhctuVcBNKl3nZZpBO8kgKNKs25MEG y0xdei0+bSZXD+XI8aCEdwkkLXiGoJjXVABQ+Ca4cFs7dm+5JGzB/yZ/SeJmRGNuw5T4 fAvw== X-Gm-Message-State: AOAM530PZRRUChaEBtPVLwIfi6vsM0hZkVkq6wOlIKAMeANHPlndEuAo eBfCuw1+t2PPVRNQ3yDVQV4= X-Google-Smtp-Source: ABdhPJzBRFPfCAKBDUfg9MFyHjw/HoxlmxsNBG+88qqkYpOAckcI+ET3dyap/DWMWfyKFeXtgsN2VQ== X-Received: by 2002:a05:6512:3341:: with SMTP id y1mr34771538lfd.645.1635866542219; Tue, 02 Nov 2021 08:22:22 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id a24sm250952lfr.151.2021.11.02.08.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 08:22:21 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Sebastian Reichel , Rob Herring Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones , Wim Van Sebroeck , Guenter Roeck , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RFC 2/3] dt-bindings: power: reset: syscon-reboot: add "reg" property Date: Tue, 2 Nov 2021 16:22:06 +0100 Message-Id: <20211102152207.11891-3-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211102152207.11891-1-zajec5@gmail.com> References: <20211102152207.11891-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafał Miłecki Reboot node should be a child of mfd/syscon node and should use "reg" property to specify regmap offset. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring --- .../bindings/power/reset/syscon-reboot.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml index ebae55683d39..ddcf6e5dcdfa 100644 --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml @@ -31,6 +31,10 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 description: Offset in the register map for the reboot register (in bytes). + reg: + maxItems: 1 + description: Offset in the register map and size (must be 4 B) + regmap: $ref: /schemas/types.yaml#/definitions/phandle deprecated: true @@ -42,12 +46,14 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 description: The reset value written to the reboot register (32 bit access). -required: - - compatible - - offset - additionalProperties: false +anyOf: + - required: + - reg + - required: + - offset + allOf: - if: not: From patchwork Tue Nov 2 15:22:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12599117 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DBBDC433F5 for ; Tue, 2 Nov 2021 15:22:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16DA260EB4 for ; Tue, 2 Nov 2021 15:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234318AbhKBPZB (ORCPT ); Tue, 2 Nov 2021 11:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbhKBPZB (ORCPT ); Tue, 2 Nov 2021 11:25:01 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173B3C061767; Tue, 2 Nov 2021 08:22:26 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id k24so16116152ljg.3; Tue, 02 Nov 2021 08:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kbTjM42dgn5znxpAJxpViMxj9q04jMH0pVgaJHislBE=; b=EhPsEs0phIHs7egi40UpSR7z2Vena1c61+UoDWEhW18IIRX5R6/klpcYZbzLBcGYQT K3Jfl9KUUcTVBIisWbw7qiMMfFYmr7y1tSNEHl12guJkIWiWboIJ/YmQpSZG/Xmn+DF3 roqUQ7+V01HQhmG12eYHOy1IeJA5NfxTuIDf1tJjYeLwF2hEt77evPj0l1Xb9g/7hJgw 8ekNeNQqxqDFAxu+l89AS++xbBQ0sPQrCcWOgf7PmWcTe4LQXBNXUZWbQTsS6dqrfmcq usrFxAjJ5wcJJhMGjE33mGy7WBzkBcTT2F217CZjYwXfbkx1iUtRvAxSysu234tzSTqf p70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kbTjM42dgn5znxpAJxpViMxj9q04jMH0pVgaJHislBE=; b=EhelqSjfSLC8uvwxDjzfr3DyGc6TS32KZo0aAfm9uYXhMEV86PtQHZz9z/Vk2jt4N1 0kPQz3NFLBcUWzxWKtJ7XoXi6rhiNiJGE3WTtRWbbECBIpjTV3LBcBqL7tS+kfrAzHgT dIlEt+lPCLnTA+A8GqxLex63xog1+d4l4c1oHwRCVyWvaJSSbSXDT8bYaybXrNr1r3WV wtpVkzC2l/6FhuVMuJ7Xa4gXbqy4pXumg+GKd1/1OlZCz2ZpgMXhkEYoGpK13XtkLFg5 NLrgW0wyl5yHWNaHyDXiF9XiNc8CudgvRdOX2DfHq3MuejOrRe9KuWPY4Cky4LTV2cWQ eN2w== X-Gm-Message-State: AOAM530cxga6d8CHqQ0UZb19lm19oEm7ALV4gDPBaJ0DF4/8vXIY9VfJ ofBFiwzBhPxCjjAQK9b7OYM= X-Google-Smtp-Source: ABdhPJx0eCQNwvHDIFM+gK0yjLlN5Li6Z6x62rWTlJAR0vYyBk31rUJiZc39mCuCSL2hEoMthVSdhQ== X-Received: by 2002:a05:651c:10b2:: with SMTP id k18mr17896959ljn.359.1635866544506; Tue, 02 Nov 2021 08:22:24 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id a24sm250952lfr.151.2021.11.02.08.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 08:22:24 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Sebastian Reichel , Rob Herring Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones , Wim Van Sebroeck , Guenter Roeck , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH RFC 3/3] power: reset: syscon-reboot: support "reg" property Date: Tue, 2 Nov 2021 16:22:07 +0100 Message-Id: <20211102152207.11891-4-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211102152207.11891-1-zajec5@gmail.com> References: <20211102152207.11891-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafał Miłecki This follows binding update to use "reg" for reading regmap offset. Signed-off-by: Rafał Miłecki --- drivers/power/reset/syscon-reboot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c index 510e363381ca..a0999bac503e 100644 --- a/drivers/power/reset/syscon-reboot.c +++ b/drivers/power/reset/syscon-reboot.c @@ -44,6 +44,7 @@ static int syscon_reboot_probe(struct platform_device *pdev) struct syscon_reboot_context *ctx; struct device *dev = &pdev->dev; int mask_err, value_err; + bool is_child = false; int err; ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); @@ -55,10 +56,14 @@ static int syscon_reboot_probe(struct platform_device *pdev) ctx->map = syscon_node_to_regmap(dev->parent->of_node); if (IS_ERR(ctx->map)) return PTR_ERR(ctx->map); + is_child = true; } - if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset)) - return -EINVAL; + if (!is_child || + of_property_read_u32(dev->of_node, "reg", &ctx->offset)) { + if (of_property_read_u32(dev->of_node, "offset", &ctx->offset)) + return -EINVAL; + } value_err = of_property_read_u32(pdev->dev.of_node, "value", &ctx->value); mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask);