aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_bitbang.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi_bitbang.c')
-rw-r--r--drivers/spi/spi_bitbang.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index 0525c99118c3..6c3da64d609a 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -138,8 +138,7 @@ static unsigned bitbang_txrx_32(
138 return t->len - count; 138 return t->len - count;
139} 139}
140 140
141static int 141int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
142bitbang_transfer_setup(struct spi_device *spi, struct spi_transfer *t)
143{ 142{
144 struct spi_bitbang_cs *cs = spi->controller_state; 143 struct spi_bitbang_cs *cs = spi->controller_state;
145 u8 bits_per_word; 144 u8 bits_per_word;
@@ -174,6 +173,7 @@ bitbang_transfer_setup(struct spi_device *spi, struct spi_transfer *t)
174 173
175 return 0; 174 return 0;
176} 175}
176EXPORT_SYMBOL_GPL(spi_bitbang_setup_transfer);
177 177
178/** 178/**
179 * spi_bitbang_setup - default setup for per-word I/O loops 179 * spi_bitbang_setup - default setup for per-word I/O loops
@@ -203,7 +203,7 @@ int spi_bitbang_setup(struct spi_device *spi)
203 if (!cs->txrx_word) 203 if (!cs->txrx_word)
204 return -EINVAL; 204 return -EINVAL;
205 205
206 retval = bitbang_transfer_setup(spi, NULL); 206 retval = spi_bitbang_setup_transfer(spi, NULL);
207 if (retval < 0) 207 if (retval < 0)
208 return retval; 208 return retval;
209 209
@@ -454,7 +454,9 @@ int spi_bitbang_start(struct spi_bitbang *bitbang)
454 bitbang->use_dma = 0; 454 bitbang->use_dma = 0;
455 bitbang->txrx_bufs = spi_bitbang_bufs; 455 bitbang->txrx_bufs = spi_bitbang_bufs;
456 if (!bitbang->master->setup) { 456 if (!bitbang->master->setup) {
457 bitbang->setup_transfer = bitbang_transfer_setup; 457 if (!bitbang->setup_transfer)
458 bitbang->setup_transfer =
459 spi_bitbang_setup_transfer;
458 bitbang->master->setup = spi_bitbang_setup; 460 bitbang->master->setup = spi_bitbang_setup;
459 bitbang->master->cleanup = spi_bitbang_cleanup; 461 bitbang->master->cleanup = spi_bitbang_cleanup;
460 } 462 }