23 #include <linux/module.h>
25 #include <linux/errno.h>
27 #include <linux/slab.h>
64 static unsigned bitbang_txrx_8(
77 while (
likely(count > 0)) {
82 word = txrx_word(spi, ns, word, bits);
90 static unsigned bitbang_txrx_16(
103 while (
likely(count > 1)) {
108 word = txrx_word(spi, ns, word, bits);
116 static unsigned bitbang_txrx_32(
125 unsigned count = t->
len;
129 while (
likely(count > 3)) {
134 word = txrx_word(spi, ns, word, bits);
159 if (bits_per_word <= 8)
161 else if (bits_per_word <= 16)
163 else if (bits_per_word <= 32)
172 cs->
nsecs = (1000000000/2) / hz;
191 bitbang = spi_master_get_devdata(spi->
master);
218 if (!bitbang->
busy) {
222 spin_unlock_irqrestore(&bitbang->
lock, flags);
240 unsigned nsecs = cs->
nsecs;
266 while (!list_empty(&bitbang->
queue)) {
278 list_del_init(&m->
queue);
279 spin_unlock_irqrestore(&bitbang->
lock, flags);
337 if (status != t->
len) {
369 if (!(status == 0 && cs_change)) {
378 spin_unlock_irqrestore(&bitbang->
lock, flags);
393 bitbang = spi_master_get_devdata(spi->
master);
402 spin_unlock_irqrestore(&bitbang->
lock, flags);
442 INIT_LIST_HEAD(&bitbang->
queue);
444 if (!bitbang->
master->mode_bits)
447 if (!bitbang->
master->transfer)
452 if (!bitbang->
master->setup) {
459 }
else if (!bitbang->
master->setup)
468 dev_name(bitbang->
master->dev.parent));