From patchwork Wed Sep 30 02:21:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Guo X-Patchwork-Id: 11807725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A72F6CB for ; Wed, 30 Sep 2020 02:22:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 445F020773 for ; Wed, 30 Sep 2020 02:22:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rznW7aON"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="R1Mi678o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 445F020773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TPTgNRyFB803QfcxwVFDaKTsVm/Vw+7/MZG3UcyjqgE=; b=rznW7aONApQkaKimwUBdCKNab fgOJrko+dP9VT7sYJXGllshs3au/5Pxz6aZyV7Uuw4OkfZvPo+tbx8dPYLolR3dcnBcdbJL2cu5oy 4hZH66WVf3KimD2LBMguq3K73vpoEPYjySkhzE89UD9efOV+37OsXZla/VpRAYA/wTwB6qtRBECNE +JOfLkCIgAk5p8GPlJK2Q8hEli2wcxB9podxCriZHKi8leV2iqOT1/M/1qIg9VbZ6AI9xjrFaB+Ir XqwsIjUMvJ7gpsVJR5yHy4yKDNRXhyGa4h8ziFGinppD/wIm5CkE6y/svtDax45BdJr8eEP4mub3l LF6zFZtBA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRlC-0007UT-6w; Wed, 30 Sep 2020 02:22:26 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRl3-0007Rg-7X; Wed, 30 Sep 2020 02:22:18 +0000 X-UUID: 0381abece7584958adeb8175f3c8339e-20200929 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=PTUVFD+apyy6mQmY58fFDkNYQDyfBeyrLgmoDEvIU44=; b=R1Mi678oPirLVImcuDo/QvjfU1NG/H5UrP0H2kOLJs4xGpWCsrTI/nCdY/W2lsbnQFf9Sgn5HqyLWVJa5hLGrLWFN4X808DdaHr5Kouhx8h/zrtiG+5SXVqfoMCY8QKiXfcxBdK3NfUbNshGNA1HJhPSiwLAHWr/brchm5iaiVo=; X-UUID: 0381abece7584958adeb8175f3c8339e-20200929 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 898721143; Tue, 29 Sep 2020 18:22:05 -0800 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Sep 2020 19:22:02 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 10:21:59 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 10:22:02 +0800 From: Crystal Guo To: , , Subject: [v6,1/3] dt-binding: reset-controller: mediatek: add YAML schemas Date: Wed, 30 Sep 2020 10:21:57 +0800 Message-ID: <20200930022159.5559-2-crystal.guo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930022159.5559-1-crystal.guo@mediatek.com> References: <20200930022159.5559-1-crystal.guo@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_222217_449916_7C2F73BE X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, yong.liang@mediatek.com, stanley.chu@mediatek.com, srv_heupstream@mediatek.com, seiya.wang@mediatek.com, linux-kernel@vger.kernel.org, fan.chen@mediatek.com, Crystal Guo , linux-mediatek@lists.infradead.org, yingjoe.chen@mediatek.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a YAML documentation for Mediatek, which uses ti reset-controller driver directly. The TI reset controller provides a common reset management, and is suitable for Mediatek SoCs. Signed-off-by: Crystal Guo --- .../bindings/reset/mediatek-syscon-reset.yaml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/mediatek-syscon-reset.yaml diff --git a/Documentation/devicetree/bindings/reset/mediatek-syscon-reset.yaml b/Documentation/devicetree/bindings/reset/mediatek-syscon-reset.yaml new file mode 100644 index 000000000000..7871550c3c69 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/mediatek-syscon-reset.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reset/mediatek-syscon-reset.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Reset Controller + +maintainers: + - Crystal Guo + +description: + The bindings describe the reset-controller for Mediatek SoCs, + which is based on TI reset controller. For more detail, please + visit Documentation/devicetree/bindings/reset/ti-syscon-reset.txt. + +properties: + compatible: + const: mediatek,syscon-reset + + '#reset-cells': + const: 1 + + mediatek,reset-bits: + description: > + Contains the reset control register information, please refer to + Documentation/devicetree/bindings/reset/ti-syscon-reset.txt. + +required: + - compatible + - '#reset-cells' + - mediatek,reset-bits + +additionalProperties: false + +examples: + - | + #include + infracfg: infracfg@10001000 { + compatible = "mediatek,mt8192-infracfg", "syscon", "simple-mfd"; + reg = <0 0x10001000>; + #clock-cells = <1>; + + infracfg_rst: reset-controller { + compatible = "mediatek,syscon-reset"; + #reset-cells = <1>; + mediatek,reset-bits = < + 0x140 15 0x144 15 0 0 (ASSERT_SET | DEASSERT_SET | STATUS_NONE) + >; + }; + }; From patchwork Wed Sep 30 02:21:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Guo X-Patchwork-Id: 11807741 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D7EF139F for ; Wed, 30 Sep 2020 02:32:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C4EB20773 for ; Wed, 30 Sep 2020 02:32:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oboXPNKn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="mmmReacq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C4EB20773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uvZCYV9P6Sv5z6rjpLlU3umMP3GYQYk4CRpagxxwFaQ=; b=oboXPNKnWioBzhKQ8anSXpFIt 0AEZKJAUx2p+fpvrPWiog0+tZQBZYQKtItIy4QeGyQKBkIHDFGQU3HtQNF2s5WOdaSD8bA+UHvPNl sK6gAyR0RbITBDEaKwmQznBw1SmULP6x67Bx2uBKOvnnWK3XMAFbL/BS2yCvlOWvGzPEoyGXGBK9Q fH1SrfeS52j/Jp/hYq1TpeYLm6eEOJAfYBKWmkx+9n2Iqep4n5DtFt6SUoqNi9HFxBmPkx8dvpzRH n+5iDT5TT4VtiWhZrJeWC/Qjjf/w0zQ/7t+qDfKi1ao0G8doVXf7LFiAEYBRQA5fFq3EK95YgE4jJ KFZiVsDOg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRuk-0000gE-Ch; Wed, 30 Sep 2020 02:32:18 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRuf-0000dm-7E; Wed, 30 Sep 2020 02:32:14 +0000 X-UUID: f84a0d5e465e42a29c438623b6a1477f-20200929 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=AC/DXYeU36EHPrXDYOJrO+0efcpwt/5OaRcV8VbmYaY=; b=mmmReacqpJDjyNK3gdpXhk4iaPBc20DCqX/Gq/8dlx04KI9N6vDect3IQ96/+ZelWdmomtXo1ttHhPq9fVi9SZCVjz9f+ow+YA80pqMox0bESv8M62wwib3PZ+oIKcjLLDQ2bRE1/cw8/9lncour06YbErOKaP4CFVdJwJKB7ZI=; X-UUID: f84a0d5e465e42a29c438623b6a1477f-20200929 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1720255773; Tue, 29 Sep 2020 18:32:09 -0800 Received: from mtkmbs08n1.mediatek.inc (172.21.101.55) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Sep 2020 19:22:06 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 10:22:03 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 10:22:03 +0800 From: Crystal Guo To: , , Subject: [v6,2/3] reset-controller: ti: introduce a new reset handler Date: Wed, 30 Sep 2020 10:21:58 +0800 Message-ID: <20200930022159.5559-3-crystal.guo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930022159.5559-1-crystal.guo@mediatek.com> References: <20200930022159.5559-1-crystal.guo@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_223213_411199_2445D02B X-CRM114-Status: GOOD ( 17.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, yong.liang@mediatek.com, stanley.chu@mediatek.com, srv_heupstream@mediatek.com, seiya.wang@mediatek.com, linux-kernel@vger.kernel.org, fan.chen@mediatek.com, Crystal Guo , linux-mediatek@lists.infradead.org, yingjoe.chen@mediatek.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Introduce ti_syscon_reset() to integrate assert and deassert together. If some modules need do serialized assert and deassert operations to reset itself, reset_control_reset can be called for convenience. Such as reset-qcom-aoss.c, it integrates assert and deassert together by 'reset' method. MTK Socs also need this method to perform reset. Signed-off-by: Crystal Guo Reviewed-by: Ikjoon Jang --- drivers/reset/reset-ti-syscon.c | 40 ++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c index a2635c21db7f..5d1f8306cd4f 100644 --- a/drivers/reset/reset-ti-syscon.c +++ b/drivers/reset/reset-ti-syscon.c @@ -15,15 +15,22 @@ * GNU General Public License for more details. */ +#include #include #include #include +#include #include #include #include #include +struct mediatek_reset_data { + unsigned char *reset_bits; + unsigned int reset_duration_us; +}; + /** * struct ti_syscon_reset_control - reset control structure * @assert_offset: reset assert control register offset from syscon base @@ -56,6 +63,7 @@ struct ti_syscon_reset_data { struct regmap *regmap; struct ti_syscon_reset_control *controls; unsigned int nr_controls; + const struct mediatek_reset_data *reset_data; }; #define to_ti_syscon_reset_data(rcdev) \ @@ -158,9 +166,29 @@ static int ti_syscon_reset_status(struct reset_controller_dev *rcdev, !(control->flags & STATUS_SET); } +static int ti_syscon_reset(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct ti_syscon_reset_data *data = to_ti_syscon_reset_data(rcdev); + int ret; + + if (data->reset_data) { + ret = ti_syscon_reset_assert(rcdev, id); + if (ret) + return ret; + usleep_range(data->reset_data->reset_duration_us, + data->reset_data->reset_duration_us * 2); + + return ti_syscon_reset_deassert(rcdev, id); + } else { + return -ENOTSUPP; + } +} + static const struct reset_control_ops ti_syscon_reset_ops = { .assert = ti_syscon_reset_assert, .deassert = ti_syscon_reset_deassert, + .reset = ti_syscon_reset, .status = ti_syscon_reset_status, }; @@ -182,7 +210,11 @@ static int ti_syscon_reset_probe(struct platform_device *pdev) if (IS_ERR(regmap)) return PTR_ERR(regmap); - list = of_get_property(np, "ti,reset-bits", &size); + data->reset_data = of_device_get_match_data(&pdev->dev); + if (data->reset_data) + list = of_get_property(np, data->reset_data->reset_bits, &size); + else + list = of_get_property(np, "ti,reset-bits", &size); if (!list || (size / sizeof(*list)) % 7 != 0) { dev_err(dev, "invalid DT reset description\n"); return -EINVAL; @@ -217,8 +249,14 @@ static int ti_syscon_reset_probe(struct platform_device *pdev) return devm_reset_controller_register(dev, &data->rcdev); } +static const struct mediatek_reset_data mtk_reset_data = { + .reset_bits = "mediatek,reset-bits", + .reset_duration_us = 10, +}; + static const struct of_device_id ti_syscon_reset_of_match[] = { { .compatible = "ti,syscon-reset", }, + { .compatible = "mediatek,syscon-reset", .data = &mtk_reset_data}, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, ti_syscon_reset_of_match); From patchwork Wed Sep 30 02:21:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Guo X-Patchwork-Id: 11807723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27321139F for ; Wed, 30 Sep 2020 02:22:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7A9E20773 for ; Wed, 30 Sep 2020 02:22:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OzZNElHb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="lV7AHAk4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7A9E20773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MSkl1b98zrpzMf5LgU9SyX9qkGoAM4NqJCOMkUKs2Dg=; b=OzZNElHbVTMDEwAEK4cWV1+gV 4hNvqKjeL6IMVxdPT006w/7akLhWyLux+Pyo5vgQUAOoQpplD6xyQdCW10S1ZXFRGKUOW/9gieW9/ DnN7OXr1J0lH2+r6+1fFoFQ2A35ZNvFsT7jZDJZtAevUwQGjDYs4eewfRrQwqDzj3Q7lFitN2rCJ0 srDmjfLp2Ue+Z2lqgPT0j7IQuNZ9O4z8s7IWeC6xQ48TvPqt+ikoNO4fToMguK7uXvrx+HL8hqdqT K/mbY0ohlB1e53YjcGscm0oqyDovCbz+5z7gaubelPK6ugYmiAkKqF/axMFNo2+i3CawwBkMyoVLx wB2hyPniQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRl5-0007T5-Kn; Wed, 30 Sep 2020 02:22:19 +0000 Received: from [216.200.240.185] (helo=mailgw02.mediatek.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNRl2-0007Qx-9l; Wed, 30 Sep 2020 02:22:17 +0000 X-UUID: 720f8f95ce2a47e49c05d785883e4e95-20200929 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=/ODE+lHaGlrQfgAiLYh/aPpeTyv6wYIwW1Yqa7xY6kI=; b=lV7AHAk4nVzmE2RzlrakofFDpJ/HeFbk3tHqXQKMBvAI22S4wGgf4h3yCvPY0hKNtAb7YCoq1g/9BOn2GAbF/UlvA85/oompbTCG7jq3Hln1bwu+3GynX2SeegE163KR/MAnzN3b35pOT9n5mYNkjdvoOpyDz6VzeTEc0/ZLH4Y=; X-UUID: 720f8f95ce2a47e49c05d785883e4e95-20200929 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1156638677; Tue, 29 Sep 2020 18:22:08 -0800 Received: from mtkmbs08n2.mediatek.inc (172.21.101.56) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Sep 2020 19:22:06 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 10:22:00 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 10:22:04 +0800 From: Crystal Guo To: , , Subject: [v6, 3/3] reset-controller: ti: force the write operation when assert or deassert Date: Wed, 30 Sep 2020 10:21:59 +0800 Message-ID: <20200930022159.5559-4-crystal.guo@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930022159.5559-1-crystal.guo@mediatek.com> References: <20200930022159.5559-1-crystal.guo@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: BA75B31640D9C6D0159B7662252A7C2BDC31A2ACBB88105A60464EEC1CA8992A2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_222216_484927_080F4024 X-CRM114-Status: GOOD ( 11.51 ) X-Spam-Score: 1.1 (+) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, yong.liang@mediatek.com, stanley.chu@mediatek.com, srv_heupstream@mediatek.com, seiya.wang@mediatek.com, linux-kernel@vger.kernel.org, fan.chen@mediatek.com, Crystal Guo , linux-mediatek@lists.infradead.org, yingjoe.chen@mediatek.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Force the write operation in case the read already happens to return the correct value. Signed-off-by: Crystal Guo --- drivers/reset/reset-ti-syscon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c index 5d1f8306cd4f..c34394f1e9e2 100644 --- a/drivers/reset/reset-ti-syscon.c +++ b/drivers/reset/reset-ti-syscon.c @@ -97,7 +97,7 @@ static int ti_syscon_reset_assert(struct reset_controller_dev *rcdev, mask = BIT(control->assert_bit); value = (control->flags & ASSERT_SET) ? mask : 0x0; - return regmap_update_bits(data->regmap, control->assert_offset, mask, value); + return regmap_write_bits(data->regmap, control->assert_offset, mask, value); } /** @@ -128,7 +128,7 @@ static int ti_syscon_reset_deassert(struct reset_controller_dev *rcdev, mask = BIT(control->deassert_bit); value = (control->flags & DEASSERT_SET) ? mask : 0x0; - return regmap_update_bits(data->regmap, control->deassert_offset, mask, value); + return regmap_write_bits(data->regmap, control->deassert_offset, mask, value); } /**