lkml.org 
[lkml]   [2014]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/2] Input: add regulator haptic driver
On Tue, Dec 16, 2014 at 10:09:25AM +0900, Jaewon Kim wrote:
> Hi Dmitry,
>
> 2014년 12월 14일 04:56에 Dmitry Torokhov 이(가) 쓴 글:
> >Hi Jaewon,
> >
> >On Fri, Dec 12, 2014 at 07:32:28PM +0900, Jaewon Kim wrote:
...
> >>+static int __maybe_unused regulator_haptic_suspend(struct device *dev)
> >>+{
> >>+ struct platform_device *pdev = to_platform_device(dev);
> >>+ struct regulator_haptic *haptic = platform_get_drvdata(pdev);
> >>+
> >>+ mutex_lock(&haptic->mutex);
> >>+ if (haptic->enabled) {
> >>+ regulator_haptic_enable(haptic, false);
> >>+ haptic->suspend_state = true;
> >Why do we only set suspend_state if an effect was playing? I think we
> >should always indicate that the device is suspended so that we do not
> >try to start playing another effect - while it is true that normally
> >effects are played by request from userspace which should be frozen by
> >now, it is theoretically possible to trigger an effect from kernel as
> >well.
>
> This variable name seems to make you confuse.
> I used this variable to restore the old state.
>
> When kernel is entering suspend state while the motor is vibrating,
> I store vibrating state for vibrate again after escape suspend state.
>
>
> I will change variable name to "suspend_restore".
> And prevent to start playing effect when kernel entering suspend state.

You do not need to save if haptic was playing or not - on resume, if
haptic->magnitude != 0 you need to restart playing, otherwise leave it
off.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2014-12-16 03:01    [W:0.224 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site