Skip to content

Commit

Permalink
gpio/mxs: Move Freescale mxs gpio driver to drivers/gpio
Browse files Browse the repository at this point in the history
GPIO drivers are getting moved to drivers/gpio for cleanup and
consolidation.  This patch moves the mxs driver.  Follow up patches
will clean it up and make it a fine upstanding example of a gpio
driver.

v2: Removed header file entirely and put struct definition directly
    into driver.  The struct isn't used anywhere else in the kernel.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Grant Likely committed Jun 6, 2011
1 parent 59c5f46 commit 7b2fa57
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 38 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-mxs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Common support
obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
obj-y := clock.o devices.o icoll.o iomux.o system.o timer.o

obj-$(CONFIG_MXS_OCOTP) += ocotp.o
obj-$(CONFIG_PM) += pm.o
Expand Down
34 changes: 0 additions & 34 deletions arch/arm/mach-mxs/gpio.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/arm/mach-mxs/mach-mx28evk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <mach/iomux-mx28.h>

#include "devices-mx28.h"
#include "gpio.h"

#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
#define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15)
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ config GPIO_EXYNOS4
help
Say yes here to support Samsung Exynos4 series SoCs GPIO library

config GPIO_MXS
def_bool y
depends on ARCH_MXS

config GPIO_PLAT_SAMSUNG
bool "Samsung SoCs GPIO library support"
default y if SAMSUNG_GPIOLIB_4BIT
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-$(CONFIG_GPIO_ADP5588) += adp5588-gpio.o
obj-$(CONFIG_GPIO_BASIC_MMIO_CORE) += basic_mmio_gpio.o
obj-$(CONFIG_GPIO_BASIC_MMIO) += basic_mmio_gpio.o
obj-$(CONFIG_GPIO_EXYNOS4) += gpio-exynos4.o
obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o
obj-$(CONFIG_GPIO_PLAT_SAMSUNG) += gpio-plat-samsung.o
obj-$(CONFIG_GPIO_S5PC100) += gpio-s5pc100.o
obj-$(CONFIG_GPIO_S5PV210) += gpio-s5pv210.o
Expand Down
11 changes: 9 additions & 2 deletions arch/arm/mach-mxs/gpio.c → drivers/gpio/gpio-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <mach/mx28.h>
#include <asm-generic/bug.h>

#include "gpio.h"

static struct mxs_gpio_port *mxs_gpio_ports;
static int gpio_table_size;

Expand All @@ -50,6 +48,15 @@ static int gpio_table_size;
#define GPIO_INT_LEV_MASK (1 << 0)
#define GPIO_INT_POL_MASK (1 << 1)

struct mxs_gpio_port {
void __iomem *base;
int id;
int irq;
int irq_high;
int virtual_irq_start;
struct gpio_chip chip;
};

/* Note: This driver assumes 32 GPIOs are handled in one register */

static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index)
Expand Down

0 comments on commit 7b2fa57

Please sign in to comment.