From: Courtney Cavin <courtney.cavin@sonymobile.com>
To: Christopher Heiny <cheiny@synaptics.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
linus.walleij@stericsson.com, linus.walleij@linaro.org
Subject: Re: [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks
Date: Tue, 4 Feb 2014 18:32:47 -0800 [thread overview]
Message-ID: <20140205023246.GF1706@sonymobile.com> (raw)
In-Reply-To: <52F17339.2010406@synaptics.com>
On Wed, Feb 05, 2014 at 12:09:45AM +0100, Christopher Heiny wrote:
> On 01/23/2014 04:00 PM, Courtney Cavin wrote:
> > These are unnecessary and ugly. Remove them, and all related code.
>
> Ugly though they might be, on a number of hardware implementations they
> are quite necessary in order to provide hooks to handle hardware
> specific suspend/resume activities relating to power management and
> device configuration. Your subsequent patch relating to the VIO/VDD
> regulators might eventually render these obsolete, but in the meantime
> let's not kill them off while they're still useful.
>
Could you provide an example use-case where existing kernel frameworks
(e.g. regulators, pm) do not provide the necessary capabilities?
> >
> > Cc: Christopher Heiny <cheiny@synaptics.com>
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
> > ---
> > drivers/input/rmi4/rmi_driver.c | 57 ++---------------------------------------
> > drivers/input/rmi4/rmi_driver.h | 10 --------
> > include/linux/rmi.h | 20 ---------------
> > 3 files changed, 2 insertions(+), 85 deletions(-)
> >
> > diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> > index 780742f..691b6fb 100644
> > --- a/drivers/input/rmi4/rmi_driver.c
> > +++ b/drivers/input/rmi4/rmi_driver.c
> > @@ -621,60 +621,16 @@ error_exit:
> > #ifdef CONFIG_PM_SLEEP
> > static int rmi_driver_suspend(struct device *dev)
> > {
> > - struct rmi_driver_data *data;
> > - int retval = 0;
> > struct rmi_device *rmi_dev = to_rmi_device(dev);
> >
> > - data = dev_get_drvdata(&rmi_dev->dev);
> > -
> > - mutex_lock(&data->suspend_mutex);
> > -
> > - if (data->pre_suspend) {
> > - retval = data->pre_suspend(data->pm_data);
> > - if (retval)
> > - goto exit;
> > - }
> > -
> > disable_sensor(rmi_dev);
> > -
> > - if (data->post_suspend)
> > - retval = data->post_suspend(data->pm_data);
> > -
> > -exit:
> > - mutex_unlock(&data->suspend_mutex);
> > - return retval;
> > + return 0;
> > }
> >
> > static int rmi_driver_resume(struct device *dev)
> > {
> > - struct rmi_driver_data *data;
> > - int retval = 0;
> > struct rmi_device *rmi_dev = to_rmi_device(dev);
> > -
> > - data = dev_get_drvdata(&rmi_dev->dev);
> > - mutex_lock(&data->suspend_mutex);
> > -
> > - if (data->pre_resume) {
> > - retval = data->pre_resume(data->pm_data);
> > - if (retval)
> > - goto exit;
> > - }
> > -
> > - retval = enable_sensor(rmi_dev);
> > - if (retval)
> > - goto exit;
> > -
> > -
> > - if (data->post_resume) {
> > - retval = data->post_resume(data->pm_data);
> > - if (retval)
> > - goto exit;
> > - }
> > -
> > - data->suspended = false;
> > -exit:
> > - mutex_unlock(&data->suspend_mutex);
> > - return retval;
> > + return enable_sensor(rmi_dev);
> > }
> >
> > #endif /* CONFIG_PM_SLEEP */
> > @@ -811,15 +767,6 @@ static int rmi_driver_probe(struct device *dev)
> > retval = -ENOMEM;
> > goto err_free_data;
> > }
> > - if (IS_ENABLED(CONFIG_PM)) {
> > - data->pm_data = pdata->pm_data;
> > - data->pre_suspend = pdata->pre_suspend;
> > - data->post_suspend = pdata->post_suspend;
> > - data->pre_resume = pdata->pre_resume;
> > - data->post_resume = pdata->post_resume;
> > -
> > - mutex_init(&data->suspend_mutex);
> > - }
> >
> > data->irq = pdata->irq;
> > if (data->irq < 0) {
> > diff --git a/drivers/input/rmi4/rmi_driver.h b/drivers/input/rmi4/rmi_driver.h
> > index aef5521..f28166f 100644
> > --- a/drivers/input/rmi4/rmi_driver.h
> > +++ b/drivers/input/rmi4/rmi_driver.h
> > @@ -53,16 +53,6 @@ struct rmi_driver_data {
> > u8 bsr;
> >
> > bool enabled;
> > -#ifdef CONFIG_PM_SLEEP
> > - bool suspended;
> > - struct mutex suspend_mutex;
> > -
> > - void *pm_data;
> > - int (*pre_suspend) (const void *pm_data);
> > - int (*post_suspend) (const void *pm_data);
> > - int (*pre_resume) (const void *pm_data);
> > - int (*post_resume) (const void *pm_data);
> > -#endif
> >
> > #ifdef CONFIG_RMI4_DEBUG
> > struct dentry *debugfs_delay;
> > diff --git a/include/linux/rmi.h b/include/linux/rmi.h
> > index 326e741..41c2c04 100644
> > --- a/include/linux/rmi.h
> > +++ b/include/linux/rmi.h
> > @@ -204,8 +204,6 @@ struct rmi_device_platform_data_spi {
> > * @f11_rezero_wait - if non-zero, this is how may milliseconds the F11 2D
> > * sensor will wait before being be rezeroed on exit from suspend. If
> > * this value is zero, the F11 2D sensor will not be rezeroed on resume.
> > - * @pre_suspend - this will be called before any other suspend operations are
> > - * done.
> > * @power_management - overrides default touch sensor doze mode settings (see
> > * above)
> > * @f19_button_map - provide initial input subsystem key mappings for F19.
> > @@ -213,16 +211,6 @@ struct rmi_device_platform_data_spi {
> > * @gpioled_map - provides initial settings for GPIOs and LEDs controlled by
> > * F30.
> > * @f41_button_map - provide initial input subsystem key mappings for F41.
> > - *
> > - * @post_suspend - this will be called after all suspend operations are
> > - * completed. This is the ONLY safe place to power off an RMI sensor
> > - * during the suspend process.
> > - * @pre_resume - this is called before any other resume operations. If you
> > - * powered off the RMI4 sensor in post_suspend(), then you MUST power it back
> > - * here, and you MUST wait an appropriate time for the ASIC to come up
> > - * (100ms to 200ms, depending on the sensor) before returning.
> > - * @pm_data - this will be passed to the various (pre|post)_(suspend/resume)
> > - * functions.
> > */
> > struct rmi_device_platform_data {
> > int irq;
> > @@ -242,14 +230,6 @@ struct rmi_device_platform_data {
> > #ifdef CONFIG_RMI4_FWLIB
> > char *firmware_name;
> > #endif
> > -
> > -#ifdef CONFIG_PM
> > - void *pm_data;
> > - int (*pre_suspend) (const void *pm_data);
> > - int (*post_suspend) (const void *pm_data);
> > - int (*pre_resume) (const void *pm_data);
> > - int (*post_resume) (const void *pm_data);
> > -#endif
> > };
> >
> > /**
> >
next prev parent reply other threads:[~2014-02-05 2:31 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 0:00 [PATCH 00/15] Input: synaptics-rmi4 - cleanup and add DT support Courtney Cavin
2014-01-24 0:00 ` [PATCH 01/15] Input: synaptics-rmi4 - fix checkpatch.pl, sparse and GCC warnings Courtney Cavin
2014-01-24 0:00 ` [PATCH 02/15] Input: synaptics-rmi4 - don't kfree devm_ alloced memory Courtney Cavin
2014-01-24 0:00 ` [PATCH 03/15] Input: synaptics-rmi4 - don't free devices directly Courtney Cavin
2014-01-24 0:00 ` [PATCH 04/15] Input: synaptics-rmi4 - remove sensor name from platform data Courtney Cavin
2014-01-24 0:00 ` [PATCH 05/15] Input: synaptics-rmi4 - remove gpio handling and polling Courtney Cavin
2014-01-24 0:00 ` [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks Courtney Cavin
2014-01-24 0:00 ` [PATCH 07/15] Input: synaptics-rmi4 - remove remaining debugfs code Courtney Cavin
2014-01-24 0:00 ` [PATCH 08/15] Input: synaptics-rmi4 - cleanup platform data Courtney Cavin
2014-01-24 0:00 ` [PATCH 09/15] Input: synaptics-rmi4 - remove unused defines and variables Courtney Cavin
2014-01-24 0:00 ` [PATCH 10/15] Input: synaptics-rmi4 - add devicetree support Courtney Cavin
2014-01-24 0:00 ` [PATCH 11/15] Input: synaptics-rmi4 - add regulator support Courtney Cavin
2014-01-24 0:00 ` [PATCH 12/15] Input: synaptics-rmi4 - don't immediately set page on probe Courtney Cavin
2014-01-24 0:00 ` [PATCH 13/15] Input: synaptics-rmi4 - properly set F01 container on PDT scan Courtney Cavin
2014-01-24 0:00 ` [PATCH 14/15] Input: synaptics-rmi4 - ensure we have IRQs before reading status Courtney Cavin
2014-01-24 0:00 ` [PATCH 15/15] Input: synaptics-rmi4 - correct RMI4 spec url Courtney Cavin
2014-02-04 23:10 ` Christopher Heiny
2014-02-06 1:14 ` Dmitry Torokhov
2014-02-04 23:10 ` [PATCH 14/15] Input: synaptics-rmi4 - ensure we have IRQs before reading status Christopher Heiny
2014-02-05 2:40 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 13/15] Input: synaptics-rmi4 - properly set F01 container on PDT scan Christopher Heiny
2014-02-05 2:39 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 11/15] Input: synaptics-rmi4 - add regulator support Christopher Heiny
2014-02-05 2:38 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 10/15] Input: synaptics-rmi4 - add devicetree support Christopher Heiny
2014-02-05 2:37 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 09/15] Input: synaptics-rmi4 - remove unused defines and variables Christopher Heiny
2014-02-05 2:35 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 08/15] Input: synaptics-rmi4 - cleanup platform data Christopher Heiny
2014-02-05 2:34 ` Courtney Cavin
2014-02-04 23:09 ` [PATCH 07/15] Input: synaptics-rmi4 - remove remaining debugfs code Christopher Heiny
2014-02-05 2:33 ` Courtney Cavin
2014-02-04 23:09 ` [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks Christopher Heiny
2014-02-05 2:32 ` Courtney Cavin [this message]
2014-02-04 23:08 ` [PATCH 05/15] Input: synaptics-rmi4 - remove gpio handling and polling Christopher Heiny
2014-02-05 2:31 ` Courtney Cavin
2014-02-06 9:28 ` Linus Walleij
2014-02-06 20:05 ` Christopher Heiny
2014-02-07 1:45 ` Courtney Cavin
2014-02-06 20:05 ` Christopher Heiny
2014-02-07 1:47 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 04/15] Input: synaptics-rmi4 - remove sensor name from platform data Christopher Heiny
2014-02-05 2:30 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 03/15] Input: synaptics-rmi4 - don't free devices directly Christopher Heiny
2014-02-05 2:28 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 02/15] Input: synaptics-rmi4 - don't kfree devm_ alloced memory Christopher Heiny
2014-02-05 2:27 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 01/15] Input: synaptics-rmi4 - fix checkpatch.pl, sparse and GCC warnings Christopher Heiny
2014-02-05 2:26 ` Courtney Cavin
2014-02-06 1:09 ` Dmitry Torokhov
2014-02-06 1:36 ` Christopher Heiny
2014-02-13 6:36 ` Dmitry Torokhov
2014-02-13 18:56 ` Christopher Heiny
2014-02-13 19:10 ` Dmitry Torokhov
2014-02-13 19:12 ` Dmitry Torokhov
2014-02-13 19:25 ` Christopher Heiny
2014-01-24 0:06 ` [PATCH 00/15] Input: synaptics-rmi4 - cleanup and add DT support Courtney Cavin
2014-01-24 23:24 ` Christopher Heiny
2014-01-25 1:08 ` Courtney Cavin
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=20140205023246.GF1706@sonymobile.com \
--to=courtney.cavin@sonymobile.com \
--cc=cheiny@synaptics.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-input@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 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).