diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-01 08:48:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-01 08:48:44 -0400 |
commit | b29bc3df37afa440290f4b8e50cf5dce429ce22f (patch) | |
tree | 2ba216f8d2e3157c535a3535d821133f977e7067 | |
parent | c3dbe2b76a835fb4b2633645b0c49359b49eb128 (diff) | |
parent | 2e29db400c4898ff72e2ea87d262921df00f1c87 (diff) |
Merge remote-tracking branch 'spi/topic/bitbang' into spi-next
-rw-r--r-- | drivers/spi/spi-altera.c | 12 | ||||
-rw-r--r-- | drivers/spi/spi-bitbang.c | 260 | ||||
-rw-r--r-- | drivers/spi/spi-nuc900.c | 13 | ||||
-rw-r--r-- | drivers/spi/spi-xilinx.c | 16 | ||||
-rw-r--r-- | include/linux/spi/spi_bitbang.h | 5 |
5 files changed, 113 insertions, 193 deletions
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c index 523f2f649e26..156eb888655e 100644 --- a/drivers/spi/spi-altera.c +++ b/drivers/spi/spi-altera.c | |||
@@ -103,16 +103,6 @@ static void altera_spi_chipsel(struct spi_device *spi, int value) | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | static int altera_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static int altera_spi_setup(struct spi_device *spi) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static inline unsigned int hw_txbyte(struct altera_spi *hw, int count) | 106 | static inline unsigned int hw_txbyte(struct altera_spi *hw, int count) |
117 | { | 107 | { |
118 | if (hw->tx) { | 108 | if (hw->tx) { |
@@ -224,7 +214,6 @@ static int altera_spi_probe(struct platform_device *pdev) | |||
224 | master->bus_num = pdev->id; | 214 | master->bus_num = pdev->id; |
225 | master->num_chipselect = 16; | 215 | master->num_chipselect = 16; |
226 | master->mode_bits = SPI_CS_HIGH; | 216 | master->mode_bits = SPI_CS_HIGH; |
227 | master->setup = altera_spi_setup; | ||
228 | 217 | ||
229 | hw = spi_master_get_devdata(master); | 218 | hw = spi_master_get_devdata(master); |
230 | platform_set_drvdata(pdev, hw); | 219 | platform_set_drvdata(pdev, hw); |
@@ -233,7 +222,6 @@ static int altera_spi_probe(struct platform_device *pdev) | |||
233 | hw->bitbang.master = spi_master_get(master); | 222 | hw->bitbang.master = spi_master_get(master); |
234 | if (!hw->bitbang.master) | 223 | if (!hw->bitbang.master) |
235 | return err; | 224 | return err; |
236 | hw->bitbang.setup_transfer = altera_spi_setupxfer; | ||
237 | hw->bitbang.chipselect = altera_spi_chipsel; | 225 | hw->bitbang.chipselect = altera_spi_chipsel; |
238 | hw->bitbang.txrx_bufs = altera_spi_txrx; | 226 | hw->bitbang.txrx_bufs = altera_spi_txrx; |
239 | 227 | ||
diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index a63d7da3bfe2..e3946e44e076 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c | |||
@@ -255,150 +255,140 @@ static int spi_bitbang_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
255 | * Drivers can provide word-at-a-time i/o primitives, or provide | 255 | * Drivers can provide word-at-a-time i/o primitives, or provide |
256 | * transfer-at-a-time ones to leverage dma or fifo hardware. | 256 | * transfer-at-a-time ones to leverage dma or fifo hardware. |
257 | */ | 257 | */ |
258 | static void bitbang_work(struct work_struct *work) | 258 | |
259 | static int spi_bitbang_prepare_hardware(struct spi_master *spi) | ||
259 | { | 260 | { |
260 | struct spi_bitbang *bitbang = | 261 | struct spi_bitbang *bitbang; |
261 | container_of(work, struct spi_bitbang, work); | ||
262 | unsigned long flags; | 262 | unsigned long flags; |
263 | struct spi_message *m, *_m; | 263 | |
264 | bitbang = spi_master_get_devdata(spi); | ||
264 | 265 | ||
265 | spin_lock_irqsave(&bitbang->lock, flags); | 266 | spin_lock_irqsave(&bitbang->lock, flags); |
266 | bitbang->busy = 1; | 267 | bitbang->busy = 1; |
267 | list_for_each_entry_safe(m, _m, &bitbang->queue, queue) { | 268 | spin_unlock_irqrestore(&bitbang->lock, flags); |
268 | struct spi_device *spi; | ||
269 | unsigned nsecs; | ||
270 | struct spi_transfer *t = NULL; | ||
271 | unsigned tmp; | ||
272 | unsigned cs_change; | ||
273 | int status; | ||
274 | int do_setup = -1; | ||
275 | |||
276 | list_del(&m->queue); | ||
277 | spin_unlock_irqrestore(&bitbang->lock, flags); | ||
278 | |||
279 | /* FIXME this is made-up ... the correct value is known to | ||
280 | * word-at-a-time bitbang code, and presumably chipselect() | ||
281 | * should enforce these requirements too? | ||
282 | */ | ||
283 | nsecs = 100; | ||
284 | 269 | ||
285 | spi = m->spi; | 270 | return 0; |
286 | tmp = 0; | 271 | } |
287 | cs_change = 1; | ||
288 | status = 0; | ||
289 | 272 | ||
290 | list_for_each_entry (t, &m->transfers, transfer_list) { | 273 | static int spi_bitbang_transfer_one(struct spi_master *master, |
291 | 274 | struct spi_message *m) | |
292 | /* override speed or wordsize? */ | 275 | { |
293 | if (t->speed_hz || t->bits_per_word) | 276 | struct spi_bitbang *bitbang; |
294 | do_setup = 1; | 277 | unsigned nsecs; |
295 | 278 | struct spi_transfer *t = NULL; | |
296 | /* init (-1) or override (1) transfer params */ | 279 | unsigned cs_change; |
297 | if (do_setup != 0) { | 280 | int status; |
298 | status = bitbang->setup_transfer(spi, t); | 281 | int do_setup = -1; |
299 | if (status < 0) | 282 | struct spi_device *spi = m->spi; |
300 | break; | 283 | |
301 | if (do_setup == -1) | 284 | bitbang = spi_master_get_devdata(master); |
302 | do_setup = 0; | 285 | |
303 | } | 286 | /* FIXME this is made-up ... the correct value is known to |
304 | 287 | * word-at-a-time bitbang code, and presumably chipselect() | |
305 | /* set up default clock polarity, and activate chip; | 288 | * should enforce these requirements too? |
306 | * this implicitly updates clock and spi modes as | 289 | */ |
307 | * previously recorded for this device via setup(). | 290 | nsecs = 100; |
308 | * (and also deselects any other chip that might be | ||
309 | * selected ...) | ||
310 | */ | ||
311 | if (cs_change) { | ||
312 | bitbang->chipselect(spi, BITBANG_CS_ACTIVE); | ||
313 | ndelay(nsecs); | ||
314 | } | ||
315 | cs_change = t->cs_change; | ||
316 | if (!t->tx_buf && !t->rx_buf && t->len) { | ||
317 | status = -EINVAL; | ||
318 | break; | ||
319 | } | ||
320 | 291 | ||
321 | /* transfer data. the lower level code handles any | 292 | cs_change = 1; |
322 | * new dma mappings it needs. our caller always gave | 293 | status = 0; |
323 | * us dma-safe buffers. | 294 | |
324 | */ | 295 | list_for_each_entry (t, &m->transfers, transfer_list) { |
325 | if (t->len) { | 296 | |
326 | /* REVISIT dma API still needs a designated | 297 | /* override speed or wordsize? */ |
327 | * DMA_ADDR_INVALID; ~0 might be better. | 298 | if (t->speed_hz || t->bits_per_word) |
328 | */ | 299 | do_setup = 1; |
329 | if (!m->is_dma_mapped) | 300 | |
330 | t->rx_dma = t->tx_dma = 0; | 301 | /* init (-1) or override (1) transfer params */ |
331 | status = bitbang->txrx_bufs(spi, t); | 302 | if (do_setup != 0) { |
332 | } | 303 | status = bitbang->setup_transfer(spi, t); |
333 | if (status > 0) | 304 | if (status < 0) |
334 | m->actual_length += status; | ||
335 | if (status != t->len) { | ||
336 | /* always report some kind of error */ | ||
337 | if (status >= 0) | ||
338 | status = -EREMOTEIO; | ||
339 | break; | 305 | break; |
340 | } | 306 | if (do_setup == -1) |
341 | status = 0; | 307 | do_setup = 0; |
342 | |||
343 | /* protocol tweaks before next transfer */ | ||
344 | if (t->delay_usecs) | ||
345 | udelay(t->delay_usecs); | ||
346 | |||
347 | if (cs_change && !list_is_last(&t->transfer_list, &m->transfers)) { | ||
348 | /* sometimes a short mid-message deselect of the chip | ||
349 | * may be needed to terminate a mode or command | ||
350 | */ | ||
351 | ndelay(nsecs); | ||
352 | bitbang->chipselect(spi, BITBANG_CS_INACTIVE); | ||
353 | ndelay(nsecs); | ||
354 | } | ||
355 | } | 308 | } |
356 | 309 | ||
357 | m->status = status; | 310 | /* set up default clock polarity, and activate chip; |
358 | m->complete(m->context); | 311 | * this implicitly updates clock and spi modes as |
312 | * previously recorded for this device via setup(). | ||
313 | * (and also deselects any other chip that might be | ||
314 | * selected ...) | ||
315 | */ | ||
316 | if (cs_change) { | ||
317 | bitbang->chipselect(spi, BITBANG_CS_ACTIVE); | ||
318 | ndelay(nsecs); | ||
319 | } | ||
320 | cs_change = t->cs_change; | ||
321 | if (!t->tx_buf && !t->rx_buf && t->len) { | ||
322 | status = -EINVAL; | ||
323 | break; | ||
324 | } | ||
359 | 325 | ||
360 | /* normally deactivate chipselect ... unless no error and | 326 | /* transfer data. the lower level code handles any |
361 | * cs_change has hinted that the next message will probably | 327 | * new dma mappings it needs. our caller always gave |
362 | * be for this chip too. | 328 | * us dma-safe buffers. |
363 | */ | 329 | */ |
364 | if (!(status == 0 && cs_change)) { | 330 | if (t->len) { |
331 | /* REVISIT dma API still needs a designated | ||
332 | * DMA_ADDR_INVALID; ~0 might be better. | ||
333 | */ | ||
334 | if (!m->is_dma_mapped) | ||
335 | t->rx_dma = t->tx_dma = 0; | ||
336 | status = bitbang->txrx_bufs(spi, t); | ||
337 | } | ||
338 | if (status > 0) | ||
339 | m->actual_length += status; | ||
340 | if (status != t->len) { | ||
341 | /* always report some kind of error */ | ||
342 | if (status >= 0) | ||
343 | status = -EREMOTEIO; | ||
344 | break; | ||
345 | } | ||
346 | status = 0; | ||
347 | |||
348 | /* protocol tweaks before next transfer */ | ||
349 | if (t->delay_usecs) | ||
350 | udelay(t->delay_usecs); | ||
351 | |||
352 | if (cs_change && !list_is_last(&t->transfer_list, &m->transfers)) { | ||
353 | /* sometimes a short mid-message deselect of the chip | ||
354 | * may be needed to terminate a mode or command | ||
355 | */ | ||
365 | ndelay(nsecs); | 356 | ndelay(nsecs); |
366 | bitbang->chipselect(spi, BITBANG_CS_INACTIVE); | 357 | bitbang->chipselect(spi, BITBANG_CS_INACTIVE); |
367 | ndelay(nsecs); | 358 | ndelay(nsecs); |
368 | } | 359 | } |
360 | } | ||
361 | |||
362 | m->status = status; | ||
369 | 363 | ||
370 | spin_lock_irqsave(&bitbang->lock, flags); | 364 | /* normally deactivate chipselect ... unless no error and |
365 | * cs_change has hinted that the next message will probably | ||
366 | * be for this chip too. | ||
367 | */ | ||
368 | if (!(status == 0 && cs_change)) { | ||
369 | ndelay(nsecs); | ||
370 | bitbang->chipselect(spi, BITBANG_CS_INACTIVE); | ||
371 | ndelay(nsecs); | ||
371 | } | 372 | } |
372 | bitbang->busy = 0; | 373 | |
373 | spin_unlock_irqrestore(&bitbang->lock, flags); | 374 | spi_finalize_current_message(master); |
375 | |||
376 | return status; | ||
374 | } | 377 | } |
375 | 378 | ||
376 | /** | 379 | static int spi_bitbang_unprepare_hardware(struct spi_master *spi) |
377 | * spi_bitbang_transfer - default submit to transfer queue | ||
378 | */ | ||
379 | int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m) | ||
380 | { | 380 | { |
381 | struct spi_bitbang *bitbang; | 381 | struct spi_bitbang *bitbang; |
382 | unsigned long flags; | 382 | unsigned long flags; |
383 | int status = 0; | ||
384 | 383 | ||
385 | m->actual_length = 0; | 384 | bitbang = spi_master_get_devdata(spi); |
386 | m->status = -EINPROGRESS; | ||
387 | |||
388 | bitbang = spi_master_get_devdata(spi->master); | ||
389 | 385 | ||
390 | spin_lock_irqsave(&bitbang->lock, flags); | 386 | spin_lock_irqsave(&bitbang->lock, flags); |
391 | if (!spi->max_speed_hz) | 387 | bitbang->busy = 0; |
392 | status = -ENETDOWN; | ||
393 | else { | ||
394 | list_add_tail(&m->queue, &bitbang->queue); | ||
395 | queue_work(bitbang->workqueue, &bitbang->work); | ||
396 | } | ||
397 | spin_unlock_irqrestore(&bitbang->lock, flags); | 388 | spin_unlock_irqrestore(&bitbang->lock, flags); |
398 | 389 | ||
399 | return status; | 390 | return 0; |
400 | } | 391 | } |
401 | EXPORT_SYMBOL_GPL(spi_bitbang_transfer); | ||
402 | 392 | ||
403 | /*----------------------------------------------------------------------*/ | 393 | /*----------------------------------------------------------------------*/ |
404 | 394 | ||
@@ -428,20 +418,22 @@ EXPORT_SYMBOL_GPL(spi_bitbang_transfer); | |||
428 | int spi_bitbang_start(struct spi_bitbang *bitbang) | 418 | int spi_bitbang_start(struct spi_bitbang *bitbang) |
429 | { | 419 | { |
430 | struct spi_master *master = bitbang->master; | 420 | struct spi_master *master = bitbang->master; |
431 | int status; | ||
432 | 421 | ||
433 | if (!master || !bitbang->chipselect) | 422 | if (!master || !bitbang->chipselect) |
434 | return -EINVAL; | 423 | return -EINVAL; |
435 | 424 | ||
436 | INIT_WORK(&bitbang->work, bitbang_work); | ||
437 | spin_lock_init(&bitbang->lock); | 425 | spin_lock_init(&bitbang->lock); |
438 | INIT_LIST_HEAD(&bitbang->queue); | ||
439 | 426 | ||
440 | if (!master->mode_bits) | 427 | if (!master->mode_bits) |
441 | master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags; | 428 | master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags; |
442 | 429 | ||
443 | if (!master->transfer) | 430 | if (master->transfer || master->transfer_one_message) |
444 | master->transfer = spi_bitbang_transfer; | 431 | return -EINVAL; |
432 | |||
433 | master->prepare_transfer_hardware = spi_bitbang_prepare_hardware; | ||
434 | master->unprepare_transfer_hardware = spi_bitbang_unprepare_hardware; | ||
435 | master->transfer_one_message = spi_bitbang_transfer_one; | ||
436 | |||
445 | if (!bitbang->txrx_bufs) { | 437 | if (!bitbang->txrx_bufs) { |
446 | bitbang->use_dma = 0; | 438 | bitbang->use_dma = 0; |
447 | bitbang->txrx_bufs = spi_bitbang_bufs; | 439 | bitbang->txrx_bufs = spi_bitbang_bufs; |
@@ -452,34 +444,12 @@ int spi_bitbang_start(struct spi_bitbang *bitbang) | |||
452 | master->setup = spi_bitbang_setup; | 444 | master->setup = spi_bitbang_setup; |
453 | master->cleanup = spi_bitbang_cleanup; | 445 | master->cleanup = spi_bitbang_cleanup; |
454 | } | 446 | } |
455 | } else if (!master->setup) | ||
456 | return -EINVAL; | ||
457 | if (master->transfer == spi_bitbang_transfer && | ||
458 | !bitbang->setup_transfer) | ||
459 | return -EINVAL; | ||
460 | |||
461 | /* this task is the only thing to touch the SPI bits */ | ||
462 | bitbang->busy = 0; | ||
463 | bitbang->workqueue = create_singlethread_workqueue( | ||
464 | dev_name(master->dev.parent)); | ||
465 | if (bitbang->workqueue == NULL) { | ||
466 | status = -EBUSY; | ||
467 | goto err1; | ||
468 | } | 447 | } |
469 | 448 | ||
470 | /* driver may get busy before register() returns, especially | 449 | /* driver may get busy before register() returns, especially |
471 | * if someone registered boardinfo for devices | 450 | * if someone registered boardinfo for devices |
472 | */ | 451 | */ |
473 | status = spi_register_master(master); | 452 | return spi_register_master(master); |
474 | if (status < 0) | ||
475 | goto err2; | ||
476 | |||
477 | return status; | ||
478 | |||
479 | err2: | ||
480 | destroy_workqueue(bitbang->workqueue); | ||
481 | err1: | ||
482 | return status; | ||
483 | } | 453 | } |
484 | EXPORT_SYMBOL_GPL(spi_bitbang_start); | 454 | EXPORT_SYMBOL_GPL(spi_bitbang_start); |
485 | 455 | ||
@@ -490,10 +460,6 @@ int spi_bitbang_stop(struct spi_bitbang *bitbang) | |||
490 | { | 460 | { |
491 | spi_unregister_master(bitbang->master); | 461 | spi_unregister_master(bitbang->master); |
492 | 462 | ||
493 | WARN_ON(!list_empty(&bitbang->queue)); | ||
494 | |||
495 | destroy_workqueue(bitbang->workqueue); | ||
496 | |||
497 | return 0; | 463 | return 0; |
498 | } | 464 | } |
499 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); | 465 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); |
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c index 150d85453c27..2ad3d74ac021 100644 --- a/drivers/spi/spi-nuc900.c +++ b/drivers/spi/spi-nuc900.c | |||
@@ -174,17 +174,6 @@ static void nuc900_spi_gobusy(struct nuc900_spi *hw) | |||
174 | spin_unlock_irqrestore(&hw->lock, flags); | 174 | spin_unlock_irqrestore(&hw->lock, flags); |
175 | } | 175 | } |
176 | 176 | ||
177 | static int nuc900_spi_setupxfer(struct spi_device *spi, | ||
178 | struct spi_transfer *t) | ||
179 | { | ||
180 | return 0; | ||
181 | } | ||
182 | |||
183 | static int nuc900_spi_setup(struct spi_device *spi) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count) | 177 | static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count) |
189 | { | 178 | { |
190 | return hw->tx ? hw->tx[count] : 0; | 179 | return hw->tx ? hw->tx[count] : 0; |
@@ -377,10 +366,8 @@ static int nuc900_spi_probe(struct platform_device *pdev) | |||
377 | master->num_chipselect = hw->pdata->num_cs; | 366 | master->num_chipselect = hw->pdata->num_cs; |
378 | master->bus_num = hw->pdata->bus_num; | 367 | master->bus_num = hw->pdata->bus_num; |
379 | hw->bitbang.master = hw->master; | 368 | hw->bitbang.master = hw->master; |
380 | hw->bitbang.setup_transfer = nuc900_spi_setupxfer; | ||
381 | hw->bitbang.chipselect = nuc900_spi_chipsel; | 369 | hw->bitbang.chipselect = nuc900_spi_chipsel; |
382 | hw->bitbang.txrx_bufs = nuc900_spi_txrx; | 370 | hw->bitbang.txrx_bufs = nuc900_spi_txrx; |
383 | hw->bitbang.master->setup = nuc900_spi_setup; | ||
384 | 371 | ||
385 | hw->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 372 | hw->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
386 | if (hw->res == NULL) { | 373 | if (hw->res == NULL) { |
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 09a942852593..fb56fcfdf65e 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -233,21 +233,6 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
233 | return 0; | 233 | return 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | static int xilinx_spi_setup(struct spi_device *spi) | ||
237 | { | ||
238 | /* always return 0, we can not check the number of bits. | ||
239 | * There are cases when SPI setup is called before any driver is | ||
240 | * there, in that case the SPI core defaults to 8 bits, which we | ||
241 | * do not support in some cases. But if we return an error, the | ||
242 | * SPI device would not be registered and no driver can get hold of it | ||
243 | * When the driver is there, it will call SPI setup again with the | ||
244 | * correct number of bits per transfer. | ||
245 | * If a driver setups with the wrong bit number, it will fail when | ||
246 | * it tries to do a transfer | ||
247 | */ | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi) | 236 | static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi) |
252 | { | 237 | { |
253 | u8 sr; | 238 | u8 sr; |
@@ -375,7 +360,6 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem, | |||
375 | xspi->bitbang.chipselect = xilinx_spi_chipselect; | 360 | xspi->bitbang.chipselect = xilinx_spi_chipselect; |
376 | xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer; | 361 | xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer; |
377 | xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs; | 362 | xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs; |
378 | xspi->bitbang.master->setup = xilinx_spi_setup; | ||
379 | init_completion(&xspi->done); | 363 | init_completion(&xspi->done); |
380 | 364 | ||
381 | if (!request_mem_region(mem->start, resource_size(mem), | 365 | if (!request_mem_region(mem->start, resource_size(mem), |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index f987a2bee16a..daebaba886aa 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -4,11 +4,7 @@ | |||
4 | #include <linux/workqueue.h> | 4 | #include <linux/workqueue.h> |
5 | 5 | ||
6 | struct spi_bitbang { | 6 | struct spi_bitbang { |
7 | struct workqueue_struct *workqueue; | ||
8 | struct work_struct work; | ||
9 | |||
10 | spinlock_t lock; | 7 | spinlock_t lock; |
11 | struct list_head queue; | ||
12 | u8 busy; | 8 | u8 busy; |
13 | u8 use_dma; | 9 | u8 use_dma; |
14 | u8 flags; /* extra spi->mode support */ | 10 | u8 flags; /* extra spi->mode support */ |
@@ -41,7 +37,6 @@ struct spi_bitbang { | |||
41 | */ | 37 | */ |
42 | extern int spi_bitbang_setup(struct spi_device *spi); | 38 | extern int spi_bitbang_setup(struct spi_device *spi); |
43 | extern void spi_bitbang_cleanup(struct spi_device *spi); | 39 | extern void spi_bitbang_cleanup(struct spi_device *spi); |
44 | extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); | ||
45 | extern int spi_bitbang_setup_transfer(struct spi_device *spi, | 40 | extern int spi_bitbang_setup_transfer(struct spi_device *spi, |
46 | struct spi_transfer *t); | 41 | struct spi_transfer *t); |
47 | 42 | ||