From patchwork Thu Jun 3 04:37:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 453626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 338C1C47080 for ; Thu, 3 Jun 2021 04:38:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1837D613F0 for ; Thu, 3 Jun 2021 04:38:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229506AbhFCEkb (ORCPT ); Thu, 3 Jun 2021 00:40:31 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:34594 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbhFCEka (ORCPT ); Thu, 3 Jun 2021 00:40:30 -0400 Received: by mail-pl1-f177.google.com with SMTP id u9so2170616plr.1; Wed, 02 Jun 2021 21:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bwoFt+YDQyQhxfnq961VZU5Jf/+5sxsJJaX0acjEBXE=; b=C3DXv7NMl/Uw80vgRKQfdquRd/YoCx8tRMrG/BDd/N1mjJ77Mi01CSrNSbkKkmmwYB IMoXTND/eW0oLppwffL+MpyRj+uRxEp4cyyOT6DK+aLvKKsrfBqOphxqRWR63U63cwM4 M6bufKVt9T1NCIEwcN6qF9qUaGS7ztfR3FE7iR290Rg3tc7HV2++Chjm9Z72S3Y0okQ/ TJWOcip9ogAEOSclWPpX4b94XCSW45RbhzidzQ+FzBhz625GuMVEcxQ1kQ582rE/Lwj8 wNz4ii1HCdOK+AHIe3pzF0rb82Cj5rNdk6KyWQWyZMzEck7cf4mwnXMmprF4hCV+W6Jn DcRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bwoFt+YDQyQhxfnq961VZU5Jf/+5sxsJJaX0acjEBXE=; b=kMLG6cgzxjBHNxLMYkma/B2+SeirSZ/WuckedgTfTTYmZjFwnE7M9PqNzmJg/aJcvn AUXdyGJkhnJ6gd570iOK2XJkRx5BV/TUnduO9j1fm8mja5J/vNJyfEfsOl7NRTTwk0F6 K15RF3iY3JzTU6kvPKTzhVSYqp+QyMkfhG8URHhzjDPCvToGXrN1d2g89jL40HJ4vNNk 1zkmeTeokv+ZyFz9gCZSSieEXDLUvU+jQsNkCmcCObmBF6bHW0dCOTB8hDQDvQatcs5c W1EEaUocq46yDJ4eo/Frwh8uL3KyrH80yqI0pcCQQUgJ9HVg7EIoxLUQK0Azg4qMQScF ML5A== X-Gm-Message-State: AOAM530QiO+jObhK/DcezczP8Wfr5t2uboDNQ6BLVW8zUOxFzheXeX4d 8GmFI93uVMsHqG/eRq1Fn9ef8vWD2tc= X-Google-Smtp-Source: ABdhPJwQXXCQGpLHiBRaSEb/7Erz/reTDL3D8w099btb2Xvd717wf5IqDBRnNY5XudQd4eBQTxhhxA== X-Received: by 2002:a17:90a:5282:: with SMTP id w2mr34770518pjh.145.1622695049797; Wed, 02 Jun 2021 21:37:29 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:fc6a:97ca:f00c:8377]) by smtp.gmail.com with ESMTPSA id f28sm1132414pgb.12.2021.06.02.21.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 21:37:28 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Linus Walleij , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] Input: cy8ctmg110_ts - rely on platform code to supply interrupt Date: Wed, 2 Jun 2021 21:37:20 -0700 Message-Id: <20210603043726.3793876-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead of using platform data to specify GPIO that is used as interrupt source, rely on the platform and I2C core to set it up properly. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij Reviewed-by: Linus Walleij --- drivers/input/touchscreen/cy8ctmg110_ts.c | 32 +---------------------- include/linux/input/cy8ctmg110_pdata.h | 1 - 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index f465bae618fe..691f35f1bdd7 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -46,7 +46,6 @@ struct cy8ctmg110 { char phys[32]; struct i2c_client *client; int reset_pin; - int irq_pin; }; /* @@ -191,7 +190,6 @@ static int cy8ctmg110_probe(struct i2c_client *client, ts->client = client; ts->input = input_dev; ts->reset_pin = pdata->reset_pin; - ts->irq_pin = pdata->irq_pin; snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&client->dev)); @@ -222,38 +220,13 @@ static int cy8ctmg110_probe(struct i2c_client *client, cy8ctmg110_power(ts, true); cy8ctmg110_set_sleepmode(ts, false); - err = gpio_request(ts->irq_pin, "touch_irq_key"); - if (err < 0) { - dev_err(&client->dev, - "Failed to request GPIO %d, error %d\n", - ts->irq_pin, err); - goto err_shutoff_device; - } - - err = gpio_direction_input(ts->irq_pin); - if (err < 0) { - dev_err(&client->dev, - "Failed to configure input direction for GPIO %d, error %d\n", - ts->irq_pin, err); - goto err_free_irq_gpio; - } - - client->irq = gpio_to_irq(ts->irq_pin); - if (client->irq < 0) { - err = client->irq; - dev_err(&client->dev, - "Unable to get irq number for GPIO %d, error %d\n", - ts->irq_pin, err); - goto err_free_irq_gpio; - } - err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, IRQF_TRIGGER_RISING | IRQF_ONESHOT, "touch_reset_key", ts); if (err < 0) { dev_err(&client->dev, "irq %d busy? error %d\n", client->irq, err); - goto err_free_irq_gpio; + goto err_shutoff_device; } err = input_register_device(input_dev); @@ -266,8 +239,6 @@ static int cy8ctmg110_probe(struct i2c_client *client, err_free_irq: free_irq(client->irq, ts); -err_free_irq_gpio: - gpio_free(ts->irq_pin); err_shutoff_device: cy8ctmg110_set_sleepmode(ts, true); cy8ctmg110_power(ts, false); @@ -318,7 +289,6 @@ static int cy8ctmg110_remove(struct i2c_client *client) free_irq(client->irq, ts); input_unregister_device(ts->input); - gpio_free(ts->irq_pin); if (ts->reset_pin) gpio_free(ts->reset_pin); kfree(ts); diff --git a/include/linux/input/cy8ctmg110_pdata.h b/include/linux/input/cy8ctmg110_pdata.h index 77582ae1745a..ee1d44545f30 100644 --- a/include/linux/input/cy8ctmg110_pdata.h +++ b/include/linux/input/cy8ctmg110_pdata.h @@ -5,7 +5,6 @@ struct cy8ctmg110_pdata { int reset_pin; /* Reset pin is wired to this GPIO (optional) */ - int irq_pin; /* IRQ pin is wired to this GPIO */ }; #endif From patchwork Thu Jun 3 04:37:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 453628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F355C47080 for ; Thu, 3 Jun 2021 04:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45537613F1 for ; Thu, 3 Jun 2021 04:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbhFCEjf (ORCPT ); Thu, 3 Jun 2021 00:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbhFCEje (ORCPT ); Thu, 3 Jun 2021 00:39:34 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BED0C06175F; Wed, 2 Jun 2021 21:37:37 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id v12so2233966plo.10; Wed, 02 Jun 2021 21:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Lml8gDdVcBir/4+S7RISpcXFgqdlzoZ+ng9XmF/Tb4M=; b=cnsSp0vY49gsZ5hEcOCaS8jac47v0uDYaa3BCIAqIpdH4PFYan0Wsk9EW/lz50Ns0H qgQ6qoidT/NZl+UlwxuSDPz+/7x0paHb0apwJSlWlkDEJ/csV4gxsawscKo6WEtf8+aB IoTZ0HrclAkVKj7hND+GxE1Ltm2YotmQHTioeZlZDJ4rw0dtFZjAXtzVVq4W7x3xZD5U M7K1B9BgM7fc3/yS+92nmEBRc4DH2DvI/FPZyFwK6L8AkNComrFUa+Yu7nt0d/HGVsc4 b6s3tHuaynKI5lhWnswn+9s3MAPHDLFlLGWU80UnItZvYKHZqOsfMK0NjjaLNUKpplmY 8KBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lml8gDdVcBir/4+S7RISpcXFgqdlzoZ+ng9XmF/Tb4M=; b=tKTsM4RKdT/LC1+635c597TA34rO3LDfnLHkwsOXPT9xwjdQDS98hfWC2zI/68K8CV IGwXtN0mHDfw4pCVetg8RPbuZ/0K/a1CYq/uGNLgyMN/lseY2WvkmnfE2BLM3VYtuk0K qHHXPlUsOQwNGVvmaamGj/aD/PGoDrolqopFQjLoU8UDPi64HAmulU4j/KeX5jZdBXjx x2DFx3OmuYo7fD6RyOt0kGgaR5VVzqSVHLWMX1a8CzOQoaOaOrb5048phPgNurQGYWfl b+BQ4bM5rAzM55AwmyniYwRA0U8jllG+hJtx79DIen9MYmxldF9/Z/cb65EKmbN3v3QZ nK7A== X-Gm-Message-State: AOAM530XaXCCg9g5jI9EmSPy1BIIT/r2dxkGg3oiYz8uiahmzXvlsPD7 AJw36mwHPv2FDYpPN9zac8QPHkroJM8= X-Google-Smtp-Source: ABdhPJyM5PV+paY5MQb2INGlLRS4HQZ12puPJ5TGk9cgavjmWvgx4UVckaR9FXy8OjeJ1ORtQPgQcg== X-Received: by 2002:a17:90a:bf15:: with SMTP id c21mr11851279pjs.206.1622695053301; Wed, 02 Jun 2021 21:37:33 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:fc6a:97ca:f00c:8377]) by smtp.gmail.com with ESMTPSA id f28sm1132414pgb.12.2021.06.02.21.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 21:37:32 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Linus Walleij , linux-kernel@vger.kernel.org Subject: [PATCH 3/7] Input: cy8ctmg110_ts - do not hardcode as wakeup source Date: Wed, 2 Jun 2021 21:37:22 -0700 Message-Id: <20210603043726.3793876-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog In-Reply-To: <20210603043726.3793876-1-dmitry.torokhov@gmail.com> References: <20210603043726.3793876-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Let platform specify whether the controller should be a wakeup source by registering as I2C_CLIENT_WAKE. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij --- drivers/input/touchscreen/cy8ctmg110_ts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index d83257284537..d83bf82f02d4 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -233,7 +233,7 @@ static int cy8ctmg110_probe(struct i2c_client *client, goto err_free_irq; i2c_set_clientdata(client, ts); - device_init_wakeup(&client->dev, 1); + return 0; err_free_irq: From patchwork Thu Jun 3 04:37:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 453627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9255BC47093 for ; Thu, 3 Jun 2021 04:37:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AF37613B8 for ; Thu, 3 Jun 2021 04:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbhFCEjh (ORCPT ); Thu, 3 Jun 2021 00:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbhFCEjg (ORCPT ); Thu, 3 Jun 2021 00:39:36 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44738C061756; Wed, 2 Jun 2021 21:37:37 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id n12so4132832pgs.13; Wed, 02 Jun 2021 21:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WU0LMmPiA/gi0hM1H/SSB6uKAA2ksvr9jOLLh3Q1VC4=; b=PoBAZd9LjCGkhI6W80kOeVbhM+dzv1hren2aAuCgtyloMl1WRD1Jh28mmm11H5VOeS yaK2jNEPVvykLSQvKfUwxI5RZRqD81opJbPDn+ayL//W3hiBQWtUi6HdYLNM7mZNB9T8 sXe4R8Wc89OVsUsJLzvBGWvvSJ5S+uDsCBIooQrT+YxbwivB+mC/obaYkGso9LbyP46s vmVmGiqr2u18uFkDzw2hASwP7nWa954+Yy2CLY+crQ4oEvTolkyehkjB6aRkW+USXfLd MdFX/YbCUq0kc3t+oEGTGFOdRHSsVgc+SV96ggkSFxoLvtqvwmGgcNdUFlp5gzzkqImu gxVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WU0LMmPiA/gi0hM1H/SSB6uKAA2ksvr9jOLLh3Q1VC4=; b=UCLpafpzpeIs0A+Uq+Q7BH8pQcxLiYSScENKyYVWqEYH+fxgdZlX4RJfNRSrfS4rza 0EPs98ezTiz0Jln9dxxNlth2VDEiwAFs3hg7d+kVIhFzqqeX+YehiHvn/BWPPyyfkHkS 6QQGB/VdaF6X5eKi1KENv+0rx0IRPsj/y2kZKO2evCzVaNRp9D3Qb6eHFIBjEoch7rXP 25r5yTMmPNaIp3v/5k2xAqiPMQzxvSGWqMT9Yu8M2IwkNueDiooAnXCA+7Fazmiia7Sd 7TLwko7TXH8xmGZHvd94sa3nh0NXje2b7LS1FR2zooZTZ/MZelfKBBAiRVEpdLhGHRCy R9FA== X-Gm-Message-State: AOAM533wQUdOSWlbSaR3ameObCMDqyG2Q4WXT8UxXWtMfOHgWngMTYF5 iBqZiM44/+sNhit4Bp75n/TYhycoZdo= X-Google-Smtp-Source: ABdhPJxvAIF8ytZpOT8dCAssGtufK0Y9Pm0gOMj9TDstxB14NSuGx52vXN0nSthbo/bGEHffsGu5dw== X-Received: by 2002:a05:6a00:cd3:b029:27f:c296:4a5d with SMTP id b19-20020a056a000cd3b029027fc2964a5dmr30366150pfv.38.1622695056331; Wed, 02 Jun 2021 21:37:36 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:fc6a:97ca:f00c:8377]) by smtp.gmail.com with ESMTPSA id f28sm1132414pgb.12.2021.06.02.21.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 21:37:35 -0700 (PDT) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Linus Walleij , linux-kernel@vger.kernel.org Subject: [PATCH 5/7] Input: cy8ctmg110_ts - use endian helpers when converting data on wire Date: Wed, 2 Jun 2021 21:37:24 -0700 Message-Id: <20210603043726.3793876-5-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog In-Reply-To: <20210603043726.3793876-1-dmitry.torokhov@gmail.com> References: <20210603043726.3793876-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Switch to using be16_to_cpup() instead of shifting and combining data by hand. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij --- drivers/input/touchscreen/cy8ctmg110_ts.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index f8d7ab3b6c25..33c1360a251c 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -16,6 +16,7 @@ #include #include #include +#include #define CY8CTMG110_DRIVER_NAME "cy8ctmg110" @@ -111,7 +112,6 @@ static int cy8ctmg110_touch_pos(struct cy8ctmg110 *tsc) { struct input_dev *input = tsc->input; unsigned char reg_p[CY8CTMG110_REG_MAX]; - int x, y; memset(reg_p, 0, CY8CTMG110_REG_MAX); @@ -119,16 +119,15 @@ static int cy8ctmg110_touch_pos(struct cy8ctmg110 *tsc) if (cy8ctmg110_read_regs(tsc, reg_p, 9, CY8CTMG110_TOUCH_X1) != 0) return -EIO; - y = reg_p[2] << 8 | reg_p[3]; - x = reg_p[0] << 8 | reg_p[1]; - /* Number of touch */ if (reg_p[8] == 0) { input_report_key(input, BTN_TOUCH, 0); } else { input_report_key(input, BTN_TOUCH, 1); - input_report_abs(input, ABS_X, x); - input_report_abs(input, ABS_Y, y); + input_report_abs(input, ABS_X, + be16_to_cpup((__be16 *)(reg_p + 0))); + input_report_abs(input, ABS_Y, + be16_to_cpup((__be16 *)(reg_p + 2))); } input_sync(input);