Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp245722rwl; Wed, 29 Mar 2023 00:49:40 -0700 (PDT) X-Google-Smtp-Source: AK7set8zUIu1xWttvwKeKX58BVYwR/KLpsUVrNukB6I50ENk98CJyJwVc6AVnckAzQTiRwpaswtN X-Received: by 2002:a05:6a20:8b14:b0:cc:d7ec:b7c with SMTP id l20-20020a056a208b1400b000ccd7ec0b7cmr18600648pzh.4.1680076180220; Wed, 29 Mar 2023 00:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680076180; cv=none; d=google.com; s=arc-20160816; b=Bu45KqgiqU6E5YtD7/R7pAu5PtlJZSJTg3JTdqwmHtkCxcVZNzmFZC6HuEaghovqF2 m1IYW1im584Go1gGE7fU5blf+RAUiejrglMly3L9pYOSFy3fNlFv2AUP2beBl9lSJgcZ imkw+/8/biDHQsu9LnJDSrMhgPMrrGXHbFSD66uymzopTwplpGzFc1zJpUDOP+YV4jD1 Iv4zx+GouiNDEIrS18D3EbrjvHjWDWVWSqqBsO0TkWUOwL5/Nvcq6XcT2B0iADDxRCVF czfD9ddQqQzaScIGCxW/vuK2dkvZFzmd96+qeUU5K9uHxp3KNBMtJZVHoEh8cwJVBM9W ILvg== 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=pQ9qP4jQttvNLs16ubimp+yVbMV+6UJZe8fcxdXIgvG39SrShtHIjB9IvlDjLpIA9b 14cEpP/1Mt5pwph7XxT4TrgLPyMm+5PP/iujaijVdAXIi2xR5jb+JYNjNRdM+7bW7Uzg IfHvDY5R2a/QOYrluTWIE5xhD0B5zHP334Zeh0lbUFE0rQipXmY7CEj92745rfqJvuQm NwnG+dV7Kp30bJDWa/926jV1tFEpH1AzdjtrMJoPfD7iJj6UEodhzu6CGNh8CYCytnIj F5AZqutEQrV3K/vGmp0jbwuQOkRg1qsSjAZcBnkv76c07kJtdnf3JNWrxwfVNQrZVQmB 9wxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EmgB3sD0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a056a0022c500b005a8d684c05dsi33221294pfj.271.2023.03.29.00.49.29; Wed, 29 Mar 2023 00:49:40 -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=EmgB3sD0; 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 S230054AbjC2HrU (ORCPT + 99 others); Wed, 29 Mar 2023 03:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjC2HrR (ORCPT ); Wed, 29 Mar 2023 03:47:17 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 900951BF0; Wed, 29 Mar 2023 00:47:16 -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 32T1nRqh015200; Wed, 29 Mar 2023 07:47:13 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=EmgB3sD0/nys+tpY/koIEhVOLAB2YAbieOmEjl/CS1bIz5vXy68qlMaCGKsG8BaPQlR/ cYUfVr+hjjr05YTOV+rvh8AC4a+h2c0YmBMic3top5UbmKF54EujWJ0TqTfWKlAVEnoo TFicHaY99q+R4Atd/rBwyU/idGrPLngk7GxVCr4W65W0QlDyulyGlHD9DMQmJQmWqjoy 4tnJihDSRcfpuQxV/lhz1eGx6vABhvQtLAeWUiovDEMrNyTTDkiUtVG5TWULJF4CiJFm 3f3kHmUNpRk8cKClwterSWRcerd74btIR7AqH4MifUOMvy7tRjbadqdP04IwuL2HtYf4 xw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pkv45k4pm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Mar 2023 07:47:13 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32T7lCi9013399 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Mar 2023 07:47:12 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; Wed, 29 Mar 2023 00:47:09 -0700 From: Mukesh Ojha To: , , , CC: , , , Mukesh Ojha Subject: [PATCH v6 2/5] pinctrl: qcom: Use qcom_scm_io_update_field() Date: Wed, 29 Mar 2023 13:16:49 +0530 Message-ID: <1680076012-10785-3-git-send-email-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1680076012-10785-1-git-send-email-quic_mojha@quicinc.com> References: <1680076012-10785-1-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain 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-GUID: ZlzBY3xBCeo8FIJWnh0gakDjsK21A9QC X-Proofpoint-ORIG-GUID: ZlzBY3xBCeo8FIJWnh0gakDjsK21A9QC 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-29_02,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-2303290063 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 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); } -- 2.7.4