Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #ifndef _DP_POWER_H_
0007 #define _DP_POWER_H_
0008 
0009 #include "dp_parser.h"
0010 
0011 /**
0012  * sruct dp_power - DisplayPort's power related data
0013  *
0014  * @init: initializes the regulators/core clocks/GPIOs/pinctrl
0015  * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl
0016  * @clk_enable: enable/disable the DP clocks
0017  * @set_pixel_clk_parent: set the parent of DP pixel clock
0018  */
0019 struct dp_power {
0020     bool core_clks_on;
0021     bool link_clks_on;
0022     bool stream_clks_on;
0023 };
0024 
0025 /**
0026  * dp_power_init() - enable power supplies for display controller
0027  *
0028  * @power: instance of power module
0029  * @flip: bool for flipping gpio direction
0030  * return: 0 if success or error if failure.
0031  *
0032  * This API will turn on the regulators and configures gpio's
0033  * aux/hpd.
0034  */
0035 int dp_power_init(struct dp_power *power, bool flip);
0036 
0037 /**
0038  * dp_power_deinit() - turn off regulators and gpios.
0039  *
0040  * @power: instance of power module
0041  * return: 0 for success
0042  *
0043  * This API turns off power and regulators.
0044  */
0045 int dp_power_deinit(struct dp_power *power);
0046 
0047 /**
0048  * dp_power_clk_status() - display controller clocks status
0049  *
0050  * @power: instance of power module
0051  * @pm_type: type of pm, core/ctrl/phy
0052  * return: status of power clocks
0053  *
0054  * This API return status of DP clocks
0055  */
0056 
0057 int dp_power_clk_status(struct dp_power *dp_power, enum dp_pm_type pm_type);
0058 
0059 /**
0060  * dp_power_clk_enable() - enable display controller clocks
0061  *
0062  * @power: instance of power module
0063  * @pm_type: type of pm, core/ctrl/phy
0064  * @enable: enables or disables
0065  * return: pointer to allocated power module data
0066  *
0067  * This API will call setrate and enable for DP clocks
0068  */
0069 
0070 int dp_power_clk_enable(struct dp_power *power, enum dp_pm_type pm_type,
0071                 bool enable);
0072 
0073 /**
0074  * dp_power_client_init() - initialize clock and regulator modules
0075  *
0076  * @power: instance of power module
0077  * return: 0 for success, error for failure.
0078  *
0079  * This API will configure the DisplayPort's clocks and regulator
0080  * modules.
0081  */
0082 int dp_power_client_init(struct dp_power *power);
0083 
0084 /**
0085  * dp_power_clinet_deinit() - de-initialize clock and regulator modules
0086  *
0087  * @power: instance of power module
0088  * return: 0 for success, error for failure.
0089  *
0090  * This API will de-initialize the DisplayPort's clocks and regulator
0091  * modules.
0092  */
0093 void dp_power_client_deinit(struct dp_power *power);
0094 
0095 /**
0096  * dp_power_get() - configure and get the DisplayPort power module data
0097  *
0098  * @parser: instance of parser module
0099  * return: pointer to allocated power module data
0100  *
0101  * This API will configure the DisplayPort's power module and provides
0102  * methods to be called by the client to configure the power related
0103  * modules.
0104  */
0105 struct dp_power *dp_power_get(struct device *dev, struct dp_parser *parser);
0106 
0107 #endif /* _DP_POWER_H_ */