|
1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
2 | 2 | /* |
3 | | - * OpenCores tiny SPI master driver |
| 3 | + * OpenCores tiny SPI host driver |
4 | 4 | * |
5 | 5 | * https://opencores.org/project,tiny_spi |
6 | 6 | * |
@@ -53,7 +53,7 @@ struct tiny_spi { |
53 | 53 |
|
54 | 54 | static inline struct tiny_spi *tiny_spi_to_hw(struct spi_device *sdev) |
55 | 55 | { |
56 | | - return spi_master_get_devdata(sdev->master); |
| 56 | + return spi_controller_get_devdata(sdev->controller); |
57 | 57 | } |
58 | 58 |
|
59 | 59 | static unsigned int tiny_spi_baud(struct spi_device *spi, unsigned int hz) |
@@ -212,24 +212,24 @@ static int tiny_spi_probe(struct platform_device *pdev) |
212 | 212 | { |
213 | 213 | struct tiny_spi_platform_data *platp = dev_get_platdata(&pdev->dev); |
214 | 214 | struct tiny_spi *hw; |
215 | | - struct spi_master *master; |
| 215 | + struct spi_controller *host; |
216 | 216 | int err = -ENODEV; |
217 | 217 |
|
218 | | - master = spi_alloc_master(&pdev->dev, sizeof(struct tiny_spi)); |
219 | | - if (!master) |
| 218 | + host = spi_alloc_host(&pdev->dev, sizeof(struct tiny_spi)); |
| 219 | + if (!host) |
220 | 220 | return err; |
221 | 221 |
|
222 | | - /* setup the master state. */ |
223 | | - master->bus_num = pdev->id; |
224 | | - master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; |
225 | | - master->setup = tiny_spi_setup; |
226 | | - master->use_gpio_descriptors = true; |
| 222 | + /* setup the host state. */ |
| 223 | + host->bus_num = pdev->id; |
| 224 | + host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; |
| 225 | + host->setup = tiny_spi_setup; |
| 226 | + host->use_gpio_descriptors = true; |
227 | 227 |
|
228 | | - hw = spi_master_get_devdata(master); |
| 228 | + hw = spi_controller_get_devdata(host); |
229 | 229 | platform_set_drvdata(pdev, hw); |
230 | 230 |
|
231 | 231 | /* setup the state for the bitbang driver */ |
232 | | - hw->bitbang.master = master; |
| 232 | + hw->bitbang.master = host; |
233 | 233 | hw->bitbang.setup_transfer = tiny_spi_setup_transfer; |
234 | 234 | hw->bitbang.txrx_bufs = tiny_spi_txrx_bufs; |
235 | 235 |
|
@@ -267,17 +267,17 @@ static int tiny_spi_probe(struct platform_device *pdev) |
267 | 267 | return 0; |
268 | 268 |
|
269 | 269 | exit: |
270 | | - spi_master_put(master); |
| 270 | + spi_controller_put(host); |
271 | 271 | return err; |
272 | 272 | } |
273 | 273 |
|
274 | 274 | static void tiny_spi_remove(struct platform_device *pdev) |
275 | 275 | { |
276 | 276 | struct tiny_spi *hw = platform_get_drvdata(pdev); |
277 | | - struct spi_master *master = hw->bitbang.master; |
| 277 | + struct spi_controller *host = hw->bitbang.master; |
278 | 278 |
|
279 | 279 | spi_bitbang_stop(&hw->bitbang); |
280 | | - spi_master_put(master); |
| 280 | + spi_controller_put(host); |
281 | 281 | } |
282 | 282 |
|
283 | 283 | #ifdef CONFIG_OF |
|
0 commit comments