All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Reyad Attiyat <reyad.attiyat@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	Jonathan Cameron <jic23@kernel.org>,
	linux-input <linux-input@vger.kernel.org>,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCHv2 3/3] IIO: hid-sensor-magn-3d: Add in support for True/Magnetic North HID usages
Date: Wed, 04 Jun 2014 08:42:34 -0700	[thread overview]
Message-ID: <538F3E6A.4080905@linux.intel.com> (raw)
In-Reply-To: <CA+BWVUTxnS_C+EXm1SuShywk998+E5KfTdtTrS6_a0+k+4U4ig@mail.gmail.com>

On 06/04/2014 08:23 AM, Reyad Attiyat wrote:
> Hey Srinivas,
>
> On Tue, Jun 3, 2014 at 12:43 PM, Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
>
>>
>> May be we should have a field in const struct iio_chan_spec, so that we
>> can dynamically enable disable channels. In this way we can statically
>> define channels, but can be enabled/disabled dynamically.
>>
> Would this require changing iio subsystem to create sysfs entries only
> when enabled? Would we need to add functions to disable and enable
> later on?

This is just a thought. You don't have to change it. I am sure Jonathan 
will have some opinion this.

>>
>> I think we need to present angle in radians. Are you basing change present
>> in linux-next? This will automatically do in this function.
>>
> I'll look into this. What function should I use to make the iio chanel
> to report radians?
I think it will work if the existing sequence is maintained
  st->scale_precision = hid_sensor_format_scale(
                                 HID_USAGE_SENSOR_COMPASS_3D,
                                 &st->magn[CHANNEL_SCAN_INDEX_X],
                                 &st->scale_pre_decml, 
&st->scale_post_decml);

So as long as you call this function, the scale value to user space will
be returned correctly.

>>
>>
>> I don't see kfree. Try devm_kcalloc?
>>
> I changed kmemdup to kcalloc so there is still a kfree in the exsiting
> code. I can change this to devm_kcalloc but only if we don't go with
> static channels that are enabled as found.
>
Since you are changing this part, devm_ calls are preferred, I think.

Thanks,
Srinivas


> Thanks,
> Reyad Attiyat
>


  reply	other threads:[~2014-06-04 15:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 23:14 [PATCHv2 0/3] IIO: Add support for compass north usage attribute Reyad Attiyat
     [not found] ` <1401750890-31854-1-git-send-email-reyad.attiyat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-02 23:14   ` [PATCHv2 1/3] IIO: Documentation: Add north attribute to ABI docs Reyad Attiyat
2014-06-02 23:14     ` Reyad Attiyat
     [not found]     ` <1401750890-31854-2-git-send-email-reyad.attiyat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-09 17:50       ` Jonathan Cameron
2014-06-09 17:50         ` Jonathan Cameron
2014-06-02 23:14   ` [PATCHv2 2/3] IIO: Add iio_chan modifier for True/Magnetic North HID usages Reyad Attiyat
2014-06-02 23:14     ` Reyad Attiyat
2014-06-09 17:51     ` Jonathan Cameron
     [not found]       ` <5395F424.4070407-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-06-09 17:52         ` Jonathan Cameron
2014-06-09 17:52           ` Jonathan Cameron
2014-06-02 23:14 ` [PATCHv2 3/3] IIO: hid-sensor-magn-3d: Add in support " Reyad Attiyat
     [not found]   ` <1401750890-31854-4-git-send-email-reyad.attiyat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-03 17:43     ` Srinivas Pandruvada
2014-06-03 17:43       ` Srinivas Pandruvada
     [not found]       ` <538E092F.9040004-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-06-04 15:23         ` Reyad Attiyat
2014-06-04 15:23           ` Reyad Attiyat
2014-06-04 15:42           ` Srinivas Pandruvada [this message]
2014-06-09 17:47             ` Jonathan Cameron
2014-06-09 17:43         ` Jonathan Cameron
2014-06-09 17:43           ` Jonathan Cameron
2014-06-09 19:55     ` Jonathan Cameron
2014-06-09 19:55       ` Jonathan Cameron
2014-06-10 17:33       ` Reyad Attiyat
2014-06-10 18:29         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538F3E6A.4080905@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=jkosina@suse.cz \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reyad.attiyat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.