Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Rajeshwari Shinde | 57da3e3 | 2012-06-06 19:54:29 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 Samsung Electronics |
| 4 | * Abhilash Kesavan <a.kesavan@samsung.com> |
Rajeshwari Shinde | 57da3e3 | 2012-06-06 19:54:29 +0000 | [diff] [blame] | 5 | */ |
| 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 | */ |
| 16 | enum { |
| 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 */ |
Przemyslaw Marczak | 056d655 | 2015-01-27 13:36:34 +0100 | [diff] [blame] | 25 | |
| 26 | /* Flags for I2C */ |
| 27 | PINMUX_FLAG_HS_MODE = 1 << 1, /* I2C High Speed Mode */ |
Rajeshwari Shinde | 57da3e3 | 2012-06-06 19:54:29 +0000 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | /** |
| 31 | * Configures the pinmux for a particular peripheral. |
| 32 | * |
| 33 | * Each gpio can be configured in many different ways (4 bits on exynos) |
| 34 | * such as "input", "output", "special function", "external interrupt" |
| 35 | * etc. This function will configure the peripheral pinmux along with |
| 36 | * pull-up/down and drive strength. |
| 37 | * |
| 38 | * @param peripheral peripheral to be configured |
| 39 | * @param flags configure flags |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 40 | * Return: 0 if ok, -1 on error (e.g. unsupported peripheral) |
Rajeshwari Shinde | 57da3e3 | 2012-06-06 19:54:29 +0000 | [diff] [blame] | 41 | */ |
| 42 | int exynos_pinmux_config(int peripheral, int flags); |
| 43 | |
Rajeshwari Shinde | 28bae82 | 2012-12-26 20:03:11 +0000 | [diff] [blame] | 44 | /** |
| 45 | * Decode the peripheral id using the interrpt numbers. |
| 46 | * |
| 47 | * @param blob Device tree blob |
| 48 | * @param node FDT I2C node to find |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 49 | * Return: peripheral id if ok, PERIPH_ID_NONE on error |
Rajeshwari Shinde | 28bae82 | 2012-12-26 20:03:11 +0000 | [diff] [blame] | 50 | */ |
| 51 | int pinmux_decode_periph_id(const void *blob, int node); |
Rajeshwari Shinde | 57da3e3 | 2012-06-06 19:54:29 +0000 | [diff] [blame] | 52 | #endif |