Thread (5 messages) 5 messages, 2 authors, 2014-09-24

Re: [PATCH v2 1/2] cap1106: Add support for various cap11xx devices

From: Daniel Mack <daniel@zonque.org>
Date: 2014-09-23 06:46:39
Also in: linux-input, lkml

On 09/23/2014 06:04 AM, Matt Ranostay wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/keyboard/cap1106.c b/drivers/input/keyboard/cap1106.c
index d70b65a..07f9e88 100644
--- a/drivers/input/keyboard/cap1106.c
+++ b/drivers/input/keyboard/cap1106.c
@@ -55,8 +55,6 @@
 #define CAP1106_REG_MANUFACTURER_ID	0xfe
 #define CAP1106_REG_REVISION		0xff
 
-#define CAP1106_NUM_CHN 6
-#define CAP1106_PRODUCT_ID	0x55
 #define CAP1106_MANUFACTURER_ID	0x5d
 
 struct cap1106_priv {
@@ -64,7 +62,25 @@ struct cap1106_priv {
 	struct input_dev *idev;
 
 	/* config */
-	unsigned short keycodes[CAP1106_NUM_CHN];
+	u32 *keycodes;
+	unsigned int num_channels;
+};
+
+struct cap11xx_hw_model {
+	uint8_t product_id;
+	unsigned int num_channels;
+};
+
+enum {
+	CAP1106,
+	CAP1126,
+	CAP1188,
+};
+
+struct cap11xx_hw_model cap11xx_devices[] = {
This can be static const.

And, as I said, there should be a 3rd patch that renames the file and
its functions, structs, defines etc to the more generic "11xx" variants.


Thanks,
Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help