]> git.karo-electronics.de Git - karo-tx-linux.git/commit
reset: allow using reset_control_reset with shared reset
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 12 Nov 2016 13:13:03 +0000 (14:13 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 14 Nov 2016 08:58:28 +0000 (09:58 +0100)
commit7da33a37b48f11ffcb4a718f29a3d4552423fea1
tree12cd41d58ed7e3e48389b4cc2a11e8a8686cd36a
parentcdd24f76fe84fd6ee3b46f54b2a475d04d79889d
reset: allow using reset_control_reset with shared reset

Some SoCs (for example Amlogic GXBB) implement a reset controller which
only supports a reset pulse (triggered via reset_control_reset). At the
same time multiple devices (in case of the Amlogic GXBB SoC both USB
PHYs) are sharing the same reset line.

This patch allows using reset_control_reset also for shared resets.
There are limitations though:
reset_control_reset can only be used if reset_control_assert was not
used yet.
reset_control_assert can only be used if reset_control_reset was not
used yet.
For shared resets the reset is only triggered once for the lifetime of
the reset_control instance (the reset can be triggered again if all
consumers of that specific reset_control are gone, as the reset
framework will free the reset_control instance in that case).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c