Re: [PATCH 11/15] iio:adc:ad799x: Add helper function to read/write config register

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

 



> Should this and patch 13 be considered a bug fix?

patch 11 is not a bug fix; the ad799x driver did update the CONF_REG on 
ad7997 and ad7998 only

patch 13 is a bug fix I think; on ad7992/3/4 no channels were ever 
enabled, hence no events

> > ---
> >   drivers/iio/adc/ad799x.c | 24 ++++++++++++++++++++++++
> >   1 file changed, 24 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
> > index dbc7c2b..0219970 100644
> > --- a/drivers/iio/adc/ad799x.c
> > +++ b/drivers/iio/adc/ad799x.c
> > @@ -136,6 +136,30 @@ struct ad799x_state {
> >   	unsigned int			transfer_size;
> >   };
> > 
> > +static int ad799x_write_config(struct ad799x_state *st, u16 val)
> > +{
> > +	switch (st->id) {
> > +	case ad7997:
> > +	case ad7998:
> > +		return i2c_smbus_write_word_swapped(st->client,
> > AD7998_CONF_REG,
> > +			val);
> > +	default:
> > +		return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG,
> > +			val);
> > +	}
> > +}
> > +
> > +static int ad799x_read_config(struct ad799x_state *st)
> > +{
> > +	switch (st->id) {
> > +	case ad7997:
> > +	case ad7998:
> > +		return i2c_smbus_read_word_swapped(st->client,
> > AD7998_CONF_REG);
> > +	default:
> > +		return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG);
> > +	}
> > +}
> > +
> >   /**
> >    * ad799x_trigger_handler() bh of trigger launched polling to ring buffer
> >    *
> > 
> 

-- 

Peter Meerwald
+43-664-2444418 (mobile)
--
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