From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: Dmitry Torokhov
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 3/4] Input: auo_pixcir_ts - keep own pointer to platform_data
Date: Sat, 23 Feb 2013 12:57:43 +0100 [thread overview]
Message-ID: <201302231257.43936.heiko@sntech.de> (raw)
In-Reply-To: <201302231255.23772.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
When supporting devicetree the platformdata may not necessarily come
from the dev but may be generated in the driver instead.
Therefore keep the pointer in the driver struct instead of using
dev.platform_data.
Signed-off-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
---
drivers/input/touchscreen/auo-pixcir-ts.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 6317a9c..c0a2483 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -111,6 +111,7 @@
struct auo_pixcir_ts {
struct i2c_client *client;
struct input_dev *input;
+ const struct auo_pixcir_ts_platdata *pdata;
char phys[32];
/* special handling for touch_indicate interupt mode */
@@ -132,7 +133,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts,
struct auo_point_t *point)
{
struct i2c_client *client = ts->client;
- const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
+ const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
uint8_t raw_coord[8];
uint8_t raw_area[4];
int i, ret;
@@ -178,8 +179,7 @@ static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts,
static irqreturn_t auo_pixcir_interrupt(int irq, void *dev_id)
{
struct auo_pixcir_ts *ts = dev_id;
- struct i2c_client *client = ts->client;
- const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
+ const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
struct auo_point_t point[AUO_PIXCIR_REPORT_POINTS];
int i;
int ret;
@@ -290,7 +290,7 @@ static int auo_pixcir_int_config(struct auo_pixcir_ts *ts,
int int_setting)
{
struct i2c_client *client = ts->client;
- struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
+ const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
int ret;
ret = i2c_smbus_read_byte_data(client, AUO_PIXCIR_REG_INT_SETTING);
@@ -527,6 +527,7 @@ static int auo_pixcir_probe(struct i2c_client *client,
msleep(200);
+ ts->pdata = pdata;
ts->client = client;
ts->touch_ind_mode = 0;
init_waitqueue_head(&ts->wait);
@@ -624,7 +625,7 @@ err_gpio_int:
static int auo_pixcir_remove(struct i2c_client *client)
{
struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
- const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
+ const struct auo_pixcir_ts_platdata *pdata = ts->pdata;
free_irq(client->irq, ts);
--
1.7.2.3
next prev parent reply other threads:[~2013-02-23 11:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-23 11:55 [PATCH 0/4] Input: auo_pixcir_ts - add devicetree support Heiko Stübner
[not found] ` <201302231255.23772.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-02-23 11:56 ` [PATCH 1/4] Input: auo-pixcir-ts - set input direction for interrupt gpio Heiko Stübner
2013-02-23 11:56 ` [PATCH 2/4] Input: auo-pixcir-ts - handle reset gpio directly Heiko Stübner
2013-02-23 11:57 ` Heiko Stübner [this message]
2013-02-23 11:58 ` [PATCH 4/4] Input: auo_pixcir_ts - add devicetree support Heiko Stübner
2013-02-24 8:00 ` Dmitry Torokhov
[not found] ` <20130224080015.GA20590-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2013-02-24 9:58 ` Heiko Stübner
2013-02-25 3:06 ` Dmitry Torokhov
2013-02-25 13:47 ` Heiko Stübner
2013-02-26 7:05 ` Dmitry Torokhov
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=201302231257.43936.heiko@sntech.de \
--to=heiko-4mtyjxux2i+zqb+pc5nmwq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.