diff mbox series

[1/1] drm/bridge: analogix_dp: Add enable_psr param

Message ID 20200626033023.24214-2-shawn@anastas.io (mailing list archive)
State New, archived
Headers show
Series drm/bridge: analogix_dp: Add PSR toggle | expand

Commit Message

Shawn Anastasio June 26, 2020, 3:30 a.m. UTC
Add a toggle to enable/disable PSR from the kernel commandline.
This is useful in situations where PSR is supported by the hardware
but is not desired by the user. One such use case is working around
hardware errata.

Signed-off-by: Shawn Anastasio <shawn@anastas.io>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 76736fb8ed94..9735ab71fca7 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -35,6 +35,10 @@ 
 
 static const bool verify_fast_training;
 
+static bool enable_psr = true;
+module_param(enable_psr, bool, 0644);
+MODULE_PARM_DESC(enable_psr, "PSR support (1 = enabled (default), 0 = disabled)");
+
 struct bridge_init {
 	struct i2c_client *client;
 	struct device_node *node;
@@ -979,7 +983,7 @@  static int analogix_dp_commit(struct analogix_dp_device *dp)
 	if (ret)
 		return ret;
 
-	if (analogix_dp_detect_sink_psr(dp)) {
+	if (enable_psr && analogix_dp_detect_sink_psr(dp)) {
 		ret = analogix_dp_enable_sink_psr(dp);
 		if (ret)
 			return ret;