[v3,03/13] iio: imu: Replace all spi->chip_select and spi->cs_gpiod references with function call
Message ID | 20230202152258.512973-4-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 s9csp302971wrn; Thu, 2 Feb 2023 07:27:27 -0800 (PST) X-Google-Smtp-Source: AK7set/oypAPUaiNF4AtPMQpxRgomTrRisi5kztS1gP3A4gqMvBPHFOfG2/ao/kIXhy4t2MtD/Ie X-Received: by 2002:aa7:c448:0:b0:4a0:af87:b3ab with SMTP id n8-20020aa7c448000000b004a0af87b3abmr5950901edr.36.1675351647138; Thu, 02 Feb 2023 07:27:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675351647; cv=pass; d=google.com; s=arc-20160816; b=u9ME9GUnNMfuMqw2BsQD/fYMPH0aLcXmh8/aSMjg6wvXWdzKEUdCUebm4WT+lwiMG1 IxvXljs1nxYeKB0jFrOZTemmPhu/JCikza3U+oYp99ATBqylx3HmYsu5FBKh7IPGhZHf GYcspE4KEsF3tQRWkJa6NHdiVDmAoxMT4DngN9SMs1l6NJ4c5SLexrMIPeQWDpwGnhvo Jne6kuOCjJpKitvOW/Z+aBefgxn4TU+AIcZgA0BMMVK7lXdc2DF8JEcEQVpfoXwPhcLE tEAq0Vu44O8uED/yzMDLDugQkM7+ZIibDWIIt4WSurd9HGoKRuAUzV70h8v+9m7ZueIG 89rw== 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=PGTDv9j62eqAAUbZYCqOwhh6o6pzCwATcSrO/Vzqvog=; b=UvVoitlQYCPz9URG1rOZKliMct781VBXW1ekCNLl4eGdKmPF0otqhAgTBh3uU8FhbR IY3j7Gr3qoTemHsG+mXCfcw2X7NR1OjuT1LRnVds8px9BWfWmptCttEgPtlhTVLhEyM+ tJZlmTQaSnavj0foFC2QnC7UzQ5WIphya8QACSrfenKkPt0QiOsEwYjeo8NFBqfCvg6k h+dlK1yIqWz+2bHX9u0mvNMFNBVLdughq06CZ76QqexczxOQX/o+oP8GvJg23j/+iZon mgGT+CQOqmoN81tLzArv5QXFyqWvB9XihWY+8tKknRxaFH3dTQmbwlPhmZUIrAI0VY1o lFvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=L5iF4U+I; 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 r6-20020a50aac6000000b0049f1fc7bdbcsi26280928edc.624.2023.02.02.07.27.03; Thu, 02 Feb 2023 07:27:27 -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=L5iF4U+I; 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 S232766AbjBBPZI (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 10:25:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232773AbjBBPZE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 10:25:04 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E32FC7BBD0; Thu, 2 Feb 2023 07:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ev/O48TNktY2LQ7KVMdoTyuDCUYidgCmMvYrvhBHAmJedZzKGPINQlvcorh+KXsCo46eEMMTLJVw89r1HACYASw5vmalMbrp/34f3tWDPBb6WJ5sj4FWGvu9EAvBWWgLR1ilf4inrKD/UVrTi3SmIc+fDg9odRY7oj2lyZbJ7NUOZAbs69xfGWT32i5OiQeRoMGxE3j4uZDGaaTkC6KHk+JhXbzHE7PwoAkXCwn81dig7UgkFB7xiIR7P8LQaneKQf88W0m04jj1SK+8BBmwKbcyPxWUCu5CASYvxDKkjkiq0/XxvD4pa2IdtSyYT+tEt4RnrAwnifPRfi3tlrNw1Q== 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=PGTDv9j62eqAAUbZYCqOwhh6o6pzCwATcSrO/Vzqvog=; b=WBoZrnBPm0ao9wVVa66WSPo6h9VTEC9fzirZcYsIVfcbdp7M1BRfLnFxalHsXQMSTBlFaq8QLh1S8+bjNC3tyz9OTNCv6szTq9/2IuIH/eOgy+IJYcITW6Kk9lzwa4JQwUX792CovNOrRUaMnSApKQGJMMeVVFWXlbQMJwrfhURrAKUGpqjObt/8Tvag5cVMUnGyYaTEJsAeyIXne3/roV7CxnbunEEXLYjRiVZiTTO62Wi6YanqqUOCMJCCHraanSs5ZKfAYw/8ajgLXKlisYJ3VkR2smJ/7UMgDJLhoY7h15nPu/TJUeGlu9ZcjCyVsSAFD81w7A1iHWKAeuZVvA== 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=PGTDv9j62eqAAUbZYCqOwhh6o6pzCwATcSrO/Vzqvog=; b=L5iF4U+IDDkZicVpfftyA8zbKDPlUsGPtZinXIQ4DxbeH44qVGqH02EmF/X0AOuud2Qr6g+WgoAtjW5SBmvdV8HWHcY106M8Q4+Pt/YnW2ybKq2Q36k55Lo0LYP4WGIl0oyJoRtZrpeh8Bi79vI7bQBM218/Z+yP8pVkiADxtfc= Received: from BLAPR03CA0143.namprd03.prod.outlook.com (2603:10b6:208:32e::28) by IA1PR12MB7639.namprd12.prod.outlook.com (2603:10b6:208:425::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 15:24:36 +0000 Received: from BL02EPF000108E8.namprd05.prod.outlook.com (2603:10b6:208:32e:cafe::b1) by BLAPR03CA0143.outlook.office365.com (2603:10b6:208:32e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 15:24:36 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000108E8.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 15:24:36 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) 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:24:35 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) 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:24:34 -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:24:11 -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>, Jonathan Cameron <Jonathan.Cameron@huawei.com> Subject: [PATCH v3 03/13] iio: imu: Replace all spi->chip_select and spi->cs_gpiod references with function call Date: Thu, 2 Feb 2023 20:52:48 +0530 Message-ID: <20230202152258.512973-4-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: BL02EPF000108E8:EE_|IA1PR12MB7639:EE_ X-MS-Office365-Filtering-Correlation-Id: 5facfa65-2e2b-4168-0eb4-08db0531980b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GlyeNtdz/Z+LYUCQe4903VfYoFsis1f7gkPTbQ6kBFgAy/HWx2Ign8NXCqUw205zDKpX6d6tj+UVJDFrrFF8yxbEtSglCIsb9A2ivwuTIDqtlX0yOZ2AALYCzlIfoSLcD+9Cbrurr2d0kTv8Yy6XozuNnuM9kxNC8PsTh7bqZndtozmpH/gDMg7vZYAjgvPvzphP3L8cQPe9IDfgx8kDvWHAJ8YyuzNSmN7JWdQsx7lHrp9rvgzifqO0vOhFLvilxWmA52itFD4xoRzJgV2qLfzZP9eJeVdBWlKoaHpQNQAzJaouyIj8+2YShUEnkg5z2FYpPX6OOc+g9zEwvpX1sdx9S09fnjn9CEhIGN4sHXALNiLNmbNP5Kh/4HcLgWUEV6QIYIIoDzNcz35Ve0UF+mF2fajxKPgNHMXu9eTVFNO9OOi/+uuO/n05YWxRIDR27tSwMaPbJM7aVMJgWiy2Exabu/V163cGfuzJIVnYtu1cfgF1C24R96kPYQ/101gb7fGsfvlzQbhyldfRaloejN9MMxDYFJqRZ2thSdT+c43A2ISatHR32FPbLJ2K9Z4rvzH/tUwviRDtVx42SUN2DvB3cH20XCnayASwZR/rw5htb/o0WHDrR4HxLhRTYjV525Cyunxn7QeOzplbalGWHKbvx6w2sxak1WcdgZdG2rSxEvHri4TmYIT1suNEW2WqcyqkrKPLUiW7C6qfNreVi5PcPYvw/nKIqa3J6Vhl4GB6E+gRUehu2+5CtRYFcZp39CTMQy0bBwVuMFAUCzPrqBFBf6qFE6YjOgo/Z0H85keJ2J5Uu2zVDdARBA97RwA1PJLh+UFEEfZ4V9Z1PtF1Ag== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199018)(36840700001)(40470700004)(46966006)(8936002)(7366002)(316002)(7336002)(82310400005)(1076003)(82740400003)(6666004)(478600001)(336012)(2616005)(86362001)(356005)(186003)(81166007)(426003)(921005)(40460700003)(36756003)(7406005)(26005)(47076005)(5660300002)(110136005)(36860700001)(2906002)(7276002)(40480700001)(4326008)(8676002)(70586007)(54906003)(41300700001)(70206006)(7416002)(83380400001)(36900700001)(41080700001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 15:24:36.1861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5facfa65-2e2b-4168-0eb4-08db0531980b 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000108E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7639 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?1756733528781931818?= X-GMAIL-MSGID: =?utf-8?q?1756733528781931818?= |
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> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Michal Simek <michal.simek@amd.com> --- drivers/iio/imu/adis16400.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c index c02fc35dceb4..3eda32e12a53 100644 --- a/drivers/iio/imu/adis16400.c +++ b/drivers/iio/imu/adis16400.c @@ -466,7 +466,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) dev_info(&indio_dev->dev, "%s: prod_id 0x%04x at CS%d (irq %d)\n", indio_dev->name, prod_id, - st->adis.spi->chip_select, st->adis.spi->irq); + spi_get_chipselect(st->adis.spi, 0), st->adis.spi->irq); } /* use high spi speed if possible */ if (st->variant->flags & ADIS16400_HAS_SLOW_MODE) {