Skip to content

Commit be4e3c7

Browse files
tmlindkishon
authored andcommitted
phy: mapphone-mdm6600: Fix timeouts by adding wake-up handling
We have an interrupt handler for the wake-up GPIO pin, but we're missing the code to wake-up the system. This can cause timeouts receiving data for the UART that shares the wake-up GPIO pin with the USB PHY. All we need to do is just wake the system and kick the autosuspend timeout to fix the issue. Fixes: 5d1ebbd ("phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4") Cc: Marcel Partap <[email protected]> Cc: Merlijn Wajer <[email protected]> Cc: Michael Scott <[email protected]> Cc: NeKit <[email protected]> Cc: Pavel Machek <[email protected]> Cc: Sebastian Reichel <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 0ed41b3 commit be4e3c7

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/phy/motorola/phy-mapphone-mdm6600.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,24 @@ static irqreturn_t phy_mdm6600_wakeirq_thread(int irq, void *data)
244244
{
245245
struct phy_mdm6600 *ddata = data;
246246
struct gpio_desc *mode_gpio1;
247+
int error, wakeup;
247248

248249
mode_gpio1 = ddata->mode_gpios->desc[PHY_MDM6600_MODE1];
249-
dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n",
250-
gpiod_get_value(mode_gpio1));
250+
wakeup = gpiod_get_value(mode_gpio1);
251+
if (!wakeup)
252+
return IRQ_NONE;
253+
254+
dev_dbg(ddata->dev, "OOB wake on mode_gpio1: %i\n", wakeup);
255+
error = pm_runtime_get_sync(ddata->dev);
256+
if (error < 0) {
257+
pm_runtime_put_noidle(ddata->dev);
258+
259+
return IRQ_NONE;
260+
}
261+
262+
/* Just wake-up and kick the autosuspend timer */
263+
pm_runtime_mark_last_busy(ddata->dev);
264+
pm_runtime_put_autosuspend(ddata->dev);
251265

252266
return IRQ_HANDLED;
253267
}

0 commit comments

Comments
 (0)