From: H Hartley Sweeten Date: Mon, 20 Oct 2014 18:34:20 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: fix apci3120_ao_insn_write() X-Git-Tag: omap-for-v3.19/fixes-rc1~73^2~806 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6174801d7e9ff27b3a589fe766f4cd75de14c31b;p=pandora-kernel.git staging: comedi: addi_apci_3120: fix apci3120_ao_insn_write() The comedi core expects (*insn_write) functions to write insn->n values and return the number of values written or an errno. This function currently returns insn->n but it only writes a single data value. Fix the function to work like the core expects. There are two registers used to update the analog outputs. Offset 0x08 is used to update channels 0-3 and offset 0x0a to update channels 4-7. Bits 14 and 15 in each register set the mux to select which channel to update. The lower 14 bits are the value used to set the DAC. For aesthetics, tidy up the defines used for the register offsets and bits in the registers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed