summaryrefslogtreecommitdiff
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>2021-09-27 18:58:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-28 09:11:05 +0200
commit9b27a62d11be1afbccbefddaad39761c8212fd92 (patch)
tree1a610a56af7145dd36042f1042bd3881a142f900 /drivers/staging/most
parentc090666ba9b583ee45ed268a5117eb022e1b191b (diff)
staging: most: dim2: force fcnt=3 on Renesas GEN3
Per Renesas datasheet, MLBC0 register's fcnt field in the embedded dim2 module must be never set to value different from 3. Enforce that, via an optional field in struct dim2_platform_data. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Link: https://lore.kernel.org/r/20210927155804.27877-1-nikita.yoush@cogentembedded.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/dim2/dim2.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 093ef9a2b291..9300040ec84c 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -108,6 +108,7 @@ struct dim2_hdm {
struct dim2_platform_data {
int (*enable)(struct platform_device *pdev);
void (*disable)(struct platform_device *pdev);
+ u8 fcnt;
};
#define iface_to_hdm(iface) container_of(iface, struct dim2_hdm, most_iface)
@@ -731,7 +732,7 @@ static int dim2_probe(struct platform_device *pdev)
struct dim2_hdm *dev;
struct resource *res;
int ret, i;
- u8 hal_ret;
+ u8 dev_fcnt, hal_ret;
int irq;
enum { MLB_INT_IDX, AHB0_INT_IDX };
@@ -770,8 +771,14 @@ static int dim2_probe(struct platform_device *pdev)
dev->disable_platform = pdata ? pdata->disable : NULL;
- dev_info(&pdev->dev, "sync: num of frames per sub-buffer: %u\n", fcnt);
- hal_ret = dim_startup(dev->io_base, dev->clk_speed, fcnt);
+ if (pdata && pdata->fcnt)
+ dev_fcnt = pdata->fcnt;
+ else
+ dev_fcnt = fcnt;
+
+ dev_info(&pdev->dev, "sync: num of frames per sub-buffer: %u\n",
+ dev_fcnt);
+ hal_ret = dim_startup(dev->io_base, dev->clk_speed, dev_fcnt);
if (hal_ret != DIM_NO_ERROR) {
dev_err(&pdev->dev, "dim_startup failed: %d\n", hal_ret);
ret = -ENODEV;
@@ -1047,9 +1054,19 @@ static void rcar_m3_disable(struct platform_device *pdev)
enum dim2_platforms { FSL_MX6, RCAR_H2, RCAR_M3 };
static struct dim2_platform_data plat_data[] = {
- [FSL_MX6] = { .enable = fsl_mx6_enable, .disable = fsl_mx6_disable },
- [RCAR_H2] = { .enable = rcar_h2_enable, .disable = rcar_h2_disable },
- [RCAR_M3] = { .enable = rcar_m3_enable, .disable = rcar_m3_disable },
+ [FSL_MX6] = {
+ .enable = fsl_mx6_enable,
+ .disable = fsl_mx6_disable,
+ },
+ [RCAR_H2] = {
+ .enable = rcar_h2_enable,
+ .disable = rcar_h2_disable,
+ },
+ [RCAR_M3] = {
+ .enable = rcar_m3_enable,
+ .disable = rcar_m3_disable,
+ .fcnt = 3,
+ },
};
static const struct of_device_id dim2_of_match[] = {