提交 a98a0bc6 编写于 作者: A Alexander Sverdlin 提交者: Mark Brown

ASoC: CS4271: Move Chip Select control out of the CODEC code.

Move Chip Select control out of the CODEC code for CS4271.
Signed-off-by: NAlexander Sverdlin <subaparts@yandex.ru>
Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 338ee253
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
struct cs4271_platform_data { struct cs4271_platform_data {
int gpio_nreset; /* GPIO driving Reset pin, if any */ int gpio_nreset; /* GPIO driving Reset pin, if any */
int gpio_disable; /* GPIO that disable serial bus, if any */
}; };
#endif /* __CS4271_H */ #endif /* __CS4271_H */
...@@ -441,22 +441,11 @@ static int cs4271_probe(struct snd_soc_codec *codec) ...@@ -441,22 +441,11 @@ static int cs4271_probe(struct snd_soc_codec *codec)
struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
int ret; int ret;
int gpio_nreset = -EINVAL; int gpio_nreset = -EINVAL;
int gpio_disable = -EINVAL;
codec->control_data = cs4271->control_data; codec->control_data = cs4271->control_data;
if (cs4271plat) { if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset))
if (gpio_is_valid(cs4271plat->gpio_nreset)) gpio_nreset = cs4271plat->gpio_nreset;
gpio_nreset = cs4271plat->gpio_nreset;
if (gpio_is_valid(cs4271plat->gpio_disable))
gpio_disable = cs4271plat->gpio_disable;
}
if (gpio_disable >= 0)
if (gpio_request(gpio_disable, "CS4271 Disable"))
gpio_disable = -EINVAL;
if (gpio_disable >= 0)
gpio_direction_output(gpio_disable, 0);
if (gpio_nreset >= 0) if (gpio_nreset >= 0)
if (gpio_request(gpio_nreset, "CS4271 Reset")) if (gpio_request(gpio_nreset, "CS4271 Reset"))
...@@ -471,7 +460,6 @@ static int cs4271_probe(struct snd_soc_codec *codec) ...@@ -471,7 +460,6 @@ static int cs4271_probe(struct snd_soc_codec *codec)
} }
cs4271->gpio_nreset = gpio_nreset; cs4271->gpio_nreset = gpio_nreset;
cs4271->gpio_disable = gpio_disable;
/* /*
* In case of I2C, chip address specified in board data. * In case of I2C, chip address specified in board data.
...@@ -509,10 +497,9 @@ static int cs4271_probe(struct snd_soc_codec *codec) ...@@ -509,10 +497,9 @@ static int cs4271_probe(struct snd_soc_codec *codec)
static int cs4271_remove(struct snd_soc_codec *codec) static int cs4271_remove(struct snd_soc_codec *codec)
{ {
struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
int gpio_nreset, gpio_disable; int gpio_nreset;
gpio_nreset = cs4271->gpio_nreset; gpio_nreset = cs4271->gpio_nreset;
gpio_disable = cs4271->gpio_disable;
if (gpio_is_valid(gpio_nreset)) { if (gpio_is_valid(gpio_nreset)) {
/* Set codec to the reset state */ /* Set codec to the reset state */
...@@ -520,9 +507,6 @@ static int cs4271_remove(struct snd_soc_codec *codec) ...@@ -520,9 +507,6 @@ static int cs4271_remove(struct snd_soc_codec *codec)
gpio_free(gpio_nreset); gpio_free(gpio_nreset);
} }
if (gpio_is_valid(gpio_disable))
gpio_free(gpio_disable);
return 0; return 0;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册