All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kathiravan T <quic_kathirav@quicinc.com>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Elliot Berman <quic_eberman@quicinc.com>,
	"Mukesh Ojha" <quic_mojha@quicinc.com>,
	Kalle Valo <kvalo@kernel.org>,
	Loic Poulain <loic.poulain@linaro.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>
Cc: <quic_srichara@quicinc.com>, <quic_sjaganat@quicinc.com>,
	<quic_anusha@quicinc.com>, <quic_saahtoma@quicinc.com>,
	Kathiravan T <quic_kathirav@quicinc.com>
Subject: [PATCH V5 2/3] pinctrl: qcom: Use qcom_scm_io_update_field()
Date: Thu, 20 Jul 2023 12:34:07 +0530	[thread overview]
Message-ID: <20230720070408.1093698-3-quic_kathirav@quicinc.com> (raw)
In-Reply-To: <20230720070408.1093698-1-quic_kathirav@quicinc.com>

From: Mukesh Ojha <quic_mojha@quicinc.com>

Use qcom_scm_io_update_field() function introduced in the commit
1f899e6997bb ("firmware: qcom_scm: provide a read-modify-write function").

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
---
Changes in V5:
	- Dropped the ununecessary paranthesis
	- Updated the commit message to indicate the commit ID in which
	  qcom_scm_io_update_field is introduced instead of simply
	  mentioning the "last commit"

 drivers/pinctrl/qcom/pinctrl-msm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 2585ef2b2793..5ecde5bea38b 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1040,6 +1040,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 	const struct msm_pingroup *g;
 	unsigned long flags;
 	bool was_enabled;
+	u32 mask;
 	u32 val;
 
 	if (msm_gpio_needs_dual_edge_parent_workaround(d, type)) {
@@ -1074,23 +1075,20 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 	 * With intr_target_use_scm interrupts are routed to
 	 * application cpu using scm calls.
 	 */
+	mask = GENMASK(2, 0) << g->intr_target_bit;
 	if (pctrl->intr_target_use_scm) {
 		u32 addr = pctrl->phys_base[0] + g->intr_target_reg;
 		int ret;
 
-		qcom_scm_io_readl(addr, &val);
-
-		val &= ~(7 << g->intr_target_bit);
-		val |= g->intr_target_kpss_val << g->intr_target_bit;
-
-		ret = qcom_scm_io_writel(addr, val);
+		val = g->intr_target_kpss_val << g->intr_target_bit;
+		ret = qcom_scm_io_update_field(addr, mask, val);
 		if (ret)
 			dev_err(pctrl->dev,
 				"Failed routing %lu interrupt to Apps proc",
 				d->hwirq);
 	} else {
 		val = msm_readl_intr_target(pctrl, g);
-		val &= ~(7 << g->intr_target_bit);
+		val &= ~mask;
 		val |= g->intr_target_kpss_val << g->intr_target_bit;
 		msm_writel_intr_target(val, pctrl, g);
 	}
-- 
2.34.1


  parent reply	other threads:[~2023-07-20  7:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20  7:04 [PATCH V5 0/3] Introduce the read-modify-write API to collect Kathiravan T
2023-07-20  7:04 ` [PATCH V5 1/3] firmware: qcom_scm: provide a read-modify-write function Kathiravan T
2023-07-22  1:17   ` Trilok Soni
2023-07-23 13:55     ` Kathiravan T
2023-07-29  0:34       ` Guru Das Srinagesh
2023-07-24 19:05   ` Elliot Berman
2023-07-20  7:04 ` Kathiravan T [this message]
2023-07-22  3:09   ` [PATCH V5 2/3] pinctrl: qcom: Use qcom_scm_io_update_field() Bjorn Andersson
2023-07-23 13:48     ` Kathiravan T
2023-07-20  7:04 ` [PATCH V5 3/3] firmware: scm: Modify only the download bits in TCSR register Kathiravan T
2023-07-21 23:15   ` kernel test robot
2023-07-24 19:05   ` Elliot Berman
2023-07-25 10:24     ` Kathiravan T
2023-07-20  7:08 ` [PATCH V5 0/3] Introduce the read-modify-write API to collect Kathiravan T
2023-07-24 19:05 ` Elliot Berman
2023-07-25  9:55   ` Kathiravan T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230720070408.1093698-3-quic_kathirav@quicinc.com \
    --to=quic_kathirav@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=kvalo@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=quic_anusha@quicinc.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_mojha@quicinc.com \
    --cc=quic_saahtoma@quicinc.com \
    --cc=quic_sjaganat@quicinc.com \
    --cc=quic_srichara@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.