diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c index c53172fa035a..18a6c329b19c 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.c +++ b/drivers/gpu/drm/msm/dp/dp_debug.c @@ -50,6 +50,7 @@ struct dp_debug_private { struct dp_debug dp_debug; struct dp_parser *parser; struct dp_ctrl *ctrl; + struct dp_power *power; struct mutex lock; }; @@ -1461,6 +1462,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim) } debug->dp_debug.sim_mode = true; + debug->power->sim_mode = true; debug->aux->set_sim_mode(debug->aux, true, debug->edid, debug->dpcd); } else { @@ -1468,6 +1470,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim) debug->ctrl->abort(debug->ctrl); debug->aux->set_sim_mode(debug->aux, false, NULL, NULL); + debug->power->sim_mode = false; debug->dp_debug.sim_mode = false; debug->panel->set_edid(debug->panel, 0); @@ -2040,6 +2043,7 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in) debug->catalog = in->catalog; debug->parser = in->parser; debug->ctrl = in->ctrl; + debug->power = in->power; dp_debug = &debug->dp_debug; dp_debug->vdisplay = 0; diff --git a/drivers/gpu/drm/msm/dp/dp_debug.h b/drivers/gpu/drm/msm/dp/dp_debug.h index c1e2cfd62466..2ec72e87a2eb 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.h +++ b/drivers/gpu/drm/msm/dp/dp_debug.h @@ -63,6 +63,8 @@ struct dp_debug { * @connector: double pointer to display connector * @catalog: instance of catalog module * @parser: instance of parser module + * @ctrl: instance od ctrl module + * @power: instance of power module */ struct dp_debug_in { struct device *dev; @@ -74,6 +76,7 @@ struct dp_debug_in { struct dp_catalog *catalog; struct dp_parser *parser; struct dp_ctrl *ctrl; + struct dp_power *power; }; /** diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index efafdddd10b7..6d7e1595b6e5 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1365,6 +1365,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp) debug_in.catalog = dp->catalog; debug_in.parser = dp->parser; debug_in.ctrl = dp->ctrl; + debug_in.power = dp->power; dp->debug = dp_debug_get(&debug_in); if (IS_ERR(dp->debug)) { diff --git a/drivers/gpu/drm/msm/dp/dp_power.c b/drivers/gpu/drm/msm/dp/dp_power.c index c54ac1b7c7e2..a85f03dd3934 100644 --- a/drivers/gpu/drm/msm/dp/dp_power.c +++ b/drivers/gpu/drm/msm/dp/dp_power.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -123,7 +123,7 @@ static int dp_power_pinctrl_set(struct dp_power_private *power, bool active) parser = power->parser; - if (IS_ERR_OR_NULL(parser->pinctrl.pin)) + if (IS_ERR_OR_NULL(parser->pinctrl.pin) || power->dp_power.sim_mode) return 0; if (parser->no_aux_switch && parser->lphw_hpd) { diff --git a/drivers/gpu/drm/msm/dp/dp_power.h b/drivers/gpu/drm/msm/dp/dp_power.h index c31add55c5d9..a2e9a49de178 100644 --- a/drivers/gpu/drm/msm/dp/dp_power.h +++ b/drivers/gpu/drm/msm/dp/dp_power.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -21,12 +21,15 @@ /** * sruct dp_power - DisplayPort's power related data * + * @sim_mode: simulation mode enable flag * @init: initializes the regulators/core clocks/GPIOs/pinctrl * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl * @clk_enable: enable/disable the DP clocks * @set_pixel_clk_parent: set the parent of DP pixel clock */ struct dp_power { + bool sim_mode; + int (*init)(struct dp_power *power, bool flip); int (*deinit)(struct dp_power *power); int (*clk_enable)(struct dp_power *power, enum dp_pm_type pm_type,