aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-05-05 15:34:57 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-05 13:49:02 -0700
commit6c1ca56d85377498bec760064c02e33f4678a2dd (patch)
treec4c896985aee5d33d4187ecf4cb51d4934ed84d3 /drivers/staging/greybus/arche-platform.c
parentgreybus: greybus_protocols.h Add SVC_TIMESYNC_PING (diff)
downloadlinux-dev-6c1ca56d85377498bec760064c02e33f4678a2dd.tar.xz
linux-dev-6c1ca56d85377498bec760064c02e33f4678a2dd.zip
greybus: arche-platform: Rename spinlock variable lock => wake_detect_lock
With addition of exported function, required for TIMESYNC operation, we need more locking mechanism for driver state, so to avoid confusion rename existing spinlock variable to its appropriate name. Testing Done: Tested on DB3.5 platform. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/arche-platform.c')
-rw-r--r--drivers/staging/greybus/arche-platform.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index d1083cfbc081..9a117176ad50 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -55,7 +55,7 @@ struct arche_platform_drvdata {
enum svc_wakedetect_state wake_detect_state;
int wake_detect_irq;
- spinlock_t lock;
+ spinlock_t wake_lock; /* Protect wake_detect_state */
unsigned long wake_detect_start;
struct notifier_block pm_notifier;
@@ -117,15 +117,15 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
struct arche_platform_drvdata *arche_pdata = devid;
unsigned long flags;
- spin_lock_irqsave(&arche_pdata->lock, flags);
+ spin_lock_irqsave(&arche_pdata->wake_lock, flags);
if (arche_pdata->wake_detect_state != WD_STATE_COLDBOOT_TRIG) {
/* Something is wrong */
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
return IRQ_HANDLED;
}
arche_pdata->wake_detect_state = WD_STATE_COLDBOOT_START;
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
/* It should complete power cycle, so first make sure it is poweroff */
device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
@@ -137,9 +137,9 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
if (usb3613_hub_mode_ctrl(true))
dev_warn(arche_pdata->dev, "failed to control hub device\n");
- spin_lock_irqsave(&arche_pdata->lock, flags);
+ spin_lock_irqsave(&arche_pdata->wake_lock, flags);
arche_pdata->wake_detect_state = WD_STATE_IDLE;
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
return IRQ_HANDLED;
}
@@ -149,7 +149,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
struct arche_platform_drvdata *arche_pdata = devid;
unsigned long flags;
- spin_lock_irqsave(&arche_pdata->lock, flags);
+ spin_lock_irqsave(&arche_pdata->wake_lock, flags);
if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
/* wake/detect rising */
@@ -170,7 +170,9 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
WD_STATE_COLDBOOT_START) {
arche_pdata->wake_detect_state =
WD_STATE_COLDBOOT_TRIG;
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(
+ &arche_pdata->wake_lock,
+ flags);
return IRQ_WAKE_THREAD;
}
}
@@ -188,7 +190,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
}
}
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
return IRQ_HANDLED;
}
@@ -257,9 +259,9 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda
/* Send disconnect/detach event to SVC */
gpio_direction_output(arche_pdata->wake_detect_gpio, 0);
usleep_range(100, 200);
- spin_lock_irqsave(&arche_pdata->lock, flags);
+ spin_lock_irqsave(&arche_pdata->wake_lock, flags);
arche_pdata->wake_detect_state = WD_STATE_IDLE;
- spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
clk_disable_unprepare(arche_pdata->svc_ref_clk);
}
@@ -465,7 +467,7 @@ static int arche_platform_probe(struct platform_device *pdev)
arche_pdata->dev = &pdev->dev;
- spin_lock_init(&arche_pdata->lock);
+ spin_lock_init(&arche_pdata->wake_lock);
arche_pdata->wake_detect_irq =
gpio_to_irq(arche_pdata->wake_detect_gpio);