Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187614
b: refs/heads/master
c: 7fdda67
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Feb 12, 2010
1 parent 7fde3ce commit 07993f1
Show file tree
Hide file tree
Showing 8 changed files with 2,213 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4e430c611db75f58d3ca33869e182a530859426
refs/heads/master: 7fdda6780aaa21c7a94e09975649649bb0f4a932
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-shmobile/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ comment "SH-Mobile Board Type"
config MACH_G3EVM
bool "G3EVM board"
depends on ARCH_SH7367
select ARCH_REQUIRE_GPIOLIB

config MACH_G4EVM
bool "G4EVM board"
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-shmobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7367.o intc-sh7377.o
obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7367.o intc-sh7372.o

# Pinmux setup
pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o
obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)

# Board objects
obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
Expand Down
25 changes: 25 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-g3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <mach/sh7367.h>
#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -113,6 +115,29 @@ static void __init g3evm_map_io(void)

static void __init g3evm_init(void)
{
sh7367_pinmux_init();

/* Lit DS4 LED */
gpio_request(GPIO_PORT22, NULL);
gpio_direction_output(GPIO_PORT22, 1);
gpio_export(GPIO_PORT22, 0);

/* Lit DS8 LED */
gpio_request(GPIO_PORT23, NULL);
gpio_direction_output(GPIO_PORT23, 1);
gpio_export(GPIO_PORT23, 0);

/* Lit DS3 LED */
gpio_request(GPIO_PORT24, NULL);
gpio_direction_output(GPIO_PORT24, 1);
gpio_export(GPIO_PORT24, 0);

/* SCIFA1 */
gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
gpio_request(GPIO_FN_SCIFA1_CTS, NULL);
gpio_request(GPIO_FN_SCIFA1_RTS, NULL);

sh7367_add_standard_devices();

platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-shmobile/include/mach/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern void sh7367_init_irq(void);
extern void sh7367_add_early_devices(void);
extern void sh7367_add_standard_devices(void);
extern void sh7367_clock_init(void);
extern void sh7367_pinmux_init(void);

extern void sh7377_init_irq(void);
extern void sh7377_add_early_devices(void);
Expand Down
49 changes: 48 additions & 1 deletion trunk/arch/arm/mach-shmobile/include/mach/gpio.h
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
/* empty */
/*
* Generic GPIO API and pinmux table support
*
* Copyright (c) 2008 Magnus Damm
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H

#include <linux/kernel.h>
#include <linux/errno.h>

#define ARCH_NR_GPIOS 1024
#include <linux/sh_pfc.h>

#ifdef CONFIG_GPIOLIB

static inline int gpio_get_value(unsigned gpio)
{
return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned gpio, int value)
{
__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned gpio)
{
return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned gpio)
{
return -ENOSYS;
}

static inline int irq_to_gpio(unsigned int irq)
{
return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* __ASM_ARCH_GPIO_H */
Loading

0 comments on commit 07993f1

Please sign in to comment.