Skip to content

Commit

Permalink
ARM: 7036/1: mach-ks8695: break out GPIO driver specifics
Browse files Browse the repository at this point in the history
The <mach/gpio.h> file is included from upper directories
and deal with generic GPIO and gpiolib stuff. Break out the
platform and driver specific defines and functions into its own
header file.

Cc: zeal <zealcook@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Acked-by: Daniel Silverstone <dsilvers@simtec.co.uk>
Acked-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Linus Walleij authored and Russell King committed Aug 22, 2011
1 parent db23c73 commit e24e449
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 27 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-acs5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <asm/mach/irq.h>

#include <mach/devices.h>
#include <mach/gpio-ks8695.h>

#include "generic.h"

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-dsm320.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <asm/mach/irq.h>

#include <mach/devices.h>
#include <mach/gpio-ks8695.h>

#include "generic.h"

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include <mach/gpio-ks8695.h>
#include <mach/devices.h>

#include "generic.h"
Expand Down
39 changes: 39 additions & 0 deletions arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2006 Andrew Victor
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#ifndef __MACH_KS8659_GPIO_H
#define __MACH_KS8659_GPIO_H

#include <linux/kernel.h>

#define KS8695_GPIO_0 0
#define KS8695_GPIO_1 1
#define KS8695_GPIO_2 2
#define KS8695_GPIO_3 3
#define KS8695_GPIO_4 4
#define KS8695_GPIO_5 5
#define KS8695_GPIO_6 6
#define KS8695_GPIO_7 7
#define KS8695_GPIO_8 8
#define KS8695_GPIO_9 9
#define KS8695_GPIO_10 10
#define KS8695_GPIO_11 11
#define KS8695_GPIO_12 12
#define KS8695_GPIO_13 13
#define KS8695_GPIO_14 14
#define KS8695_GPIO_15 15

/*
* Configure GPIO pin as external interrupt source.
*/
extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);

/* Register the GPIOs */
extern void ks8695_register_gpios(void);

#endif /* __MACH_KS8659_GPIO_H */
27 changes: 0 additions & 27 deletions arch/arm/mach-ks8695/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,9 @@
#ifndef __ASM_ARCH_GPIO_H_
#define __ASM_ARCH_GPIO_H_

#include <linux/kernel.h>

#define KS8695_GPIO_0 0
#define KS8695_GPIO_1 1
#define KS8695_GPIO_2 2
#define KS8695_GPIO_3 3
#define KS8695_GPIO_4 4
#define KS8695_GPIO_5 5
#define KS8695_GPIO_6 6
#define KS8695_GPIO_7 7
#define KS8695_GPIO_8 8
#define KS8695_GPIO_9 9
#define KS8695_GPIO_10 10
#define KS8695_GPIO_11 11
#define KS8695_GPIO_12 12
#define KS8695_GPIO_13 13
#define KS8695_GPIO_14 14
#define KS8695_GPIO_15 15

/*
* Configure GPIO pin as external interrupt source.
*/
extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);

/*
* Map IRQ number to GPIO line.
*/
extern int irq_to_gpio(unsigned int irq);

/* Register the GPIOs */
extern void ks8695_register_gpios(void);

#endif
1 change: 1 addition & 0 deletions drivers/gpio/gpio-ks8695.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/mach/irq.h>

#include <mach/regs-gpio.h>
#include <mach/gpio-ks8695.h>

/*
* Configure a GPIO line for either GPIO function, or its internal
Expand Down

0 comments on commit e24e449

Please sign in to comment.