Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718039

Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple events

From Martin Kepplinger <martink@posteo.de>
Newsgroups linux.kernel
Subject Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple events
Date 2017-08-23 07:00 +0200
Message-ID <uhvVL-4pb-13@gated-at.bofh.it> (permalink)
References <ugAXx-Ka-27@gated-at.bofh.it> <ugQzf-20E-5@gated-at.bofh.it> <uhrSa-1HS-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am 23.08.2017 02:29 schrieb Harinath Nampally:
>> 
>> If rising: use transient OR ff_mt device-dependent like before. But 
>> now save it in a simple flag,
>> whether transient registers are available.
> Ok, is it good idea to add the flag to struct mma_chip_info like below?
> 
>   * @mma_scales:                        scale factors for converting
> register values
>   *                             to m/s^2; 3 modes: 2g, 4g, 8g; 2 
> integers
>   *                             per mode: m/s^2 and micro m/s^2
> + * @transient_supported:       flag indicating whether chip support 
> transient
> + *                             event, as not all chips support 
> transient event
>   */
>  struct mma_chip_info {
>         u8 chip_id;
>         const struct iio_chan_spec *channels;
>         int num_channels;
>         const int mma_scales[3][2];
> +       bool transient_supported;
>  };
> 

I'd avoid boolean and use int and define EVENT_TYPE_TRANSIENT BIT(1) and
EVENT_TYPE_FF_MT BIT(0) for example. So something like 
"supported_event_types"
can have all types supported.

But this has quite some implications on your implementation, so your 
complete
solution would be more interesting to see. Keep it simple and focus on 
only this one
issue of enabling freefall (FF_MT registers) for the devices that 
currently use
transient registers.

thanks

>> 
>> If falling: switch to ff_mt in any case. (fixing freefall for the 
>> transient-devices)
> ok sure.
> 
> Thanks,
> 
> Hari
> 
> On 08/21/2017 04:47 AM, Martin Kepplinger wrote:
>> 
>> If rising: use transient OR ff_mt device-dependent like before. But 
>> now save it in a simple flag,
>> whether transient registers are available.
>> 
>> If falling: switch to ff_mt in any case. (fixing freefall for the 
>> transient-devices)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4]     iio: accel: mma8452: improvements to handle multiple events Harinath Nampally <harinath922@gmail.com> - 2017-08-20 18:10 +0200
  Re: [PATCH v4]     iio: accel: mma8452: improvements to handle  multiple events Martin Kepplinger <martink@posteo.de> - 2017-08-21 10:50 +0200
    Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple  events Harinath Nampally <harinath922@gmail.com> - 2017-08-23 02:40 +0200
      Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple  events Martin Kepplinger <martink@posteo.de> - 2017-08-23 07:00 +0200
        Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple events harinath Nampally <harinath922@gmail.com> - 2017-08-24 04:50 +0200

csiph-web