Received: by 10.213.65.68 with SMTP id h4csp589254imn; Fri, 30 Mar 2018 11:21:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hLR0M+61tZSXOOG/dw0F0j2hAFfKqWeYXz30CU/Vqaeab7cP+gXFeFAnh76UT7iN+8Tbi X-Received: by 2002:a17:902:464:: with SMTP id 91-v6mr85469ple.126.1522434108826; Fri, 30 Mar 2018 11:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522434108; cv=none; d=google.com; s=arc-20160816; b=MQDjFZr/PqiU3u4rClchbWafrKa9TM2OiCHRXDpqoUXNv9Vg90HOiKdIJTDKEFNlzX pqWouHrJe5P8T7UshT00sQkLQi6Yf/lVUCUDnax+eyMkW1wTMCgyMtVogLv9VNBjDCWw wwoJL+E6ST1KyP65aqa3zzsYY3ZaiDSAc8IZOdbMGHAz6ZVBwkRxWesycfXKrVqa+nR9 DI36Tw8m1YyZzSzeGyeOp2Zc7sNWYK2hbpLC6lratkEYwtCGpqb6QANmTq1S11O21Gua pSEApg5iUwX7RACqIIYSSZyJvDTdhPgGmFPOwdB0MxGm5R6gZzUTxo3OlbXwrW9TLQO/ eDvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=yL1F+7d0ySU0IEbRTcQg72P3CDkAo/50QjcvkUwVJK4=; b=Q7/CxoZ8ZlU8c0CKV01BAWdUcTO1FZMtEDlwOueDAzuHHf1BgRiv9/Pfu1vShHSqdq RcbIrq6CS4nxLd2pKIPEvauNgiC6eIPmFU9v0RuLiO9Twk2uOQiV+WcZXX8xDoRz+GdZ oolQ9HYIKijAEHBOEQ3+y32vc6pCI/wCTwSjIQ+Dsnl3y/6xY0jiKAIaAzWcB546sfSh vYN/i3yAYzCEaohkM8eOtd/ip3qXJUPv/87NsWxa4zLT1VeMt9C7l/EiRgNPtVbmFtt9 8eRCnCoChADEfj/T5kvzFpR1+25gP3uL/AyrjnprBXZ+C4Yyx8BIvqR7nYta2eAet3FO RDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MTrCygia; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si4351537pls.625.2018.03.30.11.21.21; Fri, 30 Mar 2018 11:21:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MTrCygia; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752210AbeC3STo (ORCPT + 99 others); Fri, 30 Mar 2018 14:19:44 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37457 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbeC3STm (ORCPT ); Fri, 30 Mar 2018 14:19:42 -0400 Received: by mail-pf0-f194.google.com with SMTP id x16so911604pfm.4; Fri, 30 Mar 2018 11:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yL1F+7d0ySU0IEbRTcQg72P3CDkAo/50QjcvkUwVJK4=; b=MTrCygiawfcwRDNWE02nKgWmrfjZN46f/+Ok3ungxPW6twxOxZp8STiK86kHjvnRZG /SeeiPbjhciec9ChgotrmMjIQP46T3q4i/uF4qPYG06xJRxCLkKbhhX5t5sePiq2Z0b5 i9olvDcU728UTINOHx+vhm3+ooeYonDHA+BqgQomC2IIC1QfZGl75gku6kW8N3F9z9Kv lDLxDEsE71agMcB/y3AtTREKSGbhlGTZtlEZ0CgoueXKwCcpuNFe+gYBtXS3U+XuhELn 9QkPJdXwviuWpBuHu7+uvmOQ5TYLA/grMWgJExT3cRtQ1RNTyl/+eAB2JnOefqISavn8 RgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yL1F+7d0ySU0IEbRTcQg72P3CDkAo/50QjcvkUwVJK4=; b=QF0zSMDw0teDs+IQTZwTX4U3YcHhkiA829NuDnW/ktMedU2vYNjRuqxnh7YC/r2gMX 0FXToesHA4dwBrswuIbfx3sYWJtjuJFzJTwq1qC/6I5s6RGj/8T9LDzXkhGkS+N0u5F9 yNCNW8CewkY4J37z8lMrN/ia3M30AX1WMiF4FnLcj8WWlxR8utfRFHdoMLJMrliXdMjk Vl+QsA7hpIGxpnKVpY6wme9KERllhfesMGTe2+O4mEzT+JYJyECKcuyGhKjp669BRFwn IOQnMa7KHi3kkjQ+VnZ1QNCAcyrDEj8Tphnzes7yveMyEnMIKy4RprTNzMIZob6xfMpy 9f3w== X-Gm-Message-State: AElRT7E6p7kpa/0L8V4uUS31wZXR6ChgKrJ7ekDX1K+kUUHX68VY+641 THHyTYISU9czZfGk08hzNjY= X-Received: by 2002:a17:902:9:: with SMTP id 9-v6mr87221pla.42.1522433981595; Fri, 30 Mar 2018 11:19:41 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id r76sm19851387pfl.24.2018.03.30.11.19.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Mar 2018 11:19:40 -0700 (PDT) Date: Fri, 30 Mar 2018 11:19:38 -0700 From: Dmitry Torokhov To: "Jonas Mark (BT-FIR/ENG1)" Cc: Rob Herring , Mark Rutland , "linux-input@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "hs@denx.de" , "ZHU Yi (BT-FIR/ENG1-Zhu)" Subject: Re: [PATCH] Input: add bu21029 touch driver Message-ID: <20180330181938.GD143703@dtor-ws> References: <7ab56efbafd34c11968d8cef2369c6a5@de.bosch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ab56efbafd34c11968d8cef2369c6a5@de.bosch.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 27, 2018 at 06:57:42AM +0000, Jonas Mark (BT-FIR/ENG1) wrote: > > > + /* calculate Rz (pressure resistance value) by equation: > > > + * Rz = Rx * (x/Q) * ((z2/z1) - 1), where > > > + * Rx is x-plate resistance, > > > + * Q is the touch screen resolution (8bit = 256, 12bit = 4096) > > > + * x, z1, z2 are the measured positions. > > > + */ > > > + rz = z2 - z1; > > > + rz *= x; > > > + rz *= bu21029->x_plate_ohms; > > > + rz /= z1; > > > + rz = DIV_ROUND_CLOSEST(rz, SCALE_12BIT); > > > + if (rz <= bu21029->max_pressure) { > > > + input_report_abs(bu21029->in_dev, ABS_X, x); > > > + input_report_abs(bu21029->in_dev, ABS_Y, y); > > > + input_report_abs(bu21029->in_dev, ABS_PRESSURE, rz); > > > > What is the values of pressure reported when finger is touching the > > surface? IOW is 'rz' pressure or resistance? > > Rz is pressure measured in Ohms. That is, it is a resistance which > correlates with finger pressure. > > I fear that I do not understand your question. Does ABS_PRESSURE have > to be reported in a specific unit, e.g. milli Newton? We thought that > it is a device specific scale and that it will be converted into a > calibrated value (just like the coordinates) in user space. What I was trying to say is that it is expected that ABS_PRESSURE values grow the harder you press on the screen, and reduce back to 0 when finger is about to be removed from the surface. Here, it seems, we have the opposite case, where resistance decreases the harder you press and increases up to some maximum value when you remove the finger. IOW, I think you want to report: input_report_abs(bu21029->in_dev, ABS_PRESSURE, bu21029->max_pressure - rz); Thanks. -- Dmitry