1
0
Fork 0
Commit Graph

617839 Commits (eeb7df270f1c4629b52fc1f98035fe9e7fe63df2)

Author SHA1 Message Date
Kishon Vijay Abraham I eeb7df270f include: extcon: Fix compilation error caused because of incomplete merge
Fix the following compilation error caused due to incomplete merge. This is
observed if CONFIG_EXTCON is not set.

In file included from ./include/linux/mfd/palmas.h:23:0,
                 from drivers/input/misc/palmas-pwrbutton.c:22:
./include/linux/extcon.h: In function ‘extcon_sync’:
./include/linux/extcon.h:361:1: error: expected declaration specifiers before ‘<<’ token
./include/linux/extcon.h:370:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./include/linux/extcon.h:376:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘>>’ token
./include/linux/extcon.h:381:1: error: expected declaration specifiers before ‘<<’ token
./include/linux/extcon.h:390:1: error: expected declaration specifiers or ‘...’ before ‘==’ token
./include/linux/extcon.h:476:11: warning: ‘struct extcon_specific_cable_nb’ declared inside parameter list [enabled by default]
./include/linux/extcon.h:476:11: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
./include/linux/extcon.h:474:19: error: storage class specified for parameter ‘extcon_register_interest’
./include/linux/extcon.h:474:19: warning: parameter ‘extcon_register_interest’ declared ‘inline’ [enabled by default]
./include/linux/extcon.h:477:1: warning: ‘always_inline’ attribute ignored [-Wattributes]
./include/linux/extcon.h:474:19: error: ‘no_instrument_function’ attribute applies only to functions
./include/linux/extcon.h:477:1: error: expected ‘;’, ‘,’ or ‘)’ before ‘{’ token

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 08:53:41 +02:00
Greg Kroah-Hartman 48ab6f5360 phy: for 4.9 (with extcon merge resolution)
updated tag for 4.9 based on usb-next along with extcon merge
 resolution
 
 phy updates includes:
 *) phy driver for USB 3.0 PHY on Northstar
 *) phy driver for Rockchip usb2phy
 *) phy driver for the Rockchip SoC internal PCIe PHY
 *) phy driver for USB Type-C PHY on rk3399
 *) phy_reset() API
 *) support for Allwinner A64 usb phy, usb2 phy in r8a7796
 *) Fixes in twl4030-usb, tegra phy, sun4i-usb phy, da8xx-usb phy
    and omap-usb2 phy
 *) other misc cleanups
 
 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJX2phSAAoJEA5ceFyATYLZ6LAP/0/hlgE9ySM8CDNoctWeB1/f
 8G46/aje7PbMq03x4BSAg/Tj7xJfbTa/X0bBxZjjQXRopGs6d5VytwJrPJaq5OIA
 SVYfUDlccKX9k4C1nN86PogpraELEzgC61Un6DowbgsVd/9NfCROQ8mvupxOQQUv
 oJ8D8c17lkn3Wd5hIaC09iisgf9cRzO9ojDFOjecc3JJpzz9KidHsQ8FwWj+ZmKw
 svC8EPaG8Mo3ikglFSL6Txlc1MtyE1Sybf3lkz5A3+rYlsR9EMeMS0h3c8fLg9+q
 Rc3uJ/R+aqAwU/r/yVdhfKRANJ77ev0j+5/8AMz7e4278r+uO8FfIy9vCtlfoxeO
 qPZLzOWLToRqGWcne9MfkvEsKP7pbBmxPU9WvYIDCTewBJSVNG+YoUAHf/h8y4Ix
 mHFBrKQWpbqtTZXH4Bd/D/oA4t+ST+QXfl2npWrqzvXuiw3yUxk2cgguZD8edHYh
 Rm+8yATk+ChpwQi+fc8XJ9KDw58fZ11NryMTN0ONTs3IHEABdxCaneMKPTHOlyiN
 yV4Lrtz2JWCM9Rtf92+3g6XTRclv4hzrZ6TAV7XE92oHlWcxM5i4y9JM1WsPCALe
 wgUulmRcQUi8wpmW+PrZ6eqhfA1/QLyqneMn53D1xYZ125dZkB4xmkWuMhA02cwI
 pon9oNa4Isom1hNpwoEO
 =bI2e
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-4.9-updated_v1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-testing

Kishon writes:

phy: for 4.9 (with extcon merge resolution)

updated tag for 4.9 based on usb-next along with extcon merge
resolution

phy updates includes:
*) phy driver for USB 3.0 PHY on Northstar
*) phy driver for Rockchip usb2phy
*) phy driver for the Rockchip SoC internal PCIe PHY
*) phy driver for USB Type-C PHY on rk3399
*) phy_reset() API
*) support for Allwinner A64 usb phy, usb2 phy in r8a7796
*) Fixes in twl4030-usb, tegra phy, sun4i-usb phy, da8xx-usb phy
   and omap-usb2 phy
*) other misc cleanups

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2016-09-15 15:59:30 +02:00
Kishon Vijay Abraham I cb9850d092 Merge branch 'next' into resolution
Conflicts:
	drivers/extcon/extcon-adc-jack.c
	drivers/extcon/extcon-arizona.c
	drivers/extcon/extcon-gpio.c
	include/linux/extcon.h
2016-09-15 16:45:20 +05:30
Johan Hovold 5ee05309e7 MAINTAINERS: add tree entry for USB Serial
Add tree entry for USB Serial.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 12:19:41 +02:00
Greg Kroah-Hartman f21ca2c999 Most of them are refine patches, only new feature is
disable io watchdog for chipidea platform.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJX2lExAAoJEEhZKYFQ1nG7xVkH/jfONzi6B0o1sPLwA5pF9PEz
 mvkCUaXMRmgeHcHPviXjthfbZ6eKR7ddd0bxGC3DWd4eUOO3QohW9vI+wYhpKk//
 mQh2F25nvZNYKOZ/BdG5XRZjVFT1qJGseknSg0TsRraAVEjOLdr7gqViPRAqMyoJ
 PY3CQxlf8dqHz4ed5xsKmwcjGE9Q+A+YMhOXzxY2aLGTCaDNOcYNHJWIe9QXwOVQ
 snxiNe+DoPkrspGrUJQpZ7lSq5siNxLS7cOlzYmWvxMkNw2A5xJgnoxoDziey8xo
 2F427B0CwXyTC1gNBk721pIjIvkNcPAghoUo8EUgD71hC4nH8EFFM3iqA+U1xpc=
 =hww9
 -----END PGP SIGNATURE-----

Merge tag 'usb-ci-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-testing

Peter writes:

Most of them are refine patches, only new feature is
disable io watchdog for chipidea platform.
2016-09-15 10:38:30 +02:00
Greg Kroah-Hartman 8152263748 usb: patches for v4.9 merge window
This time around we have 92 non-merge commits. Most
 of the changes are in drivers/usb/gadget (40.3%)
 with drivers/usb/gadget/function being the most
 active directory (27.2%).
 
 As for UDC drivers, only dwc3 (26.5%) and dwc2
 (12.7%) have really been active.
 
 The most important changes for dwc3 are better
 support for scatterlist and, again, throughput
 improvements. While on dwc2 got some minor stability
 fixes related to soft reset and FIFO usage.
 
 Felipe Tonello has done some good work fixing up our
 f_midi gadget and Tal Shorer has implemented a nice
 API change for our ULPI bus.
 
 Apart from these, we have our usual set of
 non-critical fixes, spelling fixes, build warning
 fixes, etc.
 -----BEGIN PGP SIGNATURE-----
 
 iQI6BAABCAAkBQJX2TpXHRxmZWxpcGUuYmFsYmlAbGludXguaW50ZWwuY29tAAoJ
 EMy+uJnhGpkGxX0QAIOavB96wkAP4msMzCMIKyKX8NBVWEYzLy7Ou6IrPKiGOR28
 CjDi1C5qW7838H4neA6Gfw896rfTiAODhoiOY/RTXI7p2hTUUXHQuJ81Bad75gHD
 744BUMPy37YJnvgHTasYn0GxAvP73YmV+omRxo76poetYZ9eH8dGECvC9q6m+jRU
 XaubWEq1JMvzHvlyO7BIrndGY4ByRbBoG0XPiZF07e5YDkKWQmv56tgAAN7fEkeh
 8HIg8lG2xvgf+w6cDbrQ2c8fp055OvrOq40R2pSXwQgYYKXPJ+vFiNzriQ6Rfxai
 gIYrB+mrKZcY6mi6OhoulGfNxT65VqMqnUfwVbbwlJQbDe5EkV6o/1WYdaBvdO2s
 qTT9A5alabFzbQ8ZtjzsIHtV62LwmZlMWk7gxZlcvLFNjf/P2CMqqnJi30/JlrsE
 iqhwIGRDhMq4QZZbiiEiJEaEn6vh2zseRdmCy3uMFearXKBP/I2177QOTDG7ZMKf
 fZR4ROlv6c5tIpBCOsTV0+7c/fnnnOTHU4+vJiUzU0krkPzaLcL8iMT1tn+uGchX
 4d2XLuT6AbVxQR4N8YF4FwRzB/PbEb+ZWWGu1mOVSd9/dsA43K50zNdc061dgz8K
 q8lau6bmtfUXdbeWa3WMEaAZIuSBmFarJY0tPZV6W7cXUAgKitThRD6fp4E0
 =vTFa
 -----END PGP SIGNATURE-----

Merge tag 'usb-for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

Felipe writes:

usb: patches for v4.9 merge window

This time around we have 92 non-merge commits. Most
of the changes are in drivers/usb/gadget (40.3%)
with drivers/usb/gadget/function being the most
active directory (27.2%).

As for UDC drivers, only dwc3 (26.5%) and dwc2
(12.7%) have really been active.

The most important changes for dwc3 are better
support for scatterlist and, again, throughput
improvements. While on dwc2 got some minor stability
fixes related to soft reset and FIFO usage.

Felipe Tonello has done some good work fixing up our
f_midi gadget and Tal Shorer has implemented a nice
API change for our ULPI bus.

Apart from these, we have our usual set of
non-critical fixes, spelling fixes, build warning
fixes, etc.
2016-09-14 20:37:50 +02:00
Andreas Kemnade b78ea84a7d phy-twl4030-usb: initialize charging-related stuff via pm_runtime
twl4030_phy_power_on() initializes some bits which are required for
charging. As they are not set in twl4030_usb_runtime_resume()
a call to pm_runtime_get_sync() is not sufficient to enable charging.

This patch moves the initialization to twl4030_usb_runtime_resume()
so everything needed for charging is initialized upon
pm_runtime_get_sync().

That also gives improved possibilities to debug problems in that area
because the relevant parts can be checked separately. Charging can be
enabled without having the musb subsystem active.

As a side effect this hides some bugs in musb which causes
unbalanced calls to phy_power_off()/phy_power_on() so that
phy->power_count becomes -1.

The result is that e.g. the GTA04 phone (dm3730 + twl4030) works
finally as a usb gadget again and charging is working.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2016-09-14 10:59:12 +05:30
Andreas Kemnade 78489c7c48 phy-twl4030-usb: better handle musb_mailbox() failure
setting twl->linkstat = MUSB_UNKNOWN upon error in musb_mailbox as
introduced in
commit 12b7db2bf8 ("usb: musb: Return error value from musb_mailbox")
causes twl4030_usb_irq() to not detect a state change form cable connected
to cable disconnected after such an error so that
pm_runtime_put_autosuspend() will not be called and the usage counter
gets unbalanced. Such errors happen e.g. if the omap2430 module is not
(yet) loaded during plug/unplug events.

This patch introduces a flag instead that indicates whether there is
information for the musb_mailbox pending and calls musb_mailbox() if
that flag is set.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2016-09-14 10:59:11 +05:30
Fabio Estevam e74e837248 usb: chipidea: udc: Use the preferred form for passing a size of a struct
According to Documentation/CodingStyle:

"The preferred form for passing a size of a struct is the following:

	p = kmalloc(sizeof(*p), ...);
"
, so do as suggested to improve readability.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Fabio Estevam 58001effe1 usb: chipidea: udc: Fit into a single line
No need to split the dma_pool_zalloc() line into two as it can
perfectly fit into a single line.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Fabio Estevam 382c1b38d8 usb: chipidea: udc: Use dma_pool_zalloc()
We can make the code simpler by using dma_pool_zalloc() instead
of calling dma_pool_alloc() and then a memset().

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Lucas Stach c744a0db75 usb: chipidea: host: disable io watchdog
The Chipidea EHCI core seems to behave sanely and doesn't need
the IO watchdog. This kills off 10 non-deferrable wakeup events
per second when the controller is otherwise idle.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Stefan Wahren c6ee9f2345 usb: chipidea: udc: Use direction flags consequently
This driver make assumptions about the value of the direction flags.
So better use them in comparisons to improve the readability.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Li Jun 9dba516ed2 usb: chipidea: imx: set over current polarity per dts setting
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>
2016-09-14 10:58:13 +08:00
Li Jun e5b3253dcc doc: usb: ci-hdrc-usb2: add property over-current-active-high
Adding over-current-active-high to indicate the over current flag
is high active as typically we use active low for over current
polarity.

Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
2016-09-14 10:58:13 +08:00
Li Jun 5de97f8bd7 doc: usb: usbmisc-imx: add imx7d compatible string
Add compatible string for imx7d-usbmisc.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Stefan Wahren 8007eb4e18 usb: chipidea: udc: Don't flush endpoint fifo twice
The endpoint fifo is already flushed in _ep_nuke so there
is no need to flush it twice.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Stefan Wahren 66b76dbe37 usb: chipidea: udc: move write barrier into hw_ep_prime
Since there should be a write barrier before every call of
hw_ep_prime we could move it into hw_ep_prime.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
2016-09-14 10:58:13 +08:00
Tony Lindgren 54a2ec67f1 usb: ohci: Allow ohci on omap5 also
With LPAE config we don't have omap3 or omap4 selected for
omap5 variants.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:26:32 +02:00
Roger Quadros b44bbc46a8 usb: core: setup dma_pfn_offset for USB devices and, interfaces
If dma_pfn_offset is not inherited correctly from the host controller,
it might result in sub-optimal configuration as bounce
buffer limit might be set to less than optimal level.

Consider the mass storage device case.
USB storage driver creates a scsi host for the mass storage interface in
drivers/usb/storage/usb.c
The scsi host parent device is nothing but the the USB interface device.
Now, __scsi_init_queue() calls scsi_calculate_bounce_limit() to find out
and set the block layer bounce limit.
scsi_calculate_bounce_limit() uses dma_max_pfn(host_dev) to get the
bounce_limit. host_dev is nothing but the device representing the
mass storage interface.
If that device doesn't have the right dma_pfn_offset, then dma_max_pfn()
is messed up and the bounce buffer limit is wrong.

e.g. On Keystone 2 systems, dma_max_pfn() is 0x87FFFF and dma_mask_pfn
is 0xFFFFF. Consider a mass storage use case: Without this patch,
usb scsi host device (usb-storage) will get a dma_pfn_offset of 0 resulting
in a dma_max_pfn() of 0xFFFFF within the scsi layer
(scsi_calculate_bounce_limit()).
This will result in bounce buffers being unnecessarily used.

Hint: On 32-bit ARM platforms dma_max_pfn() = dma_mask_pfn + dma_pfn_offset

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:25:35 +02:00
Wei Yongjun 9cdd8e11c2 USB: host: ohci-at91: fix non static symbol warning
Fixes the following sparse warning:

drivers/usb/host/ohci-at91.c:141:15: warning:
 symbol 'at91_dt_syscon_sfr' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Wei Yongjun b175b38a0f usb: host: xhci-tegra: Fix error return code in tegra_xusb_probe()
Fix to return error code -ENOMEM from the usb_create_shared_hcd()
error handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Julia Lawall 36ae6776e4 ezusb: constify local structures
For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@perches.com>.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Colin Ian King f409440703 USB: wusbcore: add in missing white space in error message text
A dev_err message spans two lines and the literal string is missing
a white space between words. Add the white space and reformat the
message to not span multiple lines.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Oliver Neukum efbe27b3cf cdc-acm: cleaning up debug in data submission path
Further cleanup making the debug messages more precise, useful
and removing mere trace points.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Oliver Neukum 46e75075ba cdc-acm: cleanup debugging in submission path
Actually make it retutn useful information.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:24:24 +02:00
Rasmus Villemoes 21b031fbd1 usb: musb: remove redundant stack buffers
aDate is always the empty string, so entirely pointless. The aRevision
formatting might as well be done as part of the pr_debug() call - that
also avoids it altogether if pr_debug is compiled out.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Wei Yongjun 48fed03b4b usb: musb: am35x: fix error return code in am35x_probe()
Fix to return a negative error code from the usb_phy_generic_register()
error handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
David Lechner 947c49afe4 usb: musb: da8xx: Remove mach code
Use the new phy-da8xx-usb driver to take the place of the mach code that
pokes CFGCHIP2 in the da8xx musb glue driver. This unbreaks the driver.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
David Lechner d458fe9a71 usb: musb: da8xx: Use devm in probe
Simplify things a bit by using devm functions where possible.

Signed-off-by: David Lechner <david@lechnology.com>
[b-liu@ti.com: fixed merge conflict]
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Hans de Goede 7cba17ec9a musb: sunxi: Add support for platform_set_mode
This allows run-time dr_mode switching support via the "mode" musb
sysfs attribute.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Tony Lindgren 65b3f50ed6 usb: musb: Add PM runtime support for MUSB DSPS glue layer
We can now just use PM runtime autoidle support as musb core
keeps things enabled when the devctl session bit is set. And
there's no need for dsps_musb_try_idle() so let's just remove
it.

Note that as cppi41 dma is clocked by musb, this only makes
PM work for dsps glue layer if CONFIG_MUSB_PIO_ONLY=y and
cppi41.ko is unloaded. This will get fixed when cppi41.c has
PM runtime implemented.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Tony Lindgren ae909fe4f4 usb: musb: Simplify PM runtime for 2430 glue layer
With musb core now blocking PM based on the devctl status
bit, we can remove related quirks from the 2430 glue layer
and simplify PM runtime further.

Lets's also use musb->controller instead of dev to make it
clear we make the PM runtime calls for the core, not the
glue layer.

And we can now also lower the autoidle timeout.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Tony Lindgren 2f3fd2c5bd usb: musb: Prepare dsps glue layer for PM runtime support
We want to be polling the state when nothing is connected.
Let's change the polling logic in preparation for PM runtime
support.

Signed-off-by: Tony Lindgren <tony@atomide.com>
[b-liu@ti.com: undo unnecessary line leading whitespace change]
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Tony Lindgren 467d5c9807 usb: musb: Implement session bit based runtime PM for musb-core
We want to keep musb enabled always when the session bit is
set. This simplifies the PM runtime and allows making it more
generic across the various glue layers.

So far the only exception to just following the session bit is
host mode disconnect where the session bit stays set.

In that case, just allow PM and let the PM runtime autoidle
timeout deal with it.

Signed-off-by: Tony Lindgren <tony@atomide.com>
[b-liu@ti.com: changed using dev_dbg() to musb_dbg()]
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 17:20:02 +02:00
Greg Kroah-Hartman 4d719209be Update extcon for 4.9
Detailed description for this pull request:
 1. Support the extcon property and add the synchronization APIs.
 - This feature supports the extcon property for external connector
   because each external connector might have the property according to
   the H/W design.
 
 - The property name should keep the following style.
   : EXTCON_PROP_USB_[property_name]
   : EXTCON_PROP_CHG_[property_name]
   : EXTCON_PROP_JACK_[property_name]
   : EXTCON_PROP_DISP_[property_name]
 
 - Add the new extcon APIs to support the extcon property.
   : extcon_set_property()
   : extcon_get_property()
   : extcon_set_property_capability()
   : extcon_get_property_capability()
 
 - Add the new synchronization extcon APIs.
   : This feature adds the synchronization extcon APIs to support the noti
   for both state and property. When extcon_*_sync() functions is called,
   the extcon informs the information from extcon provider to extcon client.
 
   The extcon driver may need to change the both state and multiple properties
   at the same time. After setting the data of a external connector,
   the extcon send the notification to client driver with the extcon_*_sync().
 
   : extcon_sync()
   : extcon_set_state_sync()
   : extcon_set_property_sync()
 
 - Change the name of existing APIs.
   : extcon_set_cable_state_() -> extcon_set_cable()
   : extcon_get_cable_state_() -> extcon_get_cable()
 
 2. Add the extcon type to group the connector into five category.
 - EXTCON_TYPE_USB  : USB connector
 - EXTCON_TYPE_CHG  : Charger connector
 - EXTCON_TYPE_JACK : Jack connector
 - EXTCON_TYPE_DISP : Display connector
 - EXTCON_TYPE_MISC : Miscellaneous connector
 
 3. Add the new property for external connector.
 - EXTCON_PROP_USB_VBUS
 - EXTCON_PROP_USB_TYPEC_POLARITY
 - EXTCON_PROP_USB_SS   (SuperSpeed)
 - EXTCON_PROP_DISP_HPD (Hot Plug Detect)
 
 4. Add the new type of external connector.
 - EXTCON_DISP_DP  : Display Port
 - EXTCON_DISP_HMD : Head Mounted Device
 - EXTCON_CHG_WPT  : Wireless Power Transfer device
 
 5. Add the new extcon driver.
 - Qualcomm SPMI PMIC USB id detection driver detects whether
   EXTCON_USB_HOST is attached or detached. (extcon-qcom-spmi-mis.c)
 
 6. Remove the usage of extcon_update_state() and old extcon_set_state()
 - Both extcon_update_state() and extcon_set_state() should change the state
   of all external connectors with bit masking handling. It may occur the
   problem. Instead, extcon provides the extcon_set/get_state() functions.
 
 7. Fix the minor issues on extcon drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX15NdAAoJEJzN3yze689THBUP/jnchjajptYuKY/Y/TkDfdHF
 ffEQX/V4lJ1rZfQe4TOWf/f4Pa/+AssFXlOH08in9mAqphsYVZb6d05yVxZgK2cA
 3C0JH2SigpcnpIbxDAmz+IuJCzA9BIyhj3+qqzo72vRE8lS+CBQk0jsuQgbNVRG+
 T9Dg7GvqcWOpvlGXFhMszznYMQIXfnYSuY4JbT5YjEN6k7qC+fYPwyXN7iJfZ70r
 B9mQwjynimE82VV7xfeYwUhoXCSu+MS8YlfxayWP7p8//kNyID17LjCZttH/deF4
 bMr+PfUmn3Uv8PoOQL+hONRruVNbzp8fPaBERk1G/7CS9Gtf1jZUHYyG4Hn7cmpt
 i/WAvFc2aDJyZEzVRborbnZ4KAwas8ftfNy13fIzsXKwPg6FKoIGoj8+4cxO61fc
 rP+GDWpCOheCMLI9oRuXM1Ub6f8z5uZl3xDgWuGb2LCp7uquIC483AaZAKqpPNll
 Xo4oLFTWecyA0lt1FsHC/qTbSW104VtYeQv644zsDTMyVvarQ4daf9lce9Qw5dYc
 jM2EN8CYHw38jpgFquNXqRArNoTbdsLWQ9shv6MlQNguX8hao6lZZgFtWYq9j3dj
 I1YjkyyYyr5VwF+xUjTQFrLWXPZ77/7LRwgeifcIPI3MC+tYFhhBojIT709ri8L/
 QwgUF2ukSoPxPVT/jUVv
 =LF4N
 -----END PGP SIGNATURE-----

Merge tag 'extcon-next-for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into usb-testing

Chanwoo writes:

Update extcon for 4.9

Detailed description for this pull request:
1. Support the extcon property and add the synchronization APIs.
- This feature supports the extcon property for external connector
  because each external connector might have the property according to
  the H/W design.

- The property name should keep the following style.
  : EXTCON_PROP_USB_[property_name]
  : EXTCON_PROP_CHG_[property_name]
  : EXTCON_PROP_JACK_[property_name]
  : EXTCON_PROP_DISP_[property_name]

- Add the new extcon APIs to support the extcon property.
  : extcon_set_property()
  : extcon_get_property()
  : extcon_set_property_capability()
  : extcon_get_property_capability()

- Add the new synchronization extcon APIs.
  : This feature adds the synchronization extcon APIs to support the noti
  for both state and property. When extcon_*_sync() functions is called,
  the extcon informs the information from extcon provider to extcon client.

  The extcon driver may need to change the both state and multiple properties
  at the same time. After setting the data of a external connector,
  the extcon send the notification to client driver with the extcon_*_sync().

  : extcon_sync()
  : extcon_set_state_sync()
  : extcon_set_property_sync()

- Change the name of existing APIs.
  : extcon_set_cable_state_() -> extcon_set_cable()
  : extcon_get_cable_state_() -> extcon_get_cable()

2. Add the extcon type to group the connector into five category.
- EXTCON_TYPE_USB  : USB connector
- EXTCON_TYPE_CHG  : Charger connector
- EXTCON_TYPE_JACK : Jack connector
- EXTCON_TYPE_DISP : Display connector
- EXTCON_TYPE_MISC : Miscellaneous connector

3. Add the new property for external connector.
- EXTCON_PROP_USB_VBUS
- EXTCON_PROP_USB_TYPEC_POLARITY
- EXTCON_PROP_USB_SS   (SuperSpeed)
- EXTCON_PROP_DISP_HPD (Hot Plug Detect)

4. Add the new type of external connector.
- EXTCON_DISP_DP  : Display Port
- EXTCON_DISP_HMD : Head Mounted Device
- EXTCON_CHG_WPT  : Wireless Power Transfer device

5. Add the new extcon driver.
- Qualcomm SPMI PMIC USB id detection driver detects whether
  EXTCON_USB_HOST is attached or detached. (extcon-qcom-spmi-mis.c)

6. Remove the usage of extcon_update_state() and old extcon_set_state()
- Both extcon_update_state() and extcon_set_state() should change the state
  of all external connectors with bit masking handling. It may occur the
  problem. Instead, extcon provides the extcon_set/get_state() functions.

7. Fix the minor issues on extcon drivers.
2016-09-13 17:17:31 +02:00
Arnd Bergmann e6be244a83 usb: gadget: uvc: add V4L2 dependency
Building the UVC gadget into the kernel fails to build when
CONFIG_VIDEO_V4L2 is a loadable module:

drivers/usb/gadget/function/usb_f_uvc.o: In function `uvc_function_ep0_complete':
uvc_configfs.c:(.text.uvc_function_ep0_complete+0x84): undefined reference to `v4l2_event_queue'
drivers/usb/gadget/function/usb_f_uvc.o: In function `uvc_function_disable':
uvc_configfs.c:(.text.uvc_function_disable+0x34): undefined reference to `v4l2_event_queue'

Adding a dependency in USB_CONFIGFS_F_UVC (which is a bool symbol)
make the 'select USB_F_UVC' statement turn the USB_F_UVC into 'm'
whenever CONFIG_VIDEO_V4L2=m too, avoiding the link failure.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-09-13 09:29:08 +03:00
Felipe Balbi b281dc630b usb: dwc3: of-simple: add compatible for Cavium
Add necessary compatible flag for Cavium's DWC3 so
dwc3-of-simple will probe.

Tested-by: Steven J. Hill <Steven.Hill@cavium.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-09-13 09:28:59 +03:00
Oliver Neukum 050bc4e846 scsi: introduce a quirk for false cache reporting
Some SATA to USB bridges fail to cooperate with some
drives resulting in no cache being present being reported
to the host. That causes the host to skip sending
a command to synchronize caches. That causes data loss
when the drive is powered down.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 08:08:24 +02:00
Felipe Balbi 26c9cac402 usb: dwc3: of-simple: allow glues without clocks
Instead of erroring out when we don't have clocks,
let's just avoid any calls to the clk API.

Tested-by: Steven J. Hill <Steven.Hill@cavium.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-09-13 08:40:40 +03:00
Stephen Boyd 38085c987f extcon: Add support for qcom SPMI PMIC USB id detection hardware
Some Qualcomm PMICs have a misc device that performs USB id pin
detection via an interrupt. When the interrupt triggers, we
should read the interrupt line to see if it has gone high or low.
If the interrupt is low then the ID pin is grounded, and if the
interrupt is high then the ID pin is being held high.

Cc: Roger Quadros <rogerq@ti.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
[cw00.choi: Edited the driver description and added the author information]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13 11:26:26 +09:00
Chanwoo Choi 8670b45980 extcon: Use the extcon_set_state_sync() instead of deprecated functions
This patch alters the renamed extcon API to set the state of the external
connectors instead of deprecated extcon_set_cable_state_().

Because the patch[1] modifies the function name to maintain the function
naming pattern.
- extcon_set_cable_state_() -> extcon_set_state_sync()
- extcon_get_cable_state_() -> extcon_get_state()

[1] https://lkml.org/lkml/2016/8/4/729
- extcon: Rename the extcon_set/get_state() to maintain the function naming pattern

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Roger Quadros <rogerq@ti.com>
2016-09-13 11:26:26 +09:00
Colin Ian King 525867dbd1 extcon: axp288: Fix spelling mistake
This patch fixes the spelling mistake in dev_dbg messages.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
[cw00.choi: Modify the patch title/description]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13 11:26:26 +09:00
Krzysztof Kozlowski e5b07e555b extcon: max14577: Change Krzysztof Kozlowski's email to kernel.org
Change my email address to kernel.org instead of Samsung one for the
purpose of any future contact.  The copyrights remain untouched and are
attributed to Samsung.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13 11:26:26 +09:00
Chris Zhong c7914e8dfa extcon: Introduce EXTCON_PROP_DISP_HPD property
EXTCON_PROP_DISP_HPD is need by display port, if the system has no hpd
interrupt, this property can be used.
- HPD (Hot Plug Detect) send the signal whether display device is on or off
  to source device.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
[cw00.choi: Add the description of HPD and full name of HPD]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2016-09-13 10:08:47 +09:00
Peter Chen 6406c3d226 usb: Kconfig: let USB_ULPI_BUS depends on USB_COMMON
Since ulpi bus driver is located at usb/common/ulpi.c, whether it
is compiled or not depends on CONFIG_USB_COMMON which needs either
USB Host or USB Gadget is enabled, so even CONFIG_USB_ULPI_BUS is
chosen, its source may still not be compiled when both USB HOST
and USB gadget are disabled.

It fixed compile error with below configurations:
- # CONFIG_USB is not set
- # CONFIG_USB_GADGET is not set
- CONFIG_PHY_TUSB1210=m
- CONFIG_USB_ULPI_BUS=m

>> All errors (new ones prefixed by >>):
>>
>> ERROR: "ulpi_unregister_driver" [drivers/phy/phy-tusb1210.ko] undefined!
>> ERROR: "__ulpi_register_driver" [drivers/phy/phy-tusb1210.ko] undefined!
>> ERROR: "ulpi_write" [drivers/phy/phy-tusb1210.ko] undefined!

Fixes: ad764c49f6 ("usb: Kconfig: move ulpi bus support out of host")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 10:43:38 +02:00
Greg Kroah-Hartman fc9104d5d7 Merge 4.8-rc6 into usb-next
We want the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 09:15:26 +02:00
Anurag Kumar Vulisha 8d53e62675 usb: dwc3: of-simple: Fix warning during unbind
In dwc3_of_simple_remove() we are using clk_unprepare() before doing
any clk_disable(). If we enable Common CLK framework (CCF) and try to
unbind dwc3-of-simple driver, we see kernel WARN messages.

This patch fixes this kernel warning by using clk_disable_unprepare()
instead of clk_unprepare().

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-09-12 10:07:24 +03:00
Lu Baolu 5e6c88d28c usb: dwc3: fix Clear Stall EP command failure
Commit 50c763f8c1 ("usb: dwc3: Set the ClearPendIN bit on Clear
Stall EP command") sets ClearPendIN bit for all IN endpoints of
v2.60a+ cores. This causes ClearStall command fails on 2.60+ cores
operating in HighSpeed mode.

In page 539 of 2.60a specification:

"When issuing Clear Stall command for IN endpoints in SuperSpeed
mode, the software must set the "ClearPendIN" bit to '1' to
clear any pending IN transcations, so that the device does not
expect any ACK TP from the host for the data sent earlier."

It's obvious that we only need to apply this rule to those IN
endpoints that currently operating in SuperSpeed mode.

Fixes: 50c763f8c1 ("usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command")
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2016-09-12 10:05:55 +03:00
Linus Torvalds 9395452b4a Linux 4.8-rc6 2016-09-11 20:02:25 -07:00