dp_power.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _DP_POWER_H_
  6. #define _DP_POWER_H_
  7. #include "dp_parser.h"
  8. #include "dp_pll.h"
  9. #include "sde_power_handle.h"
  10. /**
  11. * sruct dp_power - DisplayPort's power related data
  12. *
  13. * @init: initializes the regulators/core clocks/GPIOs/pinctrl
  14. * @deinit: turns off the regulators/core clocks/GPIOs/pinctrl
  15. * @clk_enable: enable/disable the DP clocks
  16. * @clk_status: check for clock status
  17. * @set_pixel_clk_parent: set the parent of DP pixel clock
  18. * @clk_get_rate: get the current rate for provided clk_name
  19. * @power_client_init: configures clocks and regulators
  20. * @power_client_deinit: frees clock and regulator resources
  21. * @power_mmrm_init: configures mmrm client registration
  22. */
  23. struct dp_power {
  24. struct drm_device *drm_dev;
  25. struct sde_power_handle *phandle;
  26. int (*init)(struct dp_power *power, bool flip);
  27. int (*deinit)(struct dp_power *power);
  28. int (*clk_enable)(struct dp_power *power, enum dp_pm_type pm_type,
  29. bool enable);
  30. bool (*clk_status)(struct dp_power *power, enum dp_pm_type pm_type);
  31. int (*set_pixel_clk_parent)(struct dp_power *power, u32 stream_id);
  32. u64 (*clk_get_rate)(struct dp_power *power, char *clk_name);
  33. int (*power_client_init)(struct dp_power *power,
  34. struct sde_power_handle *phandle,
  35. struct drm_device *drm_dev);
  36. void (*power_client_deinit)(struct dp_power *power);
  37. int (*power_mmrm_init)(struct dp_power *power,
  38. struct sde_power_handle *phandle, void *dp,
  39. int (*dp_display_mmrm_callback)(struct mmrm_client_notifier_data *notifier_data));
  40. };
  41. /**
  42. * dp_power_get() - configure and get the DisplayPort power module data
  43. *
  44. * @parser: instance of parser module
  45. * @pll: instance of pll module
  46. * return: pointer to allocated power module data
  47. *
  48. * This API will configure the DisplayPort's power module and provides
  49. * methods to be called by the client to configure the power related
  50. * modueles.
  51. */
  52. struct dp_power *dp_power_get(struct dp_parser *parser, struct dp_pll *pll);
  53. /**
  54. * dp_power_put() - release the power related resources
  55. *
  56. * @power: pointer to the power module's data
  57. */
  58. void dp_power_put(struct dp_power *power);
  59. #endif /* _DP_POWER_H_ */