pinmux.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2012 Samsung Electronics
  4. * Abhilash Kesavan <a.kesavan@samsung.com>
  5. */
  6. #ifndef __ASM_ARM_ARCH_PINMUX_H
  7. #define __ASM_ARM_ARCH_PINMUX_H
  8. #include "periph.h"
  9. /*
  10. * Flags for setting specific configarations of peripherals.
  11. * List will grow with support for more devices getting added.
  12. */
  13. enum {
  14. PINMUX_FLAG_NONE = 0x00000000,
  15. /* Flags for eMMC */
  16. PINMUX_FLAG_8BIT_MODE = 1 << 0, /* SDMMC 8-bit mode */
  17. /* Flags for SROM controller */
  18. PINMUX_FLAG_BANK = 3 << 0, /* bank number (0-3) */
  19. PINMUX_FLAG_16BIT = 1 << 2, /* 16-bit width */
  20. };
  21. /**
  22. * Configures the pinmux for a particular peripheral.
  23. *
  24. * Each gpio can be configured in many different ways (4 bits on exynos)
  25. * such as "input", "output", "special function", "external interrupt"
  26. * etc. This function will configure the peripheral pinmux along with
  27. * pull-up/down and drive strength.
  28. *
  29. * @param peripheral peripheral to be configured
  30. * @param flags configure flags
  31. * Return: 0 if ok, -1 on error (e.g. unsupported peripheral)
  32. */
  33. int exynos_pinmux_config(int peripheral, int flags);
  34. /**
  35. * Decode the peripheral id using the interrpt numbers.
  36. *
  37. * @param blob Device tree blob
  38. * @param node FDT I2C node to find
  39. * Return: peripheral id if ok, PERIPH_ID_NONE on error
  40. */
  41. int pinmux_decode_periph_id(const void *blob, int node);
  42. #endif