dp_power.h 1.7 KB

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