clk: Add support for enabling/disabling clocks from debugfs
authorMike Tipton <mdtipton@codeaurora.org>
Tue, 30 Jun 2020 00:30:24 +0000 (17:30 -0700)
committerStephen Boyd <sboyd@kernel.org>
Fri, 24 Jul 2020 09:03:58 +0000 (02:03 -0700)
commit03111b1088f18f93d38e888c41e8a1e6aba9f8bb
tree1fb5683436669d697ff5000fde0dfd223967538b
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407
clk: Add support for enabling/disabling clocks from debugfs

For test and debug purposes, it's simple enough to enable or disable
clocks from shell. Add a new debugfs file 'clk_prepare_enable' that
calls clk_prepare_enable() when writing "1" and clk_disable_unprepare()
when writing "0".

This can have security implications, so only support it when the code
has been modified to #define CLOCK_ALLOW_WRITE_DEBUGFS.

Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Link: https://lore.kernel.org/r/20200630003024.6282-1-mdtipton@codeaurora.org
[sboyd@kernel.org: Reword commit text and remove comment update]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c