summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pch_udc.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-06usb/gadget/pch_udc: Fix compile errorTomoya MORINAGA1-0/+1
Greg's e-mail address was old. So, I resend it. Though I've tested this patch, http://marc.info/?l=linux-usb&m=132825305710285&w=2, I've received the following reports. http://kisskb.ellerman.id.au/kisskb/buildresult/5771890/ http://kisskb.ellerman.id.au/kisskb/buildresult/5771905/ So, I added header file for these symbols. Using this patch, this compile error must be disappeared. Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disableIdo Shayevitz1-0/+1
This fix a bug in f_serial, which expect the ep->desc to be NULL after disabling an endpoint. Cc: stable@vger.kernel.org Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-09usb: gadget: pch_udc: Detecting VBUS through GPIO with interruptTomoya MORINAGA1-4/+83
Problem: pch_udc continues operation even if VBUS becomes Low. pch_udc performs D+ pulling up before VBUS becomes High. USB device should be controlled according to VBUS state. Root cause: The current pch_udc is not always monitoring VBUS. Solution: The change of VBUS is detected using an interrupt of GPIO. If VBUS became Low, pch_udc handles 'disconnect'. After VBUS became High, a pull improves D+, and pch_udc handles 'connect'. [ balbi@ti.com : make it actually compile ] Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-02-09usb: gadget: pch_udc: Detecting VBUS through GPIOTomoya MORINAGA1-3/+142
Problem: In USB Suspend, pch_udc handles 'disconnect'. Root cause: The current pch_udc is not monitoring VBUS. When USB cable is disconnected, USB Device Controller generates an interrupt of USB Suspend. pch_udc cannot distinguish it is USB Suspend or disconnect. Therefore, pch_udc handles 'disconnect' after an interrupt of USB Suspend happend. Solution: VBUS is detected through GPIO. After an interrupt produced USB Suspend, if VBUS is Low, pch_udc handles 'disconnect'. If VBUS is High, pch_udc handles 'suspend'. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Add debug messageTomoya MORINAGA1-2/+6
ISSUE: Adding debugging messages. CAUSE: The debugging messages are added to make sure of that major interrupt events are occurring. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Reduce redundant interruptTomoya MORINAGA1-3/+6
ISSUE: USB Suspend interrupts occur frequently. CAUSE: When it is called pch_udc_reconnect() in USB Suspend, it repeats reset and Suspend. SOLUTION: pch_udc_reconnect() does not enable all interrupts. When an enumeration event occurred the driver enables all interrupts. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget ↵Tomoya MORINAGA1-4/+66
connect/disconnect issue ISSUE: After a USB cable is connect/disconnected, the system rarely freezes. CAUSE: Since the USB device controller cannot know to disconnect the USB cable, when it is used without detecting VBUS by GPIO, the UDC driver does not notify to USB Gadget. Since USB Gadget cannot know to disconnect, a false setting occurred when the USB cable is connected/disconnect repeatedly. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Fix USB suspend issueTomoya MORINAGA1-1/+8
ISSUE: After USB Suspend, a system rarely freezes. CAUSE: When USB Suspend occurred, the driver is not notifying a gadget of the event. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Fix wrong return valueTomoya MORINAGA1-1/+3
ISSUE: If the return value of pch_udc_pcd_init() is False, the return value of this function is unsettled. Since pch_udc_pcd_init() always returns 0, there is not actually the issue. CAUSE: If pch_udc_pcd_init() is True, the variable, retval, is not set for an appropriate value. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-24usb: gadget: pch_udc: Fix disconnect issueTomoya MORINAGA1-1/+4
ISSUE: When the driver notifies a gadget of a disconnect event, a system rarely freezes. CAUSE: When the driver calls dev->driver->disconnect(), it is not calling spin_unlock(). Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-1/+1
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-12-12usb: gadget: rename usb_gadget_driver::speed to max_speedMichal Nazarewicz1-1/+1
This commit renames the “speed” field of the usb_gadget_driver structure to “max_speed”. This is so that to make it more apparent that the field represents the maximum speed gadget driver can support. This also make the field look more like fields with the same name in usb_gadget and usb_composite_driver structures. All of those represent the *maximal* speed given entity supports. After this commit, there are the following fields in various structures: * usb_gadget::speed - the current connection speed, * usb_gadget::max_speed - maximal speed UDC supports, * usb_gadget_driver::max_speed - maximal speed gadget driver supports, and * usb_composite_driver::max_speed - maximal speed composite gadget supports. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12usb: gadget: replace usb_gadget::is_dualspeed with max_speedMichal Nazarewicz1-1/+1
This commit replaces usb_gadget's is_dualspeed field with a max_speed field. [ balbi@ti.com : Fixed DWC3 driver ] Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-11-15USB: pch_udc: Change company name OKI SEMICONDUCTOR to LAPIS SemiconductorTomoya MORINAGA1-2/+2
On October 1 in 2011, OKI SEMICONDUCTOR Co., Ltd. changed the company name in to LAPIS Semiconductor Co., Ltd. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-15USB: pch_udc: Support new device LAPIS Semiconductor ML7831 IOHTomoya MORINAGA1-0/+6
ML7831 is companion chip for Intel Atom E6xx series. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09usb gadget: clean up FSF boilerplate textKlaus Schwarzkopf1-9/+0
remove the following two paragraphs as they are not needed: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23USB: use usb_endpoint_maxp() instead of le16_to_cpu()Kuninori Morimoto1-3/+3
Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size instead of le16_to_cpu(desc->wMaxPacketSize). This patch fix it up Cc: Armin Fuerst <fuerst@in.tum.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: Johannes Erdfelt <johannes@erdfelt.com> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Oliver Neukum <oliver@neukum.name> Cc: David Kubicek <dave@awk.cz> Cc: Johan Hovold <jhovold@gmail.com> Cc: Brad Hards <bhards@bigpond.net.au> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de> Cc: David Brownell <david-b@pacbell.net> Cc: David Lopo <dlopo@chipidea.mips.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Xie Xiaobo <X.Xie@freescale.com> Cc: Li Yang <leoli@freescale.com> Cc: Jiang Bo <tanya.jiang@freescale.com> Cc: Yuan-hsin Chen <yhchen@faraday-tech.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Xiaochen Shen <xiaochen.shen@intel.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Ben Dooks <ben@simtec.co.uk> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Herbert Pötzl <herbert@13thfloor.at> Cc: Arnaud Patard <arnaud.patard@rtp-net.org> Cc: Roman Weissgaerber <weissg@vienna.at> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Tony Olech <tony.olech@elandigitalsystems.com> Cc: Florian Floe Echtler <echtler@fs.tum.de> Cc: Christian Lucht <lucht@codemercs.com> Cc: Juergen Stuber <starblue@sourceforge.net> Cc: Georges Toth <g.toth@e-biz.lu> Cc: Bill Ryder <bryder@sgi.com> Cc: Kuba Ober <kuba@mareimbrium.org> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28usb: gadget: convert all users to the new udc infrastructureSebastian Andrzej Siewior1-4/+12
peripheral drivers are using usb_add_gadget()/usb_del_gadget() to register/unregister to the udc-core. The udc-core will take the first available gadget driver and attach function driver which is calling usb_gadget_register_driver(). This is the same behaviour we have right now. Only dummy_hcd was tested, the others were compiled tested. Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Dan Carpenter <error27@gmail.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: Li Yang <leoli@freescale.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Pavankumar Kondeti <pkondeti@codeaurora.org> Cc: Roy Huang <roy.huang@analog.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Cc: Xiaochen Shen <xiaochen.shen@intel.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com> Cc: cxie4 <cxie4@marvell.com> Cc: linux-geode@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-13usb: pch_udc: unlock on allocation failureDan Carpenter1-3/+5
There was an unlock missing on the error path. Also I did a small cleanup by changing ep->dev->lock for just dev->lock. They're the same lock, but dev->lock is shorter and that's how it is used for the spin_unlock_irqrestore() call. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-17usb: pch_udc: Fixed issue which does not work with g_etherToshiharu Okada1-74/+104
This PCH_UDC driver does not work normally when "Ethernet gadget" is used. This patch fixed this issue. The following was modified. - The FIFO flush process. - The descriptor creation process. - The adjustment of DMA buffer align. Currently the PCH_UDC driver can work normally with "Ethernet gadget", "Serial gadget" or "File-backed Storage Gadget". Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22usb: pch_udc: Fix the worning log issue at gadget driver removeToshiharu Okada1-1/+2
When removing a serial gadget driver, the kernel warning message is outputted. This patch fixed this issue. The pch_udc driver did not have disconnection processing of gadget. Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22USB: pch_udc: support new device ML7213 IOHTomoya MORINAGA1-0/+7
Support new device OKI SEMICONDUCTOR's ML7213 IOH(Input/Output Hub) which is for IVI(In-Vehicle Infotainment) use. The ML7213 is companion chip for Intel Atom E6xx series. The ML7213 is completely compatible for Intel EG20T PCH. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22usb: pch_udc: Fixed issue which does not work with g_serialToshiharu Okada1-50/+67
This PCH_UDC driver does not work normally when "Serial gadget" is used. The receiving data of control transmission (EP0 Control OUT Transaction) has not received correctly. This patch fixed this issue. The following was modified. - The buffer size. - The change processing of a receiving buffer (The temporary buffer and the buffer prepared by gadget). - The setup processing of a DMA descriptor. Currently the PCH_UDC driver can work normally with "Serial gadget" or "File-backed Storage Gadget". Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10usb: pch_udc: Fix setup transfers with data outRichard Röjfors1-1/+4
This patch fixes an issue where the driver does not handle out data in setup transactions. The per endpoint cached status register is cleared in the pch_udc_svc_control_out function. When there is out data available the function pch_udc_svc_data_out is called which tries to pick it up the status, which now is cleared to 0. When the status is 0, the function doesn't start reading the data from the FIFO. There is a second bug in all this, pch_udc_svc_data_out takes the endpoint number (0 for EP0), while pch_udc_svc_control_out passes the endpoint index (1 for EP0). Effectively pch_udc_svc_data_out picks up the wrong internal ep structure. This patch makes sure to put back the cached status and pass the endpoint number rather than index when calling pch_udc_svc_data_out. Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10usb: pch_udc: Fix compile error, warnings and checkpatch warningsRichard Röjfors1-8/+11
Building pch_udc in linux-next fails, this patch fixes the a compile error: drivers/usb/gadget/pch_udc.c: In function ‘usb_gadget_register_driver’: drivers/usb/gadget/pch_udc.c:2645: error: ‘struct usb_gadget_driver’ has no member named ‘bind’ drivers/usb/gadget/pch_udc.c:2664: error: ‘struct usb_gadget_driver’ has no member named ‘bind’ And a couple of compiler warnings and checkpatch warnings. Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16USB device driver of Topcliff PCHToshiharu Okada1-0/+2941
This patch adds the USB device driver of EG20T(Topcliff) PCH. EG20T PCH is the platform controller hub that is going to be used in Intel's upcoming general embedded platform. All IO peripherals in EG20T PCH are actually devices sitting on AMBA bus. EG20T PCH has USB device I/F. Using this I/F, it is able to access system devices connected to USB device. Signed-off-by: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Acked-by: Michał Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>