-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: include/linux/input.h
- Loading branch information
Showing
63 changed files
with
3,201 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
Kernel driver for CMA3000-D0x | ||
============================ | ||
|
||
Supported chips: | ||
* VTI CMA3000-D0x | ||
Datasheet: | ||
CMA3000-D0X Product Family Specification 8281000A.02.pdf | ||
<http://www.vti.fi/en/> | ||
|
||
Author: Hemanth V <hemanthv@ti.com> | ||
|
||
|
||
Description | ||
----------- | ||
CMA3000 Tri-axis accelerometer supports Motion detect, Measurement and | ||
Free fall modes. | ||
|
||
Motion Detect Mode: Its the low power mode where interrupts are generated only | ||
when motion exceeds the defined thresholds. | ||
|
||
Measurement Mode: This mode is used to read the acceleration data on X,Y,Z | ||
axis and supports 400, 100, 40 Hz sample frequency. | ||
|
||
Free fall Mode: This mode is intended to save system resources. | ||
|
||
Threshold values: Chip supports defining threshold values for above modes | ||
which includes time and g value. Refer product specifications for more details. | ||
|
||
CMA3000 chip supports mutually exclusive I2C and SPI interfaces for | ||
communication, currently the driver supports I2C based communication only. | ||
Initial configuration for bus mode is set in non volatile memory and can later | ||
be modified through bus interface command. | ||
|
||
Driver reports acceleration data through input subsystem. It generates ABS_MISC | ||
event with value 1 when free fall is detected. | ||
|
||
Platform data need to be configured for initial default values. | ||
|
||
Platform Data | ||
------------- | ||
fuzz_x: Noise on X Axis | ||
|
||
fuzz_y: Noise on Y Axis | ||
|
||
fuzz_z: Noise on Z Axis | ||
|
||
g_range: G range in milli g i.e 2000 or 8000 | ||
|
||
mode: Default Operating mode | ||
|
||
mdthr: Motion detect g range threshold value | ||
|
||
mdfftmr: Motion detect and free fall time threshold value | ||
|
||
ffthr: Free fall g range threshold value | ||
|
||
Input Interface | ||
-------------- | ||
Input driver version is 1.0.0 | ||
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0 | ||
Input device name: "cma3000-accelerometer" | ||
Supported events: | ||
Event type 0 (Sync) | ||
Event type 3 (Absolute) | ||
Event code 0 (X) | ||
Value 47 | ||
Min -8000 | ||
Max 8000 | ||
Fuzz 200 | ||
Event code 1 (Y) | ||
Value -28 | ||
Min -8000 | ||
Max 8000 | ||
Fuzz 200 | ||
Event code 2 (Z) | ||
Value 905 | ||
Min -8000 | ||
Max 8000 | ||
Fuzz 200 | ||
Event code 40 (Misc) | ||
Value 0 | ||
Min 0 | ||
Max 1 | ||
Event type 4 (Misc) | ||
|
||
|
||
Register/Platform parameters Description | ||
---------------------------------------- | ||
|
||
mode: | ||
0: power down mode | ||
1: 100 Hz Measurement mode | ||
2: 400 Hz Measurement mode | ||
3: 40 Hz Measurement mode | ||
4: Motion Detect mode (default) | ||
5: 100 Hz Free fall mode | ||
6: 40 Hz Free fall mode | ||
7: Power off mode | ||
|
||
grange: | ||
2000: 2000 mg or 2G Range | ||
8000: 8000 mg or 8G Range | ||
|
||
mdthr: | ||
X: X * 71mg (8G Range) | ||
X: X * 18mg (2G Range) | ||
|
||
mdfftmr: | ||
X: (X & 0x70) * 100 ms (MDTMR) | ||
(X & 0x0F) * 2.5 ms (FFTMR 400 Hz) | ||
(X & 0x0F) * 10 ms (FFTMR 100 Hz) | ||
|
||
ffthr: | ||
X: (X >> 2) * 18mg (2G Range) | ||
X: (X & 0x0F) * 71 mg (8G Range) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
* Copyright (C) 2010 ST Microelectronics | ||
* Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
* | ||
* This file is licensed under the terms of the GNU General Public | ||
* License version 2. This program is licensed "as is" without any | ||
* warranty of any kind, whether express or implied. | ||
*/ | ||
|
||
#ifndef __PLAT_KEYBOARD_H | ||
#define __PLAT_KEYBOARD_H | ||
|
||
#include <linux/bitops.h> | ||
#include <linux/input.h> | ||
#include <linux/input/matrix_keypad.h> | ||
#include <linux/types.h> | ||
|
||
#define DECLARE_KEYMAP(_name) \ | ||
int _name[] = { \ | ||
KEY(0, 0, KEY_ESC), \ | ||
KEY(0, 1, KEY_1), \ | ||
KEY(0, 2, KEY_2), \ | ||
KEY(0, 3, KEY_3), \ | ||
KEY(0, 4, KEY_4), \ | ||
KEY(0, 5, KEY_5), \ | ||
KEY(0, 6, KEY_6), \ | ||
KEY(0, 7, KEY_7), \ | ||
KEY(0, 8, KEY_8), \ | ||
KEY(1, 0, KEY_9), \ | ||
KEY(1, 1, KEY_MINUS), \ | ||
KEY(1, 2, KEY_EQUAL), \ | ||
KEY(1, 3, KEY_BACKSPACE), \ | ||
KEY(1, 4, KEY_TAB), \ | ||
KEY(1, 5, KEY_Q), \ | ||
KEY(1, 6, KEY_W), \ | ||
KEY(1, 7, KEY_E), \ | ||
KEY(1, 8, KEY_R), \ | ||
KEY(2, 0, KEY_T), \ | ||
KEY(2, 1, KEY_Y), \ | ||
KEY(2, 2, KEY_U), \ | ||
KEY(2, 3, KEY_I), \ | ||
KEY(2, 4, KEY_O), \ | ||
KEY(2, 5, KEY_P), \ | ||
KEY(2, 6, KEY_LEFTBRACE), \ | ||
KEY(2, 7, KEY_RIGHTBRACE), \ | ||
KEY(2, 8, KEY_ENTER), \ | ||
KEY(3, 0, KEY_LEFTCTRL), \ | ||
KEY(3, 1, KEY_A), \ | ||
KEY(3, 2, KEY_S), \ | ||
KEY(3, 3, KEY_D), \ | ||
KEY(3, 4, KEY_F), \ | ||
KEY(3, 5, KEY_G), \ | ||
KEY(3, 6, KEY_H), \ | ||
KEY(3, 7, KEY_J), \ | ||
KEY(3, 8, KEY_K), \ | ||
KEY(4, 0, KEY_L), \ | ||
KEY(4, 1, KEY_SEMICOLON), \ | ||
KEY(4, 2, KEY_APOSTROPHE), \ | ||
KEY(4, 3, KEY_GRAVE), \ | ||
KEY(4, 4, KEY_LEFTSHIFT), \ | ||
KEY(4, 5, KEY_BACKSLASH), \ | ||
KEY(4, 6, KEY_Z), \ | ||
KEY(4, 7, KEY_X), \ | ||
KEY(4, 8, KEY_C), \ | ||
KEY(4, 0, KEY_L), \ | ||
KEY(4, 1, KEY_SEMICOLON), \ | ||
KEY(4, 2, KEY_APOSTROPHE), \ | ||
KEY(4, 3, KEY_GRAVE), \ | ||
KEY(4, 4, KEY_LEFTSHIFT), \ | ||
KEY(4, 5, KEY_BACKSLASH), \ | ||
KEY(4, 6, KEY_Z), \ | ||
KEY(4, 7, KEY_X), \ | ||
KEY(4, 8, KEY_C), \ | ||
KEY(4, 0, KEY_L), \ | ||
KEY(4, 1, KEY_SEMICOLON), \ | ||
KEY(4, 2, KEY_APOSTROPHE), \ | ||
KEY(4, 3, KEY_GRAVE), \ | ||
KEY(4, 4, KEY_LEFTSHIFT), \ | ||
KEY(4, 5, KEY_BACKSLASH), \ | ||
KEY(4, 6, KEY_Z), \ | ||
KEY(4, 7, KEY_X), \ | ||
KEY(4, 8, KEY_C), \ | ||
KEY(5, 0, KEY_V), \ | ||
KEY(5, 1, KEY_B), \ | ||
KEY(5, 2, KEY_N), \ | ||
KEY(5, 3, KEY_M), \ | ||
KEY(5, 4, KEY_COMMA), \ | ||
KEY(5, 5, KEY_DOT), \ | ||
KEY(5, 6, KEY_SLASH), \ | ||
KEY(5, 7, KEY_RIGHTSHIFT), \ | ||
KEY(5, 8, KEY_KPASTERISK), \ | ||
KEY(6, 0, KEY_LEFTALT), \ | ||
KEY(6, 1, KEY_SPACE), \ | ||
KEY(6, 2, KEY_CAPSLOCK), \ | ||
KEY(6, 3, KEY_F1), \ | ||
KEY(6, 4, KEY_F2), \ | ||
KEY(6, 5, KEY_F3), \ | ||
KEY(6, 6, KEY_F4), \ | ||
KEY(6, 7, KEY_F5), \ | ||
KEY(6, 8, KEY_F6), \ | ||
KEY(7, 0, KEY_F7), \ | ||
KEY(7, 1, KEY_F8), \ | ||
KEY(7, 2, KEY_F9), \ | ||
KEY(7, 3, KEY_F10), \ | ||
KEY(7, 4, KEY_NUMLOCK), \ | ||
KEY(7, 5, KEY_SCROLLLOCK), \ | ||
KEY(7, 6, KEY_KP7), \ | ||
KEY(7, 7, KEY_KP8), \ | ||
KEY(7, 8, KEY_KP9), \ | ||
KEY(8, 0, KEY_KPMINUS), \ | ||
KEY(8, 1, KEY_KP4), \ | ||
KEY(8, 2, KEY_KP5), \ | ||
KEY(8, 3, KEY_KP6), \ | ||
KEY(8, 4, KEY_KPPLUS), \ | ||
KEY(8, 5, KEY_KP1), \ | ||
KEY(8, 6, KEY_KP2), \ | ||
KEY(8, 7, KEY_KP3), \ | ||
KEY(8, 8, KEY_KP0), \ | ||
} | ||
|
||
/** | ||
* struct kbd_platform_data - spear keyboard platform data | ||
* keymap: pointer to keymap data (table and size) | ||
* rep: enables key autorepeat | ||
* | ||
* This structure is supposed to be used by platform code to supply | ||
* keymaps to drivers that implement keyboards. | ||
*/ | ||
struct kbd_platform_data { | ||
const struct matrix_keymap_data *keymap; | ||
bool rep; | ||
}; | ||
|
||
/* This function is used to set platform data field of pdev->dev */ | ||
static inline void | ||
kbd_set_plat_data(struct platform_device *pdev, struct kbd_platform_data *data) | ||
{ | ||
pdev->dev.platform_data = data; | ||
} | ||
|
||
#endif /* __PLAT_KEYBOARD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.