Skip to content
Open
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
18 changes: 18 additions & 0 deletions drivers/misc/rp1-pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,24 @@ int rp1_pio_sm_xfer_data(struct rp1_pio_client *client, uint sm, uint dir,
}
EXPORT_SYMBOL_GPL(rp1_pio_sm_xfer_data);

void *rp1_pio_sm_buffer_virt(struct rp1_pio_client *client,
unsigned sm, unsigned dir, int index)
{
struct rp1_pio_device *pio = client->pio;
struct dma_info *dma;

if (sm >= RP1_PIO_SMS_COUNT || dir >= RP1_PIO_DIR_COUNT)
return NULL;

dma = &pio->dma_configs[sm][dir];

if (index >= dma->buf_count)
return NULL;

return dma->bufs[index].buf;
}
EXPORT_SYMBOL_GPL(rp1_pio_sm_buffer_virt);

struct handler_info {
const char *name;
int (*func)(struct rp1_pio_client *client, void *param);
Expand Down
1 change: 1 addition & 0 deletions include/linux/pio_rp1.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ int rp1_pio_sm_config_xfer(struct rp1_pio_client *client, uint sm, uint dir,
int rp1_pio_sm_xfer_data(struct rp1_pio_client *client, uint sm, uint dir,
uint data_bytes, void *data, dma_addr_t dma_addr,
void (*callback)(void *param), void *param);
void *rp1_pio_sm_buffer_virt(struct rp1_pio_client *client, unsigned sm, unsigned dir, int index);

int rp1_pio_can_add_program(struct rp1_pio_client *client, void *param);
int rp1_pio_add_program(struct rp1_pio_client *client, void *param);
Expand Down