Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2688418rdh; Wed, 27 Sep 2023 09:40:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP7q8iVRLI2MZE5pE+tMD4Ek2w7v4FadnBUCbIcxuC1uY5/9XNfOAszU6hcJX7FHFlstra X-Received: by 2002:a05:6808:1294:b0:3ae:1254:ea8a with SMTP id a20-20020a056808129400b003ae1254ea8amr3092472oiw.41.1695832838954; Wed, 27 Sep 2023 09:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695832838; cv=none; d=google.com; s=arc-20160816; b=INtX5lgTsNrk4Gm6cnDc16YbjGNIFS80cwze4jzbPDxJPjj6OPpLSJO7l37Omw+hCc gJNCpe9zy3w3Kyz0z9RZ4C0l1CvNiL/FBPsR5EnwwHZME5mdxR5Wbwy+zES+umVx8oWN 2+aYnyOPe1SuzkQs6QiEVetgvEFdEqFIcyb/aQlzKZZAPfrlED1fqx7II678sbPFyzco Jt2R4XezLP4DoZqTOuk92B6FTmDTmua5Z3DfyK9cnwS+Eao5TEm0m52QQtJvieO6uWBr NmTCYl8cb0udDXxn6WLfc62ckRj8B8lM5SmK066fODCGtODPOCM0+uD/J/AWApeLotM/ fCtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=GxKywGwck3KbnidkNsyFHM+HocPn+tVDnvfKIat4JMY=; fh=A2fpulUSJa3Z3RbyjIFX9wjax+SVXSZM7OKN6SOoJBI=; b=DFKrBfwTgRgTfcejG3wkkrs6vf0DVvvkSWGNhM0z1gj0agCIvZH7wCeSqnI805GKFb /6SE1FTclYVVsHbkZjLX15BNtqKYk0S078jFOL2JplTPja6iScXNzZSZfP8nawF3ZuDI wwMTztndhWqJGuuIG/nilsRko2ti3M7uCAbwfEoXOsJHFnPPX4Ba03SSbZhtAu8eW/ai YyW0LJ32nsjeCFr6aghGGgpi7UlxOwecvmXimy7E1JrcK8T3xlNMQNgT4gPfu0QPedas RsLQKaFj39jNB29kKB/K5vHUGYdYQny4dTAjKCrAIQKRjHYC1FgIcCCALHpz1+pYCMKq C0GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l63-20020a638842000000b00574006acf67si16211986pgd.17.2023.09.27.09.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 09:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6C76C805BCAA; Wed, 27 Sep 2023 09:27:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbjI0Q0t (ORCPT + 99 others); Wed, 27 Sep 2023 12:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbjI0Q0q (ORCPT ); Wed, 27 Sep 2023 12:26:46 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5731EF3; Wed, 27 Sep 2023 09:26:44 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C6E71042; Wed, 27 Sep 2023 09:27:22 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCEE13F59C; Wed, 27 Sep 2023 09:26:42 -0700 (PDT) From: Sudeep Holla Date: Wed, 27 Sep 2023 17:26:11 +0100 Subject: [PATCH v2 2/4] i2c: xgene-slimpro: Migrate to use generic PCC shmem related macros MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230927-pcc_defines-v2-2-0b8ffeaef2e5@arm.com> References: <20230927-pcc_defines-v2-0-0b8ffeaef2e5@arm.com> In-Reply-To: <20230927-pcc_defines-v2-0-0b8ffeaef2e5@arm.com> To: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Sudeep Holla , "Rafael J. Wysocki" , Andi Shyti , Jean Delvare , Guenter Roeck , Huisong Li X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2115; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=JYykwJW8XnX9bo7n2AWrUiKdtKD+V2jncnVPIPftAhE=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlFFe/kjTk37+UIHVvdqo4aE1ihgoJB5WsPQumt WCQ1neeOPGJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZRRXvwAKCRAAQbq8MX7i mAHxD/9Eih5z660Z/lKcUVaW6jT5yfjUKRURQGGhAnVuHOFGYYDdBCFJ8UFUiqW5pI+luvSUeY4 4RNpxVacMkHJ0Oy1vsSmyCoSAVI6hqo4vchQoFKfc38+0FOBpgxFMznMtSYSaoXVFIx05pvb7k4 i5Qfh4KoFpC0vVyy1NE3e9zkuvbkHuI+kGx5k5m5JAZ7iC88qohCnXlf7zRnUgSdFg11y6j2KKR 3RpQdL9TmfvfpROUoKM/+nYyYceMTZP+QeLCvWAdLNkp+Edcx5WRUa3kuOS7ewi0oOqRTdNvOs7 FlfJ0F8VFxgMysgFXm4tO96pf6z3cUohVC24K5/DLI2AykHtCIrSb5z5eNoHL1bHBP4raCh9eh7 LKlxYY8NV+IGCnX+9+JzRTzh8h4FjZ2te2wpCcVm5k4XUl98nDyW5vzOJoeKcOi8KHFBzGISccd /9FpMkD+sjURiwIV7s8ElxiRaQrYPOtb2S5Y4IgtAvMGyOhSIshdAh4FnURKzi8fW/C+VP4fxi0 UruBvnclcuw5wNRGxLdtCqaYXpesh9NX59UDk6DM3UbmMS8SIxm3nh7o90rZuwRLQHOY7X3899x wD4nnb61QR2b+lzKqrDoAt6Rh1mL6I+nVuu8IL9c2u3Zowi8xbAx6VReVNGIhiC78mys6G5gnT0 ZAiVRtT17oRQ45A== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:27:10 -0700 (PDT) Use the newly defined common and generic PCC shared memory region related macros in this driver to replace the locally defined ones. Reviewed-by: Andi Shyti Signed-off-by: Sudeep Holla --- drivers/i2c/busses/i2c-xgene-slimpro.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-xgene-slimpro.c b/drivers/i2c/busses/i2c-xgene-slimpro.c index fbc1ffbd2fa7..658396c9eeab 100644 --- a/drivers/i2c/busses/i2c-xgene-slimpro.c +++ b/drivers/i2c/busses/i2c-xgene-slimpro.c @@ -91,14 +91,6 @@ #define SLIMPRO_IIC_MSG_DWORD_COUNT 3 -/* PCC related defines */ -#define PCC_SIGNATURE 0x50424300 -#define PCC_STS_CMD_COMPLETE BIT(0) -#define PCC_STS_SCI_DOORBELL BIT(1) -#define PCC_STS_ERR BIT(2) -#define PCC_STS_PLAT_NOTIFY BIT(3) -#define PCC_CMD_GENERATE_DB_INT BIT(15) - struct slimpro_i2c_dev { struct i2c_adapter adapter; struct device *dev; @@ -160,11 +152,11 @@ static void slimpro_i2c_pcc_rx_cb(struct mbox_client *cl, void *msg) /* Check if platform sends interrupt */ if (!xgene_word_tst_and_clr(&generic_comm_base->status, - PCC_STS_SCI_DOORBELL)) + PCC_STATUS_SCI_DOORBELL)) return; if (xgene_word_tst_and_clr(&generic_comm_base->status, - PCC_STS_CMD_COMPLETE)) { + PCC_STATUS_CMD_COMPLETE)) { msg = generic_comm_base + 1; /* Response message msg[1] contains the return value. */ @@ -186,10 +178,10 @@ static void slimpro_i2c_pcc_tx_prepare(struct slimpro_i2c_dev *ctx, u32 *msg) cpu_to_le32(PCC_SIGNATURE | ctx->mbox_idx)); WRITE_ONCE(generic_comm_base->command, - cpu_to_le16(SLIMPRO_MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INT)); + cpu_to_le16(SLIMPRO_MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INTR)); status = le16_to_cpu(READ_ONCE(generic_comm_base->status)); - status &= ~PCC_STS_CMD_COMPLETE; + status &= ~PCC_STATUS_CMD_COMPLETE; WRITE_ONCE(generic_comm_base->status, cpu_to_le16(status)); /* Copy the message to the PCC comm space */ -- 2.42.0