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
8dbdc946
Commit
8dbdc946
authored
Jan 26, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/twl-breakage' into asoc-next
parents
bc47d183
8146acff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
14 deletions
+13
-14
sound/soc/codecs/twl4030.c
sound/soc/codecs/twl4030.c
+4
-5
sound/soc/codecs/twl6040.c
sound/soc/codecs/twl6040.c
+9
-9
No files found.
sound/soc/codecs/twl4030.c
View file @
8dbdc946
...
...
@@ -240,7 +240,6 @@ static struct twl4030_codec_data *twl4030_get_pdata(struct snd_soc_codec *codec)
sizeof
(
struct
twl4030_codec_data
),
GFP_KERNEL
);
if
(
!
pdata
)
{
dev_err
(
codec
->
dev
,
"Can not allocate memory
\n
"
);
of_node_put
(
twl4030_codec_node
);
return
NULL
;
}
...
...
@@ -851,14 +850,14 @@ static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol,
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
ucontrol
->
value
.
integer
.
value
[
0
]
=
(
snd_soc
_read
(
codec
,
reg
)
>>
shift
)
&
mask
;
(
twl4030
_read
(
codec
,
reg
)
>>
shift
)
&
mask
;
if
(
ucontrol
->
value
.
integer
.
value
[
0
])
ucontrol
->
value
.
integer
.
value
[
0
]
=
max
+
1
-
ucontrol
->
value
.
integer
.
value
[
0
];
if
(
shift
!=
rshift
)
{
ucontrol
->
value
.
integer
.
value
[
1
]
=
(
snd_soc
_read
(
codec
,
reg
)
>>
rshift
)
&
mask
;
(
twl4030
_read
(
codec
,
reg
)
>>
rshift
)
&
mask
;
if
(
ucontrol
->
value
.
integer
.
value
[
1
])
ucontrol
->
value
.
integer
.
value
[
1
]
=
max
+
1
-
ucontrol
->
value
.
integer
.
value
[
1
];
...
...
@@ -909,9 +908,9 @@ static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
ucontrol
->
value
.
integer
.
value
[
0
]
=
(
snd_soc
_read
(
codec
,
reg
)
>>
shift
)
&
mask
;
(
twl4030
_read
(
codec
,
reg
)
>>
shift
)
&
mask
;
ucontrol
->
value
.
integer
.
value
[
1
]
=
(
snd_soc
_read
(
codec
,
reg2
)
>>
shift
)
&
mask
;
(
twl4030
_read
(
codec
,
reg2
)
>>
shift
)
&
mask
;
if
(
ucontrol
->
value
.
integer
.
value
[
0
])
ucontrol
->
value
.
integer
.
value
[
0
]
=
...
...
sound/soc/codecs/twl6040.c
View file @
8dbdc946
...
...
@@ -106,10 +106,12 @@ static const struct snd_pcm_hw_constraint_list sysclk_constraints[] = {
{
.
count
=
ARRAY_SIZE
(
hp_rates
),
.
list
=
hp_rates
,
},
};
#define to_twl6040(codec) dev_get_drvdata((codec)->dev->parent)
static
unsigned
int
twl6040_read
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
)
{
struct
twl6040_data
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
u8
value
;
if
(
reg
>=
TWL6040_CACHEREGNUM
)
...
...
@@ -171,7 +173,7 @@ static inline void twl6040_update_dl12_cache(struct snd_soc_codec *codec,
static
int
twl6040_write
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
,
unsigned
int
value
)
{
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
if
(
reg
>=
TWL6040_CACHEREGNUM
)
return
-
EIO
;
...
...
@@ -541,7 +543,7 @@ int twl6040_get_dl1_gain(struct snd_soc_codec *codec)
if
(
snd_soc_dapm_get_pin_status
(
dapm
,
"HSOR"
)
||
snd_soc_dapm_get_pin_status
(
dapm
,
"HSOL"
))
{
u8
val
=
snd_soc
_read
(
codec
,
TWL6040_REG_HSLCTL
);
u8
val
=
twl6040
_read
(
codec
,
TWL6040_REG_HSLCTL
);
if
(
val
&
TWL6040_HSDACMODE
)
/* HSDACL in LP mode */
return
-
8
;
/* -8dB */
...
...
@@ -572,7 +574,7 @@ EXPORT_SYMBOL_GPL(twl6040_get_trim_value);
int
twl6040_get_hs_step_size
(
struct
snd_soc_codec
*
codec
)
{
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
if
(
twl6040_get_revid
(
twl6040
)
<
TWL6040_REV_ES1_3
)
/* For ES under ES_1.3 HS step is 2 mV */
...
...
@@ -830,7 +832,7 @@ static const struct snd_soc_dapm_route intercon[] = {
static
int
twl6040_set_bias_level
(
struct
snd_soc_codec
*
codec
,
enum
snd_soc_bias_level
level
)
{
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
struct
twl6040_data
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
int
ret
=
0
;
...
...
@@ -922,7 +924,7 @@ static int twl6040_prepare(struct snd_pcm_substream *substream,
struct
snd_soc_dai
*
dai
)
{
struct
snd_soc_codec
*
codec
=
dai
->
codec
;
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
struct
twl6040_data
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
int
ret
;
...
...
@@ -964,7 +966,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai,
static
void
twl6040_mute_path
(
struct
snd_soc_codec
*
codec
,
enum
twl6040_dai_id
id
,
int
mute
)
{
struct
twl6040
*
twl6040
=
codec
->
control_data
;
struct
twl6040
*
twl6040
=
to_twl6040
(
codec
)
;
struct
twl6040_data
*
priv
=
snd_soc_codec_get_drvdata
(
codec
);
int
hslctl
,
hsrctl
,
earctl
;
int
hflctl
,
hfrctl
;
...
...
@@ -1108,7 +1110,6 @@ static struct snd_soc_dai_driver twl6040_dai[] = {
static
int
twl6040_probe
(
struct
snd_soc_codec
*
codec
)
{
struct
twl6040_data
*
priv
;
struct
twl6040
*
twl6040
=
dev_get_drvdata
(
codec
->
dev
->
parent
);
struct
platform_device
*
pdev
=
to_platform_device
(
codec
->
dev
);
int
ret
=
0
;
...
...
@@ -1119,7 +1120,6 @@ static int twl6040_probe(struct snd_soc_codec *codec)
snd_soc_codec_set_drvdata
(
codec
,
priv
);
priv
->
codec
=
codec
;
codec
->
control_data
=
twl6040
;
priv
->
plug_irq
=
platform_get_irq
(
pdev
,
0
);
if
(
priv
->
plug_irq
<
0
)
{
...
...
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