Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions drivers/clk/samsung/clk-zumapro.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,8 @@ static const struct samsung_mux_clock hsi0_muxes[] __initconst = {
MUX_F(CLK_MOUT_HSI0_USI2_LOCAL, "zumapro_mout_hsi0_usi2_local",
mout_hsi0_usi2_local_parents,
0x101c, 0, 1, 0, CLK_MUX_READ_ONLY),
MUX_F(CLK_MOUT_HSI0_USI3_LOCAL, "zumapro_mout_hsi0_usi3_local",
mout_hsi0_usi3_local_parents,
0x1020, 0, 1, 0, CLK_MUX_READ_ONLY),
nMUX(CLK_MOUT_HSI0_USI3_LOCAL, "zumapro_mout_hsi0_usi3_local",
mout_hsi0_usi3_local_parents, 0x1020, 0, 1),
};

static const struct samsung_div_clock hsi0_dividers[] __initconst = {
Expand All @@ -638,7 +637,7 @@ static const struct samsung_div_clock hsi0_dividers[] __initconst = {
DIV_F(CLK_DOUT_HSI0_USI2, "zumapro_dout_hsi0_usi2", "zumapro_gout_hsi0_usi2_source",
0x181c, 0, 4, 0, 0),
DIV_F(CLK_DOUT_HSI0_USI3, "zumapro_dout_hsi0_usi3", "zumapro_gout_hsi0_usi3_source",
0x1820, 0, 4, 0, 0),
0x1820, 0, 4, CLK_SET_RATE_PARENT, 0),
};

static const struct samsung_gate_clock hsi0_gates[] __initconst = {
Expand All @@ -651,7 +650,7 @@ static const struct samsung_gate_clock hsi0_gates[] __initconst = {
0x2100, 21, CLK_IGNORE_UNUSED, 0),
GATE(CLK_GOUT_HSI0_USI3_SOURCE, "zumapro_gout_hsi0_usi3_source",
"zumapro_mout_hsi0_usi3_local",
0x2124, 21, CLK_IGNORE_UNUSED, 0),
0x2124, 21, CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
GATE(CLK_GOUT_HSI0_USI3_IP, "zumapro_gout_hsi0_usi3_ip", "zumapro_dout_hsi0_usi3",
0x2104, 21, CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
GATE(CLK_GOUT_HSI0_USI3_PCLK, "zumapro_gout_hsi0_usi3_pclk", "zumapro_mout_hsi0_noc_local",
Expand Down
22 changes: 17 additions & 5 deletions drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
const void *tx_buf = NULL;
void *rx_buf = NULL;
int target_len = 0, origin_len = 0;
unsigned int pio_len;
int use_dma = 0;
bool use_irq = false;
int status;
Expand All @@ -856,20 +857,31 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
return status;
}

/*
* A PIO piece must stay below the FIFO depth and hold whole words, or
* the packet count rounds down and the transfer times out.
*/
pio_len = rounddown(fifo_len - 1, DIV_ROUND_UP(bpw, BITS_PER_BYTE));

if (!is_polling(sdd) && xfer->len >= fifo_len &&
sdd->rx_dma.ch && sdd->tx_dma.ch) {
use_dma = 1;
} else if (xfer->len >= fifo_len) {
} else if (xfer->len > fifo_len) {
tx_buf = xfer->tx_buf;
rx_buf = xfer->rx_buf;
origin_len = xfer->len;
target_len = xfer->len;
xfer->len = fifo_len - 1;
xfer->len = pio_len;
}

do {
/* transfer size is greater than 32, change to IRQ mode */
if (!use_dma && xfer->len > S3C64XX_SPI_POLLING_SIZE)
/*
* Transfers above 32 bytes use the RX trigger interrupt. Its
* level field stops one short of the FIFO, so a transfer that
* fills the FIFO exactly is polled instead of being cut.
*/
if (!use_dma && xfer->len > S3C64XX_SPI_POLLING_SIZE &&
xfer->len < fifo_len)
use_irq = true;

if (use_irq) {
Expand Down Expand Up @@ -960,7 +972,7 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host,
xfer->rx_buf += xfer->len;

if (target_len >= fifo_len)
xfer->len = fifo_len - 1;
xfer->len = pio_len;
else
xfer->len = target_len;
}
Expand Down
Loading