Thread (13 messages) read the whole thread 13 messages, 3 authors, 2011-12-31

Re: [PATCH 5/6] Input: ucb1400_ts - convert to threaded IRQ

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2011-11-16 07:47:08

Hi Daniel,

On Wed, Nov 16, 2011 at 03:36:37PM +0800, Daniel Kurtz wrote:
`> Hi Dmitry,
On Mon, Nov 14, 2011 at 4:36 PM, Dmitry Torokhov
[off-list ref] wrote:
quoted
 #ifdef CONFIG_PM_SLEEP
+static int ucb1400_ts_suspend(struct device *dev)
+{
+       struct ucb1400_ts *ucb = dev->platform_data;
+       struct input_dev *idev = ucb->ts_idev;
+
+       mutex_lock(&idev->mutex);
+
+       if (idev->users)
+               ucb1400_ts_start(ucb);
+
+       mutex_unlock(&idev->mutex);
+       return 0;
+}
+
 static int ucb1400_ts_resume(struct device *dev)
 {
       struct ucb1400_ts *ucb = dev->platform_data;
+       struct input_dev *idev = ucb->ts_idev;

-       if (ucb->ts_task) {
-               /*
-                * Restart the TS thread to ensure the
-                * TS interrupt mode is set up again
-                * after sleep.
-                */
-               ucb->ts_restart = 1;
-               wake_up(&ucb->ts_wait);
-       }
+       mutex_lock(&idev->mutex);
+
+       if (idev->users)
+               ucb1400_ts_stop(ucb);
+
+       mutex_unlock(&idev->mutex);
       return 0;
 }
 #endif
Do you need an #else here to set *_suspend/resume to NULL when
CONFIG_PM_SLEEP is not defined?
It seems to have gotten lost somewhere.
Without CONFIG_PM_SLEEP SIMPLE_DEV_PM_OPS simply ignores its 2nd and 3rd
arguments so the fact that they are missing does not matter.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help