From patchwork Wed Mar 29 07:46:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 76430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp241398vqo; Wed, 29 Mar 2023 01:04:26 -0700 (PDT) X-Google-Smtp-Source: AKy350YvXALTxF0eN/mpjke5N5hSBAbHee6xkxV4k+bOjcGwhHjJN2YZ6JpHCzekY78aTk8ZoKls X-Received: by 2002:a17:903:1109:b0:1a2:38a3:7958 with SMTP id n9-20020a170903110900b001a238a37958mr16875821plh.1.1680077066721; Wed, 29 Mar 2023 01:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680077066; cv=none; d=google.com; s=arc-20160816; b=Xc6244nD1MrqRObA/5yC3Al6J5tSNMnTn6Z+PD+4zZH7Pe2ZVdRyzxMM07Ns5LX7a8 IcDyewug+czGcpK8kRf7OGHGuzxF10SW6UAPjs/1TU/pvoFXt2hx4a90E1QyrDIARgXj Qx5/ay5DNISYAbnMeq60j6VQHjDiYqvGqAO3DUsanrLGKXQCoWFPLPD1EoZRU8ybHyrQ oKf4dmpvWhnCLROohmIWhcs+FG5x+6qnZRprEaDQGVyNoqtl8IlzfftQMXfai2zgD3Yl TVKvRZlMW3Nu85ki6nA2Sh2Zx5JqCrCTnkRIKV4NZab9mQKN/RKGxlASMvzIQ92rD5mX FdaA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902854c00b0019c14335fc0si8147970plo.70.2023.03.29.01.04.14; Wed, 29 Mar 2023 01:04: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=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 S230071AbjC2HrU (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761688489846807293?= X-GMAIL-MSGID: =?utf-8?q?1761688489846807293?= 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); }