From: Ian Abbott Date: Fri, 31 Oct 2014 14:32:27 +0000 (+0000) Subject: staging: comedi: icp_multi: correct insn_bits returned data for DO X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cf5d2af6839deb2e7765648ce139dc9677db0c18;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: comedi: icp_multi: correct insn_bits returned data for DO For some unfathomable reason, the Comedi `insn_bits` handler for the digital output subdevice (`icp_multi_insn_bits_do()`) writes the digital output register and reads back the unrelated digital input register. Read back the current state of the outputs (held in `s->state`) instead. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/icp_multi.c b/drivers/staging/comedi/drivers/icp_multi.c index a412394bcdc9..fbbcab20a48b 100644 --- a/drivers/staging/comedi/drivers/icp_multi.c +++ b/drivers/staging/comedi/drivers/icp_multi.c @@ -53,7 +53,7 @@ Configuration options: not applicable, uses PCI auto config #define ICP_MULTI_AI 2 /* R: Analogue input data */ #define ICP_MULTI_DAC_CSR 4 /* R/W: DAC command/status register */ #define ICP_MULTI_AO 6 /* R/W: Analogue output data */ -#define ICP_MULTI_DI 8 /* R/W: Digital inouts */ +#define ICP_MULTI_DI 8 /* R/W: Digital inputs */ #define ICP_MULTI_DO 0x0A /* R/W: Digital outputs */ #define ICP_MULTI_INT_EN 0x0C /* R/W: Interrupt enable register */ #define ICP_MULTI_INT_STAT 0x0E /* R/W: Interrupt status register */ @@ -319,7 +319,7 @@ static int icp_multi_insn_bits_do(struct comedi_device *dev, if (comedi_dio_update_state(s, data)) writew(s->state, dev->mmio + ICP_MULTI_DO); - data[1] = readw(dev->mmio + ICP_MULTI_DI); + data[1] = s->state; return insn->n; }