blob: 014eebc75d97919aa85b8eef593ceeb15a9e9e4f [file] [log] [blame]
Rajeshwari Shindec5e37102012-06-06 19:54:29 +00001/*
2 * Copyright (C) 2012 Samsung Electronics
3 * Abhilash Kesavan <a.kesavan@samsung.com>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#ifndef __ASM_ARM_ARCH_PINMUX_H
25#define __ASM_ARM_ARCH_PINMUX_H
26
27#include "periph.h"
28
29/*
30 * Flags for setting specific configarations of peripherals.
31 * List will grow with support for more devices getting added.
32 */
33enum {
34 PINMUX_FLAG_NONE = 0x00000000,
35
36 /* Flags for eMMC */
37 PINMUX_FLAG_8BIT_MODE = 1 << 0, /* SDMMC 8-bit mode */
38
39 /* Flags for SROM controller */
40 PINMUX_FLAG_BANK = 3 << 0, /* bank number (0-3) */
41 PINMUX_FLAG_16BIT = 1 << 2, /* 16-bit width */
42};
43
44/**
45 * Configures the pinmux for a particular peripheral.
46 *
47 * Each gpio can be configured in many different ways (4 bits on exynos)
48 * such as "input", "output", "special function", "external interrupt"
49 * etc. This function will configure the peripheral pinmux along with
50 * pull-up/down and drive strength.
51 *
52 * @param peripheral peripheral to be configured
53 * @param flags configure flags
54 * @return 0 if ok, -1 on error (e.g. unsupported peripheral)
55 */
56int exynos_pinmux_config(int peripheral, int flags);
57
Rajeshwari Shinded0559112012-12-26 20:03:11 +000058/**
59 * Decode the peripheral id using the interrpt numbers.
60 *
61 * @param blob Device tree blob
62 * @param node FDT I2C node to find
63 * @return peripheral id if ok, PERIPH_ID_NONE on error
64 */
65int pinmux_decode_periph_id(const void *blob, int node);
Rajeshwari Shindec5e37102012-06-06 19:54:29 +000066#endif