Skip to content

Commit

Permalink
misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs
Browse files Browse the repository at this point in the history
Add an ioctl type - SM_CONFIG_XFER32 - that takes uints for the buf_size
and buf_count values.

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell authored and popcornmix committed Feb 3, 2025
1 parent b59fd82 commit f33efa7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/misc/rp1-pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,14 @@ static int rp1_pio_sm_config_xfer_user(struct rp1_pio_client *client, void *para
args->buf_size, args->buf_count);
}

static int rp1_pio_sm_config_xfer32_user(struct rp1_pio_client *client, void *param)
{
struct rp1_pio_sm_config_xfer32_args *args = param;

return rp1_pio_sm_config_xfer_internal(client, args->sm, args->dir,
args->buf_size, args->buf_count);
}

static int rp1_pio_sm_tx_user(struct rp1_pio_device *pio, struct dma_info *dma,
const void __user *userbuf, size_t bytes)
{
Expand Down Expand Up @@ -970,6 +978,7 @@ struct handler_info {
HANDLER(SM_CONFIG_XFER, sm_config_xfer_user),
HANDLER(SM_XFER_DATA, sm_xfer_data_user),
HANDLER(SM_XFER_DATA32, sm_xfer_data32_user),
HANDLER(SM_CONFIG_XFER32, sm_config_xfer32_user),

HANDLER(CAN_ADD_PROGRAM, can_add_program),
HANDLER(ADD_PROGRAM, add_program),
Expand Down
8 changes: 8 additions & 0 deletions include/uapi/misc/rp1_pio_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ struct rp1_pio_sm_config_xfer_args {
uint16_t buf_count;
};

struct rp1_pio_sm_config_xfer32_args {
uint16_t sm;
uint16_t dir;
uint32_t buf_size;
uint32_t buf_count;
};

struct rp1_pio_sm_xfer_data_args {
uint16_t sm;
uint16_t dir;
Expand All @@ -185,6 +192,7 @@ struct rp1_access_hw_args {
#define PIO_IOC_SM_CONFIG_XFER _IOW(PIO_IOC_MAGIC, 0, struct rp1_pio_sm_config_xfer_args)
#define PIO_IOC_SM_XFER_DATA _IOW(PIO_IOC_MAGIC, 1, struct rp1_pio_sm_xfer_data_args)
#define PIO_IOC_SM_XFER_DATA32 _IOW(PIO_IOC_MAGIC, 2, struct rp1_pio_sm_xfer_data32_args)
#define PIO_IOC_SM_CONFIG_XFER32 _IOW(PIO_IOC_MAGIC, 3, struct rp1_pio_sm_config_xfer32_args)

#define PIO_IOC_READ_HW _IOW(PIO_IOC_MAGIC, 8, struct rp1_access_hw_args)
#define PIO_IOC_WRITE_HW _IOW(PIO_IOC_MAGIC, 9, struct rp1_access_hw_args)
Expand Down

0 comments on commit f33efa7

Please sign in to comment.