lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] input: add driver support for Sharp gp2ap002a00f proximity sensor
On Thu, Nov 17, 2011 at 12:39:12AM +0900, anish kumar wrote:
> On Tue, 2011-11-15 at 08:34 +0100, oskar.andero@sonyericsson.com wrote:
> > > > +#ifdef CONFIG_PM_SLEEP
> > > > +static int gp2a_suspend(struct device *dev)
> > > > +{
> > > > + struct i2c_client *client = to_i2c_client(dev);
> > > > + struct gp2a_data *dt = i2c_get_clientdata(client);
> > > > + int error;
> > > > +
> > > > + if (device_may_wakeup(&client->dev)) {
> > > > + enable_irq_wake(client->irq);
> > > > + } else {
> > >
> > > This needs locking WRT open/close. Please acquire dt->device->mutex and
> > > only disable if dt->device->users != 0. Similar shoudl be done for
> > > resume.
> >
> > I see what you mean. I will fix it.
> Is my understanding correct?You are going to disable the device
> only when there are users of the driver and not disable the device
> otherwise.As anyway if there are no users the driver would have been
> already disabled right?

Right, if there are no usrs device should already be in low power mode
and we do not need anything to do here. Additionally, if device has no
users we do not wantt o power it on in esume() as this will only cause
us to waste power.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2011-11-16 17:53    [W:0.307 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site