From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757492AbdDRPxU (ORCPT ); Tue, 18 Apr 2017 11:53:20 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:33592 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757458AbdDRPwv (ORCPT ); Tue, 18 Apr 2017 11:52:51 -0400 MIME-Version: 1.0 In-Reply-To: <1492506852.24567.54.camel@linux.intel.com> References: <1492088291-5215-1-git-send-email-svenv@arcx.com> <1492088291-5215-2-git-send-email-svenv@arcx.com> <1492506852.24567.54.camel@linux.intel.com> From: Sven Van Asbroeck Date: Tue, 18 Apr 2017 11:52:49 -0400 Message-ID: Subject: Re: [PATCH v4 1/1] pwm: pca9685: fix gpio-only operation. To: Andy Shevchenko Cc: Thierry Reding , "Rafael J. Wysocki" , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, clemens.gruber@pqgruber.com, Mika Westerberg , Sven Van Asbroeck Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the feedback Andy !! > I would go with > > /* Wait for @sleep microseconds for the oscillator to be back up */ > if (sleep) > udelay(sleep); > > Otherwise int sleep is oddly here. > > Or > > bool sleep > > /* Wait 500us ... */ > if (sleep) > udelay(500); > >> +} I think you may be getting confused between: - the chip's SLEEP bit (int sleep) - the amount of time to delay after chip comes _out of_ sleep. (always 500 us) If it's confusing for you, it might be confusing for others? Perhaps change the parameter to 'bool sleep_bit' or 'bool do_sleep' to make the distinction clearer? > __maybe_unused and remove ugly #ifdef:ery. If this works on non- CONFIG_PM systems, I'm all for it ! Grepping the drivers/ directory, I see that some drivers use #ifdef CONFIG_PM, some use __maybe_unused for runtime_pm. Mika and Thierry, thoughts ?