History log of /linux-master/drivers/usb/mtu3/mtu3.h
Revision Date Author Comments
# 484468fb 18-Jul-2023 Rob Herring <robh@kernel.org>

usb: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230718143027.1064731-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 41792870 16-Apr-2023 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add optional clock xhci_ck and frmcnt_ck

Add optional clock 'xhci_ck' which is usually the same as sys_ck, but
some SoC use two separated clocks when the controller supports dual
role mode;
Add optional clock 'frmcnt_ck' used on 4nm or advanced process SoC.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20230417025203.18097-7-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 269f49ff 08-Jul-2022 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add feature to disable device's usb3 port

We may want to disable device's usb3 port when the combo phy is switched
from usb3 mode to pcie mode for some projects.
Meanwhile rename member @is_u3_ip to @u3_capable to avoid misleading, due
to the member's value may be changed when disable usb3 port, but the
controller is still a usb3 IP which also tells us how to manage the fifo.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220708071903.25752-3-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54c4862f 09-Jun-2022 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: implement udc_async_callbacks of gadget operation

Implement udc_async_callbacks hook function to avoid a race when unnbinding
gadget drivers, refer to:
7dc0c55e9f30 ('USB: UDC core: Add udc_async_callbacks gadget op')

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220609074233.15532-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 427c6642 15-Jul-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support suspend/resume for device mode

Support suspend/resume for device mode if the device is not
connected with a host, otherwise reject to suspend.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1626340078-29111-13-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fa6f59e2 15-Jul-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support runtime PM for host mode

Use a dedicated wakeup irq for runtime suspend/resume, and interrupts
names are provided if using wakeup irq, this patch only support host
mode.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1626340078-29111-11-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d7e12724 15-Jul-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support option to disable usb2 ports

Add support to disable specific usb2 host ports, it's useful when
a usb2 port is disabled on some platforms, but enabled on others
for the same SoC.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1626340078-29111-9-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 88c6b901 15-Jul-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support property role-switch-default-mode

Support default mode config when use usb-role-switch

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1626340078-29111-8-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cd59ea91 08-Jun-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: use clock bulk to get clocks

Use clock bulk helpers to get/enable/disable clocks, meanwhile
make sys_ck optional, then will be easier to handle clocks.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1623139069-8173-24-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 18cfd7b8 08-Jun-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: rebuild role switch flow of extcon

This is a preparation patch to plan to use the same work to
handle role switch for all three supported ways.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1623139069-8173-11-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ae634f93 08-Jun-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: drop support vbus detection

Until now it's never used on any platform, and will not used
later.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1623139069-8173-9-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2c09bdaa 28-May-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: remove repeated setting of speed

mtu3_gadget_start() will set speed, no need set it again in
mtu3_gadget_set_speed(), just save the desired speed.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1622182260-23767-2-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 32ab701d 28-May-2021 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: remove mtu3_ep0_setup() declaration in mtu3.h

It's defined and only used in the same file, so remove its declaration
in mtu3.h, and make it static

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 753a18c2 31-Jul-2020 YueHaibing <yuehaibing@huawei.com>

usb: mtu3: Remove unsused inline function is_first_entry

It is never used, so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>


# 5963296b 31-Jul-2020 YueHaibing <yuehaibing@huawei.com>

usb: mtu3: Remove unsused inline function is_first_entry

It is never used, so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200731082008.33016-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54402373 27-Jul-2020 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: use MTU3_EP_WEDGE flag

Use MTU3_EP_WEDGE flag instead of the member @wedged in mtu3_ep
struct, then @wedged can be removed.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1595834101-13094-9-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bf77804b 27-Jul-2020 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: remove useless member @busy in mtu3_ep struct

The member @busy in mtu3_ep struct is unnecessary, so remove it.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1595834101-13094-8-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc4c1aa7 27-Jul-2020 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add ->udc_set_speed()

Make use of the method to make sure connect on speeds
supported by the gadget driver.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1595834101-13094-6-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 80c1024b 04-Apr-2020 Nishad Kamdar <nishadkamdar@gmail.com>

USB: mtu3: Use the correct style for SPDX License Identifier

This patch corrects the SPDX License Identifier style in
header files related to MediaTek USB3 Dual Role controller.
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.

Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>


# 4d49d352 04-Apr-2020 Nishad Kamdar <nishadkamdar@gmail.com>

USB: mtu3: Use the correct style for SPDX License Identifier

This patch corrects the SPDX License Identifier style in
header files related to MediaTek USB3 Dual Role controller.
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 <joe@perches.com>
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20200404103728.GA6011@nishad
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1ac91ac5 29-Aug-2019 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: register a USB Role Switch for dual role mode

Because extcon is not allowed for new bindings, and the
dual role switch is supported by USB Role Switch,
especially for Type-C drivers, so register a USB Role
Switch to support the new way

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1567070558-29417-12-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 48e0d373 20-Mar-2019 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: supports new QMU format

In order to support U3gen2 ISOC transfer upto 96DPs, extend
the data buffer length.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 09befc32 20-Mar-2019 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: rebuild qmu_gpd struct to prepare to support new QMU format

To support USB3 Gen2 ISOC, the data buffer length need be extended,
it's hard to make the current qmu_gpd struct compatible, so here
rebuild qmu_gpd struct and make easy to support new QMU format

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4c5964b4 20-Mar-2019 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: fix transfer error of USB3 Gen2 isoc

To support USB3 Gen2 ISOC, the registers of TXCSR1 and RXCSR1
are adjusted to support greater maxpkt and mult value, this
patch fix this issue

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 681e9485 23-May-2018 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: fix warning of sleep in atomic context in notifier callback

The notifier callbacks of extcon are called in atomic context, but the
callbacks will call regulator_enable()/regulator_disable() which may
sleep caused by mutex, so use work queue to call the sleep functions.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 11254eb2 23-Apr-2018 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: fix an unrecognized issue when connected with PC

When boot on the platform with the USB cable connected to Win7,
the Win7 will pop up an error dialog: "USB Device not recognized",
but finally the Win7 can enumerate it successfully.
The root cause is as the following:
When the xHCI driver set PORT_POWER of the OTG port, and if both
IDPIN and VBUS_VALID are high at the same time, the MTU3 controller
will set SESSION and pull up DP, so the Win7 can detect existence
of USB device, but if the mtu3 driver can't switch to device mode
during the debounce time, the Win7 can not enumerate it.
Here to fix it by removing the 1s delayed EXTCON register to speed up
mode switch.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# f0ede2c6 03-Jan-2018 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: supports remote wakeup for mt2712 with two SSUSB IPs

The old way of usb wakeup only supports platform with single SSUSB IP,
such as mt8173, but mt2712 has two SSUSB IPs, so rebuild its flow and
also supports the new glue layer of usb wakeup on mt2712 which is
different from mt8173.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4c55a157 06-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: mtu3: Remove redundant license text

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.

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

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>


# 4d79e042 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add support for usb3.1 IP

Support SuperSpeedPlus for usb3.1 device IP

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# c776f2c3 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: use FORCE/RG_IDDIG to implement manual DRD switch

In order to keep manual DRD switch independent on IDDIG interrupt,
make use of FORCE/RG_IDDIG instead of IDDIG EINT interrupt to
implement manual DRD switch function.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 1a46dfea 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support 36-bit DMA address

add support for 36-bit DMA address

[ Felipe Balbi: fix printk format for dma_addr_t ]

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# a316da82 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add optional mcu and dma bus clocks

There are mcu_bus and dma_bus clocks needed to be turned on/off by
driver on some SoCs, so add them as optional ones

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# d90223ac 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: remove dummy wakeup debounce clocks

The wakeup debounce clocks for each ports in fact are not
needed, so remove them.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 076f1a89 13-Oct-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: support option to disable usb3 ports

Add support to disable specific usb3 ports, it's useful when
usb3 phy is shared with PCIe or SATA, because we should disable
the corresponding usb3 port if the phy is used by PCIe or SATA.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 8ba4ad48 25-Jul-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: handle delayed status of the control transfer

Add the delayed status handling. This is used by mass storage etc to
gain some extra time to setup its internal status before it can proceed
further requests, and once the gadget is ready, it will enqueue an
empty packet which is used for synchronization.
The issue may happen on some FGPA platform with very low cpu frequency.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# fe7c994a 25-Jul-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: handle delayed status of the control transfer

Add the delayed status handling. This is used by mass storage etc to
gain some extra time to setup its internal status before it can proceed
further requests, and once the gadget is ready, it will enqueue an
empty packet which is used for synchronization.
The issue may happen on some FGPA platform with very low cpu frequency.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9b4632ef 20-May-2017 Masahiro Yamada <yamada.masahiro@socionext.com>

usb: mtu3: cleanup with list_first_entry_or_null()

The combo of list_empty() and list_first_entry() can be replaced with
list_first_entry_or_null().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4d70d0c6 17-Jan-2017 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: add reference clock

usually, the reference clock comes from 26M oscillator directly,
but some SoCs are not, add it for compatibility.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d0ed062a 18-Oct-2016 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: dual-role mode support

support dual-role mode; there are two ways to switch between
host and device modes, one is by idpin, another is by debugfs
which depends on user input.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b3f4e727 18-Oct-2016 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: host only mode support

supports host only mode and the code is ported from
host/xhci-mtk.c
IPPC register shared between host and device is moved
into common glue layer.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a29de31b 18-Oct-2016 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: mtu3: Super-Speed Peripheral mode support

add super-speed funtion for peripheral mode

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# df2069ac 18-Oct-2016 Chunfeng Yun <chunfeng.yun@mediatek.com>

usb: Add MediaTek USB3 DRD driver

This patch adds support for the MediaTek USB3 controller
integrated into MT8173. It currently supports High-Speed
Peripheral Only mode.

Super-Speed Peripheral, Dual-Role Device and Host Only (xHCI)
modes will be added in the next patchs.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>