From: Christopher Heiny <cheiny@synaptics.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Andrew Duggan <aduggan@synaptics.com>,
Vincent Huang <vincent.huang@tw.synaptics.com>,
Vivian Ly <vly@synaptics.com>,
Daniel Rosenberg <daniel.rosenberg@synaptics.com>,
Linus Walleij <linus.walleij@stericsson.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Courtney Cavin <courtney.cavin@sonymobile.com>,
Linux Input <linux-input@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 03/11] Input: synaptics-rmi4 - do not update configuration in rmi_f01_probe()
Date: Thu, 13 Feb 2014 11:23:44 -0800 [thread overview]
Message-ID: <52FD1BC0.1050009@synaptics.com> (raw)
In-Reply-To: <1392269277-16391-3-git-send-email-dmitry.torokhov@gmail.com>
On 02/12/2014 09:27 PM, Dmitry Torokhov wrote:
> Do not write configuration data in probe(), we have config() for that.
Then we should call config() in rmi_function_probe() to ensure that
any platform data or device tree configuration settings get written
to the device.
Thinking about that, it looks like it's not fatal if the config
write fails in that situation. The device might not function as
intended, but you can hopefully get some use out of it (for
instance, a phone's touchscreen sensitivity might be wacky, but
the user will still be able to dial tech support).
For example:
static int rmi_function_probe(struct device *dev)
{
struct rmi_function *fn = to_rmi_function(dev);
struct rmi_function_handler *handler =
to_rmi_function_handler(dev->driver);
int error;
if (handler->probe) {
error = handler->probe(fn);
if (error)
return error;
}
if (handler->config) {
error = handler->config(fn);
if (error)
dev_warn(dev, "Driver config failed.\n");
}
return 0;
}
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/rmi4/rmi_f01.c | 18 ------------------
> 1 file changed, 18 deletions(-)
>
> diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
> index 897d8ac..976aba3 100644
> --- a/drivers/input/rmi4/rmi_f01.c
> +++ b/drivers/input/rmi4/rmi_f01.c
> @@ -303,12 +303,6 @@ static int rmi_f01_initialize(struct rmi_function *fn)
> if (pdata->power_management.doze_interval) {
> data->device_control.doze_interval =
> pdata->power_management.doze_interval;
> - error = rmi_write(rmi_dev, data->doze_interval_addr,
> - data->device_control.doze_interval);
> - if (error < 0) {
> - dev_err(&fn->dev, "Failed to configure F01 doze interval register.\n");
> - return error;
> - }
> } else {
> error = rmi_read(rmi_dev, data->doze_interval_addr,
> &data->device_control.doze_interval);
> @@ -324,12 +318,6 @@ static int rmi_f01_initialize(struct rmi_function *fn)
> if (pdata->power_management.wakeup_threshold) {
> data->device_control.wakeup_threshold =
> pdata->power_management.wakeup_threshold;
> - error = rmi_write(rmi_dev, data->wakeup_threshold_addr,
> - data->device_control.wakeup_threshold);
> - if (error < 0) {
> - dev_err(&fn->dev, "Failed to configure F01 wakeup threshold register.\n");
> - return error;
> - }
> } else {
> error = rmi_read(rmi_dev, data->wakeup_threshold_addr,
> &data->device_control.wakeup_threshold);
> @@ -347,12 +335,6 @@ static int rmi_f01_initialize(struct rmi_function *fn)
> if (pdata->power_management.doze_holdoff) {
> data->device_control.doze_holdoff =
> pdata->power_management.doze_holdoff;
> - error = rmi_write(rmi_dev, data->doze_holdoff_addr,
> - data->device_control.doze_holdoff);
> - if (error < 0) {
> - dev_err(&fn->dev, "Failed to configure F01 doze holdoff register.\n");
> - return error;
> - }
> } else {
> error = rmi_read(rmi_dev, data->doze_holdoff_addr,
> &data->device_control.doze_holdoff);
>
--
Christopher Heiny
Senior Staff Firmware Engineer
Synaptics Incorporated
next prev parent reply other threads:[~2014-02-13 19:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 5:27 [PATCH 01/11] Input: synaptics-rmi4 - do not kfree() managed memory in F01 Dmitry Torokhov
2014-02-13 5:27 ` [PATCH 02/11] Input: synaptics-rmi4 - remove unused rmi_f01_remove() Dmitry Torokhov
2014-02-13 19:11 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 03/11] Input: synaptics-rmi4 - do not update configuration in rmi_f01_probe() Dmitry Torokhov
2014-02-13 19:23 ` Christopher Heiny [this message]
2014-02-13 21:54 ` Dmitry Torokhov
2014-02-14 23:00 ` Christopher Heiny
2014-02-17 19:23 ` Dmitry Torokhov
2014-02-18 21:32 ` Christopher Heiny
2014-03-19 0:21 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 04/11] Input: synaptics-rmi4 - fix LTS handling in F01 Dmitry Torokhov
2014-02-13 19:32 ` Christopher Heiny
2014-02-14 8:05 ` Dmitry Torokhov
2014-02-13 5:27 ` [PATCH 05/11] Input: synaptics-rmi4 - remove control_mutex from f01_data Dmitry Torokhov
2014-02-13 23:01 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 06/11] Input: synaptics-rmi4 - remove device_status form f01_data Dmitry Torokhov
2014-02-13 21:15 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 07/11] Input: synaptics-rmi4 - rename instances of f01_data from data to f01 Dmitry Torokhov
2014-02-13 21:32 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 08/11] Input: synaptics-rmi4 - use rmi_read/rmi_write in F01 Dmitry Torokhov
2014-02-13 21:33 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 09/11] Input: synaptics-rmi4 - consolidate memory allocations " Dmitry Torokhov
2014-02-13 19:52 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 10/11] Input: synaptics-rmi4 - make accessor for platform data return const pointer Dmitry Torokhov
2014-02-13 20:00 ` Christopher Heiny
2014-02-13 5:27 ` [PATCH 11/11] Input: synaptics-rmi4 - remove data pointer from RMI fucntion structure Dmitry Torokhov
2014-02-13 21:33 ` Christopher Heiny
2014-02-13 19:11 ` [PATCH 01/11] Input: synaptics-rmi4 - do not kfree() managed memory in F01 Christopher Heiny
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=52FD1BC0.1050009@synaptics.com \
--to=cheiny@synaptics.com \
--cc=aduggan@synaptics.com \
--cc=benjamin.tissoires@redhat.com \
--cc=courtney.cavin@sonymobile.com \
--cc=daniel.rosenberg@synaptics.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vincent.huang@tw.synaptics.com \
--cc=vly@synaptics.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).