Skip to content

Commit f55be1b

Browse files
Linus WalleijRussell King
authored andcommitted
ARM: 7104/1: plat-pxa: break out GPIO driver specifics
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: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 354bf80 commit f55be1b

24 files changed

Lines changed: 227 additions & 180 deletions

File tree

‎arch/arm/mach-mmp/aspenite.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/mtd/partitions.h>
1818
#include <linux/mtd/nand.h>
1919
#include <linux/interrupt.h>
20+
#include <linux/gpio.h>
2021

2122
#include <asm/mach-types.h>
2223
#include <asm/mach/arch.h>

‎arch/arm/mach-mmp/brownstone.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/kernel.h>
1515
#include <linux/platform_device.h>
1616
#include <linux/io.h>
17-
#include <linux/gpio.h>
1817
#include <linux/regulator/machine.h>
1918
#include <linux/regulator/max8649.h>
2019
#include <linux/regulator/fixed.h>

‎arch/arm/mach-mmp/gplugd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
*/
1010

1111
#include <linux/init.h>
12+
#include <linux/gpio.h>
1213

1314
#include <asm/mach/arch.h>
1415
#include <asm/mach-types.h>
1516

16-
#include <mach/gpio.h>
1717
#include <mach/pxa168.h>
1818
#include <mach/mfp-pxa168.h>
1919
#include <mach/mfp-gplugd.h>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef __ASM_MACH_GPIO_PXA_H
2+
#define __ASM_MACH_GPIO_PXA_H
3+
4+
#include <mach/addr-map.h>
5+
#include <mach/irqs.h>
6+
7+
#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
8+
9+
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
10+
#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))
11+
12+
#define NR_BUILTIN_GPIO IRQ_GPIO_NUM
13+
14+
#define gpio_to_bank(gpio) ((gpio) >> 5)
15+
16+
/* NOTE: these macros are defined here to make optimization of
17+
* gpio_{get,set}_value() to work when 'gpio' is a constant.
18+
* Usage of these macros otherwise is no longer recommended,
19+
* use generic GPIO API whenever possible.
20+
*/
21+
#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f))
22+
23+
#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
24+
#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
25+
#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
26+
#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
27+
28+
#include <plat/gpio-pxa.h>
29+
30+
#endif /* __ASM_MACH_GPIO_PXA_H */
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
11
#ifndef __ASM_MACH_GPIO_H
22
#define __ASM_MACH_GPIO_H
33

4-
#include <mach/addr-map.h>
5-
#include <mach/irqs.h>
64
#include <asm-generic/gpio.h>
75

8-
#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
9-
10-
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
11-
#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))
12-
13-
#define NR_BUILTIN_GPIO IRQ_GPIO_NUM
14-
15-
#define gpio_to_bank(gpio) ((gpio) >> 5)
166
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
177
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
188

19-
209
#define __gpio_is_inverted(gpio) (0)
2110
#define __gpio_is_occupied(gpio) (0)
2211

23-
/* NOTE: these macros are defined here to make optimization of
24-
* gpio_{get,set}_value() to work when 'gpio' is a constant.
25-
* Usage of these macros otherwise is no longer recommended,
26-
* use generic GPIO API whenever possible.
27-
*/
28-
#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f))
29-
30-
#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
31-
#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
32-
#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
33-
#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
34-
3512
#include <plat/gpio.h>
3613
#endif /* __ASM_MACH_GPIO_H */

‎arch/arm/mach-mmp/jasper.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/kernel.h>
1515
#include <linux/platform_device.h>
1616
#include <linux/io.h>
17-
#include <linux/gpio.h>
1817
#include <linux/regulator/machine.h>
1918
#include <linux/regulator/max8649.h>
2019
#include <linux/mfd/max8925.h>

‎arch/arm/mach-mmp/mmp2.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* it under the terms of the GNU General Public License version 2 as
1010
* published by the Free Software Foundation.
1111
*/
12-
#include <linux/gpio.h>
1312
#include <linux/module.h>
1413
#include <linux/kernel.h>
1514
#include <linux/init.h>
@@ -25,6 +24,7 @@
2524
#include <mach/irqs.h>
2625
#include <mach/dma.h>
2726
#include <mach/mfp.h>
27+
#include <mach/gpio-pxa.h>
2828
#include <mach/devices.h>
2929
#include <mach/mmp2.h>
3030

‎arch/arm/mach-mmp/pxa168.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* it under the terms of the GNU General Public License version 2 as
88
* published by the Free Software Foundation.
99
*/
10-
#include <linux/gpio.h>
1110
#include <linux/module.h>
1211
#include <linux/kernel.h>
1312
#include <linux/init.h>
@@ -21,6 +20,7 @@
2120
#include <mach/regs-apbc.h>
2221
#include <mach/regs-apmu.h>
2322
#include <mach/irqs.h>
23+
#include <mach/gpio-pxa.h>
2424
#include <mach/dma.h>
2525
#include <mach/devices.h>
2626
#include <mach/mfp.h>

‎arch/arm/mach-mmp/pxa910.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* it under the terms of the GNU General Public License version 2 as
88
* published by the Free Software Foundation.
99
*/
10-
#include <linux/gpio.h>
1110
#include <linux/module.h>
1211
#include <linux/kernel.h>
1312
#include <linux/init.h>
@@ -20,6 +19,7 @@
2019
#include <mach/regs-apmu.h>
2120
#include <mach/cputype.h>
2221
#include <mach/irqs.h>
22+
#include <mach/gpio-pxa.h>
2323
#include <mach/dma.h>
2424
#include <mach/mfp.h>
2525
#include <mach/devices.h>

‎arch/arm/mach-mmp/tavorevb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/kernel.h>
1313
#include <linux/platform_device.h>
1414
#include <linux/smc91x.h>
15+
#include <linux/gpio.h>
1516

1617
#include <asm/mach-types.h>
1718
#include <asm/mach/arch.h>

0 commit comments

Comments
 (0)