From: Arnd Bergmann <arnd@arndb.de>
To: Hartley Sweeten <hsweeten@visionengravers.com>,
Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Stefan Agner <stefan@agner.ch>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
Guenter Roeck <groeck@chromium.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] ARM: ep93xx: keypad: stop using mach/platform.h
Date: Mon, 15 Apr 2019 21:25:24 +0200 [thread overview]
Message-ID: <20190415192734.935387-2-arnd@arndb.de> (raw)
In-Reply-To: <20190415192734.935387-1-arnd@arndb.de>
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.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/keyboard/Kconfig | 2 +-
drivers/input/keyboard/ep93xx_keypad.c | 5 +----
include/linux/platform_data/keypad-ep93xx.h | 4 ++--
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index a878351f1643..b373f3274542 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -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.
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index f77b295e0123..71472f6257c0 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -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;
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h
index 0e36818e3680..3054fced8509 100644
--- a/include/linux/platform_data/keypad-ep93xx.h
+++ b/include/linux/platform_data/keypad-ep93xx.h
@@ -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)
--
2.20.0
next prev parent reply other threads:[~2019-04-15 19:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-15 19:25 [PATCH 1/4] ARM: ep93xx: move network platform data to separate header Arnd Bergmann
2019-04-15 19:25 ` Arnd Bergmann [this message]
2019-04-15 19:39 ` [PATCH 2/4] ARM: ep93xx: keypad: stop using mach/platform.h Hartley Sweeten
2019-04-15 19:47 ` Arnd Bergmann
2019-04-15 19:54 ` Alexander Sverdlin
2019-04-15 20:01 ` Guenter Roeck
2019-04-15 19:58 ` Hartley Sweeten
2019-04-23 3:22 ` Dmitry Torokhov
2019-04-15 19:25 ` [PATCH 3/4] ARM: ep93xx: move pinctrl interfaces into include/linux/soc Arnd Bergmann
2019-04-15 19:41 ` Alexander Sverdlin
2019-04-23 10:41 ` Linus Walleij
2019-04-15 19:31 ` [PATCH 1/4] ARM: ep93xx: move network platform data to separate header Alexander Sverdlin
2019-04-15 19:31 ` [PATCH 4/4] ARM: ep93xx: move private headers out of mach/* Arnd Bergmann
2019-04-15 19:44 ` Alexander Sverdlin
2019-04-16 6:03 ` Lukasz Majewski
2019-04-23 10:39 ` [PATCH 1/4] ARM: ep93xx: move network platform data to separate header Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190415192734.935387-2-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alexander.sverdlin@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=hsweeten@visionengravers.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan@agner.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®