Hi,

The attached patches fix support for neufbox4 boards.
Patches are base on 2.6.32.9 kernel.

First patch brings support for 74HC164 GPIO expander.
It's mainly a copy from
target/linux/ar71xx/files/drivers/gpio/nxp_74hc153.c platform driver.

Second patch fixup buggy board names, using neufbox4 PID offset.
Then declares new boards info:
 - NB4-SER-r0
 - NB4-SER-r1
 - NB4-SER-r2
 - NB4-FXC-r1
 - NB4-FXC-r2.

Eventually, I enable 74HC164 driver in kernel config.


Yours,

Miguel
Index: target/linux/brcm63xx/patches-2.6.32/300-board_neufbox4.patch
===================================================================
--- target/linux/brcm63xx/patches-2.6.32/300-board_neufbox4.patch	(revision 0)
+++ target/linux/brcm63xx/patches-2.6.32/300-board_neufbox4.patch	(revision 0)
@@ -0,0 +1,522 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -5,6 +5,7 @@
+  *
+  * Copyright (C) 2008 Maxime Bizon <[email protected]>
+  * Copyright (C) 2008 Florian Fainelli <[email protected]>
++ * Copyright (C) 2010 Miguel Gaio <[email protected]>
+  */
+ 
+ #include <linux/init.h>
+@@ -17,6 +18,7 @@
+ #include <linux/ssb/ssb.h>
+ #include <linux/gpio_buttons.h>
+ #include <linux/input.h>
++#include <linux/nxp_74hc164.h>
+ #include <asm/addrspace.h>
+ #include <bcm63xx_board.h>
+ #include <bcm63xx_cpu.h>
+@@ -33,6 +35,11 @@
+ 
+ #define PFX	"board_bcm963xx: "
+ 
++#define NEUFBOX4_EXP_GPIO_BASE		64
++#define NEUFBOX4_GPIO_74HC164_DATA	7
++#define NEUFBOX4_GPIO_74HC164_CLK	6
++#define NXP_74HC64_GPIO(X)		(NEUFBOX4_EXP_GPIO_BASE + (X))
++
+ static struct bcm963xx_nvram nvram;
+ static unsigned int mac_addr_used;
+ static struct board_info board;
+@@ -670,6 +677,412 @@ static struct board_info __initdata boar
+ 
+ 	.has_ohci0 = 1,
+ };
++
++static struct board_info __initdata board_nb4_ser_r0 = {
++	.name				= "NB4-SER-r0",
++	.expected_cpu_id		= 0x6358,
++
++	.has_enet0			= 1,
++	.has_enet1			= 1,
++	.has_pci			= 1,
++
++	.enet0 = {
++		.has_phy		= 1,
++		.use_internal_phy	= 1,
++	},
++
++	.enet1 = {
++		.force_speed_100	= 1,
++		.force_duplex_full	= 1,
++	},
++
++
++	.has_ohci0 = 1,
++	.has_pccard = 1,
++	.has_ehci0 = 1,
++
++	.has_udc0			= 1,
++
++	.leds = {
++		{
++			.name		= "adsl",
++			.gpio		= NXP_74HC64_GPIO(4),
++			.active_low	= 1,
++		},
++		{
++			.name		= "traffic",
++			.gpio		= 2,
++			.active_low	= 1,
++		},
++		{
++			.name		= "tel",
++			.gpio		= NXP_74HC64_GPIO(3),
++			.active_low	= 1,
++		},
++		{
++			.name		= "tv",
++			.gpio		= NXP_74HC64_GPIO(2),
++			.active_low	= 1,
++		},
++		{
++			.name		= "wifi",
++			.gpio		= 15,
++			.active_low	= 1,
++		},
++		{
++			.name		= "alarm",
++			.gpio		= NXP_74HC64_GPIO(0),
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:red",
++			.gpio		= 29,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:green",
++			.gpio		= 30,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:blue",
++			.gpio		= 4,
++			.active_low	= 1,
++		},
++	},
++	.reset_buttons = {
++		{
++			.desc		= "reset",
++			.gpio		= 34,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= BTN_0,
++			.threshold	= 3,
++		},
++	},
++};
++
++static struct board_info __initdata board_nb4_ser_r1 = {
++	.name				= "NB4-SER-r1",
++	.expected_cpu_id		= 0x6358,
++
++	.has_enet0			= 1,
++	.has_enet1			= 1,
++	.has_pci			= 1,
++
++	.enet0 = {
++		.has_phy		= 1,
++		.use_internal_phy	= 1,
++	},
++
++	.enet1 = {
++		.force_speed_100	= 1,
++		.force_duplex_full	= 1,
++	},
++
++
++	.has_ohci0 = 1,
++	.has_pccard = 1,
++	.has_ehci0 = 1,
++
++	.has_udc0			= 1,
++
++	.leds = {
++		{
++			.name		= "adsl",
++			.gpio		= NXP_74HC64_GPIO(4),
++			.active_low	= 1,
++		},
++		{
++			.name		= "traffic",
++			.gpio		= 2,
++			.active_low	= 1,
++		},
++		{
++			.name		= "tel",
++			.gpio		= NXP_74HC64_GPIO(3),
++			.active_low	= 1,
++		},
++		{
++			.name		= "tv",
++			.gpio		= NXP_74HC64_GPIO(2),
++			.active_low	= 1,
++		},
++		{
++			.name		= "wifi",
++			.gpio		= 15,
++			.active_low	= 1,
++		},
++		{
++			.name		= "alarm",
++			.gpio		= NXP_74HC64_GPIO(0),
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:red",
++			.gpio		= 29,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:green",
++			.gpio		= 30,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:blue",
++			.gpio		= 4,
++			.active_low	= 1,
++		},
++	},
++	.reset_buttons = {
++		{
++			.desc		= "reset",
++			.gpio		= 34,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= BTN_0,
++			.threshold	= 3,
++		},
++	},
++};
++
++static struct board_info __initdata board_nb4_ser_r2 = {
++	.name				= "NB4-SER-r2",
++	.expected_cpu_id		= 0x6358,
++
++	.has_enet0			= 1,
++	.has_enet1			= 1,
++	.has_pci			= 1,
++
++	.enet0 = {
++		.has_phy		= 1,
++		.use_internal_phy	= 1,
++	},
++
++	.enet1 = {
++		.force_speed_100	= 1,
++		.force_duplex_full	= 1,
++	},
++
++
++	.has_ohci0 = 1,
++	.has_pccard = 1,
++	.has_ehci0 = 1,
++
++	.leds = {
++		{
++			.name		= "adsl",
++			.gpio		= NXP_74HC64_GPIO(4),
++			.active_low	= 1,
++		},
++		{
++			.name		= "traffic",
++			.gpio		= 2,
++			.active_low	= 1,
++		},
++		{
++			.name		= "tel",
++			.gpio		= NXP_74HC64_GPIO(3),
++			.active_low	= 1,
++		},
++		{
++			.name		= "tv",
++			.gpio		= NXP_74HC64_GPIO(2),
++			.active_low	= 1,
++		},
++		{
++			.name		= "wifi",
++			.gpio		= 15,
++			.active_low	= 1,
++		},
++		{
++			.name		= "alarm",
++			.gpio		= NXP_74HC64_GPIO(0),
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:red",
++			.gpio		= 29,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:green",
++			.gpio		= 30,
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:blue",
++			.gpio		= 4,
++			.active_low	= 1,
++		},
++	},
++	.reset_buttons = {
++		{
++			.desc		= "reset",
++			.gpio		= 34,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= BTN_0,
++			.threshold	= 3,
++		},
++	},
++};
++
++static struct board_info __initdata board_nb4_fxc_r1 = {
++	.name				= "NB4-FXC-r1",
++	.expected_cpu_id		= 0x6358,
++
++	.has_enet0			= 1,
++	.has_enet1			= 1,
++	.has_pci			= 1,
++
++	.enet0 = {
++		.has_phy		= 1,
++		.use_internal_phy	= 1,
++	},
++
++	.enet1 = {
++		.force_speed_100	= 1,
++		.force_duplex_full	= 1,
++	},
++
++
++	.has_ohci0 = 1,
++	.has_pccard = 1,
++	.has_ehci0 = 1,
++
++	.has_udc0			= 1,
++
++	.leds = {
++		{
++			.name		= "adsl",
++			.gpio		= NXP_74HC64_GPIO(4),
++			.active_low	= 1,
++		},
++		{
++			.name		= "traffic",
++			.gpio		= 2,
++		},
++		{
++			.name		= "tel",
++			.gpio		= NXP_74HC64_GPIO(3),
++			.active_low	= 1,
++		},
++		{
++			.name		= "tv",
++			.gpio		= NXP_74HC64_GPIO(2),
++			.active_low	= 1,
++		},
++		{
++			.name		= "wifi",
++			.gpio		= 15,
++		},
++		{
++			.name		= "alarm",
++			.gpio		= NXP_74HC64_GPIO(0),
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:red",
++			.gpio		= 29,
++		},
++		{
++			.name		= "service:green",
++			.gpio		= 30,
++		},
++		{
++			.name		= "service:blue",
++			.gpio		= 4,
++		},
++	},
++	.reset_buttons = {
++		{
++			.desc		= "reset",
++			.gpio		= 34,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= BTN_0,
++			.threshold	= 3,
++		},
++	},
++};
++
++static struct board_info __initdata board_nb4_fxc_r2 = {
++	.name				= "NB4-FXC-r2",
++	.expected_cpu_id		= 0x6358,
++
++	.has_enet0			= 1,
++	.has_enet1			= 1,
++	.has_pci			= 1,
++
++	.enet0 = {
++		.has_phy		= 1,
++		.use_internal_phy	= 1,
++	},
++
++	.enet1 = {
++		.force_speed_100	= 1,
++		.force_duplex_full	= 1,
++	},
++
++
++	.has_ohci0 = 1,
++	.has_pccard = 1,
++	.has_ehci0 = 1,
++
++	.leds = {
++		{
++			.name		= "adsl",
++			.gpio		= NXP_74HC64_GPIO(4),
++			.active_low	= 1,
++		},
++		{
++			.name		= "traffic",
++			.gpio		= 2,
++		},
++		{
++			.name		= "tel",
++			.gpio		= NXP_74HC64_GPIO(3),
++			.active_low	= 1,
++		},
++		{
++			.name		= "tv",
++			.gpio		= NXP_74HC64_GPIO(2),
++			.active_low	= 1,
++		},
++		{
++			.name		= "wifi",
++			.gpio		= 15,
++		},
++		{
++			.name		= "alarm",
++			.gpio		= NXP_74HC64_GPIO(0),
++			.active_low	= 1,
++		},
++		{
++			.name		= "service:red",
++			.gpio		= 29,
++		},
++		{
++			.name		= "service:green",
++			.gpio		= 30,
++		},
++		{
++			.name		= "service:blue",
++			.gpio		= 4,
++		},
++	},
++	.reset_buttons = {
++		{
++			.desc		= "reset",
++			.gpio		= 34,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= BTN_0,
++			.threshold	= 3,
++		},
++	},
++};
+ #endif
+ 
+ /*
+@@ -699,6 +1112,11 @@ static const struct board_info __initdat
+ 	&board_96358vw2,
+ 	&board_AGPFS0,
+ 	&board_DWVS0,
++	&board_nb4_ser_r0,
++	&board_nb4_ser_r1,
++	&board_nb4_ser_r2,
++	&board_nb4_fxc_r1,
++	&board_nb4_fxc_r2,
+ #endif
+ };
+ 
+@@ -749,6 +1167,14 @@ void __init board_prom_init(void)
+ 		return;
+ 	}
+ 
++	/* Fixup broken neufbox4 board name */
++	if (BCMCPU_IS_6358()) {
++		p = boot_addr + NEUFBOX4_PID_OFFSET;
++		if (!memcmp(p, "NB4-", 4))
++			memcpy(nvram.name, p, sizeof("NB4-XXX-rX"));
++	
++	}
++
+ 	/* find board by name */
+ 	for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
+ 		if (strncmp(nvram.name, bcm963xx_boards[i]->name,
+@@ -923,6 +1349,21 @@ static struct platform_device bcm63xx_gp
+ 	.dev.platform_data = &bcm63xx_gpio_buttons_data,
+ };
+ 
++static struct nxp_74hc164_platform_data neufbox4_74hc164_data = {
++	.gpio_base      = NEUFBOX4_EXP_GPIO_BASE,
++	.gpio_pin_data  = NEUFBOX4_GPIO_74HC164_DATA,
++	.gpio_pin_clk   = NEUFBOX4_GPIO_74HC164_CLK,
++
++};
++
++static struct platform_device neufbox4_74hc164_device = {
++	.name           = NXP_74HC164_DRIVER_NAME,
++	.id             = -1,
++	.dev = {
++		.platform_data  = &neufbox4_74hc164_data,
++	}
++};
++
+ /*
+  * third stage init callback, register all board devices.
+  */
+@@ -977,6 +1418,9 @@ int __init board_register_devices(void)
+ 
+ 	platform_device_register(&mtd_dev);
+ 
++	if (BCMCPU_IS_6358() && (!memcmp(board.name, "NB4-", 4)))
++		platform_device_register(&neufbox4_74hc164_device);
++
+ 	platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
+ 
+ 	/* count number of LEDs defined by this device */
+--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
++++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+@@ -13,6 +13,8 @@
+ #define BCM963XX_CFE_VERSION_OFFSET	0x570
+ #define BCM963XX_NVRAM_OFFSET		0x580
+ 
++#define NEUFBOX4_PID_OFFSET		0xff80
++
+ /*
+  * nvram structure
+  */
+@@ -55,7 +57,7 @@ struct board_info {
+ 	struct bcm63xx_dsp_platform_data dsp;
+ 
+ 	/* GPIO LEDs */
+-	struct gpio_led leds[8];
++	struct gpio_led leds[9];
+ 
+ 	/* Reset button */
+ 	struct gpio_button reset_buttons[1];
Index: target/linux/brcm63xx/config-2.6.32
===================================================================
--- target/linux/brcm63xx/config-2.6.32	(revision 19990)
+++ target/linux/brcm63xx/config-2.6.32	(working copy)
@@ -82,6 +82,7 @@
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVICE=y
+CONFIG_GPIO_NXP_74HC164=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_HAMRADIO is not set
 CONFIG_HARDWARE_WATCHPOINTS=y
@@ -103,7 +104,6 @@
 CONFIG_IP_PIMSM_V1=y
 CONFIG_IP_PIMSM_V2=y
 CONFIG_IRQ_CPU=y
-# CONFIG_ISDN is not set
 CONFIG_KEXEC=y
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
Index: target/linux/brcm63xx/patches-2.6.32/211-nxp-74hc164-gpio-chip-driver.patch
===================================================================
--- target/linux/brcm63xx/patches-2.6.32/211-nxp-74hc164-gpio-chip-driver.patch	(revision 0)
+++ target/linux/brcm63xx/patches-2.6.32/211-nxp-74hc164-gpio-chip-driver.patch	(revision 0)
@@ -0,0 +1,279 @@
+--- a/drivers/gpio/Kconfig
++++ b/drivers/gpio/Kconfig
+@@ -230,4 +230,12 @@ config GPIO_UCB1400
+ 	  To compile this driver as a module, choose M here: the
+ 	  module will be called ucb1400_gpio.
+ 
++comment "Other GPIO expanders"
++
++config GPIO_NXP_74HC164
++       tristate "NXP 74HC164 Output expanders"
++       help
++         Platform driver for NXP 74HC164 8-output Expanders. This
++         provides a GPIO interface supporting outputs.
++
+ endif
+--- a/drivers/gpio/Makefile
++++ b/drivers/gpio/Makefile
+@@ -10,6 +10,7 @@ obj-$(CONFIG_GPIO_MAX7301)	+= max7301.o
+ obj-$(CONFIG_GPIO_MAX732X)	+= max732x.o
+ obj-$(CONFIG_GPIO_MC33880)	+= mc33880.o
+ obj-$(CONFIG_GPIO_MCP23S08)	+= mcp23s08.o
++obj-$(CONFIG_GPIO_NXP_74HC164)	+= nxp_74hc164.o
+ obj-$(CONFIG_GPIO_PCA953X)	+= pca953x.o
+ obj-$(CONFIG_GPIO_PCF857X)	+= pcf857x.o
+ obj-$(CONFIG_GPIO_PL061)	+= pl061.o
+--- /dev/null
++++ b/drivers/gpio/nxp_74hc164.c
+@@ -0,0 +1,226 @@
++/*
++ *  NXP 74HC164 - output expander  GPIO driver
++ *
++ *  Copyright (C) 2010 Gabor Juhos <[email protected]>
++ *  Copyright (C) 2010 Miguel Gaio <[email protected]>
++ *
++ *  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.
++ *
++ *  Copy from nxp_74hc153.c code
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/gpio.h>
++#include <linux/bitops.h>
++#include <linux/platform_device.h>
++#include <linux/nxp_74hc164.h>
++
++#define NXP_74HC164_NUM_GPIOS	8
++
++struct nxp_74hc164_chip {
++	struct device		*parent;
++	struct gpio_chip	gpio_chip;
++	struct mutex		lock;
++	long			mask;
++};
++
++static void nxp_74hc164_set_value(struct gpio_chip *, unsigned, int);
++
++static struct nxp_74hc164_chip *gpio_to_nxp(struct gpio_chip *gc)
++{
++	return container_of(gc, struct nxp_74hc164_chip, gpio_chip);
++}
++
++static int nxp_74hc164_direction_input(struct gpio_chip *gc, unsigned offset)
++{
++	WARN_ON(1);
++	return -EINVAL;
++}
++
++static int nxp_74hc164_direction_output(struct gpio_chip *gc,
++					unsigned offset, int val)
++{
++	nxp_74hc164_set_value(gc, offset, val);
++	return 0;
++}
++
++static int nxp_74hc164_get_value(struct gpio_chip *gc, unsigned offset)
++{
++	struct nxp_74hc164_chip *nxp = gpio_to_nxp(gc);
++	int ret;
++
++	mutex_lock(&nxp->lock);
++	ret = test_bit(offset, &nxp->mask);
++	mutex_unlock(&nxp->lock);
++
++	return ret;
++}
++
++static void nxp_74hc164_set_value(struct gpio_chip *gc,
++				  unsigned offset, int val)
++{
++	struct nxp_74hc164_chip *nxp;
++	struct nxp_74hc164_platform_data *pdata;
++	long mask;
++	int refresh;
++	int i;
++
++	nxp = gpio_to_nxp(gc);
++	pdata = nxp->parent->platform_data;
++
++	mutex_lock(&nxp->lock);
++	if (val)
++		refresh = (test_and_set_bit(offset, &nxp->mask) != val);
++	else
++		refresh = (test_and_clear_bit(offset, &nxp->mask) != val);
++
++	if (refresh) {
++		mask = nxp->mask;
++		for (i = 8; i > 0; --i, mask <<= 1) {
++			gpio_set_value(pdata->gpio_pin_data, mask & 0x80);
++			gpio_set_value(pdata->gpio_pin_clk, 1);
++			gpio_set_value(pdata->gpio_pin_clk, 0);
++		}
++	}
++	mutex_unlock(&nxp->lock);
++}
++
++static int __devinit nxp_74hc164_probe(struct platform_device *pdev)
++{
++	struct nxp_74hc164_platform_data *pdata;
++	struct nxp_74hc164_chip *nxp;
++	struct gpio_chip *gc;
++	int err;
++
++	pdata = pdev->dev.platform_data;
++	if (pdata == NULL) {
++		dev_dbg(&pdev->dev, "no platform data specified\n");
++		return -EINVAL;
++	}
++
++	nxp = kzalloc(sizeof(struct nxp_74hc164_chip), GFP_KERNEL);
++	if (nxp == NULL) {
++		dev_err(&pdev->dev, "no memory for private data\n");
++		return -ENOMEM;
++	}
++
++	err = gpio_request(pdata->gpio_pin_clk, dev_name(&pdev->dev));
++	if (err) {
++		dev_err(&pdev->dev, "unable to claim gpio %u, err=%d\n",
++			pdata->gpio_pin_clk, err);
++		goto err_free_nxp;
++	}
++
++	err = gpio_request(pdata->gpio_pin_data, dev_name(&pdev->dev));
++	if (err) {
++		dev_err(&pdev->dev, "unable to claim gpio %u, err=%d\n",
++			pdata->gpio_pin_data, err);
++		goto err_free_clk;
++	}
++
++	err = gpio_direction_output(pdata->gpio_pin_clk, 0);
++	if (err) {
++		dev_err(&pdev->dev,
++			"unable to set direction of gpio %u, err=%d\n",
++			pdata->gpio_pin_clk, err);
++		goto err_free_data;
++	}
++
++	err = gpio_direction_output(pdata->gpio_pin_data, 0);
++	if (err) {
++		dev_err(&pdev->dev,
++			"unable to set direction of gpio %u, err=%d\n",
++			pdata->gpio_pin_data, err);
++		goto err_free_data;
++	}
++
++	nxp->parent = &pdev->dev;
++	mutex_init(&nxp->lock);
++
++	gc = &nxp->gpio_chip;
++
++	gc->direction_input  = nxp_74hc164_direction_input;
++	gc->direction_output = nxp_74hc164_direction_output;
++	gc->get = nxp_74hc164_get_value;
++	gc->set = nxp_74hc164_set_value;
++	gc->can_sleep = 1;
++
++	gc->base = pdata->gpio_base;
++	gc->ngpio = NXP_74HC164_NUM_GPIOS;
++	gc->label = dev_name(nxp->parent);
++	gc->dev = nxp->parent;
++	gc->owner = THIS_MODULE;
++
++	err = gpiochip_add(&nxp->gpio_chip);
++	if (err) {
++		dev_err(&pdev->dev, "unable to add gpio chip, err=%d\n", err);
++		goto err_free_data;
++	}
++
++	platform_set_drvdata(pdev, nxp);
++	return 0;
++
++ err_free_data:
++	gpio_free(pdata->gpio_pin_data);
++ err_free_clk:
++	gpio_free(pdata->gpio_pin_clk);
++ err_free_nxp:
++	kfree(nxp);
++	return err;
++}
++
++static int nxp_74hc164_remove(struct platform_device *pdev)
++{
++	struct nxp_74hc164_chip *nxp = platform_get_drvdata(pdev);
++	struct nxp_74hc164_platform_data *pdata = pdev->dev.platform_data;
++
++	if (nxp) {
++		int err;
++
++		err = gpiochip_remove(&nxp->gpio_chip);
++		if (err) {
++			dev_err(&pdev->dev,
++				"unable to remove gpio chip, err=%d\n",
++				err);
++			return err;
++		}
++
++		gpio_free(pdata->gpio_pin_clk);
++		gpio_free(pdata->gpio_pin_data);
++
++		kfree(nxp);
++		platform_set_drvdata(pdev, NULL);
++	}
++
++	return 0;
++}
++
++static struct platform_driver nxp_74hc164_driver = {
++	.probe		= nxp_74hc164_probe,
++	.remove		= __devexit_p(nxp_74hc164_remove),
++	.driver = {
++		.name	= NXP_74HC164_DRIVER_NAME,
++		.owner	= THIS_MODULE,
++	},
++};
++
++static int __init nxp_74hc164_init(void)
++{
++	return platform_driver_register(&nxp_74hc164_driver);
++}
++subsys_initcall(nxp_74hc164_init);
++
++static void __exit nxp_74hc164_exit(void)
++{
++	platform_driver_unregister(&nxp_74hc164_driver);
++}
++module_exit(nxp_74hc164_exit);
++
++MODULE_AUTHOR("Gabor Juhos <[email protected]>");
++MODULE_AUTHOR("Miguel Gaio <[email protected]>");
++MODULE_DESCRIPTION("GPIO expander driver for NXP 74HC164");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" NXP_74HC164_DRIVER_NAME);
+--- /dev/null
++++ b/include/linux/nxp_74hc164.h
+@@ -0,0 +1,22 @@
++/*
++ *  NXP 74HC164 - Dual 4-input multiplexer defines
++ *
++ *  Copyright (C) 2010 Gabor Juhos <[email protected]>
++ *
++ *  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 _NXP_74HC164_H
++#define _NXP_74HC164_H
++
++#define NXP_74HC164_DRIVER_NAME "nxp-74hc164"
++
++struct nxp_74hc164_platform_data {
++	unsigned	gpio_base;
++	unsigned	gpio_pin_data;
++	unsigned	gpio_pin_clk;
++};
++
++#endif /* _NXP_74HC164_H */
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to