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
b12a1906
Commit
b12a1906
authored
Jun 03, 2014
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branches 'asoc/topic/max98090' and 'asoc/topic/max98095' into asoc-next
parents
9713d5d0
b10ab7b8
e3048c3d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
4 deletions
+64
-4
Documentation/devicetree/bindings/sound/max98090.txt
Documentation/devicetree/bindings/sound/max98090.txt
+6
-0
Documentation/devicetree/bindings/sound/max98095.txt
Documentation/devicetree/bindings/sound/max98095.txt
+6
-0
sound/soc/codecs/max98090.c
sound/soc/codecs/max98090.c
+27
-4
sound/soc/codecs/max98090.h
sound/soc/codecs/max98090.h
+1
-0
sound/soc/codecs/max98095.c
sound/soc/codecs/max98095.c
+24
-0
No files found.
Documentation/devicetree/bindings/sound/max98090.txt
View file @
b12a1906
...
@@ -10,6 +10,12 @@ Required properties:
...
@@ -10,6 +10,12 @@ Required properties:
- interrupts : The CODEC's interrupt output.
- interrupts : The CODEC's interrupt output.
Optional properties:
- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"
Pins on the device (for linking into audio routes):
Pins on the device (for linking into audio routes):
* MIC1
* MIC1
...
...
Documentation/devicetree/bindings/sound/max98095.txt
View file @
b12a1906
...
@@ -8,6 +8,12 @@ Required properties:
...
@@ -8,6 +8,12 @@ Required properties:
- reg : The I2C address of the device.
- reg : The I2C address of the device.
Optional properties:
- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"
Example:
Example:
max98095: codec@11 {
max98095: codec@11 {
...
...
sound/soc/codecs/max98090.c
View file @
b12a1906
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <linux/regmap.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/acpi.h>
#include <linux/clk.h>
#include <sound/jack.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/pcm_params.h>
...
@@ -1547,19 +1548,19 @@ static const int lrclk_rates[] = {
...
@@ -1547,19 +1548,19 @@ static const int lrclk_rates[] = {
};
};
static
const
int
user_pclk_rates
[]
=
{
static
const
int
user_pclk_rates
[]
=
{
13000000
,
13000000
13000000
,
13000000
,
19200000
,
19200000
,
};
};
static
const
int
user_lrclk_rates
[]
=
{
static
const
int
user_lrclk_rates
[]
=
{
44100
,
48000
44100
,
48000
,
44100
,
48000
,
};
};
static
const
unsigned
long
long
ni_value
[]
=
{
static
const
unsigned
long
long
ni_value
[]
=
{
3528
,
768
3528
,
768
,
441
,
8
};
};
static
const
unsigned
long
long
mi_value
[]
=
{
static
const
unsigned
long
long
mi_value
[]
=
{
8125
,
1625
8125
,
1625
,
1500
,
25
};
};
static
void
max98090_configure_bclk
(
struct
snd_soc_codec
*
codec
)
static
void
max98090_configure_bclk
(
struct
snd_soc_codec
*
codec
)
...
@@ -1800,6 +1801,19 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
...
@@ -1800,6 +1801,19 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
break
;
break
;
case
SND_SOC_BIAS_PREPARE
:
case
SND_SOC_BIAS_PREPARE
:
/*
* SND_SOC_BIAS_PREPARE is called while preparing for a
* transition to ON or away from ON. If current bias_level
* is SND_SOC_BIAS_ON, then it is preparing for a transition
* away from ON. Disable the clock in that case, otherwise
* enable it.
*/
if
(
!
IS_ERR
(
max98090
->
mclk
))
{
if
(
codec
->
dapm
.
bias_level
==
SND_SOC_BIAS_ON
)
clk_disable_unprepare
(
max98090
->
mclk
);
else
clk_prepare_enable
(
max98090
->
mclk
);
}
break
;
break
;
case
SND_SOC_BIAS_STANDBY
:
case
SND_SOC_BIAS_STANDBY
:
...
@@ -1929,6 +1943,11 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai,
...
@@ -1929,6 +1943,11 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai,
if
(
freq
==
max98090
->
sysclk
)
if
(
freq
==
max98090
->
sysclk
)
return
0
;
return
0
;
if
(
!
IS_ERR
(
max98090
->
mclk
))
{
freq
=
clk_round_rate
(
max98090
->
mclk
,
freq
);
clk_set_rate
(
max98090
->
mclk
,
freq
);
}
/* Setup clocks for slave mode, and using the PLL
/* Setup clocks for slave mode, and using the PLL
* PSCLK = 0x01 (when master clk is 10MHz to 20MHz)
* PSCLK = 0x01 (when master clk is 10MHz to 20MHz)
* 0x02 (when master clk is 20MHz to 40MHz)..
* 0x02 (when master clk is 20MHz to 40MHz)..
...
@@ -2213,6 +2232,10 @@ static int max98090_probe(struct snd_soc_codec *codec)
...
@@ -2213,6 +2232,10 @@ static int max98090_probe(struct snd_soc_codec *codec)
dev_dbg
(
codec
->
dev
,
"max98090_probe
\n
"
);
dev_dbg
(
codec
->
dev
,
"max98090_probe
\n
"
);
max98090
->
mclk
=
devm_clk_get
(
codec
->
dev
,
"mclk"
);
if
(
PTR_ERR
(
max98090
->
mclk
)
==
-
EPROBE_DEFER
)
return
-
EPROBE_DEFER
;
max98090
->
codec
=
codec
;
max98090
->
codec
=
codec
;
/* Reset the codec, the DSP core, and disable all interrupts */
/* Reset the codec, the DSP core, and disable all interrupts */
...
...
sound/soc/codecs/max98090.h
View file @
b12a1906
...
@@ -1524,6 +1524,7 @@ struct max98090_priv {
...
@@ -1524,6 +1524,7 @@ struct max98090_priv {
struct
snd_soc_codec
*
codec
;
struct
snd_soc_codec
*
codec
;
enum
max98090_type
devtype
;
enum
max98090_type
devtype
;
struct
max98090_pdata
*
pdata
;
struct
max98090_pdata
*
pdata
;
struct
clk
*
mclk
;
unsigned
int
sysclk
;
unsigned
int
sysclk
;
unsigned
int
bclk
;
unsigned
int
bclk
;
unsigned
int
lrclk
;
unsigned
int
lrclk
;
...
...
sound/soc/codecs/max98095.c
View file @
b12a1906
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/i2c.h>
#include <linux/clk.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>
...
@@ -42,6 +43,7 @@ struct max98095_priv {
...
@@ -42,6 +43,7 @@ struct max98095_priv {
struct
regmap
*
regmap
;
struct
regmap
*
regmap
;
enum
max98095_type
devtype
;
enum
max98095_type
devtype
;
struct
max98095_pdata
*
pdata
;
struct
max98095_pdata
*
pdata
;
struct
clk
*
mclk
;
unsigned
int
sysclk
;
unsigned
int
sysclk
;
struct
max98095_cdata
dai
[
3
];
struct
max98095_cdata
dai
[
3
];
const
char
**
eq_texts
;
const
char
**
eq_texts
;
...
@@ -1395,6 +1397,11 @@ static int max98095_dai_set_sysclk(struct snd_soc_dai *dai,
...
@@ -1395,6 +1397,11 @@ static int max98095_dai_set_sysclk(struct snd_soc_dai *dai,
if
(
freq
==
max98095
->
sysclk
)
if
(
freq
==
max98095
->
sysclk
)
return
0
;
return
0
;
if
(
!
IS_ERR
(
max98095
->
mclk
))
{
freq
=
clk_round_rate
(
max98095
->
mclk
,
freq
);
clk_set_rate
(
max98095
->
mclk
,
freq
);
}
/* Setup clocks for slave mode, and using the PLL
/* Setup clocks for slave mode, and using the PLL
* PSCLK = 0x01 (when master clk is 10MHz to 20MHz)
* PSCLK = 0x01 (when master clk is 10MHz to 20MHz)
* 0x02 (when master clk is 20MHz to 40MHz)..
* 0x02 (when master clk is 20MHz to 40MHz)..
...
@@ -1634,6 +1641,19 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec,
...
@@ -1634,6 +1641,19 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec,
break
;
break
;
case
SND_SOC_BIAS_PREPARE
:
case
SND_SOC_BIAS_PREPARE
:
/*
* SND_SOC_BIAS_PREPARE is called while preparing for a
* transition to ON or away from ON. If current bias_level
* is SND_SOC_BIAS_ON, then it is preparing for a transition
* away from ON. Disable the clock in that case, otherwise
* enable it.
*/
if
(
!
IS_ERR
(
max98095
->
mclk
))
{
if
(
codec
->
dapm
.
bias_level
==
SND_SOC_BIAS_ON
)
clk_disable_unprepare
(
max98095
->
mclk
);
else
clk_prepare_enable
(
max98095
->
mclk
);
}
break
;
break
;
case
SND_SOC_BIAS_STANDBY
:
case
SND_SOC_BIAS_STANDBY
:
...
@@ -2238,6 +2258,10 @@ static int max98095_probe(struct snd_soc_codec *codec)
...
@@ -2238,6 +2258,10 @@ static int max98095_probe(struct snd_soc_codec *codec)
struct
i2c_client
*
client
;
struct
i2c_client
*
client
;
int
ret
=
0
;
int
ret
=
0
;
max98095
->
mclk
=
devm_clk_get
(
codec
->
dev
,
"mclk"
);
if
(
PTR_ERR
(
max98095
->
mclk
)
==
-
EPROBE_DEFER
)
return
-
EPROBE_DEFER
;
/* reset the codec, the DSP core, and disable all interrupts */
/* reset the codec, the DSP core, and disable all interrupts */
max98095_reset
(
codec
);
max98095_reset
(
codec
);
...
...
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