From 6174801d7e9ff27b3a589fe766f4cd75de14c31b Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 20 Oct 2014 11:34:20 -0700 Subject: [PATCH] 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-format-patch failed