pinmux.h 1.4 KB

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