123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef _MEDIA_DEVICE_H
- #define _MEDIA_DEVICE_H
- #include <linux/list.h>
- #include <linux/mutex.h>
- #include <linux/spinlock.h>
- #include <media/media-devnode.h>
- #include <media/media-entity.h>
- struct device;
- struct media_device {
-
- struct device *dev;
- struct media_devnode devnode;
- char model[32];
- char serial[40];
- char bus_info[32];
- u32 hw_revision;
- u32 driver_version;
- u32 entity_id;
- struct list_head entities;
-
- spinlock_t lock;
-
- struct mutex graph_mutex;
- int (*link_notify)(struct media_link *link, u32 flags,
- unsigned int notification);
- };
- #define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0
- #define MEDIA_DEV_NOTIFY_POST_LINK_CH 1
- #define to_media_device(node) container_of(node, struct media_device, devnode)
- int __must_check __media_device_register(struct media_device *mdev,
- struct module *owner);
- #define media_device_register(mdev) __media_device_register(mdev, THIS_MODULE)
- void media_device_unregister(struct media_device *mdev);
- int __must_check media_device_register_entity(struct media_device *mdev,
- struct media_entity *entity);
- void media_device_unregister_entity(struct media_entity *entity);
- #define media_device_for_each_entity(entity, mdev) \
- list_for_each_entry(entity, &(mdev)->entities, list)
- #endif
|