disp_dts_gpio.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __DISP_DTS_GPIO_H__
  2. #define __DISP_DTS_GPIO_H__
  3. /*
  4. * This module helps you to set GPIO pin according to linux device tree (DTS). To
  5. * use this module, you MUST init this module once before any operation.
  6. */
  7. #include <linux/platform_device.h> /* struct platform_device */
  8. /* DTS state */
  9. typedef enum tagDTS_GPIO_STATE {
  10. DTS_GPIO_STATE_TE_MODE_GPIO = 0, /* mode_te_gpio */
  11. DTS_GPIO_STATE_TE_MODE_TE, /* mode_te_te */
  12. DTS_GPIO_STATE_PWM_TEST_PINMUX_55, /* pwm_test_pin_mux_gpio55 */
  13. DTS_GPIO_STATE_PWM_TEST_PINMUX_69, /* pwm_test_pin_mux_gpio69 */
  14. DTS_GPIO_STATE_PWM_TEST_PINMUX_129, /* pwm_test_pin_mux_gpio129 */
  15. DTS_GPIO_STATE_MAX, /* for array size */
  16. } DTS_GPIO_STATE;
  17. /* this function MUST be called in mtkfb_probe.
  18. * @param *pdev - reference of struct platform_device which contains pinctrl
  19. * state information of GPIO
  20. * @return - 0 for OK, otherwise returns PTR_ERR(pdev).
  21. */
  22. long disp_dts_gpio_init(struct platform_device *pdev);
  23. /* set gpio according sepcified DTS state.
  24. * @notice - to call this function, you MUST init this module first.
  25. * If not, we will trigger BUG_ON(0).
  26. * @param s - state which describes GPIO statement.
  27. * @return - 0 for OK, otherwise returns PTR_ERR(pdev).
  28. */
  29. long disp_dts_gpio_select_state(DTS_GPIO_STATE s);
  30. /* repo of initialization */
  31. #ifdef CONFIG_MTK_LEGACY
  32. #define disp_dts_gpio_init_repo(x) (0)
  33. #else
  34. #define disp_dts_gpio_init_repo(x) (disp_dts_gpio_init(x))
  35. #endif
  36. #endif/*__DISP_DTS_GPIO_H__ */