diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-12-03 15:15:32 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-12-12 13:43:39 -0600 |
commit | 4b187fceec3c731815ff8e6a7317fd5ba50d1d5d (patch) | |
tree | 583fa76e4a4eab4513c38c3d05f85bc03de1f3c3 /drivers/usb/gadget/u_fs.h | |
parent | e72c39c0692d17da4c7f08e20d6c57f7409415f7 (diff) | |
download | op-kernel-dev-4b187fceec3c731815ff8e6a7317fd5ba50d1d5d.zip op-kernel-dev-4b187fceec3c731815ff8e6a7317fd5ba50d1d5d.tar.gz |
usb: gadget: FunctionFS: add devices management code
This will be required in order to use the new function interface
(usb_get_function_instance/usb_put_function_instance)
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyunmgin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/u_fs.h')
-rw-r--r-- | drivers/usb/gadget/u_fs.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_fs.h b/drivers/usb/gadget/u_fs.h index 5d9229a..2d00f9d 100644 --- a/drivers/usb/gadget/u_fs.h +++ b/drivers/usb/gadget/u_fs.h @@ -17,12 +17,36 @@ #define U_FFS_H #include <linux/usb/composite.h> +#include <linux/list.h> +#include <linux/mutex.h> struct ffs_dev { const char *name; bool mounted; bool desc_ready; + bool single; struct ffs_data *ffs_data; + struct list_head entry; + + int (*ffs_ready_callback)(struct ffs_data *ffs); + void (*ffs_closed_callback)(struct ffs_data *ffs); }; +extern struct mutex ffs_lock; + +static inline void ffs_dev_lock(void) +{ + mutex_lock(&ffs_lock); +} + +static inline void ffs_dev_unlock(void) +{ + mutex_unlock(&ffs_lock); +} + +struct ffs_dev *ffs_alloc_dev(void); +int ffs_name_dev(struct ffs_dev *dev, const char *name); +int ffs_single_dev(struct ffs_dev *dev); +void ffs_free_dev(struct ffs_dev *dev); + #endif /* U_FFS_H */ |