Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2056250iof; Tue, 7 Jun 2022 18:17:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLxKLtgyMELAdj4mkj6SpfLe+2RLJdzHwenErOm6Pnat1OxJbcs/fhKSBof4KhdGzN22Dq X-Received: by 2002:a17:902:7783:b0:167:8245:ea04 with SMTP id o3-20020a170902778300b001678245ea04mr11676507pll.95.1654651056389; Tue, 07 Jun 2022 18:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654651056; cv=none; d=google.com; s=arc-20160816; b=PlymF+nNCX3AOgn/Vga3FN1nIHSljfQDzHZ+wIB4IakxpJBKd2QxSvu0q5lZGFU5IP c4r//kGU+IzpbhWtZen8tvUek8LOJN8HvtPDCWHjARrEHUClQVHdicJkCC9V9fWmSmai iYoxN7k/3i+NObaO+XyTYMV0BJa4GVNkplA3fyIzhWJW9F+0PZ/SQyfXTB42CG+FCWkQ tSVAv03t3zJK9cSmtCjMsJZHO6jANlF5FamOM2ECXeD7s8OvTORO7SJjcjhYM+lI8VNe S5qLJmIkDlaPyZniZNQWmxZHXWV9g+fvbOUEt6/xJLyz2qUNwuLOtGbq742saqwuYywp 54eg== 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=pNHki8ftH8nDStuDhJIgHrULft2gaZILUl6BQIyp7/JdmDna7izJrvOC9hKZmTKdzb NZwdIrslzXuLh+IIH/hGxNRCCH9DXJHWdpm8QB6LolTUIgOcyX7K33xVC4SI8w11VXQG rmhjxM73z4vzUzj6LQRgl4HJ4FF3n1hJ729v4sINUoSI2vwi4M0e6p6a3jncZ/gScg5q 9UJBCu4fvrIfCkWhqlzkVhbRXRrS+4hIUDAkr4hTpg7SBmFLGQR6MrCXioYIYyvoblgd m2AeUo6cfg2dVTiJeYRdF4K5MluwQlxqgCmtoB+qJWu+NjDNbHj83B9XvJs5Su023ls1 45wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ewXyLD3U; 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 z11-20020a17090a1fcb00b001e26550d25esi29090272pjz.142.2022.06.07.18.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 18:17:36 -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=ewXyLD3U; 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 CDD85253FDB; Tue, 7 Jun 2022 18:10:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239766AbiFGJ4Y (ORCPT + 99 others); Tue, 7 Jun 2022 05:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240192AbiFGJ4L (ORCPT ); Tue, 7 Jun 2022 05:56:11 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7508E8B9D for ; Tue, 7 Jun 2022 02:56:09 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id h5so23429843wrb.0 for ; Tue, 07 Jun 2022 02:56:09 -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=ewXyLD3UqIPbri3d3Epx/ZmHVw4kmGp4TWXET1A/krbuovskBBkvOZVhPknJVFKV1a aeSs3+P/swErSMIXx3c/+lcspyoCjpIwoDoEVASuK+cwRGejC75n7xGLJuNolhhXr7ZQ eBHoJPPvGL9p1XZdodxCZOvtU0JN57VWcliuw= 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=OKqBSp6ocKet0uHpDqZWUn5LTOkOyRNsmAd3gKOlEGwZ5T1OYfVouhPg5p86VKsdHO Au8UXg2P/1NsiR8J/xTIa97z/xBJujwWX4gh7NYwktIJoXqK6BKWspAVlVj1lK1gXIBS ADq0exlMt2UZZaZLVsQUA9sCuvcr9YGm6zuBzkoZ5uvSfQV9fCZZrC0EOa2dn/L+CD/7 F6IDK01Cvj9XJgN84fGxAd+LBUktrBZ464DR8y9B79b25TFxb5K8acicw52U9YkWTUbm FHqTLga/9HipAT96Si7MateA3rFoB4mESEcBrJb80G6GlNyObZzk87QfKvWAqKDuE/zP 6FaA== X-Gm-Message-State: AOAM531X0QSNwXC6JcIA0b7EdGbLS7aKD3pE/qc75/L8saA7aT3kblOB W9AZ0UhFK4vpSe1ngRcVc4pgmaG42md3tg== X-Received: by 2002:adf:aa83:0:b0:210:2433:5c7c with SMTP id h3-20020adfaa83000000b0021024335c7cmr26617386wrc.340.1654595768161; Tue, 07 Jun 2022 02:56:08 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (mob-5-90-137-51.net.vodafone.it. [5.90.137.51]) by smtp.gmail.com with ESMTPSA id b12-20020a5d4b8c000000b0020feb9c44c2sm17693546wrt.20.2022.06.07.02.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:56:07 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Michael Trimarchi , Dmitry Torokhov , Marco Felsch , Oliver Graute , linux-input@vger.kernel.org Subject: [RESEND PATCH v4 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Date: Tue, 7 Jun 2022 11:55:52 +0200 Message-Id: <20220607095556.1034338-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220607095556.1034338-1-dario.binacchi@amarulasolutions.com> References: <20220607095556.1034338-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,T_SCC_BODY_TEXT_LINE 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