[PATCH 0/3] enable reset_control_reset for shared reset lines

Martin Blumenstingl martin.blumenstingl at googlemail.com
Sat Oct 1 08:21:31 PDT 2016


This patch allows using reset_control_reset on a shared reset line.
There are some restrictions though (all of these only apply to shared
resets):
- reset_control_reset cannot be used after reset_control_assert
- reset_control_assert cannot be used after reset_control_reset
- only the first call to reset_control_reset will be passed to the
  hardware. The only exception is when all consumers of the
  reset_control are gone (reset_control_put)

The idea came up when discussing the reset logic in the
phy-meson8b-usb2 PHY driver, see [0] and [1]

An example where this is needed is the Amlogic Meson8b and GXBB SoCs
where two USB PHYs share one reset line. The reset controller only
supports reset pulses (and thus only implements .reset).
The only workaround so far is to make the reset optional in the
driver and only add the reset to one of the two PHYs, to mimic the
behavior implemented by patch 1.

I also added the Meson USB2 PHY patch to this series to show that this
new functionality can be used with only minimal changes. These patches
can simply be dropped as they depend on the phy-meson8b-usb2 driver
patch, and the dts patch has a runtime-dependency on patch 1 and 2
(otherwise the phy-meson8b-usb2 driver would try to request the reset
line exclusively, preventing the other PHY from initializing).


[0] http://lists.infradead.org/pipermail/linux-amlogic/2016-September/001233.html
[1] http://lists.infradead.org/pipermail/linux-amlogic/2016-September/001197.html


Martin Blumenstingl (3):
  reset: allow using reset_control_reset with shared reset
  phy: meson8b-usb2: request a shared reset line
  ARM64: dts: meson-gxbb: add the USB reset also to the second USB PHY

 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi |  1 +
 drivers/phy/phy-meson8b-usb2.c              |  3 +--
 drivers/reset/core.c                        | 31 +++++++++++++++++++++++------
 3 files changed, 27 insertions(+), 8 deletions(-)

-- 
2.10.0




More information about the linux-amlogic mailing list