14 Dec, 2020

12 commits

  • Adding runtime PM control at .set_suspend API, then the controller
    driver could align PHY's power status with its runtime PM status.
    Power domain needs driver's runtime callback to call its runtime
    callback and turn on/off power domain according. So, the runtime
    pm callback is a must for power domain supported devices.

    With this support added, the subsystem (USB PHY in it) with power
    domain supported could enter low power mode, and save the power
    accordingly.

    Cc: Ranjani Vaidyanathan
    Signed-off-by: Peter Chen

    Peter Chen
     
  • The default 40ms is the minimum value according to BC 1.2 spec,
    it works not well for Type-C port when connected with DCP charger.
    Like this ticket described, the DCP charger will be recognized as
    SDP. After increasing TVDPSRC_ON value to 240ms, the Type-C port could
    work well with DCP charger.

    imx8dxl mek, imx7ulp evk and imx8qxp mek are tested.

    Reviewed-by: Jun Li
    Signed-off-by: Peter Chen

    Peter Chen
     
  • The DCD is a hardware IP in USB PHY which is used for USB charger
    detection, we use polling method for charger detection in this
    design to avoid unknown USB PHY interrupt. Currently, the
    imx8qm, imx8qxp and imx7ulp have DCD module.

    Reviewed-by: Jun Li
    Signed-off-by: Peter Chen

    Peter Chen
     
  • USB2 PLL use ring VCO, when the PLL power up, the ring VCO’s supply also
    ramp up. There is a possibility that the ring VCO start oscillation at
    multi nodes in this phase, especially for VCO which has many stages, then
    the multiwave will kept until PLL power down. Hold_ring_off(bit11) can
    force the VCO in one determined state when VCO supply start ramp up, to
    avoid this multiwave issue. Per IC design's suggestion it's better this
    bit can be off from 25us after pll power up to 25us before USB TX/RX.

    Acked-by: Peter Chen
    Signed-off-by: Li Jun
    (cherry picked from commit a094377f04c9ed2c8e702ee7bfab843caa03eb96)

    Li Jun
     
  • Add mxs phy driver dependency on ARCH_MXC_ARM64.

    Acked-by: Peter Chen
    Signed-off-by: Li Jun

    Li Jun
     
  • We only have below cases to disconnect line when suspend:
    1. Device mode without connection to any host/charger(no vbus).
    2. Device mode connect to a charger(w/ vbus), usb suspend when
    system is entering suspend.
    This patch can fix usb phy wrongly does disconnect line in case
    some usb host enters suspend but vbus is off.

    Signed-off-by: Li Jun
    (cherry picked from commit 2af48913f77cec3658f5863b13f63619d8101279)

    Li Jun
     
  • For imx6ul PHY, when the system enters suspend, its 1p1 is off by default,
    that may cause the PHY get inaccurate USB DP/DM value. If the USB wakeup
    is enabled at this time, the unexpected wakeup may occur when the system
    enters suspend.

    In this patch, when the vbus is there, we enable weak 1p1 during the PHY
    suspend API, in that case, the USB DP/DM will be accurate for USB PHY,
    then unexpected usb wakeup will not be occurred, especially for the USB
    charger is connected scenario. The user needs to enable PHY wakeup for
    USB wakeup function using below setting.

    echo enabled > /sys/devices/platform/soc/2000000.aips-bus/20c9000.usbphy
    /power/wakeup

    Cc: Shaojun Wang
    Cc: Anson Huang
    Signed-off-by: Peter Chen

    Peter Chen
     
  • For mxs PHY, if there is a vbus but the bus is not enumerated,
    force the dp/dm as SE0 from the consider side. If not, there
    is possible USB wakeup due to unstable dp/dm, since there is
    possible no pull on dp/dm, eg, there is a USB charger on the
    port. Note, the vbus event is only occurred at device mode,
    and sent by udc driver.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • This wakeup setting can enable USB wakeup function even the
    controller's power is lost, and both A7 and M4 are in VLLS mode.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • Per IC engineer request, we need to keep USBPHY2's clk always on,
    in this way, the USBPHY2 (PLL7) power can be controlled by
    hardware suspend signal totally. It is benefit of USB remote wakeup
    case which needs the resume signal be sent out as soon as
    possible (without software interfere).

    It is intended to fix the issue which this ticket describes, the
    reason for this issue is the host does not send resume in time.

    Signed-off-by: Peter Chen
    (cherry picked from commit 98888b352377f9ebaee03bedce8c239691f45262)

    Peter Chen
     
  • It is one of PHY's power, and we need to enable it to keep signal
    quality good, and pass eye diagram test.

    Signed-off-by: Peter Chen
    (cherry picked from commit 3a8670ee7ff698521369e8292bba7ef288a12335)

    Peter Chen
     
  • Implementation of notify_suspend and notify_resume will be different
    according to mxs_phy_data->flags.

    Signed-off-by: Peter Chen
    (cherry picked from commit d1ce766d9aabdfb823131d38056ff67c94e7e20a)

    Peter Chen
     

25 Sep, 2020

2 commits


14 Sep, 2020

1 commit


25 Aug, 2020

1 commit

  • The commit 2a6c0b82e651 ("USB: PHY: JZ4770: Add support for new
    Ingenic SoCs.") introduced the initialization function for different
    chips, but left the relevant code involved in the resetting process
    in the original function, resulting in uninitialized variable calls.

    Fixes: 2a6c0b82e651 ("USB: PHY: JZ4770: Add support for new Ingenic SoCs.").
    Signed-off-by: 周琰杰 (Zhou Yanjie)
    Link: https://lore.kernel.org/r/20200825081654.18186-2-zhouyanjie@wanyeetech.com
    Signed-off-by: Greg Kroah-Hartman

    周琰杰 (Zhou Yanjie)
     

29 Jul, 2020

1 commit


24 Jul, 2020

3 commits


15 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Link: https://lore.kernel.org/r/20200710191842.32561-1-grandmaster@al2klimov.de
    Signed-off-by: Greg Kroah-Hartman

    Alexander A. Klimov
     

10 Jul, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200707200040.GA4525@embeddedor
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

03 Jul, 2020

3 commits

  • No idea why this driver is using a char device node, statically
    allocated, with no dynamic allocation or hook up with devtmpfs, along
    with a reserverd major number, for "special" operations, not all of
    which ever were implemented.

    So just rip it out, as no one must be using it because no modern system
    will ever actually create the /dev/ node it needs.

    Cc: Felipe Balbi
    Reviewed-by: Ran Wang
    Signed-off-by: Greg Kroah-Hartman
    Link: https://lore.kernel.org/r/20200702072914.1072878-2-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This file has a HUGE debugging sysfs file that spews out a lot of
    information all at once, which violates the one-value-per-file rule for
    sysfs. If this is really needed, it should go into debugfs, but given
    the age of this driver, I strongly doubt anyone is using it anymore.

    So just remove the file entirely, it was never documented, so obviously,
    no one actually needed it :)

    Cc: Felipe Balbi
    Reviewed-by: Ran Wang
    Link: https://lore.kernel.org/r/20200702072914.1072878-1-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Kerneldoc expects arg descriptions to be in the format '@.*: '. If either
    the '@' or the ':' is omitted then kerneldoc complains that the description
    is missing. Add the missing ':'s here.

    Also provide a new description for 'event'.

    Fixes the following kernel build W=1 warnings:

    drivers/usb/phy/phy.c:106: warning: Function parameter or member 'work' not described in 'usb_phy_notify_charger_work'
    drivers/usb/phy/phy.c:172: warning: Function parameter or member 'nb' not described in 'usb_phy_get_charger_type'
    drivers/usb/phy/phy.c:172: warning: Function parameter or member 'state' not described in 'usb_phy_get_charger_type'
    drivers/usb/phy/phy.c:172: warning: Function parameter or member 'data' not described in 'usb_phy_get_charger_type'
    drivers/usb/phy/phy.c:194: warning: Function parameter or member 'usb_phy' not described in 'usb_phy_set_charger_current'
    drivers/usb/phy/phy.c:194: warning: Function parameter or member 'mA' not described in 'usb_phy_set_charger_current'
    drivers/usb/phy/phy.c:244: warning: Function parameter or member 'usb_phy' not described in 'usb_phy_get_charger_current'
    drivers/usb/phy/phy.c:244: warning: Function parameter or member 'min' not described in 'usb_phy_get_charger_current'
    drivers/usb/phy/phy.c:244: warning: Function parameter or member 'max' not described in 'usb_phy_get_charger_current'
    drivers/usb/phy/phy.c:281: warning: Function parameter or member 'usb_phy' not described in 'usb_phy_set_charger_state'
    drivers/usb/phy/phy.c:281: warning: Function parameter or member 'state' not described in 'usb_phy_set_charger_state'
    drivers/usb/phy/phy.c:427: warning: Function parameter or member 'dev' not described in 'devm_usb_get_phy'
    drivers/usb/phy/phy.c:427: warning: Function parameter or member 'type' not described in 'devm_usb_get_phy'
    drivers/usb/phy/phy.c:456: warning: Function parameter or member 'type' not described in 'usb_get_phy'
    drivers/usb/phy/phy.c:500: warning: Function parameter or member 'dev' not described in 'devm_usb_get_phy_by_node'
    drivers/usb/phy/phy.c:500: warning: Function parameter or member 'node' not described in 'devm_usb_get_phy_by_node'
    drivers/usb/phy/phy.c:500: warning: Function parameter or member 'nb' not described in 'devm_usb_get_phy_by_node'
    drivers/usb/phy/phy.c:558: warning: Function parameter or member 'dev' not described in 'devm_usb_get_phy_by_phandle'
    drivers/usb/phy/phy.c:558: warning: Function parameter or member 'phandle' not described in 'devm_usb_get_phy_by_phandle'
    drivers/usb/phy/phy.c:558: warning: Function parameter or member 'index' not described in 'devm_usb_get_phy_by_phandle'
    drivers/usb/phy/phy.c:590: warning: Function parameter or member 'dev' not described in 'devm_usb_put_phy'
    drivers/usb/phy/phy.c:590: warning: Function parameter or member 'phy' not described in 'devm_usb_put_phy'
    drivers/usb/phy/phy.c:627: warning: Function parameter or member 'type' not described in 'usb_add_phy'
    drivers/usb/phy/phy.c:721: warning: Function parameter or member 'event' not described in 'usb_phy_set_event'

    Cc: Felipe Balbi
    Signed-off-by: Lee Jones
    Link: https://lore.kernel.org/r/20200702144625.2533530-2-lee.jones@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Lee Jones
     

24 Jun, 2020

1 commit


18 May, 2020

1 commit


09 May, 2020

1 commit


23 Apr, 2020

1 commit

  • This patch corrects the SPDX License Identifier style in
    header files related to Physical Layer USB driver configuration.
    For C header files Documentation/process/license-rules.rst
    mandates C-like comments (opposed to C source files where
    C++ style should be used).

    Changes made by using a script provided by Joe Perches here:
    https://lkml.org/lkml/2019/2/7/46.

    Suggested-by: Joe Perches
    Signed-off-by: Nishad Kamdar
    Link: https://lore.kernel.org/r/20200419123559.GA4505@nishad
    Signed-off-by: Greg Kroah-Hartman

    Nishad Kamdar
     

16 Apr, 2020

1 commit


12 Mar, 2020

1 commit


04 Mar, 2020

1 commit

  • The driver uses only GPIO Descriptor Consumer Interface so include
    proper header. This fixes compile test failures (e.g. on i386):

    drivers/usb/phy/phy-tegra-usb.c: In function ‘ulpi_phy_power_on’:
    drivers/usb/phy/phy-tegra-usb.c:695:2: error:
    implicit declaration of function ‘gpiod_set_value_cansleep’ [-Werror=implicit-function-declaration]
    drivers/usb/phy/phy-tegra-usb.c: In function ‘tegra_usb_phy_probe’:
    drivers/usb/phy/phy-tegra-usb.c:1167:11: error:
    implicit declaration of function ‘devm_gpiod_get_from_of_node’ [-Werror=implicit-function-declaration]

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Dmitry Osipenko
    Link: https://lore.kernel.org/r/1583234960-24909-1-git-send-email-krzk@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Krzysztof Kozlowski
     

11 Feb, 2020

1 commit

  • Tools like Coccinelle may erroneously recommend to use the
    devm_platform_ioremap_resource() API for the registers mapping because
    these tools are not aware about the implementation details of the driver.
    Let's add a clarifying comments to the code, which should help to stop
    future attempts to break the driver.

    Signed-off-by: Dmitry Osipenko
    Acked-by: Thierry Reding
    Link: https://lore.kernel.org/r/20200202224259.29187-1-digetx@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Osipenko
     

24 Jan, 2020

2 commits

  • Current USB charger framework only shows charger state for user, but the
    user may also need charger type for further use, add support for it.

    Signed-off-by: Peter Chen
    Link: https://lore.kernel.org/r/1579145333-1657-1-git-send-email-peter.chen@nxp.com
    Signed-off-by: Greg Kroah-Hartman

    Peter Chen
     
  • Instead of using the legacy GPIO API and keeping track on
    polarity inversion semantics in the driver, switch to use
    GPIO descriptors for this driver and change all consumers
    in the process.

    This makes it possible to retire platform data completely:
    the only remaining platform data member was "wakeup" which
    was intended to make the vbus interrupt wakeup capable,
    but was not set by any users and thus remained unused. VBUS
    was not waking any devices up. Leave a comment about it so
    later developers using the platform can consider setting it
    to always enabled so plugging in USB wakes up the platform.

    Cc: Daniel Mack
    Cc: Haojian Zhuang
    Acked-by: Robert Jarzmik
    Acked-by: Felipe Balbi
    Acked-by: Sylwester Nawrocki
    Acked-by: Philipp Zabel
    Signed-off-by: Linus Walleij
    Link: https://lore.kernel.org/r/20200123155013.93249-1-linus.walleij@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     

15 Jan, 2020

1 commit

  • The last user of the phy generic platform data was
    deleted in commit 1e041b6f313aaa966612a7e415cfc09c90d6b829
    ("usb: dwc3: exynos: Remove dead code"). So get rid of
    the platform data, which rids us of another consumer of
    the legacy GPIO API at the same time. Make sure we
    only inlcude which is all we use.

    Alter the usb_phy_gen_create_phy() function prototype to
    not pass any platform data as this is just hardcoded to
    NULL at all locations calling it in the kernel.

    Move the devm_gpiod_get* calls out of the if (of_node)
    parenthesis, as these calls are generic and do not depend
    on device tree, they are used by any hardware description.

    Cc: Marek Szyprowski
    Cc: Felipe Balbi
    Signed-off-by: Linus Walleij
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     

09 Jan, 2020

4 commits