dp_power.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. * @park_clocks: park all clocks driven by PLL
  19. * @clk_get_rate: get the current rate for provided clk_name
  20. * @power_client_init: configures clocks and regulators
  21. * @power_client_deinit: frees clock and regulator resources
  22. * @power_mmrm_init: configures mmrm client registration
  23. */
  24. struct dp_power {
  25. struct drm_device *drm_dev;
  26. struct sde_power_handle *phandle;
  27. int (*init)(struct dp_power *power, bool flip);
  28. int (*deinit)(struct dp_power *power);
  29. int (*clk_enable)(struct dp_power *power, enum dp_pm_type pm_type,
  30. bool enable);
  31. bool (*clk_status)(struct dp_power *power, enum dp_pm_type pm_type);
  32. int (*set_pixel_clk_parent)(struct dp_power *power, u32 stream_id);
  33. int (*park_clocks)(struct dp_power *power);
  34. u64 (*clk_get_rate)(struct dp_power *power, char *clk_name);
  35. int (*power_client_init)(struct dp_power *power,
  36. struct sde_power_handle *phandle,
  37. struct drm_device *drm_dev);
  38. void (*power_client_deinit)(struct dp_power *power);
  39. int (*power_mmrm_init)(struct dp_power *power,
  40. struct sde_power_handle *phandle, void *dp,
  41. int (*dp_display_mmrm_callback)(struct mmrm_client_notifier_data *notifier_data));
  42. };
  43. /**
  44. * dp_power_get() - configure and get the DisplayPort power module data
  45. *
  46. * @parser: instance of parser module
  47. * @pll: instance of pll module
  48. * return: pointer to allocated power module data
  49. *
  50. * This API will configure the DisplayPort's power module and provides
  51. * methods to be called by the client to configure the power related
  52. * modueles.
  53. */
  54. struct dp_power *dp_power_get(struct dp_parser *parser, struct dp_pll *pll);
  55. /**
  56. * dp_power_put() - release the power related resources
  57. *
  58. * @power: pointer to the power module's data
  59. */
  60. void dp_power_put(struct dp_power *power);
  61. #endif /* _DP_POWER_H_ */