From patchwork Fri Mar 8 03:43:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benson Leung X-Patchwork-Id: 2234681 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 876BFE0339 for ; Fri, 8 Mar 2013 03:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932577Ab3CHDoI (ORCPT ); Thu, 7 Mar 2013 22:44:08 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:65352 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760285Ab3CHDnt (ORCPT ); Thu, 7 Mar 2013 22:43:49 -0500 Received: by mail-pb0-f48.google.com with SMTP id wy12so861908pbc.21 for ; Thu, 07 Mar 2013 19:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=PlZAFjHyTsDPcW+H67an1k3bCflW6bHOOoaqMbFVYD0=; b=BKnH5X/8fD9WKoJt14AZ0ln8UCmJWmyYHKp+jgHThNxk+qK+rdAHgkYbJZmK9QG930 dMyYqSWg6BprcjUV6LcB3bnHEed8bTamVFKDL0BuWT3mY+AO8buaCRpMiw3ycul1MhQ5 9lW0th9z1ZyVJcRztSfvlcKmVJO9F4N2Jv8Dw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=PlZAFjHyTsDPcW+H67an1k3bCflW6bHOOoaqMbFVYD0=; b=AQT8+9jAvJz76QvyGk5DlN3z7ObGMCyChsrDzyibxAn009RsJg1HWxtfSEkzL0h16f 1g2TulJySLiybgM5YlWgqD2uKCdWlGoq9aHiCmXdbtbkT6K1kN2lin0kg1ZK9DIXgI2c aUNXWfNwAvjPpPw4bsQUakt7e9yWSckwSNtOt5a5e2GnLywbLAx/nc1KU/iS3Q/d4Mee O9xQjJBU2BpQY4gtsUVCfpy5h9tR71sFBdGsjHkCrrI2QeoDNnfTEJIWAzdOBJ+A/0tB 7SA0Ft6yeOevBbYADKC6eKyfxj30CcP5rTlU3BBhxw2C+/sx5ue/yqkm5QHfM6Q3ysL3 CW3w== X-Received: by 10.68.242.41 with SMTP id wn9mr1044834pbc.156.1362714228726; Thu, 07 Mar 2013 19:43:48 -0800 (PST) Received: from laughingman.mtv.corp.google.com (laughingman.mtv.corp.google.com [172.22.73.99]) by mx.google.com with ESMTPS id hf4sm4556742pac.3.2013.03.07.19.43.46 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Mar 2013 19:43:47 -0800 (PST) From: Benson Leung 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 Message-Id: <1362714214-32405-3-git-send-email-bleung@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1362714214-32405-1-git-send-email-bleung@chromium.org> References: <1362187254-9227-1-git-send-email-bleung@chromium.org> <1362714214-32405-1-git-send-email-bleung@chromium.org> X-Gm-Message-State: ALoCoQnASMjz+Gc1cSe3OxFrF452W8Arff3NxxI5u1JABkQecZwHtQDZagNgH6DokBODekWgyuRV Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 Tested-by: Olof Johansson --- 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 #include +#include +#include +#include #include #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, };