regmaps with different register sizes

Hendrik v. Raven hendrik at
Fri Sep 15 11:10:28 EDT 2017


I currently try to develop a device driver for the National Instruments
X-series DAQ cards. These are PCIe cards with real-time capable analog
and digital i/o modules. All of these are configured through many
registers in combination with dma. I thought of using regmap-mmio to
configure all these registers.

However the register size is not homogenous throughout the device.
Depending on the submodule they use 8, 16, 32 or 64 bit registers. Would
it be a problem to use several regmaps in parallel, one per register size?
Assuming this would work I've seen the regmap_fields API. It would be
nice to use as it would hide the different regmaps inside the
regmap_field struct. However the device has many registers and even more
fields (didn't count, but many hundred). Is it ok to allocate this many
regmap_fields dynamically? I am wondering as all information except the
regmap pointer is static.

Another question for the same device: The device has the actual output
modules and a custom DMA chip (NI CHInCh). As the DMA seems to be a
special component of the chip, should I still try to integrate it into
the dmaengine framework? And if so, how do I register the modules to
have the pci device shared between DMA and DAQ components?


More information about the Kernelnewbies mailing list