Skip to content

Commit 8a08b4a

Browse files
committed
misc: rp1-pio: SM_CONFIG_XFER32 = larger DMA bufs
Add an ioctl type - SM_CONFIG_XFER32 - that takes uints for the buf_size and buf_count values. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent f02c04d commit 8a08b4a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/misc/rp1-pio.c

+9
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,14 @@ static int rp1_pio_sm_config_xfer_user(struct rp1_pio_client *client, void *para
710710
args->buf_size, args->buf_count);
711711
}
712712

713+
static int rp1_pio_sm_config_xfer32_user(struct rp1_pio_client *client, void *param)
714+
{
715+
struct rp1_pio_sm_config_xfer32_args *args = param;
716+
717+
return rp1_pio_sm_config_xfer_internal(client, args->sm, args->dir,
718+
args->buf_size, args->buf_count);
719+
}
720+
713721
static int rp1_pio_sm_tx_user(struct rp1_pio_device *pio, struct dma_info *dma,
714722
const void __user *userbuf, size_t bytes)
715723
{
@@ -970,6 +978,7 @@ struct handler_info {
970978
HANDLER(SM_CONFIG_XFER, sm_config_xfer_user),
971979
HANDLER(SM_XFER_DATA, sm_xfer_data_user),
972980
HANDLER(SM_XFER_DATA32, sm_xfer_data32_user),
981+
HANDLER(SM_CONFIG_XFER32, sm_config_xfer32_user),
973982

974983
HANDLER(CAN_ADD_PROGRAM, can_add_program),
975984
HANDLER(ADD_PROGRAM, add_program),

include/uapi/misc/rp1_pio_if.h

+8
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ struct rp1_pio_sm_config_xfer_args {
160160
uint16_t buf_count;
161161
};
162162

163+
struct rp1_pio_sm_config_xfer32_args {
164+
uint16_t sm;
165+
uint16_t dir;
166+
uint32_t buf_size;
167+
uint32_t buf_count;
168+
};
169+
163170
struct rp1_pio_sm_xfer_data_args {
164171
uint16_t sm;
165172
uint16_t dir;
@@ -185,6 +192,7 @@ struct rp1_access_hw_args {
185192
#define PIO_IOC_SM_CONFIG_XFER _IOW(PIO_IOC_MAGIC, 0, struct rp1_pio_sm_config_xfer_args)
186193
#define PIO_IOC_SM_XFER_DATA _IOW(PIO_IOC_MAGIC, 1, struct rp1_pio_sm_xfer_data_args)
187194
#define PIO_IOC_SM_XFER_DATA32 _IOW(PIO_IOC_MAGIC, 2, struct rp1_pio_sm_xfer_data32_args)
195+
#define PIO_IOC_SM_CONFIG_XFER32 _IOW(PIO_IOC_MAGIC, 3, struct rp1_pio_sm_config_xfer32_args)
188196

189197
#define PIO_IOC_READ_HW _IOW(PIO_IOC_MAGIC, 8, struct rp1_access_hw_args)
190198
#define PIO_IOC_WRITE_HW _IOW(PIO_IOC_MAGIC, 9, struct rp1_access_hw_args)

0 commit comments

Comments
 (0)