Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / msm / dp / dp_power.h
blob7d0327bbc0d563e3bfe806d8b759d83905e88500
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
4 */
6 #ifndef _DP_POWER_H_
7 #define _DP_POWER_H_
9 #include "dp_parser.h"
11 /**
12 * sruct dp_power - DisplayPort's power related data
14 * @init: initializes the regulators/core clocks/GPIOs/pinctrl
15 * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl
16 * @clk_enable: enable/disable the DP clocks
17 * @set_pixel_clk_parent: set the parent of DP pixel clock
19 struct dp_power {
20 bool core_clks_on;
21 bool link_clks_on;
22 bool stream_clks_on;
25 /**
26 * dp_power_init() - enable power supplies for display controller
28 * @power: instance of power module
29 * @flip: bool for flipping gpio direction
30 * return: 0 if success or error if failure.
32 * This API will turn on the regulators and configures gpio's
33 * aux/hpd.
35 int dp_power_init(struct dp_power *power, bool flip);
37 /**
38 * dp_power_deinit() - turn off regulators and gpios.
40 * @power: instance of power module
41 * return: 0 for success
43 * This API turns off power and regulators.
45 int dp_power_deinit(struct dp_power *power);
47 /**
48 * dp_power_clk_status() - display controller clocks status
50 * @power: instance of power module
51 * @pm_type: type of pm, core/ctrl/phy
52 * return: status of power clocks
54 * This API return status of DP clocks
57 int dp_power_clk_status(struct dp_power *dp_power, enum dp_pm_type pm_type);
59 /**
60 * dp_power_clk_enable() - enable display controller clocks
62 * @power: instance of power module
63 * @pm_type: type of pm, core/ctrl/phy
64 * @enable: enables or disables
65 * return: pointer to allocated power module data
67 * This API will call setrate and enable for DP clocks
70 int dp_power_clk_enable(struct dp_power *power, enum dp_pm_type pm_type,
71 bool enable);
73 /**
74 * dp_power_client_init() - initialize clock and regulator modules
76 * @power: instance of power module
77 * return: 0 for success, error for failure.
79 * This API will configure the DisplayPort's clocks and regulator
80 * modules.
82 int dp_power_client_init(struct dp_power *power);
84 /**
85 * dp_power_clinet_deinit() - de-initialize clock and regulator modules
87 * @power: instance of power module
88 * return: 0 for success, error for failure.
90 * This API will de-initialize the DisplayPort's clocks and regulator
91 * modueles.
93 void dp_power_client_deinit(struct dp_power *power);
95 /**
96 * dp_power_get() - configure and get the DisplayPort power module data
98 * @parser: instance of parser module
99 * return: pointer to allocated power module data
101 * This API will configure the DisplayPort's power module and provides
102 * methods to be called by the client to configure the power related
103 * modueles.
105 struct dp_power *dp_power_get(struct device *dev, struct dp_parser *parser);
107 #endif /* _DP_POWER_H_ */