Updated to 2.6.26 for stable and 2.6.27 for development
[nslu2-linux/kernel.git] / patches / 2.6.19 / 99-avila-loft-mac-platform.patch
blob952a05506ee2e01ff8a55da19ea37f821579d25e
1 Index: linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/avila-setup.c 2007-01-23 03:12:36.000000000 -0800
4 +++ linux-2.6.19/arch/arm/mach-ixp4xx/avila-setup.c 2007-01-23 03:12:47.000000000 -0800
5 @@ -18,6 +18,10 @@
6 #include <linux/tty.h>
7 #include <linux/serial_8250.h>
8 #include <linux/slab.h>
9 +#ifdef CONFIG_SENSORS_EEPROM
10 +#include <linux/i2c.h>
11 +#include <linux/eeprom.h>
12 +#endif
14 #include <asm/types.h>
15 #include <asm/setup.h>
16 @@ -198,9 +202,34 @@
17 &avila_npe_ucode,
20 +#ifdef CONFIG_SENSORS_EEPROM
21 +static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
23 + struct eeprom_data *data = t;
25 + char macs[12];
27 + /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
28 + if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
29 + data->attr->read(&data->client.dev.kobj, macs, 0, 12);
30 + memcpy(&plat_mac0.hwaddr, macs, 6);
31 + memcpy(&plat_mac1.hwaddr, macs + 6, 6);
32 + }
34 + return NOTIFY_DONE;
37 +static struct notifier_block loft_eeprom_notifier = {
38 + .notifier_call = loft_eeprom_do
39 +};
40 +#endif
42 static void __init avila_init(void)
44 ixp4xx_sys_init();
45 +#ifdef CONFIG_SENSORS_EEPROM
46 + register_eeprom_notifier(&loft_eeprom_notifier);
47 +#endif
49 avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
50 avila_flash_resource.end =