Re: [PATCH 2/4] iio: hi8435: avoid garbage event at first enable

2017-05-23 Thread Nikita Yushchenko
>> +int ret; >> +u32 tmp; >> + >> +if (state) { >> +ret = hi8435_readl(priv, HI8435_SO31_0_REG, &tmp); >> +if (ret < 0) >> +return ret; >> +if (tmp & BIT(chan->channel)) >> +priv->event_prev_val |= BIT(chan->channel); >> +else >> +

Re: [PATCH 2/4] iio: hi8435: avoid garbage event at first enable

2017-05-22 Thread Vladimir Barinov
Hi Nikita, On 19.05.2017 17:48, Nikita Yushchenko wrote: Currently, driver generates events for channels if new reading differs from previous one. This "previous value" is initialized to zero, which results into event if value is constant-one. Fix that by initializing "previous value" by readin

Re: [PATCH 2/4] iio: hi8435: avoid garbage event at first enable

2017-05-20 Thread Jonathan Cameron
On 19/05/17 15:48, Nikita Yushchenko wrote: Currently, driver generates events for channels if new reading differs from previous one. This "previous value" is initialized to zero, which results into event if value is constant-one. Fix that by initializing "previous value" by reading at event ena

[PATCH 2/4] iio: hi8435: avoid garbage event at first enable

2017-05-19 Thread Nikita Yushchenko
Currently, driver generates events for channels if new reading differs from previous one. This "previous value" is initialized to zero, which results into event if value is constant-one. Fix that by initializing "previous value" by reading at event enable time. This provides reliable sequence for