linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device
@ 2011-11-29  8:17 jhbird.choi at samsung.com
  2011-12-02  2:27 ` Kyungmin Park
  2011-12-18 21:10 ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: jhbird.choi at samsung.com @ 2011-11-29  8:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jonghwan Choi <jhbird.choi@samsung.com>

Use device_init_wakeup & device_may_wakeup to init wakeup

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 drivers/mfd/max8998.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index de4096a..6ef56d2 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
 	if (ret < 0)
 		goto err;
 
+	device_init_wakeup(max8998->dev, max8998->wakeup);
+
 	return ret;
 
 err:
@@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev)
 	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 	struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
-	if (max8998->wakeup)
+	if (device_may_wakeup(dev))
 		irq_set_irq_wake(max8998->irq, 1);
 	return 0;
 }
@@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev)
 	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
 	struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
-	if (max8998->wakeup)
+	if (device_may_wakeup(dev))
 		irq_set_irq_wake(max8998->irq, 0);
 	/*
 	 * In LP3974, if IRQ registers are not "read & clear"
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device
  2011-11-29  8:17 [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device jhbird.choi at samsung.com
@ 2011-12-02  2:27 ` Kyungmin Park
  2011-12-18 21:10 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Kyungmin Park @ 2011-12-02  2:27 UTC (permalink / raw)
  To: linux-arm-kernel

Acked-by: Kyungmin Park <kyungmin.park@samsung.com>

After this patch, we don't more use the max8998->wakeup field, so it
can remove it
and use & set the wakeup feature with pdata->wakeup.

device_init_wakeup(max8998->dev, pdata->wakeup);

On 11/29/11, jhbird.choi at samsung.com <jhbird.choi@samsung.com> wrote:
> From: Jonghwan Choi <jhbird.choi@samsung.com>
>
> Use device_init_wakeup & device_may_wakeup to init wakeup
>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  drivers/mfd/max8998.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
> index de4096a..6ef56d2 100644
> --- a/drivers/mfd/max8998.c
> +++ b/drivers/mfd/max8998.c
> @@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
>  	if (ret < 0)
>  		goto err;
>
> +	device_init_wakeup(max8998->dev, max8998->wakeup);
> +
>  	return ret;
>
>  err:
> @@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev)
>  	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
>  	struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
>
> -	if (max8998->wakeup)
> +	if (device_may_wakeup(dev))
>  		irq_set_irq_wake(max8998->irq, 1);
>  	return 0;
>  }
> @@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev)
>  	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
>  	struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
>
> -	if (max8998->wakeup)
> +	if (device_may_wakeup(dev))
>  		irq_set_irq_wake(max8998->irq, 0);
>  	/*
>  	 * In LP3974, if IRQ registers are not "read & clear"
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device
  2011-11-29  8:17 [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device jhbird.choi at samsung.com
  2011-12-02  2:27 ` Kyungmin Park
@ 2011-12-18 21:10 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2011-12-18 21:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jonghwan,

On Tue, Nov 29, 2011 at 05:17:51PM +0900, jhbird.choi at samsung.com wrote:
> From: Jonghwan Choi <jhbird.choi@samsung.com>
> 
> Use device_init_wakeup & device_may_wakeup to init wakeup
I applied this one, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-18 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29  8:17 [PATCH] mfd: max8998: Use standard device wakeup for handling wakeup device jhbird.choi at samsung.com
2011-12-02  2:27 ` Kyungmin Park
2011-12-18 21:10 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).