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
c0324fb3
Commit
c0324fb3
authored
Dec 10, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/tlv320aic32x4' into asoc-next
parents
2ca5e86c
1858fe97
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
include/sound/tlv320aic32x4.h
include/sound/tlv320aic32x4.h
+1
-0
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic32x4.c
+24
-0
sound/soc/codecs/tlv320aic32x4.h
sound/soc/codecs/tlv320aic32x4.h
+3
-0
No files found.
include/sound/tlv320aic32x4.h
View file @
c0324fb3
...
...
@@ -26,6 +26,7 @@ struct aic32x4_pdata {
u32
power_cfg
;
u32
micpga_routing
;
bool
swapdacs
;
int
rstn_gpio
;
};
#endif
sound/soc/codecs/tlv320aic32x4.c
View file @
c0324fb3
...
...
@@ -28,6 +28,7 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/cdev.h>
#include <linux/slab.h>
...
...
@@ -65,6 +66,7 @@ struct aic32x4_priv {
u32
power_cfg
;
u32
micpga_routing
;
bool
swapdacs
;
int
rstn_gpio
;
};
/* 0dB min, 1dB steps */
...
...
@@ -627,10 +629,20 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
{
struct
aic32x4_priv
*
aic32x4
=
snd_soc_codec_get_drvdata
(
codec
);
u32
tmp_reg
;
int
ret
;
codec
->
hw_write
=
(
hw_write_t
)
i2c_master_send
;
codec
->
control_data
=
aic32x4
->
control_data
;
if
(
aic32x4
->
rstn_gpio
>=
0
)
{
ret
=
devm_gpio_request_one
(
codec
->
dev
,
aic32x4
->
rstn_gpio
,
GPIOF_OUT_INIT_LOW
,
"tlv320aic32x4 rstn"
);
if
(
ret
!=
0
)
return
ret
;
ndelay
(
10
);
gpio_set_value
(
aic32x4
->
rstn_gpio
,
1
);
}
snd_soc_write
(
codec
,
AIC32X4_RESET
,
0x01
);
/* Power platform configuration */
...
...
@@ -675,6 +687,16 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
ARRAY_SIZE
(
aic32x4_snd_controls
));
aic32x4_add_widgets
(
codec
);
/*
* Workaround: for an unknown reason, the ADC needs to be powered up
* and down for the first capture to work properly. It seems related to
* a HW BUG or some kind of behavior not documented in the datasheet.
*/
tmp_reg
=
snd_soc_read
(
codec
,
AIC32X4_ADCSETUP
);
snd_soc_write
(
codec
,
AIC32X4_ADCSETUP
,
tmp_reg
|
AIC32X4_LADC_EN
|
AIC32X4_RADC_EN
);
snd_soc_write
(
codec
,
AIC32X4_ADCSETUP
,
tmp_reg
);
return
0
;
}
...
...
@@ -713,10 +735,12 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c,
aic32x4
->
power_cfg
=
pdata
->
power_cfg
;
aic32x4
->
swapdacs
=
pdata
->
swapdacs
;
aic32x4
->
micpga_routing
=
pdata
->
micpga_routing
;
aic32x4
->
rstn_gpio
=
pdata
->
rstn_gpio
;
}
else
{
aic32x4
->
power_cfg
=
0
;
aic32x4
->
swapdacs
=
false
;
aic32x4
->
micpga_routing
=
0
;
aic32x4
->
rstn_gpio
=
-
1
;
}
ret
=
snd_soc_register_codec
(
&
i2c
->
dev
,
...
...
sound/soc/codecs/tlv320aic32x4.h
View file @
c0324fb3
...
...
@@ -94,6 +94,9 @@
#define AIC32X4_WORD_LEN_24BITS 0x02
#define AIC32X4_WORD_LEN_32BITS 0x03
#define AIC32X4_LADC_EN (1 << 7)
#define AIC32X4_RADC_EN (1 << 6)
#define AIC32X4_I2S_MODE 0x00
#define AIC32X4_DSP_MODE 0x01
#define AIC32X4_RIGHT_JUSTIFIED_MODE 0x02
...
...
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