From patchwork Mon Mar 27 16:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 75570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3404:b0:112:7285:5352 with SMTP id h4csp1552340rwd; Mon, 27 Mar 2023 09:48:11 -0700 (PDT) X-Google-Smtp-Source: AKy350b8WfKu98i6mdY5vzl7h34arLWuf5/jmJuDqL4upQUGM1dR6RyDPgGxavYwFrdqaiTjW50e X-Received: by 2002:a17:906:5d0b:b0:933:3aa7:57a7 with SMTP id g11-20020a1709065d0b00b009333aa757a7mr15547807ejt.49.1679935690736; Mon, 27 Mar 2023 09:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679935690; cv=none; d=google.com; s=arc-20160816; b=Gu8hf2Slqvq3ZQkBdYKUzyvwu8nzUBEi2sa5/0WTv+yz9FViTdFxuOdETg1Xx7Y06k OuoU59U8+Z9/q6SXPO8QsT7znmTF7sO76gYCOiIEj5pbDbve4+BoAjkXEzKUFMhbQsGq j1bRUVucSmCSS5gfeTMyQqRgDMOaGW2kMytmqO4rr+Y+o1cn77dB7/rxyh4NQuzcMb2W NpPRcOPZ4Ob8Qed4yw6n1/Y0IV/Z8Zia4I3mfrFcyE8V3yPIl4TKFTwssrGT4o35MSiQ BhaoCj2rLwR2eWoMQ2m0P/Pny6fcU+W5pVc50QP6Mjkmt36uLO/Po7W/8/ZrH+4hdOUI z7ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HsA+LxQVnxzKseTa2KZjRCjKmeq9PeHoILc6rkYATsQ=; b=KQIqLmxhznRo9seOwThpnF1ewZWAr0a9vImROth3AOjObVxWR7FqjrNOgXfcKLK5Nj 2+KnCUO5TzRv9mcJgMRu73gjtB88HpXPvs3SQDbPSYZarG20ZMoKcB2KHoucD1cvbk1z hHBgQWxfpd5AwMGMbI2SjkbWBWbVS2g6eC6pTpYgx68LYA8jOPhrBDOJ/TgN2iBFAXGj He4Exx/5SLqT4p8mvreT/u6dY9cTcg9SCMbBAzd8IC+SmihEAzi9vfxbwjJWf9UOa3eZ ACHtMcnyuQjgGJ9VHnXvy1Wr1yDMtU9o1+AkM3GsuK+8HYBtrZVBN0WQlWE5cUuWqA5h zSAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=P7yqQUFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb1-20020a1709076d8100b009256ac76f98si26248781ejc.676.2023.03.27.09.47.45; Mon, 27 Mar 2023 09:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=P7yqQUFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbjC0Qlz (ORCPT + 99 others); Mon, 27 Mar 2023 12:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232467AbjC0Qlt (ORCPT ); Mon, 27 Mar 2023 12:41:49 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CE7273A; Mon, 27 Mar 2023 09:41:48 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32RDM52c015305; Mon, 27 Mar 2023 16:41:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=HsA+LxQVnxzKseTa2KZjRCjKmeq9PeHoILc6rkYATsQ=; b=P7yqQUFzTx9wNiHGgXZy5jTN7rucXo2QdDwVuE47+7drtt2XXnMj/AJxvbj7fHhOHOAx 5UT68HX1zyOi2VtXUOKIJ0eTpMKJh5TVE3UBoAMPNILOvP9hXHJKf5ZyX4K2KV8lt9Po 7Gj9uZ0h/RuNJe/X7mu/Pvldb4fbn1xHW/vAcWegryA3fWO5kSRLXMMtGWcz6PUfKgrn iDXUWB2dzs44KNRSGZZ+JL6JrdiNqmOjbthxDiIAFp3kcrEWd6ysFm9GWcztlcN2dps8 5nnekZAcP2vUsa5LNnQLK76CGe0pGGugh6cqY/P3fAUaXn8i60QqfW1IDcIS6GmDZ3PP 9w== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pkby48k0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 16:41:45 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32RGfia6022544 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 16:41:44 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 27 Mar 2023 09:41:41 -0700 From: Mukesh Ojha To: , , , CC: , , , Mukesh Ojha Subject: [PATCH v4 2/5] pinctrl: qcom: Use qcom_scm_io_update_field() Date: Mon, 27 Mar 2023 22:11:18 +0530 Message-ID: <1679935281-18445-3-git-send-email-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1679935281-18445-1-git-send-email-quic_mojha@quicinc.com> References: <1679935281-18445-1-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: c67uhQ2rKaZ0M1zzOviNmCLSK794sqLR X-Proofpoint-GUID: c67uhQ2rKaZ0M1zzOviNmCLSK794sqLR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-27_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0 mlxlogscore=693 mlxscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303270134 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761540246555388881?= X-GMAIL-MSGID: =?utf-8?q?1761540246555388881?= Use qcom_scm_io_update_field() exported function introduced in last commit. Acked-by: Linus Walleij Signed-off-by: Mukesh Ojha --- drivers/pinctrl/qcom/pinctrl-msm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index daeb79a..6e1a5e4 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -1016,6 +1016,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type) unsigned long flags; bool was_enabled; u32 val; + u32 mask; if (msm_gpio_needs_dual_edge_parent_workaround(d, type)) { set_bit(d->hwirq, pctrl->dual_edge_irqs); @@ -1049,23 +1050,19 @@ 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 = (7 << 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); + ret = qcom_scm_io_update_field(addr, mask, g->intr_target_kpss_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); }