Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbcDOV6b (ORCPT ); Fri, 15 Apr 2016 17:58:31 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:33080 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752200AbcDOV61 (ORCPT ); Fri, 15 Apr 2016 17:58:27 -0400 MIME-Version: 1.0 In-Reply-To: <20160415185927.GN14441@codeaurora.org> References: <1460668031-12384-1-git-send-email-john.stultz@linaro.org> <20160415172212.GW391@tuxbot> <20160415185927.GN14441@codeaurora.org> Date: Fri, 15 Apr 2016 14:58:26 -0700 Message-ID: Subject: Re: [PATCH 1/2 v2] device-tree: nexus7-flo: Remove power gpio key entry and use pmic8xxx-pwrkey From: John Stultz To: Stephen Boyd Cc: Bjorn Andersson , Dmitry Torokhov , Stephen Boyd , lkml , Rob Herring , Arnd Bergmann , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Andy Gross , Vinay Simha BN , "linux-arm-msm@vger.kernel.org" , devicetree@vger.kernel.org, linux-input@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 36 On Fri, Apr 15, 2016 at 11:59 AM, Stephen Boyd wrote: > From: Stephen Boyd > Subject: [PATCH] Input: pmic8xxx-pwrkey: Fix algorithm for converting trigger > delay > > The trigger delay algorithm that converts from microseconds to > the register value looks incorrect. According to most of the PMIC > documentation, the equation is > > delay (Seconds) = (1 / 1024) * 2 ^ (x + 4) > > except for one case where the documentation looks to have a > formatting issue and the equation looks like > > delay (Seconds) = (1 / 1024) * 2 x + 4 > > Most likely this driver was written with the improper > documentation to begin with. According to the downstream sources > the valid delays are from 2 seconds to 1/64 second, and the > latter equation just doesn't make sense for that. Let's fix the > algorithm and the range check to match the documentation and the > downstream sources. > > Reported-by: Bjorn Andersson > Cc: John Stultz > Fixes: 92d57a73e410 ("input: Add support for Qualcomm PMIC8XXX power key") > Signed-off-by: Stephen Boyd This works great for me, and lets me zap the pwrkey node in my dts. Tested-by: John Stultz I'll also send an updated variant of my patch that only removes the gpio key. thanks! -john