Received: by 10.213.65.68 with SMTP id h4csp358919imn; Mon, 26 Mar 2018 23:58:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELubf3V05ACf+Vntpk3g5xMEA3jXtcJkDhLYzz0JS5Z6zfz9WH0vU8Sh7OGA45OMR3vZ/a5N X-Received: by 10.98.131.75 with SMTP id h72mr26373037pfe.166.1522133937990; Mon, 26 Mar 2018 23:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522133937; cv=none; d=google.com; s=arc-20160816; b=ogu0gqL4liSlxs+YVmmjpm50Uue925TP7K89oTHMZ0Xqwfb5CF/eyh/+XOWLnM/PcJ 9R/c86XcoqPYqBVrnzLHbkkt1vW7EakMgCSsrCgeJFtL8dQKzLcAbbkktxtb6TVWnlIU WcwkvNE0axy6dq4z0bbeUm+chfaCx5jqrwAI8uAyzSgLrmwsMZIlVeZvjrMVD45uhfCl yrK+wVyyXy3KZ1kUI+XUVbPIyyEOOmrpxwlBe/xH3Z3I5TLDfkjMTJWlRkiy44fAVtJm sic4vKjiQ7LxtP/pDGM1xhtetwX5/y7bLoIgbt4g1HpL8zQTVP7JXnri5uwgR1j31osP ZoKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zbLQbglIAuNPt7laVgZ1eKdmfIjHcVta8bOSRWtzEnE=; b=WL+mx/XYbkgYU1I7VtyDdMVvs2XZlrguEJpo14IBScj8mGsNTHtGbywBC9x526jeR0 yP+4QRTzrES0Vg20V1+yL7l4qwTRJ2t85nCEGUgp/mtXwF4Hbm2qjCzAc97DcbZDnm9o lTyereETY2ZnqKPDlST3k4ouUxqC30Qk0e1iyO+eNS3EZ+EEQYkGlEXJlv0XIM8juqxg APafuHlO79/lC5K3awUjQdaSOggseME5jZqlUOD3k+CwOp4F2m36sEnKZeb4KsrhWoRR GLO9hv2Yh2PjSR9iiCyLtqsnUQmvoMHzW3/4zwf3mecwrrfNZdqdFMOqFT8QiClxx1dg jxbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@de.bosch.com header.s=2015-01-21 header.b=Lqqva2EI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=de.bosch.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x70si438047pgd.724.2018.03.26.23.58.43; Mon, 26 Mar 2018 23:58:57 -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=fail header.i=@de.bosch.com header.s=2015-01-21 header.b=Lqqva2EI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=de.bosch.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbeC0G5r (ORCPT + 99 others); Tue, 27 Mar 2018 02:57:47 -0400 Received: from de-out1.bosch-org.com ([139.15.230.186]:47038 "EHLO de-out1.bosch-org.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeC0G5p (ORCPT ); Tue, 27 Mar 2018 02:57:45 -0400 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Tue, 27 Mar 2018 02:57:44 EDT Received: from fe0vm1649.rbesz01.com (lb41g3-ha-dmz-psi-sl1-mailout.fe.ssn.bosch.com [139.15.230.188]) by fe0vms0187.rbdmz01.com (Postfix) with ESMTPS id 409MK31cBcz1XLFYj; Tue, 27 Mar 2018 08:57:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1522133863; bh=HOaT1hrdMtb1781JxR/wpK0GpltgC8HtsieGbtWl1ek=; l=10; h=From:From:Reply-To:Sender; b=Lqqva2EIYHjdLB0mGB3Fyll0xLgMhdzMkUNUJOz6QtUq0/Co8uNANt9VUbYa64hy6 tOjAs3jGJve1zAms5n3f2ra13d055EGC5VbKRItn3fArD+Sv70IwmJ0H8Dn++s+fhR Ny+rzkjZkizPFdAz6J+f9mjGoHXiYMI85nDbtiLk= Received: from fe0vm1741.rbesz01.com (unknown [10.58.172.176]) by fe0vm1649.rbesz01.com (Postfix) with ESMTPS id 409MK311pQz25; Tue, 27 Mar 2018 08:57:43 +0200 (CEST) X-AuditID: 0a3aad15-a0bff70000007ca2-c6-5ab9eb693352 Received: from si0vm1950.rbesz01.com ( [10.58.173.29]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by fe0vm1741.rbesz01.com (SMG Outbound) with SMTP id 7D.CA.31906.96BE9BA5; Tue, 27 Mar 2018 08:57:45 +0200 (CEST) Received: from FE-MBX2051.de.bosch.com (fe-mbx2051.de.bosch.com [10.3.231.61]) by si0vm1950.rbesz01.com (Postfix) with ESMTPS id 409MK268MYzD6dP; Tue, 27 Mar 2018 08:57:42 +0200 (CEST) Received: from FE-MBX2051.de.bosch.com (10.3.231.61) by FE-MBX2051.de.bosch.com (10.3.231.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1415.2; Tue, 27 Mar 2018 08:57:42 +0200 Received: from FE-MBX2051.de.bosch.com ([fe80::d5b5:44fa:ef15:153e]) by FE-MBX2051.de.bosch.com ([fe80::d5b5:44fa:ef15:153e%6]) with mapi id 15.01.1415.002; Tue, 27 Mar 2018 08:57:42 +0200 From: "Jonas Mark (BT-FIR/ENG1)" To: Dmitry Torokhov 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)" , "Jonas Mark (BT-FIR/ENG1)" Subject: Re: [PATCH] Input: add bu21029 touch driver Thread-Topic: [PATCH] Input: add bu21029 touch driver Thread-Index: AdPFmLCuuWcHIO+GQ4GRxNEfUInxQQ== Date: Tue, 27 Mar 2018 06:57:42 +0000 Message-ID: <7ab56efbafd34c11968d8cef2369c6a5@de.bosch.com> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.19.142.147] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA22Tb0wbdRjH+fX650CuXAuVhwo4a0gQlBUcoWPqcEZT44uNuJCMaLSMgzZA S+4KjsYXsxtsY4wAQoSDFguCEVnGUKDMNpCKhmHYXxM6ggEdUWjdItMikoBeezD6wjeX5/k+ z+f7PPdcDsfkI7gSNxjNFG3UlavEUcKo3MtJLxj844XqfzuUmu6pGyLNtz0rSONcWMQ09x6t izR3r3WJNX1ztwWaWveUJE+iHbQPIq2dnRZqx9mfJNrhgQti7Z/DycdEhVEvFVPlhmqK3v/K +1F69199qNKhPNXyxargNFqNq0eROJAH4KzTj+pRFC4n2wXQs+aR8IkLQWfD5xifPEBw5/eP xXwyieDLX2axIC8mc+Fc/w+SYBxH7oexzs2QF0Y2YnD+1pYgWIjlhtR6WTHflA0Nkw0iPs6A 6d/sIVhIpkD3fF1IJ8hDMLloC+mITIKhoZuhYRgZD8O//i3iFyfhMxevA6mA1fvbnI5z8TPQ 1X6Eb88Ab1urmI/Tod/hx3h7GVzvWBY2IQUb5sqGIWwYwoYhnyLhAFKUUOrqisycA5kZdBHF WNSZGSdNFcOI/3oKJ3I4CjyIxJEqmrAsjxfKRbpqpqbCg7JxgUpBWJ7mJGmRqbhGr2P079FV 5RSjUhIoIiJCHvtYZqqKKgwMYzAZPQhwTBVHlPVxHFGsq7FQtInHPOgpXKiKJxqKPyyUk6U6 M1VGUZUUvVs9hOMqINp9HCijqVLqVImh3LxbViXxM58Mr4SPFeCRHvQiHs3NPhi0IJhKXQVj KN3BE3hcvqvuoTPoKL7uXqrDcOtS8Old8ddhcqHRZKSU8QQd9CKDlL7K+HgbZSKRPscVFGGF PUcfmkPcPWOJ1iAczf0we3sA4YztOiGX7Yh7UFYvx5CsFFw3j4PdSsN0y1cIJu7dRXBl+wEG 9ocDYmBvT0hg3LMh4Toe4XDVejkStr0jBHR7NwjYGNwiwLWyTcBEZ4sUnLYxKaytBaSw2dEW AxOXbDHgvz8bA4GmGzEwOmSTQcB6Vgm2NbcSmm8tJMLC1UAyNM6wKdB+xpcCC7UbKfDjd92p 0Lx9Lg3Ou0bTfdyJBdyJR63O4InNOvP/nHhH3Xs35WnUbEmukj13/efU3oLXDpe05TgOX0zw qvd9ksOcyc/6/sKUe75MvZln7v/63conUg++802NMDu3IP+icen59UCkIU/aejIhui/rzYTE 12U9H9nfPuY+OkJe6R07cfzZO38sl6xey5+f9T18OS3f/Ra6JERNLW8ccSzSWzP7BP80vlof 98GESsjodZlpGM3o/gMd0JM2yAQAAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dmitry, > > +++ b/drivers/input/touchscreen/bu21029_ts.c > > @@ -0,0 +1,456 @@ >=20 > Please add SPDX tag for the driver. We will do. > Please use GPIOD API (and include linux/gpio/consumer.h instead of > of_gpio.h). We will do the change. > > +/* HW_ID1 Register (PAGE=3D0, ADDR=3D0x0E, Reset value=3D0x02, Read on= ly) >=20 > Multi-line comments start with empty comment line: >=20 > /* > * Multi > * line. > */ Will be fixed. > > + /* calculate Rz (pressure resistance value) by equation: > > + * Rz =3D Rx * (x/Q) * ((z2/z1) - 1), where > > + * Rx is x-plate resistance, > > + * Q is the touch screen resolution (8bit =3D 256, 12bit =3D 4096) > > + * x, z1, z2 are the measured positions. > > + */ > > + rz =3D z2 - z1; > > + rz *=3D x; > > + rz *=3D bu21029->x_plate_ohms; > > + rz /=3D z1; > > + rz =3D DIV_ROUND_CLOSEST(rz, SCALE_12BIT); > > + if (rz <=3D 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); >=20 > 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. > > + if (of_property_read_u32(np, "touchscreen-max-pressure", &val32)) > > + bu21029->max_pressure =3D MAX_12BIT; > > + else > > + bu21029->max_pressure =3D val32; >=20 > Please use infrastructure form include/linux/input/touchscreen.h > so that you handle different sizes and orientations. Thank you for this recommendation. We will check it out and send a new proposal. > > + in_dev->name =3D DRIVER_NAME; > > + in_dev->id.bustype =3D BUS_I2C; > > + in_dev->dev.parent =3D &client->dev; >=20 > Not needed with devm_input_allocate_device(). We will have a look at the other drivers. > > +static int bu21029_remove(struct i2c_client *client) > > +{ > > + struct bu21029_ts_data *bu21029 =3D i2c_get_clientdata(client); > > + > > + del_timer_sync(&bu21029->timer); >=20 > If interrupt comes here kernel will be unhappy. You need to either work > canceling timer into devm unwid stream (devm_add_action_or_reset()) or > somehow make sure that you shut off interrupts before canceling the > timer. We will work on a solution. Thank you for spotting this. >=20 > > + > > + return 0; > > +} > > +static struct i2c_driver bu21029_driver =3D { > > + .driver =3D { > > + .name =3D DRIVER_NAME, > > + .owner =3D THIS_MODULE, >=20 > Not needed. OK, we will remove the .owner assignment. Greetings, Mark Jonas Building Technologies, Panel Software Fire (BT-FIR/ENG1)=20 Bosch Sicherheitssysteme GmbH | Postfach 11 11 | 85626 Grasbrunn | GERMANY = | www.boschsecurity.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 23118=20 Aufsichtsratsvorsitzender: Stefan Hartung; Gesch=E4ftsf=FChrung: Gert van I= peren, Andreas Bartz, Thomas Quante, Bernhard Schuster