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
d6e116ba
Commit
d6e116ba
authored
Nov 03, 2010
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'takashi/fix/asoc' into for-2.6.37
parents
c46e0079
75e3f313
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/tlv320dac33.c
+26
-10
sound/soc/codecs/tpa6130a2.c
sound/soc/codecs/tpa6130a2.c
+3
-3
No files found.
sound/soc/codecs/tlv320dac33.c
View file @
d6e116ba
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
(1000000000 / ((rate * 1000) / samples))
(1000000000 / ((rate * 1000) / samples))
#define US_TO_SAMPLES(rate, us) \
#define US_TO_SAMPLES(rate, us) \
(rate / (1000000 /
us
))
(rate / (1000000 /
(us < 1000000 ? us : 1000000)
))
#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \
#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \
((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate)))
((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate)))
...
@@ -200,7 +200,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
...
@@ -200,7 +200,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
u8
*
value
)
u8
*
value
)
{
{
struct
tlv320dac33_priv
*
dac33
=
snd_soc_codec_get_drvdata
(
codec
);
struct
tlv320dac33_priv
*
dac33
=
snd_soc_codec_get_drvdata
(
codec
);
int
val
;
int
val
,
ret
=
0
;
*
value
=
reg
&
0xff
;
*
value
=
reg
&
0xff
;
...
@@ -210,6 +210,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
...
@@ -210,6 +210,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
if
(
val
<
0
)
{
if
(
val
<
0
)
{
dev_err
(
codec
->
dev
,
"Read failed (%d)
\n
"
,
val
);
dev_err
(
codec
->
dev
,
"Read failed (%d)
\n
"
,
val
);
value
[
0
]
=
dac33_read_reg_cache
(
codec
,
reg
);
value
[
0
]
=
dac33_read_reg_cache
(
codec
,
reg
);
ret
=
val
;
}
else
{
}
else
{
value
[
0
]
=
val
;
value
[
0
]
=
val
;
dac33_write_reg_cache
(
codec
,
reg
,
val
);
dac33_write_reg_cache
(
codec
,
reg
,
val
);
...
@@ -218,7 +219,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
...
@@ -218,7 +219,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
value
[
0
]
=
dac33_read_reg_cache
(
codec
,
reg
);
value
[
0
]
=
dac33_read_reg_cache
(
codec
,
reg
);
}
}
return
0
;
return
ret
;
}
}
static
int
dac33_write
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
,
static
int
dac33_write
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
,
...
@@ -329,13 +330,18 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
...
@@ -329,13 +330,18 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
dac33_read_reg_cache
(
codec
,
DAC33_LINER_TO_RLO_VOL
));
dac33_read_reg_cache
(
codec
,
DAC33_LINER_TO_RLO_VOL
));
}
}
static
inline
void
dac33_read_id
(
struct
snd_soc_codec
*
codec
)
static
inline
int
dac33_read_id
(
struct
snd_soc_codec
*
codec
)
{
{
int
i
,
ret
=
0
;
u8
reg
;
u8
reg
;
dac33_read
(
codec
,
DAC33_DEVICE_ID_MSB
,
&
reg
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
dac33_read
(
codec
,
DAC33_DEVICE_ID_LSB
,
&
reg
);
ret
=
dac33_read
(
codec
,
DAC33_DEVICE_ID_MSB
+
i
,
&
reg
);
dac33_read
(
codec
,
DAC33_DEVICE_REV_ID
,
&
reg
);
if
(
ret
<
0
)
break
;
}
return
ret
;
}
}
static
inline
void
dac33_soft_power
(
struct
snd_soc_codec
*
codec
,
int
power
)
static
inline
void
dac33_soft_power
(
struct
snd_soc_codec
*
codec
,
int
power
)
...
@@ -1076,6 +1082,9 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
...
@@ -1076,6 +1082,9 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
/* Number of samples under i2c latency */
/* Number of samples under i2c latency */
dac33
->
alarm_threshold
=
US_TO_SAMPLES
(
rate
,
dac33
->
alarm_threshold
=
US_TO_SAMPLES
(
rate
,
dac33
->
mode1_latency
);
dac33
->
mode1_latency
);
nsample_limit
=
DAC33_BUFFER_SIZE_SAMPLES
-
dac33
->
alarm_threshold
;
if
(
dac33
->
auto_fifo_config
)
{
if
(
dac33
->
auto_fifo_config
)
{
if
(
period_size
<=
dac33
->
alarm_threshold
)
if
(
period_size
<=
dac33
->
alarm_threshold
)
/*
/*
...
@@ -1086,6 +1095,8 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
...
@@ -1086,6 +1095,8 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
((
dac33
->
alarm_threshold
/
period_size
)
+
((
dac33
->
alarm_threshold
/
period_size
)
+
(
dac33
->
alarm_threshold
%
period_size
?
(
dac33
->
alarm_threshold
%
period_size
?
1
:
0
));
1
:
0
));
else
if
(
period_size
>
nsample_limit
)
dac33
->
nsample
=
nsample_limit
;
else
else
dac33
->
nsample
=
period_size
;
dac33
->
nsample
=
period_size
;
}
else
{
}
else
{
...
@@ -1097,8 +1108,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
...
@@ -1097,8 +1108,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
*/
*/
dac33
->
nsample_max
=
substream
->
runtime
->
buffer_size
-
dac33
->
nsample_max
=
substream
->
runtime
->
buffer_size
-
period_size
;
period_size
;
nsample_limit
=
DAC33_BUFFER_SIZE_SAMPLES
-
dac33
->
alarm_threshold
;
if
(
dac33
->
nsample_max
>
nsample_limit
)
if
(
dac33
->
nsample_max
>
nsample_limit
)
dac33
->
nsample_max
=
nsample_limit
;
dac33
->
nsample_max
=
nsample_limit
;
...
@@ -1414,9 +1424,15 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
...
@@ -1414,9 +1424,15 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
dev_err
(
codec
->
dev
,
"Failed to power up codec: %d
\n
"
,
ret
);
dev_err
(
codec
->
dev
,
"Failed to power up codec: %d
\n
"
,
ret
);
goto
err_power
;
goto
err_power
;
}
}
dac33_read_id
(
codec
);
ret
=
dac33_read_id
(
codec
);
dac33_hard_power
(
codec
,
0
);
dac33_hard_power
(
codec
,
0
);
if
(
ret
<
0
)
{
dev_err
(
codec
->
dev
,
"Failed to read chip ID: %d
\n
"
,
ret
);
ret
=
-
ENODEV
;
goto
err_power
;
}
/* Check if the IRQ number is valid and request it */
/* Check if the IRQ number is valid and request it */
if
(
dac33
->
irq
>=
0
)
{
if
(
dac33
->
irq
>=
0
)
{
ret
=
request_irq
(
dac33
->
irq
,
dac33_interrupt_handler
,
ret
=
request_irq
(
dac33
->
irq
,
dac33_interrupt_handler
,
...
...
sound/soc/codecs/tpa6130a2.c
View file @
d6e116ba
...
@@ -119,13 +119,13 @@ static int tpa6130a2_power(int power)
...
@@ -119,13 +119,13 @@ static int tpa6130a2_power(int power)
{
{
struct
tpa6130a2_data
*
data
;
struct
tpa6130a2_data
*
data
;
u8
val
;
u8
val
;
int
ret
;
int
ret
=
0
;
BUG_ON
(
tpa6130a2_client
==
NULL
);
BUG_ON
(
tpa6130a2_client
==
NULL
);
data
=
i2c_get_clientdata
(
tpa6130a2_client
);
data
=
i2c_get_clientdata
(
tpa6130a2_client
);
mutex_lock
(
&
data
->
mutex
);
mutex_lock
(
&
data
->
mutex
);
if
(
power
)
{
if
(
power
&&
!
data
->
power_state
)
{
/* Power on */
/* Power on */
if
(
data
->
power_gpio
>=
0
)
if
(
data
->
power_gpio
>=
0
)
gpio_set_value
(
data
->
power_gpio
,
1
);
gpio_set_value
(
data
->
power_gpio
,
1
);
...
@@ -153,7 +153,7 @@ static int tpa6130a2_power(int power)
...
@@ -153,7 +153,7 @@ static int tpa6130a2_power(int power)
val
=
tpa6130a2_read
(
TPA6130A2_REG_CONTROL
);
val
=
tpa6130a2_read
(
TPA6130A2_REG_CONTROL
);
val
&=
~
TPA6130A2_SWS
;
val
&=
~
TPA6130A2_SWS
;
tpa6130a2_i2c_write
(
TPA6130A2_REG_CONTROL
,
val
);
tpa6130a2_i2c_write
(
TPA6130A2_REG_CONTROL
,
val
);
}
else
{
}
else
if
(
!
power
&&
data
->
power_state
)
{
/* set SWS */
/* set SWS */
val
=
tpa6130a2_read
(
TPA6130A2_REG_CONTROL
);
val
=
tpa6130a2_read
(
TPA6130A2_REG_CONTROL
);
val
|=
TPA6130A2_SWS
;
val
|=
TPA6130A2_SWS
;
...
...
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