uda1380.c (b71951d63d83194d449e8ec7b28c3f30176e8208) uda1380.c (68020db8ac1046e50c758545b75850eb356a0651)
1/*
2 * uda1380.c - Philips UDA1380 ALSA SoC audio driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (c) 2007-2009 Philipp Zabel <philipp.zabel@gmail.com>

--- 718 unchanged lines hidden (view full) ---

727
728 codec->hw_write = (hw_write_t)i2c_master_send;
729 codec->control_data = uda1380->control_data;
730
731 if (!pdata)
732 return -EINVAL;
733
734 if (gpio_is_valid(pdata->gpio_reset)) {
1/*
2 * uda1380.c - Philips UDA1380 ALSA SoC audio driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (c) 2007-2009 Philipp Zabel <philipp.zabel@gmail.com>

--- 718 unchanged lines hidden (view full) ---

727
728 codec->hw_write = (hw_write_t)i2c_master_send;
729 codec->control_data = uda1380->control_data;
730
731 if (!pdata)
732 return -EINVAL;
733
734 if (gpio_is_valid(pdata->gpio_reset)) {
735 ret = gpio_request(pdata->gpio_reset, "uda1380 reset");
735 ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_LOW,
736 "uda1380 reset");
736 if (ret)
737 goto err_out;
737 if (ret)
738 goto err_out;
738 ret = gpio_direction_output(pdata->gpio_reset, 0);
739 if (ret)
740 goto err_gpio_reset_conf;
741 }
742
743 if (gpio_is_valid(pdata->gpio_power)) {
739 }
740
741 if (gpio_is_valid(pdata->gpio_power)) {
744 ret = gpio_request(pdata->gpio_power, "uda1380 power");
742 ret = gpio_request_one(pdata->gpio_power, GPIOF_OUT_INIT_LOW,
743 "uda1380 power");
745 if (ret)
744 if (ret)
746 goto err_gpio;
747 ret = gpio_direction_output(pdata->gpio_power, 0);
748 if (ret)
749 goto err_gpio_power_conf;
745 goto err_free_gpio;
750 } else {
751 ret = uda1380_reset(codec);
746 } else {
747 ret = uda1380_reset(codec);
752 if (ret) {
753 dev_err(codec->dev, "Failed to issue reset\n");
754 goto err_reset;
755 }
748 if (ret)
749 goto err_free_gpio;
756 }
757
758 INIT_WORK(&uda1380->work, uda1380_flush_work);
759
760 /* power on device */
761 uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
762 /* set clock input */
763 switch (pdata->dac_clk) {

--- 7 unchanged lines hidden (view full) ---

771 }
772
773 snd_soc_add_controls(codec, uda1380_snd_controls,
774 ARRAY_SIZE(uda1380_snd_controls));
775 uda1380_add_widgets(codec);
776
777 return 0;
778
750 }
751
752 INIT_WORK(&uda1380->work, uda1380_flush_work);
753
754 /* power on device */
755 uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
756 /* set clock input */
757 switch (pdata->dac_clk) {

--- 7 unchanged lines hidden (view full) ---

765 }
766
767 snd_soc_add_controls(codec, uda1380_snd_controls,
768 ARRAY_SIZE(uda1380_snd_controls));
769 uda1380_add_widgets(codec);
770
771 return 0;
772
779err_reset:
780err_gpio_power_conf:
781 if (gpio_is_valid(pdata->gpio_power))
782 gpio_free(pdata->gpio_power);
783
784err_gpio_reset_conf:
785err_gpio:
773err_free_gpio:
786 if (gpio_is_valid(pdata->gpio_reset))
787 gpio_free(pdata->gpio_reset);
788err_out:
789 return ret;
790}
791
792/* power down chip */
793static int uda1380_remove(struct snd_soc_codec *codec)

--- 93 unchanged lines hidden ---
774 if (gpio_is_valid(pdata->gpio_reset))
775 gpio_free(pdata->gpio_reset);
776err_out:
777 return ret;
778}
779
780/* power down chip */
781static int uda1380_remove(struct snd_soc_codec *codec)

--- 93 unchanged lines hidden ---