summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/core.c
diff options
context:
space:
mode:
authorChristian Gromm2018-05-08 11:44:53 +0200
committerGreg Kroah-Hartman2018-05-08 13:41:48 +0200
commitdbd36d5772f7e49e1e638391941de358d84ce379 (patch)
tree37f3c1fa14d4889b6883ba135413396092d6989f /drivers/staging/most/core.c
parentstaging: most: i2c: remove unnecessary poison_channel call (diff)
downloadkernel-qcow2-linux-dbd36d5772f7e49e1e638391941de358d84ce379.tar.gz
kernel-qcow2-linux-dbd36d5772f7e49e1e638391941de358d84ce379.tar.xz
kernel-qcow2-linux-dbd36d5772f7e49e1e638391941de358d84ce379.zip
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/core.c')
-rw-r--r--drivers/staging/most/core.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 965409efc8bf..db3c7e243deb 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -420,6 +420,26 @@ static ssize_t set_packets_per_xact_store(struct device *dev,
return count;
}
+static ssize_t set_dbr_size_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct most_channel *c = to_channel(dev);
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", c->cfg.dbr_size);
+}
+
+static ssize_t set_dbr_size_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct most_channel *c = to_channel(dev);
+ int ret = kstrtou16(buf, 0, &c->cfg.dbr_size);
+
+ if (ret)
+ return ret;
+ return count;
+}
+
#define DEV_ATTR(_name) (&dev_attr_##_name.attr)
static DEVICE_ATTR_RO(available_directions);
@@ -435,6 +455,7 @@ static DEVICE_ATTR_RW(set_direction);
static DEVICE_ATTR_RW(set_datatype);
static DEVICE_ATTR_RW(set_subbuffer_size);
static DEVICE_ATTR_RW(set_packets_per_xact);
+static DEVICE_ATTR_RW(set_dbr_size);
static struct attribute *channel_attrs[] = {
DEV_ATTR(available_directions),
@@ -450,6 +471,7 @@ static struct attribute *channel_attrs[] = {
DEV_ATTR(set_datatype),
DEV_ATTR(set_subbuffer_size),
DEV_ATTR(set_packets_per_xact),
+ DEV_ATTR(set_dbr_size),
NULL,
};