mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Revert "Revert "ODROID-COMMON: drivers/spi: Set the 64 bits per word by default""
This reverts commit 4389a90ae4.
Change-Id: I7f750bd403e75bb7bf871bca01b4bcfcd0389757
This commit is contained in:
@@ -478,11 +478,9 @@ static inline void meson_spicc_tx(struct meson_spicc_device *spicc)
|
||||
|
||||
static void meson_spicc_setup_pio_burst(struct meson_spicc_device *spicc)
|
||||
{
|
||||
unsigned int burst_len;
|
||||
|
||||
burst_len = min_t(unsigned int,
|
||||
spicc->xfer_remain / spicc->bytes_per_word,
|
||||
spicc->data->fifo_size);
|
||||
unsigned int burst_len = min_t(unsigned int,
|
||||
spicc->xfer_remain / spicc->bytes_per_word,
|
||||
spicc->data->fifo_size);
|
||||
|
||||
/* Setup Xfer variables */
|
||||
spicc->tx_remain = burst_len;
|
||||
@@ -588,6 +586,18 @@ static int meson_spicc_transfer_one(struct spi_master *master,
|
||||
spicc->rx_buf = (u8 *)xfer->rx_buf;
|
||||
spicc->xfer_remain = xfer->len;
|
||||
|
||||
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
|
||||
if ((xfer->len >= 64) && (xfer->bits_per_word == 8) && ((xfer->len % 8) == 0)) {
|
||||
int cnt = xfer->len / 8;
|
||||
int i;
|
||||
|
||||
u64 *tx_buf = (u64 *) &spicc->tx_buf[0];
|
||||
for (i = 0; i < cnt; i++)
|
||||
tx_buf[i] = __swab64p((__u64 *) &spicc->tx_buf[i * 8]);
|
||||
|
||||
xfer->bits_per_word = 64;
|
||||
}
|
||||
#endif
|
||||
/* Pre-calculate word size */
|
||||
spicc->bytes_per_word =
|
||||
DIV_ROUND_UP(spicc->xfer->bits_per_word, 8);
|
||||
|
||||
Reference in New Issue
Block a user