summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2023-10-19 14:31:26 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-21 11:56:26 +0200
commit1fa05877588a02fdad995385eaafea4798022cd4 (patch)
tree73f60798327d6681ee2752e483af448c8d675812 /drivers
parent75fd2810b08a4854af3928121a301e50376288d2 (diff)
staging: vc04_services: Support module autoloading using MODULE_DEVICE_TABLE
VC04 has now a independent bus vchiq_bus to register its devices. However, the module auto-loading for bcm2835-audio and bcm2835-camera currently happens through MODULE_ALIAS() macro specified explicitly. The correct way to auto-load a module, is when the alias is picked out from MODULE_DEVICE_TABLE(). In order to get there, we need to introduce vchiq_device_id and add relevant entries in file2alias.c infrastructure so that aliases can be generated. This patch targets adding vchiq_device_id and do_vchiq_entry, in order to generate those alias using the /script/mod/file2alias.c. Going forward the MODULE_ALIAS() from bcm2835-camera and bcm2835-audio will be dropped, in favour of MODULE_DEVICE_TABLE being used there. The alias format for vchiq_bus devices will be "vchiq:<dev_name>". Adjust the vchiq_bus_uevent() to reflect that. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Link: https://lore.kernel.org/r/20231019090128.430297-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c2
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 0076d091b9b2..933027e0011e 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -26,7 +26,7 @@ static int vchiq_bus_uevent(const struct device *dev, struct kobj_uevent_env *en
{
const struct vchiq_device *device = container_of_const(dev, struct vchiq_device, dev);
- return add_uevent_var(env, "MODALIAS=%s", dev_name(&device->dev));
+ return add_uevent_var(env, "MODALIAS=vchiq:%s", dev_name(&device->dev));
}
static int vchiq_bus_probe(struct device *dev)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
index 7eaaf9a91cda..caa6fdf25bb1 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
@@ -7,6 +7,7 @@
#define _VCHIQ_DEVICE_H
#include <linux/device.h>
+#include <linux/mod_devicetable.h>
struct vchiq_device {
struct device dev;
@@ -18,6 +19,8 @@ struct vchiq_driver {
int (*resume)(struct vchiq_device *device);
int (*suspend)(struct vchiq_device *device,
pm_message_t state);
+
+ const struct vchiq_device_id *id_table;
struct device_driver driver;
};