Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53fe6285 authored by Shiraz Hashim's avatar Shiraz Hashim Committed by Dmitry Torokhov
Browse files

Input: spear_keyboard - fix clock handling during suspend/resume



SPEAr keyboard should normally disable clock during suspend and enable it
during resume.

For cases where it is expected to act as a wakeup source the clock can
remain in the same state i.e. kept enabled if it is being used.

Signed-off-by: default avatarShiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9a932145
Loading
Loading
Loading
Loading
+10 −8
Original line number Original line Diff line number Diff line
@@ -320,11 +320,12 @@ static int spear_kbd_suspend(struct device *dev)


	mutex_lock(&input_dev->mutex);
	mutex_lock(&input_dev->mutex);


	if (input_dev->users)
	if (device_may_wakeup(&pdev->dev)) {
		clk_enable(kbd->clk);

	if (device_may_wakeup(&pdev->dev))
		enable_irq_wake(kbd->irq);
		enable_irq_wake(kbd->irq);
	} else {
		if (input_dev->users)
			clk_disable(kbd->clk);
	}


	mutex_unlock(&input_dev->mutex);
	mutex_unlock(&input_dev->mutex);


@@ -339,11 +340,12 @@ static int spear_kbd_resume(struct device *dev)


	mutex_lock(&input_dev->mutex);
	mutex_lock(&input_dev->mutex);


	if (device_may_wakeup(&pdev->dev))
	if (device_may_wakeup(&pdev->dev)) {
		disable_irq_wake(kbd->irq);
		disable_irq_wake(kbd->irq);

	} else {
		if (input_dev->users)
		if (input_dev->users)
			clk_enable(kbd->clk);
			clk_enable(kbd->clk);
	}


	mutex_unlock(&input_dev->mutex);
	mutex_unlock(&input_dev->mutex);