Skip to contentSkip to conversation

Input: max7359_keypad - drop platform data support and style fixes

PATCH In review Dmitry Torokhov 1 participant 4 messages Nov 12 – Nov 23

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

cover Input: max7359_keypad - drop platform data support and style fixes

This short series drops unused platform data support from the max7359_keypad driver so it relies exclusively on device properties via matrix_keypad_build_keymap(), and cleans up register bit definitions and argument alignment.

Thanks.

Dmitry Torokhov (2):
Input: max7359_keypad - drop platform data support
Input: max7359_keypad - fix coding style issues

 drivers/input/keyboard/max7359_keypad.c | 27 ++++++++++++-------------
 1 file changed, 13 insertions(+), 14 deletions(-)
Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog
author maintainer
#1 lore raw

PATCH 1/2 Input: max7359_keypad - drop platform data support

There are no in-tree board files or drivers instantiating max7359 via platform data. Remove platform data support and pass NULL to matrix_keypad_build_keymap() to rely entirely on device properties.

---
 drivers/input/keyboard/max7359_keypad.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/input/keyboard/max7359_keypad.c +1 -3
index d2b8adcfc9e5..686832fe2931 100644
@@ -157,8 +157,6 @@ static void max7359_initialize(struct i2c_client *client)
 
 static int max7359_probe(struct i2c_client *client)
 {
-	const struct matrix_keymap_data *keymap_data =
-			dev_get_platdata(&client->dev);
 	struct max7359_keypad *keypad;
 	struct input_dev *input_dev;
 	int ret;
@@ -206,7 +204,7 @@ static int max7359_probe(struct i2c_client *client)
 	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
 	input_set_drvdata(input_dev, keypad);
 
-	error = matrix_keypad_build_keymap(keymap_data, NULL,
+	error = matrix_keypad_build_keymap(NULL, NULL,
 					   MAX7359_MAX_KEY_ROWS,
 					   MAX7359_MAX_KEY_COLS,
 					   keypad->keycodes,
Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog
author maintainer
#2 lore raw

PATCH 2/2 Input: max7359_keypad - fix coding style issues

In reply to Dmitry Torokhov

Include <linux/bits.h> and switch the configuration register definitions to use the BIT() macro. Also align the arguments with the open parenthesis in max7359_initialize().

---
 drivers/input/keyboard/max7359_keypad.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/input/keyboard/max7359_keypad.c +12 -11
index 686832fe2931..c6673bda67ba 100644
@@ -10,13 +10,14 @@
  * Datasheet: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/5456
  */
 
-#include <linux/module.h>
+#include <linux/bits.h>
 #include <linux/i2c.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
 #include <linux/input.h>
 #include <linux/input/matrix_keypad.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/slab.h>
 
 #define MAX7359_MAX_KEY_ROWS	8
 #define MAX7359_MAX_KEY_COLS	8
@@ -37,11 +38,11 @@
 /*
  * Configuration register bits
  */
-#define MAX7359_CFG_SLEEP	(1 << 7)
-#define MAX7359_CFG_INTERRUPT	(1 << 5)
-#define MAX7359_CFG_KEY_RELEASE	(1 << 3)
-#define MAX7359_CFG_WAKEUP	(1 << 1)
-#define MAX7359_CFG_TIMEOUT	(1 << 0)
+#define MAX7359_CFG_SLEEP	BIT(7)
+#define MAX7359_CFG_INTERRUPT	BIT(5)
+#define MAX7359_CFG_KEY_RELEASE	BIT(3)
+#define MAX7359_CFG_WAKEUP	BIT(1)
+#define MAX7359_CFG_TIMEOUT	BIT(0)
 
 /*
  * Autosleep register values (ms)
@@ -143,8 +144,8 @@ static void max7359_close(struct input_dev *dev)
 static void max7359_initialize(struct i2c_client *client)
 {
 	max7359_write_reg(client, MAX7359_REG_CONFIG,
-		MAX7359_CFG_KEY_RELEASE | /* Key release enable */
-		MAX7359_CFG_WAKEUP); /* Key press wakeup enable */
+			  MAX7359_CFG_KEY_RELEASE | /* Key release enable */
+			  MAX7359_CFG_WAKEUP); /* Key press wakeup enable */
 
 	/* Full key-scan functionality */
 	max7359_write_reg(client, MAX7359_REG_DEBOUNCE, 0x1F);
Signature · 1 line
2.56.0.567.gdb80ae8cd5-goog
author maintainer
#3 lore raw
In reply to Dmitry Torokhov
Quoted 10 lines · Dmitry Torokhov

This short series drops unused platform data support from the max7359_keypad driver so it relies exclusively on device properties via matrix_keypad_build_keymap(), and cleans up register bit definitions and argument alignment.

Thanks.

Dmitry Torokhov (2):
Input: max7359_keypad - drop platform data support
Input: max7359_keypad - fix coding style issues

Applied the lot.

Signature · 1 line
Dmitry