Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
d5221ab6
Commit
d5221ab6
authored
Jan 11, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/rt5651' into asoc-next
parents
5450487a
3ae08dc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
Documentation/devicetree/bindings/sound/rt5651.txt
Documentation/devicetree/bindings/sound/rt5651.txt
+41
-0
sound/soc/codecs/rt5651.c
sound/soc/codecs/rt5651.c
+31
-0
No files found.
Documentation/devicetree/bindings/sound/rt5651.txt
0 → 100644
View file @
d5221ab6
RT5651 audio CODEC
This device supports I2C only.
Required properties:
- compatible : "realtek,rt5651".
- reg : The I2C address of the device.
Optional properties:
- realtek,in2-differential
Boolean. Indicate MIC2 input are differential, rather than single-ended.
- realtek,dmic-en
Boolean. true if dmic is used.
Pins on the device (for linking into audio routes) for RT5651:
* DMIC L1
* DMIC R1
* IN1P
* IN2P
* IN2N
* IN3P
* HPOL
* HPOR
* LOUTL
* LOUTR
* PDML
* PDMR
Example:
codec: rt5651@1a {
compatible = "realtek,rt5651";
reg = <0x1a>;
realtek,dmic-en = "true";
realtek,in2-diff = "false";
};
sound/soc/codecs/rt5651.c
View file @
d5221ab6
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <linux/regmap.h>
#include <linux/regmap.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi.h>
#include <linux/acpi.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/pcm_params.h>
...
@@ -1735,12 +1736,38 @@ static const struct regmap_config rt5651_regmap = {
...
@@ -1735,12 +1736,38 @@ static const struct regmap_config rt5651_regmap = {
.
num_ranges
=
ARRAY_SIZE
(
rt5651_ranges
),
.
num_ranges
=
ARRAY_SIZE
(
rt5651_ranges
),
};
};
#if defined(CONFIG_OF)
static
const
struct
of_device_id
rt5651_of_match
[]
=
{
{
.
compatible
=
"realtek,rt5651"
,
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
rt5651_of_match
);
#endif
#ifdef CONFIG_ACPI
static
const
struct
acpi_device_id
rt5651_acpi_match
[]
=
{
{
"10EC5651"
,
0
},
{
},
};
MODULE_DEVICE_TABLE
(
acpi
,
rt5651_acpi_match
);
#endif
static
const
struct
i2c_device_id
rt5651_i2c_id
[]
=
{
static
const
struct
i2c_device_id
rt5651_i2c_id
[]
=
{
{
"rt5651"
,
0
},
{
"rt5651"
,
0
},
{
}
{
}
};
};
MODULE_DEVICE_TABLE
(
i2c
,
rt5651_i2c_id
);
MODULE_DEVICE_TABLE
(
i2c
,
rt5651_i2c_id
);
static
int
rt5651_parse_dt
(
struct
rt5651_priv
*
rt5651
,
struct
device_node
*
np
)
{
rt5651
->
pdata
.
in2_diff
=
of_property_read_bool
(
np
,
"realtek,in2-differential"
);
rt5651
->
pdata
.
dmic_en
=
of_property_read_bool
(
np
,
"realtek,dmic-en"
);
return
0
;
}
static
int
rt5651_i2c_probe
(
struct
i2c_client
*
i2c
,
static
int
rt5651_i2c_probe
(
struct
i2c_client
*
i2c
,
const
struct
i2c_device_id
*
id
)
const
struct
i2c_device_id
*
id
)
{
{
...
@@ -1757,6 +1784,8 @@ static int rt5651_i2c_probe(struct i2c_client *i2c,
...
@@ -1757,6 +1784,8 @@ static int rt5651_i2c_probe(struct i2c_client *i2c,
if
(
pdata
)
if
(
pdata
)
rt5651
->
pdata
=
*
pdata
;
rt5651
->
pdata
=
*
pdata
;
else
if
(
i2c
->
dev
.
of_node
)
rt5651_parse_dt
(
rt5651
,
i2c
->
dev
.
of_node
);
rt5651
->
regmap
=
devm_regmap_init_i2c
(
i2c
,
&
rt5651_regmap
);
rt5651
->
regmap
=
devm_regmap_init_i2c
(
i2c
,
&
rt5651_regmap
);
if
(
IS_ERR
(
rt5651
->
regmap
))
{
if
(
IS_ERR
(
rt5651
->
regmap
))
{
...
@@ -1806,6 +1835,8 @@ static int rt5651_i2c_remove(struct i2c_client *i2c)
...
@@ -1806,6 +1835,8 @@ static int rt5651_i2c_remove(struct i2c_client *i2c)
static
struct
i2c_driver
rt5651_i2c_driver
=
{
static
struct
i2c_driver
rt5651_i2c_driver
=
{
.
driver
=
{
.
driver
=
{
.
name
=
"rt5651"
,
.
name
=
"rt5651"
,
.
acpi_match_table
=
ACPI_PTR
(
rt5651_acpi_match
),
.
of_match_table
=
of_match_ptr
(
rt5651_of_match
),
},
},
.
probe
=
rt5651_i2c_probe
,
.
probe
=
rt5651_i2c_probe
,
.
remove
=
rt5651_i2c_remove
,
.
remove
=
rt5651_i2c_remove
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment