Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3703195imm; Thu, 17 May 2018 13:12:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqvp+bliew/2iT8ZF/TK4W1zxiQHhmpQlmTezPGgKJ0g2jkSxrfvjOuVxk2nkvj/1tj21MV X-Received: by 2002:a17:902:bd0a:: with SMTP id p10-v6mr6577073pls.69.1526587937092; Thu, 17 May 2018 13:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526587937; cv=none; d=google.com; s=arc-20160816; b=W68tG+kX1SfNsabxHYHgirvgN8OSTAczW0eijThivg+uvlOEF/ycIUHgrVGeJsuJwW 27vnKSUVyW7zdvRrLi7Y86dTXb5pGTJppY7nqi2RluYtUSz6J6YrqawhaDLBrV37Kd6f ElY3qUUPg4AaJ5ICcOY5RL546RuDTt3sjskUnHsFYeFBe4hZhLI3q3O4V8vet1hpuVNa P8/oso1qCOtL2JZ3OzdCLVX+WrgZo4V292k4y2mf6r+T5deptlrLqYi0hiBXm5liVAXF 1S2Xpuxfv4RVPYObleQ+29LvnPcXeUgblfefs30TeARLd6Qu30Xsdx19FxEVjU1AvY9N RENw== 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:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=d7wcHLCJa+jQU/DQHDUoUskbeftIA7tnWKD1QfpFYQQ=; b=DLxBfFoKAqcleqLuBa0tWIT5nVq+vG/CvR2TRJuawrrJhbuq6JGgb0ALcn3K/OYS04 DbftZloDJaXm9wSFgmGOZc7nWtKcxp0bRgQhHbOQCQHICKuewVSHdw/4TZwGoVZz198J npf9+k5keyjdTUnV999TXr883X9M62z2pnY4bKWzVzzqeUNhhe/H2/nP8aPfO6Z1K5o3 nQHcbbNfVHAHqkCQy0FRFnDDrgXSFMzfuWyH15ZmZ+/Zwizmt1TEfOjI/ubmIXWkGHgG vz5GVsJsx6ERQ3OqZ0LtQorzH6oCJyN2WoUb0+h/01LnaPPWsIpB5AYj2hdxtn8Owuci VY8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@de.bosch.com header.s=2015-01-21 header.b=paGStxzU; 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 p7-v6si4521166pgd.96.2018.05.17.13.12.02; Thu, 17 May 2018 13:12:17 -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=paGStxzU; 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 S1752215AbeEQUKe (ORCPT + 99 others); Thu, 17 May 2018 16:10:34 -0400 Received: from de-out1.bosch-org.com ([139.15.230.186]:56884 "EHLO de-out1.bosch-org.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbeEQUKa (ORCPT ); Thu, 17 May 2018 16:10:30 -0400 Received: from si0vm1947.rbesz01.com (unknown [139.15.230.188]) by si0vms0217.rbdmz01.com (Postfix) with ESMTPS id 40n2VD5Lg7z4f3knr; Thu, 17 May 2018 22:10:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1526587828; bh=HOaT1hrdMtb1781JxR/wpK0GpltgC8HtsieGbtWl1ek=; l=10; h=From:From:Reply-To:Sender; b=paGStxzUS1yXQazhfPBXeGTlCqlKuUvihgS68bWR19wXRjCUZIKFjZUyVqO/LR10p RN1BIjCwcvLaZL2SRtdHIeKXn/ILTuOFe25u3pTh5vdisvtRdA+iPZsJP7ZFVKuDQT R1WuqeGcCjAJID9CgX/+VpWuhTC50wH+LQ7gpeAU= Received: from fe0vm1741.rbesz01.com (unknown [10.58.172.176]) by si0vm1947.rbesz01.com (Postfix) with ESMTPS id 40n2VD506Qz6CjQ37; Thu, 17 May 2018 22:10:28 +0200 (CEST) X-AuditID: 0a3aad15-a0bff70000007ca2-cb-5afde1bb223a Received: from fe0vm1652.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 DF.27.31906.CB1EDFA5; Thu, 17 May 2018 22:10:36 +0200 (CEST) Received: from FE-MBX2051.de.bosch.com (fe-mbx2051.de.bosch.com [10.3.231.61]) by fe0vm1652.rbesz01.com (Postfix) with ESMTPS id 40n2VD2StXzBpBY; Thu, 17 May 2018 22:10:28 +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.1466.3; Thu, 17 May 2018 22:10:28 +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.1466.008; Thu, 17 May 2018 22:10:28 +0200 From: "Jonas Mark (BT-FIR/ENG1)" To: Dmitry Torokhov CC: Andy Shevchenko , Rob Herring , Mark Rutland , linux-input , devicetree , "Linux Kernel Mailing List" , Heiko Schocher , "ZHU Yi (BT-FIR/ENG1-Zhu)" , "Jonas Mark (BT-FIR/ENG1)" Subject: AW: [PATCH v3] Input: add bu21029 touch driver Thread-Topic: [PATCH v3] Input: add bu21029 touch driver Thread-Index: AQHT6TN1hReU6D2Y4UWjnT8atFgViaQtoUiAgAS+JACAACeUgIAB06pg Date: Thu, 17 May 2018 20:10:27 +0000 Message-ID: <7f0a4cb041354801b732c744ad695495@de.bosch.com> References: <1521651874-15379-1-git-send-email-mark.jonas@de.bosch.com> <1526048528-3613-1-git-send-email-mark.jonas@de.bosch.com> <20180516174357.GE21971@dtor-ws> In-Reply-To: <20180516174357.GE21971@dtor-ws> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.142.73.12] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA21TfUwbZRzm7V3L0XHjuFL5CSviOZONraVslV2GURPJUqMu+8MsGf6hZdxo lRbWKwjEOMbQOYZIUAZrCeNruC8dK6jVsK12JHaMOBEWwCETtxnYB34gjIGAd1xZ+4f/XH7v 8/ye53nf3/segdHdRBxhsTk4u82UwyiUuHLr5xpt19hChr5sQs5OVF1C7LHuH+TspeZxxHpG bmDs8N8zcrb/23oFe3ywT8a+f747/AXCeKbhDDI2OP248RvnL+FG96lDCuOUO2GHPEP5bBaX Yyng7MnPvak0n/APK/ImVYXfdU6Gl6CPosoRQQBlAFdTQTlSEjRVJ4Na12EkLboQ9Houh5ej CGFxH0HD/iSJ8CL4ufIaLhIKaiscbLuy3BRDJcPXrjkk1hh1BIODZVqxVlFbYN5To5B6WFi4 3orE5BhqG3QOrBdhnHoaRu+WLFuSVBrU7m8KbKJRBudu3lomIigtnJy4sOyDKA20t1/FpKxY cP/+QC7WQFHQ2iXhQKlh4uZiAE8EX+mUQurXwVDNp4F6A7Q13cWk4Gi4fPQWXoVinSG2zhCJ M0TiDJE0IvwUUu/h9AXWlC2GFJ09k+OL9Sm63blWN5IuVu1BTU07fYgiEBNJtlxfyKDlpgK+ yOpDzxAyRk1WLs5n0Kszc7OKzCbe/IY9P4fjmTgShYWF0apHMJ+fabXwvCXX5kNAYEwMub1I sCKzTEXFnD1XkvlQPIEzsWRF1rsZNJVtcnBvc1weZ19h0wiCAXKt8NDoaDuXzRXuseQ4VmhG I2U+FsqExsqICB/aTEQK2Xt/FbP5PJOVt2QH5I9LcnoFDUp70IvEvQ8qKjAat+XauLhYckHU U2KnOd/2aAdxa8jkWIFQhxBBlztoEAkzVJEzN4SeSOH/CWYD6VHV76KjA2BQtKlF0FCjq2D0 j3hoKLWDv7oDwcXhfgQP+8pkcHbxPgb+KbcSZq/1kHDRVb0a5o7WRMF06VfCZ/ZCNExO12lg pLU2Ac7NdidAZ/9cAgwc/zERfppreQquOP9cB19UP1gPS6VLG8A/eUAL/0x/r4XxxT6dkOrS w+C9Pj182F21GUamew1Qf/Z8Kox7Z1Lh4e0hFipHb7N3hLHKhLEi77w4VofJ8T9jDaDBs8WV oNPeDs+/dbj75d2r1m4a1hl27tvxelrxun3b/NOk39GQ+F6jx/TEWM3YMfVk4WelhrSSV8yq t3a1ffnk868lkt41M6dtSXN7lwYYK3+YTm3+reOlvzSkC1Rj6fHtC8X12zuGPnm1t38g/UTP 1ayNs13vpG+0HEpTj4yeHPmYtx2Iao5hcN5sSknC7LzpP45RQBbXBAAA Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dmitry, > > > > +static void bu21029_stop_chip(struct input_dev *dev) > > > > +{ > > > > + struct bu21029_ts_data *bu21029 =3D input_get_drvdata(dev); > > > > + > > > > + disable_irq(bu21029->client->irq); > > > > + del_timer_sync(&bu21029->timer); > > > > + > > > > + /* put chip into reset */ > > > > + gpiod_set_value_cansleep(bu21029->reset_gpios, 1); > > > > > > > + udelay(STOP_DELAY_US); > > > > > > udelay() ?! > > > > > > > +} > > > > According to the datasheet disabling the chip will take 30 microseconds= . > > In the defines we added a buffer of 20 microseconds and thus > > STOP_DELAY_US is 50. The function guarantees that the chip is stopped > > before it returns. > > > > We think that it is ok to use udelay() here because in normal operation > > the chip is not stopped. It is only stopped when loading or unloading > > the driver, or when the system suspends. > > > > We would like to keep it like it is. >=20 > The issue is not with having delay here, but the kind of delay you are > using: udelay makes CPU spin for given amount of time; you really want > msleep() or usleep_range() here. Understood and changed. > > > > +static int bu21029_start_chip(struct input_dev *dev) > > > > +{ > > > > > > > + u16 hwid; > > > > + > > > > + /* take chip out of reset */ > > > > + gpiod_set_value_cansleep(bu21029->reset_gpios, 0); > > > > > > > + mdelay(START_DELAY_MS); > > > > > > mdelay()?! >=20 > Same here - replace with msleep(). Replaced. > > > Instead... > > > > > > > +static int bu21029_suspend(struct device *dev) > > > > > > ...use __maby_unused annotation. > > > > > > > +static int bu21029_resume(struct device *dev) > > > > > > Ditto. > > > > OK, added. >=20 > You also need to drop #ifdef CONFIG_SLEEP. That's the point: we want to > reduce amount of conditionally compiled code and use __maybe_unused to > shut off compiler warning about some functions not used in certain > configurations. We rely on linker to eliminate dead functions from > executable. Done. Greetings, Mark 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