Re: [PATCH v3 2/2] iio: adc: hx711: Add IIO driver for AVIA HX711

2016-12-20 Thread Lars-Peter Clausen
On 12/20/2016 11:33 AM, Andreas Klinger wrote: >>> +static struct attribute *hx711_attributes[] = { >>> + &iio_dev_attr_gain.dev_attr.attr, >> >> For IIO devices the gain is typically expressed through the scale attribute. >> Which is kind of the inverse of gain. It would be good if this driver >

Re: [PATCH v3 2/2] iio: adc: hx711: Add IIO driver for AVIA HX711

2016-12-20 Thread Andreas Klinger
Hello Lars, thank you for the thorough review. I have some questions. See below. Thanks, Andreas Lars-Peter Clausen schrieb am Mon, 19. Dec 17:28: > On 12/14/2016 05:17 PM, Andreas Klinger wrote: > [...] > > +#include > > +#include > > Since you used the consumer API linux/gpio.h is not n

Re: [PATCH v3 2/2] iio: adc: hx711: Add IIO driver for AVIA HX711

2016-12-19 Thread Jonathan Cameron
On 14/12/16 16:17, Andreas Klinger wrote: > This is the IIO driver for AVIA HX711 ADC which ist mostly used in weighting > cells. > > The protocol is quite simple and using GPIOs: > One GPIO is used as clock (SCK) while another GPIO is read (DOUT) Youch. Controlling the next conversion via the num

Re: [PATCH v3 2/2] iio: adc: hx711: Add IIO driver for AVIA HX711

2016-12-19 Thread Lars-Peter Clausen
On 12/14/2016 05:17 PM, Andreas Klinger wrote: [...] > +#include > +#include Since you used the consumer API linux/gpio.h is not needed. > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define

[PATCH v3 2/2] iio: adc: hx711: Add IIO driver for AVIA HX711

2016-12-14 Thread Andreas Klinger
This is the IIO driver for AVIA HX711 ADC which ist mostly used in weighting cells. The protocol is quite simple and using GPIOs: One GPIO is used as clock (SCK) while another GPIO is read (DOUT) The raw value read from the chip is delivered. To get a weight one needs to subtract the zero offset