MLK-24795-3: mic: vop: module autoprobing support for vop drivers
Add vop support to MODULE_DEVICE_TABLE() by adding info about struct vop_device_id in devicetable-offsets.c and add a vop entry point in file2alias.c. The type argument for MODULE_DEVICE_TABLE(type, name) is vop. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
This commit is contained in:
parent
0b77905613
commit
f7349db6e9
|
@ -14,16 +14,11 @@
|
|||
*/
|
||||
#include <linux/dmaengine.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#include "../common/mic_dev.h"
|
||||
|
||||
struct vop_device_id {
|
||||
u32 device;
|
||||
u32 vendor;
|
||||
};
|
||||
|
||||
#define VOP_DEV_TRNSP 1
|
||||
#define VOP_DEV_ANY_ID 0xffffffff
|
||||
/*
|
||||
* Size of the internal buffer used during DMA's as an intermediate buffer
|
||||
* for copy to/from user. Must be an integral number of pages.
|
||||
|
|
|
@ -827,4 +827,11 @@ struct wmi_device_id {
|
|||
const void *context;
|
||||
};
|
||||
|
||||
/* vop */
|
||||
struct vop_device_id {
|
||||
__u32 device;
|
||||
__u32 vendor;
|
||||
};
|
||||
#define VOP_DEV_ANY_ID 0xffffffff
|
||||
|
||||
#endif /* LINUX_MOD_DEVICETABLE_H */
|
||||
|
|
|
@ -231,5 +231,9 @@ int main(void)
|
|||
DEVID(wmi_device_id);
|
||||
DEVID_FIELD(wmi_device_id, guid_string);
|
||||
|
||||
DEVID(vop_device_id);
|
||||
DEVID_FIELD(vop_device_id, device);
|
||||
DEVID_FIELD(vop_device_id, vendor);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1335,6 +1335,21 @@ static int do_wmi_entry(const char *filename, void *symval, char *alias)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* Looks like: vop:dNvN */
|
||||
static int do_vop_entry(const char *filename, void *symval,
|
||||
char *alias)
|
||||
{
|
||||
DEF_FIELD(symval, vop_device_id, device);
|
||||
DEF_FIELD(symval, vop_device_id, vendor);
|
||||
|
||||
strcpy(alias, "vop:");
|
||||
ADD(alias, "d", device != VOP_DEV_ANY_ID, device);
|
||||
ADD(alias, "v", vendor != VOP_DEV_ANY_ID, vendor);
|
||||
|
||||
add_wildcard(alias);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Does namelen bytes of name exactly match the symbol? */
|
||||
static bool sym_is(const char *name, unsigned namelen, const char *symbol)
|
||||
{
|
||||
|
@ -1407,6 +1422,7 @@ static const struct devtable devtable[] = {
|
|||
{"typec", SIZE_typec_device_id, do_typec_entry},
|
||||
{"tee", SIZE_tee_client_device_id, do_tee_entry},
|
||||
{"wmi", SIZE_wmi_device_id, do_wmi_entry},
|
||||
{"vop", SIZE_vop_device_id, do_vop_entry},
|
||||
};
|
||||
|
||||
/* Create MODULE_ALIAS() statements.
|
||||
|
|
Loading…
Reference in New Issue