diff options
Diffstat (limited to 'sound/soc/codecs/wm8776.c')
-rw-r--r-- | sound/soc/codecs/wm8776.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index a9829aa26e53..60b1b3e1094b 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
23 | #include <linux/slab.h> | ||
23 | #include <sound/core.h> | 24 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 25 | #include <sound/pcm.h> |
25 | #include <sound/pcm_params.h> | 26 | #include <sound/pcm_params.h> |
@@ -406,6 +407,8 @@ static int wm8776_resume(struct platform_device *pdev) | |||
406 | 407 | ||
407 | /* Sync reg_cache with the hardware */ | 408 | /* Sync reg_cache with the hardware */ |
408 | for (i = 0; i < ARRAY_SIZE(wm8776_reg); i++) { | 409 | for (i = 0; i < ARRAY_SIZE(wm8776_reg); i++) { |
410 | if (cache[i] == wm8776_reg[i]) | ||
411 | continue; | ||
409 | data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001); | 412 | data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001); |
410 | data[1] = cache[i] & 0x00ff; | 413 | data[1] = cache[i] & 0x00ff; |
411 | codec->hw_write(codec->control_data, data, 2); | 414 | codec->hw_write(codec->control_data, data, 2); |
@@ -447,17 +450,8 @@ static int wm8776_probe(struct platform_device *pdev) | |||
447 | ARRAY_SIZE(wm8776_dapm_widgets)); | 450 | ARRAY_SIZE(wm8776_dapm_widgets)); |
448 | snd_soc_dapm_add_routes(codec, routes, ARRAY_SIZE(routes)); | 451 | snd_soc_dapm_add_routes(codec, routes, ARRAY_SIZE(routes)); |
449 | 452 | ||
450 | ret = snd_soc_init_card(socdev); | ||
451 | if (ret < 0) { | ||
452 | dev_err(codec->dev, "failed to register card: %d\n", ret); | ||
453 | goto card_err; | ||
454 | } | ||
455 | |||
456 | return ret; | 453 | return ret; |
457 | 454 | ||
458 | card_err: | ||
459 | snd_soc_free_pcms(socdev); | ||
460 | snd_soc_dapm_free(socdev); | ||
461 | pcm_err: | 455 | pcm_err: |
462 | return ret; | 456 | return ret; |
463 | } | 457 | } |
@@ -616,21 +610,6 @@ static int __devexit wm8776_spi_remove(struct spi_device *spi) | |||
616 | return 0; | 610 | return 0; |
617 | } | 611 | } |
618 | 612 | ||
619 | #ifdef CONFIG_PM | ||
620 | static int wm8776_spi_suspend(struct spi_device *spi, pm_message_t msg) | ||
621 | { | ||
622 | return snd_soc_suspend_device(&spi->dev); | ||
623 | } | ||
624 | |||
625 | static int wm8776_spi_resume(struct spi_device *spi) | ||
626 | { | ||
627 | return snd_soc_resume_device(&spi->dev); | ||
628 | } | ||
629 | #else | ||
630 | #define wm8776_spi_suspend NULL | ||
631 | #define wm8776_spi_resume NULL | ||
632 | #endif | ||
633 | |||
634 | static struct spi_driver wm8776_spi_driver = { | 613 | static struct spi_driver wm8776_spi_driver = { |
635 | .driver = { | 614 | .driver = { |
636 | .name = "wm8776", | 615 | .name = "wm8776", |
@@ -638,8 +617,6 @@ static struct spi_driver wm8776_spi_driver = { | |||
638 | .owner = THIS_MODULE, | 617 | .owner = THIS_MODULE, |
639 | }, | 618 | }, |
640 | .probe = wm8776_spi_probe, | 619 | .probe = wm8776_spi_probe, |
641 | .suspend = wm8776_spi_suspend, | ||
642 | .resume = wm8776_spi_resume, | ||
643 | .remove = __devexit_p(wm8776_spi_remove), | 620 | .remove = __devexit_p(wm8776_spi_remove), |
644 | }; | 621 | }; |
645 | #endif /* CONFIG_SPI_MASTER */ | 622 | #endif /* CONFIG_SPI_MASTER */ |
@@ -673,21 +650,6 @@ static __devexit int wm8776_i2c_remove(struct i2c_client *client) | |||
673 | return 0; | 650 | return 0; |
674 | } | 651 | } |
675 | 652 | ||
676 | #ifdef CONFIG_PM | ||
677 | static int wm8776_i2c_suspend(struct i2c_client *i2c, pm_message_t msg) | ||
678 | { | ||
679 | return snd_soc_suspend_device(&i2c->dev); | ||
680 | } | ||
681 | |||
682 | static int wm8776_i2c_resume(struct i2c_client *i2c) | ||
683 | { | ||
684 | return snd_soc_resume_device(&i2c->dev); | ||
685 | } | ||
686 | #else | ||
687 | #define wm8776_i2c_suspend NULL | ||
688 | #define wm8776_i2c_resume NULL | ||
689 | #endif | ||
690 | |||
691 | static const struct i2c_device_id wm8776_i2c_id[] = { | 653 | static const struct i2c_device_id wm8776_i2c_id[] = { |
692 | { "wm8776", 0 }, | 654 | { "wm8776", 0 }, |
693 | { } | 655 | { } |
@@ -701,8 +663,6 @@ static struct i2c_driver wm8776_i2c_driver = { | |||
701 | }, | 663 | }, |
702 | .probe = wm8776_i2c_probe, | 664 | .probe = wm8776_i2c_probe, |
703 | .remove = __devexit_p(wm8776_i2c_remove), | 665 | .remove = __devexit_p(wm8776_i2c_remove), |
704 | .suspend = wm8776_i2c_suspend, | ||
705 | .resume = wm8776_i2c_resume, | ||
706 | .id_table = wm8776_i2c_id, | 666 | .id_table = wm8776_i2c_id, |
707 | }; | 667 | }; |
708 | #endif | 668 | #endif |