Skip to content

Commit 8d964a2

Browse files
committed
Input: samsung-keypad - enable compiling on other platforms
There is nothing in keypad platform definitions that requires the driver be complied on Samsung platform only, so let's move them out of the platform subdirectory and relax the dependencies. Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 400bf29 commit 8d964a2

4 files changed

Lines changed: 48 additions & 29 deletions

File tree

arch/arm/plat-samsung/include/plat/keypad.h

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,7 @@
1313
#ifndef __PLAT_SAMSUNG_KEYPAD_H
1414
#define __PLAT_SAMSUNG_KEYPAD_H
1515

16-
#include <linux/input/matrix_keypad.h>
17-
18-
#define SAMSUNG_MAX_ROWS 8
19-
#define SAMSUNG_MAX_COLS 8
20-
21-
/**
22-
* struct samsung_keypad_platdata - Platform device data for Samsung Keypad.
23-
* @keymap_data: pointer to &matrix_keymap_data.
24-
* @rows: number of keypad row supported.
25-
* @cols: number of keypad col supported.
26-
* @no_autorepeat: disable key autorepeat.
27-
* @wakeup: controls whether the device should be set up as wakeup source.
28-
* @cfg_gpio: configure the GPIO.
29-
*
30-
* Initialisation data specific to either the machine or the platform
31-
* for the device driver to use or call-back when configuring gpio.
32-
*/
33-
struct samsung_keypad_platdata {
34-
const struct matrix_keymap_data *keymap_data;
35-
unsigned int rows;
36-
unsigned int cols;
37-
bool no_autorepeat;
38-
bool wakeup;
39-
40-
void (*cfg_gpio)(unsigned int rows, unsigned int cols);
41-
};
16+
#include <linux/input/samsung-keypad.h>
4217

4318
/**
4419
* samsung_keypad_set_platdata - Set platform data for Samsung Keypad device.

drivers/input/keyboard/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,10 @@ config KEYBOARD_PMIC8XXX
441441

442442
config KEYBOARD_SAMSUNG
443443
tristate "Samsung keypad support"
444-
depends on SAMSUNG_DEV_KEYPAD
444+
depends on HAVE_CLK
445445
help
446-
Say Y here if you want to use the Samsung keypad.
446+
Say Y here if you want to use the keypad on your Samsung mobile
447+
device.
447448

448449
To compile this driver as a module, choose M here: the
449450
module will be called samsung-keypad.

drivers/input/keyboard/samsung-keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/platform_device.h>
2323
#include <linux/slab.h>
2424
#include <linux/sched.h>
25-
#include <plat/keypad.h>
25+
#include <linux/input/samsung-keypad.h>
2626

2727
#define SAMSUNG_KEYIFCON 0x00
2828
#define SAMSUNG_KEYIFSTSCLR 0x04
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Samsung Keypad platform data definitions
3+
*
4+
* Copyright (C) 2010 Samsung Electronics Co.Ltd
5+
* Author: Joonyoung Shim <[email protected]>
6+
*
7+
* This program is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU General Public License as published by the
9+
* Free Software Foundation; either version 2 of the License, or (at your
10+
* option) any later version.
11+
*/
12+
13+
#ifndef __SAMSUNG_KEYPAD_H
14+
#define __SAMSUNG_KEYPAD_H
15+
16+
#include <linux/input/matrix_keypad.h>
17+
18+
#define SAMSUNG_MAX_ROWS 8
19+
#define SAMSUNG_MAX_COLS 8
20+
21+
/**
22+
* struct samsung_keypad_platdata - Platform device data for Samsung Keypad.
23+
* @keymap_data: pointer to &matrix_keymap_data.
24+
* @rows: number of keypad row supported.
25+
* @cols: number of keypad col supported.
26+
* @no_autorepeat: disable key autorepeat.
27+
* @wakeup: controls whether the device should be set up as wakeup source.
28+
* @cfg_gpio: configure the GPIO.
29+
*
30+
* Initialisation data specific to either the machine or the platform
31+
* for the device driver to use or call-back when configuring gpio.
32+
*/
33+
struct samsung_keypad_platdata {
34+
const struct matrix_keymap_data *keymap_data;
35+
unsigned int rows;
36+
unsigned int cols;
37+
bool no_autorepeat;
38+
bool wakeup;
39+
40+
void (*cfg_gpio)(unsigned int rows, unsigned int cols);
41+
};
42+
43+
#endif /* __SAMSUNG_KEYPAD_H */

0 commit comments

Comments
 (0)