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] [day] [month] [year] [list]
Message-ID: <87f737af-c676-4e91-658f-55d9d78ae760@gmail.com>
Date:   Sun, 2 Oct 2022 17:31:21 +0300
From:   Matti Vaittinen <mazziesaccount@...il.com>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Nikita Yushchenko <nikita.yoush@...entembedded.com>,
        Cosmin Tanislav <demonsingur@...il.com>,
        Jagath Jog J <jagathjog1996@...il.com>,
        linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        "Mutanen, Mikko" <Mikko.Mutanen@...rohmeurope.com>,
        "Haikola, Heikki" <Heikki.Haikola@...rohmeurope.com>
Subject: Re: [RFC PATCH 4/5] iio: accel: Support Kionix/ROHM KX022A
 accelerometer

On 10/2/22 14:18, Jonathan Cameron wrote:
> On Wed, 28 Sep 2022 14:14:14 +0300
> Matti Vaittinen <mazziesaccount@...il.com> wrote:
> 
>> Hi Jonathan,
>>
>> On 9/22/22 20:03, Jonathan Cameron wrote:
>>> On Wed, 21 Sep 2022 14:45:35 +0300
>>> Matti Vaittinen <mazziesaccount@...il.com> wrote:
>>>> +
>>>> +/*
>>>> + * The sensor HW can support ODR up to 1600 Hz - which is beyond what most of
>>>> + * Linux CPUs can handle w/o dropping samples. Also, the low power mode is not
>>>> + * available for higher sample rates. Thus the driver only supports 200 Hz and
>>>> + * slower ODRs. Slowest being 0.78 Hz
>>>> + */
>>>> +static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("0.78 1.563 3.125 6.25 12.5 25 50 100 200");
>>>> +static IIO_CONST_ATTR(scale_available,
>>>> +		      "598.550415 1197.10083 2394.20166 4788.40332");
>>>> +
>>>> +static struct attribute *kx022a_attributes[] = {
>>>> +	&iio_const_attr_sampling_frequency_available.dev_attr.attr,
>>>> +	&iio_const_attr_scale_available.dev_attr.attr,
>>>
>>> Use the read_avail() callback instead of doing these as attributes.
>>> That makes the values available to consumer drivers...
>>
>> Am I correct that populating the read_avail() does not add sysfs entries
>> for available scale/frequency? Eg, if I wish to expose the supported
>> values via sysfs I still need these attributes? Implementing the
>> read_avail() as well is not a problem though.
> 
> Need to also set the relevant bit in
> info_mask_shared_by_xxx_avail in the channels for the sysfs files to be created

Thanks for the help! I missed this. I'll try that :)

Yours
	-- Matti

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ