board.c 750 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2018 Armadeus Systems
  4. */
  5. #include <common.h>
  6. #include <init.h>
  7. #include <asm/arch/sys_proto.h>
  8. #include <asm/gpio.h>
  9. #include <asm/io.h>
  10. #ifdef CONFIG_VIDEO_MXS
  11. int setup_lcd(void)
  12. {
  13. struct gpio_desc backlight;
  14. int ret;
  15. /* Set Brightness to high */
  16. ret = dm_gpio_lookup_name("GPIO4_10", &backlight);
  17. if (ret) {
  18. printf("Cannot get GPIO4_10\n");
  19. return ret;
  20. }
  21. ret = dm_gpio_request(&backlight, "backlight");
  22. if (ret) {
  23. printf("Cannot request GPIO4_10\n");
  24. return ret;
  25. }
  26. dm_gpio_set_dir_flags(&backlight, GPIOD_IS_OUT);
  27. dm_gpio_set_value(&backlight, 1);
  28. return 0;
  29. }
  30. #endif
  31. int opos6ul_board_late_init(void)
  32. {
  33. #ifdef CONFIG_VIDEO_MXS
  34. setup_lcd();
  35. #endif
  36. return 0;
  37. }