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
91898117
Commit
91898117
authored
Mar 28, 2018
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/pcm3168a' into asoc-next
parents
09a37cbc
29751c1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
26 deletions
+25
-26
sound/soc/codecs/pcm3168a.c
sound/soc/codecs/pcm3168a.c
+25
-26
No files found.
sound/soc/codecs/pcm3168a.c
View file @
91898117
...
...
@@ -287,8 +287,8 @@ static int pcm3168a_reset(struct pcm3168a_priv *pcm3168a)
static
int
pcm3168a_digital_mute
(
struct
snd_soc_dai
*
dai
,
int
mute
)
{
struct
snd_soc_co
dec
*
codec
=
dai
->
codec
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
dec_get_drvdata
(
codec
);
struct
snd_soc_co
mponent
*
component
=
dai
->
component
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
mponent_get_drvdata
(
component
);
regmap_write
(
pcm3168a
->
regmap
,
PCM3168A_DAC_MUTE
,
mute
?
0xff
:
0
);
...
...
@@ -298,7 +298,7 @@ static int pcm3168a_digital_mute(struct snd_soc_dai *dai, int mute)
static
int
pcm3168a_set_dai_sysclk
(
struct
snd_soc_dai
*
dai
,
int
clk_id
,
unsigned
int
freq
,
int
dir
)
{
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
dec_get_drvdata
(
dai
->
codec
);
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
mponent_get_drvdata
(
dai
->
component
);
int
ret
;
if
(
freq
>
PCM1368A_MAX_SYSCLK
)
...
...
@@ -316,8 +316,8 @@ static int pcm3168a_set_dai_sysclk(struct snd_soc_dai *dai,
static
int
pcm3168a_set_dai_fmt
(
struct
snd_soc_dai
*
dai
,
unsigned
int
format
,
bool
dac
)
{
struct
snd_soc_co
dec
*
codec
=
dai
->
codec
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
dec_get_drvdata
(
codec
);
struct
snd_soc_co
mponent
*
component
=
dai
->
component
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
mponent_get_drvdata
(
component
);
u32
fmt
,
reg
,
mask
,
shift
;
bool
master_mode
;
...
...
@@ -338,7 +338,7 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai,
fmt
=
PCM3168A_FMT_DSP_B
;
break
;
default:
dev_err
(
co
dec
->
dev
,
"unsupported dai format
\n
"
);
dev_err
(
co
mponent
->
dev
,
"unsupported dai format
\n
"
);
return
-
EINVAL
;
}
...
...
@@ -350,7 +350,7 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai,
master_mode
=
true
;
break
;
default:
dev_err
(
co
dec
->
dev
,
"unsupported master/slave mode
\n
"
);
dev_err
(
co
mponent
->
dev
,
"unsupported master/slave mode
\n
"
);
return
-
EINVAL
;
}
...
...
@@ -396,8 +396,8 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
struct
snd_pcm_hw_params
*
params
,
struct
snd_soc_dai
*
dai
)
{
struct
snd_soc_co
dec
*
codec
=
dai
->
codec
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
dec_get_drvdata
(
codec
);
struct
snd_soc_co
mponent
*
component
=
dai
->
component
;
struct
pcm3168a_priv
*
pcm3168a
=
snd_soc_co
mponent_get_drvdata
(
component
);
bool
tx
,
master_mode
;
u32
val
,
mask
,
shift
,
reg
;
unsigned
int
rate
,
fmt
,
ratio
,
max_ratio
;
...
...
@@ -430,7 +430,7 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
}
if
(
i
==
max_ratio
)
{
dev_err
(
co
dec
->
dev
,
"unsupported sysclk ratio
\n
"
);
dev_err
(
co
mponent
->
dev
,
"unsupported sysclk ratio
\n
"
);
return
-
EINVAL
;
}
...
...
@@ -438,21 +438,21 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
switch
(
min_frame_size
)
{
case
32
:
if
(
master_mode
||
(
fmt
!=
PCM3168A_FMT_RIGHT_J
))
{
dev_err
(
co
dec
->
dev
,
"32-bit frames are supported only for slave mode using right justified
\n
"
);
dev_err
(
co
mponent
->
dev
,
"32-bit frames are supported only for slave mode using right justified
\n
"
);
return
-
EINVAL
;
}
fmt
=
PCM3168A_FMT_RIGHT_J_16
;
break
;
case
48
:
if
(
master_mode
||
(
fmt
&
PCM3168A_FMT_DSP_MASK
))
{
dev_err
(
co
dec
->
dev
,
"48-bit frames not supported in master mode, or slave mode using DSP
\n
"
);
dev_err
(
co
mponent
->
dev
,
"48-bit frames not supported in master mode, or slave mode using DSP
\n
"
);
return
-
EINVAL
;
}
break
;
case
64
:
break
;
default:
dev_err
(
co
dec
->
dev
,
"unsupported frame size: %d
\n
"
,
min_frame_size
);
dev_err
(
co
mponent
->
dev
,
"unsupported frame size: %d
\n
"
,
min_frame_size
);
return
-
EINVAL
;
}
...
...
@@ -595,16 +595,16 @@ const struct regmap_config pcm3168a_regmap = {
};
EXPORT_SYMBOL_GPL
(
pcm3168a_regmap
);
static
const
struct
snd_soc_co
dec
_driver
pcm3168a_driver
=
{
.
idle_bias_off
=
true
,
.
component_driver
=
{
.
controls
=
pcm3168a_snd_control
s
,
.
num_controls
=
ARRAY_SIZE
(
pcm3168a_snd_control
s
),
.
dapm_widgets
=
pcm3168a_dapm_widget
s
,
.
num_dapm_widgets
=
ARRAY_SIZE
(
pcm3168a_dapm_widget
s
),
.
dapm_routes
=
pcm3168a_dapm_routes
,
.
num_dapm_routes
=
ARRAY_SIZE
(
pcm3168a_dapm_routes
)
}
,
static
const
struct
snd_soc_co
mponent
_driver
pcm3168a_driver
=
{
.
controls
=
pcm3168a_snd_controls
,
.
num_controls
=
ARRAY_SIZE
(
pcm3168a_snd_controls
),
.
dapm_widgets
=
pcm3168a_dapm_widget
s
,
.
num_dapm_widgets
=
ARRAY_SIZE
(
pcm3168a_dapm_widget
s
),
.
dapm_routes
=
pcm3168a_dapm_route
s
,
.
num_dapm_routes
=
ARRAY_SIZE
(
pcm3168a_dapm_route
s
),
.
use_pmdown_time
=
1
,
.
endianness
=
1
,
.
non_legacy_dai_naming
=
1
,
};
int
pcm3168a_probe
(
struct
device
*
dev
,
struct
regmap
*
regmap
)
...
...
@@ -669,10 +669,10 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
pm_runtime_enable
(
dev
);
pm_runtime_idle
(
dev
);
ret
=
snd_soc_register_codec
(
dev
,
&
pcm3168a_driver
,
pcm3168a_dais
,
ret
=
devm_snd_soc_register_component
(
dev
,
&
pcm3168a_driver
,
pcm3168a_dais
,
ARRAY_SIZE
(
pcm3168a_dais
));
if
(
ret
)
{
dev_err
(
dev
,
"failed to register co
dec
: %d
\n
"
,
ret
);
dev_err
(
dev
,
"failed to register co
mponent
: %d
\n
"
,
ret
);
goto
err_regulator
;
}
...
...
@@ -692,7 +692,6 @@ void pcm3168a_remove(struct device *dev)
{
struct
pcm3168a_priv
*
pcm3168a
=
dev_get_drvdata
(
dev
);
snd_soc_unregister_codec
(
dev
);
pm_runtime_disable
(
dev
);
regulator_bulk_disable
(
ARRAY_SIZE
(
pcm3168a
->
supplies
),
pcm3168a
->
supplies
);
...
...
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