History

Input: add CMA3000 accelerometer driver

Add support for CMA3000 Tri-axis accelerometer, which supports Motion detect, Measurement and Free fall modes. CMA3000 supports both I2C/SPI bus for communication, currently the driver supports I2C based communication.

Hemanth V committed 15 years ago

Commit b029ffa1 parent 33e808c7 files · +781 −0Browse files

Showing the changes to include/linux/input (1 of 7 files). Show all

Unified · Split

include/linux/input/cma3000.h+59−0
@@ -0,0 +1,59 @@
1+/*
2+ * VTI CMA3000_Dxx Accelerometer driver
3+ *
4+ * Copyright (C) 2010 Texas Instruments
5+ * Author: Hemanth V <hemanthv@ti.com>
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 version 2 as published by
9+ * the Free Software Foundation.
10+ *
11+ * This program is distributed in the hope that it will be useful, but WITHOUT
12+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14+ * more details.
15+ *
16+ * You should have received a copy of the GNU General Public License along with
17+ * this program. If not, see <http://www.gnu.org/licenses/>.
18+ */
19+
20+#ifndef _LINUX_CMA3000_H
21+#define _LINUX_CMA3000_H
22+
23+#define CMAMODE_DEFAULT 0
24+#define CMAMODE_MEAS100 1
25+#define CMAMODE_MEAS400 2
26+#define CMAMODE_MEAS40 3
27+#define CMAMODE_MOTDET 4
28+#define CMAMODE_FF100 5
29+#define CMAMODE_FF400 6
30+#define CMAMODE_POFF 7
31+
32+#define CMARANGE_2G 2000
33+#define CMARANGE_8G 8000
34+
35+/**
36+ * struct cma3000_i2c_platform_data - CMA3000 Platform data
37+ * @fuzz_x: Noise on X Axis
38+ * @fuzz_y: Noise on Y Axis
39+ * @fuzz_z: Noise on Z Axis
40+ * @g_range: G range in milli g i.e 2000 or 8000
41+ * @mode: Operating mode
42+ * @mdthr: Motion detect threshold value
43+ * @mdfftmr: Motion detect and free fall time value
44+ * @ffthr: Free fall threshold value
45+ */
46+
47+struct cma3000_platform_data {
48+ int fuzz_x;
49+ int fuzz_y;
50+ int fuzz_z;
51+ int g_range;
52+ uint8_t mode;
53+ uint8_t mdthr;
54+ uint8_t mdfftmr;
55+ uint8_t ffthr;
56+ unsigned long irqflags;
57+};
58+
59+#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t