Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE8EBC433EF for ; Thu, 5 May 2022 15:33:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B681F83FE4; Thu, 5 May 2022 17:33:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sancloud.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=sancloud.onmicrosoft.com header.i=@sancloud.onmicrosoft.com header.b="JbAHdlhK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B56D483FC3; Thu, 5 May 2022 17:33:04 +0200 (CEST) Received: from GBR01-CWL-obe.outbound.protection.outlook.com (mail-cwlgbr01on0713.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe14::713]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B69C83FD3 for ; Thu, 5 May 2022 17:32:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sancloud.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=paul.barker@sancloud.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JbiJ4wANiy01vtC4I3i7hj1VJ1pZGU2UYFWZP9p9sU/JnTRFl2Fa2GLc4Hl8bkfH+Peid5yYbwrUKfcTp2WHHY99OCyk8C72SlV5nfgRIfbQW/RPj2vm0WEfsX3sBEAnBlRiyI6AMMr+5dpqS3Qf+vyYBZd9zcnXysYVPoU9QILv2TYFl5pWzAXWw3NwxFeQt0N4S7/LnFcSwqW+vjAmMNGdU2hyZ5AuyB4V7z8iCznwma01+Ud2mhGQ7kdyVO9Rm8CYIjB5uYUto+IL9JM+0gA5a75svzA5Ku2dIsFpf0XSVcBhz4yi5BhxunauUPP6lPOtrp3YXgc/fTN5MVqdpw== 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=cAd7vKk1dK7yOoGgxY2jcjjhGhgkvnbC+ttzI2HKudU=; b=DJ55Ahr6prRjdxmL8ERJoiBNOJYGB/BZh79R85mTd5qT9xhI+vWRBjY0iPPDL6oqHSJSZlaKkukRjhG2plCM4xeGWcb2073gx/gtcO/HdMbIBz8oAmBwA6wVVhouaQ9pwF3dvlE4rBN8HssPJ2zNI2V/oAumEmdpw+J6GvwYmstr0mC9RY3XgDRLBjPdatHbMFzKe7xq7zfm8Ln7gbUsM5Xx0Pv7XUJoEC5ZsUhuU0jpWuRfeNEf4xGqLXf0OyCD6ZEC30rpSnK0Q0lqDya8FwP+szI/4oTYIy+wsrZvuIUjjZQ3KvaTugoSeiOMcpHYSVOcj3naexgfraKRzUtqBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sancloud.com; dmarc=pass action=none header.from=sancloud.com; dkim=pass header.d=sancloud.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sancloud.onmicrosoft.com; s=selector2-sancloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cAd7vKk1dK7yOoGgxY2jcjjhGhgkvnbC+ttzI2HKudU=; b=JbAHdlhKihscv+B7qlW6khqy8xLmMtCGY6bjiCZfss6GNX7tETWYMI9xPGe/JpJf8gwR/jjbOsvEHyEeyCDsVtMBwd+muxFVFwQXwMRQeJO3zzbvioreF15cfyxaPtn5lXqLAjyt4mKwGVpK3U/sQWPQAgiJeitFeEFRvnL5Nuw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=sancloud.com; Received: from CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:7e::18) by CWXP123MB3365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Thu, 5 May 2022 15:32:57 +0000 Received: from CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM ([fe80::b051:6529:e2a3:887f]) by CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM ([fe80::b051:6529:e2a3:887f%7]) with mapi id 15.20.5206.025; Thu, 5 May 2022 15:32:57 +0000 From: Paul Barker To: u-boot@lists.denx.de Cc: Paul Barker Subject: [PATCH 3/3] exports: Fix export of SPI access functions Date: Thu, 5 May 2022 15:32:42 +0000 Message-Id: <20220505153242.1598807-4-paul.barker@sancloud.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220505153242.1598807-1-paul.barker@sancloud.com> References: <20220505153242.1598807-1-paul.barker@sancloud.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO4P123CA0263.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::16) To CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:7e::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13370ff0-1333-479b-fa4b-08da2eac87f2 X-MS-TrafficTypeDiagnostic: CWXP123MB3365:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jd4JyCMSqrE6u5qHXg3dBzPLBOJrqMc+zrqC1Fd8umwMoYd8liQsCObfGiw1dd9vhFR90LkPQyL6ZyUi8o4lN5gr5Am8eBuUaETIYGDqNdFaH5qTU7yT8SUKM5qV6JG/8Hr1VqeAm29cO9GP2h2QIXEfLI90KFGG8O+/uTGYYFI5G9hn99rspQhR6E4dll7VXMWQJo9Q076MptqeRiich6OVSxu5RjsSVrTcdRl8bWLO2cJOQBe9GZmjGeY61zrKN70yepkSfSZ6gDnLjcdtJ5+DtL1kdDveRT0w8Y9JITNhMt/VGBUN7N0CNEjjtTSQoUJwP1W72Rgk6iYeJqVP4HoHu+xgmFh3lNi1Vy8p4oQWAICITusss7mN5paRSJlok8nRgHejrwVQZkP14Aap69Uc4PN0dPKSRH3OlTYF8jBVxfajR5PNB4VZ+f8aCCY4ZFT88r9zVtV1k2Zm8W9ezq1vqXRs7pr2cmBCCTC0088T0KZ5ASs7Zhg7aGvixm5ZapKNyTK/XsVGZBDUj7PzMdXYeUJ7NXHA4HPB/WpRmf+zEQecIf6pQKG45VJBE5JdBp4KaFzcNQd4cl6bo91vUQnspKKQSOKInI6njpX+NAZHr96FhxQXPm/5hgTtb2ymLcMcXvR5cXPhi3EmVQXjNlyhW8HRL2lQd5OVSbBEvQEDst5LiCeAWOUzbuQ4wK+ad5M3y2GfcYTaBz6eyR08XQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(396003)(39830400003)(346002)(366004)(136003)(376002)(26005)(6512007)(6506007)(8936002)(86362001)(44832011)(52116002)(186003)(2906002)(2616005)(83380400001)(36756003)(107886003)(1076003)(508600001)(8676002)(66556008)(6486002)(4326008)(66946007)(66476007)(5660300002)(6666004)(6916009)(316002)(38350700002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QLmgjhmTMo/bw8TA9CWpvu/JtR3XrNfVT+N724UVBB3nre3ggdh5bGOxmYN2?= =?us-ascii?Q?Rv/GrbQnjlRnIm3m8KfeRW7IQDbUoyGS/LE6q+WkrKQVKB2DNiVKzolOU5Rp?= =?us-ascii?Q?TMv6AaEXOIt6hN8UdjRpwXmeOECk7nr5rFU3upi/guL0ocwp7cKQukniR7mX?= =?us-ascii?Q?lNjpJl6jrHW8zIG+UR9b6KM7Nmoq94PJ0P5FOuMzgMGgNfI68LxDfvc99zOa?= =?us-ascii?Q?cWGOFM1NLbr3D2cfv/AvDTjF1F7jp0uW+zwPoCpL3cUbDwxPE29IYQTtbwZ8?= =?us-ascii?Q?CClK+F4PJ3Z1lqnk2x1zr/l5NdU6wX+q1OU1RthVcddjcTIBMfUikQ3JQE0o?= =?us-ascii?Q?Z4rdJBSDMzERPb1AiAE7h1nNSyqiirziFWVuwJmNr9xgoL7QHLGkFtH+ZfsB?= =?us-ascii?Q?NNTT1snbV3Oo1kjetLXphJJyAGXaLqJXwRjTVayMI8N+LLF890wwxYNjA/GK?= =?us-ascii?Q?GqvEpVkU21T7x+Tv3odkIqwma6I3XUyvcJXi3kYAjvkCav4w1kU8BPQITCgh?= =?us-ascii?Q?1sAFGYcOpq1BOVX5DRiU6FxqhwS0Ed+kqTDigeuHROawQfYtcsEqR8Hm5xMP?= =?us-ascii?Q?aopDD/ODkPWviEYyD3WC48LYNkUNfvCr68LC4yUqSS5V+U5qrt1aJNlV8NYh?= =?us-ascii?Q?2s8579fzVgMzmT34j5JE/TCU+RLRRPwQO1Pl2CxNog7KsNmwM9YnpdKPoaeL?= =?us-ascii?Q?nIyYdqgpoXsbT+rN7IP/rGyVOxaXFNgHFfPCQc36+tS4JgqXD4gB0jHOMb8M?= =?us-ascii?Q?bl+ArFIecaJcOsNiuQPOe2cd6A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9R8Vesp5glNik+fBssDKXATn+w2M9rFt3i15h//YAK1pmGWq4WfpewPLWCC?= =?us-ascii?Q?qNlv5aK6pmbjLKGlsYfIDtf/qeP/Dy0=3D?= X-OriginatorOrg: sancloud.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13370ff0-1333-479b-fa4b-08da2eac87f2 X-MS-Exchange-CrossTenant-AuthSource: CWXP123MB2248.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2022 15:32:57.7228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 840be37c-244a-450e-9bcc-2064862de1f4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qlgNoxfcmiNigZ5qauVZE7uYpzwN0tAmahwLWBhS7Ym6HhwLMiLU20+e2wLjoWE2+SWuRmJEnNeXIcBjd7FKmmHGHjG2hSpAge6zWTYSXGc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3365 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean * With CONFIG_DM_SPI defined, spi_get_bus_and_cs needs to be used instead of spi_setup_slave to configure a SPI bus. As spi_setup_slave is already present in the export list it is reasonable to also export spi_get_bus_and_cs. * For the functions listed in the jump table to be callable they must also be defined in the "exports.h" header. Define the various exported SPI functions so that they can be used. Signed-off-by: Paul Barker --- include/_exports.h | 4 ++++ include/exports.h | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/_exports.h b/include/_exports.h index f6df8b610734..3457a92c95ad 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -60,11 +60,15 @@ EXPORT_FUNC(dummy, void, spi_claim_bus, void) EXPORT_FUNC(dummy, void, spi_release_bus, void) EXPORT_FUNC(dummy, void, spi_xfer, void) + EXPORT_FUNC(dummy, void, spi_get_bus_and_cs, void) #else EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *) EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *) EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *, unsigned int, const void *, void *, unsigned long) + EXPORT_FUNC(spi_get_bus_and_cs, int, spi_get_bus_and_cs, int, int, int, + int, const char *, const char *, struct udevice **, + struct spi_slave **) #endif EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul, const char *, char **, unsigned int) diff --git a/include/exports.h b/include/exports.h index 6f8c9cf4517e..93110d63a235 100644 --- a/include/exports.h +++ b/include/exports.h @@ -53,6 +53,19 @@ unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); int i2c_write (uchar, uint, int , uchar* , int); int i2c_read (uchar, uint, int , uchar* , int); #endif +#ifdef CONFIG_CMD_SPI +#ifndef CONFIG_DM_SPI +struct spi_slave * spi_setup_slave(unsigned int, unsigned int, + unsigned int, unsigned int); +void spi_free_slave(struct spi_slave *); +#endif +int spi_claim_bus(struct spi_slave *); +void spi_release_bus(struct spi_slave *); +int spi_xfer(struct spi_slave *, unsigned int, const void *, void *, + unsigned long); +int spi_get_bus_and_cs(int, int, int, int, const char *, const char *, + struct udevice **, struct spi_slave **); +#endif #ifdef CONFIG_PHY_AQUANTIA struct mii_dev *mdio_get_current_dev(void); struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask); @@ -71,7 +84,7 @@ struct jt_funcs { }; -#define XF_VERSION 9 +#define XF_VERSION 10 #if defined(CONFIG_X86) extern gd_t *global_data; -- 2.25.1