All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jaewon Kim <jaewon02.kim@samsung.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-input@vger.kernel.org, Chanwoo Choi <cw00.choi@samsung.com>,
	Hyunhee Kim <hyunhee.kim@samsung.com>
Subject: Re: [PATCH v6 1/2] Input: add regulator haptic driver
Date: Mon, 15 Dec 2014 17:42:27 -0800	[thread overview]
Message-ID: <20141216014227.GA18491@dtor-ws> (raw)
In-Reply-To: <548F8645.3070002@samsung.com>

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

  reply	other threads:[~2014-12-16  1:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 10:32 [PATCH v6 0/2] Add regulator-haptic driver Jaewon Kim
2014-12-12 10:32 ` [PATCH v6 1/2] Input: add regulator haptic driver Jaewon Kim
2014-12-13 19:56   ` Dmitry Torokhov
2014-12-16  1:09     ` Jaewon Kim
2014-12-16  1:42       ` Dmitry Torokhov [this message]
2014-12-12 10:32 ` [PATCH v6 2/2] ARM: dts: Add haptic node for exynos3250-rinato Jaewon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141216014227.GA18491@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=hyunhee.kim@samsung.com \
    --cc=jaewon02.kim@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.