From 54cbac81881ded7fa487a9304e337d9acdbe4364 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 15 Dec 2012 23:50:37 +0100 Subject: sh: sh7723: Rename GPIO_FN_SIUOSPD to GPIO_FN_SIUAOSPD The GPIO was incorrectly named. As it has no user in the whole kernel tree, just rename it. Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij Signed-off-by: Simon Horman --- arch/sh/include/cpu-sh4/cpu/sh7723.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/sh/include') diff --git a/arch/sh/include/cpu-sh4/cpu/sh7723.h b/arch/sh/include/cpu-sh4/cpu/sh7723.h index 6fae50cb1e9..668da89bdac 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7723.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7723.h @@ -184,7 +184,7 @@ enum { /* SIUA */ GPIO_FN_SIUAFCK, GPIO_FN_SIUAILR, GPIO_FN_SIUAIBT, GPIO_FN_SIUAISLD, GPIO_FN_SIUAOLR, GPIO_FN_SIUAOBT, GPIO_FN_SIUAOSLD, GPIO_FN_SIUAMCK, - GPIO_FN_SIUAISPD, GPIO_FN_SIUOSPD, + GPIO_FN_SIUAISPD, GPIO_FN_SIUAOSPD, /* SIUB */ GPIO_FN_SIUBFCK, GPIO_FN_SIUBILR, GPIO_FN_SIUBIBT, GPIO_FN_SIUBISLD, -- cgit v1.2.3-70-g09d2 From cc88ec4875d3da8746a74e5772aa331dbf661647 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 15 Dec 2012 23:50:39 +0100 Subject: sh: sh7786: Fix port E, G and J GPIOs The port E, G and J GPIOs don't match the SoC datasheet (they seem to have been copied from the SH7785). Fix them. Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij Signed-off-by: Simon Horman --- arch/sh/include/cpu-sh4/cpu/sh7786.h | 8 +++----- arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'arch/sh/include') diff --git a/arch/sh/include/cpu-sh4/cpu/sh7786.h b/arch/sh/include/cpu-sh4/cpu/sh7786.h index 977862f9072..0df09e638f0 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7786.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7786.h @@ -32,16 +32,14 @@ enum { GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0, /* PE */ - GPIO_PE5, GPIO_PE4, GPIO_PE3, GPIO_PE2, - GPIO_PE1, GPIO_PE0, + GPIO_PE7, GPIO_PE6, /* PF */ GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4, GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0, /* PG */ - GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4, - GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0, + GPIO_PG7, GPIO_PG6, GPIO_PG5, /* PH */ GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4, @@ -49,7 +47,7 @@ enum { /* PJ */ GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4, - GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, GPIO_PJ0, + GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, /* DU */ GPIO_FN_DCLKIN, GPIO_FN_DCLKOUT, GPIO_FN_ODDF, diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c index 4229e0724c8..c24a7779405 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c @@ -468,8 +468,8 @@ static struct pinmux_gpio pinmux_gpios[] = { PINMUX_GPIO(GPIO_PD0, PD0_DATA), /* PE */ - PINMUX_GPIO(GPIO_PE5, PE7_DATA), - PINMUX_GPIO(GPIO_PE4, PE6_DATA), + PINMUX_GPIO(GPIO_PE7, PE7_DATA), + PINMUX_GPIO(GPIO_PE6, PE6_DATA), /* PF */ PINMUX_GPIO(GPIO_PF7, PF7_DATA), -- cgit v1.2.3-70-g09d2 From 8fdff1dc26fc0f50be2c64656229efca2e9de8c5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 15 Dec 2012 23:51:04 +0100 Subject: sh: Add PFC platform device registration helper function The sh_pfc_register() function can be called by boards or SoC setup code to register the PFC platform device. Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij Signed-off-by: Simon Horman --- arch/sh/include/cpu-common/cpu/pfc.h | 30 ++++++++++++++++++++++++ arch/sh/kernel/cpu/Makefile | 2 +- arch/sh/kernel/cpu/pfc.c | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 arch/sh/include/cpu-common/cpu/pfc.h create mode 100644 arch/sh/kernel/cpu/pfc.c (limited to 'arch/sh/include') diff --git a/arch/sh/include/cpu-common/cpu/pfc.h b/arch/sh/include/cpu-common/cpu/pfc.h new file mode 100644 index 00000000000..40e86436054 --- /dev/null +++ b/arch/sh/include/cpu-common/cpu/pfc.h @@ -0,0 +1,30 @@ +/* + * SH Pin Function Control Initialization + * + * Copyright (C) 2012 Renesas Solutions Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __ARCH_SH_CPU_PFC_H__ +#define __ARCH_SH_CPU_PFC_H__ + +#include + +struct pinmux_info; +struct resource; + +int sh_pfc_register(const char *name, + struct resource *resource, u32 num_resources); +int sh_pfc_register_info(const char *name, + struct resource *resource, u32 num_resources, + struct pinmux_info *pdata); + +#endif /* __ARCH_SH_CPU_PFC_H__ */ diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index fa58bfd30d8..accc7ca722e 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile @@ -18,4 +18,4 @@ obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ obj-$(CONFIG_SH_ADC) += adc.o obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o -obj-y += irq/ init.o clock.o fpu.o proc.o +obj-y += irq/ init.o clock.o fpu.o pfc.o proc.o diff --git a/arch/sh/kernel/cpu/pfc.c b/arch/sh/kernel/cpu/pfc.c new file mode 100644 index 00000000000..d045d75c05b --- /dev/null +++ b/arch/sh/kernel/cpu/pfc.c @@ -0,0 +1,44 @@ +/* + * SH Pin Function Control Initialization + * + * Copyright (C) 2012 Renesas Solutions Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include + +#include + +static struct platform_device sh_pfc_device = { + .name = "sh-pfc", + .id = -1, +}; + +int __init sh_pfc_register(const char *name, + struct resource *resource, u32 num_resources) +{ + if (name) + sh_pfc_device.name = name; + sh_pfc_device.num_resources = num_resources; + sh_pfc_device.resource = resource; + + return platform_device_register(&sh_pfc_device); +} + +int __init sh_pfc_register_info(const char *name, + struct resource *resource, u32 num_resources, + struct pinmux_info *pdata) +{ + sh_pfc_device.dev.platform_data = pdata; + + return sh_pfc_register(name, resource, num_resources); +} -- cgit v1.2.3-70-g09d2 From e854547bfa55660e088dffa640e7eaac61833c1a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 15 Dec 2012 23:51:53 +0100 Subject: sh: Remove unused sh_pfc_register_info() function All boards use sh_pfc_register() directly, remove the unused sh_pfc_register_info() function. Make the name argument to sh_pfc_register() mandatory as it's now supplied by all callers. Signed-off-by: Laurent Pinchart Acked-by: Linus Walleij Signed-off-by: Simon Horman --- arch/sh/include/asm/gpio.h | 2 +- arch/sh/include/cpu-common/cpu/pfc.h | 4 ---- arch/sh/kernel/cpu/pfc.c | 13 +------------ 3 files changed, 2 insertions(+), 17 deletions(-) (limited to 'arch/sh/include') diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h index 04f53d31489..7dfe15e2e99 100644 --- a/arch/sh/include/asm/gpio.h +++ b/arch/sh/include/asm/gpio.h @@ -20,7 +20,7 @@ #endif #define ARCH_NR_GPIOS 512 -#include +#include #ifdef CONFIG_GPIOLIB diff --git a/arch/sh/include/cpu-common/cpu/pfc.h b/arch/sh/include/cpu-common/cpu/pfc.h index 40e86436054..e538813286a 100644 --- a/arch/sh/include/cpu-common/cpu/pfc.h +++ b/arch/sh/include/cpu-common/cpu/pfc.h @@ -18,13 +18,9 @@ #include -struct pinmux_info; struct resource; int sh_pfc_register(const char *name, struct resource *resource, u32 num_resources); -int sh_pfc_register_info(const char *name, - struct resource *resource, u32 num_resources, - struct pinmux_info *pdata); #endif /* __ARCH_SH_CPU_PFC_H__ */ diff --git a/arch/sh/kernel/cpu/pfc.c b/arch/sh/kernel/cpu/pfc.c index d045d75c05b..d766564ef7c 100644 --- a/arch/sh/kernel/cpu/pfc.c +++ b/arch/sh/kernel/cpu/pfc.c @@ -19,26 +19,15 @@ #include static struct platform_device sh_pfc_device = { - .name = "sh-pfc", .id = -1, }; int __init sh_pfc_register(const char *name, struct resource *resource, u32 num_resources) { - if (name) - sh_pfc_device.name = name; + sh_pfc_device.name = name; sh_pfc_device.num_resources = num_resources; sh_pfc_device.resource = resource; return platform_device_register(&sh_pfc_device); } - -int __init sh_pfc_register_info(const char *name, - struct resource *resource, u32 num_resources, - struct pinmux_info *pdata) -{ - sh_pfc_device.dev.platform_data = pdata; - - return sh_pfc_register(name, resource, num_resources); -} -- cgit v1.2.3-70-g09d2