OSDN Git Service

net: ipa: resume in ipa_clock_get()
authorAlex Elder <elder@linaro.org>
Tue, 10 Aug 2021 19:27:00 +0000 (14:27 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Aug 2021 12:31:56 +0000 (13:31 +0100)
commit2abb0c7f98e8f025447c5386389928b87e047738
tree59981e11109c210fdd4f30959152d5f634f7744a
parent1016c6b8c62152eaa9ad31a9905a816e58333afa
net: ipa: resume in ipa_clock_get()

Introduce ipa_runtime_suspend() and ipa_runtime_resume(), which
encapsulate the activities necessary for suspending and resuming
the IPA hardware.  Call these functions from ipa_clock_get() and
ipa_clock_put() when the first reference is taken or last one is
dropped.

When the very first clock reference is taken (for ipa_config()),
setup isn't complete yet, so (as before) only the core clock gets
enabled.

When the last clock reference is dropped (after ipa_deconfig()),
ipa_teardown() will have made the setup_complete flag false, so
there too, the core clock will be stopped without affecting GSI
or the endpoints.

Otherwise these new functions will perform the desired suspend and
resume actions once setup is complete.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_clock.c