From patchwork Mon Nov 28 18:43:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aniroop Mathur X-Patchwork-Id: 9450009 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 D6F1F60756 for ; Mon, 28 Nov 2016 18:33:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDE0E25D97 for ; Mon, 28 Nov 2016 18:33:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C296827D5E; Mon, 28 Nov 2016 18:33:40 +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 5292627D4A for ; Mon, 28 Nov 2016 18:33:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbcK1Sdh (ORCPT ); Mon, 28 Nov 2016 13:33:37 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36511 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbcK1Sdg (ORCPT ); Mon, 28 Nov 2016 13:33:36 -0500 Received: by mail-pg0-f68.google.com with SMTP id x23so13804034pgx.3; Mon, 28 Nov 2016 10:33:35 -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=Uc55NM/45eJP/aWeVKxizdgJZkpoo7Ui0B93GJ5QGB8=; b=Ryoifz8TPwbSzQo9qZNb8N9kT0sz2ZJeLOuEjhiEWIwtMeZu+rBGe3YXaJABTrme2B fGs3pW+CsvZdB2F9UZyiBt4B3CaO8MAJ/byAl5mtwnW4mq4DXEUVLzkCuuIiZu3NKHTU PeNPzEeGpurcI349LYBbzc9afDrvfKO6ALTKfy0tm2QaX2PKmbv3ZEGdRp1eMhc/yg59 wLFNVbn5dlkvr3BcIHIh8jLM2oteEi/CBKrxFX1L3L1y11PDeWRxf/DP/yRg5+kqlUFG D1NhxgbwaU7GP7pSkRstr3wWmVq5AsIcLyYn7dNs9dq27czdqFuyWWyIkdnufHJOee0+ 9xxQ== 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=Uc55NM/45eJP/aWeVKxizdgJZkpoo7Ui0B93GJ5QGB8=; b=fIPHgOGjI+aLFujBD105hfYNz6j8tvWIFUAH5oeWf+5PEvnkls90OsgFTfkjK05HPx /kSzf7wmqQFeusj60uRhQqTQDki++GnnMV+I2DXTuPZgrrlO5Rbvx66opqfIRGxS/z7l eKC9bu4lAmSnFJLoMDmCchGWKOJoMmf1OYVKrtrlDX9gAOW+E5wGQpv0ZTskTqE5ak8a zqI/5Vu2IaZIn6dQPAx0SwXN6qzXiKkok2K8CKh2SVCFeCO5xlyI3tefN48LsgX9M/0V /qZNUbjp2nS+fMInUcbq8K8OaLc2ru08lYycOVi7KUAkdfAxA74oASzI42vtNturkY/e QeEQ== X-Gm-Message-State: AKaTC02HyurYz4BTJyqjdspx7ep+X0ATq6dI7BNi1cvcT5ec/ixqGDPue1pFamJSbHtuDQ== X-Received: by 10.99.98.2 with SMTP id w2mr42923749pgb.59.1480358010408; Mon, 28 Nov 2016 10:33:30 -0800 (PST) Received: from Aniroops-MacBook-Pro.local.name ([110.172.168.122]) by smtp.gmail.com with ESMTPSA id t89sm88924440pfe.50.2016.11.28.10.33.27 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Nov 2016 10:33:30 -0800 (PST) From: Aniroop Mathur To: mcuos.com@gmail.com, 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: w90p910 - change msleep to usleep_range for small msecs Date: Tue, 29 Nov 2016 00:13:02 +0530 Message-Id: <1480358582-2954-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/w90p910_ts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index da6004e..3f14b5a 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c @@ -171,9 +171,9 @@ static int w90p910_open(struct input_dev *dev) clk_enable(w90p910_ts->clk); __raw_writel(ADC_RST1, w90p910_ts->ts_reg); - msleep(1); + usleep_range(1000, 1100); __raw_writel(ADC_RST0, w90p910_ts->ts_reg); - msleep(1); + usleep_range(1000, 1100); /* set delay and screen type */ val = __raw_readl(w90p910_ts->ts_reg + 0x04);