aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi_bitbang.c10
-rw-r--r--include/linux/spi/spi_bitbang.h2
2 files changed, 8 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 }
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index c954557b757c..16ce178f54d7 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -57,6 +57,8 @@ struct spi_bitbang {
57extern int spi_bitbang_setup(struct spi_device *spi); 57extern int spi_bitbang_setup(struct spi_device *spi);
58extern void spi_bitbang_cleanup(const struct spi_device *spi); 58extern void spi_bitbang_cleanup(const struct spi_device *spi);
59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); 59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
60extern int spi_bitbang_setup_transfer(struct spi_device *spi,
61 struct spi_transfer *t);
60 62
61/* start or stop queue processing */ 63/* start or stop queue processing */
62extern int spi_bitbang_start(struct spi_bitbang *spi); 64extern int spi_bitbang_start(struct spi_bitbang *spi);