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