usb: gadget: f_fs: add poll for endpoint 0 66/87866/2 accepted/tizen/mobile/20160912.093254 submit/tizen/20160912.020407
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Wed, 7 Sep 2016 19:24:12 +0000 (21:24 +0200)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Mon, 12 Sep 2016 01:56:20 +0000 (10:56 +0900)
commitf510d3e4ccd7dcb769d11e34f4d0cf0474bbcffc
tree195aa226ed197ce76892513aeffee172b9590b7f
parentf61f53eef2852f35ca9feaaec65a4a8c8ed256ee
usb: gadget: f_fs: add poll for endpoint 0

This patch adds poll function for file representing ep0.

Ability of read from or write to ep0 file is related with actual state of ffs:
- When desctiptors or strings are not written yet, POLLOUT flag is set.
- If there is any event to read, POLLIN flag is set.
- If setup request was read, POLLIN and POLLOUT flag is set, to allow
  send response (by performing I/O operation consistent with setup request
  direction) or set stall (by performing I/O operation opposite  setup
  request direction).

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[Backported from mainline commit 23de91e]
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Change-Id: I4286847252357b4796cc3794ce71d5a4ec2af9f5
drivers/usb/gadget/f_fs.c