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