summaryrefslogtreecommitdiff
path: root/drivers/staging/most/dim2/dim2.c
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2018-05-08 12:44:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-08 14:41:48 +0300
commitdbd36d5772f7e49e1e638391941de358d84ce379 (patch)
tree37f3c1fa14d4889b6883ba135413396092d6989f /drivers/staging/most/dim2/dim2.c
parent95b2f82d63f6d0888db188dddf76433dce32affe (diff)
downloadlinux-dbd36d5772f7e49e1e638391941de358d84ce379.tar.xz
staging: most: add channel property dbr_size
This patch adds the channel property dbr_size to control the corresponding buffer size of the channels of the DIM2 interface. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/dim2/dim2.c')
-rw-r--r--drivers/staging/most/dim2/dim2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index fa4559b8f536..d15867a1ba2d 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -61,6 +61,7 @@ struct hdm_channel {
char name[sizeof "caNNN"];
bool is_initialized;
struct dim_channel ch;
+ u16 *reset_dbr_size;
struct list_head pending_list; /* before dim_enqueue_buffer() */
struct list_head started_list; /* after dim_enqueue_buffer() */
enum most_channel_direction direction;
@@ -494,6 +495,12 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,
if (hdm_ch->is_initialized)
return -EPERM;
+ /* do not reset if the property was set by user, see poison_channel */
+ hdm_ch->reset_dbr_size = ccfg->dbr_size ? NULL : &ccfg->dbr_size;
+
+ /* zero value is default dbr_size, see dim2 hal */
+ hdm_ch->ch.dbr_size = ccfg->dbr_size;
+
switch (ccfg->data_type) {
case MOST_CH_CONTROL:
new_size = dim_norm_ctrl_async_buffer_size(buf_size);
@@ -574,6 +581,7 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,
dev->atx_idx = ch_idx;
spin_unlock_irqrestore(&dim_lock, flags);
+ ccfg->dbr_size = hdm_ch->ch.dbr_size;
return 0;
}
@@ -689,6 +697,8 @@ static int poison_channel(struct most_interface *most_iface, int ch_idx)
complete_all_mbos(&hdm_ch->started_list);
complete_all_mbos(&hdm_ch->pending_list);
+ if (hdm_ch->reset_dbr_size)
+ *hdm_ch->reset_dbr_size = 0;
return ret;
}