ARM: ep93xx: keypad: stop using mach/platform.h
authorArnd Bergmann <arnd@arndb.de>
Mon, 15 Apr 2019 20:17:10 +0000 (22:17 +0200)
committerOlof Johansson <olof@lixom.net>
Mon, 29 Apr 2019 06:08:35 +0000 (23:08 -0700)
We can communicate the clock rate using platform data rather than setting
a flag to use a particular value in the driver, which is cleaner and
avoids the dependency.

No platform in the kernel currently defines the ep93xx keypad device
structure, so this is a rather pointless excercise.  Any out of tree
users are probably dead now, but if not, they have to change their
platform code to match the new platform_data structure.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/input/keyboard/Kconfig
drivers/input/keyboard/ep93xx_keypad.c
include/linux/platform_data/keypad-ep93xx.h

index a878351..b373f32 100644 (file)
@@ -194,7 +194,7 @@ config KEYBOARD_LKKBD
 
 config KEYBOARD_EP93XX
        tristate "EP93xx Matrix Keypad support"
-       depends on ARCH_EP93XX
+       depends on ARCH_EP93XX || COMPILE_TEST
        select INPUT_MATRIXKMAP
        help
          Say Y here to enable the matrix keypad on the Cirrus EP93XX.
index f77b295..71472f6 100644 (file)
@@ -137,10 +137,7 @@ static void ep93xx_keypad_config(struct ep93xx_keypad *keypad)
        struct ep93xx_keypad_platform_data *pdata = keypad->pdata;
        unsigned int val = 0;
 
-       if (pdata->flags & EP93XX_KEYPAD_KDIV)
-               clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV4);
-       else
-               clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV16);
+       clk_set_rate(keypad->clk, pdata->clk_rate);
 
        if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY)
                val |= KEY_INIT_DIS3KY;
index 0e36818..3054fce 100644 (file)
@@ -9,8 +9,7 @@ struct matrix_keymap_data;
 #define EP93XX_KEYPAD_DIAG_MODE                (1<<1)  /* diagnostic mode */
 #define EP93XX_KEYPAD_BACK_DRIVE       (1<<2)  /* back driving mode */
 #define EP93XX_KEYPAD_TEST_MODE                (1<<3)  /* scan only column 0 */
-#define EP93XX_KEYPAD_KDIV             (1<<4)  /* 1/4 clock or 1/16 clock */
-#define EP93XX_KEYPAD_AUTOREPEAT       (1<<5)  /* enable key autorepeat */
+#define EP93XX_KEYPAD_AUTOREPEAT       (1<<4)  /* enable key autorepeat */
 
 /**
  * struct ep93xx_keypad_platform_data - platform specific device structure
@@ -24,6 +23,7 @@ struct ep93xx_keypad_platform_data {
        unsigned int    debounce;
        unsigned int    prescale;
        unsigned int    flags;
+       unsigned int    clk_rate;
 };
 
 #define EP93XX_MATRIX_ROWS             (8)