|
23 | 23 | #include <linux/spinlock.h>
|
24 | 24 | #include <linux/workqueue.h>
|
25 | 25 |
|
| 26 | +#include "../internals.h" |
| 27 | + |
26 | 28 | #define DEV_ID 0x0
|
27 | 29 | #define DEV_ID_I3C_MASTER 0x5034
|
28 | 30 |
|
@@ -427,25 +429,13 @@ to_cdns_i3c_master(struct i3c_master_controller *master)
|
427 | 429 | static void cdns_i3c_master_wr_to_tx_fifo(struct cdns_i3c_master *master,
|
428 | 430 | const u8 *bytes, int nbytes)
|
429 | 431 | {
|
430 |
| - writesl(master->regs + TX_FIFO, bytes, nbytes / 4); |
431 |
| - if (nbytes & 3) { |
432 |
| - u32 tmp = 0; |
433 |
| - |
434 |
| - memcpy(&tmp, bytes + (nbytes & ~3), nbytes & 3); |
435 |
| - writesl(master->regs + TX_FIFO, &tmp, 1); |
436 |
| - } |
| 432 | + i3c_writel_fifo(master->regs + TX_FIFO, bytes, nbytes); |
437 | 433 | }
|
438 | 434 |
|
439 | 435 | static void cdns_i3c_master_rd_from_rx_fifo(struct cdns_i3c_master *master,
|
440 | 436 | u8 *bytes, int nbytes)
|
441 | 437 | {
|
442 |
| - readsl(master->regs + RX_FIFO, bytes, nbytes / 4); |
443 |
| - if (nbytes & 3) { |
444 |
| - u32 tmp; |
445 |
| - |
446 |
| - readsl(master->regs + RX_FIFO, &tmp, 1); |
447 |
| - memcpy(bytes + (nbytes & ~3), &tmp, nbytes & 3); |
448 |
| - } |
| 438 | + i3c_readl_fifo(master->regs + RX_FIFO, bytes, nbytes); |
449 | 439 | }
|
450 | 440 |
|
451 | 441 | static bool cdns_i3c_master_supports_ccc_cmd(struct i3c_master_controller *m,
|
@@ -1330,12 +1320,7 @@ static void cdns_i3c_master_handle_ibi(struct cdns_i3c_master *master,
|
1330 | 1320 | buf = slot->data;
|
1331 | 1321 |
|
1332 | 1322 | nbytes = IBIR_XFER_BYTES(ibir);
|
1333 |
| - readsl(master->regs + IBI_DATA_FIFO, buf, nbytes / 4); |
1334 |
| - if (nbytes % 3) { |
1335 |
| - u32 tmp = __raw_readl(master->regs + IBI_DATA_FIFO); |
1336 |
| - |
1337 |
| - memcpy(buf + (nbytes & ~3), &tmp, nbytes & 3); |
1338 |
| - } |
| 1323 | + i3c_readl_fifo(master->regs + IBI_DATA_FIFO, buf, nbytes); |
1339 | 1324 |
|
1340 | 1325 | slot->len = min_t(unsigned int, IBIR_XFER_BYTES(ibir),
|
1341 | 1326 | dev->ibi->max_payload_len);
|
|
0 commit comments