Thread (14 messages) 14 messages, 6 authors, 2009-09-23

RE: [PATCH] input/keyboard: new driver for ADP5520 MFD PMICs

From: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Date: 2009-09-22 07:53:21
Also in: lkml

From: Jiri Kosina
Sent: Tuesday, September 22, 2009 9:33 AM

On Mon, 21 Sep 2009, Dmitry Torokhov wrote:
quoted
quoted
+	if (event & KP_INT) {
+		adp5520_read(dev->master, KP_INT_STAT_1, &reg_val_low);
+		adp5520_read(dev->master, KP_INT_STAT_2, &reg_val_high);
+
+		keymask = (reg_val_high << 8) | reg_val_low;
+		/* Read twice to clear */
+		adp5520_read(dev->master, KP_INT_STAT_1, &reg_val_low);
+		adp5520_read(dev->master, KP_INT_STAT_2, &reg_val_high);
+		keymask |= (reg_val_high << 8) | reg_val_low;
+		adp5520_keys_report_event(dev, keymask, 1);
+	}
+
+	if (event & KR_INT) {
Why do you check the same condition twice?
It actually doesn't seem to be the same condition (KP_INT vs. KR_INT), but
it's difficult to say, as these constants are apparently added in some
other patch I have no idea about.
KP Key-Press versus Key-Release 
And the same for other constants used in the code ... the patch seems to
be quite incomplete.
The missing constants are in include/linux/mfd/adp5520.h

This file was sent in a different patch, adding support for the Multi Function Device Core 
(drivers/mfd/adp5520.c)

-Michael

------------------------------------------------------------------
********* Analog Devices GmbH
**  ***** Systems Engineering
**     ** Wilhelm-Wagenfeld-Strasse 6 
**  ***** D-80807 Munich
********* Germany 
Registergericht München HRB 40368,  Geschäftsführer: Thomas Wessel, William A. Martin, Margaret K. Seif
--
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help