Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293463
b: refs/heads/master
c: 9d5ef26
h: refs/heads/master
i:
  293461: df258c1
  293459: d6b96be
  293455: 1562816
v: v3
  • Loading branch information
Richard Zhao authored and Mark Brown committed Mar 6, 2012
1 parent ab45eeb commit 1cec985
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f320515a589eeb9bfbc317801e60b87a12f9eae1
refs/heads/master: 9d5ef2663fe220a88412a7190942b7d933da0333
13 changes: 13 additions & 0 deletions trunk/Documentation/devicetree/bindings/sound/imx-audmux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Freescale Digital Audio Mux (AUDMUX) device

Required properties:
- compatible : "fsl,imx21-audmux" for AUDMUX version firstly used on i.MX21,
or "fsl,imx31-audmux" for the version firstly used on i.MX31.
- reg : Should contain AUDMUX registers location and length

Example:

audmux@021d8000 {
compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux";
reg = <0x021d8000 0x4000>;
};
14 changes: 14 additions & 0 deletions trunk/sound/soc/imx/imx-audmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

Expand Down Expand Up @@ -197,6 +199,13 @@ static struct platform_device_id imx_audmux_ids[] = {
};
MODULE_DEVICE_TABLE(platform, imx_audmux_ids);

static const struct of_device_id imx_audmux_dt_ids[] = {
{ .compatible = "fsl,imx21-audmux", .data = &imx_audmux_ids[0], },
{ .compatible = "fsl,imx31-audmux", .data = &imx_audmux_ids[1], },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, imx_audmux_dt_ids);

static const uint8_t port_mapping[] = {
0x0, 0x4, 0x8, 0x10, 0x14, 0x1c,
};
Expand Down Expand Up @@ -243,6 +252,8 @@ EXPORT_SYMBOL_GPL(imx_audmux_v2_configure_port);
static int __init imx_audmux_probe(struct platform_device *pdev)
{
struct resource *res;
const struct of_device_id *of_id =
of_match_device(imx_audmux_dt_ids, &pdev->dev);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
audmux_base = devm_request_and_ioremap(&pdev->dev, res);
Expand All @@ -256,6 +267,8 @@ static int __init imx_audmux_probe(struct platform_device *pdev)
audmux_clk = NULL;
}

if (of_id)
pdev->id_entry = of_id->data;
audmux_type = pdev->id_entry->driver_data;
if (audmux_type == IMX31_AUDMUX)
audmux_debugfs_init();
Expand All @@ -279,6 +292,7 @@ static struct platform_driver imx_audmux_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = imx_audmux_dt_ids,
}
};

Expand Down

0 comments on commit 1cec985

Please sign in to comment.