linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wm97xx-core: Report a phys for WM97xx touchscreens
@ 2008-05-22 11:35 Mark Brown
  2008-05-22 13:41 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2008-05-22 11:35 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, akpm, Mark Brown

phys is displayed in various diagnostic output so ensure that it is set
to something sensible.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
It'd be nice to get this merged into 2.6.26 since this is rather user visible
and given that this is a new driver there's no risk of regressions.

 drivers/input/touchscreen/wm97xx-core.c |    2 ++
 include/linux/wm97xx.h                  |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index e9c7ea4..12ae1ba 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -616,6 +616,8 @@ static int wm97xx_probe(struct device *dev)
 
 	/* set up touch configuration */
 	wm->input_dev->name = "wm97xx touchscreen";
+	snprintf(wm->phys, sizeof(wm->phys), "%s/input0", dev->bus_id);
+	wm->input_dev->phys = wm->phys;
 	wm->input_dev->open = wm97xx_ts_input_open;
 	wm->input_dev->close = wm97xx_ts_input_close;
 	set_bit(EV_ABS, wm->input_dev->evbit);
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 4d13732..1f38fc4 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -261,6 +261,7 @@ struct wm97xx_mach_ops {
 };
 
 struct wm97xx {
+	char phys[32];			/* Device name */
 	u16 dig[3], id, gpio[6], misc;	/* Cached codec registers */
 	u16 dig_save[3];		/* saved during aux reading */
 	struct wm97xx_codec_drv *codec;	/* attached codec driver*/
-- 
1.5.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wm97xx-core: Report a phys for WM97xx touchscreens
  2008-05-22 11:35 [PATCH] wm97xx-core: Report a phys for WM97xx touchscreens Mark Brown
@ 2008-05-22 13:41 ` Dmitry Torokhov
  2008-05-22 15:01   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2008-05-22 13:41 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-input, linux-kernel, akpm

Hi Mark,

On Thu, May 22, 2008 at 12:35:06PM +0100, Mark Brown wrote:
> phys is displayed in various diagnostic output so ensure that it is set
> to something sensible.
>

Phys is used to describe the physical connection of a device that is
ideally not changing between reboots so having it set up based on
device's bus_id is not a best option I think.

What tools besides evbug use phys? They probably should display both
phys and sysfs paths (I will be changing evbug soon).

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wm97xx-core: Report a phys for WM97xx touchscreens
  2008-05-22 13:41 ` Dmitry Torokhov
@ 2008-05-22 15:01   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2008-05-22 15:01 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, akpm

On Thu, May 22, 2008 at 09:41:48AM -0400, Dmitry Torokhov wrote:
> On Thu, May 22, 2008 at 12:35:06PM +0100, Mark Brown wrote:

> > phys is displayed in various diagnostic output so ensure that it is set
> > to something sensible.

> Phys is used to describe the physical connection of a device that is
> ideally not changing between reboots so having it set up based on
> device's bus_id is not a best option I think.

It didn't seem terribly wonderful to me either but I saw that some other
drivers were doing the same thing so I assumed it was idiomatic.  A
quick survey of devices on my laptop suggets that it's getting filled in
with USB bus IDs for some devices.

For a WM97xx device it should actually be OK almost all the time - AC97
bus identifiers are fixed in hardware, there would only be a problem if
additional AC97 buses are added which is relatively unlikely, especially
in the embedded applications where the WM97xx devices get used.
However, if it's supposed to be OK to leave this null then that would be
better.

> What tools besides evbug use phys? They probably should display both
> phys and sysfs paths (I will be changing evbug soon).

It was actually evbug that prompted this - it prints a rather alarming
'Connected device: "foo", NULL' when phys is left empty.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-22 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 11:35 [PATCH] wm97xx-core: Report a phys for WM97xx touchscreens Mark Brown
2008-05-22 13:41 ` Dmitry Torokhov
2008-05-22 15:01   ` Mark Brown

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).