diff options
author | Piotr Wilczek <p.wilczek@samsung.com> | 2014-03-07 14:59:38 +0100 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2014-03-12 19:54:59 +0900 |
commit | b8dfcdb7d3e3442ba9f5a593ecaac7d8bc5fa921 (patch) | |
tree | 063051e4aace4699d691da9b0bb06ba71fa070f1 /arch/arm/cpu | |
parent | 8ee950dd273aef6a074d41bf2ee4ef11d6f848fb (diff) | |
download | u-boot-imx-b8dfcdb7d3e3442ba9f5a593ecaac7d8bc5fa921.zip u-boot-imx-b8dfcdb7d3e3442ba9f5a593ecaac7d8bc5fa921.tar.gz u-boot-imx-b8dfcdb7d3e3442ba9f5a593ecaac7d8bc5fa921.tar.bz2 |
exynos4:pinmux:fdt: decode peripheral id
This patch adds api to decode peripheral id based on interrupt number.
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/armv7/exynos/pinmux.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c index 645c497..8d6e5c1 100644 --- a/arch/arm/cpu/armv7/exynos/pinmux.c +++ b/arch/arm/cpu/armv7/exynos/pinmux.c @@ -741,6 +741,21 @@ int exynos_pinmux_config(int peripheral, int flags) } #ifdef CONFIG_OF_CONTROL +static int exynos4_pinmux_decode_periph_id(const void *blob, int node) +{ + int err; + u32 cell[3]; + + err = fdtdec_get_int_array(blob, node, "interrupts", cell, + ARRAY_SIZE(cell)); + if (err) { + debug(" invalid peripheral id\n"); + return PERIPH_ID_NONE; + } + + return cell[1]; +} + static int exynos5_pinmux_decode_periph_id(const void *blob, int node) { int err; @@ -758,6 +773,8 @@ int pinmux_decode_periph_id(const void *blob, int node) { if (cpu_is_exynos5()) return exynos5_pinmux_decode_periph_id(blob, node); + else if (cpu_is_exynos4()) + return exynos4_pinmux_decode_periph_id(blob, node); else return PERIPH_ID_NONE; } |