From patchwork Wed Sep 16 20:49:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 293950 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 B64CAC43461 for ; Wed, 16 Sep 2020 20:51:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57F182087D for ; Wed, 16 Sep 2020 20:51:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="DQNWwpb9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726648AbgIPUvw (ORCPT ); Wed, 16 Sep 2020 16:51:52 -0400 Received: from mail-dm6nam10on2061.outbound.protection.outlook.com ([40.107.93.61]:48609 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728586AbgIPUvK (ORCPT ); Wed, 16 Sep 2020 16:51:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPetkd4WIqIoNKBiDpSsFXxREkNuBiMxxCv86hR/POsAvdD2pUt3MIKmq0Eli96rN8rLQlSL8oi6vsDcDgSWiWTwS6LCVJMA0h8P7jiQMPFE2S6setlDB8r8rOX4zHE+Zr2h5102WguWPZWsgmhpiirQcoCy8b8Gloi6uFJ28Mes9d578mNFP612lSH0RG6qU1vswZDnZuJnuEa0XwahCR7VYRh9r1oqovGGD/f20xrGdaNScbnFWXVu2qPG9d1VZuOzFGI+vXmF1gddDx2BOem7NvSGuleAMy2KxLy5/voWL9E/T1ZKKXidYO1ar7VjKfH3m8/EUMQ7YQbCJg9/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=03BF4GsV9zNb6I+owR3AmF6hCvPw2B0akVpCn4SSV0E=; b=gYeww3IRk12udH6aE57OxojoBQFewpr7co4PT8iteoDnVzOITvW23M4ECqkrcE3/TEh0h2youF5Q/YFwPzFWMCLuzxWLIOgglu4sNfMbMeuHvFFf66t/oB/ewPcbPF2qJI/AUZ/PmroGf7K+hmgNiZ/v8G4mXEf0Dsly8Ds6dxZvisUbtpAXqXxbpRkT5S4EU6mK1LGuRVewsN/+TaAgyq3+cLUQxbEXCXLtxpxzxTSoiuLCt6Onv82Q2oYk9Lt2R22CMWFKsIgRLG0pkqqnjrGajz3gQKWZdOanfaP9b2ASUuGUW69999l/jSGye7K72cPznAn3i36o1OOmb6yp6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=03BF4GsV9zNb6I+owR3AmF6hCvPw2B0akVpCn4SSV0E=; b=DQNWwpb99YttknTiIsX1YCRP+4FtTNEwciqhC8Hp/dgC5y4peOh1lWZfA3Gaui/d9npEN81WrkF0aIZS2oKv+NjC4pHMXxVSJROb4d5ViGquSoctHu19hPEg5UcJPHmwwNN4fpnirrny/gKHQ0lSP1/QRSvpTzrW/uhqQovdS4A= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4848.namprd08.prod.outlook.com (2603:10b6:805:6d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 20:50:59 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2%7]) with mapi id 15.20.3391.014; Wed, 16 Sep 2020 20:50:59 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [RESEND 1/5] dt-bindings: input: iqs269a: Add bindings for slider gestures Date: Wed, 16 Sep 2020 15:49:56 -0500 Message-Id: <1600289400-27632-2-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600289400-27632-1-git-send-email-jeff@labundy.com> References: <1600289400-27632-1-git-send-email-jeff@labundy.com> X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.227.119) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 20:50:59 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [136.49.227.119] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4cf3494-f529-4c35-7647-08d85a823775 X-MS-TrafficTypeDiagnostic: SN6PR08MB4848: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NK9luN+clxdYkHOUH1KlWXGa45/N07YL7zSo0W0ZMvdNDr5Z61NJWManpQHk7sUzSwkeHbbBz23htQyoYeQEQFQZkS5ou+sJYXs3kxvazgtfYFBGparh6ZAi/44XcZKMSla+MWxGsaS31Pe5s7NNPWzZD3xlMkNjFNg1OE+r15SurwQ5ymsTw05TQc87+h8Dqh3WXApvb50ynNVdGVsA44bQAWkbNzEmPPH8ff3133W/HWyYzB0O/SRXJCgNoAFKOPzSDfutk5NVZsa80BoeIMCFj81ORwfRi+nYpLerpFMVKrD40+vPY3t1cA+fxMK2kAgNxklpnTxSrH7VEqIQg1edZitVG2X1D1Cjr+B1F2R0AydKBD/HffDrK00XxBRtXfhIQmqjNgGmgBq1ghl8CMbBLvX+eJsy3GRiSoka8z4IOAM/2IWOhGUxgJOEhVNI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39830400003)(376002)(346002)(366004)(136003)(956004)(316002)(4326008)(2616005)(26005)(186003)(2906002)(83380400001)(8936002)(107886003)(16526019)(478600001)(6666004)(86362001)(6512007)(5660300002)(69590400008)(66946007)(8676002)(6506007)(66556008)(52116002)(36756003)(66476007)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3Z2z+v8zvtIBofkSKMAw4/puOVW9emCHbsf124C7n2ATNAgcg/VXR8FTUekx114kOFaDjyinZhN9RuXGvwK7cPJnTXRcRxbHTgj0rP46trTW4+ZdrKvVRluOPNDIVN00MrYqjWuHc3gsQrrjOviGwXQqb2Uu7CCpOT+vl1CiU60TBAWbjFblD8SkWYV1CxGNwavpsWJUaw4mXb8Y6gGGyIkk39tBmNnhVCMkOSI/gg9tIr4wMKsXEUAUOPlpTKQ0zgWSZPS5OAZpP8QAP9ABsIIlMBMQieGEPJZS7tT5U0wbDTRxQbotqyefjQaBMYbmwVXX1Kb6VouELTJDtskS1aPtvuFUeAsHf3xDNCi+lGOkktepMiNxLNGZrAtDVYztuO0eRg4BazdqeyxgHyAiJ2JLBUR8Qpb3EH7nIVyD6AQMZRm9Mcxgvau7XyYxqsiXi37ObzEXlsaOX67fs5rzpYsW4aMPMs0cbntj9EQz7yY9R1OmT4jEMxDHcbdESSV/z74Z9Y9akcBIoWR8sXD4q65rsrXGY5di7ljTDDVyUuOCqWA0umNJPmlxbXI5zRgfPhls9O/7/xIDXDi6taUakI4HDKGGHxROGrZvkwI9XMa7n+p9oRh43pt89O5W5ljPWL0b3cwib95RXiHK+ODDPw== X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4cf3494-f529-4c35-7647-08d85a823775 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 20:50:59.7577 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ApGIdyB8lYstMjOs+ukH9Q4rXqc35+4JrFTBWmZedWDhye93Z4uiYZxzHdUh3UkxLShyRUAw9GBMvAu/ivPOFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4848 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch adds bindings for slider gestures that can be expressed by the device. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- .../devicetree/bindings/input/iqs269a.yaml | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml index 9c154e5..e13812d 100644 --- a/Documentation/devicetree/bindings/input/iqs269a.yaml +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml @@ -61,6 +61,12 @@ properties: default: 3 description: Specifies the ultra-low-power mode update rate. + azoteq,slider-swipe: + type: boolean + description: + Directs the device to interpret axial gestures as a swipe (finger remains + on slider) instead of a flick (finger leaves slider). + azoteq,reseed-offset: type: boolean description: @@ -204,6 +210,57 @@ properties: default: 1 description: Specifies the slider coordinate filter strength. + linux,keycodes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 8 + description: | + Specifies the numeric keycodes associated with each available gesture in + the following order (enter 0 for unused gestures): + 0: Slider 0 tap + 1: Slider 0 hold + 2: Slider 0 positive flick or swipe + 3: Slider 0 negative flick or swipe + 4: Slider 1 tap + 5: Slider 1 hold + 6: Slider 1 positive flick or swipe + 7: Slider 1 negative flick or swipe + + azoteq,timeout-tap-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + default: 400 + description: + Specifies the length of time (in ms) within which a slider touch must be + released in order to be interpreted as a tap. Default and maximum values + as well as step size are reduced by a factor of 4 with device version 2. + + azoteq,timeout-swipe-ms: + multipleOf: 16 + minimum: 0 + maximum: 4080 + default: 2000 + description: + Specifies the length of time (in ms) within which an axial gesture must be + completed in order to be interpreted as a flick or swipe. Default and max- + imum values as well as step size are reduced by a factor of 4 with device + version 2. + + azoteq,thresh-swipe: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 255 + default: 128 + description: + Specifies the number of points across which an axial gesture must travel + in order to be interpreted as a flick or swipe. + +dependencies: + azoteq,timeout-tap-ms: ["linux,keycodes"] + azoteq,timeout-swipe-ms: ["linux,keycodes"] + azoteq,thresh-swipe: ["linux,keycodes"] + patternProperties: "^channel@[0-7]$": type: object @@ -487,6 +544,14 @@ examples: azoteq,hall-enable; azoteq,suspend-mode = <2>; + linux,keycodes = , + , + , + ; + + azoteq,timeout-tap-ms = <400>; + azoteq,timeout-swipe-ms = <800>; + channel@0 { reg = <0x0>; From patchwork Wed Sep 16 20:49:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 293948 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 52ED9C433E2 for ; Wed, 16 Sep 2020 20:52:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1B4F221E5 for ; Wed, 16 Sep 2020 20:52:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="esnrVO50" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727362AbgIPUwO (ORCPT ); Wed, 16 Sep 2020 16:52:14 -0400 Received: from mail-eopbgr760053.outbound.protection.outlook.com ([40.107.76.53]:36262 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727725AbgIPUvx (ORCPT ); Wed, 16 Sep 2020 16:51:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlQk0cCTyxiuYvySvw0hM5y/QLg0DY66ACh6vRXvm0FPGZxA/unLGEeaYSilxfCf1M4ciG+Ue6uTR7IutGygghkbuWMwdjONQX+LUNc2mcmTuvlZERA5R6Fa9WmIdDcI0pWF4HS6lT4GqAkeIEBYJQwR9Vx8acTDjw2hY2gwvdd1ofcnilAAzqkTm0pysr2fR/JHRoUjKZNTg9bPAASx5EOS17KanAkUUyQw4IbVljbjSQ0nw4ujgPs+wOHQOOZgItPRhwjfsz7gJoIWxGecuXJAYLWk3DHWwXLqlKZ+QlH/qLnX3yPR7YeQDrWzezSb37iNtG75e9hH1qOVybU1bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R03ZvJREaA94tS0/myDWnxx/ECNuojaXDIyBGhfRplo=; b=cRYwE9fqruxhIHjTbeGp55LmsqWEsgfH5fa8MTq6ouEH8w2UaNL+i0RVamhWzl/CYpiiKqpEs6CgIhC79sR09v6SneCOxkOHC4D8e6c4gnv5AuomBHKZ0HbVemADO3X84DpYtPExNetQhbHE63P67HCkcQeIo08nbuqfIWASgZR97vXf1tQd2i0rfQDnUXaLu/v4BPdp4Gt3aHD9yjAUIj14RMzmLaopO3dgsbfU3j3rCW3IpzpHpoYbruRvRpZMssq2zyahEZgbjGLpXj34aatvZnKj9vrfZdrSlgILqVdWaJSwffMdYWA3yyPWHfQF+rZMKdt9IiH/0C9/MxHCtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R03ZvJREaA94tS0/myDWnxx/ECNuojaXDIyBGhfRplo=; b=esnrVO50K+eHRJhzkTBKp/ZammS2qEivPq+vpm9+3LcXJp1JRbRko/JRDBm0mHPkUUo2/KX2rD+G2OIk0bbdGnAnSY8eKveOUSMPl4J7F8/M+d3p+SULdeksfrQcBX8UwgzHhn/p0t+jjqEdj8zivHotxJNXxTe+574LaOYx8a8= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4848.namprd08.prod.outlook.com (2603:10b6:805:6d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 20:51:07 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2%7]) with mapi id 15.20.3391.014; Wed, 16 Sep 2020 20:51:05 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [RESEND 2/5] input: iqs269a: Add support for slider gestures Date: Wed, 16 Sep 2020 15:49:57 -0500 Message-Id: <1600289400-27632-3-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600289400-27632-1-git-send-email-jeff@labundy.com> References: <1600289400-27632-1-git-send-email-jeff@labundy.com> X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.227.119) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 20:51:02 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [136.49.227.119] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6da47650-a11f-451f-3f65-08d85a823990 X-MS-TrafficTypeDiagnostic: SN6PR08MB4848: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GB9r30ApJkyKjiasx7GkIates2jSvnM5Udwkjc5oRoQPfjOnNj5w2pCt9C1lT7d5oLEcB+ipIB6VF+47irYIao0dKsMgquPWhCuzsSMVL7Si/Dxol8exHRlz5jrERQuWuAlznwRhzBjYJHIxlBiux72CSBQKOygi0VZ0Hop7pbkqK5qed/6A9zIVMhDWuqMddbtCEPOSy65f51XmGezkH4UveZPf9owG+cDirM4fE7Cje/bwyHO4aarEPHh4PttiItRybZHoI2Z3fL0KHd3eTDcpYrnm3v77Wbq2NYfAimXpxJGZKI7XjZ5O+f1FnLwAddysiSI6sx6qv6+Sp3mREPwWRgpYK05agiNyhuf6/nY9QhRBXXJvqeLQb1wcdNsN530igh+gZRwYsK25CMDkxGuMvYSV2Da8GgxJcJpAn6AeKlLaqOajtuwuZfVdHW1Q X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(366004)(376002)(39830400003)(396003)(69590400008)(6506007)(66946007)(8676002)(6512007)(5660300002)(86362001)(66556008)(36756003)(66476007)(6486002)(52116002)(316002)(4326008)(186003)(2906002)(26005)(2616005)(956004)(30864003)(6666004)(8936002)(83380400001)(107886003)(16526019)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 36aiPeRkDj+75e8NtxGgqkudkrExTk7GJFSRYK3gMkItuV3H/A2cKJ8FP7JECu9ZQXEIPH1T2Dj+shZx1B02ze6mikxXXs6kf+TJM55xFgSwyJ1zuOXBczaQxlAIomx1IFLsZmG/yQUxVoTKICa9X23b+Xs7luSAsUJLZKvFOlJgdTHBZddkuUBRPY2zaZcjRYb9UW35wIwSMTntKhHNh84K2pUqSLj6AI+29Azv3/DQX71KKB35yq+ous5IRH7n0ZQzUc4MmqAEWB8f1RYkT1G1fxFVjIYIGSYKKI2WwPTmRvD8Ae55FVQ6OH6xmIPTPoYUTNblQAjHACJ33BmRMXyPzLAMGLzZ/3QzKjZmGbsG5VMDPk3tZuvWMO/WbE/JaarNZhhQ5B/SNLsOW4HDj7c/FSAoLXG6CPyRzkdKbcSDJyvX6Ajq7wULAJG2wicOmNF4ZucXKHx9coYlQs1JtvIPJB7C6eRHG/qeelFMO0qcGTs0LkdJQuLJFyjVCcDASHESvTLlNZFutfr1xIu4KRAkffj0KEQyu/ZUnpX0yHNXmTb9G7rSzQNj13NNEaJx+5PggT/zNP/L0zuzkceSTrrwuwXbx3ARXu1p2df7zrtPh+6CTDgEj/HvY3eb3Cg8VjVNwuRlyEDv1dB1KhmLgw== X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6da47650-a11f-451f-3f65-08d85a823990 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 20:51:03.2997 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RQvnS4xX3QBMLywl568ZyxvO3KOfxf2wclHylnAW3YTSwkRKjTT/LKItaprJ4uALZtxhjpCw+Hom3ujZ+Fzvuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4848 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch adds support for slider gestures that can be expressed by the device. Each gesture (e.g. tap or hold) can be mapped to a unique keycode for either slider 0 or 1. With this change, raw slider coordinates are reported only if the slider has no keycodes defined. This prevents unwanted mouse cur- sor movement when expressing axial gestures (e.g. swipe) and also eliminates some unnecessary I2C traffic. Different revisions of silicon use different tap and swipe timeout step sizes. Apply an appropriate scaling factor depending on which revision is found. To facilitate this change, store the iqs269_ver_info struct in the driver's private data so that other functions can use it after the driver has probed. Last but not least, a former reserved field in iqs269_ver_info now contains useful information; give it a name (fw_num). Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs269a.c | 219 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 190 insertions(+), 29 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index a348247..095e5d5 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -25,6 +25,8 @@ #define IQS269_VER_INFO 0x00 #define IQS269_VER_INFO_PROD_NUM 0x4F +#define IQS269_VER_INFO_FW_NUM_2 0x03 +#define IQS269_VER_INFO_FW_NUM_3 0x10 #define IQS269_SYS_FLAGS 0x02 #define IQS269_SYS_FLAGS_SHOW_RESET BIT(15) @@ -52,6 +54,7 @@ #define IQS269_SYS_SETTINGS_ULP_UPDATE_MASK GENMASK(10, 8) #define IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT 8 #define IQS269_SYS_SETTINGS_ULP_UPDATE_MAX 7 +#define IQS269_SYS_SETTINGS_SLIDER_SWIPE BIT(7) #define IQS269_SYS_SETTINGS_RESEED_OFFSET BIT(6) #define IQS269_SYS_SETTINGS_EVENT_MODE BIT(5) #define IQS269_SYS_SETTINGS_EVENT_MODE_LP BIT(4) @@ -68,6 +71,7 @@ #define IQS269_FILT_STR_MAX 3 #define IQS269_EVENT_MASK_SYS BIT(6) +#define IQS269_EVENT_MASK_GESTURE BIT(3) #define IQS269_EVENT_MASK_DEEP BIT(2) #define IQS269_EVENT_MASK_TOUCH BIT(1) #define IQS269_EVENT_MASK_PROX BIT(0) @@ -96,6 +100,10 @@ #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) +#define IQS269_TIMEOUT_TAP_MS_MAX 4080 +#define IQS269_TIMEOUT_SWIPE_MS_MAX 4080 +#define IQS269_THRESH_SWIPE_MAX 255 + #define IQS269_CHx_SETTINGS 0x8C #define IQS269_CHx_ENG_A_MEAS_CAP_SIZE BIT(15) @@ -183,6 +191,20 @@ enum iqs269_event_id { IQS269_EVENT_DEEP_UP, }; +enum iqs269_slider_id { + IQS269_SLIDER_NONE, + IQS269_SLIDER_KEY, + IQS269_SLIDER_RAW, +}; + +enum iqs269_gesture_id { + IQS269_GESTURE_TAP, + IQS269_GESTURE_HOLD, + IQS269_GESTURE_FLKP, + IQS269_GESTURE_FLKN, + IQS269_NUM_GESTURES, +}; + struct iqs269_switch_desc { unsigned int code; bool enabled; @@ -242,7 +264,7 @@ struct iqs269_ver_info { u8 prod_num; u8 sw_num; u8 hw_num; - u8 padding; + u8 fw_num; } __packed; struct iqs269_sys_reg { @@ -294,9 +316,11 @@ struct iqs269_private { struct iqs269_switch_desc switches[ARRAY_SIZE(iqs269_events)]; struct iqs269_ch_reg ch_reg[IQS269_NUM_CH]; struct iqs269_sys_reg sys_reg; + struct iqs269_ver_info ver_info; struct input_dev *keypad; struct input_dev *slider[IQS269_NUM_SL]; unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; + unsigned int gs_code[IQS269_NUM_SL][IQS269_NUM_GESTURES]; unsigned int suspend_mode; unsigned int delay_mult; unsigned int ch_num; @@ -304,6 +328,21 @@ struct iqs269_private { bool ati_current; }; +static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269, + int slider_num) +{ + int i; + + if (!iqs269->sys_reg.slider_select[slider_num]) + return IQS269_SLIDER_NONE; + + for (i = 0; i < IQS269_NUM_GESTURES; i++) + if (iqs269->gs_code[slider_num][i] != KEY_RESERVED) + return IQS269_SLIDER_KEY; + + return IQS269_SLIDER_RAW; +} + static int iqs269_ati_mode_set(struct iqs269_private *iqs269, unsigned int ch_num, unsigned int mode) { @@ -978,6 +1017,72 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) */ sys_reg->redo_ati = sys_reg->active; + if (device_property_present(&client->dev, "linux,keycodes")) { + int scale = 1; + int count = device_property_count_u32(&client->dev, + "linux,keycodes"); + if (count > IQS269_NUM_GESTURES * IQS269_NUM_SL) { + dev_err(&client->dev, "Too many keycodes present\n"); + return -EINVAL; + } else if (count < 0) { + dev_err(&client->dev, "Failed to count keycodes: %d\n", + count); + return count; + } + + error = device_property_read_u32_array(&client->dev, + "linux,keycodes", + *iqs269->gs_code, count); + if (error) { + dev_err(&client->dev, "Failed to read keycodes: %d\n", + error); + return error; + } + + /* + * Early revisions of silicon use a more granular step size for + * tap and swipe gesture timeouts; scale them appropriately. + */ + if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) + scale = 4; + + if (!device_property_read_u32(&client->dev, + "azoteq,timeout-tap-ms", &val)) { + if (val > IQS269_TIMEOUT_TAP_MS_MAX / scale) { + dev_err(&client->dev, "Invalid timeout: %u\n", + val); + return -EINVAL; + } + + sys_reg->timeout_tap = val / (16 / scale); + } + + if (!device_property_read_u32(&client->dev, + "azoteq,timeout-swipe-ms", + &val)) { + if (val > IQS269_TIMEOUT_SWIPE_MS_MAX / scale) { + dev_err(&client->dev, "Invalid timeout: %u\n", + val); + return -EINVAL; + } + + sys_reg->timeout_swipe = val / (16 / scale); + } + + if (!device_property_read_u32(&client->dev, + "azoteq,thresh-swipe", &val)) { + if (val > IQS269_THRESH_SWIPE_MAX) { + dev_err(&client->dev, "Invalid threshold: %u\n", + val); + return -EINVAL; + } + + sys_reg->thresh_swipe = val; + } + + sys_reg->event_mask &= ~IQS269_EVENT_MASK_GESTURE; + } + general = be16_to_cpu(sys_reg->general); if (device_property_present(&client->dev, "azoteq,clk-div")) { @@ -1008,6 +1113,10 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) general |= (val << IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT); } + general &= ~IQS269_SYS_SETTINGS_SLIDER_SWIPE; + if (device_property_present(&client->dev, "azoteq,slider-swipe")) + general |= IQS269_SYS_SETTINGS_SLIDER_SWIPE; + general &= ~IQS269_SYS_SETTINGS_RESEED_OFFSET; if (device_property_present(&client->dev, "azoteq,reseed-offset")) general |= IQS269_SYS_SETTINGS_RESEED_OFFSET; @@ -1016,10 +1125,11 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) /* * As per the datasheet, enable streaming during normal-power mode if - * either slider is in use. In that case, the device returns to event - * mode during low-power mode. + * raw coordinates will be read from either slider. In that case, the + * device returns to event mode during low-power mode. */ - if (sys_reg->slider_select[0] || sys_reg->slider_select[1]) + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) general |= IQS269_SYS_SETTINGS_EVENT_MODE_LP; general |= IQS269_SYS_SETTINGS_REDO_ATI; @@ -1164,19 +1274,37 @@ static int iqs269_input_init(struct iqs269_private *iqs269) } for (i = 0; i < IQS269_NUM_SL; i++) { - if (!iqs269->sys_reg.slider_select[i]) + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_NONE) continue; iqs269->slider[i] = devm_input_allocate_device(&client->dev); if (!iqs269->slider[i]) return -ENOMEM; + iqs269->slider[i]->keycodemax = ARRAY_SIZE(iqs269->gs_code[i]); + iqs269->slider[i]->keycode = iqs269->gs_code[i]; + iqs269->slider[i]->keycodesize = sizeof(**iqs269->gs_code); + iqs269->slider[i]->name = i ? "iqs269a_slider_1" : "iqs269a_slider_0"; iqs269->slider[i]->id.bustype = BUS_I2C; - input_set_capability(iqs269->slider[i], EV_KEY, BTN_TOUCH); - input_set_abs_params(iqs269->slider[i], ABS_X, 0, 255, 0, 0); + for (j = 0; j < IQS269_NUM_GESTURES; j++) + if (iqs269->gs_code[i][j] != KEY_RESERVED) + input_set_capability(iqs269->slider[i], EV_KEY, + iqs269->gs_code[i][j]); + + /* + * Present the slider as a narrow trackpad if one or more chan- + * nels have been selected to participate, but no gestures have + * been mapped to a keycode. + */ + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_RAW) { + input_set_capability(iqs269->slider[i], + EV_KEY, BTN_TOUCH); + input_set_abs_params(iqs269->slider[i], + ABS_X, 0, 255, 0, 0); + } error = input_register_device(iqs269->slider[i]); if (error) { @@ -1222,28 +1350,62 @@ static int iqs269_report(struct iqs269_private *iqs269) return error; } - error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x, - sizeof(slider_x)); - if (error) { - dev_err(&client->dev, "Failed to read slider position: %d\n", - error); - return error; + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) { + error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, + slider_x, sizeof(slider_x)); + if (error) { + dev_err(&client->dev, + "Failed to read slider position: %d\n", error); + return error; + } } for (i = 0; i < IQS269_NUM_SL; i++) { - if (!iqs269->sys_reg.slider_select[i]) + flags.gesture >>= (i * IQS269_NUM_GESTURES); + + switch (iqs269_slider_type(iqs269, i)) { + case IQS269_SLIDER_NONE: continue; - /* - * Report BTN_TOUCH if any channel that participates in the - * slider is in a state of touch. - */ - if (flags.states[IQS269_ST_OFFS_TOUCH] & - iqs269->sys_reg.slider_select[i]) { - input_report_key(iqs269->slider[i], BTN_TOUCH, 1); - input_report_abs(iqs269->slider[i], ABS_X, slider_x[i]); - } else { - input_report_key(iqs269->slider[i], BTN_TOUCH, 0); + case IQS269_SLIDER_KEY: + for (j = 0; j < IQS269_NUM_GESTURES; j++) + input_report_key(iqs269->slider[i], + iqs269->gs_code[i][j], + flags.gesture & BIT(j)); + + if (!(flags.gesture & (BIT(IQS269_GESTURE_FLKN) | + BIT(IQS269_GESTURE_FLKP) | + BIT(IQS269_GESTURE_TAP)))) + break; + + input_sync(iqs269->slider[i]); + + /* + * Momentary gestures are followed by a complementary + * release cycle so as to emulate a full keystroke. + */ + for (j = 0; j < IQS269_NUM_GESTURES; j++) + if (j != IQS269_GESTURE_HOLD) + input_report_key(iqs269->slider[i], + iqs269->gs_code[i][j], + 0); + break; + + case IQS269_SLIDER_RAW: + /* + * The slider is considered to be in a state of touch + * if any selected channels are in a state of touch. + */ + state = flags.states[IQS269_ST_OFFS_TOUCH]; + state &= iqs269->sys_reg.slider_select[i]; + + input_report_key(iqs269->slider[i], BTN_TOUCH, state); + + if (state) + input_report_abs(iqs269->slider[i], + ABS_X, slider_x[i]); + break; } input_sync(iqs269->slider[i]); @@ -1635,7 +1797,6 @@ static const struct regmap_config iqs269_regmap_config = { static int iqs269_probe(struct i2c_client *client) { - struct iqs269_ver_info ver_info; struct iqs269_private *iqs269; int error; @@ -1656,14 +1817,14 @@ static int iqs269_probe(struct i2c_client *client) mutex_init(&iqs269->lock); - error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info, - sizeof(ver_info)); + error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, + &iqs269->ver_info, sizeof(iqs269->ver_info)); if (error) return error; - if (ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { + if (iqs269->ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { dev_err(&client->dev, "Unrecognized product number: 0x%02X\n", - ver_info.prod_num); + iqs269->ver_info.prod_num); return -EINVAL; } From patchwork Wed Sep 16 20:49:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 254978 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 4655CC433E2 for ; Wed, 16 Sep 2020 20:52:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D58362087D for ; Wed, 16 Sep 2020 20:52:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="wCS0lVOw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbgIPUwN (ORCPT ); Wed, 16 Sep 2020 16:52:13 -0400 Received: from mail-dm6nam10on2061.outbound.protection.outlook.com ([40.107.93.61]:48609 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727757AbgIPUvw (ORCPT ); Wed, 16 Sep 2020 16:51:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZMi9rofj9jgRklp59Vb8lAEqm2deX0FClh30C9/Ujwzj7DjgV5FM8Qq40CTrrjQc3sk83UHkfrMlVATYkNICCSzpEgu+nwkE5z4Li23sOqW0DKbK8N3wIeg3ACfVuCww7OaS78iQUyhMqgeKA15aacwFIHeXelgUjvDvhNQjBTXUq6xRbhZh1JyHPz9qo6B8wQsheLPe4Gh/S4PMxFNdgbvDstrV7L8T6tXmA/E92sl8ceAznh+Qz9dLcOaOxDWg4MsWN4dOqY5t7w3sZ5j19j6zCbkoamX3UqtUsgD+2OOfCmBpJ/bhE+3+gnjj+la5tmKi+4KNAIKjRTupSj8pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uiGv6lUMGQUeAGEMQL/+x34mpIHzwmBkHKJfVNp8y0E=; b=bf2U1DEHB/ULFWx/iWPK5K5VYgdQiYoEkgxcTzZI16n2RJKgp7T9wFv+s+nLp762VgHDCJc/JtN2jtboDKXgYd73ki/Y3B2Y9upZDybrGSu6n0+2oqbxRAqCDyx6REI5giXz70ryl91oJA6Vyqu40noHTQ9A/ZgPfcJjtS7IjjCrDeqBTG7Hrzstcc7jDpwYg5BvJHsKTvD6fTDCkXCHp8nVDqQXgePwLo41Si4CTPsGmnbZziK/aKlKYmtqIIB83Bv9Fe1MBqhZmluxavx6tNn5RH0K35pc6mEPizCB00/N+gskBod/KWSa777Lgc9rlgH962B1s5G0mWLBkG9V+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uiGv6lUMGQUeAGEMQL/+x34mpIHzwmBkHKJfVNp8y0E=; b=wCS0lVOwIxjwAF3ReGHdncr0dxHIcDTWUVHYiX3EE10xRsGk+uYtL07K1Wttc50ycw8b1P2zyCpjgKlT4s3rZVaNQ27eK0N5jjjnXb3wjnTVT84etOS/jsh5DO0+Y/sX9UqKVI7ZpYNhnSbcn7MUfNXnokvFVjLYAN38SGI6bKc= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4848.namprd08.prod.outlook.com (2603:10b6:805:6d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 20:51:08 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2%7]) with mapi id 15.20.3391.014; Wed, 16 Sep 2020 20:51:08 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [RESEND 3/5] dt-bindings: input: iqs269a: Add bindings for OTP variants Date: Wed, 16 Sep 2020 15:49:58 -0500 Message-Id: <1600289400-27632-4-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600289400-27632-1-git-send-email-jeff@labundy.com> References: <1600289400-27632-1-git-send-email-jeff@labundy.com> X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.227.119) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 20:51:08 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [136.49.227.119] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11741f31-969d-454d-bada-08d85a823cdb X-MS-TrafficTypeDiagnostic: SN6PR08MB4848: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +asdYgZB43IVSwIGNFrSyUn+8o7zMO2ySyoHHiawqOBa6PT1za8MZok4cxwxY6wEffbNQDRkIiRbzIaZSuG0yeHZW8O2lvQi02BS6V4y4hRkGwtUnlHnyEqJNpp0hfgh2spY/TXJeKk/xs3lL2oAM+qxReNnOjEgX1+58m1PHjdI3adj/UYal7E39RC5HUqIwrgN4lbKcb9lRURkoKDQ3F0Znirz6g4XDyx94Oj53EoUjjmkz653GiR/DmHZeuqc5jZury3LRspqXQU3BudFu7j2POUgg4YuMKfqKohxieOvifzNFQDb2w+Q6Ig1biotv/AeJAHi5kxe5aR0RHC/y/YbgAxcKHSj0qP77E0ZVtsNcRnBg0TBihvIp9ps0QLZ5hVZkoaPu7cuqI247Vq1MGcJT4vCf/WgOebixnFgwPeXFjRhzgf5IYcTqiVLePCl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(366004)(376002)(39830400003)(396003)(69590400008)(6506007)(66946007)(8676002)(6512007)(5660300002)(86362001)(66556008)(36756003)(66476007)(6486002)(52116002)(316002)(4326008)(186003)(2906002)(26005)(2616005)(956004)(6666004)(8936002)(83380400001)(107886003)(16526019)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aMPHCW726/RTItrcQWgUg9BlKFbfOKysBxFJxE0zcZATd/M7nyrYYHJ6w9l4ocMWHaxDxkBMM/q3RwMHbUb/mFdKzDdU+0MEtwRaoOAcyS2tiUUdYubcpq2Q3LlAbdtLn3vHA4biQelTs0lIkC+JIaAW8vZpuv3ZjwiTbjty0h7gfUhjEOfjBad5hbBp9XeD+U7lUWnVbhdFec9YHC+dUj5H23K5iiTZW7tqF5vdV3Jnxg+shUoWlvmRygXxoy76uvl4/ZqZzQ5DkXF5LxBrhs0q6hOq9sNfO7qBEMh2mppZ1elyYmFIcpJbO0P+frHAuNqC6paSf34EFgjSXVFTgnQVb38Z3gwmBo3AzK5lk6tG5SnY3z86hitPIKczBJqZrAhJBAjl/MaeqXh1GT6XEPQX8CeaC+QSwT1GBCbLSIt+I2z/xcttVNBTLGhg5Rky+zCLcXFarWUDHvt+kurbrlHtC6YgppJxFgBUzrJouGRncwp++KRKB+IuCLRJxE1Ygfk3YJWFAEpMAoWWwSSCrj0pFFDkBxPe1ASX7Jf3hUF4ptnfwD5aiKKrr0ckYADlR6blRKyWStbXCzz9EZ/LVVv69t+eXsWQkwMVwyRoPBAuYoEkiITXVFMbYiatnJ+HbEyKMKJYZ2xpkkez0aGhaw== X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11741f31-969d-454d-bada-08d85a823cdb X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 20:51:08.7855 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MnFWnCFVNI2d8W8otHErKOwfS21YCvSk7y/mdH4NUQlSKCFVsaciGWQaU6P0vRCD1K4h8L68AwspoEM94ZVBTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4848 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch adds bindings for the D0 order code of the device. This order code represents an OTP variant that enables a touch-and-hold function in place of slider 1. Also included is the ability to specify the 00 order code (default option with no OTP customization) explicitly. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring --- .../devicetree/bindings/input/iqs269a.yaml | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/iqs269a.yaml b/Documentation/devicetree/bindings/input/iqs269a.yaml index e13812d..56a628e 100644 --- a/Documentation/devicetree/bindings/input/iqs269a.yaml +++ b/Documentation/devicetree/bindings/input/iqs269a.yaml @@ -17,7 +17,10 @@ description: | properties: compatible: - const: azoteq,iqs269a + enum: + - azoteq,iqs269a + - azoteq,iqs269a-00 + - azoteq,iqs269a-d0 reg: maxItems: 1 @@ -210,6 +213,16 @@ properties: default: 1 description: Specifies the slider coordinate filter strength. + azoteq,touch-hold-ms: + multipleOf: 256 + minimum: 256 + maximum: 65280 + default: 5120 + description: + Specifies the length of time (in ms) for which the channel selected by + 'azoteq,gpio3-select' must be held in a state of touch in order for an + approximately 60-ms pulse to be asserted on the GPIO4 pin. + linux,keycodes: $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 @@ -514,6 +527,21 @@ patternProperties: additionalProperties: false +if: + properties: + compatible: + contains: + enum: + - azoteq,iqs269a-d0 +then: + patternProperties: + "^channel@[0-7]$": + properties: + azoteq,slider1-select: false +else: + properties: + azoteq,touch-hold-ms: false + required: - compatible - reg From patchwork Wed Sep 16 20:49:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 254979 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 D7C5EC43461 for ; Wed, 16 Sep 2020 20:51:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A0C021D7D for ; Wed, 16 Sep 2020 20:51:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="SgiHzOKj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbgIPUv4 (ORCPT ); Wed, 16 Sep 2020 16:51:56 -0400 Received: from mail-bn8nam12on2088.outbound.protection.outlook.com ([40.107.237.88]:47413 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726704AbgIPUvS (ORCPT ); Wed, 16 Sep 2020 16:51:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGFwDdL7XD3U39uSA9Rlin5dFawyFfikI/pEYE+V/P0SSpFY/4L7UY4+sqAs6D0dVwsSS0McS2PU9c+tOAhKP4rZGXKgcAJiotq8jNsGtet5uoAeS1cApS1own654IbM1KNKBVILfB3jH4xuGYzuUlJiCDPT0s1/cMUuGKp3sNWxF2DA/RqgzOyAM2pzEdr4B6NeoJILbfXqB4WmVU0BpmWqdxlJpZj0N+IEPnDZ6xgRGHGUluXwBHTomYhnAa0ZO6n48MNeADy/i5ar7EqW3r9dLutY9CJ1ZjjAplGWC9Vqb6stjH82FqNibi/LJnRcsB2uBtzSLvX77mhpOEgHvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lPfxuwLTmK+GkStKq+86hSwgk8J+FX39rElhUysleFA=; b=BywpC1IjnJFhHhmwq/45VeKDkyGSFmDo9m5w1tWrcOKZ0S7ksBXEGtLRzpjJsB+XtgbU4p/bRb07qPqJAWsbgd28DwGhBLopcvmxAi4ANElDGaoTYcpkibz9lqIYCovU45/p5FAKrYtTcq1Hn5mO6bdcoEhc/RYae0HleKPARmiPW3gte3lwOLd26XtA6IxrLEjuHf1RUMnQkLZLK2igToF8X8RQwcV/eob0UY6aK6jWxr37+0jRyIEtdKWTjSmqEGYdEBztZLCGksDrsEp0kyIGeXnDzTy3sWyXWULyUUTFRQ9ILDCZ1eDl/87gD1+rYQhdzRezXL5NOlxzy7QANA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lPfxuwLTmK+GkStKq+86hSwgk8J+FX39rElhUysleFA=; b=SgiHzOKjvM9pSNA4cV6hnN2ld4J99zCJU41VCKg6I90T0Nlg1NV9+ae/gxlAwn+92gS5tQqLQwUKvkD3pcbvM6P9HjrCrrtIAbl3PTxpR7kWsY3F+Fk8E4YwOnS6qj91Sa7+srxaLMnnxiq4xhR9H6j0Kceooawhm9fX9Ux0E+o= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4094.namprd08.prod.outlook.com (2603:10b6:805:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 20:51:13 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2%7]) with mapi id 15.20.3391.014; Wed, 16 Sep 2020 20:51:13 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [RESEND 4/5] input: iqs269a: Add support for OTP variants Date: Wed, 16 Sep 2020 15:49:59 -0500 Message-Id: <1600289400-27632-5-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600289400-27632-1-git-send-email-jeff@labundy.com> References: <1600289400-27632-1-git-send-email-jeff@labundy.com> X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.227.119) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 20:51:12 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [136.49.227.119] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4e64966-92f4-438f-67f4-08d85a823f51 X-MS-TrafficTypeDiagnostic: SN6PR08MB4094: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZBKczIeKhslMZdhUz5R5r7Wo+5phW+MPfCKnqI+gj3UAMa3cYYXK7f6U3qvlJuzgZAEz6YBsXw/7BTBQ0+Wt147edjwwZ+bFwlOWBst9rL6ussIv6QtMRuJdP6xIMRq+yvnxfzk+I1soRg1VoIEKumjagOL5hxb5HR7FeGoK2cbHqJtJ1MAIY0s3uoBF0cWZAofSIXlEt7idjnZk71PqYTO79NgE/fuhG4mkhbwk2oDaa+DU8HDZ4YktxH4QofZymTPP2vuIE4CS56LG/RjlB9H/J9anWz5fXksDzXiVFi1bZbdjwqk/8JBvEQYft7jcNRC8Fwws2J7yxr76ZdqI8ZCwG/D4+PwPeJXG9kx7vxiyKvRPlYqQlYQNR86IyAbA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(39830400003)(136003)(346002)(396003)(376002)(366004)(16526019)(8676002)(4326008)(956004)(6486002)(107886003)(186003)(83380400001)(69590400008)(52116002)(478600001)(36756003)(6512007)(66556008)(66476007)(6506007)(316002)(2906002)(26005)(66946007)(6666004)(5660300002)(2616005)(86362001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 8yR04QiYoO1fhMKlVrPmKON4Rs3EFRvmAXBSLqzcCHqLw0hdwuzdpErF6P2pAXP3cQqN6ua3iclPhFHD41yUivk2mx75mfhCmgmSA5EQi7pRd4lZuwRPd6Bat9RO3lhCytPyRRdIC+7Ejuaz2Jl9EQFAd2ebFHly2bjiH0pNOWVHS25C0nN83zrCq7r+0aS2uCQ0hnvTZ5tO8MGjolZ6yvpmg55O5KOo8TB84Njwg+DaC/h3lLQ6xVvuCMTTJ9xQ/+NBY/RjZ/oWBob2iuR6sF2smuAnB3FXaN5lxayxrEzs6Uvf+3r9MyV1pjEDQexErDw3ZD1VdSaDlS9IYw3ffLJLJsWuiGWf5aikwPaMLjfnEp4KhvQAqSDtmXBg3a0qrvSn51PEaLFCYqGN22/kHrbUj0pJAAUgM8+VnS7hbAk1StkffmFObk5xDfat+R2zKNFaywqC2ugaeuwmpfz5fyU880ISAIZFBrl6HiUHTN1Wl3nFXd9JCoHQ4YTPPxH6MdNGxlK67TeKDcG+geSRyYwPh6RYBMWZ2JyV4s1Tc3tuZhPH+6Zh1RwaJutp7aBIAlNMISmYl+bXMtaIzMaY+ax3NmF+SF97cDze4ZafewQ9oS3B/F+Y63RbZ/5hivfvMewPk6M4eCtXA6J+mFLYyw== X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4e64966-92f4-438f-67f4-08d85a823f51 X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 20:51:12.9352 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WNgSdjFjvNb9VOTwmVRRVQVXBu0qu52BY0Ht81Ogq2snCWL41ykn52WTFneLroI0DAvX68pZ6OvB56ZwgIA2nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4094 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch adds support for each available OTP variant of the device. The OTP configuration cannot be read over I2C, so it is derived from a compatible string instead. Early revisions of the D0 order code require their OTP-enabled func- tionality to be manually restored following a soft reset; this patch works around this erratum as well. Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs269a.c | 94 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index 095e5d5..04947f1 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -100,6 +100,11 @@ #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) +#define IQS269_TOUCH_HOLD_SLIDER_SEL 0x89 +#define IQS269_TOUCH_HOLD_DEFAULT 0x14 +#define IQS269_TOUCH_HOLD_MS_MIN 256 +#define IQS269_TOUCH_HOLD_MS_MAX 65280 + #define IQS269_TIMEOUT_TAP_MS_MAX 4080 #define IQS269_TIMEOUT_SWIPE_MS_MAX 4080 #define IQS269_THRESH_SWIPE_MAX 255 @@ -142,6 +147,10 @@ #define IQS269_CHx_HALL_INACTIVE 6 #define IQS269_CHx_HALL_ACTIVE 7 +#define IQS269_OTP_OPTION_DEFAULT 0x00 +#define IQS269_OTP_OPTION_TWS 0xD0 +#define IQS269_OTP_OPTION_HOLD BIT(7) + #define IQS269_HALL_PAD_R BIT(0) #define IQS269_HALL_PAD_L BIT(1) #define IQS269_HALL_PAD_INV BIT(6) @@ -322,6 +331,7 @@ struct iqs269_private { unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; unsigned int gs_code[IQS269_NUM_SL][IQS269_NUM_GESTURES]; unsigned int suspend_mode; + unsigned int otp_option; unsigned int delay_mult; unsigned int ch_num; bool hall_enable; @@ -333,6 +343,14 @@ static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269, { int i; + /* + * Slider 1 is unavailable if the touch-and-hold option is enabled via + * OTP. In that case, the channel selection register is repurposed for + * the touch-and-hold timer ceiling. + */ + if (slider_num && (iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) + return IQS269_SLIDER_NONE; + if (!iqs269->sys_reg.slider_select[slider_num]) return IQS269_SLIDER_NONE; @@ -567,7 +585,8 @@ static int iqs269_parse_chan(struct iqs269_private *iqs269, if (fwnode_property_present(ch_node, "azoteq,slider0-select")) iqs269->sys_reg.slider_select[0] |= BIT(reg); - if (fwnode_property_present(ch_node, "azoteq,slider1-select")) + if (fwnode_property_present(ch_node, "azoteq,slider1-select") && + !(iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) iqs269->sys_reg.slider_select[1] |= BIT(reg); ch_reg = &iqs269->ch_reg[reg]; @@ -999,7 +1018,43 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) sys_reg->blocking = 0; sys_reg->slider_select[0] = 0; - sys_reg->slider_select[1] = 0; + + /* + * If configured via OTP to do so, the device asserts a pulse on the + * GPIO4 pin for approximately 60 ms once a selected channel is held + * in a state of touch for a configurable length of time. + * + * In that case, the register used for slider 1 channel selection is + * repurposed for the touch-and-hold timer ceiling. + */ + if (iqs269->otp_option & IQS269_OTP_OPTION_HOLD) { + if (!device_property_read_u32(&client->dev, + "azoteq,touch-hold-ms", &val)) { + if (val < IQS269_TOUCH_HOLD_MS_MIN || + val > IQS269_TOUCH_HOLD_MS_MAX) { + dev_err(&client->dev, + "Invalid touch-and-hold ceiling: %u\n", + val); + return -EINVAL; + } + + sys_reg->slider_select[1] = val / 256; + } else if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { + /* + * The default touch-and-hold timer ceiling initially + * read from early revisions of silicon is invalid if + * the device experienced a soft reset between power- + * on and the read operation. + * + * To protect against this case, explicitly cache the + * default value so that it is restored each time the + * device is re-initialized. + */ + sys_reg->slider_select[1] = IQS269_TOUCH_HOLD_DEFAULT; + } + } else { + sys_reg->slider_select[1] = 0; + } sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS); @@ -1140,6 +1195,12 @@ static int iqs269_parse_prop(struct iqs269_private *iqs269) return 0; } +static const struct reg_sequence iqs269_tws_init[] = { + { IQS269_TOUCH_HOLD_SLIDER_SEL, IQS269_TOUCH_HOLD_DEFAULT }, + { 0xF0, 0x580F }, + { 0xF0, 0x59EF }, +}; + static int iqs269_dev_init(struct iqs269_private *iqs269) { struct iqs269_sys_reg *sys_reg = &iqs269->sys_reg; @@ -1149,6 +1210,18 @@ static int iqs269_dev_init(struct iqs269_private *iqs269) mutex_lock(&iqs269->lock); + /* + * Early revisions of silicon require the following workaround in order + * to restore any OTP-enabled functionality after a soft reset. + */ + if (iqs269->otp_option == IQS269_OTP_OPTION_TWS && + iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { + error = regmap_multi_reg_write(iqs269->regmap, iqs269_tws_init, + ARRAY_SIZE(iqs269_tws_init)); + if (error) + goto err_mutex; + } + error = regmap_update_bits(iqs269->regmap, IQS269_HALL_UI, IQS269_HALL_UI_ENABLE, iqs269->hall_enable ? ~0 : 0); @@ -1807,6 +1880,10 @@ static int iqs269_probe(struct i2c_client *client) i2c_set_clientdata(client, iqs269); iqs269->client = client; + if (client->dev.of_node) + iqs269->otp_option = (uintptr_t) + of_device_get_match_data(&client->dev); + iqs269->regmap = devm_regmap_init_i2c(client, &iqs269_regmap_config); if (IS_ERR(iqs269->regmap)) { error = PTR_ERR(iqs269->regmap); @@ -1967,7 +2044,18 @@ static int __maybe_unused iqs269_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume); static const struct of_device_id iqs269_of_match[] = { - { .compatible = "azoteq,iqs269a" }, + { + .compatible = "azoteq,iqs269a", + .data = (void *)IQS269_OTP_OPTION_DEFAULT, + }, + { + .compatible = "azoteq,iqs269a-00", + .data = (void *)IQS269_OTP_OPTION_DEFAULT, + }, + { + .compatible = "azoteq,iqs269a-d0", + .data = (void *)IQS269_OTP_OPTION_TWS, + }, { } }; MODULE_DEVICE_TABLE(of, iqs269_of_match); From patchwork Wed Sep 16 20:50:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff LaBundy X-Patchwork-Id: 293949 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=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 25928C43461 for ; Wed, 16 Sep 2020 20:52:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE24B206D4 for ; Wed, 16 Sep 2020 20:52:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NETORG5796793.onmicrosoft.com header.i=@NETORG5796793.onmicrosoft.com header.b="RkCWY+gv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbgIPUwK (ORCPT ); Wed, 16 Sep 2020 16:52:10 -0400 Received: from mail-bn8nam11on2081.outbound.protection.outlook.com ([40.107.236.81]:43233 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728589AbgIPUvw (ORCPT ); Wed, 16 Sep 2020 16:51:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTNREUrf/94e6nQbIbWhTVZray83thTgbsnKePmhEsHQsEztHNAHkl+pLSQej16cR3aWwzvBlU//+Nr1jR5sPoKt/ttBhA/HhQC/ybDr3CFqa8Kdgw0r+TCqL+TnVRp4Q3d0jB9taPunOMEUHoJ5zY5ILBtIYjobLRlaxwYZBsAfj3WzQwjPnmivw3F1B59YCvp6KLRzv+rHQUkW4a+N3DETpz1xZ9mApuOpe8na6+RwXVkMZ70wYwrp22VWaWqX1q/PeJ8NA9CsPR9+n5op7GyDYYli79d0KQ5sRFiJHSDh48g5GwEqNKGqu+F72aJ00NMmV1dEIN0ose6lc8ykkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eZOS9QNE92oxGWSPhUfAu6jraI0qXSySjYhObHDbUcA=; b=Qfssxm3fLMg7b/TG5JxEiOWDP5QPH2iAzK3v/g2ybJcBB8+Wda7GmweT9R33UFDvPttZaN1BcQRrckyckul5CG2jUhXY8+C4sToHzenzxE9rFEMUCyfnHj0WX2XR6OTOptn4j7YkWNBXirvc2x+91dVFrr/axfI8UYJBAUh/xkQeCKmkF19wIjG8J+ggxJ4E0O0jcITid8UO3tgIBeY+5dkawD/53F8BGbUzVWqBsgVqjRefZwGMpE1ybMjB4dLcgNToUXCLcjpWIxaOxkpZtqTFZkMWTRAwwQtyGTsr9qYxMjCofyEnikTFk/NX+NH1CoIvHmYbkbLhEVmal5LzTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=labundy.com; dmarc=pass action=none header.from=labundy.com; dkim=pass header.d=labundy.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORG5796793.onmicrosoft.com; s=selector1-NETORG5796793-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eZOS9QNE92oxGWSPhUfAu6jraI0qXSySjYhObHDbUcA=; b=RkCWY+gvsPeOvXXPTjmdzd4BiroLT3/mDuae7oTHKXEYUhpI8s4qYesZOUfOAfqcM6o04oC1Hf/uBrc7lKNed8HZ5v7ZNh9Jw/ZJ0puKbodrpIQhGfe6Nva1qO8ySMXBD+CW7sZit0ghiDOn6InzbFQSlR6jA2O/ykZq4AD+4VM= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=labundy.com; Received: from SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) by SN6PR08MB4094.namprd08.prod.outlook.com (2603:10b6:805:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 20:51:16 +0000 Received: from SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2]) by SN6PR08MB5517.namprd08.prod.outlook.com ([fe80::d19a:589c:d9e8:b5e2%7]) with mapi id 15.20.3391.014; Wed, 16 Sep 2020 20:51:16 +0000 From: Jeff LaBundy To: dmitry.torokhov@gmail.com, robh+dt@kernel.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, Jeff LaBundy Subject: [RESEND 5/5] input: iqs269a: Make sliders two-dimensional Date: Wed, 16 Sep 2020 15:50:00 -0500 Message-Id: <1600289400-27632-6-git-send-email-jeff@labundy.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600289400-27632-1-git-send-email-jeff@labundy.com> References: <1600289400-27632-1-git-send-email-jeff@labundy.com> X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To SN6PR08MB5517.namprd08.prod.outlook.com (2603:10b6:805:fb::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (136.49.227.119) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 20:51:15 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [136.49.227.119] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 406f8ed7-0a46-4d9f-d2d3-08d85a82411b X-MS-TrafficTypeDiagnostic: SN6PR08MB4094: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qDIj55veNCcyD4RtE2moWbF5iMUFKMo9hZhiBvDQ0RHnEfqXzwxT8LuxCXFVMTqrSrE44BRIWbOs9KIekMc4szPDewBWCtXIjve1G9PLzcvRPk7CA8IdDRB4O3QOMhiSpE0pu65Tp2Hn789L+sxcZWE9FRdD7r4rorQHzj3C7CeIcSvPe3g43Psfk8aSxgP60IXbOfBppwI7duE83bYz09vEKEOmVRxP3ZNaxRWGmq0/7pAcggpiCm7DeAl4mZIjJhvsG46dEkBAAjZ7zziW5QY0ATISM1ejR/Rfq8zPVd85FNCTl6O8YEInSKS+ZzeSyE/MexkrsgXyls3d9EMCzyeM9qQxrh3a+0otsw3zhE6CTlCg2wyaJ4rjadmcndQ7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB5517.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(39830400003)(136003)(346002)(396003)(376002)(366004)(16526019)(8676002)(4326008)(956004)(6486002)(107886003)(186003)(69590400008)(4744005)(52116002)(478600001)(36756003)(6512007)(66556008)(66476007)(6506007)(316002)(2906002)(26005)(66946007)(6666004)(5660300002)(2616005)(86362001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: dumf+idUBYKAMpXPA+FQMMNv6drGC6HNBrwxRcNKD+1VTGhWXHv5uWfqwiOJSrOlDnI1Ud5KN4BCTTfVEO5LDzr2KHLaLJyr+nDNijWARdJDCsINLx6pe5coYeMh0pt07xAcvn/nIFvaYbAo+05aVNv5+wx3AGG5wmgcztUE3hxqYSjtaizxcl06yLErlTP7028+PobX0SFfeuYQNh3LWnWQzoxb6X1yNkJ1zn1696KreR1FlzjcGHrU+bTxfTIJrxWLTUm2frQJKKElu+0ag6P9Zs05HNdP7bqG/F54rFSUaKglVguK21t6RleH8JNMIWTPUAiyNvwfh8ysOzqcd+k2CNxK2J+NCQtg2UUNElAnU2zWr661Y5IGkCNLrMSM4dZrd4/8PP5+wuKybI5oQgx+xCLkAKrg8Ub0zjORwfWWNjm8shfruvACkCztyKawXD2znzfIN0gofSo8bwdZuU0Z0JYDnHOvQytin8CQKwsNP0U7iQ+DvdDMsWtokq0PyxFnv81OycmzyCz3zk7w/pKzeQsJ3Va6j9xd89CNMQvdigcTQUPQHVpXIc3yazE4t525KES5+vXjKLF03pVgI4rkeAv1IKls5BXs3ojKwX8UNbCrlAA9BLwsQ4S+VHufNEJ8m3w1s9Qk11rdqKFrtg== X-OriginatorOrg: labundy.com X-MS-Exchange-CrossTenant-Network-Message-Id: 406f8ed7-0a46-4d9f-d2d3-08d85a82411b X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB5517.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 20:51:15.9754 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 00b69d09-acab-4585-aca7-8fb7c6323e6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wL3UgXclz+I1fgyh1D/fqU5SeT4bGM7Lf86GY3hb+S0EpvxgTq+Cw7h8TcmOM+ewsIZoVQFTNutnJ0yJsIpXFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR08MB4094 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org libinput rejects devices that define one axis without the orthogonal axis, as well as devices for which either axis's resolution is zero. To solve this problem, present a thin y-axis with a resolution equal to one. Signed-off-by: Jeff LaBundy --- drivers/input/misc/iqs269a.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c index 04947f1..4a0e4ec 100644 --- a/drivers/input/misc/iqs269a.c +++ b/drivers/input/misc/iqs269a.c @@ -1377,6 +1377,8 @@ static int iqs269_input_init(struct iqs269_private *iqs269) EV_KEY, BTN_TOUCH); input_set_abs_params(iqs269->slider[i], ABS_X, 0, 255, 0, 0); + input_set_abs_params(iqs269->slider[i], + ABS_Y, 0, 1, 0, 0); } error = input_register_device(iqs269->slider[i]);