spi.c (bb29785e0d6d150181704be2efcc3141044625e2) | spi.c (059b8ffeee5b427949872bb6ed5db5ae0788054e) |
---|---|
1/* 2 * SPI init/core code 3 * 4 * Copyright (C) 2005 David Brownell 5 * Copyright (C) 2008 Secret Lab Technologies Ltd. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 1355 unchanged lines hidden (view full) --- 1364 if ((flags & SPI_MASTER_NO_TX) && xfer->tx_buf) 1365 return -EINVAL; 1366 if ((flags & SPI_MASTER_NO_RX) && xfer->rx_buf) 1367 return -EINVAL; 1368 } 1369 } 1370 1371 /** | 1/* 2 * SPI init/core code 3 * 4 * Copyright (C) 2005 David Brownell 5 * Copyright (C) 2008 Secret Lab Technologies Ltd. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 1355 unchanged lines hidden (view full) --- 1364 if ((flags & SPI_MASTER_NO_TX) && xfer->tx_buf) 1365 return -EINVAL; 1366 if ((flags & SPI_MASTER_NO_RX) && xfer->rx_buf) 1367 return -EINVAL; 1368 } 1369 } 1370 1371 /** |
1372 * Set transfer bits_per_word as spi device default if it is not 1373 * set for this transfer. | 1372 * Set transfer bits_per_word and max speed as spi device default if 1373 * it is not set for this transfer. |
1374 */ 1375 list_for_each_entry(xfer, &message->transfers, transfer_list) { 1376 if (!xfer->bits_per_word) 1377 xfer->bits_per_word = spi->bits_per_word; | 1374 */ 1375 list_for_each_entry(xfer, &message->transfers, transfer_list) { 1376 if (!xfer->bits_per_word) 1377 xfer->bits_per_word = spi->bits_per_word; |
1378 if (!xfer->speed_hz) 1379 xfer->speed_hz = spi->max_speed_hz; |
|
1378 } 1379 1380 message->spi = spi; 1381 message->status = -EINPROGRESS; 1382 return master->transfer(spi, message); 1383} 1384 1385/** --- 351 unchanged lines hidden --- | 1380 } 1381 1382 message->spi = spi; 1383 message->status = -EINPROGRESS; 1384 return master->transfer(spi, message); 1385} 1386 1387/** --- 351 unchanged lines hidden --- |