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
86a94277
Commit
86a94277
authored
Dec 10, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/wm8962' into asoc-next
parents
e7d28c8c
b439c6d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
16 deletions
+8
-16
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8962.c
+8
-16
No files found.
sound/soc/codecs/wm8962.c
View file @
86a94277
...
...
@@ -3610,7 +3610,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
wm8962
->
supplies
);
i
++
)
wm8962
->
supplies
[
i
].
supply
=
wm8962_supply_names
[
i
];
ret
=
regulator_bulk_get
(
&
i2c
->
dev
,
ARRAY_SIZE
(
wm8962
->
supplies
),
ret
=
devm_
regulator_bulk_get
(
&
i2c
->
dev
,
ARRAY_SIZE
(
wm8962
->
supplies
),
wm8962
->
supplies
);
if
(
ret
!=
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to request supplies: %d
\n
"
,
ret
);
...
...
@@ -3621,10 +3621,10 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
wm8962
->
supplies
);
if
(
ret
!=
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to enable supplies: %d
\n
"
,
ret
);
goto
err_g
et
;
return
r
et
;
}
wm8962
->
regmap
=
regmap_init_i2c
(
i2c
,
&
wm8962_regmap
);
wm8962
->
regmap
=
devm_
regmap_init_i2c
(
i2c
,
&
wm8962_regmap
);
if
(
IS_ERR
(
wm8962
->
regmap
))
{
ret
=
PTR_ERR
(
wm8962
->
regmap
);
dev_err
(
&
i2c
->
dev
,
"Failed to allocate regmap: %d
\n
"
,
ret
);
...
...
@@ -3641,20 +3641,20 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
ret
=
regmap_read
(
wm8962
->
regmap
,
WM8962_SOFTWARE_RESET
,
&
reg
);
if
(
ret
<
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to read ID register
\n
"
);
goto
err_
regmap
;
goto
err_
enable
;
}
if
(
reg
!=
0x6243
)
{
dev_err
(
&
i2c
->
dev
,
"Device is not a WM8962, ID %x != 0x6243
\n
"
,
reg
);
ret
=
-
EINVAL
;
goto
err_
regmap
;
goto
err_
enable
;
}
ret
=
regmap_read
(
wm8962
->
regmap
,
WM8962_RIGHT_INPUT_VOLUME
,
&
reg
);
if
(
ret
<
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to read device revision: %d
\n
"
,
ret
);
goto
err_
regmap
;
goto
err_
enable
;
}
dev_info
(
&
i2c
->
dev
,
"customer id %x revision %c
\n
"
,
...
...
@@ -3667,7 +3667,7 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
ret
=
wm8962_reset
(
wm8962
);
if
(
ret
<
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to issue reset
\n
"
);
goto
err_
regmap
;
goto
err_
enable
;
}
if
(
pdata
&&
pdata
->
in4_dc_measure
)
{
...
...
@@ -3686,30 +3686,22 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
ret
=
snd_soc_register_codec
(
&
i2c
->
dev
,
&
soc_codec_dev_wm8962
,
&
wm8962_dai
,
1
);
if
(
ret
<
0
)
goto
err_
regmap
;
goto
err_
enable
;
/* The drivers should power up as needed */
regulator_bulk_disable
(
ARRAY_SIZE
(
wm8962
->
supplies
),
wm8962
->
supplies
);
return
0
;
err_regmap:
regmap_exit
(
wm8962
->
regmap
);
err_enable:
regulator_bulk_disable
(
ARRAY_SIZE
(
wm8962
->
supplies
),
wm8962
->
supplies
);
err_get:
regulator_bulk_free
(
ARRAY_SIZE
(
wm8962
->
supplies
),
wm8962
->
supplies
);
err:
return
ret
;
}
static
__devexit
int
wm8962_i2c_remove
(
struct
i2c_client
*
client
)
{
struct
wm8962_priv
*
wm8962
=
dev_get_drvdata
(
&
client
->
dev
);
snd_soc_unregister_codec
(
&
client
->
dev
);
regmap_exit
(
wm8962
->
regmap
);
regulator_bulk_free
(
ARRAY_SIZE
(
wm8962
->
supplies
),
wm8962
->
supplies
);
return
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