OSDN Git Service

iio: adc: hx711: optimize performance in read cycle
authorAndreas Klinger <ak@it-klinger.de>
Mon, 9 Sep 2019 12:37:48 +0000 (14:37 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 22 Oct 2019 11:58:07 +0000 (12:58 +0100)
commit68d8ab3cf1a98e9d296221afdb6433715fd57535
tree475034390dbcbf1afdef5b6ce0c2d9301def02d9
parent1cd92d42dbfff03bdd209fd6ccd5aec395faa915
iio: adc: hx711: optimize performance in read cycle

Set gain in hx711_reset() to its default value after a reset cycle. This
omits one precautionary read cycle, because the read is performed in
hx711_set_gain_for_channel() anyway if gain has changed.

Check for DOUT low and if its high wait some time if it goes down
instead of doing a blind reset cycle when DOUT is not down.

This is a performance optimization which allows to query the sensor with
a higher frequency.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/hx711.c