Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751915Ab3IRXJ3 (ORCPT ); Wed, 18 Sep 2013 19:09:29 -0400 Received: from co9ehsobe002.messaging.microsoft.com ([207.46.163.25]:27295 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607Ab3IRXJ1 convert rfc822-to-8bit (ORCPT ); Wed, 18 Sep 2013 19:09:27 -0400 X-Forefront-Antispam-Report: CIP:149.199.60.83;KIP:(null);UIP:(null);IPV:NLI;H:xsj-gw1;RD:unknown-60-83.xilinx.com;EFVD:NLI X-SpamScore: -2 X-BigFish: VPS-2(zz98dIc89bh936eI1432Izz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzzz2fh95h839h93fhd24hf0ah119dh1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1fe8h1ff5h209eh906i1155h192ch) Date: Wed, 18 Sep 2013 16:09:14 -0700 From: =?utf-8?B?U8O2cmVu?= Brinkmann To: Joe Perches CC: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Rob Landley , Mike Turquette , Grant Likely , Guenter Roeck , Sebastian Hesselbarth , , , , , Hyun Kwon Subject: Re: [PATCH v2] clk: si570: Add a driver for SI570 oscillators References: <1379544219-23579-1-git-send-email-soren.brinkmann@xilinx.com> <1379545361.1787.87.camel@joe-AO722> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <1379545361.1787.87.camel@joe-AO722> User-Agent: Mutt/1.5.21 (2010-09-15) X-RCIS-Action: ALLOW Message-ID: <0da25c5c-660c-4836-8179-6e7c51fd0d9f@CO9EHSMHS005.ehs.local> Content-Transfer-Encoding: 8BIT X-OriginatorOrg: xilinx.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1631 Lines: 43 On Wed, Sep 18, 2013 at 04:02:41PM -0700, Joe Perches wrote: > On Wed, 2013-09-18 at 15:43 -0700, Soren Brinkmann wrote: > > Add a driver for SILabs 570, 571, 598, 599 programmable oscillators. > > The devices generate low-jitter clock signals and are reprogrammable via > > an I2C interface. > [] > > v2: > [] > > - use 10000 as MIN and MAX value in usleep_range > [] > > diff --git a/drivers/clk/clk-si570.c b/drivers/clk/clk-si570.c > [] > > +static int si570_set_frequency(struct clk_si570 *data, unsigned long frequency) > > +{ > [] > > + /* Applying a new frequency can take up to 10ms */ > > + usleep_range(10000, 10000); > > Generally it's nicer to have an actual range for usleep_range. Well, as I said in the discussion with Guenther. I'm flexible and nobody objected when I said to make both equal. A real range doesn't make sense here though, but I don't know what's common practice for cases like this. > > Is there a bit you could periodically poll to see > if the new frequency has been set or is stable so > that a 10ms delay isn't always used? Unfortunately not. The data sheet describes one bit which is cleared when the new frequency configuration is applied, but it seems to be cleared before the output is actually stable/enabled. At least our testing failed when some driver changed the frequency and continued operation w/o this additional delay. Sören -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/