• Stanley Chang's avatar
    usb: core: add phy notify connect and disconnect · 53a2d95d
    Stanley Chang authored
    In Realtek SoC, the parameter of usb phy is designed to can dynamic
    tuning base on port status. Therefore, add a notify callback of generic
    phy driver when usb device connect and disconnect change.
    
    The Realtek phy driver is designed to dynamically adjust disconnection
    level and calibrate phy parameters. When the device connected bit changes
    and when the disconnected bit changes, do connection change notification:
    
    Check if portstatus is USB_PORT_STAT_CONNECTION and portchange is
    USB_PORT_STAT_C_CONNECTION.
    1. The device is connected, the driver lowers the disconnection level and
       calibrates the phy parameters.
    2. The device disconnects, the driver increases the disconnect level and
       calibrates the phy parameters.
    
    Generic phy driver in usb core framework does not support device connect
    and disconnect notifications. Therefore, we add an api to notify phy
    the connection changes.
    
    Additionally, the generic phy only specifies primary_hcd in the original
    design. Added specific "usb2-phy" on primary_hcd and "usb3-phy" on
    shared_hcd.
    Signed-off-by: default avatarStanley Chang <stanley_chang@realtek.com>
    Link: https://lore.kernel.org/r/20231213031203.4911-4-stanley_chang@realtek.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    53a2d95d
phy.h 1.2 KB