linux_dsm_epyc7002/drivers/iio/adc
David Lechner e2540da86e iio: adc: ti-ads7950: use SPI_CS_WORD to reduce CPU usage
This changes how the SPI message for the triggered buffer is setup in
the TI ADS7950 A/DC driver. By using the SPI_CS_WORD flag, we can read
multiple samples in a single SPI transfer. If the SPI controller
supports DMA transfers, we can see a significant reduction in CPU usage.

For example, on an ARM9 system running at 456MHz reading just 4 channels
at 100Hz: before this change, top shows the CPU usage of the IRQ thread
of this driver to be ~7.7%. After this change, the CPU usage drops to
~3.8%.

The use of big-endian for the raw data was cargo culted from another
driver when this driver was originally written. It used an SPI word size
of 8 bits and big-endian byte ordering to effectively emulate 16 bit
words.

Now, in order to inject a CS toggle between each word, we need to use
the correct word size, otherwise we would get a CS toggle half way
through each word 16-bit. The SPI subsystem uses CPU byte ordering for
multi-byte words. So, the data we get back from the SPI is going to be
CPU endian now no matter what. Converting that to big endian will just
add overhead on little endian systems so we opt to change the raw data
format from big endian to CPU endian.

There is a small risk that this could break some lazy userspace programs
that use the raw data without checking the data format. We can address
this if/when it actually comes up.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-22 10:09:47 +01:00
..
ad799x.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad7266.c
ad7291.c
ad7298.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad7476.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad7766.c
ad7791.c
ad7793.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad7887.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad7923.c drivers: iio: Update MODULE AUTHOR email address 2018-08-19 17:23:39 +01:00
ad_sigma_delta.c iio: ad_sigma_delta: use unsigned long for timeout 2018-07-28 12:15:03 +01:00
aspeed_adc.c
at91_adc.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
at91-sama5d2_adc.c iio: adc: at91-sama5d2_adc: fix up casting in at91_adc_read_info_raw() 2018-07-23 19:18:12 +01:00
axp20x_adc.c
axp288_adc.c
bcm_iproc_adc.c
berlin2-adc.c
cc10001_adc.c
cpcap-adc.c
da9150-gpadc.c
dln2-adc.c
envelope-detector.c iio: envelope-detector: switch to SPDX license identifier 2018-08-20 19:27:05 +01:00
ep93xx_adc.c
exynos_adc.c
fsl-imx25-gcq.c
hi8435.c
hx711.c iio: hx711: add delay until DOUT is ready 2018-07-15 09:36:38 +01:00
imx7d_adc.c iio: adc: fix spelling mistake: "Freeacale" -> "Freescale" 2018-05-22 18:17:57 +01:00
ina2xx-adc.c iio: adc: ina2xx: avoid kthread_stop() with stale task_struct 2018-07-07 17:06:39 +01:00
Kconfig iio: adc: add support for mcp3911 2018-08-19 20:02:48 +01:00
lp8788_adc.c
lpc18xx_adc.c
lpc32xx_adc.c
ltc2471.c
ltc2485.c
ltc2497.c
Makefile iio: adc: add support for mcp3911 2018-08-19 20:02:48 +01:00
max1027.c treewide: devm_kmalloc() -> devm_kmalloc_array() 2018-06-12 16:19:22 -07:00
max1118.c
max1363.c iio: adc: max1363: merge calls to of_match_device and of_device_get_match_data 2018-07-08 10:35:17 +01:00
max9611.c iio: adc: max9611: explicitly cast gain_selectors 2018-08-19 17:48:04 +01:00
max11100.c
mcp320x.c
mcp3422.c
mcp3911.c iio: adc: add support for mcp3911 2018-08-19 20:02:48 +01:00
men_z188_adc.c
meson_saradc.c iio: adc: meson-saradc: add support for the Meson8m2 SoCs 2018-07-23 19:18:13 +01:00
mt6577_auxadc.c
mxs-lradc-adc.c
nau7802.c
palmas_gpadc.c
qcom-pm8xxx-xoadc.c iio: Convert to using %pOFn instead of device_node.name 2018-09-02 18:54:31 +01:00
qcom-spmi-adc5.c iio: adc: qcom-spmi-adc5: Verify channel numbers from DT 2018-09-02 18:52:04 +01:00
qcom-spmi-iadc.c
qcom-spmi-vadc.c
qcom-vadc-common.c iio: adc: Add QCOM SPMI PMIC5 ADC driver 2018-08-18 18:11:43 +01:00
qcom-vadc-common.h iio: adc: Add QCOM SPMI PMIC5 ADC driver 2018-08-18 18:11:43 +01:00
rcar-gyroadc.c iio: Convert to using %pOFn instead of device_node.name 2018-09-02 18:54:31 +01:00
rockchip_saradc.c
sc27xx_adc.c iio: adc: sc27xx: Add ADC scale calibration 2018-09-02 09:52:55 +01:00
sd_adc_modulator.c
spear_adc.c
stm32-adc-core.c
stm32-adc-core.h
stm32-adc.c
stm32-dfsdm-adc.c Staging/IIO patches for 4.18-rc1 2018-06-09 10:32:39 -07:00
stm32-dfsdm-core.c
stm32-dfsdm.h
stx104.c
sun4i-gpadc-iio.c
ti_am335x_adc.c
ti-adc081c.c
ti-adc084s021.c
ti-adc108s102.c
ti-adc128s052.c
ti-adc161s626.c
ti-adc0832.c
ti-adc12138.c
ti-ads1015.c
ti-ads7950.c iio: adc: ti-ads7950: use SPI_CS_WORD to reduce CPU usage 2018-09-22 10:09:47 +01:00
ti-ads8688.c iio: adc: ti-ads8688: add trigger and buffer support 2018-05-12 12:00:30 +01:00
ti-tlc4541.c
twl4030-madc.c
twl6030-gpadc.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
vf610_adc.c
viperboard_adc.c
xilinx-xadc-core.c iio: adc: xilinx: Move request_irq before enabling interrupts 2018-07-29 13:30:35 +01:00
xilinx-xadc-events.c
xilinx-xadc.h iio: adc: xilinx: Remove platform_get_irq from xadc_remove function 2018-07-29 12:52:21 +01:00