public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, sameo@linux.intel.com,
	broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org, kyungmin.park@samsung.com,
	myungjoo.ham@samsung.com
Subject: Re: [PATCH v3 2/2] input: add driver support for MAX8997-haptic
Date: Wed, 14 Mar 2012 23:47:42 +0900	[thread overview]
Message-ID: <4F60AF8E.7050900@samsung.com> (raw)
In-Reply-To: <20120314084652.GC3964@core.coreip.homeip.net>

Hi Dmitry,

> This is not proper locking between playing effect and suspend. Now that
> you are using workqueue you need to synchronize access with it, not with
> play_effect method.
> 
> Does the following patch work for you?
> 

Your patch is worked on TRATS board based on EXYNOS4210 but, you should
apply following patch because 'chip->enabled' is used on
max8997_haptic_configure() function to enable/disable haptic motor.

diff --git a/drivers/haptic/max8997_haptic.c
b/drivers/haptic/max8997_haptic.c
index 806bcf3..0347404 100644
--- a/drivers/haptic/max8997_haptic.c
+++ b/drivers/haptic/max8997_haptic.c
@@ -182,11 +182,11 @@ static void max8997_haptic_enable(struct
max8997_haptic *chip)
 	}

 	if (!chip->enabled) {
+		chip->enabled = true;
 		regulator_enable(chip->regulator);
 		max8997_haptic_configure(chip);
 		if (chip->mode == MAX8997_EXTERNAL_MODE)
 			pwm_enable(chip->pwm);
-		chip->enabled = true;
 	}

 out:
@@ -198,11 +198,11 @@ static void max8997_haptic_disable(struct
max8997_haptic *chip)
 	mutex_lock(&chip->mutex);

 	if (chip->enabled) {
+		chip->enabled = false;
 		max8997_haptic_configure(chip);
 		if (chip->mode == MAX8997_EXTERNAL_MODE)
 			pwm_disable(chip->pwm);
 		regulator_disable(chip->regulator);
-		chip->enabled = false;
 	}

 	mutex_unlock(&chip->mutex);
-- 
1.7.0.4

Thank you,
Chanwoo Choi

  parent reply	other threads:[~2012-03-14 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  8:31 [PATCH v3 2/2] input: add driver support for MAX8997-haptic Chanwoo Choi
2012-03-14  8:46 ` Dmitry Torokhov
2012-03-14 11:54   ` Chanwoo Choi
2012-03-14 14:47   ` Chanwoo Choi [this message]
2012-03-14 15:48     ` Dmitry Torokhov
2012-03-16 17:48       ` Samuel Ortiz
2012-03-16 17:55         ` Dmitry Torokhov
2012-03-16 18:56           ` Samuel Ortiz
2012-03-16 19:27             ` Dmitry Torokhov

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=4F60AF8E.7050900@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=sameo@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox