From patchwork Tue Mar 28 15:37:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 76156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2316903vqo; Tue, 28 Mar 2023 08:45:26 -0700 (PDT) X-Google-Smtp-Source: AKy350aE0jaem4sswy2XxeUKN0GP0COkaV+w6sniqTyyOXrco8zgZam6WE5nb8/D2e/Q2m4w3nTi X-Received: by 2002:aa7:db53:0:b0:4fb:aa0a:5b72 with SMTP id n19-20020aa7db53000000b004fbaa0a5b72mr16378400edt.5.1680018326459; Tue, 28 Mar 2023 08:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680018326; cv=none; d=google.com; s=arc-20160816; b=N1tmwb7D0gFNkj+9eSwZ1iteycG3Cu7ucbDmPq2ocG5UvkrdS0gQZyx0eHCI+eE14G ZAJekiFlOR5HX0ORGB7K6jLFsIq5hLj32ik6t2sR54d61MJxnfRHPBP42w1DZ6dKiRf6 NVVEwIMyzy1HmhACJxVnBsr6uIsT+Km8Uiwizpq+qeY6hwaQqoz9ybBFxsMAea76pyGt sr1w2PH4wCpFgFPeoYrprE2gyL+i4FjNT+f+goaIG18BnJM/MEfD6R5F0xcdCLcEebr2 UF/08G7qhRjLF7PNCZtgaFRST6JH+ZmVSjmhE8U1xyDM/VUz+uuICSckh/MkkYs96Dm1 5Z7g== 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=r+pX2vSb4YAJKMO0j8KLMPAl+BMabReRmbo81yPu2HrUyq+fd9FOyZPXrGK/7AllA5 BbWi7TfGPV2J52eU0lUb05m4wievgVIcQJ5QAkWtS3Ss2wDsGR0Be731SlTyOsivIsD7 uR1jbMUltu1a40Vnbb/sThdfO9hLT6xLSdp6S476EuG4/qpRoOwUHDLRE6/d7fHcENpC SLoQK8nwfoYb0oWMVbN/ySEFfY0TX4oJE1geW8oKja5zdrI4SQXw/PlUhuJIyfhWJebD bq69c8viFadi7P+wL7dMbJmYi6rgA6U5IKNCsuw681imIks/aDqTTfjJnjQUDscipwtI jWrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OkGE83NW; 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 i16-20020a50fc10000000b004acc454abe7si30776349edr.260.2023.03.28.08.45.02; Tue, 28 Mar 2023 08:45:26 -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=OkGE83NW; 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 S233760AbjC1Plj (ORCPT + 99 others); Tue, 28 Mar 2023 11:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233943AbjC1PlO (ORCPT ); Tue, 28 Mar 2023 11:41:14 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E97611E84; Tue, 28 Mar 2023 08:40:13 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32S7iuZD014407; Tue, 28 Mar 2023 15:39:53 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=OkGE83NWHUm6FaTWy2rjtoue1WyewqTKBk8iXXlZVKEqZCqd7fjfHdHVZBVR7cd1ZUa0 pj4res8jGmGrL5Yk13gKLYpGB7krZWMG1s8paGhoSn68GEcabIQIgesBAIXHNgZ7wWLc JA4Jbk1lqkD+KH6ACAIEj3FiY47MxYtrPPsbCAoJ/6jAKI64injR/j31RKmryv3PxhoB CSv5yCaQNePR5nELEAFfKczevC5BVmETA2svkq0cDavjkf+1fi9/KPQs3ZYYCGVpI1mD rDxAhlTRQjZybSIu3miq/2UTzaYBisY9sk9ao1X/3p3Ia+vPOCt+5OqWrEbvwQLNwGiw 0A== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pkv45h8gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 15:39:53 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32SFdqiq022990 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 15:39:52 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.42; Tue, 28 Mar 2023 08:39:49 -0700 From: Mukesh Ojha To: , , , CC: , , , Mukesh Ojha Subject: [PATCH v5 2/5] pinctrl: qcom: Use qcom_scm_io_update_field() Date: Tue, 28 Mar 2023 21:07:46 +0530 Message-ID: <1680017869-22421-3-git-send-email-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1680017869-22421-1-git-send-email-quic_mojha@quicinc.com> References: <1680017869-22421-1-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-GUID: TKn8C7nppsSyggOAmVDd9ObJxSq-Uj6k X-Proofpoint-ORIG-GUID: TKn8C7nppsSyggOAmVDd9ObJxSq-Uj6k 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-28_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 bulkscore=0 impostorscore=0 clxscore=1015 mlxlogscore=693 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303280121 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?1761626896376218759?= X-GMAIL-MSGID: =?utf-8?q?1761626896376218759?= 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); }