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,
	jic23@kernel.org, linux-input <linux-input@vger.kernel.org>,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCH 3/3] IO: hid-sensor-magn-3d: Add in support for True/Magnetic North HID usages
Date: Wed, 28 May 2014 14:25:12 -0700	[thread overview]
Message-ID: <53865438.2030901@linux.intel.com> (raw)
In-Reply-To: <CA+BWVUQEsprV1jEzD9D0hidR0jvYeSRVGT=ESzstR4apa+nV1A@mail.gmail.com>

On 05/28/2014 02:15 PM, Reyad Attiyat wrote:
>> +static void sensor_hub_fill_attr_info(
>> +               struct hid_sensor_hub_attribute_info *info,
>> +               s32 index, s32 report_id, struct hid_field *field)
>> +{
>> +       info->index = index;
>> +       info->report_id = report_id;
>> +       info->units = field->unit;
>> +       info->unit_expo = field->unit_exponent;
>> +       info->size = (field->report_size * field->report_count)/8;
>> +       info->logical_minimum = field->logical_minimum;
>> +       info->logical_maximum = field->logical_maximum;
>>   }
> I copied this function from hid/hid-sensor-hub.c as it is marked
> static in that file. I use it to fill attributes as I find them.
> Should I create an another patch to make it non-static?

I didn't check your implementation. But 
sensor_hub_input_get_attribute_info()
function is not enough? We are already using to get other attributes for 
x, y and Z.

Thanks,
Srinivas


>> +       list_for_each_entry(report, &report_enum->report_list, list) {
>> +               for (i = 0; i < report->maxfield; ++i) {
>> +                       field = report->field[i];
>> +
>> +                       for (j = 0; j < field->maxusage; j++) {
>> +                               usage = &(field->usage[j]);
>> +
> This is how I mange to find all possible hid reports in the parse
> reports function. I noticed that in the other function that was used,
> sensor_hub_input_get_attribute_info(),  it only uses field->usage[0].
> Is there a reason for this and should I change my current
> implementation?
>


  reply	other threads:[~2014-05-28 21:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 21:06 [PATCH 0/3] IIO: hid-sensor-magn-3d: Add support for compass north usage attribute Reyad Attiyat
2014-05-28 21:06 ` Reyad Attiyat
2014-05-28 21:06 ` [PATCH 1/3] IIO: Add iio magn_north ABI documentation Reyad Attiyat
2014-05-29 16:46   ` Jonathan Cameron
     [not found]     ` <53876477.7000503-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-06-02 15:54       ` Srinivas Pandruvada
2014-06-02 15:54         ` Srinivas Pandruvada
2014-06-03  1:22     ` Reyad Attiyat
2014-05-28 21:06 ` [PATCH 2/3] IIO: Add iio_chan modifier for True/Magnetic North HID usages Reyad Attiyat
     [not found]   ` <1401311175-12784-3-git-send-email-reyad.attiyat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-31 10:14     ` Jonathan Cameron
2014-05-31 10:14       ` Jonathan Cameron
     [not found]       ` <5389AB89.9080305-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-06-02 19:54         ` Reyad Attiyat
2014-06-02 19:54           ` Reyad Attiyat
2014-05-28 21:06 ` [PATCH 3/3] IO: hid-sensor-magn-3d: Add in support " Reyad Attiyat
2014-05-28 21:15   ` Reyad Attiyat
2014-05-28 21:25     ` Srinivas Pandruvada [this message]
2014-05-28 21:35       ` Reyad Attiyat
2014-05-28 21:56         ` Srinivas Pandruvada
     [not found]           ` <CA+BWVURydjyrnC9ec-POtn5A8gL7C93MH6pObcmmAqD4V=p0Zg@mail.gmail.com>
     [not found]             ` <CA+BWVURydjyrnC9ec-POtn5A8gL7C93MH6pObcmmAqD4V=p0Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-28 21:59               ` Fwd: " Reyad Attiyat
2014-05-28 21:59                 ` Reyad Attiyat

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=53865438.2030901@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.