blob: d3dc75f7e65acce605a19420a4465e855ab7cd69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright 2019 NXP.
*/
#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include "fsl_dsp_audiomix.h"
struct imx_audiomix_dsp_data {
void __iomem *base;
};
void imx_audiomix_dsp_start(struct imx_audiomix_dsp_data *data)
{
u32 val;
val = readl(data->base + AudioDSP_REG2);
val &= ~(1 << 5);
writel(val, data->base + AudioDSP_REG2);
}
static int imx_audiomix_dsp_probe(struct platform_device *pdev)
{
struct imx_audiomix_dsp_data *drvdata;
struct device *dev = &pdev->dev;
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (drvdata == NULL)
return -ENOMEM;
drvdata->base = dev_get_drvdata(dev->parent);
platform_set_drvdata(pdev, drvdata);
return 0;
}
static const struct of_device_id imx_audiomix_dsp_dt_ids[] = {
{ .compatible = "fsl,audiomix-dsp", },
{ /* sentinel */ },
};
static struct platform_driver imx_audiomix_dsp_driver = {
.probe = imx_audiomix_dsp_probe,
.driver = {
.name = "audiomix-dsp",
.of_match_table = imx_audiomix_dsp_dt_ids,
},
};
module_platform_driver(imx_audiomix_dsp_driver);
|