diff mbox

[U-Boot,v2,2/4] gpio: do not include <asm/arch/gpio.h> for UniPhier

Message ID 1437135346-4612-3-git-send-email-yamada.masahiro@socionext.com
State Deferred
Delegated to: Simon Glass
Headers show

Commit Message

Masahiro Yamada July 17, 2015, 12:15 p.m. UTC
I implemented a GPIO driver based on Driver Model for the UniPhier
SoC family, but I could not find any good reason why such SoC
specific GPIO headers are needed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v2: None

 arch/arm/include/asm/gpio.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Glass Aug. 26, 2015, 3:53 a.m. UTC | #1
Hi,

On 17 July 2015 at 05:15, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> I implemented a GPIO driver based on Driver Model for the UniPhier
> SoC family, but I could not find any good reason why such SoC
> specific GPIO headers are needed.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> Changes in v2: None
>
>  arch/arm/include/asm/gpio.h | 2 ++
>  1 file changed, 2 insertions(+)

It is true that with device tree this probably isn't needed.

Some other boards just have dummy files. How do you suggest we deal
with this? I feel that adding dummy files is a reasonable approach
until everything is converted.

But I suppose this is another way.

Acked-by: Simon Glass <sjg@chromium.org>

Regards,
Simon
Masahiro Yamada Aug. 26, 2015, 4:08 a.m. UTC | #2
Hi Simon,


2015-08-26 12:53 GMT+09:00 Simon Glass <sjg@chromium.org>:
> Hi,
>
> On 17 July 2015 at 05:15, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> I implemented a GPIO driver based on Driver Model for the UniPhier
>> SoC family, but I could not find any good reason why such SoC
>> specific GPIO headers are needed.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>
>> Changes in v2: None
>>
>>  arch/arm/include/asm/gpio.h | 2 ++
>>  1 file changed, 2 insertions(+)
>
> It is true that with device tree this probably isn't needed.
>
> Some other boards just have dummy files. How do you suggest we deal
> with this? I feel that adding dummy files is a reasonable approach
> until everything is converted.
>
> But I suppose this is another way.
>
> Acked-by: Simon Glass <sjg@chromium.org>
>


I do not prefer dummy files.


We can increase ifdefs with conversion progress


#if !defined(CONFIG_ARCH_UNIPHIER) && \
    !defined(CONFIG_ARCH_FOO) && \
    !defined(CONFIG_ARCH_BAR)
 #include <asm/arch/gpio.h>
#endif





Or, let SoCs select HAVE_ARCH_GPIO.



In Kconfig,

config TEGRA
      ...
      select HAVE_ARCH_GPIO



then,



#ifdef CONFIG_HAVE_ARCH_GPIO
#include <asm/arch/gpio.h>
#endif





We can later drop "select HAVE_ARCH_GPIO" after converting the GPIO to DM.
diff mbox

Patch

diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index d49ad08..fe4419c 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -1,2 +1,4 @@ 
+#ifndef CONFIG_ARCH_UNIPHIER
 #include <asm/arch/gpio.h>
+#endif
 #include <asm-generic/gpio.h>