setup-fimc.c 916 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics Co., Ltd.
  3. *
  4. * S5PV210 camera interface GPIO configuration.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/gpio.h>
  11. #include <plat/gpio-cfg.h>
  12. #include <plat/camport.h>
  13. int s5pv210_fimc_setup_gpio(enum s5p_camport_id id)
  14. {
  15. u32 gpio8, gpio5;
  16. int ret;
  17. switch (id) {
  18. case S5P_CAMPORT_A:
  19. gpio8 = S5PV210_GPE0(0);
  20. gpio5 = S5PV210_GPE1(0);
  21. break;
  22. case S5P_CAMPORT_B:
  23. gpio8 = S5PV210_GPJ0(0);
  24. gpio5 = S5PV210_GPJ1(0);
  25. break;
  26. default:
  27. WARN(1, "Wrong camport id: %d\n", id);
  28. return -EINVAL;
  29. }
  30. ret = s3c_gpio_cfgall_range(gpio8, 8, S3C_GPIO_SFN(2),
  31. S3C_GPIO_PULL_UP);
  32. if (ret)
  33. return ret;
  34. return s3c_gpio_cfgall_range(gpio5, 5, S3C_GPIO_SFN(2),
  35. S3C_GPIO_PULL_UP);
  36. }