linux-stable/drivers/staging
Ian Abbott 279dd75cec staging: comedi: dt2815: fix writing hi byte of analog output
commit ed87d33ddb upstream.

The DT2815 analog output command is 16 bits wide, consisting of the
12-bit sample value in bits 15 to 4, the channel number in bits 3 to 1,
and a voltage or current selector in bit 0.  Both bytes of the 16-bit
command need to be written in turn to a single 8-bit data register.
However, the driver currently only writes the low 8-bits.  It is broken
and appears to have always been broken.

Electronic copies of the DT2815 User's Manual seem impossible to find
online, but looking at the source code, a best guess for the sequence
the driver intended to use to write the analog output command is as
follows:

1. Wait for the status register to read 0x00.
2. Write the low byte of the command to the data register.
3. Wait for the status register to read 0x80.
4. Write the high byte of the command to the data register.

Step 4 is missing from the driver.  Add step 4 to (hopefully) fix the
driver.

Also add a "FIXME" comment about setting bit 0 of the low byte of the
command.  Supposedly, it is used to choose between voltage output and
current output, but the current driver always sets it to 1.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200406142015.126982-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-29 16:33:20 +02:00
..
android staging: android: ashmem: Disallow ashmem memory from being remapped 2020-02-28 17:22:15 +01:00
axis-fifo staging: axis-fifo: add unspecified HAS_IOMEM dependency 2020-01-12 12:21:35 +01:00
board
clocking-wizard
comedi staging: comedi: dt2815: fix writing hi byte of analog output 2020-04-29 16:33:20 +02:00
emxx_udc
exfat
fbtft fbtft: Make sure string is NULL terminated 2019-12-31 16:45:42 +01:00
fieldbus
fsl-dpaa2
fwserial
gasket staging: gasket: Fix incongruency in handling of sysfs entries creation 2020-04-29 16:33:14 +02:00
gdm724x
goldfish
greybus staging: greybus: loopback_test: fix potential path truncations 2020-03-25 08:25:59 +01:00
gs_fpgaboot
iio staging: iio: ad9834: add a check for devm_clk_get 2019-12-31 16:44:11 +01:00
isdn
kpc2000 staging: kpc2000: prevent underflow in cpld_reconfigure() 2020-04-01 11:02:16 +02:00
ks7010
media media: hantro: Read be32 words starting at every fourth byte 2020-04-17 10:50:08 +02:00
most staging: most: net: fix buffer overflow 2020-02-01 09:34:33 +00:00
mt7621-dma
mt7621-dts
mt7621-pci staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute' 2020-02-01 09:34:47 +00:00
mt7621-pci-phy
mt7621-pinctrl
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
ralink-gdma
rtl8188eu staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device table 2020-04-01 11:02:16 +02:00
rtl8192e
rtl8192u
rtl8712
rtl8723bs staging: rtl8723bs: fix copy of overlapping memory 2020-02-28 17:22:26 +01:00
rts5208
sm750fb
speakup staging/speakup: fix get_word non-space look-ahead 2020-03-25 08:25:55 +01:00
unisys
uwb
vc04_services
vme
vt6655
vt6656 staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi. 2020-02-28 17:22:15 +01:00
wilc1000 staging: wilc1000: avoid double unlocking of 'wilc->hif_cs' mutex 2020-04-17 10:50:00 +02:00
wlan-ng staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback 2020-04-01 11:02:17 +02:00
wusbcore
Kconfig
Makefile