From patchwork Thu Mar 26 22:46:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masaki Ota <012nexus@gmail.com> X-Patchwork-Id: 6095451 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 85BBABF90F for ; Wed, 25 Mar 2015 22:39:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FA7D2034C for ; Wed, 25 Mar 2015 22:39:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 597A920218 for ; Wed, 25 Mar 2015 22:39:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567AbbCYWjY (ORCPT ); Wed, 25 Mar 2015 18:39:24 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:34997 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbbCYWjY (ORCPT ); Wed, 25 Mar 2015 18:39:24 -0400 Received: by pdbop1 with SMTP id op1so42364514pdb.2 for ; Wed, 25 Mar 2015 15:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=i6+6jLIi+bgN/6IX5Wi5hAamaAIrN/rx6rE8T5tTAks=; b=S0p9ZSuYBBFiBBnuj713jTsSwvyW//q+KYd3OZFfU2qWpntDSFkxpXkuhQRC16I4v0 +1tMI8pWI+dEnnuSA/3CzdA9SVW4hI3R9MV24z4GP3dgpSGFLwjAYxyZT8FjKScTKwix lqhnvOgFtyu4p1PyweSmo6iQS2t9XSGu/Eg3gnM5qWRURXFgU6YFF9IEXOpmnOIVd/KT JcEcgzDzzJmLBESdAqhhbLhJMpMMywhb85dmjNmOhZetz/D8xZbeaMOS2Hku2zlht2ce Ovj8w8giuMTg9Lr4GfSMOQqGbOiiaLuhzYgd8VFDtlMwqatqHjE1CHvHnzg7wY7YuFYX Wg7g== X-Received: by 10.69.12.133 with SMTP id eq5mr21318802pbd.158.1427323163629; Wed, 25 Mar 2015 15:39:23 -0700 (PDT) Received: from localhost ([58.37.168.157]) by mx.google.com with ESMTPSA id h9sm3510879pdo.5.2015.03.25.15.39.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 15:39:22 -0700 (PDT) From: Masaki Ota <012nexus@gmail.com> X-Google-Original-From: Masaki Ota To: dmitry.torokhov@gmail.com, hdegoede@redhat.com Cc: linux-input@vger.kernel.org, 012nexus@gmail.com, masaki.ota@jp.alps.com Subject: [PATCH v2 1/2] Separate set parameter function for MT device Date: Fri, 27 Mar 2015 06:46:06 +0800 Message-Id: <1427409967-4721-1-git-send-email-masaki.ota@jp.alps.com> X-Mailer: git-send-email 2.1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_24_48, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_STARTS_WITH_NUMS, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Masaki Ota - Separate set parameter function for MT device. Signed-off-by: Masaki Ota Acked-by: Hans de Goede --- drivers/input/mouse/alps.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index d28726a..e36d4da 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -157,6 +157,8 @@ static void alps_set_abs_params_st(struct alps_data *priv, struct input_dev *dev1); static void alps_set_abs_params_mt(struct alps_data *priv, struct input_dev *dev1); +static void alps_set_abs_params_v7(struct alps_data *priv, + struct input_dev *dev1); /* Packet formats are described in Documentation/input/alps.txt */ @@ -2300,7 +2302,7 @@ static int alps_set_protocol(struct psmouse *psmouse, priv->hw_init = alps_hw_init_v7; priv->process_packet = alps_process_packet_v7; priv->decode_fields = alps_decode_packet_v7; - priv->set_abs_params = alps_set_abs_params_mt; + priv->set_abs_params = alps_set_abs_params_v7; priv->nibble_commands = alps_v3_nibble_commands; priv->addr_command = PSMOUSE_CMD_RESET_WRAP; @@ -2429,7 +2431,7 @@ static void alps_set_abs_params_st(struct alps_data *priv, input_set_abs_params(dev1, ABS_Y, 0, priv->y_max, 0, 0); } -static void alps_set_abs_params_mt(struct alps_data *priv, +static void alps_set_abs_params_mt_common(struct alps_data *priv, struct input_dev *dev1) { input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0); @@ -2438,15 +2440,26 @@ static void alps_set_abs_params_mt(struct alps_data *priv, input_abs_set_res(dev1, ABS_MT_POSITION_X, priv->x_res); input_abs_set_res(dev1, ABS_MT_POSITION_Y, priv->y_res); + set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit); + set_bit(BTN_TOOL_QUADTAP, dev1->keybit); +} + +static void alps_set_abs_params_mt(struct alps_data *priv, + struct input_dev *dev1) +{ + alps_set_abs_params_mt_common(priv, dev1); + input_mt_init_slots(dev1, MAX_TOUCHES, INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED | INPUT_MT_TRACK | INPUT_MT_SEMI_MT); +} - set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit); - set_bit(BTN_TOOL_QUADTAP, dev1->keybit); +static void alps_set_abs_params_v7(struct alps_data *priv, + struct input_dev *dev1) +{ + alps_set_abs_params_mt_common(priv, dev1); - /* V7 is real multi-touch */ - if (priv->proto_version == ALPS_PROTO_V7) - clear_bit(INPUT_PROP_SEMI_MT, dev1->propbit); + input_mt_init_slots(dev1, MAX_TOUCHES, INPUT_MT_POINTER | + INPUT_MT_DROP_UNUSED | INPUT_MT_TRACK); } int alps_init(struct psmouse *psmouse)