diff options
| author | Patrice Chotard <[email protected]> | 2022-03-30 09:33:13 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-05-23 09:33:10 -0400 |
| commit | 61708bb0a24caad99b0e79de52077dafb59688d6 (patch) | |
| tree | 92509d695141d0455f7fe329a870ad57e39a6a34 /include | |
| parent | 827a232623e9b00e7d1b4b62b46e803d7168bbf5 (diff) | |
spi: spi-uclass: Add new spi_get_bus_and_cs() implementation
Move legacy spi_get_bus_and_cs() code to _spi_get_bus_and_cs().
Add new spi_get_bus_and_cs() implementation which rely on DT
for speed and mode and don't need any drv_name nor dev_name
parameters. This will prepare the ground for next patch.
Update all callers to use _spi_get_bus_and_cs() to keep the
same behavior.
Signed-off-by: Patrice Chotard <[email protected]>
Cc: Marek Behun <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Vignesh R <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Ramon Fried <[email protected]>
Cc: Lukasz Majewski <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Wolfgang Denk <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: "Pali Rohár" <[email protected]>
Cc: Konstantin Porotchkin <[email protected]>
Cc: Igal Liberman <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Pratyush Yadav <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Anji J <[email protected]>
Cc: Biwen Li <[email protected]>
Cc: Priyanka Jain <[email protected]>
Cc: Chaitanya Sakinam <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/spi.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/spi.h b/include/spi.h index fa9ab12dbef..9a8c1fb260e 100644 --- a/include/spi.h +++ b/include/spi.h @@ -572,6 +572,23 @@ int spi_find_bus_and_cs(int busnum, int cs, struct udevice **busp, * Given a bus number and chip select, this finds the corresponding bus * device and slave device. * + * @busnum: SPI bus number + * @cs: Chip select to look for + * @busp: Returns bus device + * @devp: Return slave device + * @return 0 if found, -ve on error + */ +int spi_get_bus_and_cs(int busnum, int cs, + struct udevice **busp, struct spi_slave **devp); + +/** + * _spi_get_bus_and_cs() - Find and activate bus and slave devices by number + * As spi_flash_probe(), This is an old-style function. We should remove + * it when all SPI flash drivers use dm + * + * Given a bus number and chip select, this finds the corresponding bus + * device and slave device. + * * If no such slave exists, and drv_name is not NULL, then a new slave device * is automatically bound on this chip select with requested speed and mode. * @@ -588,7 +605,7 @@ int spi_find_bus_and_cs(int busnum, int cs, struct udevice **busp, * @devp: Return slave device * Return: 0 if found, -ve on error */ -int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode, +int _spi_get_bus_and_cs(int busnum, int cs, int speed, int mode, const char *drv_name, const char *dev_name, struct udevice **busp, struct spi_slave **devp); |
