Re: [PATCH] staging/comedi: Fix undefined array subscript

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-02-13 11:56, Ian Abbott wrote:
For a digital output subdevice, you could either read back the current
values directly from the hardware or just use the value previously
written.  The Velleman K8055 doesn't have a command to read back the
digital outputs from the hardware, so the last written value has to be
used.  But what if the digital outputs have never been written (or the
analog outputs have never been written, since the same command updates
all analog and digital channels)?  A "reset" command is sent to the
hardware on initialization by vmk80xx_reset_device() (only called for
the K8055), but I don't know what effect this has on the actual digital
(and analog) outputs (though I could find out easily enough as we appear
to have one of these kits (assembled) lying around in the office).  If
necessary, we may have to also send a "write" command on initialization
to make the hardware outputs match the initial software state.

I've had a quick play with a K8055 and it seems the "reset" command issued during hardware initialization has no effect on the digital outputs. (I tested this by setting some digital outputs with comedi instructions - there are some handy LEDs on the board that light up or not according to the state of the digital outputs - then rmmod'ing and modprobe'ing the vmk80xx module - the LEDs remained in the same state.)

Since we can't read back the outputs on this board we should initialize them to a known state. I'll submit some patches later.

Nothing to do with the patch in this thread, which has my Ack.

Acked-by: Ian Abbott <abbotti@xxxxxxxxx>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux