lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vdptz=mj+FaAwKP1NCZPknZ2T4TCCu99Egzh37wbtQJmQ@mail.gmail.com>
Date:   Tue, 4 Sep 2018 22:26:01 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     afonsobordado@....co
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>
Subject: Re: [PATCH v3 3/4] iio: fxas21002c: add ODR/Scale support

On Tue, Sep 4, 2018 at 10:07 PM Afonso Bordado <afonsobordado@....co> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ