Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp394922ybh; Wed, 22 Jul 2020 03:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfp10x8ImMJY+7uKIwwsbFQZhenX6bIiLeNfICh6lZb2ZGHJXwbQFr2ZrZpPhc96IBjEBa X-Received: by 2002:a05:6402:2cb:: with SMTP id b11mr31268136edx.66.1595413588384; Wed, 22 Jul 2020 03:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595413588; cv=none; d=google.com; s=arc-20160816; b=NSpIQpOnWcbvyWQanlvpassJtTL+fa3XXaev/hrznoo2fyHeZW9On0ItOXWF0Jg4H+ SsdyoVDFBTDDX159fNUXlLNXqyllCsM6fen9GXKNqxczkOn56rzA30Hfgs+kydedMGcD ibYQBP64B1apPxoRK0CPPM8g/4msirqXkVw+Qlob9Ky8HHYYk/aOaHRvyqjeivNHyTIx LGANTgzz2tjiihyAr/f9SZpdiZc6rvkcOM8dzMuqrtKJ1t9bbwowd/zOui2FxitY0xgM C9xEFxfqbbfaT0nd9CtU1tbFIfEf5/x+05rxXb5bG7jQxueXUP88r+c1xV6Nhu4Bso4z jhiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=351AZ2ekNDQ3m5sRAihkmJTU7M8Jo1Yfnte60wYBP14=; b=tNfNlFdu1+oBYCUllhQyqytmM+B8CCK+21e1CdYIbJrze2VaOpn1AkFBayuxB+9hrb o+QZzBQlFhN9IVh+eQzS8qbEHqDAPSsCzjRp7oc98F3Z+R/AJ7UXvfQ8fmzyyGoOBLtb r2G4zWVwTXC2XDGqoL3FhC6vJv6Pi/jUs7n1F9cQtAzDHbfeT596mmprsJU7xr1M+og3 BsM0AjkjFNtYI9sIp8fvv6/eUTZowmnYBd9aXAvVdjXlxPw9G1R2zrp7ot+uKY2ld6bh DkUnof0RoSHkvuRccbuzaAYaoS3UJBNZU4N4YGgrKseqqCUJz5LD16tZIUmee7Lxtq4S mSvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RKQFyU7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si11301637ejd.91.2020.07.22.03.26.05; Wed, 22 Jul 2020 03:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RKQFyU7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731811AbgGVKXi (ORCPT + 99 others); Wed, 22 Jul 2020 06:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726153AbgGVKXi (ORCPT ); Wed, 22 Jul 2020 06:23:38 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB74C0619DC; Wed, 22 Jul 2020 03:23:37 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id o13so990220pgf.0; Wed, 22 Jul 2020 03:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=351AZ2ekNDQ3m5sRAihkmJTU7M8Jo1Yfnte60wYBP14=; b=RKQFyU7Z0jmcWuaFp3mPqomB4elfcjfPsGGbVGUeVH7pNz1N7B3QlSKSKeEVwE0GwJ v0FMMi05JhglpwUcvnqQFgsaA/AkhjsAcu0QT62f0c/BvJ22NPxdZzcsvToc8hYEZXSg +KvQRDm5kJ7qjev+0WgkRtCl+nO4V4Lx9ogrT8XZwjTqqJx42DisqG7Fed44iZlKD4/K 77Ef26mQcJxunrv06/NWkLC4FdJ1kspGDEqs+6DyatqTK/PeSipS64cCgmYl96sGsqqQ Z0H5b+TMwVOR94ztgy1nHZkjwVbkOadhUY+eyj6dxHX12w/Vo2SqsC9OXLBRJwDkwFPv 90qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=351AZ2ekNDQ3m5sRAihkmJTU7M8Jo1Yfnte60wYBP14=; b=BU4DF3PNtRJYnrnSuiSRAK/CKiO3VoGeHKWL/dNppmyPg7UmnPxRjaJAY6oSBBsGR+ JlURbtDN+JjygXzIdpuaTQ5QeUmaw2dAml/oA5oDUGTryBAuaUwDjdRGujdJ8zo/b4j3 EjDn8+TsJk3z6uF9lcQCGgUYmTYk01Q1Erzptf+vKQZkwIfw5zU4Xmmo2IeRCNM7bous 04VlzsXJigc5PQh7b6Ehn8oGwUUVMsk73WwqA5wyD8Tmzw0lMySE6/OdwBMVUfAwpO/o bOhyxivOU9tEo/ae+3FetBd3VVqi76StZDq7pItXOrVcEzvDvy++Z8FYdU5FUxYG9agc fSBQ== X-Gm-Message-State: AOAM5332aZ6KcA8KZ1homv4zahLyDXC3QHmvt/ugwEO8apk6p2VrESI7 9Rfr/Zhuq7I4EM2qbkcJ86PElzQ2hR54Dko8Wb1HXoeT X-Received: by 2002:a62:7657:: with SMTP id r84mr27188292pfc.130.1595413417435; Wed, 22 Jul 2020 03:23:37 -0700 (PDT) MIME-Version: 1.0 References: <20200721181926.27046-1-nish.malpani25@gmail.com> <7ba8469a-dd8c-1686-6d26-e2a4cbfedce9@gmail.com> <5cb55101-af5c-b6a2-d770-9717f8a463cc@gmail.com> In-Reply-To: <5cb55101-af5c-b6a2-d770-9717f8a463cc@gmail.com> From: Andy Shevchenko Date: Wed, 22 Jul 2020 13:23:22 +0300 Message-ID: Subject: Re: [PATCH v2 1/2] iio: gyro: Add driver support for ADXRS290 To: Nishant Malpani Cc: Jonathan Cameron , "Bogdan, Dragos" , darius.berghe@analog.com, Linux Kernel Mailing List , linux-iio Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 12:40 PM Nishant Malpani wrote: > On 22/07/20 3:08 am, Andy Shevchenko wrote: > > On Tue, Jul 21, 2020 at 11:35 PM Nishant Malpani > > wrote: > >> On 22/07/20 1:16 am, Andy Shevchenko wrote: ... > > Can't you declare table as const int? > > > I'm not sure I understand you completely here; do you mean const int *? > So, an array of alternate integer and fractional parts? I suppose that's > possible but we'd be introducing unwanted complexity I feel - for > example, currently the index of the 3db frequency in the table is used > to directly map & set bits in the filter register corresponding to that > frequency but with the approach you share, we'd have to apply a > transformation (div by 2) to set the same bits in the filter register. > Do you think the added complexity justifies the removal of the casting? It was a question. If you think it is too much, don't change :-) ... > >>>> + /* max transition time to measurement mode */ > >>>> + msleep_interruptible(ADXRS290_MAX_TRANSITION_TIME_MS); > >>> > >>> I'm not sure what the point of interruptible variant here? > >>> > >> I referred Documentation/timers/timers-howto.rst for this. > >> My reasoning was shaped to use the interruptible variant because the > >> transition settles in a time *less than* 100ms and since 100ms is quite > >> a huge time to sleep, it should be interrupted in case a signal arrives. > > > > This is probe of the device, > > What are the expectations here? > > > I fail to understand why this can't be used in the probe() but perhaps > in a routine to standby/resume. Could you please elaborate? I didn't say it can not be used, what I'm asking is what are the expectations of the interruptible part here. In other words what is the benefit that makes you choose this over plain msleep(). -- With Best Regards, Andy Shevchenko