|
23 | 23 | #include <linux/reset.h>
|
24 | 24 | #include <linux/slab.h>
|
25 | 25 |
|
| 26 | +#include "../internals.h" |
26 | 27 | #include "dw-i3c-master.h"
|
27 | 28 |
|
28 | 29 | #define DEVICE_CTRL 0x0
|
@@ -336,37 +337,19 @@ static int dw_i3c_master_get_free_pos(struct dw_i3c_master *master)
|
336 | 337 | static void dw_i3c_master_wr_tx_fifo(struct dw_i3c_master *master,
|
337 | 338 | const u8 *bytes, int nbytes)
|
338 | 339 | {
|
339 |
| - writesl(master->regs + RX_TX_DATA_PORT, bytes, nbytes / 4); |
340 |
| - if (nbytes & 3) { |
341 |
| - u32 tmp = 0; |
342 |
| - |
343 |
| - memcpy(&tmp, bytes + (nbytes & ~3), nbytes & 3); |
344 |
| - writesl(master->regs + RX_TX_DATA_PORT, &tmp, 1); |
345 |
| - } |
346 |
| -} |
347 |
| - |
348 |
| -static void dw_i3c_master_read_fifo(struct dw_i3c_master *master, |
349 |
| - int reg, u8 *bytes, int nbytes) |
350 |
| -{ |
351 |
| - readsl(master->regs + reg, bytes, nbytes / 4); |
352 |
| - if (nbytes & 3) { |
353 |
| - u32 tmp; |
354 |
| - |
355 |
| - readsl(master->regs + reg, &tmp, 1); |
356 |
| - memcpy(bytes + (nbytes & ~3), &tmp, nbytes & 3); |
357 |
| - } |
| 340 | + i3c_writel_fifo(master->regs + RX_TX_DATA_PORT, bytes, nbytes); |
358 | 341 | }
|
359 | 342 |
|
360 | 343 | static void dw_i3c_master_read_rx_fifo(struct dw_i3c_master *master,
|
361 | 344 | u8 *bytes, int nbytes)
|
362 | 345 | {
|
363 |
| - return dw_i3c_master_read_fifo(master, RX_TX_DATA_PORT, bytes, nbytes); |
| 346 | + i3c_readl_fifo(master->regs + RX_TX_DATA_PORT, bytes, nbytes); |
364 | 347 | }
|
365 | 348 |
|
366 | 349 | static void dw_i3c_master_read_ibi_fifo(struct dw_i3c_master *master,
|
367 | 350 | u8 *bytes, int nbytes)
|
368 | 351 | {
|
369 |
| - return dw_i3c_master_read_fifo(master, IBI_QUEUE_STATUS, bytes, nbytes); |
| 352 | + i3c_readl_fifo(master->regs + IBI_QUEUE_STATUS, bytes, nbytes); |
370 | 353 | }
|
371 | 354 |
|
372 | 355 | static struct dw_i3c_xfer *
|
|
0 commit comments