Commit 505eb8df authored by Hans de Goede's avatar Hans de Goede Committed by Lee Jones

extcon: arizona: Always use pm_runtime_get_sync() when we need the device to be awake

Before this commit the extcon-arizona code was mixing pm_runtime_get()
and pm_runtime_get_sync() in different places.

In all places where pm_runtime_get[_sync]() is called, the code
makes use of the device immediately after the call.
This means that we should always use pm_runtime_get_sync().
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent ece2619f
...@@ -290,7 +290,7 @@ static void arizona_start_mic(struct arizona_extcon_info *info) ...@@ -290,7 +290,7 @@ static void arizona_start_mic(struct arizona_extcon_info *info)
unsigned int mode; unsigned int mode;
/* Microphone detection can't use idle mode */ /* Microphone detection can't use idle mode */
pm_runtime_get(info->dev); pm_runtime_get_sync(info->dev);
if (info->detecting) { if (info->detecting) {
ret = regulator_allow_bypass(info->micvdd, false); ret = regulator_allow_bypass(info->micvdd, false);
...@@ -695,7 +695,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info) ...@@ -695,7 +695,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
dev_dbg(arizona->dev, "Starting HPDET\n"); dev_dbg(arizona->dev, "Starting HPDET\n");
/* Make sure we keep the device enabled during the measurement */ /* Make sure we keep the device enabled during the measurement */
pm_runtime_get(info->dev); pm_runtime_get_sync(info->dev);
info->hpdet_active = true; info->hpdet_active = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment