aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/neo1973_wm8753.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/neo1973_wm8753.c')
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c72
1 files changed, 16 insertions, 56 deletions
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 73a50e93a9a2..87ddfefcc2fb 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -511,21 +511,20 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
511 DBG("Entered %s\n", __func__); 511 DBG("Entered %s\n", __func__);
512 512
513 /* set up NC codec pins */ 513 /* set up NC codec pins */
514 snd_soc_dapm_disable_pin(codec, "LOUT2"); 514 snd_soc_dapm_nc_pin(codec, "LOUT2");
515 snd_soc_dapm_disable_pin(codec, "ROUT2"); 515 snd_soc_dapm_nc_pin(codec, "ROUT2");
516 snd_soc_dapm_disable_pin(codec, "OUT3"); 516 snd_soc_dapm_nc_pin(codec, "OUT3");
517 snd_soc_dapm_disable_pin(codec, "OUT4"); 517 snd_soc_dapm_nc_pin(codec, "OUT4");
518 snd_soc_dapm_disable_pin(codec, "LINE1"); 518 snd_soc_dapm_nc_pin(codec, "LINE1");
519 snd_soc_dapm_disable_pin(codec, "LINE2"); 519 snd_soc_dapm_nc_pin(codec, "LINE2");
520
521
522 /* set endpoints to default mode */
523 set_scenario_endpoints(codec, NEO_AUDIO_OFF);
524 520
525 /* Add neo1973 specific widgets */ 521 /* Add neo1973 specific widgets */
526 snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets, 522 snd_soc_dapm_new_controls(codec, wm8753_dapm_widgets,
527 ARRAY_SIZE(wm8753_dapm_widgets)); 523 ARRAY_SIZE(wm8753_dapm_widgets));
528 524
525 /* set endpoints to default mode */
526 set_scenario_endpoints(codec, NEO_AUDIO_OFF);
527
529 /* add neo1973 specific controls */ 528 /* add neo1973 specific controls */
530 for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) { 529 for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) {
531 err = snd_ctl_add(codec->card, 530 err = snd_ctl_add(codec->card,
@@ -603,6 +602,8 @@ static int lm4857_i2c_probe(struct i2c_client *client,
603{ 602{
604 DBG("Entered %s\n", __func__); 603 DBG("Entered %s\n", __func__);
605 604
605 i2c = client;
606
606 lm4857_write_regs(); 607 lm4857_write_regs();
607 return 0; 608 return 0;
608} 609}
@@ -611,6 +612,8 @@ static int lm4857_i2c_remove(struct i2c_client *client)
611{ 612{
612 DBG("Entered %s\n", __func__); 613 DBG("Entered %s\n", __func__);
613 614
615 i2c = NULL;
616
614 return 0; 617 return 0;
615} 618}
616 619
@@ -650,7 +653,7 @@ static void lm4857_shutdown(struct i2c_client *dev)
650} 653}
651 654
652static const struct i2c_device_id lm4857_i2c_id[] = { 655static const struct i2c_device_id lm4857_i2c_id[] = {
653 { "neo1973_lm4857", 0 } 656 { "neo1973_lm4857", 0 },
654 { } 657 { }
655}; 658};
656 659
@@ -668,48 +671,6 @@ static struct i2c_driver lm4857_i2c_driver = {
668}; 671};
669 672
670static struct platform_device *neo1973_snd_device; 673static struct platform_device *neo1973_snd_device;
671static struct i2c_client *lm4857_client;
672
673static int __init neo1973_add_lm4857_device(struct platform_device *pdev,
674 int i2c_bus,
675 unsigned short i2c_address)
676{
677 struct i2c_board_info info;
678 struct i2c_adapter *adapter;
679 struct i2c_client *client;
680 int ret;
681
682 ret = i2c_add_driver(&lm4857_i2c_driver);
683 if (ret != 0) {
684 dev_err(&pdev->dev, "can't add lm4857 driver\n");
685 return ret;
686 }
687
688 memset(&info, 0, sizeof(struct i2c_board_info));
689 info.addr = i2c_address;
690 strlcpy(info.type, "neo1973_lm4857", I2C_NAME_SIZE);
691
692 adapter = i2c_get_adapter(i2c_bus);
693 if (!adapter) {
694 dev_err(&pdev->dev, "can't get i2c adapter %d\n", i2c_bus);
695 goto err_driver;
696 }
697
698 client = i2c_new_device(adapter, &info);
699 i2c_put_adapter(adapter);
700 if (!client) {
701 dev_err(&pdev->dev, "can't add lm4857 device at 0x%x\n",
702 (unsigned int)info.addr);
703 goto err_driver;
704 }
705
706 lm4857_client = client;
707 return 0;
708
709err_driver:
710 i2c_del_driver(&lm4857_i2c_driver);
711 return -ENODEV;
712}
713 674
714static int __init neo1973_init(void) 675static int __init neo1973_init(void)
715{ 676{
@@ -736,8 +697,8 @@ static int __init neo1973_init(void)
736 return ret; 697 return ret;
737 } 698 }
738 699
739 ret = neo1973_add_lm4857_device(neo1973_snd_device, 700 ret = i2c_add_driver(&lm4857_i2c_driver);
740 neo1973_wm8753_setup, 0x7C); 701
741 if (ret != 0) 702 if (ret != 0)
742 platform_device_unregister(neo1973_snd_device); 703 platform_device_unregister(neo1973_snd_device);
743 704
@@ -748,7 +709,6 @@ static void __exit neo1973_exit(void)
748{ 709{
749 DBG("Entered %s\n", __func__); 710 DBG("Entered %s\n", __func__);
750 711
751 i2c_unregister_device(lm4857_client);
752 i2c_del_driver(&lm4857_i2c_driver); 712 i2c_del_driver(&lm4857_i2c_driver);
753 platform_device_unregister(neo1973_snd_device); 713 platform_device_unregister(neo1973_snd_device);
754} 714}