lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090515061058.GA31862@roarinelk.homelinux.net>
Date:	Fri, 15 May 2009 08:10:58 +0200
From:	Manuel Lauss <mano@...rinelk.homelinux.net>
To:	Kwangwoo Lee <kwangwoo.lee@...il.com>
Cc:	Trilok Soni <soni.trilok@...il.com>, linux-kernel@...r.kernel.org,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
Subject: Re: [PATCH] TSC2007: private data for platform callbacks.

On Fri, May 15, 2009 at 01:25:41PM +0900, Kwangwoo Lee wrote:
> Hi Manual,
> 
> On Thu, May 14, 2009 at 7:28 PM, Trilok Soni <soni.trilok@...il.com> wrote:
> > Hi Manuel,
> >
> > CCing linux-input mailing list, so not deleting any code from this
> > e-mail while replying.
> >
> > On Thu, May 14, 2009 at 3:39 PM, Manuel Lauss
> > <mano@...rinelk.homelinux.net> wrote:
> >> Add a private data field to the tsc2007 platform data and pass this
> >> to the callbacks.
> >
> > I hope that you have created this patch on top of two recently posted
> > patches by Kwangwoo Lee
> > to merge changes from Thierry.
> >
> >>
> >> Signed-off-by: Manuel Lauss <mano@...rinelk.homelinux.net>
> >> ---
> >> ?drivers/input/touchscreen/tsc2007.c | ? 52 +++++++++++++++++++++++-----------
> >> ?include/linux/i2c/tsc2007.h ? ? ? ? | ? 10 ++++---
> >> ?2 files changed, 41 insertions(+), 21 deletions(-)
> >>
> >> diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
> >> index 948e167..5c4242d 100644
> >> --- a/drivers/input/touchscreen/tsc2007.c
> >> +++ b/drivers/input/touchscreen/tsc2007.c
> >> @@ -83,10 +83,35 @@ struct tsc2007 {
> >> ? ? ? ?unsigned ? ? ? ? ? ? ? ?pendown;
> >> ? ? ? ?int ? ? ? ? ? ? ? ? ? ? irq;
> >>
> >> - ? ? ? int ? ? ? ? ? ? ? ? ? ? (*get_pendown_state)(void);
> >> - ? ? ? void ? ? ? ? ? ? ? ? ? ?(*clear_penirq)(void);
> >> + ? ? ? struct tsc2007_platform_data *pd;
> 
> Why is this pd is contained in struct tsc2007?

It just seemed nicer to me to store a pointer to the platform data
instead of duplicating its members.

 
> >> +/* ask platform for pendown state */
> >> +static inline int ts_get_pendown_state(struct tsc2007 *ts)
> >> +{
> >> + ? ? ? return ts->pd->get_pendown_state(ts->pd->priv);
> 
> Is it required in get_pendown_state() function in your platform?
> The function just return true/false indicating the pendown state.

It enables me to reuse the same callbacks if more than one tsc2007 is
soldered on (different bits to fiddle with in external registers).

Thanks,
	Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ