linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Kevin Tsai <ktsai@capellamicro.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Arnd Bergmann <arnd@arndb.de>, Joe Perches <joe@perches.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Roberta Dobrescu <roberta.dobrescu@gmail.com>,
	Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 3/6] iio: light: Updated Vishay Capella cm32181 ambient light sensor driver.
Date: Sat, 23 May 2015 12:04:20 +0100	[thread overview]
Message-ID: <55605EB4.5060603@kernel.org> (raw)
In-Reply-To: <1432268380-7302-3-git-send-email-ktsai@capellamicro.com>

On 22/05/15 05:19, Kevin Tsai wrote:
> - Added Power Management support.
> - Added driver remove routine.
> 
> Signed-off-by: Kevin Tsai <ktsai@capellamicro.com>
This one is fine other than the patch title.
You could split it but as the two changes don't interfere and are
kind of related, this one is fine as a single patch.
> ---
>  drivers/iio/light/cm32181.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c
> index 6b11145..9bc3e1f 100644
> --- a/drivers/iio/light/cm32181.c
> +++ b/drivers/iio/light/cm32181.c
> @@ -370,11 +370,51 @@ static int cm32181_probe(struct i2c_client *client,
>  	return 0;
>  }
>  
> +static int cm32181_remove(struct i2c_client *client)
> +{
> +	i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
> +		CM32181_CMD_ALS_DISABLE);
> +
> +	return 0;
> +}
> +
>  static const struct i2c_device_id cm32181_id[] = {
>  	{ "cm32181", 0 },
>  	{ }
>  };
>  
> +#ifdef CONFIG_PM_SLEEP
> +static int cm32181_suspend(struct device *dev)
> +{
> +	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> +	struct cm32181_chip *chip = iio_priv(indio_dev);
> +	struct i2c_client *client = chip->client;
> +	int ret;
> +
> +	ret = i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
> +					CM32181_CMD_ALS_DISABLE);
> +
> +	return ret;
> +}
> +
> +static int cm32181_resume(struct device *dev)
> +{
> +	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
> +	struct cm32181_chip *chip = iio_priv(indio_dev);
> +	struct i2c_client *client = chip->client;
> +	int ret;
> +
> +	chip->conf_regs[CM32181_REG_ADDR_CMD] &= ~CM32181_CMD_ALS_DISABLE;
> +	ret = i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
> +				chip->conf_regs[CM32181_REG_ADDR_CMD]);
> +
> +	return ret;
> +}
> +
> +static const struct dev_pm_ops cm32181_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(cm32181_suspend, cm32181_resume)};
> +#endif
> +
>  MODULE_DEVICE_TABLE(i2c, cm32181_id);
>  
>  static const struct of_device_id cm32181_of_match[] = {
> @@ -387,9 +427,13 @@ static struct i2c_driver cm32181_driver = {
>  		.name	= "cm32181",
>  		.of_match_table = of_match_ptr(cm32181_of_match),
>  		.owner	= THIS_MODULE,
> +#ifdef CONFIG_PM_SLEEP
> +		.pm     = &cm32181_pm_ops,
> +#endif
>  	},
>  	.id_table	= cm32181_id,
>  	.probe		= cm32181_probe,
> +	.remove		= cm32181_remove,
>  };
>  
>  module_i2c_driver(cm32181_driver);
> 


  reply	other threads:[~2015-05-23 11:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  4:19 [PATCH 1/6] iio: light: Updated Vishay Capella cm32181 ambient light sensor driver Kevin Tsai
2015-05-22  4:19 ` [PATCH 2/6] " Kevin Tsai
2015-05-23 11:02   ` Jonathan Cameron
2015-05-22  4:19 ` [PATCH 3/6] " Kevin Tsai
2015-05-23 11:04   ` Jonathan Cameron [this message]
2015-05-22  4:19 ` [PATCH 4/6] " Kevin Tsai
2015-05-23 11:10   ` Jonathan Cameron
2015-05-22  4:19 ` [PATCH 5/6] " Kevin Tsai
2015-05-23 11:15   ` Jonathan Cameron
2015-05-22  4:19 ` [PATCH 6/6] " Kevin Tsai
2015-05-22  8:26   ` Peter Meerwald
2015-05-23 11:21   ` Jonathan Cameron
2015-05-22  4:36 ` [PATCH 1/6] " Joe Perches
2015-05-22  4:39 ` Joe Perches
2015-05-23 10:57 ` Jonathan Cameron

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=55605EB4.5060603@kernel.org \
    --to=jic23@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=daniel.baluta@intel.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jingoohan1@gmail.com \
    --cc=joe@perches.com \
    --cc=knaack.h@gmx.de \
    --cc=ktsai@capellamicro.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=roberta.dobrescu@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sathyanarayanan.kuppuswamy@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;
as well as URLs for NNTP newsgroup(s).