Skip to content

Commit a98a0bc

Browse files
Alexander Sverdlinbroonie
authored andcommitted
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: Alexander Sverdlin <subaparts@yandex.ru> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 parent 338ee25 commit a98a0bc

2 files changed

Lines changed: 3 additions & 20 deletions

File tree

‎include/sound/cs4271.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
struct cs4271_platform_data {
2121
int gpio_nreset; /* GPIO driving Reset pin, if any */
22-
int gpio_disable; /* GPIO that disable serial bus, if any */
2322
};
2423

2524
#endif /* __CS4271_H */

‎sound/soc/codecs/cs4271.c‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -441,22 +441,11 @@ static int cs4271_probe(struct snd_soc_codec *codec)
441441
struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
442442
int ret;
443443
int gpio_nreset = -EINVAL;
444-
int gpio_disable = -EINVAL;
445444

446445
codec->control_data = cs4271->control_data;
447446

448-
if (cs4271plat) {
449-
if (gpio_is_valid(cs4271plat->gpio_nreset))
450-
gpio_nreset = cs4271plat->gpio_nreset;
451-
if (gpio_is_valid(cs4271plat->gpio_disable))
452-
gpio_disable = cs4271plat->gpio_disable;
453-
}
454-
455-
if (gpio_disable >= 0)
456-
if (gpio_request(gpio_disable, "CS4271 Disable"))
457-
gpio_disable = -EINVAL;
458-
if (gpio_disable >= 0)
459-
gpio_direction_output(gpio_disable, 0);
447+
if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset))
448+
gpio_nreset = cs4271plat->gpio_nreset;
460449

461450
if (gpio_nreset >= 0)
462451
if (gpio_request(gpio_nreset, "CS4271 Reset"))
@@ -471,7 +460,6 @@ static int cs4271_probe(struct snd_soc_codec *codec)
471460
}
472461

473462
cs4271->gpio_nreset = gpio_nreset;
474-
cs4271->gpio_disable = gpio_disable;
475463

476464
/*
477465
* In case of I2C, chip address specified in board data.
@@ -509,20 +497,16 @@ static int cs4271_probe(struct snd_soc_codec *codec)
509497
static int cs4271_remove(struct snd_soc_codec *codec)
510498
{
511499
struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
512-
int gpio_nreset, gpio_disable;
500+
int gpio_nreset;
513501

514502
gpio_nreset = cs4271->gpio_nreset;
515-
gpio_disable = cs4271->gpio_disable;
516503

517504
if (gpio_is_valid(gpio_nreset)) {
518505
/* Set codec to the reset state */
519506
gpio_set_value(gpio_nreset, 0);
520507
gpio_free(gpio_nreset);
521508
}
522509

523-
if (gpio_is_valid(gpio_disable))
524-
gpio_free(gpio_disable);
525-
526510
return 0;
527511
};
528512

0 commit comments

Comments
 (0)