[v3,06/13] platform/x86: serial-multi-instantiate: Replace all spi->chip_select and spi->cs_gpiod references with function call
Message ID | 20230202152258.512973-7-amit.kumar-mahapatra@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp303427wrn; Thu, 2 Feb 2023 07:28:23 -0800 (PST) X-Google-Smtp-Source: AK7set+8bSX9+MZ5/0XMMFq6rmG7NoIaFogCKgVdkm7HPqX1mN+oe+ohXDLKzC3aQnlhkaPD2X5P X-Received: by 2002:a17:906:c352:b0:881:44e3:baae with SMTP id ci18-20020a170906c35200b0088144e3baaemr6590238ejb.54.1675351703003; Thu, 02 Feb 2023 07:28:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675351702; cv=pass; d=google.com; s=arc-20160816; b=WOX9NJlM3+Gv2HJbbrpVlXFmLG7maZKDlwVmVnnsqL2pEWrr3oCkQE5uH9MoZ/RDPT DPwUsMbK3bV2FtLleJGZm6+kHmdQM8QfY9LBWzdh8t190AuLF5WX9Arh4M742qE9Ap3l xNOSE465iWqyPWmeRN1KZ8iE1mN0OUHPg8gWoEJZJREDJ2T9rFm3LEwl9sjkcCGa1LwQ y/sEJp+D+sg3q9GzgRbHa1d/RH2HU8nlAowAHiznSwTE3XnGsTnLXt1+64JEc1ncdd2c s4GAm+4f+/kId07HXMeGkgUUJKPWrdQknBjmHW6A1/pRGsCm2CFpIfOVqUcz0fvk0xzt /Ulw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XxTTaX0RvNIuGzXe79JJPMl4YfA6n1vchK0hnLsPc6A=; b=ugYa3Klykc4OTvOCbtJbMJ9NdETt2HW+oyZUp4Yl8+ZjNm9VP62Xdhv+p4cId3TOY2 PcpF/+0VDiiCZkknx3fm9k/AHRsJEONMflPo0+GMxnJSrT2CNu2+TL+qtvittzrZ1g5W n5HUkUu5gMcOB9b63zQ/pk7OOVBmvCO5DXxq1jCLjzHfRX/4NnkXVPR/tMZJrvCZSG8L YsIjidp06WcNdlk6eSMNWAUnRHmFtjR58DJ8di9DxY9qKukWvb8e6aLrMY7HVTfu8AiF Zz0pwUeDFV71MARECyxLw/lP4ajmKKvnbsOujY5Tgn7uaL1t3y64c83ksBmxRuIQcdKS vwHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EuI0obwC; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq17-20020a170907291100b0088ed763410esi2645288ejc.434.2023.02.02.07.27.56; Thu, 02 Feb 2023 07:28:22 -0800 (PST) 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=@amd.com header.s=selector1 header.b=EuI0obwC; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbjBBP1U (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 10:27:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232918AbjBBP1P (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 10:27:15 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2072.outbound.protection.outlook.com [40.107.244.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF08010A9D; Thu, 2 Feb 2023 07:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7CXIBBblRf3Sx1gQml+vdL5M7kyV/mpZzrACP+k1/sCY5eQNoEQ96J5tU96x5ajxA4v5OXvwfb+94xh35BWmjY4bdBcFXpimwLFEJmockrmz6zphgwglRD6Bd/J2NWySjK07CD8msa24wWtOsf2N9LgaQUbVb5ZCKajKhJQV/WJ7Z9OoXZlGcvl3R40IyEnZf3RQvJGGzdyJIvtSG1A03mNLBYc4Zk3VUAK4LqOkeg0XirRdIgblJBvv3lKMpRIJ+YQ/Rbv2EI448KtlcvZkiDRhcmc6CYgAswD/60qZESIpSzw5Dg8ZbcQLRYGmLqKqN8ck4jhgSfZfAhfvcatPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XxTTaX0RvNIuGzXe79JJPMl4YfA6n1vchK0hnLsPc6A=; b=KP4S3N2U75l1Qo3Xpua124F7aB4lWjZARKSd3wHwl/kKNZMzJlQjY55ziuV/Z/ymcupy1F7m0ZYz2GpaCwGp+0ha69uuPs3fc5mV+Csp7BqfrCRl5QX6+wXSVyyvifVcPx1g7uAIeOizVon1GvRXLAeOtESuCcXdO+lD7xsG8t2SdfAKYLMUOrInVUYcYIh4RvwjY1Z3tmV6FQgIHqQBtWxkE+BMQ/cDePul1Z74l4e65Jeo5WYnoFaIdHPacP39zrutbzxtqSJSOYHLSYAib5zac7t4Hd1O/SBZM23CXxhaUlQBpIbvquInjf7ODco/Zo6CAYB/dnKT4ked2o21Dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XxTTaX0RvNIuGzXe79JJPMl4YfA6n1vchK0hnLsPc6A=; b=EuI0obwCuRpS9scVbl3gdrtGkoTztcNMbWR4Fte9+HmYX9avlBJ2pMDH8jfEA/TsItRwdQupVm8GITRHXZ/e9pEGxrjUIb/z2TaMhW9rLuKeEYkSem+q97dlgjHSt4vztdrOO75U6W5EytJpwWbful+3WJnRP8f26JnYLC1IqEM= Received: from DS7PR07CA0021.namprd07.prod.outlook.com (2603:10b6:5:3af::23) by DM6PR12MB4281.namprd12.prod.outlook.com (2603:10b6:5:21e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 15:25:47 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::3a) by DS7PR07CA0021.outlook.office365.com (2603:10b6:5:3af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.28 via Frontend Transport; Thu, 2 Feb 2023 15:25:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.28 via Frontend Transport; Thu, 2 Feb 2023 15:25:45 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 2 Feb 2023 09:25:44 -0600 Received: from xhdsgoud40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Thu, 2 Feb 2023 09:25:22 -0600 From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> To: <broonie@kernel.org>, <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>, <jic23@kernel.org>, <tudor.ambarus@microchip.com>, <pratyush@kernel.org>, <sanju.mehta@amd.com>, <chin-ting_kuo@aspeedtech.com>, <clg@kaod.org>, <kdasu.kdev@gmail.com>, <f.fainelli@gmail.com>, <rjui@broadcom.com>, <sbranden@broadcom.com>, <eajames@linux.ibm.com>, <olteanv@gmail.com>, <han.xu@nxp.com>, <john.garry@huawei.com>, <shawnguo@kernel.org>, <s.hauer@pengutronix.de>, <narmstrong@baylibre.com>, <khilman@baylibre.com>, <matthias.bgg@gmail.com>, <haibo.chen@nxp.com>, <linus.walleij@linaro.org>, <daniel@zonque.org>, <haojian.zhuang@gmail.com>, <robert.jarzmik@free.fr>, <agross@kernel.org>, <bjorn.andersson@linaro.org>, <heiko@sntech.de>, <krzysztof.kozlowski@linaro.org>, <andi@etezian.org>, <mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>, <wens@csie.org>, <jernej.skrabec@gmail.com>, <samuel@sholland.org>, <masahisa.kojima@linaro.org>, <jaswinder.singh@linaro.org>, <rostedt@goodmis.org>, <mingo@redhat.com>, <l.stelmach@samsung.com>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <alex.aring@gmail.com>, <stefan@datenfreihafen.org>, <kvalo@kernel.org> CC: <git@amd.com>, <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <joel@jms.id.au>, <andrew@aj.id.au>, <radu_nicolae.pirea@upb.ro>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <claudiu.beznea@microchip.com>, <bcm-kernel-feedback-list@broadcom.com>, <fancer.lancer@gmail.com>, <kernel@pengutronix.de>, <festevam@gmail.com>, <linux-imx@nxp.com>, <jbrunet@baylibre.com>, <martin.blumenstingl@googlemail.com>, <avifishman70@gmail.com>, <tmaimon77@gmail.com>, <tali.perry1@gmail.com>, <venture@google.com>, <yuenn@google.com>, <benjaminfair@google.com>, <yogeshgaur.83@gmail.com>, <konrad.dybcio@somainline.org>, <alim.akhtar@samsung.com>, <ldewangan@nvidia.com>, <thierry.reding@gmail.com>, <jonathanh@nvidia.com>, <michal.simek@amd.com>, <linux-aspeed@lists.ozlabs.org>, <openbmc@lists.ozlabs.org>, <linux-arm-kernel@lists.infradead.org>, <linux-rpi-kernel@lists.infradead.org>, <linux-amlogic@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <linux-arm-msm@vger.kernel.org>, <linux-rockchip@lists.infradead.org>, <linux-samsung-soc@vger.kernel.org>, <linux-stm32@st-md-mailman.stormreply.com>, <linux-sunxi@lists.linux.dev>, <linux-tegra@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-wpan@vger.kernel.org>, <libertas-dev@lists.infradead.org>, <linux-wireless@vger.kernel.org>, <linux-mtd@lists.infradead.org>, <lars@metafoo.de>, <Michael.Hennerich@analog.com>, <linux-iio@vger.kernel.org>, <michael@walle.cc>, <palmer@dabbelt.com>, <linux-riscv@lists.infradead.org>, <amitrkcian2002@gmail.com>, "Amit Kumar Mahapatra" <amit.kumar-mahapatra@amd.com> Subject: [PATCH v3 06/13] platform/x86: serial-multi-instantiate: Replace all spi->chip_select and spi->cs_gpiod references with function call Date: Thu, 2 Feb 2023 20:52:51 +0530 Message-ID: <20230202152258.512973-7-amit.kumar-mahapatra@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230202152258.512973-1-amit.kumar-mahapatra@amd.com> References: <20230202152258.512973-1-amit.kumar-mahapatra@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT057:EE_|DM6PR12MB4281:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a88d122-703e-4969-af57-08db0531c17b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VIvXZebVHSbOlimZcWrlT3HxfZJoJ3hnAuDzGuaYh6G9o1fzXahrFla2528Xa8fFTOQYvK2GEeQ9rSQmFFEUUx795+ZkdhZRLFUzKuO+PehLN2UldGA9poTG2SzhjBSVxkBLEiUT2WGx0EeuKo72UTrMyUWJLxiMwIz8HRvRYl1GURpmX2OGuxfLlnIB6yXcuk8u51H/M3O2ManmbJj3jG1WMXN5rY+ynkh+1s04cgcgIfpL2EnaCnPAX75JfZEZOEfUxs/8pW0sRJKJp935YI0lihieEbd7zheV3Saa7cxNXXHzlIvLuqDIc7Bbyu/IlD0qLv/yFVbw/oWl0aFHLhVS+U39+jOx9tmW0YB7IKCua05gdHb6hMp/2etMihOZLnq1GQL/1ELsEd+RKDXEFay2MNLDMWCAwo53zgFiDrExTb7FlqJ5juvnXHGcElamBu/srtV6iqo5R7huJzdDp3LWt4K7GEcNYWXZI9H4MZy3zr4E3rtt07rCce6MFrrMBoD0Bd/4gIKkoWoSRjRzA8K4trddtbMfXHeyOh3Un+z6ZdPc75tHUk7NNAthFHl9ZdNuGFwdfqz+fGPG8amTcP3jVQW/+woBpJShOmeEPdMOLujuEex77YbEBLVwmelkbcL7JgfpK6wMzDjsB4riGjjhz0vqjUPSSs9Tlcg+4EFwBLNH11tGKrUbwgoeqdQWtwzk9kD7BlwIupF1eG3V9u7FXJOyEICtXQfOq6uJOF4WYg6ygj5j4tGk3d2kilzcC+BlR113ySvdG6OOMhTDwUmjjdLRQiLRVR75VIB6ACrY9PJaELgodCiYXt9tTlDMhBrvH4jyLlyscJyvw0LVeA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(396003)(346002)(376002)(451199018)(36840700001)(40470700004)(46966006)(8676002)(40460700003)(36860700001)(41300700001)(478600001)(110136005)(186003)(26005)(54906003)(36756003)(1076003)(82310400005)(316002)(6666004)(5660300002)(86362001)(7336002)(7276002)(7416002)(7406005)(2906002)(7366002)(8936002)(70586007)(70206006)(4326008)(40480700001)(336012)(2616005)(426003)(83380400001)(47076005)(356005)(81166007)(921005)(82740400003)(2101003)(83996005)(41080700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 15:25:45.8827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a88d122-703e-4969-af57-08db0531c17b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4281 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756733587090617346?= X-GMAIL-MSGID: =?utf-8?q?1756733587090617346?= |
Series |
spi: Add support for stacked/parallel memories
|
|
Commit Message
Mahapatra, Amit Kumar
Feb. 2, 2023, 3:22 p.m. UTC
Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod members of struct spi_device to be an array. But changing the type of these members to array would break the spi driver functionality. To make the transition smoother introduced four new APIs to get/set the spi->chip_select & spi->cs_gpiod and replaced all spi->chip_select and spi->cs_gpiod references with get or set API calls. While adding multi-cs support in further patches the chip_select & cs_gpiod members of the spi_device structure would be converted to arrays & the "idx" parameter of the APIs would be used as array index i.e., spi->chip_select[idx] & spi->cs_gpiod[idx] respectively. Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Reviewed-by: Michal Simek <michal.simek@amd.com> --- drivers/platform/x86/serial-multi-instantiate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c index 5362f1a7b77c..270a4700d25d 100644 --- a/drivers/platform/x86/serial-multi-instantiate.c +++ b/drivers/platform/x86/serial-multi-instantiate.c @@ -139,7 +139,8 @@ static int smi_spi_probe(struct platform_device *pdev, struct smi *smi, goto error; } - dev_dbg(dev, "SPI device %s using chip select %u", name, spi_dev->chip_select); + dev_dbg(dev, "SPI device %s using chip select %u", name, + spi_get_chipselect(spi_dev, 0)); smi->spi_devs[i] = spi_dev; smi->spi_num++;