summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/dp/dp_power.h
blob: e3f959ffae12153d7fdd1b9602c864f731a4547e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _DP_POWER_H_
#define _DP_POWER_H_

#include "dp_parser.h"

/**
 * sruct dp_power - DisplayPort's power related data
 *
 * @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 core_clks_on;
	bool link_clks_on;
	bool stream_clks_on;
};

/**
 * dp_power_init() - enable power supplies for display controller
 *
 * @power: instance of power module
 * @flip: bool for flipping gpio direction
 * return: 0 if success or error if failure.
 *
 * This API will turn on the regulators and configures gpio's
 * aux/hpd.
 */
int dp_power_init(struct dp_power *power, bool flip);

/**
 * dp_power_deinit() - turn off regulators and gpios.
 *
 * @power: instance of power module
 * return: 0 for success
 *
 * This API turns off power and regulators.
 */
int dp_power_deinit(struct dp_power *power);

/**
 * dp_power_clk_status() - display controller clocks status
 *
 * @power: instance of power module
 * @pm_type: type of pm, core/ctrl/phy
 * return: status of power clocks
 *
 * This API return status of DP clocks
 */

int dp_power_clk_status(struct dp_power *dp_power, enum dp_pm_type pm_type);

/**
 * dp_power_clk_enable() - enable display controller clocks
 *
 * @power: instance of power module
 * @pm_type: type of pm, core/ctrl/phy
 * @enable: enables or disables
 * return: pointer to allocated power module data
 *
 * This API will call setrate and enable for DP clocks
 */

int dp_power_clk_enable(struct dp_power *power, enum dp_pm_type pm_type,
				bool enable);

/**
 * dp_power_client_init() - initialize clock and regulator modules
 *
 * @power: instance of power module
 * return: 0 for success, error for failure.
 *
 * This API will configure the DisplayPort's clocks and regulator
 * modules.
 */
int dp_power_client_init(struct dp_power *power);

/**
 * dp_power_clinet_deinit() - de-initialize clock and regulator modules
 *
 * @power: instance of power module
 * return: 0 for success, error for failure.
 *
 * This API will de-initialize the DisplayPort's clocks and regulator
 * modules.
 */
void dp_power_client_deinit(struct dp_power *power);

/**
 * dp_power_get() - configure and get the DisplayPort power module data
 *
 * @parser: instance of parser module
 * return: pointer to allocated power module data
 *
 * This API will configure the DisplayPort's power module and provides
 * methods to be called by the client to configure the power related
 * modules.
 */
struct dp_power *dp_power_get(struct device *dev, struct dp_parser *parser);

#endif /* _DP_POWER_H_ */