mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 14:56:59 +00:00
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>
This commit is contained in:
parent
8ee950dd27
commit
b8dfcdb7d3
1 changed files with 17 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue