[PATCH 12/30] staging: comedi: dmm32at: use 8255 module for Digital I/O subdevice
Ian Abbott
abbotti at mev.co.uk
Wed Nov 12 10:12:29 UTC 2014
On 11/11/14 23:55, H Hartley Sweeten wrote:
> The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to
> provide the 24 digital I/O lines. The only quirk is the need to set the page
> selection bits in the control register to select page 1 addresses.
>
> Instead of duplicating the 8255 code, provide an (*io) callback and use the
> 8255 module to support this subdevice.
>
> This also removes the need for the private data in this driver.
The patch is fine, but there's a bug in the original code which means we
might need the private data back (unless the DMM32AT_CNTRL register is
read-write rather than read-only). The bug is that the ISR routine
clobbers the page selection bits in the register. To avoid that, the
current page would either need to be stored in private data or read from
the register (if possible) to avoid clobbering it, and updates to the
register would need a spin-lock.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti at mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
More information about the devel
mailing list