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