From patchwork Mon Nov 28 18:44:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aniroop Mathur X-Patchwork-Id: 9450015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1C6A6071C for ; Mon, 28 Nov 2016 18:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A616427D5E for ; Mon, 28 Nov 2016 18:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9712D27F9C; Mon, 28 Nov 2016 18:35:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17BF027D5E for ; Mon, 28 Nov 2016 18:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbcK1SfX (ORCPT ); Mon, 28 Nov 2016 13:35:23 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34963 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752099AbcK1SfW (ORCPT ); Mon, 28 Nov 2016 13:35:22 -0500 Received: by mail-pg0-f67.google.com with SMTP id p66so13810138pga.2; Mon, 28 Nov 2016 10:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=YD00lXmH2NhHiGGuO4dFvdTiYfGWKqHi5ZCDWGl/21k=; b=FJP/37ierI+MBFO1dTwJ9XiyqVYS9WzaU740pWIa7c2ZpmzDHayyyog3buZFUvwAry k/VUDdS7kOSsI6kKCpPJjl5ziV5zEBwgtOgl+OXZKPgRRcB8f9Vc6b77cYjsmwm/c1j6 TcnI6Xb71xdWskTejU1FNW8tpsFyeMjDNklEOmrxg1tk3RqR9qD9/ZObidQAHdQ3Vxo1 bfl71oBb+wCo39vU9NCVEbp/YzmNmuFoKM1FH5An7uPsLk4C6N0ReeqIWokgV3WfED4y S+84QdGIyTLthcSrKqZA75EYnATEU02P5NAW6yLVhH+RvwvGTZqlodnWSxIY3VRL9hVs qvgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=YD00lXmH2NhHiGGuO4dFvdTiYfGWKqHi5ZCDWGl/21k=; b=Tq6FdiSVPCXpjnQDz+J2EjClOB0XfakmIY+u7j28Pa7fU7kquBBbWPh7Hwp5NisWhK aN0X5Oe3pZxArkni2j9D/EhtSJim9sF7s+vmmCLcZ8+aROz1oygAT4qvcyade5J7HD2s deYDAWaQ60OX/IinNZu2R3ufEzRvW1LuYzi+Zm54+Iij5K9aRNqYTxbME2gnheaajc4R tAhn703rS2IhWpsSWwdVk3el1gYK88tc1xAZcD+/kVDFwCTiKwRyDxrDojB/VcVb6wKB 0ZSHvOFdIvc7RyZgJRfvhK7QVn15cE/1OtN+rDSb8T2ZZyLZ5/PUvbYNEuPyGVohKJ0P WkmA== X-Gm-Message-State: AKaTC01h5CzQoY2JZr7emGjdIaX384+oaanTahmbUcn90/RIrNoqwNBq2Ir1EsmL4kAokw== X-Received: by 10.99.112.66 with SMTP id a2mr42309632pgn.43.1480358121948; Mon, 28 Nov 2016 10:35:21 -0800 (PST) Received: from Aniroops-MacBook-Pro.local.name ([110.172.168.122]) by smtp.gmail.com with ESMTPSA id q27sm88967648pfd.49.2016.11.28.10.35.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Nov 2016 10:35:21 -0800 (PST) From: Aniroop Mathur To: broonie@opensource.wolfsonmicro.com, pyro@f2s.com, zap@homelink.ru, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: s.samuel@samsung.com, r.mahale@samsung.com, aniroop.mathur@gmail.com, Aniroop Mathur Subject: [PATCH] Input: touchscreen: zylonite_wm97xx - change msleep to usleep_range for small msecs Date: Tue, 29 Nov 2016 00:14:55 +0530 Message-Id: <1480358695-3024-1-git-send-email-a.mathur@samsung.com> X-Mailer: git-send-email 2.6.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP msleep(1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, retry logic, etc. Thus, change msleep to usleep_range for precise wakeups. Signed-off-by: Aniroop Mathur --- drivers/input/touchscreen/zylonite-wm97xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/zylonite-wm97xx.c b/drivers/input/touchscreen/zylonite-wm97xx.c index e2ccd68..cebd3a8 100644 --- a/drivers/input/touchscreen/zylonite-wm97xx.c +++ b/drivers/input/touchscreen/zylonite-wm97xx.c @@ -81,7 +81,7 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm) { int i; - msleep(1); + usleep_range(1000, 1100); for (i = 0; i < 16; i++) MODR; @@ -98,7 +98,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm) * for samples. The controller can't have a suitably low * threshold set to use the notifications it gives. */ - msleep(1); + usleep_range(1000, 1100); if (tries > 5) { tries = 0;