Linux IIO development
 help / color / mirror / Atom feed
From: Michael Hennerich <michael.hennerich@analog.com>
To: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"device-drivers-devel@blackfin.uclinux.org"
	<device-drivers-devel@blackfin.uclinux.org>,
	Drivers <Drivers@analog.com>
Subject: Re: [PATCH 2/2] iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System
Date: Mon, 18 Jul 2011 17:06:40 +0200	[thread overview]
Message-ID: <4E244C00.5090701@analog.com> (raw)
In-Reply-To: <4E2436E0.9060501@analog.com>

On 07/18/2011 03:36 PM, Michael Hennerich wrote:
> On 07/18/2011 02:56 PM, Jonathan Cameron wrote:
>> On 07/18/11 13:48, Michael Hennerich wrote:
>>> On 07/18/2011 01:43 PM, Jonathan Cameron wrote:
>>>> On 07/15/11 13:59, michael.hennerich@analog.com wrote:
>>>>
>> ...
>>>>> +static irqreturn_t ad7280_event_handler(int irq, void *private)
>>>>> +{
>>>>> +     struct iio_dev *dev_info = private;
>>>>> +
>>>>> +     iio_push_event(dev_info, 0,
>>>>> +                    IIO_UNMOD_EVENT_CODE(IIO_IN,
>>>>> +                                         0,
>>>>> +                                         IIO_EV_TYPE_THRESH,
>>>>> +                                         IIO_EV_DIR_EITHER),
>>>>> +                    iio_get_time_ns());
>>>> You have thresholds for temp and voltage below, but only voltage
>>>> event. I wonder if the right thing here is to issue two events
>>>> (subject to what is enabled).  If everything is turned on, there
>>>> doesn't seem to be anyway to tell what happened.  If the event
>>>> is consistent, I guess you could write a strobe function that would
>>>> enable events up the chain and see when it kicked in. That would
>>>> tell you where it came from.  No idea if one ever wants to know though.
>>> Alternatively I could read all channels in the stack and compare
>>> against the set thresholds. I think that would make the most sense here.
>> Good point. That's much simpler.
>>
Actually - I remember why I didn't do that in the first place.
The bits reserved in IIO_EVENT_CODE for the number are not enough.


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



  parent reply	other threads:[~2011-07-18 15:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 12:59 [PATCH 1/2] iio: core: deconstify members of struct iio_chan_spec michael.hennerich
2011-07-15 12:59 ` [PATCH 2/2] iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System michael.hennerich
2011-07-18 11:43   ` Jonathan Cameron
2011-07-18 12:48     ` Michael Hennerich
2011-07-18 12:56       ` Jonathan Cameron
2011-07-18 13:36         ` Michael Hennerich
2011-07-18 13:41           ` Jonathan Cameron
2011-07-18 13:47             ` Michael Hennerich
2011-07-18 15:06           ` Michael Hennerich [this message]
2011-07-18 15:12             ` Jonathan Cameron
2011-07-15 13:19 ` [PATCH 1/2] iio: core: deconstify members of struct iio_chan_spec Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-07-20 13:03 michael.hennerich
2011-07-20 13:03 ` [PATCH 2/2] iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System michael.hennerich
2011-07-20 13:03 ` michael.hennerich

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=4E244C00.5090701@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=Drivers@analog.com \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox