Re: binder stress testing
On Fri, May 17, 2019 at 8:34 PM Todd Kjos wrote: > > On Fri, May 17, 2019 at 5:51 PM Dmitry Vyukov wrote: > > > > > > > > > > > > From: Dmitry Vyukov > > > > > > Date: Fri, May 17, 2019 at 3:26 AM > > > > > > To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos, Martijn Coenen, > > > > > > Joel Fernandes, Christian Brauner, open list:ANDROID DRIVERS, LKML > > > > > > Cc: syzkaller > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > I have 2 questions re drivers/android/binder.c stress testing. > > > > > > > > > > > > > > 1. Are there any docs on the kernel interface? Or some examples > > > > > > > on how > > > > > > > to use it and reference syscall sequences to make it do something > > > > > > > meaningful? > > > > > > > I hopefully figured out struct layouts and offsets of objects > > > > > > > thing, > > > > > > > but I still can't figure out handles, pointers, nodes, pointer to > > > > > > > nodes... pointer to data (?), references, cookies and where does > > > > > > > one > > > > > > > get valid values for these. > > > > > > > > > > > > The kernel interface is not well documented since it isn't intended > > > > > > to > > > > > > be used apart from libbinder. The best example for your purposes is > > > > > > probably the binderDriverInterfaceTest which you can find at > > > > > > https://android.googlesource.com/platform/frameworks/native/+/refs/heads/master/libs/binder/tests/binderDriverInterfaceTest.cpp. > > > > > > > > > > > > The libbinder source is at > > > > > > https://android.googlesource.com/platform/frameworks/native/+/refs/heads/master/libs/binder. > > > > > > > > > > > > > > > > > > > > 2. In my tests any transaction breaks binder device until the > > > > > > > next reboot. > > > > > > > If I open binder device twice, mmap, set context and then the > > > > > > > process > > > > > > > dies, then everything it released fine, in particular the context > > > > > > > (context_mgr_node gone). So the device is ready for a next test: > > > > > > > > > > > > > > [ 40.247970][ T6239] binder: binder_open: 6238:6239 > > > > > > > [ 40.250819][ T6239] binder: 6238:6239 node 1 u > > > > > > > c created > > > > > > > [ 40.253365][ T6239] binder: binder_mmap: 6238 > > > > > > > 200a-200a2000 (8 > > > > > > > K) vma f9 pagep 8025 > > > > > > > [ 40.256454][ T6239] binder: binder_open: 6238:6239 > > > > > > > [ 40.259604][ T6239] binder: binder_mmap: 6238 > > > > > > > 200c-200c2000 (8 > > > > > > > K) vma f9 pagep 8025 > > > > > > > [ 40.271526][ T6238] binder: 6238 close vm area > > > > > > > 200a-200a2000 (8 > > > > > > > K) vma 180200d9 pagep 8025 > > > > > > > [ 40.273113][ T6238] binder: 6238 close vm area > > > > > > > 200c-200c2000 (8 > > > > > > > K) vma 180200d9 pagep 8025 > > > > > > > [ 40.275058][ T17] binder: binder_flush: 6238 woke 0 threads > > > > > > > [ 40.275997][ T17] binder: binder_flush: 6238 woke 0 threads > > > > > > > [ 40.276968][ T17] binder: binder_deferred_release: 6238 > > > > > > > threads > > > > > > > 0, nodes 0 (ref 0), refs 0, active transactions 0 > > > > > > > [ 40.278626][ T17] binder: binder_deferred_release: 6238 > > > > > > > context_mgr_node gone > > > > > > > [ 40.279756][ T17] binder: binder_deferred_release: 6238 > > > > > > > threads > > > > > > > 1, nodes 1 (ref 0), refs 0, active transactions 0 > > > > > > > > > > > > > > > > > > > > > However, if I also send a transaction between these fd's, then > > > > > > > context_mgr_node is not released: > > > > > > > > > > > > > > [ 783.851403][ T6167] binder: binder_open: 6166:6167 > > > > > > > [ 783.858801][ T6167] binder: 6166:6167 node 1 u > > > > > > > c created > > > > > > > [ 783.862458][ T6167] binder: binder_mmap: 6166 > > > > > > > 200a-200a2000 (8 > > > > > > > K) vma f9 pagep 8025 > > > > > > > [ 783.865777][ T6167] binder: binder_open: 6166:6167 > > > > > > > [ 783.867892][ T6167] binder: binder_mmap: 6166 > > > > > > > 200c-200c2000 (8 > > > > > > > K) vma f9 pagep 8025 > > > > > > > [ 783.870810][ T6167] binder: 6166:6167 write 76 at > > > > > > > 2180, > > > > > > > read 0 at 2300 > > > > > > > [ 783.872211][ T6167] binder: 6166:6167 BC_TRANSACTION 2 -> 6166 > > > > > > > - > > > > > > > node 1, data 2200-22c0 size 88-24-16 > > > > > > > [ 783.873819][ T6167] binder: 6166:6167 node 3 u > > > > > > > c created > > > > > > > [ 783.875032][ T6167] binder: 6166 new ref 4 desc 1 for node 3 > > > > > > > [ 783.875860][ T6167] binder: node 3 u > > > > > > > -> ref 4 desc 1 > > > > > > > [ 783.876868][ T6167] binder: 6166:6167 wrote 76 of 76, read > > > > > > > return 0 of 0 > > > > > > > [ 783.886714][ T6167] binder: 6166 close vm area > > > > > > > 200a-200a2000 (8 > > > > >
Re: [PATCH 1/5] iio: adc: ad7606: Move oversampling and scale options to chip info
On Thu, 16 May 2019 17:32:04 +0300 Beniamin Bia wrote: > The device dependent options which are going to be different for devices > which will be supported in the future by this driver, > were moved in chip info for a more generic driver. This patch allows > supporting more devices by the driver. Also, it is an intermediate > step of adding support for ad7616 in software mode. > > Signed-off-by: Beniamin Bia Looks good to me. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/adc/ad7606.c | 61 +--- > drivers/iio/adc/ad7606.h | 15 +- > 2 files changed, 58 insertions(+), 18 deletions(-) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index 24c70c3cefb4..c66ff22f32d2 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -158,7 +158,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > return IIO_VAL_INT; > case IIO_CHAN_INFO_SCALE: > *val = 0; > - *val2 = st->scale_avail[st->range]; > + *val2 = st->scale_avail[st->range[0]]; > return IIO_VAL_INT_PLUS_MICRO; > case IIO_CHAN_INFO_OVERSAMPLING_RATIO: > *val = st->oversampling; > @@ -194,6 +194,32 @@ static ssize_t in_voltage_scale_available_show(struct > device *dev, > > static IIO_DEVICE_ATTR_RO(in_voltage_scale_available, 0); > > +static int ad7606_write_scale_hw(struct iio_dev *indio_dev, int ch, int val) > +{ > + struct ad7606_state *st = iio_priv(indio_dev); > + > + gpiod_set_value(st->gpio_range, val); > + > + return 0; > +} > + > +static int ad7606_write_os_hw(struct iio_dev *indio_dev, int val) > +{ > + struct ad7606_state *st = iio_priv(indio_dev); > + DECLARE_BITMAP(values, 3); > + > + values[0] = val; > + > + gpiod_set_array_value(ARRAY_SIZE(values), st->gpio_os->desc, > + st->gpio_os->info, values); > + > + /* AD7616 requires a reset to update value */ > + if (st->chip_info->os_req_reset) > + ad7606_reset(st); > + > + return 0; > +} > + > static int ad7606_write_raw(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan, > int val, > @@ -201,15 +227,18 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > long mask) > { > struct ad7606_state *st = iio_priv(indio_dev); > - DECLARE_BITMAP(values, 3); > - int i; > + int i, ret, ch = 0; > > switch (mask) { > case IIO_CHAN_INFO_SCALE: > mutex_lock(&st->lock); > i = find_closest(val2, st->scale_avail, st->num_scales); > - gpiod_set_value(st->gpio_range, i); > - st->range = i; > + ret = st->write_scale(indio_dev, chan->address, i); > + if (ret < 0) { > + mutex_unlock(&st->lock); > + return ret; > + } > + st->range[ch] = i; > mutex_unlock(&st->lock); > > return 0; > @@ -218,17 +247,12 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > return -EINVAL; > i = find_closest(val, st->oversampling_avail, >st->num_os_ratios); > - > - values[0] = i; > - > mutex_lock(&st->lock); > - gpiod_set_array_value(ARRAY_SIZE(values), st->gpio_os->desc, > - st->gpio_os->info, values); > - > - /* AD7616 requires a reset to update value */ > - if (st->chip_info->os_req_reset) > - ad7606_reset(st); > - > + ret = st->write_os(indio_dev, i); > + if (ret < 0) { > + mutex_unlock(&st->lock); > + return ret; > + } > st->oversampling = st->oversampling_avail[i]; > mutex_unlock(&st->lock); > > @@ -536,7 +560,7 @@ int ad7606_probe(struct device *dev, int irq, void > __iomem *base_address, > st->bops = bops; > st->base_address = base_address; > /* tied to logic low, analog input range is +/- 5V */ > - st->range = 0; > + st->range[0] = 0; > st->oversampling = 1; > st->scale_avail = ad7606_scale_avail; > st->num_scales = ARRAY_SIZE(ad7606_scale_avail); > @@ -589,6 +613,9 @@ int ad7606_probe(struct device *dev, int irq, void > __iomem *base_address, > if (ret) > dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n"); > > + st->write_scale = ad7606_write_scale_hw; > + st->write_os = ad7606_write_os_hw; > + > st->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", > indio_dev->name, indio_dev->id); > if (!st->trig) > @@ -643,7 +670,7 @@ static int ad7606_resume(str
Re: [PATCH 2/5] iio: adc: ad7606: Add software configuration
On Thu, 16 May 2019 17:32:05 +0300 Beniamin Bia wrote: > Because this driver will support multiple configurations for software, > the software configuration was made generic. > > Signed-off-by: Beniamin Bia Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks Jonathan > --- > drivers/iio/adc/ad7606.c | 40 +--- > drivers/iio/adc/ad7606.h | 2 ++ > 2 files changed, 39 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index c66ff22f32d2..aba0fd123a51 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -140,7 +140,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > int *val2, > long m) > { > - int ret; > + int ret, ch = 0; > struct ad7606_state *st = iio_priv(indio_dev); > > switch (m) { > @@ -157,8 +157,10 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > *val = (short)ret; > return IIO_VAL_INT; > case IIO_CHAN_INFO_SCALE: > + if (st->sw_mode_en) > + ch = chan->address; > *val = 0; > - *val2 = st->scale_avail[st->range[0]]; > + *val2 = st->scale_avail[st->range[ch]]; > return IIO_VAL_INT_PLUS_MICRO; > case IIO_CHAN_INFO_OVERSAMPLING_RATIO: > *val = st->oversampling; > @@ -233,7 +235,9 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > case IIO_CHAN_INFO_SCALE: > mutex_lock(&st->lock); > i = find_closest(val2, st->scale_avail, st->num_scales); > - ret = st->write_scale(indio_dev, chan->address, i); > + if (st->sw_mode_en) > + ch = chan->address; > + ret = st->write_scale(indio_dev, ch, i); > if (ret < 0) { > mutex_unlock(&st->lock); > return ret; > @@ -616,6 +620,36 @@ int ad7606_probe(struct device *dev, int irq, void > __iomem *base_address, > st->write_scale = ad7606_write_scale_hw; > st->write_os = ad7606_write_os_hw; > > + if (st->chip_info->sw_mode_config) > + st->sw_mode_en = device_property_present(st->dev, > + "adi,sw-mode"); > + > + if (st->sw_mode_en) { > + /* After reset, in software mode, ±10 V is set by default */ > + memset32(st->range, 2, ARRAY_SIZE(st->range)); > + indio_dev->info = &ad7606_info_os_and_range; > + > + /* > + * In software mode, the range gpio has no longer its function. > + * Instead, the scale can be configured individually for each > + * channel from the range registers. > + */ > + if (st->chip_info->write_scale_sw) > + st->write_scale = st->chip_info->write_scale_sw; > + > + /* > + * In software mode, the oversampling is no longer configured > + * with GPIO pins. Instead, the oversampling can be configured > + * in configuratiion register. > + */ > + if (st->chip_info->write_os_sw) > + st->write_os = st->chip_info->write_os_sw; > + > + ret = st->chip_info->sw_mode_config(indio_dev); > + if (ret < 0) > + return ret; > + } > + > st->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", > indio_dev->name, indio_dev->id); > if (!st->trig) > diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h > index 143c30163df9..d8a509c2c428 100644 > --- a/drivers/iio/adc/ad7606.h > +++ b/drivers/iio/adc/ad7606.h > @@ -43,6 +43,7 @@ struct ad7606_chip_info { > * @rangevoltage range selection, selects which scale to apply > * @oversampling oversampling selection > * @base_address address from where to read data in parallel operation > + * @sw_mode_en software mode enabled > * @scale_avail pointer to the array which stores the available > scales > * @num_scales number of elements stored in the scale_avail > array > * @oversampling_avail pointer to the array which stores the available > @@ -71,6 +72,7 @@ struct ad7606_state { > unsigned intrange[16]; > unsigned intoversampling; > void __iomem*base_address; > + boolsw_mode_en; > const unsigned int *scale_avail; > unsigned intnum_scales; > const unsigned int *oversampling_avail; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinf
Re: [PATCH 3/5] iio: adc: ad7606: Make SPI register calculation generic and add spi support
On Thu, 16 May 2019 17:32:06 +0300 Beniamin Bia wrote: > In order to support AD7616 software mode, the spi register access must be > added and the calculation of registers address must be generic. > The length of address and bit which specifies the read/write operation is > different for every device, that is why it was made generic. > > Signed-off-by: Beniamin Bia The break up patches has ended up a little odd. This one introduced unused functions for example. Probably best to merge this and the next patch. As a potential follow up, could this driver just use a 16 bit word length and avoid some of the endian handling? (this might also fix the casting issues). However, there are some nasty casts in here that sparse is unhappy about. I would definitely like those cleaned up before we add more of them. If changing to 16bit SPI words doesn't do the job, then perhaps we have to have a be16 version of data (as a union to avoid more space usage). Thanks, Jonathan > --- > drivers/iio/adc/ad7606.c | 60 > drivers/iio/adc/ad7606.h | 2 ++ > 2 files changed, 62 insertions(+) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index aba0fd123a51..6df81117cacc 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -25,6 +25,8 @@ > #include > #include > > +#include > + > #include "ad7606.h" > > /* > @@ -43,6 +45,11 @@ static const unsigned int ad7616_oversampling_avail[8] = { > 1, 2, 4, 8, 16, 32, 64, 128, > }; > > +static int ad7616_spi_rd_wr_cmd(int addr, char isWriteOp) > +{ > + return ((addr & 0x7F) << 1) | ((isWriteOp & 0x1) << 7); > +} > + > static int ad7606_reset(struct ad7606_state *st) > { > if (st->gpio_reset) { > @@ -55,6 +62,59 @@ static int ad7606_reset(struct ad7606_state *st) > return -ENODEV; > } > > +static int ad7606_spi_reg_read(struct ad7606_state *st, unsigned int addr) > +{ > + struct spi_device *spi = to_spi_device(st->dev); > + struct spi_transfer t[] = { > + { > + .tx_buf = &st->data[0], > + .len = 2, > + .cs_change = 0, > + }, { > + .rx_buf = &st->data[1], > + .len = 2, > + }, > + }; > + int ret; > + > + st->data[0] = cpu_to_be16(st->chip_info->spi_rd_wr_cmd(addr, 0) << 8); > + > + ret = spi_sync_transfer(spi, t, ARRAY_SIZE(t)); > + if (ret < 0) > + return ret; > + > + return be16_to_cpu(st->data[1]); > +} > + > +static int ad7606_spi_reg_write(struct ad7606_state *st, > + unsigned int addr, > + unsigned int val) > +{ > + struct spi_device *spi = to_spi_device(st->dev); > + > + st->data[0] = cpu_to_be16((st->chip_info->spi_rd_wr_cmd(addr, 1) << 8) | > + (val & 0x1FF)); > + > + return spi_write(spi, &st->data[0], sizeof(st->data[0])); > +} > + > +static int ad7606_spi_write_mask(struct ad7606_state *st, > + unsigned int addr, > + unsigned long mask, > + unsigned int val) > +{ > + int readval; > + > + readval = ad7606_spi_reg_read(st, addr); > + if (readval < 0) > + return readval; > + > + readval &= ~mask; > + readval |= val; > + > + return ad7606_spi_reg_write(st, addr, readval); > +} > + > static int ad7606_read_samples(struct ad7606_state *st) > { > unsigned int num = st->chip_info->num_channels; > diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h > index d8a509c2c428..dfc60af9b8ac 100644 > --- a/drivers/iio/adc/ad7606.h > +++ b/drivers/iio/adc/ad7606.h > @@ -16,6 +16,7 @@ > * oversampling ratios. > * @oversampling_num number of elements stored in oversampling_avail array > * @os_req_reset some devices require a reset to update oversampling > + * @spi_rd_wr_cmdpointer to the function which calculates the spi address > * @write_scale_sw pointer to the function which writes the scale via spi > in software mode > * @write_os_sw pointer to the function which writes the os via > spi > @@ -29,6 +30,7 @@ struct ad7606_chip_info { > const unsigned int *oversampling_avail; > unsigned intoversampling_num; > boolos_req_reset; > + int (*spi_rd_wr_cmd)(int addr, char isWriteOp); > int (*write_scale_sw)(struct iio_dev *indio_dev, int ch, int val); > int (*write_os_sw)(struct iio_dev *indio_dev, int val); > int (*sw_mode_config)(struct iio_dev *indio_dev); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/5] iio: adc: ad7606: Add support for software mode for ad7616
On Thu, 16 May 2019 17:32:07 +0300 Beniamin Bia wrote: > Support for ad7616 running in software was added. In order > to activate the software mode, HW_RNGSEL pins must be pulled low. > Oversampling and input ranges are now configured in corresponding > registers. Ad7616 has multiple scale options when it is configured > in software mode. > > Signed-off-by: Beniamin Bia Looks good subject to comments on the previous. Thanks, Jonathan > --- > drivers/iio/adc/ad7606.c | 111 --- > 1 file changed, 103 insertions(+), 8 deletions(-) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index 6df81117cacc..f77df3efe43f 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -29,6 +29,20 @@ > > #include "ad7606.h" > > +#define AD7606_RANGE_CH_ADDR(ch) (0x03 + ((ch) >> 1)) > +#define AD7606_OS_MODE 0x08 > + > +#define AD7616_CONFIGURATION_REGISTER0x02 > +#define AD7616_OS_MASK GENMASK(4, 2) > +#define AD7616_BURST_MODEBIT(6) > +#define AD7616_SEQEN_MODEBIT(5) > +#define AD7616_RANGE_CH_ADDR_OFF 0x04 > +#define AD7616_RANGE_CH_ADDR(ch) ch) & 0x1) << 1) + ((ch) >> 3)) > +#define AD7616_RANGE_CH_MSK(ch) (GENMASK(1, 0) << ((ch) & 0x6)) > +#define AD7616_RANGE_CH_MODE(ch, mode) ((mode) << (ch & GENMASK(2, 1))) > + > +static int ad7616_sw_mode_config(struct iio_dev *indio_dev); > + > /* > * Scales are computed as 5000/32768 and 1/32768 respectively, > * so that when applied to the raw values they provide mV values > @@ -37,6 +51,11 @@ static const unsigned int ad7606_scale_avail[2] = { > 152588, 305176 > }; > > + > +static const unsigned int ad7616_sw_scale_avail[3] = { > + 76293, 152588, 305176 > +}; > + > static const unsigned int ad7606_oversampling_avail[7] = { > 1, 2, 4, 8, 16, 32, 64, > }; > @@ -282,6 +301,26 @@ static int ad7606_write_os_hw(struct iio_dev *indio_dev, > int val) > return 0; > } > > +static int ad7616_write_scale_sw(struct iio_dev *indio_dev, int ch, int val) > +{ > + struct ad7606_state *st = iio_priv(indio_dev); > + unsigned int ch_addr, mode; > + > + ch_addr = AD7616_RANGE_CH_ADDR_OFF + AD7616_RANGE_CH_ADDR(ch); > + mode = AD7616_RANGE_CH_MODE(ch, ((val + 1) & 0x3)); > + > + return ad7606_spi_write_mask(st, ch_addr, AD7616_RANGE_CH_MSK(ch), > + mode); > +} > + > +static int ad7616_write_os_sw(struct iio_dev *indio_dev, int val) > +{ > + struct ad7606_state *st = iio_priv(indio_dev); > + > + return ad7606_spi_write_mask(st, AD7616_CONFIGURATION_REGISTER, > + AD7616_OS_MASK, val << 2); > +} > + > static int ad7606_write_raw(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan, > int val, > @@ -368,14 +407,14 @@ static const struct attribute_group > ad7606_attribute_group_range = { > .attrs = ad7606_attributes_range, > }; > > -#define AD760X_CHANNEL(num, mask) { \ > +#define AD760X_CHANNEL(num, mask_sep, mask_type, mask_all) { \ > .type = IIO_VOLTAGE,\ > .indexed = 1, \ > .channel = num, \ > .address = num, \ > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ > - .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\ > - .info_mask_shared_by_all = mask,\ > + .info_mask_separate = mask_sep, \ > + .info_mask_shared_by_type = mask_type, \ > + .info_mask_shared_by_all = mask_all,\ > .scan_index = num, \ > .scan_type = { \ > .sign = 's',\ > @@ -385,11 +424,18 @@ static const struct attribute_group > ad7606_attribute_group_range = { > }, \ > } > > -#define AD7605_CHANNEL(num) \ > - AD760X_CHANNEL(num, 0) > +#define AD7605_CHANNEL(num) \ > + AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_RAW), \ > + BIT(IIO_CHAN_INFO_SCALE), 0) > + > +#define AD7606_CHANNEL(num) \ > + AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_RAW), \ > + BIT(IIO_CHAN_INFO_SCALE), \ > + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO)) > > -#define AD7606_CHANNEL(num) \ > - AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO)) > +#define AD7616_CHANNEL(num) \ > + AD760X_CHANNEL(num, BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),\ > + 0, BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO)) > > sta
Re: [PATCH 1/5] iio: adc: ad7606: Move oversampling and scale options to chip info
On Sat, 18 May 2019 11:04:49 +0100 Jonathan Cameron wrote: > On Thu, 16 May 2019 17:32:04 +0300 > Beniamin Bia wrote: > > > The device dependent options which are going to be different for devices > > which will be supported in the future by this driver, > > were moved in chip info for a more generic driver. This patch allows > > supporting more devices by the driver. Also, it is an intermediate > > step of adding support for ad7616 in software mode. > > > > Signed-off-by: Beniamin Bia > Looks good to me. > > Applied to the togreg branch of iio.git and pushed out as testing for > the autobuilders to play with it. Actually, as this only makes sense with the later patches, I'm going to back this out until those are ready. For reference though add Acked-by: Jonathan Cameron to v2. Thanks Jonathan > > Thanks, > > Jonathan > > > --- > > drivers/iio/adc/ad7606.c | 61 +--- > > drivers/iio/adc/ad7606.h | 15 +- > > 2 files changed, 58 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > > index 24c70c3cefb4..c66ff22f32d2 100644 > > --- a/drivers/iio/adc/ad7606.c > > +++ b/drivers/iio/adc/ad7606.c > > @@ -158,7 +158,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > > return IIO_VAL_INT; > > case IIO_CHAN_INFO_SCALE: > > *val = 0; > > - *val2 = st->scale_avail[st->range]; > > + *val2 = st->scale_avail[st->range[0]]; > > return IIO_VAL_INT_PLUS_MICRO; > > case IIO_CHAN_INFO_OVERSAMPLING_RATIO: > > *val = st->oversampling; > > @@ -194,6 +194,32 @@ static ssize_t in_voltage_scale_available_show(struct > > device *dev, > > > > static IIO_DEVICE_ATTR_RO(in_voltage_scale_available, 0); > > > > +static int ad7606_write_scale_hw(struct iio_dev *indio_dev, int ch, int > > val) > > +{ > > + struct ad7606_state *st = iio_priv(indio_dev); > > + > > + gpiod_set_value(st->gpio_range, val); > > + > > + return 0; > > +} > > + > > +static int ad7606_write_os_hw(struct iio_dev *indio_dev, int val) > > +{ > > + struct ad7606_state *st = iio_priv(indio_dev); > > + DECLARE_BITMAP(values, 3); > > + > > + values[0] = val; > > + > > + gpiod_set_array_value(ARRAY_SIZE(values), st->gpio_os->desc, > > + st->gpio_os->info, values); > > + > > + /* AD7616 requires a reset to update value */ > > + if (st->chip_info->os_req_reset) > > + ad7606_reset(st); > > + > > + return 0; > > +} > > + > > static int ad7606_write_raw(struct iio_dev *indio_dev, > > struct iio_chan_spec const *chan, > > int val, > > @@ -201,15 +227,18 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > > long mask) > > { > > struct ad7606_state *st = iio_priv(indio_dev); > > - DECLARE_BITMAP(values, 3); > > - int i; > > + int i, ret, ch = 0; > > > > switch (mask) { > > case IIO_CHAN_INFO_SCALE: > > mutex_lock(&st->lock); > > i = find_closest(val2, st->scale_avail, st->num_scales); > > - gpiod_set_value(st->gpio_range, i); > > - st->range = i; > > + ret = st->write_scale(indio_dev, chan->address, i); > > + if (ret < 0) { > > + mutex_unlock(&st->lock); > > + return ret; > > + } > > + st->range[ch] = i; > > mutex_unlock(&st->lock); > > > > return 0; > > @@ -218,17 +247,12 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > > return -EINVAL; > > i = find_closest(val, st->oversampling_avail, > > st->num_os_ratios); > > - > > - values[0] = i; > > - > > mutex_lock(&st->lock); > > - gpiod_set_array_value(ARRAY_SIZE(values), st->gpio_os->desc, > > - st->gpio_os->info, values); > > - > > - /* AD7616 requires a reset to update value */ > > - if (st->chip_info->os_req_reset) > > - ad7606_reset(st); > > - > > + ret = st->write_os(indio_dev, i); > > + if (ret < 0) { > > + mutex_unlock(&st->lock); > > + return ret; > > + } > > st->oversampling = st->oversampling_avail[i]; > > mutex_unlock(&st->lock); > > > > @@ -536,7 +560,7 @@ int ad7606_probe(struct device *dev, int irq, void > > __iomem *base_address, > > st->bops = bops; > > st->base_address = base_address; > > /* tied to logic low, analog input range is +/- 5V */ > > - st->range = 0; > > + st->range[0] = 0; > > st->oversampling = 1; > > st->scale_avail = ad7606_scale_avail; > > st->num_scales = ARRAY_SIZE(ad7606_scale_avail); > > @@ -589,6 +613,9 @@ int ad7606_probe(struct device *dev, int irq, void > > __iomem *base_address, > > if (ret) > >
Re: [PATCH 2/5] iio: adc: ad7606: Add software configuration
On Sat, 18 May 2019 11:07:49 +0100 Jonathan Cameron wrote: > On Thu, 16 May 2019 17:32:05 +0300 > Beniamin Bia wrote: > > > Because this driver will support multiple configurations for software, > > the software configuration was made generic. > > > > Signed-off-by: Beniamin Bia > Applied to the togreg branch of iio.git and pushed out as testing for > the autobuilders to play with it. As with patch 1, I've backed this out for now as it doesn't make sense with the later. For reference please add. Acked-by: Jonathan Cameron Thanks, Jonathan > > Thanks > > Jonathan > > > --- > > drivers/iio/adc/ad7606.c | 40 +--- > > drivers/iio/adc/ad7606.h | 2 ++ > > 2 files changed, 39 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > > index c66ff22f32d2..aba0fd123a51 100644 > > --- a/drivers/iio/adc/ad7606.c > > +++ b/drivers/iio/adc/ad7606.c > > @@ -140,7 +140,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > >int *val2, > >long m) > > { > > - int ret; > > + int ret, ch = 0; > > struct ad7606_state *st = iio_priv(indio_dev); > > > > switch (m) { > > @@ -157,8 +157,10 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, > > *val = (short)ret; > > return IIO_VAL_INT; > > case IIO_CHAN_INFO_SCALE: > > + if (st->sw_mode_en) > > + ch = chan->address; > > *val = 0; > > - *val2 = st->scale_avail[st->range[0]]; > > + *val2 = st->scale_avail[st->range[ch]]; > > return IIO_VAL_INT_PLUS_MICRO; > > case IIO_CHAN_INFO_OVERSAMPLING_RATIO: > > *val = st->oversampling; > > @@ -233,7 +235,9 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, > > case IIO_CHAN_INFO_SCALE: > > mutex_lock(&st->lock); > > i = find_closest(val2, st->scale_avail, st->num_scales); > > - ret = st->write_scale(indio_dev, chan->address, i); > > + if (st->sw_mode_en) > > + ch = chan->address; > > + ret = st->write_scale(indio_dev, ch, i); > > if (ret < 0) { > > mutex_unlock(&st->lock); > > return ret; > > @@ -616,6 +620,36 @@ int ad7606_probe(struct device *dev, int irq, void > > __iomem *base_address, > > st->write_scale = ad7606_write_scale_hw; > > st->write_os = ad7606_write_os_hw; > > > > + if (st->chip_info->sw_mode_config) > > + st->sw_mode_en = device_property_present(st->dev, > > +"adi,sw-mode"); > > + > > + if (st->sw_mode_en) { > > + /* After reset, in software mode, ±10 V is set by default */ > > + memset32(st->range, 2, ARRAY_SIZE(st->range)); > > + indio_dev->info = &ad7606_info_os_and_range; > > + > > + /* > > +* In software mode, the range gpio has no longer its function. > > +* Instead, the scale can be configured individually for each > > +* channel from the range registers. > > +*/ > > + if (st->chip_info->write_scale_sw) > > + st->write_scale = st->chip_info->write_scale_sw; > > + > > + /* > > +* In software mode, the oversampling is no longer configured > > +* with GPIO pins. Instead, the oversampling can be configured > > +* in configuratiion register. > > +*/ > > + if (st->chip_info->write_os_sw) > > + st->write_os = st->chip_info->write_os_sw; > > + > > + ret = st->chip_info->sw_mode_config(indio_dev); > > + if (ret < 0) > > + return ret; > > + } > > + > > st->trig = devm_iio_trigger_alloc(dev, "%s-dev%d", > > indio_dev->name, indio_dev->id); > > if (!st->trig) > > diff --git a/drivers/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h > > index 143c30163df9..d8a509c2c428 100644 > > --- a/drivers/iio/adc/ad7606.h > > +++ b/drivers/iio/adc/ad7606.h > > @@ -43,6 +43,7 @@ struct ad7606_chip_info { > > * @range voltage range selection, selects which scale to apply > > * @oversampling oversampling selection > > * @base_address address from where to read data in parallel operation > > + * @sw_mode_en software mode enabled > > * @scale_availpointer to the array which stores the available > > scales > > * @num_scales number of elements stored in the scale_avail > > array > > * @oversampling_avail pointer to the array which stores the available > > @@ -71,6 +72,7 @@ struct ad7606_state { > > unsigned intrange[16]; > > unsigned intoversampling; > > void __iomem*base_address; > > + boolsw_mode_en; > >
Re: [PATCH 5/5] iio: adc: ad7606: Add debug mode for ad7616
On Thu, 16 May 2019 17:32:08 +0300 Beniamin Bia wrote: > Support for register access was added for spi devices. > > Signed-off-by: Beniamin Bia Looks fine. For my reference please add Acked-by: Jonathan Cameron > --- > drivers/iio/adc/ad7606.c | 25 + > 1 file changed, 25 insertions(+) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index f77df3efe43f..b03bdce4fd4e 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -134,6 +134,30 @@ static int ad7606_spi_write_mask(struct ad7606_state *st, > return ad7606_spi_reg_write(st, addr, readval); > } > > +static int ad7606_reg_access(struct iio_dev *indio_dev, > + unsigned int reg, > + unsigned int writeval, > + unsigned int *readval) > +{ > + struct ad7606_state *st = iio_priv(indio_dev); > + int ret; > + > + mutex_lock(&st->lock); > + if (readval) { > + ret = ad7606_spi_reg_read(st, reg); > + if (ret < 0) > + goto err_unlock; > + *readval = ret; > + ret = 0; > + } else { > + ret = ad7606_spi_reg_write(st, reg, writeval); > + } > +err_unlock: > + mutex_unlock(&st->lock); > + > + return ret; > +} > + > static int ad7606_read_samples(struct ad7606_state *st) > { > unsigned int num = st->chip_info->num_channels; > @@ -645,6 +669,7 @@ static const struct iio_info ad7606_info_no_os_or_range = > { > static const struct iio_info ad7606_info_os_and_range = { > .read_raw = &ad7606_read_raw, > .write_raw = &ad7606_write_raw, > + .debugfs_reg_access = &ad7606_reg_access, > .attrs = &ad7606_attribute_group_os_and_range, > .validate_trigger = &ad7606_validate_trigger, > }; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
開发镖
187口2162口1564嶶 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
fix below warning reported by coccicheck drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Signed-off-by: Hariprasad Kelam --- drivers/staging/erofs/unzip_pagevec.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h index f37d8fd..0f61c54 100644 --- a/drivers/staging/erofs/unzip_pagevec.h +++ b/drivers/staging/erofs/unzip_pagevec.h @@ -70,8 +70,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor, return tagptr_unfold_ptr(t); } - if (unlikely(nr >= ctor->nr)) - BUG(); + BUG_ON(nr >= ctor->nr); return NULL; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: imx: fix Unneeded variable: "ret". Return "0"
fix below warning reported by coccichec drivers/staging/media/imx/imx-media-capture.c:617:5-8: Unneeded variable: "ret". Return "0" on line 630 Signed-off-by: Hariprasad Kelam --- drivers/staging/media/imx/imx-media-capture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 9430c83..b678857 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -614,7 +614,6 @@ static int capture_release(struct file *file) struct capture_priv *priv = video_drvdata(file); struct video_device *vfd = priv->vdev.vfd; struct vb2_queue *vq = &priv->q; - int ret = 0; mutex_lock(&priv->mutex); @@ -627,7 +626,7 @@ static int capture_release(struct file *file) v4l2_fh_release(file); mutex_unlock(&priv->mutex); - return ret; + return 0; } static const struct v4l2_file_operations capture_fops = { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] media: cedrus: Allow different mod clock rates
Some VPU variants may run at higher clock speeds. They actually need extra speed to be capable of decoding more complex codecs like HEVC or bigger image sizes (4K). Expand variant structure with mod_rate information. Signed-off-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus.c| 11 --- drivers/staging/media/sunxi/cedrus/cedrus.h| 1 + drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_hw.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index d0429c0e6b6b..9349a082a29c 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -369,36 +369,41 @@ static int cedrus_remove(struct platform_device *pdev) } static const struct cedrus_variant sun4i_a10_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 32000, }; static const struct cedrus_variant sun5i_a13_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 32000, }; static const struct cedrus_variant sun7i_a20_cedrus_variant = { - /* No particular capability. */ + .mod_rate = 32000, }; static const struct cedrus_variant sun8i_a33_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 32000, }; static const struct cedrus_variant sun8i_h3_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 40200, }; static const struct cedrus_variant sun50i_a64_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 40200, }; static const struct cedrus_variant sun50i_h5_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, + .mod_rate = 40200, }; static const struct cedrus_variant sun50i_h6_cedrus_variant = { .capabilities = CEDRUS_CAPABILITY_UNTILED, .quirks = CEDRUS_QUIRK_NO_DMA_OFFSET, + .mod_rate = 6, }; static const struct of_device_id cedrus_dt_match[] = { diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h index c57c04b41d2e..25ee1f80f2c7 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -94,6 +94,7 @@ struct cedrus_dec_ops { struct cedrus_variant { unsigned intcapabilities; unsigned intquirks; + unsigned intmod_rate; }; struct cedrus_dev { diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index fbfff7c1c771..60406b2d4595 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -236,7 +236,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev) goto err_sram; } - ret = clk_set_rate(dev->mod_clk, CEDRUS_CLOCK_RATE_DEFAULT); + ret = clk_set_rate(dev->mod_clk, variant->mod_rate); if (ret) { dev_err(dev->dev, "Failed to set clock rate\n"); diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h index b43c77d54b95..27d0882397aa 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.h @@ -16,8 +16,6 @@ #ifndef _CEDRUS_HW_H_ #define _CEDRUS_HW_H_ -#define CEDRUS_CLOCK_RATE_DEFAULT 32000 - int cedrus_engine_enable(struct cedrus_dev *dev, enum cedrus_codec codec); void cedrus_engine_disable(struct cedrus_dev *dev); -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Investment Opportunity
Good Day, I am Barrister Geoffrey Dawson, legal Attorney to the immediate past President of the Republic of South Africa Mr. Jacob G. Zuma. I am using this medium to request for your assistance and partnership of $50 Million business investment program. This fund is presently deposited with the Barclays Bank in the United Kingdom. This is where you come in to take over the ownership of this said fund to be backed with legal documents from my legal firm. Your assistance is urgently needed to secure the said fund and invest same in any business invest program that is legal and profitable. He is offering 30% of the total sum for your partnership and 70% will be for my client. I assure you that this transaction is risk-free and 100% legal. As an Attorney, I will not be part of anything illegal in my life after years of legal practice. As a former head of state, my client cannot afford to work on this project personally or with persons close to him as anyone around betrayed him in the past and that is why I have been instructed with the mandate to find a foreign partner, secure and invest the funds. To make matters worse, he has been Diagnosed of Lung Cancer and he is hospitalized at the moment. You are also advised to reply swiftly if this proposal is acceptable to you with the requested details: Full names: Home address: Phone number: Occupation: Age: I will send you the relevant fund deposit documentations for your confirmation upon your reply. These same details will be used for the partnership agreement and legal Power of Attorney that will give you the legal right to the fund. Please know this transaction needs almost confidentiality. Looking forward to hearing from you soonest. Thank you. Yours in Service, Barrister Geoffrey Dawson Beach House, Bay View Road, Port St Mary, Isle of Man IM9 5AE, United Kingdom. Reply Email: grahamjoneschamb...@wildblue.net ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: ad9832: Add device tree support
Add a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to support device tree. Signed-off-by: João Seckler Signed-off-by: Anderson Reis Co-developed-by: Anderson Reis Signed-off-by: Andre Tadeu de Carvalho Co-developed-by: Andre Tadeu de Carvalho --- drivers/staging/iio/frequency/ad9832.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index 74308a2e72db..51e97c74c6b2 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -451,6 +451,13 @@ static int ad9832_remove(struct spi_device *spi) return 0; } +static const struct of_device_id ad9832_of_match[] = { + { .compatible = "adi,ad9832", }, + { .compatible = "adi,ad9835", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, ad9832_of_match); + static const struct spi_device_id ad9832_id[] = { {"ad9832", 0}, {"ad9835", 0}, -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: media: imx: fix Unneeded variable: "ret". Return "0"
On Sat, May 18, 2019 at 2:38 PM Hariprasad Kelam wrote: > > fix below warning reported by coccichec > > drivers/staging/media/imx/imx-media-capture.c:617:5-8: Unneeded > variable: "ret". Return "0" on line 630 > > Signed-off-by: Hariprasad Kelam Reviewed-by: Fabio Estevam Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: adis16240: add device to module device table
Add a of_device_id struct and MODULE_DEVICE_TABLE call. Signed-off-by: Lucas Oshiro Signed-off-by: Rodrigo Ribeiro Co-developed-by: Rodrigo Ribeiro --- drivers/staging/iio/accel/adis16240.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c index b80e0d248b0f..8c6d23604eca 100644 --- a/drivers/staging/iio/accel/adis16240.c +++ b/drivers/staging/iio/accel/adis16240.c @@ -435,6 +435,12 @@ static int adis16240_remove(struct spi_device *spi) return 0; } +static const struct of_device_id adis16240_of_match[] = { + { .compatible = "adi,adis16240" }, + { }, +}; +MODULE_DEVICE_TABLE(of, adis16240_of_match); + static struct spi_driver adis16240_driver = { .driver = { .name = "adis16240", -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: iio: adis16240: add device to module device table
Hi Lucas, On Sat, May 18, 2019 at 6:01 PM Lucas Oshiro wrote: > > Add a of_device_id struct and MODULE_DEVICE_TABLE call. Please provide an explanation as to why you are doing this. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: iio: adis16240: add device to module device table
Add a of_device_id struct and MODULE_DEVICE_TABLE call, in order to add device-tree support for this driver. Signed-off-by: Lucas Oshiro Signed-off-by: Rodrigo Ribeiro Co-developed-by: Rodrigo Ribeiro --- drivers/staging/iio/accel/adis16240.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c index b80e0d248b0f..8c6d23604eca 100644 --- a/drivers/staging/iio/accel/adis16240.c +++ b/drivers/staging/iio/accel/adis16240.c @@ -435,6 +435,12 @@ static int adis16240_remove(struct spi_device *spi) return 0; } +static const struct of_device_id adis16240_of_match[] = { + { .compatible = "adi,adis16240" }, + { }, +}; +MODULE_DEVICE_TABLE(of, adis16240_of_match); + static struct spi_driver adis16240_driver = { .driver = { .name = "adis16240", -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: iio: ad2s1210: Destroy mutex at remove
Ensure the mutex will be destroyed on drive removal. Also adds mutex comment description. Signed-off-by: Tallys Martins Signed-off-by: Souza Guilherme Co-developed-by: Souza Guilherme --- drivers/staging/iio/resolver/ad2s1210.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c index b6be0bc202f5..b91cf57c5e57 100644 --- a/drivers/staging/iio/resolver/ad2s1210.c +++ b/drivers/staging/iio/resolver/ad2s1210.c @@ -86,7 +86,7 @@ static const struct ad2s1210_gpio gpios[] = { static const unsigned int ad2s1210_resolution_value[] = { 10, 12, 14, 16 }; struct ad2s1210_state { - struct mutex lock; + struct mutex lock; /* lock to protect the state on r/w operations */ struct spi_device *sdev; struct gpio_desc *gpios[5]; unsigned int fclkin; @@ -689,8 +689,10 @@ static int ad2s1210_probe(struct spi_device *spi) static int ad2s1210_remove(struct spi_device *spi) { struct iio_dev *indio_dev = spi_get_drvdata(spi); + struct ad2s1210_state *ad2s1210_ad = iio_priv(indio_dev); iio_device_unregister(indio_dev); + mutex_destroy(&ad2s1210_ad->lock); return 0; } -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: iio: ad2s1210: Add devicetree yaml doc
The driver currently has no devicetree documentation. This commit adds a devicetree folder and documentation for it. Documentation must be moved as well when the driver gets out of staging. Signed-off-by: Tallys Martins Signed-off-by: Souza Guilherme Co-developed-by: Souza Guilherme --- .../Documentation/devicetree/ad2s1210.yaml| 41 +++ 1 file changed, 41 insertions(+) create mode 100644 drivers/staging/iio/Documentation/devicetree/ad2s1210.yaml diff --git a/drivers/staging/iio/Documentation/devicetree/ad2s1210.yaml b/drivers/staging/iio/Documentation/devicetree/ad2s1210.yaml new file mode 100644 index ..733aa07b4626 --- /dev/null +++ b/drivers/staging/iio/Documentation/devicetree/ad2s1210.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/iio/ad2s1210.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: | + Analog Devices Inc. AD2S1210 10-Bit to 16-Bit R/D Converters + +maintainers: + - Graff Yang + +description: | + Analog Devices AD2S1210 Resolver to Digital SPI driver + + https://www.analog.com/en/products/ad2s1210.html + +properties: + compatible: +enum: + - adi,ad2s1210 + + reg: +maxItems: 1 + + clock-frequency: +minimum: 2000 +maximum: 2 +default: 8192 + +required: + - compatible + - reg + +examples: + - | + resolver@0 { +compatible = "adi,ad2s1210"; +reg = <0>; + }; +... -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: ad7746: add device tree support
Add a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to support device tree. Signed-off-by: João Seckler Signed-off-by: Lucas Oshiro Co-developed-by: Lucas Oshiro --- drivers/staging/iio/cdc/ad7746.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c index 47610d863908..21527d84f940 100644 --- a/drivers/staging/iio/cdc/ad7746.c +++ b/drivers/staging/iio/cdc/ad7746.c @@ -748,9 +748,19 @@ static const struct i2c_device_id ad7746_id[] = { MODULE_DEVICE_TABLE(i2c, ad7746_id); +static const struct of_device_id ad7746_of_match[] = { + { .compatible = "adi,ad7745" }, + { .compatible = "adi,ad7746" }, + { .compatible = "adi,ad7747" }, + { }, +}; + +MODULE_DEVICE_TABLE(of, ad7746_of_match); + static struct i2c_driver ad7746_driver = { .driver = { .name = KBUILD_MODNAME, + .of_match_table = ad7746_of_match, }, .probe = ad7746_probe, .id_table = ad7746_id, -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] dt-bindings: iio: adc: add adi,ad7780.yaml binding
This patch adds a YAML binding for the Analog Devices AD7780/1 and AD7170/1 analog-to-digital converters. Signed-off-by: Renato Lui Geh --- .../bindings/iio/adc/adi,ad7780.txt | 48 --- .../bindings/iio/adc/adi,ad7780.yaml | 85 +++ 2 files changed, 85 insertions(+), 48 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7780.txt create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7780.txt b/Documentation/devicetree/bindings/iio/adc/adi,ad7780.txt deleted file mode 100644 index 440e52555349.. --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7780.txt +++ /dev/null @@ -1,48 +0,0 @@ -* Analog Devices AD7170/AD7171/AD7780/AD7781 - -Data sheets: - -- AD7170: - * https://www.analog.com/media/en/technical-documentation/data-sheets/AD7170.pdf -- AD7171: - * https://www.analog.com/media/en/technical-documentation/data-sheets/AD7171.pdf -- AD7780: - * https://www.analog.com/media/en/technical-documentation/data-sheets/ad7780.pdf -- AD7781: - * https://www.analog.com/media/en/technical-documentation/data-sheets/AD7781.pdf - -Required properties: - -- compatible: should be one of - * "adi,ad7170" - * "adi,ad7171" - * "adi,ad7780" - * "adi,ad7781" -- reg: spi chip select number for the device -- vref-supply: the regulator supply for the ADC reference voltage - -Optional properties: - -- powerdown-gpios: must be the device tree identifier of the PDRST pin. If - specified, it will be asserted during driver probe. As the - line is active high, it should be marked GPIO_ACTIVE_HIGH. -- adi,gain-gpios: must be the device tree identifier of the GAIN pin. Only for - the ad778x chips. If specified, it will be asserted during - driver probe. As the line is active low, it should be marked - GPIO_ACTIVE_LOW. -- adi,filter-gpios: must be the device tree identifier of the FILTER pin. Only - for the ad778x chips. If specified, it will be asserted - during driver probe. As the line is active low, it should be - marked GPIO_ACTIVE_LOW. - -Example: - -adc@0 { - compatible = "adi,ad7780"; - reg = <0>; - vref-supply = <&vdd_supply> - - powerdown-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; - adi,gain-gpios = <&gpio 5 GPIO_ACTIVE_LOW>; - adi,filter-gpios = <&gpio 15 GPIO_ACTIVE_LOW>; -}; diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml new file mode 100644 index ..931bc4f8ec04 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/adi,ad7780.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AD7170/AD7171/AD7780/AD7781 analog to digital converters + +maintainers: + - Michael Hennerich + +description: | + The ad7780 is a sigma-delta analog to digital converter. This driver provides + reading voltage values and status bits from both the ad778x and ad717x series. + Its interface also allows writing on the FILTER and GAIN GPIO pins on the + ad778x. + + Specifications on the converters can be found at: +AD7170: + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7170.pdf +AD7171: + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7171.pdf +AD7780: + https://www.analog.com/media/en/technical-documentation/data-sheets/ad7780.pdf +AD7781: + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7781.pdf + +properties: + compatible: +enum: + - adi,ad7170 + - adi,ad7171 + - adi,ad7780 + - adi,ad7781 + + reg: +description: + Chip select number for the device +maxItems: 1 + + vref-supply: +description: + The regulator supply for the ADC reference voltage +maxItems: 1 + + powerdown-gpios: +description: + Must be the device tree identifier of the PDRST pin. If + specified, it will be asserted during driver probe. As the + line is active high, it should be marked GPIO_ACTIVE_HIGH. +maxItems: 1 + + adi,gain-gpios: +description: + Must be the device tree identifier of the GAIN pin. Only for + the ad778x chips. If specified, it will be asserted during + driver probe. As the line is active low, it should be marked + GPIO_ACTIVE_LOW. +maxItems: 1 + + adi,filter-gpios: +description: + Must be the device tree identifier of the FILTER pin. Only + for the ad778x chips. If specified, it will be asserted + during driver probe. As the line is active low, it should be +
[PATCH] staging: iio: adis16203: Add of_device_id table
Accomplish device tree compatibility to driver ADIS16203 by adding of_device_id table and making a subsequent call to MODULE_DEVICE_TABLE. Signed-off-by: Thiago Estrela Signed-off-by: Tiago Napoli Co-developed-by: Tiago Napoli Signed-off-by: Pedro Sousa Co-developed-by: Pedro Sousa Reviewed-by: Matheus Tavares Reviewed-by: Marcelo Schmitt --- drivers/staging/iio/accel/adis16203.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index 70381756a64a..a5d974ac2e3b 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -311,9 +311,17 @@ static int adis16203_remove(struct spi_device *spi) return 0; } +static const struct of_device_id adis16203_of_match[] = { + { .compatible = "adi,adis16203" }, + { }, +}; + +MODULE_DEVICE_TABLE(of, adis16203_of_match); + static struct spi_driver adis16203_driver = { .driver = { .name = "adis16203", + .of_match_table = adis16203_of_match, }, .probe = adis16203_probe, .remove = adis16203_remove, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: iio: cdc: ad7150: create of_device_id array
Create structure of type of_device_id in order to register all devices the driver is able to manage. Signed-off-by: Bárbara Fernandes Signed-off-by: Melissa Wen Co-developed-by: Melissa Wen Signed-off-by: Wilson Sales Co-developed-by: Wilson Sales --- drivers/staging/iio/cdc/ad7150.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index 4b1c90e1b0ea..072094227e1b 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -655,11 +655,21 @@ static const struct i2c_device_id ad7150_id[] = { {} }; +static const struct of_device_id ad7150_of_i2c_match[] = { + { .compatible = "adi,ad7150" }, + { .compatible = "adi,ad7151" }, + { .compatible = "adi,ad7156" }, + {} +}; + +MODULE_DEVICE_TABLE(of, ad7150_of_i2c_match); + MODULE_DEVICE_TABLE(i2c, ad7150_id); static struct i2c_driver ad7150_driver = { .driver = { .name = "ad7150", + .of_match_table = ad7150_of_i2c_match }, .probe = ad7150_probe, .id_table = ad7150_id, -- 2.22.0.rc0.1.g337bb99195.dirty ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND PATCH] staging: iio: adt7316: create of_device_id array
Create structure of type of_device_id in order to register all devices the driver is able to manage. Signed-off-by: Bárbara Fernandes Signed-off-by: Wilson Sales Co-developed-by: Wilson Sales --- drivers/staging/iio/addac/adt7316-spi.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c index 8294b9c1e3c2..9968775f1d23 100644 --- a/drivers/staging/iio/addac/adt7316-spi.c +++ b/drivers/staging/iio/addac/adt7316-spi.c @@ -127,9 +127,22 @@ static const struct spi_device_id adt7316_spi_id[] = { MODULE_DEVICE_TABLE(spi, adt7316_spi_id); +static const struct of_device_id adt7316_of_spi_match[] = { + { .compatible = "adi,adt7316" }, + { .compatible = "adi,adt7317" }, + { .compatible = "adi,adt7318" }, + { .compatible = "adi,adt7516" }, + { .compatible = "adi,adt7517" }, + { .compatible = "adi,adt7519" }, + { } +}; + +MODULE_DEVICE_TABLE(of, adt7316_of_spi_match); + static struct spi_driver adt7316_driver = { .driver = { .name = "adt7316", + .of_match_table = adt7316_of_spi_match, .pm = ADT7316_PM_OPS, }, .probe = adt7316_spi_probe, -- 2.22.0.rc0.1.g337bb99195.dirty ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND PATCH 0/2] Enhance dt support and channel creation
This series of patches set a struct of_device_id with all the devices this driver is able to manage and also add a macro to facilitate channel creation for its two capacitance channels. Bárbara Fernandes (2): staging: iio: cdc: ad7150: create of_device_id array staging: iio: cdc: ad7150: create macro for capacitance channels drivers/staging/iio/cdc/ad7150.c | 39 ++-- 1 file changed, 22 insertions(+), 17 deletions(-) -- 2.22.0.rc0.1.g337bb99195.dirty ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND PATCH] staging: iio: ad7192: create of_device_id array
Create list of compatible device ids to be matched with those stated in the device tree. Signed-off-by: Bárbara Fernandes Signed-off-by: Wilson Sales Co-developed by: Wilson Sales --- drivers/staging/iio/adc/ad7192.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 3d74da9d37e7..cc886f944dbf 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -810,11 +810,23 @@ static const struct spi_device_id ad7192_id[] = { {"ad7195", ID_AD7195}, {} }; + +static const struct of_device_id ad7192_of_spi_match[] = { + { .compatible = "adi,ad7190" }, + { .compatible = "adi,ad7192" }, + { .compatible = "adi,ad7193" }, + { .compatible = "adi,ad7195" }, + {} +}; + +MODULE_DEVICE_TABLE(of, ad7192_of_spi_match); + MODULE_DEVICE_TABLE(spi, ad7192_id); static struct spi_driver ad7192_driver = { .driver = { .name = "ad7192", + .of_match_table = ad7192_of_spi_match, }, .probe = ad7192_probe, .remove = ad7192_remove, -- 2.22.0.rc0.1.g337bb99195.dirty ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: iio: cdc: ad7150: create macro for capacitance channels
Create macro for capacitance channels in order to remove the repeated code and improve its readability. Signed-off-by: Bárbara Fernandes Signed-off-by: Wilson Sales Co-developed-by: Wilson Sales --- drivers/staging/iio/cdc/ad7150.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index 072094227e1b..d8c43cabce25 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -468,24 +468,19 @@ static const struct iio_event_spec ad7150_events[] = { }, }; +#define AD7150_CAPACITANCE_CHAN(_chan) { \ + .type = IIO_CAPACITANCE,\ + .indexed = 1, \ + .channel = _chan, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ + BIT(IIO_CHAN_INFO_AVERAGE_RAW), \ + .event_spec = ad7150_events,\ + .num_event_specs = ARRAY_SIZE(ad7150_events), \ + } + static const struct iio_chan_spec ad7150_channels[] = { - { - .type = IIO_CAPACITANCE, - .indexed = 1, - .channel = 0, - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | - BIT(IIO_CHAN_INFO_AVERAGE_RAW), - .event_spec = ad7150_events, - .num_event_specs = ARRAY_SIZE(ad7150_events), - }, { - .type = IIO_CAPACITANCE, - .indexed = 1, - .channel = 1, - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | - BIT(IIO_CHAN_INFO_AVERAGE_RAW), - .event_spec = ad7150_events, - .num_event_specs = ARRAY_SIZE(ad7150_events), - }, + AD7150_CAPACITANCE_CHAN(0), + AD7150_CAPACITANCE_CHAN(1) }; /* -- 2.22.0.rc0.1.g337bb99195.dirty ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: ad9834: add of_device_id table
Add a of_device_id struct array of_match_table variable and subsequent call to MODULE_DEVICE_TABLE macro to device tree support. Co-developed-by: Thiago L. A. Miller Signed-off-by: Thiago L. A. Miller Co-developed-by: Osvaldo M. Yasuda Signed-off-by: Osvaldo M. Yasuda Signed-off-by: João Victor Marques de Oliveira --- drivers/staging/iio/frequency/ad9834.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 6de3cd7363d7..038d6732c3fd 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -521,9 +521,20 @@ static const struct spi_device_id ad9834_id[] = { }; MODULE_DEVICE_TABLE(spi, ad9834_id); +static const struct of_device_id ad9834_of_match[] = { + {.compatible = "adi,ad9833"}, + {.compatible = "adi,ad9834"}, + {.compatible = "adi,ad9837"}, + {.compatible = "adi,ad9838"}, + {} +}; + +MODULE_DEVICE_TABLE(of, ad9834_of_match); + static struct spi_driver ad9834_driver = { .driver = { .name = "ad9834", + .of_match_table = ad9834_of_match }, .probe = ad9834_probe, .remove = ad9834_remove, -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:iio:ad7150: fix threshold mode config bit
According to the AD7150 configuration register description, bit 7 assumes value 1 when the threshold mode is fixed and 0 when it is adaptive, however, the operation that identifies this mode was considering the opposite values. This patch renames the boolean variable to describe it correctly and properly replaces it in the places where it is used. Fixes: 531efd6aa0991 ("staging:iio:adc:ad7150: chan_spec conv + i2c_smbus commands + drop unused poweroff timeout control.") Signed-off-by: Melissa Wen --- drivers/staging/iio/cdc/ad7150.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index dd7fcab8e19e..e075244c602b 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -5,6 +5,7 @@ * Copyright 2010-2011 Analog Devices Inc. */ +#include #include #include #include @@ -130,7 +131,7 @@ static int ad7150_read_event_config(struct iio_dev *indio_dev, { int ret; u8 threshtype; - bool adaptive; + bool thrfixed; struct ad7150_chip_info *chip = iio_priv(indio_dev); ret = i2c_smbus_read_byte_data(chip->client, AD7150_CFG); @@ -138,21 +139,23 @@ static int ad7150_read_event_config(struct iio_dev *indio_dev, return ret; threshtype = (ret >> 5) & 0x03; - adaptive = !!(ret & 0x80); + + /*check if threshold mode is fixed or adaptive*/ + thrfixed = FIELD_GET(AD7150_CFG_FIX, ret); switch (type) { case IIO_EV_TYPE_MAG_ADAPTIVE: if (dir == IIO_EV_DIR_RISING) - return adaptive && (threshtype == 0x1); - return adaptive && (threshtype == 0x0); + return !thrfixed && (threshtype == 0x1); + return !thrfixed && (threshtype == 0x0); case IIO_EV_TYPE_THRESH_ADAPTIVE: if (dir == IIO_EV_DIR_RISING) - return adaptive && (threshtype == 0x3); - return adaptive && (threshtype == 0x2); + return !thrfixed && (threshtype == 0x3); + return !thrfixed && (threshtype == 0x2); case IIO_EV_TYPE_THRESH: if (dir == IIO_EV_DIR_RISING) - return !adaptive && (threshtype == 0x1); - return !adaptive && (threshtype == 0x0); + return thrfixed && (threshtype == 0x1); + return thrfixed && (threshtype == 0x0); default: break; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel