linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4]  Fujitsu panel update
@ 2007-12-03 22:18 Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 1/4] apanel: free input device on close Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-12-03 22:18 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, akpm

Fixes based on version in 2.6.24-rc3-mm1


-- 


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

* [PATCH 1/4] apanel: free input device on close
  2007-12-03 22:18 [PATCH 0/4] Fujitsu panel update Stephen Hemminger
@ 2007-12-03 22:18 ` Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 2/4] apanel: change name of LED Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-12-03 22:18 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, akpm

[-- Attachment #1: fujitsu-apanel-input-free.patch --]
[-- Type: text/plain, Size: 430 bytes --]

Fix memory leak.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/input/misc/apanel.c	2007-11-20 06:03:06.000000000 -0800
+++ b/drivers/input/misc/apanel.c	2007-11-20 06:04:52.000000000 -0800
@@ -176,6 +176,7 @@ static int apanel_detach_client(struct i
 
 	input_unregister_polled_device(ap->ipdev);
 	i2c_detach_client(&ap->client);
+	input_free_polled_device(ap->ipdev);
 
 	return 0;
 }

-- 


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

* [PATCH 2/4] apanel: change name of LED
  2007-12-03 22:18 [PATCH 0/4] Fujitsu panel update Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 1/4] apanel: free input device on close Stephen Hemminger
@ 2007-12-03 22:18 ` Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 3/4] apanel: detach on shutdown Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 4/4] apanel: use generic keycode routines Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-12-03 22:18 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, akpm

[-- Attachment #1: fujitsu-apanel-led-name.patch --]
[-- Type: text/plain, Size: 548 bytes --]

Make name of LED match the current usage precedent in wistron buttons.
Note: If the LED developers want a different convention, they can just change
both drivers.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/input/misc/apanel.c	2007-11-20 06:10:18.000000000 -0800
+++ b/drivers/input/misc/apanel.c	2007-11-20 06:11:34.000000000 -0800
@@ -219,7 +219,7 @@ static struct apanel apanel = {
 
 	},
 	.mail_led = {
-		.name = APANEL ":mail",
+		.name = "mail:blue",
 		.brightness_set = mail_led_set,
 	},
 };

-- 


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

* [PATCH 3/4] apanel: detach on shutdown
  2007-12-03 22:18 [PATCH 0/4] Fujitsu panel update Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 1/4] apanel: free input device on close Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 2/4] apanel: change name of LED Stephen Hemminger
@ 2007-12-03 22:18 ` Stephen Hemminger
  2007-12-03 22:18 ` [PATCH 4/4] apanel: use generic keycode routines Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-12-03 22:18 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, akpm

[-- Attachment #1: fujitsu-apanel-shutdown.patch --]
[-- Type: text/plain, Size: 769 bytes --]

Need to stop any device polling on shutdown. Without this, the
laptop can sometimes not turn off.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/input/misc/apanel.c	2007-11-20 06:11:34.000000000 -0800
+++ b/drivers/input/misc/apanel.c	2007-11-20 06:14:18.000000000 -0800
@@ -193,12 +193,18 @@ static int apanel_attach_adapter(struct 
 	return i2c_probe(adap, &addr_data, apanel_probe);
 }
 
+static void apanel_shutdown(struct i2c_client *client)
+{
+	apanel_detach_client(client);
+}
+
 static struct i2c_driver apanel_driver = {
 	.driver = {
 		.name = APANEL,
 	},
 	.attach_adapter = &apanel_attach_adapter,
 	.detach_client  = &apanel_detach_client,
+	.shutdown	= &apanel_shutdown,
 };
 
 static struct apanel apanel = {

-- 


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

* [PATCH 4/4] apanel: use generic keycode routines
  2007-12-03 22:18 [PATCH 0/4] Fujitsu panel update Stephen Hemminger
                   ` (2 preceding siblings ...)
  2007-12-03 22:18 ` [PATCH 3/4] apanel: detach on shutdown Stephen Hemminger
@ 2007-12-03 22:18 ` Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-12-03 22:18 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, akpm

[-- Attachment #1: fujitsu-apanel-generic-keymap.patch --]
[-- Type: text/plain, Size: 1602 bytes --]

Don't need driver specific keymap routines, generic keycode routines
will work fine.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>


--- a/drivers/input/misc/apanel.c	2007-11-21 17:32:36.000000000 -0800
+++ b/drivers/input/misc/apanel.c	2007-11-21 17:39:24.000000000 -0800
@@ -120,33 +120,6 @@ static void apanel_poll(struct input_pol
 			report_key(idev, ap->keymap[i]);
 }
 
-static int apanel_getkeycode(struct input_dev *idev, int scancode, int *keycode)
-{
-	struct apanel *ap = idev->private;
-
-	if (scancode < 0 || scancode >= MAX_PANEL_KEYS)
-		return -EINVAL;
-
-	*keycode = ap->keymap[scancode];
-	return 0;
-}
-
-static int apanel_setkeycode(struct input_dev *idev, int scancode, int keycode)
-{
-	struct apanel *ap = idev->private;
-
-	if (keycode < 0 || keycode > KEY_MAX)
-		return -EINVAL;
-
-	if (scancode < 0 || scancode >= MAX_PANEL_KEYS)
-		return -EINVAL;
-
-	clear_bit(ap->keymap[scancode], idev->keybit);
-	ap->keymap[scancode] = keycode;
-	set_bit(keycode, idev->keybit);
-	return 0;
-}
-
 /* Track state changes of LED */
 static void led_update(struct work_struct *work)
 {
@@ -274,11 +247,11 @@ static int apanel_probe(struct i2c_adapt
 	idev->phys = "apanel/input0";
 	idev->id.bustype = BUS_HOST;
 	idev->dev.parent = &ap->client.dev;
-	idev->getkeycode = apanel_getkeycode;
-	idev->setkeycode = apanel_setkeycode;
 
 	set_bit(EV_KEY, idev->evbit);
 
+	idev->keycode = ap->keymap;
+	idev->keycodesize = sizeof(ap->keymap[0]);
 	idev->keycodemax = (device_chip[APANEL_DEV_CDBTN] != CHIP_NONE) ? 12 : 4;
 
 	for (i = 0; i < idev->keycodemax; i++)

-- 


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

end of thread, other threads:[~2007-12-03 22:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03 22:18 [PATCH 0/4] Fujitsu panel update Stephen Hemminger
2007-12-03 22:18 ` [PATCH 1/4] apanel: free input device on close Stephen Hemminger
2007-12-03 22:18 ` [PATCH 2/4] apanel: change name of LED Stephen Hemminger
2007-12-03 22:18 ` [PATCH 3/4] apanel: detach on shutdown Stephen Hemminger
2007-12-03 22:18 ` [PATCH 4/4] apanel: use generic keycode routines Stephen Hemminger

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