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
Kirill Smelkov
linux
Commits
856de815
Commit
856de815
authored
Oct 24, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/tpa6130a2' into asoc-next
parents
3caa2827
f95a4883
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
9 deletions
+50
-9
Documentation/devicetree/bindings/sound/tpa6130a2.txt
Documentation/devicetree/bindings/sound/tpa6130a2.txt
+27
-0
sound/soc/codecs/tpa6130a2.c
sound/soc/codecs/tpa6130a2.c
+23
-9
No files found.
Documentation/devicetree/bindings/sound/tpa6130a2.txt
0 → 100644
View file @
856de815
Texas Instruments - tpa6130a2 Codec module
The tpa6130a2 serial control bus communicates through I2C protocols
Required properties:
- compatible - "string" - One of:
"ti,tpa6130a2" - TPA6130A2
"ti,tpa6140a2" - TPA6140A2
- reg - <int> - I2C slave address
- Vdd-supply - <phandle> - power supply regulator
Optional properties:
- power-gpio - gpio pin to power the device
Example:
tpa6130a2: tpa6130a2@60 {
compatible = "ti,tpa6130a2";
reg = <0x60>;
Vdd-supply = <&vmmc2>;
power-gpio = <&gpio4 2 GPIO_ACTIVE_HIGH>;
};
sound/soc/codecs/tpa6130a2.c
View file @
856de815
...
...
@@ -30,6 +30,7 @@
#include <sound/tpa6130a2-plat.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <linux/of_gpio.h>
#include "tpa6130a2.h"
...
...
@@ -364,30 +365,33 @@ static int tpa6130a2_probe(struct i2c_client *client,
{
struct
device
*
dev
;
struct
tpa6130a2_data
*
data
;
struct
tpa6130a2_platform_data
*
pdata
;
struct
tpa6130a2_platform_data
*
pdata
=
client
->
dev
.
platform_data
;
struct
device_node
*
np
=
client
->
dev
.
of_node
;
const
char
*
regulator
;
int
ret
;
dev
=
&
client
->
dev
;
if
(
client
->
dev
.
platform_data
==
NULL
)
{
dev_err
(
dev
,
"Platform data not set
\n
"
);
dump_stack
();
return
-
ENODEV
;
}
data
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
data
),
GFP_KERNEL
);
if
(
data
==
NULL
)
{
dev_err
(
dev
,
"Can not allocate memory
\n
"
);
return
-
ENOMEM
;
}
if
(
pdata
)
{
data
->
power_gpio
=
pdata
->
power_gpio
;
}
else
if
(
np
)
{
data
->
power_gpio
=
of_get_named_gpio
(
np
,
"power-gpio"
,
0
);
}
else
{
dev_err
(
dev
,
"Platform data not set
\n
"
);
dump_stack
();
return
-
ENODEV
;
}
tpa6130a2_client
=
client
;
i2c_set_clientdata
(
tpa6130a2_client
,
data
);
pdata
=
client
->
dev
.
platform_data
;
data
->
power_gpio
=
pdata
->
power_gpio
;
data
->
id
=
id
->
driver_data
;
mutex_init
(
&
data
->
mutex
);
...
...
@@ -466,10 +470,20 @@ static const struct i2c_device_id tpa6130a2_id[] = {
};
MODULE_DEVICE_TABLE
(
i2c
,
tpa6130a2_id
);
#if IS_ENABLED(CONFIG_OF)
static
const
struct
of_device_id
tpa6130a2_of_match
[]
=
{
{
.
compatible
=
"ti,tpa6130a2"
,
},
{
.
compatible
=
"ti,tpa6140a2"
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
tpa6130a2_of_match
);
#endif
static
struct
i2c_driver
tpa6130a2_i2c_driver
=
{
.
driver
=
{
.
name
=
"tpa6130a2"
,
.
owner
=
THIS_MODULE
,
.
of_match_table
=
of_match_ptr
(
tpa6130a2_of_match
),
},
.
probe
=
tpa6130a2_probe
,
.
remove
=
tpa6130a2_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