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
d6c513e8
Commit
d6c513e8
authored
Jan 11, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branches 'asoc/topic/da7218' and 'asoc/topic/da7219' into asoc-next
parents
e72ceb2a
f644eb62
4acfa36b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
22 deletions
+99
-22
sound/soc/codecs/da7218.c
sound/soc/codecs/da7218.c
+37
-10
sound/soc/codecs/da7219.c
sound/soc/codecs/da7219.c
+62
-12
No files found.
sound/soc/codecs/da7218.c
View file @
d6c513e8
...
...
@@ -1954,6 +1954,10 @@ static int da7218_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return
-
EINVAL
;
}
switch
(
fmt
&
SND_SOC_DAIFMT_FORMAT_MASK
)
{
case
SND_SOC_DAIFMT_I2S
:
case
SND_SOC_DAIFMT_LEFT_J
:
case
SND_SOC_DAIFMT_RIGHT_J
:
switch
(
fmt
&
SND_SOC_DAIFMT_INV_MASK
)
{
case
SND_SOC_DAIFMT_NB_NF
:
break
;
...
...
@@ -1964,7 +1968,30 @@ static int da7218_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
dai_clk_mode
|=
DA7218_DAI_CLK_POL_INV
;
break
;
case
SND_SOC_DAIFMT_IB_IF
:
dai_clk_mode
|=
DA7218_DAI_WCLK_POL_INV
|
DA7218_DAI_CLK_POL_INV
;
dai_clk_mode
|=
DA7218_DAI_WCLK_POL_INV
|
DA7218_DAI_CLK_POL_INV
;
break
;
default:
return
-
EINVAL
;
}
break
;
case
SND_SOC_DAIFMT_DSP_B
:
switch
(
fmt
&
SND_SOC_DAIFMT_INV_MASK
)
{
case
SND_SOC_DAIFMT_NB_NF
:
dai_clk_mode
|=
DA7218_DAI_CLK_POL_INV
;
break
;
case
SND_SOC_DAIFMT_NB_IF
:
dai_clk_mode
|=
DA7218_DAI_WCLK_POL_INV
|
DA7218_DAI_CLK_POL_INV
;
break
;
case
SND_SOC_DAIFMT_IB_NF
:
break
;
case
SND_SOC_DAIFMT_IB_IF
:
dai_clk_mode
|=
DA7218_DAI_WCLK_POL_INV
;
break
;
default:
return
-
EINVAL
;
}
break
;
default:
return
-
EINVAL
;
...
...
sound/soc/codecs/da7219.c
View file @
d6c513e8
...
...
@@ -1156,6 +1156,10 @@ static int da7219_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
return
-
EINVAL
;
}
switch
(
fmt
&
SND_SOC_DAIFMT_FORMAT_MASK
)
{
case
SND_SOC_DAIFMT_I2S
:
case
SND_SOC_DAIFMT_LEFT_J
:
case
SND_SOC_DAIFMT_RIGHT_J
:
switch
(
fmt
&
SND_SOC_DAIFMT_INV_MASK
)
{
case
SND_SOC_DAIFMT_NB_NF
:
break
;
...
...
@@ -1172,6 +1176,28 @@ static int da7219_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
default:
return
-
EINVAL
;
}
break
;
case
SND_SOC_DAIFMT_DSP_B
:
switch
(
fmt
&
SND_SOC_DAIFMT_INV_MASK
)
{
case
SND_SOC_DAIFMT_NB_NF
:
dai_clk_mode
|=
DA7219_DAI_CLK_POL_INV
;
break
;
case
SND_SOC_DAIFMT_NB_IF
:
dai_clk_mode
|=
DA7219_DAI_WCLK_POL_INV
|
DA7219_DAI_CLK_POL_INV
;
break
;
case
SND_SOC_DAIFMT_IB_NF
:
break
;
case
SND_SOC_DAIFMT_IB_IF
:
dai_clk_mode
|=
DA7219_DAI_WCLK_POL_INV
;
break
;
default:
return
-
EINVAL
;
}
break
;
default:
return
-
EINVAL
;
}
switch
(
fmt
&
SND_SOC_DAIFMT_FORMAT_MASK
)
{
case
SND_SOC_DAIFMT_I2S
:
...
...
@@ -1592,9 +1618,14 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
}
}
static
struct
reg_sequence
da7219_rev_aa_patch
[]
=
{
{
DA7219_REFERENCES
,
0x08
},
};
static
int
da7219_probe
(
struct
snd_soc_codec
*
codec
)
{
struct
da7219_priv
*
da7219
=
snd_soc_codec_get_drvdata
(
codec
);
unsigned
int
rev
;
int
ret
;
mutex_init
(
&
da7219
->
lock
);
...
...
@@ -1604,6 +1635,26 @@ static int da7219_probe(struct snd_soc_codec *codec)
if
(
ret
)
return
ret
;
ret
=
regmap_read
(
da7219
->
regmap
,
DA7219_CHIP_REVISION
,
&
rev
);
if
(
ret
)
{
dev_err
(
codec
->
dev
,
"Failed to read chip revision: %d
\n
"
,
ret
);
goto
err_disable_reg
;
}
switch
(
rev
&
DA7219_CHIP_MINOR_MASK
)
{
case
0
:
ret
=
regmap_register_patch
(
da7219
->
regmap
,
da7219_rev_aa_patch
,
ARRAY_SIZE
(
da7219_rev_aa_patch
));
if
(
ret
)
{
dev_err
(
codec
->
dev
,
"Failed to register AA patch: %d
\n
"
,
ret
);
goto
err_disable_reg
;
}
break
;
default:
break
;
}
/* Handle DT/Platform data */
if
(
codec
->
dev
->
of_node
)
da7219
->
pdata
=
da7219_of_to_pdata
(
codec
);
...
...
@@ -1774,7 +1825,6 @@ static struct reg_default da7219_reg_defaults[] = {
{
DA7219_MIXOUT_R_CTRL
,
0x10
},
{
DA7219_CHIP_ID1
,
0x23
},
{
DA7219_CHIP_ID2
,
0x93
},
{
DA7219_CHIP_REVISION
,
0x00
},
{
DA7219_IO_CTRL
,
0x00
},
{
DA7219_GAIN_RAMP_CTRL
,
0x00
},
{
DA7219_PC_COUNT
,
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