aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc/atmel_usba_udc.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: udc: atmel: update endpoint allocation for sam9x60Cristian Birsan2020-09-241-0/+2
| | | | | | | | | | | The DPRAM memory from the USB High Speed Device Port (UDPHS) hardware block was increased. This patch updates the endpoint allocation for sam9x60 to take advantage of this larger memory. At the same time the constraint to allocate the endpoints in order was lifted. To handle old and new hardware in the same driver the ep_prealloc was added. Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: gadget: udc: atmel: simplify endpoint allocationCristian Birsan2020-09-241-1/+0
| | | | | | | Simplify the endpoint allocation and cleanup the code. Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: gadget: udc: atmel: Don't use DT to configure end pointGregory CLEMENT2020-05-251-0/+12
| | | | | | | | | | | | | | | The endpoint configuration used to be stored in the device tree, however the configuration depend on the "version" of the controller itself. This information is already documented by the compatible string. It then possible to just rely on the compatible string and completely remove the full ep configuration done in the device tree as it was already the case for all the other USB device controller. Acked-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
* usb: gadget: atmel: support USB suspendJonas Bonn2019-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for USB suspend to the Atmel UDC. When suspended, the UDC clock can be stopped, resulting in some power savings. The "wake up" interrupt will fire irregardless of whether the clock is running or not, allowing the UDC clock to be restarted when the USB master wants to wake the device again. The IRQ state of this device is somewhat fiddly. The "wake up" IRQ seems to actually be a "bus activity" indicator; the IRQ is almost continuously asserted so enabling this IRQ should only be done after a suspend when the wake IRQ becomes relevant. Similarly, the "suspend" IRQ detects "bus inactivity" and may therefore fire together with a "wake" if the two types of activity coincide during the period between two IRQ handler invocations; therefore, it's important to ignore the "suspend" IRQ while waiting for a wake-up. This has been tested on a SAMA5D2 board. Signed-off-by: Jonas Bonn <jonas@norrbonn.se> CC: Cristian Birsan <cristian.birsan@microchip.com> CC: Felipe Balbi <balbi@kernel.org> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Nicolas Ferre <nicolas.ferre@microchip.com> CC: Alexandre Belloni <alexandre.belloni@bootlin.com> CC: Ludovic Desroches <ludovic.desroches@microchip.com> CC: linux-arm-kernel@lists.infradead.org CC: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* USB: udc: atmel_usba_udc: no need to check return value of debugfs_create functionsGreg Kroah-Hartman2018-05-311-4/+0
| | | | | | | | | | | | | | When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. There is also no need to keep the file dentries around at all, so remove those variables from the device structure. Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Felipe Balbi <balbi@kernel.org> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: gadget: udc: atmel: GPIO inversion is handled by gpiodRomain Izard2018-05-151-1/+0
| | | | | | | | | | | | | When converting to GPIO descriptors, gpiod_get_value automatically handles the line inversion flags from the device tree. Do not invert the line twice. Fixes: 3df034081021 ("usb: gadget: udc: atmel: convert to use GPIO descriptors") Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* usb: gadget: udc: atmel: convert to use GPIO descriptorsLudovic Desroches2018-03-131-1/+3
| | | | | | | | | | Use GPIO descriptors instead of relying on the old method. Include irq.h header since it is needed and was indirectly included through of_gpio.h. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* USB: gadget: udc: Remove redundant license textGreg Kroah-Hartman2017-11-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the SPDX tag is in all USB files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com> Cc: Daniel Mack <daniel@zonque.org> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Cc: Raviteja Garimella <raviteja.garimella@broadcom.com> Cc: Romain Perier <romain.perier@collabora.com> Cc: Johan Hovold <johan@kernel.org> Cc: Al Cooper <alcooperx@gmail.com> Cc: Srinath Mannam <srinath.mannam@broadcom.com> Cc: Roger Quadros <rogerq@ti.com> Cc: Krzysztof Opasiak <k.opasiak@samsung.com> Cc: Stefan Agner <stefan@agner.ch> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: "Felix Hädicke" <felixhaedicke@web.de> Cc: Peter Chen <peter.chen@nxp.com> Cc: Allen Pais <allen.lkml@gmail.com> Cc: Yuyang Du <yuyang.du@intel.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Li Yang <leoyang.li@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: add SPDX identifiers to all remaining files in drivers/usb/Greg Kroah-Hartman2017-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/usb/ and include/linux/usb* files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: gadget: udc: atmel: Remove unnecessary macrosAlexandre Belloni2017-06-191-10/+6
| | | | | | | | | | commit 46ddd79e893b ("usb: gadget: udc: atmel: Remove AVR32 bits from the driver") left the accessor macros introduced by commit a3dd3befd7cb ("usb: gadget: atmel_usba: use endian agnostic IO on ARM"). They can now be removed. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* usb: gadget: udc: atmel: Remove AVR32 bits from the driverAndy Shevchenko2017-06-131-11/+0
| | | | | | | | AVR32 is gone. Now it's time to clean up the driver by removing leftovers that was used by AVR32 related code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* Merge tag 'usb-for-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-nextGreg Kroah-Hartman2017-01-261-1/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Felipe writes: USB: changes for v4.11 Here's the big pull request for the Gadget API. Again the majority of changes sit in dwc2 driver. Most important changes contain a workaround for GOTGCTL being wrong, a sleep-inside-spinlock fix and the big series of cleanups on dwc2. One important thing on dwc3 is that we don't anymore need gadget drivers to cope with unaligned OUT transfers for us. We have support for appending one extra chained TRB to align transfer ourselves. Apart from these, the usual set of typos, non-critical fixes, etc.
| * usb: gadget: udc: atmel: Update endpoint allocation schemeCristian Birsan2017-01-241-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the usb endpoint allocation scheme for atmel usba driver to make sure all endpoints are allocated in order. This requirement comes from the datasheet of the controller. The allocation scheme is decided by fifo_mode parameter. For fifo_mode = 0 the driver tries to autoconfigure the endpoints fifo size. All other modes contain fixed configurations optimized for different purposes. The idea is somehow similar with the approach used on musb driver. Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* | usb: gadget: udc: atmel: remove memory leakAlexandre Belloni2017-01-121-0/+1
|/ | | | | | | | | | Commit bbe097f092b0 ("usb: gadget: udc: atmel: fix endpoint name") introduced a memory leak when unbinding the driver. The endpoint names would not be freed. Solve that by including the name as a string in struct usba_ep so it is freed when the endpoint is. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
* usb: gadget: atmel: access the PMC using regmapAlexandre Belloni2016-02-171-0/+2
| | | | | | | | | Use regmap to access the PMC to avoid using at91_pmc_read and at91_pmc_write. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: atmel_usba: use endian agnostic IO on ARMBen Dooks2015-03-191-6/+16
| | | | | | | | | | | | | | Change from using the __raw IO accesors to the endian agnostic versions of readl/writel_relaxed when not on AVR32. This fixes issues with running big endian on ARMv7. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> -- CC: Nicolas Ferre <nicolas.ferre@atmel.com> CC: Felipe Balbi <balbi@ti.com> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: atmel_usba_udc: condition clocks to vbus stateSylvain Rochet2015-03-111-0/+4
| | | | | | | | | | | | | | If USB PLL is not necessary for other USB drivers (e.g. OHCI and EHCI) we will reduce power consumption by switching off the USB PLL if no USB Host is currently connected to this USB Device. We are using Vbus GPIO signal to detect Host presence. If Vbus signal is not available then the device stays continuously clocked. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: atmel_usba: Cache INT_ENB register valueBoris Brezillon2015-01-121-0/+2
| | | | | | | | | Cache INT_ENB register value in order to avoid uncached iomem access, and thus improve access time to INT_ENB value. Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: atmel_usba_udc: Add at91sam9g45 and at91sam9x5 errata handlingBoris Brezillon2015-01-121-0/+2
| | | | | | | | | | | at91sam9g45 and at91sam9x5 SoCs have an hardware bug forcing us to generate a pulse on the BIAS signal on "USB end of reset” and “USB end of resume" events. Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Reported-by: Patrice VILCHEZ <patrice.vilchez@atmel.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: atmel_usba_udc: Rework at91sam9rl errata handlingBoris Brezillon2015-01-121-0/+5
| | | | | | | | | | | | | | | | | | | at91sam9rl SoC has an erratum forcing us to toggle the BIAS on USB suspend/resume events. This specific handling is only activated when CONFIG_ARCH_AT91SAM9RL is set and this option is only set when building a non-DT kernel, which is problematic since non-DT support for at91sam9rl SoC has been removed. Rework the toggle_bias implementation to attach it to the "at91sam9rl-udc" compatible string. Add new compatible strings to avoid executing at91sam9rl erratum handling on other SoCs. Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: Gadget directory cleanup - group UDC driversAndrzej Pietrasiewicz2014-07-161-0/+354
The drivers/usb/gadget directory contains many files. Files which are related can be distributed into separate directories. This patch moves the UDC drivers into a separate directory. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>