Re: [PATCH 2/2] iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/18/11 16:06, Michael Hennerich wrote:
> 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@xxxxxxxxxx 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.
Fair enough.  Then we need to fix that.  What is the maximum number you need?
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux