summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/uvc_configfs.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: uvc: Missing files for configfs interfacePetr Cvek2017-04-111-8/+8
| | | | | | | | | | | | | Commit 76e0da34c7ce ("usb-gadget/uvc: use per-attribute show and store methods") caused a stringification of an undefined macro argument "aname", so three UVC parameters (streaming_interval, streaming_maxpacket and streaming_maxburst) were named "aname". Add the definition of "aname" to the main macro and name the filenames as originaly intended. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* fs: configfs: don't return anything from drop_linkAndrzej Pietrasiewicz2016-12-011-20/+5
| | | | | | | | | | | | | | | | | | | Documentation/filesystems/configfs/configfs.txt says: "When unlink(2) is called on the symbolic link, the source item is notified via the ->drop_link() method. Like the ->drop_item() method, this is a void function and cannot return failure." The ->drop_item() is indeed a void function, the ->drop_link() is actually not. This, together with the fact that the value of ->drop_link() is silently ignored suggests, that it is the ->drop_link() return type that should be corrected and changed to void. This patch changes drop_link() signature and all its users. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> [hch: reverted reformatting of some code] Signed-off-by: Christoph Hellwig <hch@lst.de>
* usb: gadget: uvc: Fix return value in case of errorChristophe JAILLET2016-08-111-1/+1
| | | | | | | | | If this memory allocation fail, we will return 0, which means success. Return -ENOMEM instead. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* configfs: switch ->default groups to a linked listChristoph Hellwig2016-03-061-119/+79
| | | | | | | | | | | | | | | Replace the current NULL-terminated array of default groups with a linked list. This gets rid of lots of nasty code to size and/or dynamically allocate the array. While we're at it also provide a conveniant helper to remove the default groups. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Felipe Balbi <balbi@kernel.org> [drivers/usb/gadget] Acked-by: Joel Becker <jlbec@evilplan.org> Acked-by: Nicholas Bellinger <nab@linux-iscsi.org> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
* usb: gadget: uvc: fix permissions of configfs attributesMian Yousaf Kaukab2015-12-081-1/+1
| | | | | | | | | | | | 76e0da3 "usb-gadget/uvc: use per-attribute show and store methods" removed write permission for writeable attributes. Correct attribute permissions. Fixes: 76e0da3 "usb-gadget/uvc: use per-attribute show and store methods" Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb-gadget/uvc: use per-attribute show and store methodsChristoph Hellwig2015-10-131-244/+143
| | | | | | | | | | | | UVC is a little different from other configfs consumers in that it wants different function and field names from the exposed attribute name, so it keeps it's local macros to define attributes instead of using the common ones. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
* usb: gadget: uvc: comments for iterating over streaming hierarchyAndrzej Pietrasiewicz2015-01-271-0/+34
| | | | | | | | The purpose of the functions and their parametrs might not be obvious to the reader, so explain it. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: use explicit type instead of void *Andrzej Pietrasiewicz2015-01-271-2/+2
| | | | | | | | | | The first parameter of __uvcg_iter_strm_cls() is always used in the context of struct uvcg_streaming_header, so change the function prototype accordingly. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: preserve the address passed to kfree()Andrzej Pietrasiewicz2015-01-191-3/+7
| | | | | | | | | | __uvcg_fill_strm() called from __uvcg_iter_stream_cls() might have advanced the "data" even if __uvcg_iter_stream_cls() returns an error, so use a backup copy as an argument to kfree(). Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: cleanup UVCG_FRAME_ATTR macroDan Carpenter2015-01-191-26/+18
| | | | | | | | | | | | | | | | 1) Change "conv" an "vnoc" to "to_cpu_endian" to "to_little_endian". 2) No need to check the "limit" because that is already handled in kstrtoXX so delete that parameter along with the check. 3) By using a "bits" parameter, we can combine the "uxx" parameter and the "str2u" parameters. 4) The kstrtou##bits() conversion does not need to be done under the mutex so move it to the start of the function. 5) Change the name of "identity_conv" to "noop_conversion". Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: memory leak in uvcg_frame_make()Dan Carpenter2015-01-191-0/+1
| | | | | | | | | We need to add a kfree(h) on an error path. Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: remove an impossible conditionDan Carpenter2015-01-191-2/+0
| | | | | | | | | | "num" is a u32 so "(num > 0xFFFFFFFF)" is never true. Also the range is already checked in kstrtou32(). Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: fix some error codesDan Carpenter2015-01-191-7/+7
| | | | | | | | | | We're basically saying ERR_CAST(NULL) and PTR_ERR(NULL) here, which is nonsensical. Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: to_uvcg_control_header() can be statickbuild test robot2015-01-151-16/+16
| | | | | | | | | | | | | | | | | | | | | | drivers/usb/gadget/function/uvc_configfs.c:46:28: sparse: symbol 'to_uvcg_control_header' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:138:25: sparse: symbol 'uvcg_control_header_type' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:164:6: sparse: symbol 'uvcg_control_header_drop' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:721:20: sparse: symbol 'to_uvcg_format' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:798:30: sparse: symbol 'to_uvcg_streaming_header' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:950:25: sparse: symbol 'uvcg_streaming_header_type' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:976:6: sparse: symbol 'uvcg_streaming_header_drop' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1020:19: sparse: symbol 'to_uvcg_frame' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1265:25: sparse: symbol 'uvcg_frame_type' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1315:6: sparse: symbol 'uvcg_frame_drop' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1338:26: sparse: symbol 'to_uvcg_uncompressed' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1548:25: sparse: symbol 'uvcg_uncompressed_type' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1586:6: sparse: symbol 'uvcg_uncompressed_drop' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1610:19: sparse: symbol 'to_uvcg_mjpeg' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1761:25: sparse: symbol 'uvcg_mjpeg_type' was not declared. Should it be static? drivers/usb/gadget/function/uvc_configfs.c:1793:6: sparse: symbol 'uvcg_mjpeg_drop' was not declared. Should it be static? Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: uvc: configfs support in uvc functionAndrzej Pietrasiewicz2015-01-121-0/+2439
Add support for using the uvc function as a component of USB gadgets composed with configfs. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud