Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2938399imm; Tue, 4 Sep 2018 12:27:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYIpZMiUjqFkAmAf9Ep4CfWt1mUOGlCRexepkUh0nuaKXYAIUrsNCZvpHAqu/Wg43cqLgqj X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr35204152plk.323.1536089255385; Tue, 04 Sep 2018 12:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536089255; cv=none; d=google.com; s=arc-20160816; b=vG430s+CZ7AYnPzuxy+sFIKKF4+fqGIwKRuBmR2SozdCkvHd7YVhiXN4e9iwSKl5Jt GtJ4e2kWrNYXZXHp913qXZTKD2N2TSPM0l94pQnmz/g30x9/PVi8tx/QzZGfMI1j3noU uryTEIEa7ddBWJ9cB7sOsw9DithQH5qmQ8/liTIz2uPZ+uhn1gHfqeNiKRojs1EN9zgL qvZDTURM+D7QlExjj4zex7531uxISkIGBcB/32By/HqTAGzc5NGdlwUlrkzlEBIfqQw4 rtNvcfcO8UeXn9M5TxMzlXVqUIlWePnItptrQh2ayHsWrUt8p0Aute4WxSZd1t9EnK8z d7Lg== 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 :arc-authentication-results; bh=1LCHG8zDXa81XkeCOcwjYV4vkKpWYX7U3uWMHLhR2f0=; b=Iko7cNuG82TTzAZjmF/POUFyVai9yS97vdbrxHE3c7Dhe9r1IGPLs3zGADx1Jpj/da blRKamZ3nYnZHjWGGfEBmVcjHEMGAMMr/NWlpXVHXDqOF61ZnnLHf35kM8IYmFZbLpYh LXlCZizM8AqK+siH40u+Uh4/JErJP3IFTqc7N1/Jyez1mDXGBUpVziYaoe6wJKu9gjve nTpditu/RHTtb2RFSXbpDoPquqhx4wBmIEsygA7zfZRPsowATtuY6l6VZ2CsrQPTdRkA PsSn5+XFhXMCjdhTuD2t09k1r2E58ebkh5JeB5AAp1OP0/hx38jxKlsVlKq9kud+N+yX qupQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H2DXDg5T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si2100219pgb.180.2018.09.04.12.27.20; Tue, 04 Sep 2018 12:27:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H2DXDg5T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727955AbeIDXwo (ORCPT + 99 others); Tue, 4 Sep 2018 19:52:44 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:38125 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbeIDXwo (ORCPT ); Tue, 4 Sep 2018 19:52:44 -0400 Received: by mail-qt0-f194.google.com with SMTP id x7-v6so5358481qtk.5; Tue, 04 Sep 2018 12:26:13 -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=1LCHG8zDXa81XkeCOcwjYV4vkKpWYX7U3uWMHLhR2f0=; b=H2DXDg5TPHY57GwH07jg5PqnXRf0vesd16Hy3swzZLAC5ae8gQsbBMbxKFWkW7S3RX PMfbYcOMI1FjR8AR6MsW0eAA/fXn9hePl5r9y9nCAo6V74u8JoEBAu6zsqiaF5BDtPEr o4twue7J/lfSrZ31NZq+6dhX4eH8MJbvunbSxGnquUc2euC5B0eYiRech0GM9nlTI5px QhjFHAXd3/qumguLRyt/YGZMimo+uebEWsRTRDBtiHt5gNrTeYlv3Fv0Y9o0cdW7wjPs +A3xDXGRmkeg64AWbD2jN6aIH/H2m3CwO+02DshIaQ8Srji15aYYDR/w+eo6gOa4kOgm eIeA== 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=1LCHG8zDXa81XkeCOcwjYV4vkKpWYX7U3uWMHLhR2f0=; b=qtpWlEjGc0Qnzj6D+/dpCCe/1V1385f3xVGPpeW2sKdXYkU5IOgwBsGn/D/FXtut7U MnX13l8xa3aZcm/CY6wmJryzylbiIO4vGDHFzyW756PfNne7ZqLhGMtSiN6WRxXttnQH VPEjrrkFdrJeoS3ud903b944KyqP2rFyfa7aJeg8vXvFCVUSOabVuPHhVauPsOASBjyk D09vDKPKg2qNCSPUSBIhLBBm6Lk9Cw4SQqV7ZZqjjLGNigR1W3TCW3Ty4kuPhuqu7KSW nx/Kb34oK8LxBkZ+tmqCvTqSDnUTnvBx0knTSpXpg3r935FTTWU4zwPxbIiLFyV/j3El PhNg== X-Gm-Message-State: APzg51Af/uO2TOX2KzV/DLZFgCaCNcVad8t9TOY01dsoQjr7OW+OC67B KRzoZEREZ6+99/sYBCaajyk49sMZc6fymXiR+HM= X-Received: by 2002:aed:2b83:: with SMTP id e3-v6mr30527852qtd.246.1536089172725; Tue, 04 Sep 2018 12:26:12 -0700 (PDT) MIME-Version: 1.0 References: <20180904200434.10442-1-afonsobordado@az8.co> <20180904200434.10442-3-afonsobordado@az8.co> In-Reply-To: <20180904200434.10442-3-afonsobordado@az8.co> From: Andy Shevchenko Date: Tue, 4 Sep 2018 22:26:01 +0300 Message-ID: Subject: Re: [PATCH v3 3/4] iio: fxas21002c: add ODR/Scale support To: afonsobordado@az8.co Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , linux-iio , Linux Kernel Mailing List , devicetree 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 Tue, Sep 4, 2018 at 10:07 PM Afonso Bordado wrote: > > This patch adds support for reading/writing ODR/Scale > > We don't support the scale boost modes. > @@ -44,7 +44,10 @@ > #define FXAS21002C_REG_F_EVENT 0x0A > #define FXAS21002C_REG_INT_SRC_FLAG 0x0B > #define FXAS21002C_REG_WHO_AM_I 0x0C > + > #define FXAS21002C_REG_CTRL_REG0 0x0D > +#define FXAS21002C_SCALE_MASK GENMASK(1, 0) > + > #define FXAS21002C_REG_RT_CFG 0x0E > #define FXAS21002C_REG_RT_SRC 0x0F > #define FXAS21002C_REG_RT_THS 0x10 This hunk doesn't belong to this patch. > +static const int fxas21002c_anglevel_scale_avail[4][2] = { > + [FXAS21002C_SCALE_62MDPS] = { 0, IIO_DEGREE_TO_RAD(62500) }, > + [FXAS21002C_SCALE_31MDPS] = { 0, IIO_DEGREE_TO_RAD(31250) }, > + [FXAS21002C_SCALE_15MDPS] = { 0, IIO_DEGREE_TO_RAD(15625) }, > + [FXAS21002C_SCALE_7MDPS] = { 0, IIO_DEGREE_TO_RAD(7812) }, This is just set of powers of two. No table needed. > +}; > +static const int fxas21002c_sample_freq_avail[7][2] = { > + [FXAS21002C_ODR_800] = { 800, 0 }, > + [FXAS21002C_ODR_400] = { 400, 0 }, > + [FXAS21002C_ODR_200] = { 200, 0 }, > + [FXAS21002C_ODR_100] = { 100, 0 }, > + [FXAS21002C_ODR_50] = { 50, 0 }, > + [FXAS21002C_ODR_25] = { 25, 0 }, > + [FXAS21002C_ODR_12_5] = { 12, 500000 }, Ditto. > +}; -- With Best Regards, Andy Shevchenko