Skip to content
Snippets Groups Projects
Commit c9d719c5 authored by Vladimir Karpovich's avatar Vladimir Karpovich Committed by Vineeta Srivastava
Browse files

asoc: fsa8500: Remove unused regulator frameworks


Remove unused regulator frameworks

Signed-off-by: default avatarVladimir Karpovich <vkarpovich@motorola.com>
parent 516a1bfe
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,11 @@ Required properties: ...@@ -8,12 +8,11 @@ Required properties:
-compatible : should be "fairchild,fsa8500". -compatible : should be "fairchild,fsa8500".
-reg : i2c address to be used. -reg : i2c address to be used.
-gpios : Interrupt GPIO -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 -fsa8500-init-regs : initial registers settings
Optional properties: Optional properties:
-hs_det_vdd-supply : regulator to power the chip.
-fsa8500-always-on-micbias: Keep bias always on. -fsa8500-always-on-micbias: Keep bias always on.
-fsa8500-keymap : headset keys code map. -fsa8500-keymap : headset keys code map.
Default :1-BTN with key code 0xE2 - KEY_MEDIA Default :1-BTN with key code 0xE2 - KEY_MEDIA
...@@ -25,8 +24,6 @@ Example: ...@@ -25,8 +24,6 @@ Example:
compatible = "fairchild,fsa8500"; compatible = "fairchild,fsa8500";
reg = <0x23>; reg = <0x23>;
gpios = <&msmgpio 9 0x0>; gpios = <&msmgpio 9 0x0>;
hs_det_vdd-supply = <&pma8084_lvs2>;
hs_det_micvdd-supply = <&pma8084_l18>;
fsa8500-init-regs = <0x0C 0xA1>, fsa8500-init-regs = <0x0C 0xA1>,
<0x0F 0xF9>; <0x0F 0xF9>;
/* SND_JACK_BTN_0 - KEY_MEDIA */ /* SND_JACK_BTN_0 - KEY_MEDIA */
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
SND_JACK_BTN_4 | SND_JACK_BTN_5 | \ SND_JACK_BTN_4 | SND_JACK_BTN_5 | \
SND_JACK_BTN_6 | SND_JACK_BTN_7) SND_JACK_BTN_6 | SND_JACK_BTN_7)
#define VDD_UA_ON_LOAD 10000
#define SND_JACK_BTN_SHIFT 20 #define SND_JACK_BTN_SHIFT 20
static struct snd_soc_jack hs_jack; static struct snd_soc_jack hs_jack;
...@@ -66,7 +65,6 @@ static struct i2c_client *fsa8500_client; ...@@ -66,7 +65,6 @@ static struct i2c_client *fsa8500_client;
struct fsa8500_data { struct fsa8500_data {
struct regulator *vdd; struct regulator *vdd;
struct regulator *micvdd;
int gpio_irq; int gpio_irq;
int gpio; int gpio;
struct snd_soc_jack *hs_jack; struct snd_soc_jack *hs_jack;
...@@ -598,20 +596,12 @@ int fsa8500_hs_detect(struct snd_soc_codec *codec) ...@@ -598,20 +596,12 @@ int fsa8500_hs_detect(struct snd_soc_codec *codec)
mutex_lock(&fsa8500->lock); 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, /* if something is plugged in, the irq has been triggered,
the status regs were readed and cleared. the status regs were readed and cleared.
Just report stored value */ Just report stored value */
ret = fsa8500_report_hs(fsa8500); ret = fsa8500_report_hs(fsa8500);
if (!fsa8500->inserted)
regulator_set_optimum_mode(fsa8500->vdd, 0);
mutex_unlock(&fsa8500->lock); mutex_unlock(&fsa8500->lock);
...@@ -816,31 +806,14 @@ static int fsa8500_probe(struct i2c_client *client, ...@@ -816,31 +806,14 @@ static int fsa8500_probe(struct i2c_client *client,
/* enable regulators */ /* enable regulators */
fsa8500->vdd = regulator_get(&client->dev, "hs_det_vdd"); fsa8500->vdd = regulator_get(&client->dev, "hs_det_vdd");
if (IS_ERR(fsa8500->vdd)) { if (IS_ERR(fsa8500->vdd))
pr_err("%s: Error getting vdd regulator.\n", __func__); pr_warn("%s: Can't get vdd regulator.\n", __func__);
err = PTR_ERR(fsa8500->vdd); else {
goto reg_get_vdd;
}
regulator_set_voltage(fsa8500->vdd, 1800000, 1800000);
err = regulator_enable(fsa8500->vdd); err = regulator_enable(fsa8500->vdd);
if (err < 0) { if (err < 0) {
pr_err("%s: Error enabling vdd regulator.\n", __func__); pr_err("%s: Error enabling vdd regulator.\n", __func__);
goto reg_enable_vdd_fail; 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;
} }
wake_lock_init(&fsa8500->wake_lock, WAKE_LOCK_SUSPEND, "hs_det"); wake_lock_init(&fsa8500->wake_lock, WAKE_LOCK_SUSPEND, "hs_det");
...@@ -879,13 +852,11 @@ irq_fail: ...@@ -879,13 +852,11 @@ irq_fail:
wake_lock_destroy(&fsa8500->wake_lock); wake_lock_destroy(&fsa8500->wake_lock);
destroy_workqueue(fsa8500->wq); destroy_workqueue(fsa8500->wq);
wq_fail: wq_fail:
reg_enable_micvdd_fail: if (!IS_ERR_OR_NULL(fsa8500->vdd))
regulator_put(fsa8500->micvdd);
reg_get_micvdd:
regulator_disable(fsa8500->vdd); regulator_disable(fsa8500->vdd);
reg_enable_vdd_fail: reg_enable_vdd_fail:
if (!IS_ERR_OR_NULL(fsa8500->vdd))
regulator_put(fsa8500->vdd); regulator_put(fsa8500->vdd);
reg_get_vdd:
gpio_free(fsa8500->gpio); gpio_free(fsa8500->gpio);
gpio_init_fail: gpio_init_fail:
kfree(fsa8500); kfree(fsa8500);
...@@ -896,11 +867,10 @@ gpio_init_fail: ...@@ -896,11 +867,10 @@ gpio_init_fail:
static int fsa8500_remove(struct i2c_client *client) static int fsa8500_remove(struct i2c_client *client)
{ {
struct fsa8500_data *fsa8500 = i2c_get_clientdata(client); struct fsa8500_data *fsa8500 = i2c_get_clientdata(client);
regulator_set_optimum_mode(fsa8500->vdd, 0); if (!IS_ERR_OR_NULL(fsa8500->vdd)) {
regulator_disable(fsa8500->vdd); regulator_disable(fsa8500->vdd);
regulator_put(fsa8500->vdd); regulator_put(fsa8500->vdd);
regulator_disable(fsa8500->micvdd); }
regulator_put(fsa8500->micvdd);
gpio_free(fsa8500->gpio); gpio_free(fsa8500->gpio);
wake_lock_destroy(&fsa8500->wake_lock); wake_lock_destroy(&fsa8500->wake_lock);
destroy_workqueue(fsa8500->wq); destroy_workqueue(fsa8500->wq);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment