From: Benson Leung <bleung@chromium.org>
To: torvalds@linux-foundation.org, olofj@chromium.org,
miletus@chromium.org, dmitry.torokhov@gmail.com,
matthew.garrett@nebula.com, rydberg@euromail.se,
djkurtz@chromium.org, jy0922.shim@samsung.com,
wfp5p@virginia.edu, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Cc: bleung@chromium.org, davem@davemloft.net
Subject: [PATCH v3 2/2] Platform: x86: chromeos_laptop : Add basic platform data for atmel devices
Date: Thu, 7 Mar 2013 19:43:34 -0800 [thread overview]
Message-ID: <1362714214-32405-3-git-send-email-bleung@chromium.org> (raw)
In-Reply-To: <1362714214-32405-1-git-send-email-bleung@chromium.org>
Add basic platform data to get the current upstream driver working
with the 224s touchpad and 1664s touchscreen.
We will be using NULL config so we will use the settings from the
devices' NVRAMs.
Signed-off-by: Benson Leung <bleung@chromium.org>
Tested-by: Olof Johansson <olof@lixom.net>
---
v3: Add key map for the mXT224SL used on Chromebook Pixel, assigning BTN_LEFT
to GPIO3. Set .is_tp to true for mXT224SL.
v2: Patches cleanly with v3.9-rc1
v1: Initial
---
drivers/platform/x86/chromeos_laptop.c | 41 ++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index 93d6680..3e5b4497 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -23,6 +23,9 @@
#include <linux/dmi.h>
#include <linux/i2c.h>
+#include <linux/i2c/atmel_mxt_ts.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
#include <linux/module.h>
#define ATMEL_TP_I2C_ADDR 0x4b
@@ -67,15 +70,49 @@ static struct i2c_board_info __initdata tsl2563_als_device = {
I2C_BOARD_INFO("tsl2563", TAOS_ALS_I2C_ADDR),
};
+static struct mxt_platform_data atmel_224s_tp_platform_data = {
+ .x_line = 18,
+ .y_line = 12,
+ .x_size = 102*20,
+ .y_size = 68*20,
+ .blen = 0x80, /* Gain setting is in upper 4 bits */
+ .threshold = 0x32,
+ .voltage = 0, /* 3.3V */
+ .orient = MXT_VERTICAL_FLIP,
+ .irqflags = IRQF_TRIGGER_FALLING,
+ .is_tp = true,
+ .key_map = { KEY_RESERVED,
+ KEY_RESERVED,
+ KEY_RESERVED,
+ BTN_LEFT },
+ .config = NULL,
+ .config_length = 0,
+};
+
static struct i2c_board_info __initdata atmel_224s_tp_device = {
I2C_BOARD_INFO("atmel_mxt_tp", ATMEL_TP_I2C_ADDR),
- .platform_data = NULL,
+ .platform_data = &atmel_224s_tp_platform_data,
.flags = I2C_CLIENT_WAKE,
};
+static struct mxt_platform_data atmel_1664s_platform_data = {
+ .x_line = 32,
+ .y_line = 50,
+ .x_size = 1700,
+ .y_size = 2560,
+ .blen = 0x89, /* Gain setting is in upper 4 bits */
+ .threshold = 0x28,
+ .voltage = 0, /* 3.3V */
+ .orient = MXT_ROTATED_90_COUNTER,
+ .irqflags = IRQF_TRIGGER_FALLING,
+ .is_tp = false,
+ .config = NULL,
+ .config_length = 0,
+};
+
static struct i2c_board_info __initdata atmel_1664s_device = {
I2C_BOARD_INFO("atmel_mxt_ts", ATMEL_TS_I2C_ADDR),
- .platform_data = NULL,
+ .platform_data = &atmel_1664s_platform_data,
.flags = I2C_CLIENT_WAKE,
};
--
1.8.1.3
prev parent reply other threads:[~2013-03-08 3:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-02 1:20 [PATCH 0/2] Add platform data and touchpad functionality for Pixel Benson Leung
2013-03-02 1:20 ` [PATCH 1/2] Input: atmel_mxt_ts - add device id for touchpad variant Benson Leung
2013-03-02 3:57 ` Olof Johansson
2013-03-02 1:20 ` [PATCH 2/2] Platform: x86: chromeos_laptop : Add basic platform data for atmel devices Benson Leung
2013-03-02 4:00 ` Olof Johansson
2013-03-06 7:41 ` [PATCH v2 0/2] Add platform data and touchpad functionality for Pixel Benson Leung
2013-03-06 7:41 ` [PATCH v2 1/2] Input: atmel_mxt_ts - add device id for touchpad variant Benson Leung
2013-03-06 8:44 ` Joonyoung Shim
2013-03-06 7:41 ` [PATCH v2 2/2] Platform: x86: chromeos_laptop : Add basic platform data for atmel devices Benson Leung
2013-03-08 3:43 ` [PATCH v3 0/2] Add platform data and touchpad functionality for Pixel Benson Leung
2013-03-08 3:43 ` [PATCH v3 1/2] Input: atmel_mxt_ts - Support for touchpad variant Benson Leung
2013-03-08 6:57 ` Benson Leung
2013-03-10 9:13 ` Henrik Rydberg
2013-03-08 3:43 ` Benson Leung [this message]
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=1362714214-32405-3-git-send-email-bleung@chromium.org \
--to=bleung@chromium.org \
--cc=davem@davemloft.net \
--cc=djkurtz@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jy0922.shim@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.garrett@nebula.com \
--cc=miletus@chromium.org \
--cc=olofj@chromium.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rydberg@euromail.se \
--cc=torvalds@linux-foundation.org \
--cc=wfp5p@virginia.edu \
/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;
as well as URLs for NNTP newsgroup(s).