Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp933693pxb; Fri, 22 Apr 2022 14:43:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwceeVcfMHX5Gg4qDo68qCGYW8/wn/FY+CaOdXbjo//5FwtFEKoYeCX93xjZdkK+3cllU3m X-Received: by 2002:a17:90b:70a:b0:1d8:5662:6de0 with SMTP id s10-20020a17090b070a00b001d856626de0mr4870830pjz.212.1650663801188; Fri, 22 Apr 2022 14:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650663801; cv=none; d=google.com; s=arc-20160816; b=kJYNx5/3MIgEOrD/645LlObBECGZJDHAaViBvAPd5c7YJ6bz1F3G57P81znoR92Y2i +zRnWFS5AYSFnucLiI214r0jpGskFGRTLflYf8DhCDGJ4/TZA7kXbJ4MsieTAFZf7ZV1 DtRZVr21U9crgt5obvQCNYYzl3dHvPugBExJqsNqkhdz9mts20NcAIQ3NdN9CcFidJ4F Qrsn1aH6Kd/4m1nxDOYN6r5wIR6HdoLHQCgAoCD7LzY9Ly7pYewj/ljVfb6KvXJlf2jU 4ArUvrYyuEESGASgRRCrkbys5/mnrnv6RzvK1M4NwQYRIM0tJuPyDsWOn9Qd2bkZQVME 0mtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5FXIG1Rp9D4NgAZ2oOx6JgdhKdrDvM+0LjdQT4OHOI8=; b=jUG//orPvIpoRIGSX77h0KmSL8flwyyUnvgkUuSrpmdhthD7MA94TH4lgKG95wHXtW jYChBrjVyB5BxgROPVvVUNs2lUDmwcc1eh/dKamNi0VctwuTuXLV65Gx0WLl+YpOEL9/ aZpF7yOGVvIVMGt9QTMc8r1ygWrwgRzvL5uKjhUH2O7eaVLyZkSMu2z98YBV3KpTwbAB nnUXm66AsDNn8EMPAYIiVf5YUMYy9GBvKmyG3mPwhmejZ5ZF2wAF6kEzpVFMmjBdUlE/ czv4GLTh/RZMmB5fS/D/95ilBljIIqRYhbqB2Ypw+OcSb1+H0DHt8/fnxKXeeLMOYB5p Cxrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MaR3Nh0a; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s11-20020a170902a50b00b00153b2d164cdsi8907550plq.213.2022.04.22.14.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:43:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MaR3Nh0a; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 17DD5321313; Fri, 22 Apr 2022 12:51:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391706AbiDUTDk (ORCPT + 99 others); Thu, 21 Apr 2022 15:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391693AbiDUTDf (ORCPT ); Thu, 21 Apr 2022 15:03:35 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 125CE4AE14 for ; Thu, 21 Apr 2022 12:00:42 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id y20so11891755eju.7 for ; Thu, 21 Apr 2022 12:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5FXIG1Rp9D4NgAZ2oOx6JgdhKdrDvM+0LjdQT4OHOI8=; b=MaR3Nh0a44PUeP4GD3N3fQzpOlKuDClTPxLe42jw/eCBgTgd5mP96liXIDHRTXppE6 ixs8Ql1juGJM6TIDGV2+bJ9iYvfZ00PBMmh1w8O1yGdYwLdAzEODqrF9D0bSqvGeq50m sW/4spg0aTemVpI+udSkE8CjxlOk3WfAac4+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5FXIG1Rp9D4NgAZ2oOx6JgdhKdrDvM+0LjdQT4OHOI8=; b=lih1HSkw+h/l3l+dZlHz2mDtv49A3xsyik3Dm4CaSEYaKc45BqIvmbaqpAIP7rV4YL MozFSBmDOZymCzWyi3YkzA9AFh+L7TRUyL5OKrZNCsboQycSXEemKGU6j4erUm4Bczgf v1B7kq8pu6d4Us+7NbmFmLQi9lRtgJdD6MozVD2Z8WbD5g+Z6umPQX65DOYPMr7g3DWj zRSMFeD3+OvvTDxW2fLUgug2/IdKBpdYEaG+/rTph/uOijuQYNEVGcuyU4VSM+QoxB7i 0CVkWNL3QbIw6fKrNi7N2ZL0SoWdFQUOQwTxeqobvXkD5Cxa6VUrQSWuA0RBT/efAxxR nq4w== X-Gm-Message-State: AOAM533+O/qQHjlA4ssUnUiDqhzOZf6BsCn4i+k4dI5sCtKjqlanBeYR r2zF9N2dw1E5tTytdEbS6wfauKmp97qg7Q== X-Received: by 2002:a17:907:1b19:b0:6f0:1022:1430 with SMTP id mp25-20020a1709071b1900b006f010221430mr843589ejc.13.1650567640396; Thu, 21 Apr 2022 12:00:40 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com (host-87-0-15-73.retail.telecomitalia.it. [87.0.15.73]) by smtp.gmail.com with ESMTPSA id s11-20020a170906284b00b006e108693850sm7975142ejc.28.2022.04.21.12.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 12:00:34 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Michael Trimarchi , Dmitry Torokhov , Marco Felsch , Oliver Graute , Stephan Gerhold , linux-input@vger.kernel.org Subject: [RESEND PATCH v4 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Date: Thu, 21 Apr 2022 20:59:59 +0200 Message-Id: <20220421190003.3228699-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220421190003.3228699-1-dario.binacchi@amarulasolutions.com> References: <20220421190003.3228699-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for reading/writing scan rate (SC) register for M12 by sysfs. The register value is equal to the SC (Hz), unlike M06, where instead it is equal to SC / 10. Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Tested-by: Dario Binacchi Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/input/touchscreen/edt-ft5x06.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index bb2e1cbffba7..77f061af5c61 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -47,6 +47,8 @@ #define M09_REGISTER_NUM_X 0x94 #define M09_REGISTER_NUM_Y 0x95 +#define M12_REGISTER_REPORT_RATE 0x88 + #define EV_REGISTER_THRESHOLD 0x40 #define EV_REGISTER_GAIN 0x41 #define EV_REGISTER_OFFSET_Y 0x45 @@ -523,9 +525,9 @@ static EDT_ATTR(offset_y, S_IWUSR | S_IRUGO, NO_REGISTER, NO_REGISTER, /* m06: range 20 to 80, m09: range 0 to 30, m12: range 1 to 255... */ static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD, M09_REGISTER_THRESHOLD, EV_REGISTER_THRESHOLD, 0, 255); -/* m06: range 3 to 14, m12: (0x64: 100Hz) */ +/* m06: range 3 to 14, m12: range 1 to 255 */ static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE, - NO_REGISTER, NO_REGISTER, 0, 255); + M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255); static struct attribute *edt_ft5x06_attrs[] = { &edt_ft5x06_attr_gain.dattr.attr, @@ -1030,7 +1032,8 @@ static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata) case EDT_M09: case EDT_M12: reg_addr->reg_threshold = M09_REGISTER_THRESHOLD; - reg_addr->reg_report_rate = NO_REGISTER; + reg_addr->reg_report_rate = tsdata->version == EDT_M12 ? + M12_REGISTER_REPORT_RATE : NO_REGISTER; reg_addr->reg_gain = M09_REGISTER_GAIN; reg_addr->reg_offset = M09_REGISTER_OFFSET; reg_addr->reg_offset_x = NO_REGISTER; -- 2.32.0