dp_power.h 2.1 KB

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