diff --git a/Documentation/devicetree/bindings/sound/fsa8500.txt b/Documentation/devicetree/bindings/sound/fsa8500.txt index 427a46f75e40d8a380cb217750e7d3927efe1912..9454c33bca59c1822619dc232d977f4660a3423a 100644 --- a/Documentation/devicetree/bindings/sound/fsa8500.txt +++ b/Documentation/devicetree/bindings/sound/fsa8500.txt @@ -8,12 +8,11 @@ Required properties: -compatible : should be "fairchild,fsa8500". -reg : i2c address to be used. -gpios : Interrupt GPIO --hs_det_vdd-supply : regulator to power the chip. --hs_det_micvdd-supply : regulator to power the mic bias. -fsa8500-init-regs : initial registers settings Optional properties: +-hs_det_vdd-supply : regulator to power the chip. -fsa8500-always-on-micbias: Keep bias always on. -fsa8500-keymap : headset keys code map. Default :1-BTN with key code 0xE2 - KEY_MEDIA @@ -25,8 +24,6 @@ Example: compatible = "fairchild,fsa8500"; reg = <0x23>; gpios = <&msmgpio 9 0x0>; - hs_det_vdd-supply = <&pma8084_lvs2>; - hs_det_micvdd-supply = <&pma8084_l18>; fsa8500-init-regs = <0x0C 0xA1>, <0x0F 0xF9>; /* SND_JACK_BTN_0 - KEY_MEDIA */ diff --git a/sound/soc/codecs/fsa8500.c b/sound/soc/codecs/fsa8500.c index 2853d8c7925fb17e73caa2d50a40537e539803e0..d4649203644a0878f04ecd21bb0c911bab7eb95e 100644 --- a/sound/soc/codecs/fsa8500.c +++ b/sound/soc/codecs/fsa8500.c @@ -56,7 +56,6 @@ SND_JACK_BTN_4 | SND_JACK_BTN_5 | \ SND_JACK_BTN_6 | SND_JACK_BTN_7) -#define VDD_UA_ON_LOAD 10000 #define SND_JACK_BTN_SHIFT 20 static struct snd_soc_jack hs_jack; @@ -66,7 +65,6 @@ static struct i2c_client *fsa8500_client; struct fsa8500_data { struct regulator *vdd; - struct regulator *micvdd; int gpio_irq; int gpio; struct snd_soc_jack *hs_jack; @@ -598,20 +596,12 @@ int fsa8500_hs_detect(struct snd_soc_codec *codec) mutex_lock(&fsa8500->lock); - if (!fsa8500->inserted) { - ret = regulator_set_optimum_mode(fsa8500->vdd, - VDD_UA_ON_LOAD); - if (ret < 0) - pr_err("%s: failed to set optimum mode\n", __func__); - } /* if something is plugged in, the irq has been triggered, the status regs were readed and cleared. Just report stored value */ ret = fsa8500_report_hs(fsa8500); - if (!fsa8500->inserted) - regulator_set_optimum_mode(fsa8500->vdd, 0); mutex_unlock(&fsa8500->lock); @@ -816,31 +806,14 @@ static int fsa8500_probe(struct i2c_client *client, /* enable regulators */ fsa8500->vdd = regulator_get(&client->dev, "hs_det_vdd"); - if (IS_ERR(fsa8500->vdd)) { - pr_err("%s: Error getting vdd regulator.\n", __func__); - err = PTR_ERR(fsa8500->vdd); - goto reg_get_vdd; - } - - regulator_set_voltage(fsa8500->vdd, 1800000, 1800000); - err = regulator_enable(fsa8500->vdd); - if (err < 0) { - pr_err("%s: Error enabling vdd regulator.\n", __func__); - goto reg_enable_vdd_fail; - } - - fsa8500->micvdd = regulator_get(&client->dev, "hs_det_micvdd"); - if (IS_ERR(fsa8500->micvdd)) { - pr_err("%s: Error getting micvdd regulator.\n", __func__); - err = PTR_ERR(fsa8500->micvdd); - goto reg_get_micvdd; - } - - regulator_set_voltage(fsa8500->micvdd, 2850000, 2850000); - err = regulator_enable(fsa8500->micvdd); - if (err < 0) { - pr_err("%s: Error enabling micvdd regulator.\n", __func__); - goto reg_enable_micvdd_fail; + if (IS_ERR(fsa8500->vdd)) + pr_warn("%s: Can't get vdd regulator.\n", __func__); + else { + err = regulator_enable(fsa8500->vdd); + if (err < 0) { + pr_err("%s: Error enabling vdd regulator.\n", __func__); + goto reg_enable_vdd_fail; + } } wake_lock_init(&fsa8500->wake_lock, WAKE_LOCK_SUSPEND, "hs_det"); @@ -879,13 +852,11 @@ irq_fail: wake_lock_destroy(&fsa8500->wake_lock); destroy_workqueue(fsa8500->wq); wq_fail: -reg_enable_micvdd_fail: - regulator_put(fsa8500->micvdd); -reg_get_micvdd: - regulator_disable(fsa8500->vdd); + if (!IS_ERR_OR_NULL(fsa8500->vdd)) + regulator_disable(fsa8500->vdd); reg_enable_vdd_fail: - regulator_put(fsa8500->vdd); -reg_get_vdd: + if (!IS_ERR_OR_NULL(fsa8500->vdd)) + regulator_put(fsa8500->vdd); gpio_free(fsa8500->gpio); gpio_init_fail: kfree(fsa8500); @@ -896,11 +867,10 @@ gpio_init_fail: static int fsa8500_remove(struct i2c_client *client) { struct fsa8500_data *fsa8500 = i2c_get_clientdata(client); - regulator_set_optimum_mode(fsa8500->vdd, 0); - regulator_disable(fsa8500->vdd); - regulator_put(fsa8500->vdd); - regulator_disable(fsa8500->micvdd); - regulator_put(fsa8500->micvdd); + if (!IS_ERR_OR_NULL(fsa8500->vdd)) { + regulator_disable(fsa8500->vdd); + regulator_put(fsa8500->vdd); + } gpio_free(fsa8500->gpio); wake_lock_destroy(&fsa8500->wake_lock); destroy_workqueue(fsa8500->wq);