+struct vchiq_device *
+vchiq_device_register(struct device *parent, const char *name)
+{
+ struct vchiq_device *device;
+ int ret;
+
+ device = kzalloc(sizeof(*device), GFP_KERNEL);
+ if (!device) {
+ dev_err(parent, "Cannot register %s: Insufficient memory\n",
+ name);
+ return NULL;
+ }
+
+ device->dev.init_name = name;
+ device->dev.parent = parent;
+ device->dev.bus = &vchiq_bus_type;
+ device->dev.release = vchiq_device_release;
+
+ of_dma_configure(&device->dev, parent->of_node, true);
+ ret = dma_set_mask_and_coherent(&device->dev, DMA_BIT_MASK(32));
+ if (ret) {
+ dev_err(&device->dev, "32-bit DMA enable failed\n");
+ return NULL;
+ }
Unfortunately the call of of_dma_configure() generates warnings likes
this (Raspberry Pi 3A+ with multi_v7_defconfig + VCHIQ):
[ 9.206802] vchiq-bus bcm2835-audio: DMA mask not set
[ 9.206892] vchiq-bus bcm2835-camera: DMA mask not set
huh, really weird, as on my RPi-3-b I get these set correctly and I don't any such warning.