Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp605730pxb; Thu, 17 Feb 2022 10:37:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSpiCmPvgcdIeDDO6rLkR6wK7HLCR4WhYO7cCZxxyGGmOnokXuaYI+sMGyPFOKndnoXFbc X-Received: by 2002:a17:90b:3755:b0:1b9:bc4a:b9dc with SMTP id ne21-20020a17090b375500b001b9bc4ab9dcmr4302436pjb.159.1645123034437; Thu, 17 Feb 2022 10:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645123034; cv=none; d=google.com; s=arc-20160816; b=gd+ybT2kgfD8qtQmLekl6RDbJ8mXaAUxj6finWq6mPvlXByMIRb6r2ARxjqe0wWkmd KOvDB0jBLiadUhO5kZz/V2VCFt0YzNPFEs8cV9WeA92SGo4zLbPFcR8Iiizsh+v9X+fw T24o/V/7pnXq2swG4/NSl+M0mgh60mRG5m9G4MrN5F35FpRb82SE81P80vsT8qZdiy4S U9/l5pZlS1XNVUzOCA8WYQb1rFdHJ80WuaG08pgDaIz/huMyyOM4SEqlfk7Fahkk919M YpELiiw/+ofMyG1c5eUb4bbBNWvw20J5RljYFeR9KF/t63pq0E7Qu5H/xx6T2SdycjVY cdLQ== 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=kqSty99JIW0BVU5oTdOW7akXHXwz1OsKwdfOj3X2wKF3NLwbiXaDRbll2PRauYaJkA inb+oLRIleQdjLAVcD7HeACU+vVsC77I/g7wl0zpPR3at4YWTKHH6SkgcV45i39n2lQT uqniUdymzw9SPb2/vMIvFzsEfAIFz69yo6E4pxEdyAn8a0FN0+BcxQiIP8luIhNEW2Al ekQongBXYQoAcJneY0uG9N6kmBWQ0UUlQ2DyZiV5msJKa1J4gvtcIOKEaakYQq2F5Nex +hUyfA0RpVeDuZclV1EWDhJQ4xObR3OoMdYuaF6DjzxCKopSr+r50uF9f9Fxiip+7SWw ZeKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VnHYi5Wj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1si8739824pgc.1.2022.02.17.10.36.58; Thu, 17 Feb 2022 10:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VnHYi5Wj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243499AbiBQQ4a (ORCPT + 99 others); Thu, 17 Feb 2022 11:56:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243487AbiBQQ4Y (ORCPT ); Thu, 17 Feb 2022 11:56:24 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9CB2B355D for ; Thu, 17 Feb 2022 08:56:09 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id gb39so8788987ejc.1 for ; Thu, 17 Feb 2022 08:56:09 -0800 (PST) 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=VnHYi5Wj0YE13I1AUCj+Cx7Y1RB4UEuq7ssWnN/HkT+mon1Tdocm01PyP/Mo+KI926 qtqHU7Q3+Zhd+OKwP2A1ZubKIqIaVXkVadLxfkQF5yqe4ir0MV5a1T1hzQ19VEKHryMm /ZaohaM4t2K6QOwE3FSWbTCfnlQ+6aHmcmulA= 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=xwMeYi2pHmP1YjIN3ml3SvD14lBdk748rMX6hVb7kI/bf3UUogN9T2gMFprHb1NzdW KUuP2YZfvSSjuY5jdgx8X+De8MRRMYyPErCzxtkeGaVTydC2ZglQWkGgK+OZzHGfyNx7 h/dfWGTpGJiLTxIobtYNDdBnxvn35kCWCdgQeWY+Rp+n66KdgHI2U3/1D0F6jvAehjiR gvDP91VQPAORWWzK+1TUGPSTOmlIiBYbb3JNhoGdPK2rnZ1veyqqbdlp/cPAy3u8yrVY iBd6T/AFxew4z/Ki98jW33T+daPTwZ6LmSepvIBPfi24EZ1ONPC3eVM2iskGiaQMl9Ck rxtg== X-Gm-Message-State: AOAM532f42XsnGH3GvNu3LkJdm2xe+MqJ+IVmaBMElstR7uhy8Fd7yj6 WPQ13Zz1G7yC13f49qVso8Ayw3hBpfHhBw== X-Received: by 2002:a17:906:e218:b0:6cf:7483:36c8 with SMTP id gf24-20020a170906e21800b006cf748336c8mr3042038ejb.747.1645116967527; Thu, 17 Feb 2022 08:56:07 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (host-87-0-15-73.retail.telecomitalia.it. [87.0.15.73]) by smtp.gmail.com with ESMTPSA id v4sm965323ejb.72.2022.02.17.08.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:56:06 -0800 (PST) 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: [PATCH v2 2/6] Input: edt-ft5x06 - get/set M12 report rate by sysfs Date: Thu, 17 Feb 2022 17:55:54 +0100 Message-Id: <20220217165559.313366-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217165559.313366-1-dario.binacchi@amarulasolutions.com> References: <20220217165559.313366-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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