Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1718788
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | harinath Nampally <harinath922@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4] iio: accel: mma8452: improvements to handle multiple events |
| Date | Thu, 24 Aug 2017 04:50:01 +0200 |
| Message-ID | <uhQnv-tt-3@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> <uhvVL-4pb-13@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0p0LWcLrNLQ83KoRDZtJ5798NgYv7BH9hNOrrr9qBC8=; b=pRNfj5CiOjAoSjozne2gdMNA9A4/Vwo5j94yw7Ie1j8YQuuXRXSxfBm0kGAZc+dTKM b2SpRAPjiEJ58YiAW87NkFdUpgZ92z9/bQfBsbBJDulWQhdLROuldSwgnwDdgj7Z3XSh K4X2wqYLMk7FeNQ4VYb9HLMRfT1qq/P4HvFrLtotSYqD0tY663mezKlxQzM/lkSyRCRz uyXmoMivgwpQuYd81Wqr2Ew0yedoPZV6EeE5v0PbAG9z57juHf/EF5OSWJIRJhPQjEjC nCaDpjp2e4bXtrLr54VoGjZAiMnv8P+1wNwWHBLM+/3NF3jCeMCfr5Nk8zUicPW77Yls gT5Q== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0p0LWcLrNLQ83KoRDZtJ5798NgYv7BH9hNOrrr9qBC8=; b=Wjzulv23YurzNPasvzM3ViWYmLY+QgjqgT87Kky5YYbsU8G+zNBkaiVmXWZ+VSeRzR 5Orj2c2wQebrCekmb1+GPDCXwkxW8bWEzlza9YyXGh+MpKiFRvi/yrGA7i8qlaSw6woz 1ain4bd/mObf2kID20ny4C2sGAV9C8B5P11zoL5i2m38LMjapNh933/yteuv/E5YUCo6 8z94EbrtZminOQcO/U9k27CplvdB3M92g5sa1qmLLG03uZGNvTbWOPjUszJBcY2pgpFw R76qYDAcO9VY0FuTGZ0K2IV4Y+Ss9J1g/Ho5x2cHNp83qd61ALFN8vg9OPKfrGO2CaXk P3vA== |
| X-Gm-Message-State | AHYfb5h2zIXmT5mXVk6hV4V5iCuvuLHgSlB0Oq6mPwMp4CLEoe6ocHCD CpYYQHdFr4aPZJcSyxBRw3qnn4e0ZA== |
| X-Received | by 10.28.56.70 with SMTP id f67mr2740582wma.6.1503542580433; Wed, 23 Aug 2017 19:43:00 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 109 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Jonathan Cameron <jic23@kernel.org>, knaack.h@gmx.de, lars@metafoo.de, Peter Meerwald-Stadler <pmeerw@pmeerw.net>, Greg KH <gregkh@linuxfoundation.org>, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Alison Schofield <amsfield22@gmail.com>, linux-iio-owner@vger.kernel.org |
| X-Original-Date | Wed, 23 Aug 2017 22:42:19 -0400 |
| X-Original-Message-ID | <CAAGUq_pYs58a9p8wY3Qb_pOhRLyVm+JTomzVUxh1pzrOD-aGgA@mail.gmail.com> |
| X-Original-References | <1503245215-12150-1-git-send-email-harinath922@gmail.com> <b5ba8c62743486649f99625d7a43e42b@posteo.de> <99ef70c3-64f0-66eb-5c1a-45a034ead5d5@gmail.com> <d2c0cc909ca48d674c1432233ef02c57@posteo.de> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1718788 |
Show key headers only | 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.
ok sure, I am thinking to adding 'int supported_event_types'(chip
supported events) and 'int enabled_event_types'(events enabled by this
driver for this chip). So in the probe method based on chip specific
'supported_event_types' and 'enabled_event_types' I can configure the
interrupt register accordingly.
> 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.
The main motivation of this patch was to add new events like tap and
orientation for fxls8471, So I would like to
make code changes such a way that it fixes the issue of enabling
freefall(FF_MT registers) for the devices
that currently use transient registers and also make the driver
flexible enough to add multiple new events.
Thanks,
Hari
On Wed, Aug 23, 2017 at 12:52 AM, Martin Kepplinger <martink@posteo.de> wrote:
> 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 | Next — Previous in thread | Find similar | Unroll 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