summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/usbmisc_imx.c
AgeCommit message (Collapse)Author
2017-11-07USB: chipidea: Remove redundant license textGreg Kroah-Hartman
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: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-04USB: add SPDX identifiers to all remaining files in drivers/usb/Greg Kroah-Hartman
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>
2017-05-18usb: chipidea: imx: Do not access CLKONOFF on i.MX51Andrey Smirnov
Unlike i.MX53, i.MX51's USBOH3 register file does not implemenent registers past offset 0x018, which includes MX53_USB_CLKONOFF_CTRL_OFFSET and trying to access that register on said platform results in external abort. Fix it by enabling CLKONOFF accessing codepath only for i.MX53. Cc: stable <stable@vger.kernel.org> Fixes 3be3251db088 ("usb: chipidea: imx: Disable internal 60Mhz clock with ULPI PHY") Cc: cphealy@gmail.com Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-11-14usb: chipidea: imx: Disable internal 60Mhz clock with ULPI PHYFabien Lahoudere
The internal 60Mhz clock for host2 and host3 are useless in ULPI phy mode, so we disable it when configuring ULPI PHY node for those host. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-11-14usb: chipidea: imx: configure imx for ULPI phyFabien Lahoudere
In order to use ULPI phy with usb host 2 and 3, we need to configure controller register to enable ULPI features. Each USB controller have different behaviour, so in order to avoid to have several "swicth(data->index)" and lock/unlock, we prefer to get the index switch and then test for features if they exist for this index. This patch also remove useless test of reg and val. Those two values cannot be NULL. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14usb: chipidea: imx: set over current polarity per dts settingLi Jun
imx usb over current polarity is low active by default, with over-current-active-high property added, user can config it to be high active. Meanwhile keep this setting unchanged for existing platforms so new platform must set the right value for active low by its usbmisc init function if over current is enabled. Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
2015-11-18usb: chipidea: usbmisc_imx: fix a possible NULL dereferenceLABBE Corentin
of_match_device could return NULL, and so cause a NULL pointer dereference later. Renaming tmp_dev to of_id (like all others do) in the process. Reported-by: coverity (CID 1324135) Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-10-22usb: chipidea: imx: add imx6ul usb supportPeter Chen
Add imx6ul usb support. Signed-off-by: Peter chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-10-22usb: chipidea: imx: add usb support for imx7dPeter Chen
Add imx7d usb support. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com>
2015-08-14usb: chipidea: usbmisc_imx: add non-burst setting for imx6Peter Chen
With this setting and AHBBRST at SBUSCFG as "Incremental burst of unspecified length", each non-burst size can be taken as single transfer. It is benefit for non-burst size transfer. Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-06-08usb: chipidea: usbmisc_imx: Remove unneeded semicolonFabio Estevam
Remove unneeded semicolon. The semantic patch that makes this change is available in scripts/coccinelle/misc/semicolon.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-03-26usb: chipidea: usbmisc_imx: fix returnvar.cocci warningskbuild test robot
drivers/usb/chipidea/usbmisc_imx.c:277:5-8: Unneeded variable: "ret". Return "0" on line 297 Removes unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci Cc: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18usb: chipidea: usbmisc_imx: add imx6sx initialization routinePeter Chen
Except the same process with earlier imx6, it has below two features: - Choose which vbus voltage as vbus wakeup source We choose B_SESSION_VALID as vbus wakeup source since when the system goes to suspend, the vbus comparator can't compare the vbus voltage for VBUS_VALID. - Disable dp/dm (linestate) change as wakeup source at device mode when the vbus is not there, we don't expect dp/dm change waking up usb controller at this situation. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18usb: chipidea: usbmisc_imx: add .set_wakeup interfacePeter Chen
This API is used to enable/disable usb wakeup, only imx6 series are added, since I don't have other imx hardware on hand. Other imx users can add their API according to reference manual after testing. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18usb: chipidea: imx: simplify the usbmisc callersPeter Chen
Move struct imx_usbmisc_data NULL pointer judgement from caller to each API, it can simplify the caller. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18usb: chipidea: usbmisc_imx: delete clock informationPeter Chen
All imx usb controller's non core registers uses the same clock gate with core registers, the usbmisc_imx is the library for imx glue driver, the glue keeps clock on when it calls usbmisc_imx API to change non-core register. Besides, we will support runtime pm in the future, it also needs to close this clock when the usb is not in use. Philipp Zabel also verifies it at imx6q platform, see http://www.spinics.net/lists/linux-usb/msg118491.html Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-11-26usb: chipidea: usbmisc_imx: Read MX53_USB_OTG_PHY_CTRL_1_OFFSET directlyFabio Estevam
There is no need to do an intermediate step for reading the MX53_USB_OTG_PHY_CTRL_1_OFFSET register. Read it directly instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26usb: chipidea: usbmisc_imx: Move the reading of USB_PHY_CTRLFabio Estevam
If 'evdo' property is not defined, then reading the MX25_USB_PHY_CTRL_OFFSET register is an unneeded operation. Move the reading of MX25_USB_PHY_CTRL_OFFSET inside the 'evdo' if block code, where it is actually used. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20usb: chipidea: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-09-23chipidea: usbmisc_imx: Add USB support for VF610 SoCsStefan Agner
This adds Vybrid VF610 SoC support. The IP is very similar to i.MX6, however, the non-core registers are spread in two different register areas. Hence we support multiple instances of the USB misc driver and add the driver instance to the imx_usbmisc_data structure. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23chipidea: usbmisc_imx: Allow USB OTG to work on mx51Fabio Estevam
The field PLLDIVVALUE of register PHY_CTRL_1 selects the reference clock source for the PHY: 00 = sysclock uses 19.2 MHz 01 = sysclock uses 24 MHz 10 = sysclock uses 26 MHz 11 = sysclock uses 27 MHz The reset value for this field is 10 according to the reference manual, and even though this reset value works for mx53, it does not work for mx51. So instead of relying on the reset value for the PLLDIVVALUE field, explicitly set it to 01 so that a 24MHz clock can be selected for the PHY and allowing both mx51 and mx53 to have USB OTG port functional. Succesfully tested 'g_ether' on a imx51-babbage and on a imx53-qsb boards. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-24usb: chipidea: usbmisc: Add USB support for i.MX25/i.MX35 CPUsDenis Carikli
This adds the i.MX25 and the i.MX35 support in the ChipIdea usbmisc driver. The i.MX25 and i.MX35 usb controllers are similar enough to be able to use the same code. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Denis Carikli <denis@eukrea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08usb: chipidea: usbmisc: Add support for i.MX51 CPUAlexander Shiyan
This adds i.MX51 as the next user of the usbmisc driver. Functionality is similar to i.MX53, so at this stage simply reuse existing i.MX53 calls. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08usb: chipidea: usbmisc: Add support for i.MX27/i.MX31 CPUsAlexander Shiyan
This adds i.MX27 and i.MX31 as the next user of the usbmisc driver. Tested-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14USB: chipidea: i.MX: simplify usbmiscSascha Hauer
The chipidea i.MX driver is split into two drivers. The ci_hdrc_imx driver handles the chipidea cores and the usbmisc_imx driver handles the noncore registers common to all chipidea cores (but SoC specific). Current flow is: - usbmisc sets an ops pointer in the ci_hdrc_imx driver during probe - ci_hdrc_imx checks if the pointer is valid during probe, if yes calls the functions in the ops pointer. - usbmisc_imx calls back into the ci_hdrc_imx driver to get additional data This is overly complicated and has problems if the drivers are compiled as modules. In this case the usbmisc_imx driver can be unloaded even if the ci_hdrc_imx driver still needs usbmisc functionality. This patch changes this by letting the ci_hdrc_imx driver calling functions from the usbmisc_imx driver. This way the symbol resolving during module load makes sure the ci_hdrc_imx driver depends on the usbmisc_imx driver. Also instead of letting the usbmisc_imx driver call back into the ci_hdrc_imx driver, pass the needed data in the first place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24usb: chipidea: drop "13xxx" infixAlexander Shishkin
"ci13xxx" is bad for at least the following reasons: * people often mistype it * it doesn't add any informational value to the names it's used in * it needlessly attracts mail filters This patch replaces it with "ci_hdrc", "ci_udc" or "ci_hw", depending on the situation. Modules with ci13xxx prefix are also renamed accordingly and aliases are added for compatibility. Otherwise, no functional changes. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24usbmisc_imx: allow autoloading on according to dt idsArnaud Patard (Rtp)
Allow udev to autoload the module when booting with device-tree Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17usb: chipidea: usbmisc: use module_platform_driverPhilipp Zabel
This patch converts the driver to use the module_platform_driver macro which makes the code smaller and a bit simpler. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Michael Grzeschik <mgr@pengutronix.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17usb: chipidea: usbmisc_imx: Staticize usbmisc_imx_drv_init/exitFabio Estevam
Fix the following sparse warnings: drivers/usb/chipidea/usbmisc_imx.c:246:5: warning: symbol 'usbmisc_imx_drv_init' was not declared. Should it be static? drivers/usb/chipidea/usbmisc_imx.c:252:6: warning: symbol 'usbmisc_imx_drv_exit' was not declared. Should it be static? Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: add post handling and errata fix for mx25Michael Grzeschik
This adds a post handling routine which is called after ci13xxx_add_device was called. The first user is the mx25, which has to disable the external-vbus-divider after the udc has started. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> [Alex: also fixed a signed one-bit bitfield a whitespace error and yet another set of line-too-long and void pointer casting errors] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: add mx53 supportMichael Grzeschik
This adds mx53 as the next user of the usbmisc driver and makes it possible to disable the overcurrent-detection of the internal phy. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> [Alex: fixed another set of line-too-long and void pointer cast] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: prepare driver to handle more than one socMarc Kleine-Budde
This attaches the usbmisc_ops to the of_device_id data and makes it possible to define special functions per soc. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> [Alex: fixed one case of line-too-long and one bogus cast to void ptr] Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: fix a potential race conditionMarc Kleine-Budde
This fixes a potential race condition where the ci13xxx_imx glue code could be fast enough to call one of the usbmisc_ops before he got a valid value on the static usbmisc pointer. To fix that we first set usbmisc, then call usbmisc_set_ops(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: unset global varibale usbmisc on driver removeMarc Kleine-Budde
The probe function checks usbmisc to be NULL in the beginning. Without this patch the can only be loaded once. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-30usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imxMichael Grzeschik
This driver will be used for every Freescale SoC which has this misc memory layout to control the basic usb handling. So better name this driver, function and struct names in a more generic way. Reported-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>