Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Minkyu Kang
Dear Marek,

On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
  +int gpio_set_value(unsigned gpio, int value)
  +{
  +       unsigned l = readl(GPIO_FULLPORT(gpio));
  +       unsigned port = GPIO_FULLPORT(gpio);
  +
  +       /*
  +        * All GPIO Port have a configuration on
  +        * 2 bits excepted the first GPIO (A) which
  +        * have only 1 bit of configuration.
  +        */
  +       if (value)
  +               if (!GPIO_PORT(gpio))
  +                       l |= (0x1  GPIO_BIT(gpio));
  +               else
  +                       l |= (0x3  GPIO_BIT(gpio));
  +       else
  +               if (!GPIO_PORT(gpio))
  +                       l = ~(0x1  GPIO_BIT(gpio));
  +               else
  +                       l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)

As I know, it's a rule of u-boot.. maybe. :)

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Scott Wood
On 05/02/2012 01:16 AM, Minkyu Kang wrote:
 Dear Marek,
 
 On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
 +int gpio_set_value(unsigned gpio, int value)
 +{
 +   unsigned l = readl(GPIO_FULLPORT(gpio));
 +   unsigned port = GPIO_FULLPORT(gpio);
 +
 +   /*
 +* All GPIO Port have a configuration on
 +* 2 bits excepted the first GPIO (A) which
 +* have only 1 bit of configuration.
 +*/
 +   if (value)
 +   if (!GPIO_PORT(gpio))
 +   l |= (0x1  GPIO_BIT(gpio));
 +   else
 +   l |= (0x3  GPIO_BIT(gpio));
 +   else
 +   if (!GPIO_PORT(gpio))
 +   l = ~(0x1  GPIO_BIT(gpio));
 +   else
 +   l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)
 
 As I know, it's a rule of u-boot.. maybe. :)

It is a U-Boot rule (multi-line if/loop body), and also it's good to
avoid the ambiguous if/if/else construct, but wouldn't this be better as:

if (GPIO_PORT(gpio))
bit = 1  GPIO_BIT(gpio);
else
bit = 3  GPIO_BIT(gpio);

if (value)
l |= bit;
else
l = ~bit;

?

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Gabriel Huau
On Wed, May 02, 2012 at 01:40:35PM -0500, Scott Wood wrote:
 On 05/02/2012 01:16 AM, Minkyu Kang wrote:
  Dear Marek,
  
  On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
  +int gpio_set_value(unsigned gpio, int value)
  +{
  +   unsigned l = readl(GPIO_FULLPORT(gpio));
  +   unsigned port = GPIO_FULLPORT(gpio);
  +
  +   /*
  +* All GPIO Port have a configuration on
  +* 2 bits excepted the first GPIO (A) which
  +* have only 1 bit of configuration.
  +*/
  +   if (value)
  +   if (!GPIO_PORT(gpio))
  +   l |= (0x1  GPIO_BIT(gpio));
  +   else
  +   l |= (0x3  GPIO_BIT(gpio));
  +   else
  +   if (!GPIO_PORT(gpio))
  +   l = ~(0x1  GPIO_BIT(gpio));
  +   else
  +   l = ~(0x3  GPIO_BIT(gpio));
 
  Need brace at this if..else statement.
 
  I wanted to ask why, but ... C isn't python, good point ;-)
  
  As I know, it's a rule of u-boot.. maybe. :)
 
 It is a U-Boot rule (multi-line if/loop body), and also it's good to
 avoid the ambiguous if/if/else construct, but wouldn't this be better as:
 
 if (GPIO_PORT(gpio))
   bit = 1  GPIO_BIT(gpio);
 else
   bit = 3  GPIO_BIT(gpio);
 
 if (value)
   l |= bit;
 else
   l = ~bit;
 
 ?
 

For multi-line, we should maybe patch the checkpatch.pl to check this
statement. But, indeed, I will do the modification of Scott.

 -Scott
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Scott Wood
On 05/02/2012 03:16 PM, Gabriel Huau wrote:
 On Wed, May 02, 2012 at 01:40:35PM -0500, Scott Wood wrote:
 On 05/02/2012 01:16 AM, Minkyu Kang wrote:
 Dear Marek,

 On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
 +int gpio_set_value(unsigned gpio, int value)
 +{
 +   unsigned l = readl(GPIO_FULLPORT(gpio));
 +   unsigned port = GPIO_FULLPORT(gpio);
 +
 +   /*
 +* All GPIO Port have a configuration on
 +* 2 bits excepted the first GPIO (A) which
 +* have only 1 bit of configuration.
 +*/
 +   if (value)
 +   if (!GPIO_PORT(gpio))
 +   l |= (0x1  GPIO_BIT(gpio));
 +   else
 +   l |= (0x3  GPIO_BIT(gpio));
 +   else
 +   if (!GPIO_PORT(gpio))
 +   l = ~(0x1  GPIO_BIT(gpio));
 +   else
 +   l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)

 As I know, it's a rule of u-boot.. maybe. :)

 It is a U-Boot rule (multi-line if/loop body), and also it's good to
 avoid the ambiguous if/if/else construct, but wouldn't this be better as:

 if (GPIO_PORT(gpio))
  bit = 1  GPIO_BIT(gpio);
 else
  bit = 3  GPIO_BIT(gpio);

 if (value)
  l |= bit;
 else
  l = ~bit;

 ?

 
 For multi-line, we should maybe patch the checkpatch.pl to check this
 statement. But, indeed, I will do the modification of Scott.

...with the 1 and 3 swapped in the first if/else, of course. :-P

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-01 Thread Minkyu Kang
Dear Gabriel Huau,

On 30 April 2012 23:11, Gabriel Huau cont...@huau-gabriel.fr wrote:
 It's now possible to use the gpio driver interface
 for s3c2440. This patch add iomux definitions too.

 Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
 ---
 Changes for v2:
        - Modification of the coding style
        - Add my email address to copyright
        - Remove a typedef
        - Move some defines to driver file

 Changes for v3:
        - Cleanup coding style
        - Changement of the commit message

 Changes for v4:
        - Add a nice commit message

  arch/arm/include/asm/arch-s3c24x0/gpio.h  |  171 
  arch/arm/include/asm/arch-s3c24x0/iomux.h |  200 
 +
  drivers/gpio/Makefile                     |    1 +
  drivers/gpio/s3c2440_gpio.c               |   94 ++
  4 files changed, 466 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-s3c24x0/gpio.h
  create mode 100644 arch/arm/include/asm/arch-s3c24x0/iomux.h
  create mode 100644 drivers/gpio/s3c2440_gpio.c

 diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c
 new file mode 100644
 index 000..12a9043
 --- /dev/null
 +++ b/drivers/gpio/s3c2440_gpio.c
 @@ -0,0 +1,94 @@
 +/*
 + * Copyright (C) 2012
 + * Gabriel Huau cont...@huau-gabriel.fr
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * 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.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +#include common.h
 +#include asm/arch/s3c2440.h
 +#include asm/gpio.h
 +#include asm/io.h
 +
 +#define GPIO_INPUT  0x0
 +#define GPIO_OUTPUT 0x1
 +
 +/* 0x4 means that we want DAT and not CON register */
 +#define GPIO_PORT(x)   x)  5)  0x3) + 0x4)
 +#define GPIO_BIT(x)            ((x)  0x3f)
 +
 +/*
 + * It's how we calculate the full port address
 + * We have to get the number of the port + 1 (Port A is at 0x5601 ...)
 + * We move it at the second digit, and finally we add 0x4 because we want
 + * to modify GPIO DAT and not CON
 + */
 +#define GPIO_FULLPORT(x) (S3C24X0_GPIO_BASE | ((GPIO_PORT(gpio) + 1)  1))
 +
 +int gpio_set_value(unsigned gpio, int value)
 +{
 +       unsigned l = readl(GPIO_FULLPORT(gpio));
 +       unsigned port = GPIO_FULLPORT(gpio);
 +
 +       /*
 +        * All GPIO Port have a configuration on
 +        * 2 bits excepted the first GPIO (A) which
 +        * have only 1 bit of configuration.
 +        */
 +       if (value)
 +               if (!GPIO_PORT(gpio))
 +                       l |= (0x1  GPIO_BIT(gpio));
 +               else
 +                       l |= (0x3  GPIO_BIT(gpio));
 +       else
 +               if (!GPIO_PORT(gpio))
 +                       l = ~(0x1  GPIO_BIT(gpio));
 +               else
 +                       l = ~(0x3  GPIO_BIT(gpio));

Need brace at this if..else statement.

 +       return writel(port, l);
 +}
 +
 +int gpio_get_value(unsigned gpio)
 +{
 +       unsigned l = readl(GPIO_FULLPORT(gpio));
 +
 +       if (GPIO_PORT(gpio) == 0) /* PORT A */
 +               return (l  GPIO_BIT(gpio))  0x1;
 +       return (l  GPIO_BIT(gpio))  0x3;
 +}
 +
 +int gpio_request(unsigned gpio, const char *label)
 +{
 +       return 0;
 +}
 +
 +int gpio_free(unsigned gpio)
 +{
 +       return 0;
 +}
 +
 +int gpio_direction_input(unsigned gpio)
 +{
 +       return writel(GPIO_FULLPORT(gpio), GPIO_INPUT  GPIO_BIT(gpio));
 +}
 +
 +int gpio_direction_output(unsigned gpio, int value)
 +{
 +       writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT  GPIO_BIT(gpio));
 +       return gpio_set_value(gpio, value);
 +}
 --
 1.7.9.5

 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-01 Thread Marek Vasut
Dear Minkyu Kang,

 Dear Gabriel Huau,
 
 On 30 April 2012 23:11, Gabriel Huau cont...@huau-gabriel.fr wrote:
  It's now possible to use the gpio driver interface
  for s3c2440. This patch add iomux definitions too.
  
  Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
  ---
  Changes for v2:
 - Modification of the coding style
 - Add my email address to copyright
 - Remove a typedef
 - Move some defines to driver file
  
  Changes for v3:
 - Cleanup coding style
 - Changement of the commit message
  
  Changes for v4:
 - Add a nice commit message
  
   arch/arm/include/asm/arch-s3c24x0/gpio.h  |  171
   arch/arm/include/asm/arch-s3c24x0/iomux.h |
   200 + drivers/gpio/Makefile
  |1 +
   drivers/gpio/s3c2440_gpio.c   |   94 ++
   4 files changed, 466 insertions(+)
   create mode 100644 arch/arm/include/asm/arch-s3c24x0/gpio.h
   create mode 100644 arch/arm/include/asm/arch-s3c24x0/iomux.h
   create mode 100644 drivers/gpio/s3c2440_gpio.c
  
  diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c
  new file mode 100644
  index 000..12a9043
  --- /dev/null
  +++ b/drivers/gpio/s3c2440_gpio.c
  @@ -0,0 +1,94 @@
  +/*
  + * Copyright (C) 2012
  + * Gabriel Huau cont...@huau-gabriel.fr
  + *
  + * See file CREDITS for list of people who contributed to this
  + * project.
  + *
  + * 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; either version 2 of
  + * the License, or (at your option) any later version.
  + *
  + * 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.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  + * MA 02111-1307 USA
  + */
  +#include common.h
  +#include asm/arch/s3c2440.h
  +#include asm/gpio.h
  +#include asm/io.h
  +
  +#define GPIO_INPUT  0x0
  +#define GPIO_OUTPUT 0x1
  +
  +/* 0x4 means that we want DAT and not CON register */
  +#define GPIO_PORT(x)   x)  5)  0x3) + 0x4)
  +#define GPIO_BIT(x)((x)  0x3f)
  +
  +/*
  + * It's how we calculate the full port address
  + * We have to get the number of the port + 1 (Port A is at 0x5601
  ...) + * We move it at the second digit, and finally we add 0x4 because
  we want + * to modify GPIO DAT and not CON
  + */
  +#define GPIO_FULLPORT(x) (S3C24X0_GPIO_BASE | ((GPIO_PORT(gpio) + 1) 
  1)) +
  +int gpio_set_value(unsigned gpio, int value)
  +{
  +   unsigned l = readl(GPIO_FULLPORT(gpio));
  +   unsigned port = GPIO_FULLPORT(gpio);
  +
  +   /*
  +* All GPIO Port have a configuration on
  +* 2 bits excepted the first GPIO (A) which
  +* have only 1 bit of configuration.
  +*/
  +   if (value)
  +   if (!GPIO_PORT(gpio))
  +   l |= (0x1  GPIO_BIT(gpio));
  +   else
  +   l |= (0x3  GPIO_BIT(gpio));
  +   else
  +   if (!GPIO_PORT(gpio))
  +   l = ~(0x1  GPIO_BIT(gpio));
  +   else
  +   l = ~(0x3  GPIO_BIT(gpio));
 
 Need brace at this if..else statement.

I wanted to ask why, but ... C isn't python, good point ;-)

  +   return writel(port, l);
  +}
  +
  +int gpio_get_value(unsigned gpio)
  +{
  +   unsigned l = readl(GPIO_FULLPORT(gpio));
  +
  +   if (GPIO_PORT(gpio) == 0) /* PORT A */
  +   return (l  GPIO_BIT(gpio))  0x1;
  +   return (l  GPIO_BIT(gpio))  0x3;
  +}
  +
  +int gpio_request(unsigned gpio, const char *label)
  +{
  +   return 0;
  +}
  +
  +int gpio_free(unsigned gpio)
  +{
  +   return 0;
  +}
  +
  +int gpio_direction_input(unsigned gpio)
  +{
  +   return writel(GPIO_FULLPORT(gpio), GPIO_INPUT  GPIO_BIT(gpio));
  +}
  +
  +int gpio_direction_output(unsigned gpio, int value)
  +{
  +   writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT  GPIO_BIT(gpio));
  +   return gpio_set_value(gpio, value);
  +}
  --
  1.7.9.5
  
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot
 
 Thanks.
 Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-04-30 Thread Gabriel Huau
It's now possible to use the gpio driver interface
for s3c2440. This patch add iomux definitions too.

Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
---
Changes for v2:
- Modification of the coding style
- Add my email address to copyright
- Remove a typedef
- Move some defines to driver file

Changes for v3:
- Cleanup coding style
- Changement of the commit message

Changes for v4:
- Add a nice commit message

 arch/arm/include/asm/arch-s3c24x0/gpio.h  |  171 
 arch/arm/include/asm/arch-s3c24x0/iomux.h |  200 +
 drivers/gpio/Makefile |1 +
 drivers/gpio/s3c2440_gpio.c   |   94 ++
 4 files changed, 466 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-s3c24x0/gpio.h
 create mode 100644 arch/arm/include/asm/arch-s3c24x0/iomux.h
 create mode 100644 drivers/gpio/s3c2440_gpio.c

diff --git a/arch/arm/include/asm/arch-s3c24x0/gpio.h 
b/arch/arm/include/asm/arch-s3c24x0/gpio.h
new file mode 100644
index 000..76bc52c
--- /dev/null
+++ b/arch/arm/include/asm/arch-s3c24x0/gpio.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2012.
+ *
+ * Gabriel Huau cont...@huau-gabriel.fr
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _S3C24X0_GPIO_H_
+#define _S3C24X0_GPIO_H_
+
+enum s3c2440_gpio {
+   GPA0,
+   GPA1,
+   GPA2,
+   GPA3,
+   GPA4,
+   GPA5,
+   GPA6,
+   GPA7,
+   GPA8,
+   GPA9,
+   GPA10,
+   GPA11,
+   GPA12,
+   GPA13,
+   GPA14,
+   GPA15,
+   GPA16,
+   GPA17,
+   GPA18,
+   GPA19,
+   GPA20,
+   GPA21,
+   GPA22,
+   GPA23,
+   GPA24,
+
+   GPB0 = 32,
+   GPB1,
+   GPB2,
+   GPB3,
+   GPB4,
+   GPB5,
+   GPB6,
+   GPB7,
+   GPB8,
+   GPB9,
+   GPB10,
+
+   GPC0 = 64,
+   GPC1,
+   GPC2,
+   GPC3,
+   GPC4,
+   GPC5,
+   GPC6,
+   GPC7,
+   GPC8,
+   GPC9,
+   GPC10,
+   GPC11,
+   GPC12,
+   GPC13,
+   GPC14,
+   GPC15,
+
+   GPD0 = 96,
+   GPD1,
+   GPD2,
+   GPD3,
+   GPD4,
+   GPD5,
+   GPD6,
+   GPD7,
+   GPD8,
+   GPD9,
+   GPD10,
+   GPD11,
+   GPD12,
+   GPD13,
+   GPD14,
+   GPD15,
+
+   GPE0 = 128,
+   GPE1,
+   GPE2,
+   GPE3,
+   GPE4,
+   GPE5,
+   GPE6,
+   GPE7,
+   GPE8,
+   GPE9,
+   GPE10,
+   GPE11,
+   GPE12,
+   GPE13,
+   GPE14,
+   GPE15,
+
+   GPF0 = 160,
+   GPF1,
+   GPF2,
+   GPF3,
+   GPF4,
+   GPF5,
+   GPF6,
+   GPF7,
+
+   GPG0 = 192,
+   GPG1,
+   GPG2,
+   GPG3,
+   GPG4,
+   GPG5,
+   GPG6,
+   GPG7,
+   GPG8,
+   GPG9,
+   GPG10,
+   GPG11,
+   GPG12,
+   GPG13,
+   GPG14,
+   GPG15,
+
+   GPH0 = 224,
+   GPH1,
+   GPH2,
+   GPH3,
+   GPH4,
+   GPH5,
+   GPH6,
+   GPH7,
+   GPH8,
+   GPH9,
+   GPH10,
+
+   GPJ0 = 256,
+   GPJ1,
+   GPJ2,
+   GPJ3,
+   GPJ4,
+   GPJ5,
+   GPJ6,
+   GPJ7,
+   GPJ8,
+   GPJ9,
+   GPJ10,
+   GPJ11,
+   GPJ12,
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-s3c24x0/iomux.h 
b/arch/arm/include/asm/arch-s3c24x0/iomux.h
new file mode 100644
index 000..cc22de7
--- /dev/null
+++ b/arch/arm/include/asm/arch-s3c24x0/iomux.h
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2012
+ *
+ * Gabriel Huau cont...@huau-gabriel.fr
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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 

Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-04-30 Thread Marek Vasut
Dear Gabriel Huau,

 It's now possible to use the gpio driver interface
 for s3c2440. This patch add iomux definitions too.

All right, I guess I can't rub my sadistic reviewing pleasures on you anymore 
;-)

Acked-by: Marek Vasut ma...@denx.de
 
 Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
 ---
 Changes for v2:
   - Modification of the coding style
   - Add my email address to copyright
   - Remove a typedef
   - Move some defines to driver file
 
 Changes for v3:
   - Cleanup coding style
   - Changement of the commit message
 
 Changes for v4:
   - Add a nice commit message
 
  arch/arm/include/asm/arch-s3c24x0/gpio.h  |  171 
  arch/arm/include/asm/arch-s3c24x0/iomux.h |  200
 + drivers/gpio/Makefile | 
   1 +
  drivers/gpio/s3c2440_gpio.c   |   94 ++
  4 files changed, 466 insertions(+)
  create mode 100644 arch/arm/include/asm/arch-s3c24x0/gpio.h
  create mode 100644 arch/arm/include/asm/arch-s3c24x0/iomux.h
  create mode 100644 drivers/gpio/s3c2440_gpio.c
 
 diff --git a/arch/arm/include/asm/arch-s3c24x0/gpio.h
 b/arch/arm/include/asm/arch-s3c24x0/gpio.h new file mode 100644
 index 000..76bc52c
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-s3c24x0/gpio.h
 @@ -0,0 +1,171 @@
 +/*
 + * Copyright (c) 2012.
 + *
 + * Gabriel Huau cont...@huau-gabriel.fr
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * 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.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#ifndef _S3C24X0_GPIO_H_
 +#define _S3C24X0_GPIO_H_
 +
 +enum s3c2440_gpio {
 + GPA0,
 + GPA1,
 + GPA2,
 + GPA3,
 + GPA4,
 + GPA5,
 + GPA6,
 + GPA7,
 + GPA8,
 + GPA9,
 + GPA10,
 + GPA11,
 + GPA12,
 + GPA13,
 + GPA14,
 + GPA15,
 + GPA16,
 + GPA17,
 + GPA18,
 + GPA19,
 + GPA20,
 + GPA21,
 + GPA22,
 + GPA23,
 + GPA24,
 +
 + GPB0 = 32,
 + GPB1,
 + GPB2,
 + GPB3,
 + GPB4,
 + GPB5,
 + GPB6,
 + GPB7,
 + GPB8,
 + GPB9,
 + GPB10,
 +
 + GPC0 = 64,
 + GPC1,
 + GPC2,
 + GPC3,
 + GPC4,
 + GPC5,
 + GPC6,
 + GPC7,
 + GPC8,
 + GPC9,
 + GPC10,
 + GPC11,
 + GPC12,
 + GPC13,
 + GPC14,
 + GPC15,
 +
 + GPD0 = 96,
 + GPD1,
 + GPD2,
 + GPD3,
 + GPD4,
 + GPD5,
 + GPD6,
 + GPD7,
 + GPD8,
 + GPD9,
 + GPD10,
 + GPD11,
 + GPD12,
 + GPD13,
 + GPD14,
 + GPD15,
 +
 + GPE0 = 128,
 + GPE1,
 + GPE2,
 + GPE3,
 + GPE4,
 + GPE5,
 + GPE6,
 + GPE7,
 + GPE8,
 + GPE9,
 + GPE10,
 + GPE11,
 + GPE12,
 + GPE13,
 + GPE14,
 + GPE15,
 +
 + GPF0 = 160,
 + GPF1,
 + GPF2,
 + GPF3,
 + GPF4,
 + GPF5,
 + GPF6,
 + GPF7,
 +
 + GPG0 = 192,
 + GPG1,
 + GPG2,
 + GPG3,
 + GPG4,
 + GPG5,
 + GPG6,
 + GPG7,
 + GPG8,
 + GPG9,
 + GPG10,
 + GPG11,
 + GPG12,
 + GPG13,
 + GPG14,
 + GPG15,
 +
 + GPH0 = 224,
 + GPH1,
 + GPH2,
 + GPH3,
 + GPH4,
 + GPH5,
 + GPH6,
 + GPH7,
 + GPH8,
 + GPH9,
 + GPH10,
 +
 + GPJ0 = 256,
 + GPJ1,
 + GPJ2,
 + GPJ3,
 + GPJ4,
 + GPJ5,
 + GPJ6,
 + GPJ7,
 + GPJ8,
 + GPJ9,
 + GPJ10,
 + GPJ11,
 + GPJ12,
 +};
 +
 +#endif
 diff --git a/arch/arm/include/asm/arch-s3c24x0/iomux.h
 b/arch/arm/include/asm/arch-s3c24x0/iomux.h new file mode 100644
 index 000..cc22de7
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-s3c24x0/iomux.h
 @@ -0,0 +1,200 @@
 +/*
 + * Copyright (c) 2012
 + *
 + * Gabriel Huau cont...@huau-gabriel.fr
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or