diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-17 13:17:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-17 13:17:03 -0400 |
commit | 557e2e2eef90d7d3d4ee5396c1ecee873c3dd46e (patch) | |
tree | 0564981d2766e8b4f9b7bbf7eff12e4ad9b82e97 /drivers | |
parent | c83917976fad1e66689f2e4f632841ed2b2dbe2b (diff) | |
parent | 3a491aeae86577e0f23cd094f3e16351b6061209 (diff) |
Merge tag 'staging-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging fixes from Greg Kroah-Hartman:
"Here are some staging driver fixes (and iio driver fixes, they get
lumped in with the staging stuff due to dependancies) for your 3.6-rc3
tree.
Nothing major, just a bunch of fixes that people have reported.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'staging-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (26 commits)
iio: lm3533-als: Fix build warnings
staging:iio:ad7780: Mark channels as unsigned
staging:iio:ad7192: Report offset and scale for temperature channel
staging:iio:ad7192: Report channel offset
staging:iio:ad7192: Mark channels as unsigned
staging:iio:ad7192: Fix setting ACX
staging:iio:ad7192: Add missing break in switch statement
staging:iio:ad7793: Fix internal reference value
staging:iio:ad7793: Follow new IIO naming spec
staging:iio:ad7793: Fix temperature scale and offset
staging:iio:ad7793: Report channel offset
staging:iio:ad7793: Mark channels as unsigned
staging:iio:ad7793: Add missing break in switch statement
iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()
iio: frequency: ADF4350: Fix potential reference div factor overflow.
iio: staging: ad7298_ring: Fix maybe-uninitialized warning
staging: comedi: usbduxfast: Declare MODULE_FIRMWARE usage
staging: comedi: usbdux: Declare MODULE_FIRMWARE usage
staging: comedi: usbduxsigma: Declare MODULE_FIRMWARE usage
staging: csr: add INET dependancy
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/frequency/adf4350.c | 24 | ||||
-rw-r--r-- | drivers/iio/light/adjd_s311.c | 7 | ||||
-rw-r--r-- | drivers/iio/light/lm3533-als.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/adv_pci1710.c | 3 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/adv_pci1723.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/adv_pci_dio.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/daqboard2000.c | 17 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/dt3000.c | 6 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/rtd520.c | 26 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/usbdux.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxfast.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxsigma.c | 4 | ||||
-rw-r--r-- | drivers/staging/csr/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7192.c | 48 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7298_ring.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7780.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7793.c | 99 |
18 files changed, 148 insertions, 118 deletions
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c index 59fbb3ae40e7..e35bb8f6fe75 100644 --- a/drivers/iio/frequency/adf4350.c +++ b/drivers/iio/frequency/adf4350.c | |||
@@ -129,7 +129,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq) | |||
129 | { | 129 | { |
130 | struct adf4350_platform_data *pdata = st->pdata; | 130 | struct adf4350_platform_data *pdata = st->pdata; |
131 | u64 tmp; | 131 | u64 tmp; |
132 | u32 div_gcd, prescaler; | 132 | u32 div_gcd, prescaler, chspc; |
133 | u16 mdiv, r_cnt = 0; | 133 | u16 mdiv, r_cnt = 0; |
134 | u8 band_sel_div; | 134 | u8 band_sel_div; |
135 | 135 | ||
@@ -158,14 +158,20 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq) | |||
158 | if (pdata->ref_div_factor) | 158 | if (pdata->ref_div_factor) |
159 | r_cnt = pdata->ref_div_factor - 1; | 159 | r_cnt = pdata->ref_div_factor - 1; |
160 | 160 | ||
161 | do { | 161 | chspc = st->chspc; |
162 | r_cnt = adf4350_tune_r_cnt(st, r_cnt); | ||
163 | 162 | ||
164 | st->r1_mod = st->fpfd / st->chspc; | 163 | do { |
165 | while (st->r1_mod > ADF4350_MAX_MODULUS) { | 164 | do { |
166 | r_cnt = adf4350_tune_r_cnt(st, r_cnt); | 165 | do { |
167 | st->r1_mod = st->fpfd / st->chspc; | 166 | r_cnt = adf4350_tune_r_cnt(st, r_cnt); |
168 | } | 167 | st->r1_mod = st->fpfd / chspc; |
168 | if (r_cnt > ADF4350_MAX_R_CNT) { | ||
169 | /* try higher spacing values */ | ||
170 | chspc++; | ||
171 | r_cnt = 0; | ||
172 | } | ||
173 | } while ((st->r1_mod > ADF4350_MAX_MODULUS) && r_cnt); | ||
174 | } while (r_cnt == 0); | ||
169 | 175 | ||
170 | tmp = freq * (u64)st->r1_mod + (st->fpfd > 1); | 176 | tmp = freq * (u64)st->r1_mod + (st->fpfd > 1); |
171 | do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */ | 177 | do_div(tmp, st->fpfd); /* Div round closest (n + d/2)/d */ |
@@ -194,7 +200,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq) | |||
194 | st->regs[ADF4350_REG0] = ADF4350_REG0_INT(st->r0_int) | | 200 | st->regs[ADF4350_REG0] = ADF4350_REG0_INT(st->r0_int) | |
195 | ADF4350_REG0_FRACT(st->r0_fract); | 201 | ADF4350_REG0_FRACT(st->r0_fract); |
196 | 202 | ||
197 | st->regs[ADF4350_REG1] = ADF4350_REG1_PHASE(0) | | 203 | st->regs[ADF4350_REG1] = ADF4350_REG1_PHASE(1) | |
198 | ADF4350_REG1_MOD(st->r1_mod) | | 204 | ADF4350_REG1_MOD(st->r1_mod) | |
199 | prescaler; | 205 | prescaler; |
200 | 206 | ||
diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c index 1cbb449b319a..9a99f43094f0 100644 --- a/drivers/iio/light/adjd_s311.c +++ b/drivers/iio/light/adjd_s311.c | |||
@@ -271,9 +271,10 @@ static int adjd_s311_update_scan_mode(struct iio_dev *indio_dev, | |||
271 | const unsigned long *scan_mask) | 271 | const unsigned long *scan_mask) |
272 | { | 272 | { |
273 | struct adjd_s311_data *data = iio_priv(indio_dev); | 273 | struct adjd_s311_data *data = iio_priv(indio_dev); |
274 | data->buffer = krealloc(data->buffer, indio_dev->scan_bytes, | 274 | |
275 | GFP_KERNEL); | 275 | kfree(data->buffer); |
276 | if (!data->buffer) | 276 | data->buffer = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
277 | if (data->buffer == NULL) | ||
277 | return -ENOMEM; | 278 | return -ENOMEM; |
278 | 279 | ||
279 | return 0; | 280 | return 0; |
diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c index c3e7bac13123..e45712a921ce 100644 --- a/drivers/iio/light/lm3533-als.c +++ b/drivers/iio/light/lm3533-als.c | |||
@@ -404,7 +404,7 @@ out: | |||
404 | return ret; | 404 | return ret; |
405 | } | 405 | } |
406 | 406 | ||
407 | static int show_thresh_either_en(struct device *dev, | 407 | static ssize_t show_thresh_either_en(struct device *dev, |
408 | struct device_attribute *attr, | 408 | struct device_attribute *attr, |
409 | char *buf) | 409 | char *buf) |
410 | { | 410 | { |
@@ -424,7 +424,7 @@ static int show_thresh_either_en(struct device *dev, | |||
424 | return scnprintf(buf, PAGE_SIZE, "%u\n", enable); | 424 | return scnprintf(buf, PAGE_SIZE, "%u\n", enable); |
425 | } | 425 | } |
426 | 426 | ||
427 | static int store_thresh_either_en(struct device *dev, | 427 | static ssize_t store_thresh_either_en(struct device *dev, |
428 | struct device_attribute *attr, | 428 | struct device_attribute *attr, |
429 | const char *buf, size_t len) | 429 | const char *buf, size_t len) |
430 | { | 430 | { |
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index c0fdb00783ed..2359151af7e1 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c | |||
@@ -168,7 +168,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
168 | dev->board_ptr = comedi_recognize(driv, it->board_name); | 168 | dev->board_ptr = comedi_recognize(driv, it->board_name); |
169 | if (dev->board_ptr) | 169 | if (dev->board_ptr) |
170 | break; | 170 | break; |
171 | } else if (strcmp(driv->driver_name, it->board_name)) | 171 | } else if (strcmp(driv->driver_name, it->board_name) == 0) |
172 | break; | 172 | break; |
173 | module_put(driv->module); | 173 | module_put(driv->module); |
174 | } | 174 | } |
diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 31986608eaf1..6b4d0d68e637 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c | |||
@@ -1349,9 +1349,6 @@ static struct pci_dev *pci1710_find_pci_dev(struct comedi_device *dev, | |||
1349 | } | 1349 | } |
1350 | if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH) | 1350 | if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH) |
1351 | continue; | 1351 | continue; |
1352 | if (pci_is_enabled(pcidev)) | ||
1353 | continue; | ||
1354 | |||
1355 | if (strcmp(this_board->name, DRV_NAME) == 0) { | 1352 | if (strcmp(this_board->name, DRV_NAME) == 0) { |
1356 | for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) { | 1353 | for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) { |
1357 | if (pcidev->device == boardtypes[i].device_id) { | 1354 | if (pcidev->device == boardtypes[i].device_id) { |
diff --git a/drivers/staging/comedi/drivers/adv_pci1723.c b/drivers/staging/comedi/drivers/adv_pci1723.c index da5ee69d2c9d..dfde0f6328dd 100644 --- a/drivers/staging/comedi/drivers/adv_pci1723.c +++ b/drivers/staging/comedi/drivers/adv_pci1723.c | |||
@@ -301,8 +301,6 @@ static struct pci_dev *pci1723_find_pci_dev(struct comedi_device *dev, | |||
301 | } | 301 | } |
302 | if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH) | 302 | if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH) |
303 | continue; | 303 | continue; |
304 | if (pci_is_enabled(pcidev)) | ||
305 | continue; | ||
306 | return pcidev; | 304 | return pcidev; |
307 | } | 305 | } |
308 | dev_err(dev->class_dev, | 306 | dev_err(dev->class_dev, |
diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c index 97f06dc8e48d..2d4cb7f638b2 100644 --- a/drivers/staging/comedi/drivers/adv_pci_dio.c +++ b/drivers/staging/comedi/drivers/adv_pci_dio.c | |||
@@ -1064,8 +1064,6 @@ static struct pci_dev *pci_dio_find_pci_dev(struct comedi_device *dev, | |||
1064 | slot != PCI_SLOT(pcidev->devfn)) | 1064 | slot != PCI_SLOT(pcidev->devfn)) |
1065 | continue; | 1065 | continue; |
1066 | } | 1066 | } |
1067 | if (pci_is_enabled(pcidev)) | ||
1068 | continue; | ||
1069 | for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) { | 1067 | for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) { |
1070 | if (boardtypes[i].vendor_id != pcidev->vendor) | 1068 | if (boardtypes[i].vendor_id != pcidev->vendor) |
1071 | continue; | 1069 | continue; |
diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index ef28385c1482..cad559a1a730 100644 --- a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c | |||
@@ -718,7 +718,8 @@ static struct pci_dev *daqboard2000_find_pci_dev(struct comedi_device *dev, | |||
718 | continue; | 718 | continue; |
719 | } | 719 | } |
720 | if (pcidev->vendor != PCI_VENDOR_ID_IOTECH || | 720 | if (pcidev->vendor != PCI_VENDOR_ID_IOTECH || |
721 | pcidev->device != 0x0409) | 721 | pcidev->device != 0x0409 || |
722 | pcidev->subsystem_device != PCI_VENDOR_ID_IOTECH) | ||
722 | continue; | 723 | continue; |
723 | 724 | ||
724 | for (i = 0; i < ARRAY_SIZE(boardtypes); i++) { | 725 | for (i = 0; i < ARRAY_SIZE(boardtypes); i++) { |
@@ -739,6 +740,7 @@ static int daqboard2000_attach(struct comedi_device *dev, | |||
739 | { | 740 | { |
740 | struct pci_dev *pcidev; | 741 | struct pci_dev *pcidev; |
741 | struct comedi_subdevice *s; | 742 | struct comedi_subdevice *s; |
743 | resource_size_t pci_base; | ||
742 | void *aux_data; | 744 | void *aux_data; |
743 | unsigned int aux_len; | 745 | unsigned int aux_len; |
744 | int result; | 746 | int result; |
@@ -758,11 +760,12 @@ static int daqboard2000_attach(struct comedi_device *dev, | |||
758 | "failed to enable PCI device and request regions\n"); | 760 | "failed to enable PCI device and request regions\n"); |
759 | return -EIO; | 761 | return -EIO; |
760 | } | 762 | } |
761 | dev->iobase = pci_resource_start(pcidev, 2); | 763 | dev->iobase = 1; /* the "detach" needs this */ |
762 | 764 | ||
763 | devpriv->plx = | 765 | pci_base = pci_resource_start(pcidev, 0); |
764 | ioremap(pci_resource_start(pcidev, 0), DAQBOARD2000_PLX_SIZE); | 766 | devpriv->plx = ioremap(pci_base, DAQBOARD2000_PLX_SIZE); |
765 | devpriv->daq = ioremap(dev->iobase, DAQBOARD2000_DAQ_SIZE); | 767 | pci_base = pci_resource_start(pcidev, 2); |
768 | devpriv->daq = ioremap(pci_base, DAQBOARD2000_DAQ_SIZE); | ||
766 | if (!devpriv->plx || !devpriv->daq) | 769 | if (!devpriv->plx || !devpriv->daq) |
767 | return -ENOMEM; | 770 | return -ENOMEM; |
768 | 771 | ||
@@ -799,8 +802,6 @@ static int daqboard2000_attach(struct comedi_device *dev, | |||
799 | printk("Interrupt after is: %x\n", interrupt); | 802 | printk("Interrupt after is: %x\n", interrupt); |
800 | */ | 803 | */ |
801 | 804 | ||
802 | dev->iobase = (unsigned long)devpriv->daq; | ||
803 | |||
804 | dev->board_name = this_board->name; | 805 | dev->board_name = this_board->name; |
805 | 806 | ||
806 | s = dev->subdevices + 0; | 807 | s = dev->subdevices + 0; |
@@ -824,7 +825,7 @@ static int daqboard2000_attach(struct comedi_device *dev, | |||
824 | 825 | ||
825 | s = dev->subdevices + 2; | 826 | s = dev->subdevices + 2; |
826 | result = subdev_8255_init(dev, s, daqboard2000_8255_cb, | 827 | result = subdev_8255_init(dev, s, daqboard2000_8255_cb, |
827 | (unsigned long)(dev->iobase + 0x40)); | 828 | (unsigned long)(devpriv->daq + 0x40)); |
828 | 829 | ||
829 | out: | 830 | out: |
830 | return result; | 831 | return result; |
diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index a6fe6c9be87e..3476cda0fff0 100644 --- a/drivers/staging/comedi/drivers/dt3000.c +++ b/drivers/staging/comedi/drivers/dt3000.c | |||
@@ -804,6 +804,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
804 | { | 804 | { |
805 | struct pci_dev *pcidev; | 805 | struct pci_dev *pcidev; |
806 | struct comedi_subdevice *s; | 806 | struct comedi_subdevice *s; |
807 | resource_size_t pci_base; | ||
807 | int ret = 0; | 808 | int ret = 0; |
808 | 809 | ||
809 | dev_dbg(dev->class_dev, "dt3000:\n"); | 810 | dev_dbg(dev->class_dev, "dt3000:\n"); |
@@ -820,9 +821,10 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
820 | ret = comedi_pci_enable(pcidev, "dt3000"); | 821 | ret = comedi_pci_enable(pcidev, "dt3000"); |
821 | if (ret < 0) | 822 | if (ret < 0) |
822 | return ret; | 823 | return ret; |
824 | dev->iobase = 1; /* the "detach" needs this */ | ||
823 | 825 | ||
824 | dev->iobase = pci_resource_start(pcidev, 0); | 826 | pci_base = pci_resource_start(pcidev, 0); |
825 | devpriv->io_addr = ioremap(dev->iobase, DT3000_SIZE); | 827 | devpriv->io_addr = ioremap(pci_base, DT3000_SIZE); |
826 | if (!devpriv->io_addr) | 828 | if (!devpriv->io_addr) |
827 | return -ENOMEM; | 829 | return -ENOMEM; |
828 | 830 | ||
diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 112fdc3e9c69..5aa8be1e7b92 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c | |||
@@ -1619,9 +1619,8 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
1619 | struct rtdPrivate *devpriv; | 1619 | struct rtdPrivate *devpriv; |
1620 | struct pci_dev *pcidev; | 1620 | struct pci_dev *pcidev; |
1621 | struct comedi_subdevice *s; | 1621 | struct comedi_subdevice *s; |
1622 | resource_size_t pci_base; | ||
1622 | int ret; | 1623 | int ret; |
1623 | resource_size_t physLas1; /* data area */ | ||
1624 | resource_size_t physLcfg; /* PLX9080 */ | ||
1625 | #ifdef USE_DMA | 1624 | #ifdef USE_DMA |
1626 | int index; | 1625 | int index; |
1627 | #endif | 1626 | #endif |
@@ -1655,20 +1654,15 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
1655 | printk(KERN_INFO "Failed to enable PCI device and request regions.\n"); | 1654 | printk(KERN_INFO "Failed to enable PCI device and request regions.\n"); |
1656 | return ret; | 1655 | return ret; |
1657 | } | 1656 | } |
1658 | 1657 | dev->iobase = 1; /* the "detach" needs this */ | |
1659 | /* | 1658 | |
1660 | * Initialize base addresses | 1659 | /* Initialize the base addresses */ |
1661 | */ | 1660 | pci_base = pci_resource_start(pcidev, LAS0_PCIINDEX); |
1662 | /* Get the physical address from PCI config */ | 1661 | devpriv->las0 = ioremap_nocache(pci_base, LAS0_PCISIZE); |
1663 | dev->iobase = pci_resource_start(pcidev, LAS0_PCIINDEX); | 1662 | pci_base = pci_resource_start(pcidev, LAS1_PCIINDEX); |
1664 | physLas1 = pci_resource_start(pcidev, LAS1_PCIINDEX); | 1663 | devpriv->las1 = ioremap_nocache(pci_base, LAS1_PCISIZE); |
1665 | physLcfg = pci_resource_start(pcidev, LCFG_PCIINDEX); | 1664 | pci_base = pci_resource_start(pcidev, LCFG_PCIINDEX); |
1666 | /* Now have the kernel map this into memory */ | 1665 | devpriv->lcfg = ioremap_nocache(pci_base, LCFG_PCISIZE); |
1667 | /* ASSUME page aligned */ | ||
1668 | devpriv->las0 = ioremap_nocache(dev->iobase, LAS0_PCISIZE); | ||
1669 | devpriv->las1 = ioremap_nocache(physLas1, LAS1_PCISIZE); | ||
1670 | devpriv->lcfg = ioremap_nocache(physLcfg, LCFG_PCISIZE); | ||
1671 | |||
1672 | if (!devpriv->las0 || !devpriv->las1 || !devpriv->lcfg) | 1666 | if (!devpriv->las0 || !devpriv->las1 || !devpriv->lcfg) |
1673 | return -ENOMEM; | 1667 | return -ENOMEM; |
1674 | 1668 | ||
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 848c7ec06976..11ee83681da7 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c | |||
@@ -102,6 +102,7 @@ sampling rate. If you sample two channels you get 4kHz and so on. | |||
102 | #define BULK_TIMEOUT 1000 | 102 | #define BULK_TIMEOUT 1000 |
103 | 103 | ||
104 | /* constants for "firmware" upload and download */ | 104 | /* constants for "firmware" upload and download */ |
105 | #define FIRMWARE "usbdux_firmware.bin" | ||
105 | #define USBDUXSUB_FIRMWARE 0xA0 | 106 | #define USBDUXSUB_FIRMWARE 0xA0 |
106 | #define VENDOR_DIR_IN 0xC0 | 107 | #define VENDOR_DIR_IN 0xC0 |
107 | #define VENDOR_DIR_OUT 0x40 | 108 | #define VENDOR_DIR_OUT 0x40 |
@@ -2791,7 +2792,7 @@ static int usbdux_usb_probe(struct usb_interface *uinterf, | |||
2791 | 2792 | ||
2792 | ret = request_firmware_nowait(THIS_MODULE, | 2793 | ret = request_firmware_nowait(THIS_MODULE, |
2793 | FW_ACTION_HOTPLUG, | 2794 | FW_ACTION_HOTPLUG, |
2794 | "usbdux_firmware.bin", | 2795 | FIRMWARE, |
2795 | &udev->dev, | 2796 | &udev->dev, |
2796 | GFP_KERNEL, | 2797 | GFP_KERNEL, |
2797 | usbduxsub + index, | 2798 | usbduxsub + index, |
@@ -2850,3 +2851,4 @@ module_comedi_usb_driver(usbdux_driver, usbdux_usb_driver); | |||
2850 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); | 2851 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); |
2851 | MODULE_DESCRIPTION("Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"); | 2852 | MODULE_DESCRIPTION("Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"); |
2852 | MODULE_LICENSE("GPL"); | 2853 | MODULE_LICENSE("GPL"); |
2854 | MODULE_FIRMWARE(FIRMWARE); | ||
diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index d9911588c10a..8eb41257c6ce 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c | |||
@@ -57,6 +57,7 @@ | |||
57 | /* | 57 | /* |
58 | * constants for "firmware" upload and download | 58 | * constants for "firmware" upload and download |
59 | */ | 59 | */ |
60 | #define FIRMWARE "usbduxfast_firmware.bin" | ||
60 | #define USBDUXFASTSUB_FIRMWARE 0xA0 | 61 | #define USBDUXFASTSUB_FIRMWARE 0xA0 |
61 | #define VENDOR_DIR_IN 0xC0 | 62 | #define VENDOR_DIR_IN 0xC0 |
62 | #define VENDOR_DIR_OUT 0x40 | 63 | #define VENDOR_DIR_OUT 0x40 |
@@ -1706,7 +1707,7 @@ static int usbduxfast_usb_probe(struct usb_interface *uinterf, | |||
1706 | 1707 | ||
1707 | ret = request_firmware_nowait(THIS_MODULE, | 1708 | ret = request_firmware_nowait(THIS_MODULE, |
1708 | FW_ACTION_HOTPLUG, | 1709 | FW_ACTION_HOTPLUG, |
1709 | "usbduxfast_firmware.bin", | 1710 | FIRMWARE, |
1710 | &udev->dev, | 1711 | &udev->dev, |
1711 | GFP_KERNEL, | 1712 | GFP_KERNEL, |
1712 | usbduxfastsub + index, | 1713 | usbduxfastsub + index, |
@@ -1774,3 +1775,4 @@ module_comedi_usb_driver(usbduxfast_driver, usbduxfast_usb_driver); | |||
1774 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); | 1775 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); |
1775 | MODULE_DESCRIPTION("USB-DUXfast, BerndPorr@f2s.com"); | 1776 | MODULE_DESCRIPTION("USB-DUXfast, BerndPorr@f2s.com"); |
1776 | MODULE_LICENSE("GPL"); | 1777 | MODULE_LICENSE("GPL"); |
1778 | MODULE_FIRMWARE(FIRMWARE); | ||
diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 543e604791e2..f54ab8c2fcfd 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c | |||
@@ -63,6 +63,7 @@ Status: testing | |||
63 | #define BULK_TIMEOUT 1000 | 63 | #define BULK_TIMEOUT 1000 |
64 | 64 | ||
65 | /* constants for "firmware" upload and download */ | 65 | /* constants for "firmware" upload and download */ |
66 | #define FIRMWARE "usbduxsigma_firmware.bin" | ||
66 | #define USBDUXSUB_FIRMWARE 0xA0 | 67 | #define USBDUXSUB_FIRMWARE 0xA0 |
67 | #define VENDOR_DIR_IN 0xC0 | 68 | #define VENDOR_DIR_IN 0xC0 |
68 | #define VENDOR_DIR_OUT 0x40 | 69 | #define VENDOR_DIR_OUT 0x40 |
@@ -2780,7 +2781,7 @@ static int usbduxsigma_usb_probe(struct usb_interface *uinterf, | |||
2780 | 2781 | ||
2781 | ret = request_firmware_nowait(THIS_MODULE, | 2782 | ret = request_firmware_nowait(THIS_MODULE, |
2782 | FW_ACTION_HOTPLUG, | 2783 | FW_ACTION_HOTPLUG, |
2783 | "usbduxsigma_firmware.bin", | 2784 | FIRMWARE, |
2784 | &udev->dev, | 2785 | &udev->dev, |
2785 | GFP_KERNEL, | 2786 | GFP_KERNEL, |
2786 | usbduxsub + index, | 2787 | usbduxsub + index, |
@@ -2845,3 +2846,4 @@ module_comedi_usb_driver(usbduxsigma_driver, usbduxsigma_usb_driver); | |||
2845 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); | 2846 | MODULE_AUTHOR("Bernd Porr, BerndPorr@f2s.com"); |
2846 | MODULE_DESCRIPTION("Stirling/ITL USB-DUX SIGMA -- Bernd.Porr@f2s.com"); | 2847 | MODULE_DESCRIPTION("Stirling/ITL USB-DUX SIGMA -- Bernd.Porr@f2s.com"); |
2847 | MODULE_LICENSE("GPL"); | 2848 | MODULE_LICENSE("GPL"); |
2849 | MODULE_FIRMWARE(FIRMWARE); | ||
diff --git a/drivers/staging/csr/Kconfig b/drivers/staging/csr/Kconfig index cee8d48d2af9..ad2a1096e920 100644 --- a/drivers/staging/csr/Kconfig +++ b/drivers/staging/csr/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config CSR_WIFI | 1 | config CSR_WIFI |
2 | tristate "CSR wireless driver" | 2 | tristate "CSR wireless driver" |
3 | depends on MMC && CFG80211_WEXT | 3 | depends on MMC && CFG80211_WEXT && INET |
4 | select WIRELESS_EXT | 4 | select WIRELESS_EXT |
5 | select WEXT_PRIV | 5 | select WEXT_PRIV |
6 | help | 6 | help |
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 22c3923d55eb..095837285f4f 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c | |||
@@ -754,7 +754,7 @@ static ssize_t ad7192_set(struct device *dev, | |||
754 | else | 754 | else |
755 | st->mode &= ~AD7192_MODE_ACX; | 755 | st->mode &= ~AD7192_MODE_ACX; |
756 | 756 | ||
757 | ad7192_write_reg(st, AD7192_REG_GPOCON, 3, st->mode); | 757 | ad7192_write_reg(st, AD7192_REG_MODE, 3, st->mode); |
758 | break; | 758 | break; |
759 | default: | 759 | default: |
760 | ret = -EINVAL; | 760 | ret = -EINVAL; |
@@ -798,6 +798,11 @@ static const struct attribute_group ad7195_attribute_group = { | |||
798 | .attrs = ad7195_attributes, | 798 | .attrs = ad7195_attributes, |
799 | }; | 799 | }; |
800 | 800 | ||
801 | static unsigned int ad7192_get_temp_scale(bool unipolar) | ||
802 | { | ||
803 | return unipolar ? 2815 * 2 : 2815; | ||
804 | } | ||
805 | |||
801 | static int ad7192_read_raw(struct iio_dev *indio_dev, | 806 | static int ad7192_read_raw(struct iio_dev *indio_dev, |
802 | struct iio_chan_spec const *chan, | 807 | struct iio_chan_spec const *chan, |
803 | int *val, | 808 | int *val, |
@@ -824,19 +829,6 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, | |||
824 | *val = (smpl >> chan->scan_type.shift) & | 829 | *val = (smpl >> chan->scan_type.shift) & |
825 | ((1 << (chan->scan_type.realbits)) - 1); | 830 | ((1 << (chan->scan_type.realbits)) - 1); |
826 | 831 | ||
827 | switch (chan->type) { | ||
828 | case IIO_VOLTAGE: | ||
829 | if (!unipolar) | ||
830 | *val -= (1 << (chan->scan_type.realbits - 1)); | ||
831 | break; | ||
832 | case IIO_TEMP: | ||
833 | *val -= 0x800000; | ||
834 | *val /= 2815; /* temp Kelvin */ | ||
835 | *val -= 273; /* temp Celsius */ | ||
836 | break; | ||
837 | default: | ||
838 | return -EINVAL; | ||
839 | } | ||
840 | return IIO_VAL_INT; | 832 | return IIO_VAL_INT; |
841 | 833 | ||
842 | case IIO_CHAN_INFO_SCALE: | 834 | case IIO_CHAN_INFO_SCALE: |
@@ -848,11 +840,21 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, | |||
848 | mutex_unlock(&indio_dev->mlock); | 840 | mutex_unlock(&indio_dev->mlock); |
849 | return IIO_VAL_INT_PLUS_NANO; | 841 | return IIO_VAL_INT_PLUS_NANO; |
850 | case IIO_TEMP: | 842 | case IIO_TEMP: |
851 | *val = 1000; | 843 | *val = 0; |
852 | return IIO_VAL_INT; | 844 | *val2 = 1000000000 / ad7192_get_temp_scale(unipolar); |
845 | return IIO_VAL_INT_PLUS_NANO; | ||
853 | default: | 846 | default: |
854 | return -EINVAL; | 847 | return -EINVAL; |
855 | } | 848 | } |
849 | case IIO_CHAN_INFO_OFFSET: | ||
850 | if (!unipolar) | ||
851 | *val = -(1 << (chan->scan_type.realbits - 1)); | ||
852 | else | ||
853 | *val = 0; | ||
854 | /* Kelvin to Celsius */ | ||
855 | if (chan->type == IIO_TEMP) | ||
856 | *val -= 273 * ad7192_get_temp_scale(unipolar); | ||
857 | return IIO_VAL_INT; | ||
856 | } | 858 | } |
857 | 859 | ||
858 | return -EINVAL; | 860 | return -EINVAL; |
@@ -890,7 +892,7 @@ static int ad7192_write_raw(struct iio_dev *indio_dev, | |||
890 | } | 892 | } |
891 | ret = 0; | 893 | ret = 0; |
892 | } | 894 | } |
893 | 895 | break; | |
894 | default: | 896 | default: |
895 | ret = -EINVAL; | 897 | ret = -EINVAL; |
896 | } | 898 | } |
@@ -942,20 +944,22 @@ static const struct iio_info ad7195_info = { | |||
942 | .channel = _chan, \ | 944 | .channel = _chan, \ |
943 | .channel2 = _chan2, \ | 945 | .channel2 = _chan2, \ |
944 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 946 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ |
945 | IIO_CHAN_INFO_SCALE_SHARED_BIT, \ | 947 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ |
948 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, \ | ||
946 | .address = _address, \ | 949 | .address = _address, \ |
947 | .scan_index = _si, \ | 950 | .scan_index = _si, \ |
948 | .scan_type = IIO_ST('s', 24, 32, 0)} | 951 | .scan_type = IIO_ST('u', 24, 32, 0)} |
949 | 952 | ||
950 | #define AD7192_CHAN(_chan, _address, _si) \ | 953 | #define AD7192_CHAN(_chan, _address, _si) \ |
951 | { .type = IIO_VOLTAGE, \ | 954 | { .type = IIO_VOLTAGE, \ |
952 | .indexed = 1, \ | 955 | .indexed = 1, \ |
953 | .channel = _chan, \ | 956 | .channel = _chan, \ |
954 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 957 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ |
955 | IIO_CHAN_INFO_SCALE_SHARED_BIT, \ | 958 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ |
959 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, \ | ||
956 | .address = _address, \ | 960 | .address = _address, \ |
957 | .scan_index = _si, \ | 961 | .scan_index = _si, \ |
958 | .scan_type = IIO_ST('s', 24, 32, 0)} | 962 | .scan_type = IIO_ST('u', 24, 32, 0)} |
959 | 963 | ||
960 | #define AD7192_CHAN_TEMP(_chan, _address, _si) \ | 964 | #define AD7192_CHAN_TEMP(_chan, _address, _si) \ |
961 | { .type = IIO_TEMP, \ | 965 | { .type = IIO_TEMP, \ |
@@ -965,7 +969,7 @@ static const struct iio_info ad7195_info = { | |||
965 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 969 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ |
966 | .address = _address, \ | 970 | .address = _address, \ |
967 | .scan_index = _si, \ | 971 | .scan_index = _si, \ |
968 | .scan_type = IIO_ST('s', 24, 32, 0)} | 972 | .scan_type = IIO_ST('u', 24, 32, 0)} |
969 | 973 | ||
970 | static struct iio_chan_spec ad7192_channels[] = { | 974 | static struct iio_chan_spec ad7192_channels[] = { |
971 | AD7192_CHAN_DIFF(1, 2, NULL, AD7192_CH_AIN1P_AIN2M, 0), | 975 | AD7192_CHAN_DIFF(1, 2, NULL, AD7192_CH_AIN1P_AIN2M, 0), |
diff --git a/drivers/staging/iio/adc/ad7298_ring.c b/drivers/staging/iio/adc/ad7298_ring.c index fd1d855ff57a..506016f01593 100644 --- a/drivers/staging/iio/adc/ad7298_ring.c +++ b/drivers/staging/iio/adc/ad7298_ring.c | |||
@@ -76,7 +76,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p) | |||
76 | struct iio_dev *indio_dev = pf->indio_dev; | 76 | struct iio_dev *indio_dev = pf->indio_dev; |
77 | struct ad7298_state *st = iio_priv(indio_dev); | 77 | struct ad7298_state *st = iio_priv(indio_dev); |
78 | struct iio_buffer *ring = indio_dev->buffer; | 78 | struct iio_buffer *ring = indio_dev->buffer; |
79 | s64 time_ns; | 79 | s64 time_ns = 0; |
80 | __u16 buf[16]; | 80 | __u16 buf[16]; |
81 | int b_sent, i; | 81 | int b_sent, i; |
82 | 82 | ||
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 1ece2ac8de56..19ee49c95de4 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c | |||
@@ -131,9 +131,10 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { | |||
131 | .indexed = 1, | 131 | .indexed = 1, |
132 | .channel = 0, | 132 | .channel = 0, |
133 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 133 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
134 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 134 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
135 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
135 | .scan_type = { | 136 | .scan_type = { |
136 | .sign = 's', | 137 | .sign = 'u', |
137 | .realbits = 24, | 138 | .realbits = 24, |
138 | .storagebits = 32, | 139 | .storagebits = 32, |
139 | .shift = 8, | 140 | .shift = 8, |
@@ -146,9 +147,10 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { | |||
146 | .indexed = 1, | 147 | .indexed = 1, |
147 | .channel = 0, | 148 | .channel = 0, |
148 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 149 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
149 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 150 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
151 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
150 | .scan_type = { | 152 | .scan_type = { |
151 | .sign = 's', | 153 | .sign = 'u', |
152 | .realbits = 20, | 154 | .realbits = 20, |
153 | .storagebits = 32, | 155 | .storagebits = 32, |
154 | .shift = 12, | 156 | .shift = 12, |
diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c index 76fdd7145fc5..112e2b7b5bc4 100644 --- a/drivers/staging/iio/adc/ad7793.c +++ b/drivers/staging/iio/adc/ad7793.c | |||
@@ -563,8 +563,9 @@ static ssize_t ad7793_show_scale_available(struct device *dev, | |||
563 | return len; | 563 | return len; |
564 | } | 564 | } |
565 | 565 | ||
566 | static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, in-in_scale_available, | 566 | static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, |
567 | S_IRUGO, ad7793_show_scale_available, NULL, 0); | 567 | in_voltage-voltage_scale_available, S_IRUGO, |
568 | ad7793_show_scale_available, NULL, 0); | ||
568 | 569 | ||
569 | static struct attribute *ad7793_attributes[] = { | 570 | static struct attribute *ad7793_attributes[] = { |
570 | &iio_dev_attr_sampling_frequency.dev_attr.attr, | 571 | &iio_dev_attr_sampling_frequency.dev_attr.attr, |
@@ -604,9 +605,6 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, | |||
604 | *val = (smpl >> chan->scan_type.shift) & | 605 | *val = (smpl >> chan->scan_type.shift) & |
605 | ((1 << (chan->scan_type.realbits)) - 1); | 606 | ((1 << (chan->scan_type.realbits)) - 1); |
606 | 607 | ||
607 | if (!unipolar) | ||
608 | *val -= (1 << (chan->scan_type.realbits - 1)); | ||
609 | |||
610 | return IIO_VAL_INT; | 608 | return IIO_VAL_INT; |
611 | 609 | ||
612 | case IIO_CHAN_INFO_SCALE: | 610 | case IIO_CHAN_INFO_SCALE: |
@@ -620,25 +618,38 @@ static int ad7793_read_raw(struct iio_dev *indio_dev, | |||
620 | return IIO_VAL_INT_PLUS_NANO; | 618 | return IIO_VAL_INT_PLUS_NANO; |
621 | } else { | 619 | } else { |
622 | /* 1170mV / 2^23 * 6 */ | 620 | /* 1170mV / 2^23 * 6 */ |
623 | scale_uv = (1170ULL * 100000000ULL * 6ULL) | 621 | scale_uv = (1170ULL * 100000000ULL * 6ULL); |
624 | >> (chan->scan_type.realbits - | ||
625 | (unipolar ? 0 : 1)); | ||
626 | } | 622 | } |
627 | break; | 623 | break; |
628 | case IIO_TEMP: | 624 | case IIO_TEMP: |
629 | /* Always uses unity gain and internal ref */ | 625 | /* 1170mV / 0.81 mV/C / 2^23 */ |
630 | scale_uv = (2500ULL * 100000000ULL) | 626 | scale_uv = 1444444444444ULL; |
631 | >> (chan->scan_type.realbits - | ||
632 | (unipolar ? 0 : 1)); | ||
633 | break; | 627 | break; |
634 | default: | 628 | default: |
635 | return -EINVAL; | 629 | return -EINVAL; |
636 | } | 630 | } |
637 | 631 | ||
638 | *val2 = do_div(scale_uv, 100000000) * 10; | 632 | scale_uv >>= (chan->scan_type.realbits - (unipolar ? 0 : 1)); |
639 | *val = scale_uv; | 633 | *val = 0; |
640 | 634 | *val2 = scale_uv; | |
641 | return IIO_VAL_INT_PLUS_NANO; | 635 | return IIO_VAL_INT_PLUS_NANO; |
636 | case IIO_CHAN_INFO_OFFSET: | ||
637 | if (!unipolar) | ||
638 | *val = -(1 << (chan->scan_type.realbits - 1)); | ||
639 | else | ||
640 | *val = 0; | ||
641 | |||
642 | /* Kelvin to Celsius */ | ||
643 | if (chan->type == IIO_TEMP) { | ||
644 | unsigned long long offset; | ||
645 | unsigned int shift; | ||
646 | |||
647 | shift = chan->scan_type.realbits - (unipolar ? 0 : 1); | ||
648 | offset = 273ULL << shift; | ||
649 | do_div(offset, 1444); | ||
650 | *val -= offset; | ||
651 | } | ||
652 | return IIO_VAL_INT; | ||
642 | } | 653 | } |
643 | return -EINVAL; | 654 | return -EINVAL; |
644 | } | 655 | } |
@@ -676,7 +687,7 @@ static int ad7793_write_raw(struct iio_dev *indio_dev, | |||
676 | } | 687 | } |
677 | ret = 0; | 688 | ret = 0; |
678 | } | 689 | } |
679 | 690 | break; | |
680 | default: | 691 | default: |
681 | ret = -EINVAL; | 692 | ret = -EINVAL; |
682 | } | 693 | } |
@@ -720,9 +731,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
720 | .channel2 = 0, | 731 | .channel2 = 0, |
721 | .address = AD7793_CH_AIN1P_AIN1M, | 732 | .address = AD7793_CH_AIN1P_AIN1M, |
722 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 733 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
723 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 734 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
735 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
724 | .scan_index = 0, | 736 | .scan_index = 0, |
725 | .scan_type = IIO_ST('s', 24, 32, 0) | 737 | .scan_type = IIO_ST('u', 24, 32, 0) |
726 | }, | 738 | }, |
727 | .channel[1] = { | 739 | .channel[1] = { |
728 | .type = IIO_VOLTAGE, | 740 | .type = IIO_VOLTAGE, |
@@ -732,9 +744,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
732 | .channel2 = 1, | 744 | .channel2 = 1, |
733 | .address = AD7793_CH_AIN2P_AIN2M, | 745 | .address = AD7793_CH_AIN2P_AIN2M, |
734 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 746 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
735 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 747 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
748 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
736 | .scan_index = 1, | 749 | .scan_index = 1, |
737 | .scan_type = IIO_ST('s', 24, 32, 0) | 750 | .scan_type = IIO_ST('u', 24, 32, 0) |
738 | }, | 751 | }, |
739 | .channel[2] = { | 752 | .channel[2] = { |
740 | .type = IIO_VOLTAGE, | 753 | .type = IIO_VOLTAGE, |
@@ -744,9 +757,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
744 | .channel2 = 2, | 757 | .channel2 = 2, |
745 | .address = AD7793_CH_AIN3P_AIN3M, | 758 | .address = AD7793_CH_AIN3P_AIN3M, |
746 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 759 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
747 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 760 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
761 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
748 | .scan_index = 2, | 762 | .scan_index = 2, |
749 | .scan_type = IIO_ST('s', 24, 32, 0) | 763 | .scan_type = IIO_ST('u', 24, 32, 0) |
750 | }, | 764 | }, |
751 | .channel[3] = { | 765 | .channel[3] = { |
752 | .type = IIO_VOLTAGE, | 766 | .type = IIO_VOLTAGE, |
@@ -757,9 +771,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
757 | .channel2 = 2, | 771 | .channel2 = 2, |
758 | .address = AD7793_CH_AIN1M_AIN1M, | 772 | .address = AD7793_CH_AIN1M_AIN1M, |
759 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 773 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
760 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 774 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
775 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
761 | .scan_index = 3, | 776 | .scan_index = 3, |
762 | .scan_type = IIO_ST('s', 24, 32, 0) | 777 | .scan_type = IIO_ST('u', 24, 32, 0) |
763 | }, | 778 | }, |
764 | .channel[4] = { | 779 | .channel[4] = { |
765 | .type = IIO_TEMP, | 780 | .type = IIO_TEMP, |
@@ -769,7 +784,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
769 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 784 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
770 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 785 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, |
771 | .scan_index = 4, | 786 | .scan_index = 4, |
772 | .scan_type = IIO_ST('s', 24, 32, 0), | 787 | .scan_type = IIO_ST('u', 24, 32, 0), |
773 | }, | 788 | }, |
774 | .channel[5] = { | 789 | .channel[5] = { |
775 | .type = IIO_VOLTAGE, | 790 | .type = IIO_VOLTAGE, |
@@ -778,9 +793,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
778 | .channel = 4, | 793 | .channel = 4, |
779 | .address = AD7793_CH_AVDD_MONITOR, | 794 | .address = AD7793_CH_AVDD_MONITOR, |
780 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 795 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
781 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 796 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | |
797 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
782 | .scan_index = 5, | 798 | .scan_index = 5, |
783 | .scan_type = IIO_ST('s', 24, 32, 0), | 799 | .scan_type = IIO_ST('u', 24, 32, 0), |
784 | }, | 800 | }, |
785 | .channel[6] = IIO_CHAN_SOFT_TIMESTAMP(6), | 801 | .channel[6] = IIO_CHAN_SOFT_TIMESTAMP(6), |
786 | }, | 802 | }, |
@@ -793,9 +809,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
793 | .channel2 = 0, | 809 | .channel2 = 0, |
794 | .address = AD7793_CH_AIN1P_AIN1M, | 810 | .address = AD7793_CH_AIN1P_AIN1M, |
795 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 811 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
796 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 812 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
813 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
797 | .scan_index = 0, | 814 | .scan_index = 0, |
798 | .scan_type = IIO_ST('s', 16, 32, 0) | 815 | .scan_type = IIO_ST('u', 16, 32, 0) |
799 | }, | 816 | }, |
800 | .channel[1] = { | 817 | .channel[1] = { |
801 | .type = IIO_VOLTAGE, | 818 | .type = IIO_VOLTAGE, |
@@ -805,9 +822,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
805 | .channel2 = 1, | 822 | .channel2 = 1, |
806 | .address = AD7793_CH_AIN2P_AIN2M, | 823 | .address = AD7793_CH_AIN2P_AIN2M, |
807 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 824 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
808 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 825 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
826 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
809 | .scan_index = 1, | 827 | .scan_index = 1, |
810 | .scan_type = IIO_ST('s', 16, 32, 0) | 828 | .scan_type = IIO_ST('u', 16, 32, 0) |
811 | }, | 829 | }, |
812 | .channel[2] = { | 830 | .channel[2] = { |
813 | .type = IIO_VOLTAGE, | 831 | .type = IIO_VOLTAGE, |
@@ -817,9 +835,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
817 | .channel2 = 2, | 835 | .channel2 = 2, |
818 | .address = AD7793_CH_AIN3P_AIN3M, | 836 | .address = AD7793_CH_AIN3P_AIN3M, |
819 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 837 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
820 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 838 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
839 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
821 | .scan_index = 2, | 840 | .scan_index = 2, |
822 | .scan_type = IIO_ST('s', 16, 32, 0) | 841 | .scan_type = IIO_ST('u', 16, 32, 0) |
823 | }, | 842 | }, |
824 | .channel[3] = { | 843 | .channel[3] = { |
825 | .type = IIO_VOLTAGE, | 844 | .type = IIO_VOLTAGE, |
@@ -830,9 +849,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
830 | .channel2 = 2, | 849 | .channel2 = 2, |
831 | .address = AD7793_CH_AIN1M_AIN1M, | 850 | .address = AD7793_CH_AIN1M_AIN1M, |
832 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 851 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
833 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 852 | IIO_CHAN_INFO_SCALE_SHARED_BIT | |
853 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
834 | .scan_index = 3, | 854 | .scan_index = 3, |
835 | .scan_type = IIO_ST('s', 16, 32, 0) | 855 | .scan_type = IIO_ST('u', 16, 32, 0) |
836 | }, | 856 | }, |
837 | .channel[4] = { | 857 | .channel[4] = { |
838 | .type = IIO_TEMP, | 858 | .type = IIO_TEMP, |
@@ -842,7 +862,7 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
842 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 862 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
843 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 863 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, |
844 | .scan_index = 4, | 864 | .scan_index = 4, |
845 | .scan_type = IIO_ST('s', 16, 32, 0), | 865 | .scan_type = IIO_ST('u', 16, 32, 0), |
846 | }, | 866 | }, |
847 | .channel[5] = { | 867 | .channel[5] = { |
848 | .type = IIO_VOLTAGE, | 868 | .type = IIO_VOLTAGE, |
@@ -851,9 +871,10 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = { | |||
851 | .channel = 4, | 871 | .channel = 4, |
852 | .address = AD7793_CH_AVDD_MONITOR, | 872 | .address = AD7793_CH_AVDD_MONITOR, |
853 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 873 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | |
854 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 874 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | |
875 | IIO_CHAN_INFO_OFFSET_SHARED_BIT, | ||
855 | .scan_index = 5, | 876 | .scan_index = 5, |
856 | .scan_type = IIO_ST('s', 16, 32, 0), | 877 | .scan_type = IIO_ST('u', 16, 32, 0), |
857 | }, | 878 | }, |
858 | .channel[6] = IIO_CHAN_SOFT_TIMESTAMP(6), | 879 | .channel[6] = IIO_CHAN_SOFT_TIMESTAMP(6), |
859 | }, | 880 | }, |
@@ -901,7 +922,7 @@ static int __devinit ad7793_probe(struct spi_device *spi) | |||
901 | else if (voltage_uv) | 922 | else if (voltage_uv) |
902 | st->int_vref_mv = voltage_uv / 1000; | 923 | st->int_vref_mv = voltage_uv / 1000; |
903 | else | 924 | else |
904 | st->int_vref_mv = 2500; /* Build-in ref */ | 925 | st->int_vref_mv = 1170; /* Build-in ref */ |
905 | 926 | ||
906 | spi_set_drvdata(spi, indio_dev); | 927 | spi_set_drvdata(spi, indio_dev); |
907 | st->spi = spi; | 928 | st->spi = spi; |