diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2008-12-17 17:39:59 +0100 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2008-12-17 17:39:59 +0100 |
| commit | 9dd5f2f30aec3141ed782e55b6671058e7239901 (patch) | |
| tree | 9dac15b8277817596c23f87cbdea547632ac0831 /packages/linux | |
| parent | 0fb4b44bb38396d7ffbc7a8b2ee976d80e0edff8 (diff) | |
linux-2.6.26: update patches for boc01
Diffstat (limited to 'packages/linux')
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/005-081217-isl12024.patch (renamed from packages/linux/linux-2.6.26/boc01/005-081127-isl12024.patch) | 68 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/006-081105-at24c32.patch | 284 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/006-081216-at24c32.patch | 361 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/007-081216-lm73.patch (renamed from packages/linux/linux-2.6.26/boc01/007-081127-lm73.patch) | 61 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/011-081105-gpio.patch | 161 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/011-081202-gpio.patch | 365 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/013-081212-lcd.patch (renamed from packages/linux/linux-2.6.26/boc01/013-081127-lcd.patch) | 276 | ||||
| -rw-r--r-- | packages/linux/linux-2.6.26/boc01/defconfig | 8 | ||||
| -rw-r--r-- | packages/linux/linux_2.6.26.bb | 12 |
9 files changed, 981 insertions, 615 deletions
diff --git a/packages/linux/linux-2.6.26/boc01/005-081127-isl12024.patch b/packages/linux/linux-2.6.26/boc01/005-081217-isl12024.patch index 5e9f198b47..bcbc2b35db 100644 --- a/packages/linux/linux-2.6.26/boc01/005-081127-isl12024.patch +++ b/packages/linux/linux-2.6.26/boc01/005-081217-isl12024.patch @@ -1,6 +1,7 @@ -diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/isl12024-eeprom.c /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/isl12024-eeprom.c ---- linux-2.6.26-officiel/drivers/i2c/chips/isl12024-eeprom.c 1970-01-01 01:00:00.000000000 +0100 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/isl12024-eeprom.c 2008-11-06 10:41:46.000000000 +0100 +Index: linux-2.6.26-NEW/drivers/i2c/chips/isl12024-eeprom.c +=================================================================== +--- /dev/null ++++ linux-2.6.26-NEW/drivers/i2c/chips/isl12024-eeprom.c @@ -0,0 +1,254 @@ +/* + * Intersil ISL12024 EEPROM class driver @@ -256,23 +257,11 @@ diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/isl12024-eeprom.c /home/guilig + +module_init(eeprom_init); +module_exit(eeprom_exit); -diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/Kconfig /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Kconfig ---- linux-2.6.26-officiel/drivers/i2c/chips/Kconfig 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Kconfig 2008-11-05 15:49:03.000000000 +0100 -@@ -4,6 +4,12 @@ - - menu "Miscellaneous I2C Chip support" - -+config AT24C32 -+ tristate "24C32 EEPROM" -+ depends on SYSFS && EXPERIMENTAL -+ help -+ help not needed :) -+ - config DS1682 - tristate "Dallas DS1682 Total Elapsed Time Recorder with Alarm" - depends on EXPERIMENTAL -@@ -14,6 +20,15 @@ +Index: linux-2.6.26-NEW/drivers/i2c/chips/Kconfig +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/i2c/chips/Kconfig ++++ linux-2.6.26-NEW/drivers/i2c/chips/Kconfig +@@ -14,6 +14,15 @@ config DS1682 This driver can also be built as a module. If so, the module will be called ds1682. @@ -288,9 +277,10 @@ diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/Kconfig /home/guilig/workspace config SENSORS_EEPROM tristate "EEPROM reader" depends on EXPERIMENTAL -diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/Makefile /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Makefile ---- linux-2.6.26-officiel/drivers/i2c/chips/Makefile 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Makefile 2008-11-06 11:04:27.000000000 +0100 +Index: linux-2.6.26-NEW/drivers/i2c/chips/Makefile +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/i2c/chips/Makefile ++++ linux-2.6.26-NEW/drivers/i2c/chips/Makefile @@ -9,6 +9,8 @@ # * I/O expander drivers go to drivers/gpio # @@ -300,10 +290,11 @@ diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/Makefile /home/guilig/workspac obj-$(CONFIG_DS1682) += ds1682.o obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o obj-$(CONFIG_SENSORS_MAX6875) += max6875.o -diff -Nru linux-2.6.26-officiel/drivers/rtc/Kconfig /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/rtc/Kconfig ---- linux-2.6.26-officiel/drivers/rtc/Kconfig 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/rtc/Kconfig 2008-09-26 13:53:16.000000000 +0200 -@@ -124,6 +124,12 @@ +Index: linux-2.6.26-NEW/drivers/rtc/Kconfig +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/rtc/Kconfig ++++ linux-2.6.26-NEW/drivers/rtc/Kconfig +@@ -124,6 +124,12 @@ comment "I2C RTC drivers" if I2C @@ -316,10 +307,11 @@ diff -Nru linux-2.6.26-officiel/drivers/rtc/Kconfig /home/guilig/workspace/kerne config RTC_DRV_DS1307 tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00" help -diff -Nru linux-2.6.26-officiel/drivers/rtc/Makefile /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/rtc/Makefile ---- linux-2.6.26-officiel/drivers/rtc/Makefile 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/rtc/Makefile 2008-09-26 14:25:25.000000000 +0200 -@@ -33,6 +33,7 @@ +Index: linux-2.6.26-NEW/drivers/rtc/Makefile +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/rtc/Makefile ++++ linux-2.6.26-NEW/drivers/rtc/Makefile +@@ -33,6 +33,7 @@ obj-$(CONFIG_RTC_DRV_DS1742) += rtc-ds17 obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o obj-$(CONFIG_RTC_DRV_FM3130) += rtc-fm3130.o obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o @@ -327,9 +319,10 @@ diff -Nru linux-2.6.26-officiel/drivers/rtc/Makefile /home/guilig/workspace/kern obj-$(CONFIG_RTC_DRV_M41T80) += rtc-m41t80.o obj-$(CONFIG_RTC_DRV_M48T59) += rtc-m48t59.o obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o -diff -Nru linux-2.6.26/drivers/rtc/rtc-isl12024.c linux-2.6.26.mod/drivers/rtc/rtc-isl12024.c ---- linux-2.6.26/drivers/rtc/rtc-isl12024.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.26.mod/drivers/rtc/rtc-isl12024.c 2008-11-27 12:05:37.000000000 +0100 +Index: linux-2.6.26-NEW/drivers/rtc/rtc-isl12024.c +=================================================================== +--- /dev/null ++++ linux-2.6.26-NEW/drivers/rtc/rtc-isl12024.c @@ -0,0 +1,516 @@ +/* + * Intersil ISL12024 class driver @@ -847,9 +840,10 @@ diff -Nru linux-2.6.26/drivers/rtc/rtc-isl12024.c linux-2.6.26.mod/drivers/rtc/r + +module_init(isl12024_init); +module_exit(isl12024_exit); -diff -Nru linux-2.6.26-officiel/include/i2c/isl12024.h /home/guilig/workspace/kernel-goobie-2.6.26/src/include/linux/i2c/isl12024.h ---- linux-2.6.26-officiel/include/i2c/isl12024.h 1970-01-01 01:00:00.000000000 +0100 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/include/linux/i2c/isl12024.h 2008-10-21 10:36:19.000000000 +0200 +Index: linux-2.6.26-NEW/include/i2c/isl12024.h +=================================================================== +--- /dev/null ++++ linux-2.6.26-NEW/include/i2c/isl12024.h @@ -0,0 +1,93 @@ +#ifndef ISL12024_H_ +#define ISL12024_H_ diff --git a/packages/linux/linux-2.6.26/boc01/006-081105-at24c32.patch b/packages/linux/linux-2.6.26/boc01/006-081105-at24c32.patch deleted file mode 100644 index 1cd70feb4a..0000000000 --- a/packages/linux/linux-2.6.26/boc01/006-081105-at24c32.patch +++ /dev/null @@ -1,284 +0,0 @@ -diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/at24c32.c /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/at24c32.c ---- linux-2.6.26-officiel/drivers/i2c/chips/at24c32.c 1970-01-01 01:00:00.000000000 +0100 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/at24c32.c 2008-11-06 10:45:30.000000000 +0100 -@@ -0,0 +1,268 @@ -+/* -+ * at24c32.c - Based on eeprom.c -+ * -+ * Copyright (C) 2007, CenoSYS (www.cenosys.com). -+ * Guillaume Ligneul -+ * Guillaume.ligneul@gmail.com -+ * -+ * Code is based on eeprom.c -+ * -+ * This software program is licensed subject to the GNU General Public License -+ * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/init.h> -+#include <linux/module.h> -+#include <linux/slab.h> -+#include <linux/jiffies.h> -+#include <linux/i2c.h> -+#include <linux/mutex.h> -+ -+/* Addresses to scan */ -+static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, -+ 0x55, 0x56, I2C_CLIENT_END }; -+ -+/* Insmod parameters */ -+I2C_CLIENT_INSMOD_1(eeprom); -+ -+ -+/* Size of EEPROM in bytes */ -+#define EEPROM_SIZE 32768 -+ -+/* possible types of eeprom devices */ -+enum eeprom_nature { -+ UNKNOWN, -+ VAIO, -+}; -+ -+/* Each client has this additional data */ -+struct eeprom_data { -+ struct i2c_client client; -+ struct mutex update_lock; -+ u8 valid; /* bitfield, bit!=0 if slice is valid */ -+ unsigned long last_updated[8]; /* In jiffies, 8 slices */ -+ u8 data[EEPROM_SIZE]; /* Register values */ -+ enum eeprom_nature nature; -+}; -+ -+ -+static int eeprom_attach_adapter(struct i2c_adapter *adapter); -+static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind); -+static int eeprom_detach_client(struct i2c_client *client); -+ -+/* This is the driver that will be inserted */ -+static struct i2c_driver eeprom_driver = { -+ .driver = { -+ .name = "eeprom", -+ }, -+ .attach_adapter = eeprom_attach_adapter, -+ .detach_client = eeprom_detach_client, -+}; -+ -+static ssize_t eeprom_write(struct kobject *kobj, struct bin_attribute *bin_attr, -+ char *buf, loff_t off, size_t count) -+{ -+ struct i2c_client *client = kobj_to_i2c_client(kobj); -+ struct eeprom_data *data = i2c_get_clientdata(client); -+ int ret; -+ u8 i2c_buf[256]; -+ -+ if (off >= 32) -+ return -ENOSPC; -+ -+ if (off + count > 32) -+ count = 32 - off; -+ -+ mutex_unlock(&data->update_lock); -+ -+ struct i2c_msg msgs[1] = { -+ { -+ .addr = client->addr, -+ .flags = 0, -+ .len = count+2, -+ .buf = i2c_buf, -+ }, -+ }; -+ -+ i2c_buf[0] = 0; -+ i2c_buf[1] = off; -+ -+ -+ memcpy(&i2c_buf[2], &buf[0], count ); -+ -+ -+ ret = i2c_transfer(client->adapter, msgs, 1); -+ -+ if(ret<0) -+ { -+ mutex_unlock(&data->update_lock); -+ return -EIO; -+ } -+ -+ mutex_unlock(&data->update_lock); -+ return count; -+} -+ -+int -+i2c_read(struct i2c_client *client, u8 reg, u8 buf[], -+ unsigned len) -+{ -+ int ret; -+ u8 dt_addr[2]; -+ -+ struct i2c_msg msgs[2] = { -+ { -+ .addr = client->addr, -+ .flags = 0, -+ .len = 2, -+ .buf = dt_addr, -+ }, -+ { -+ .addr = client->addr, -+ .flags = I2C_M_RD, -+ .len = len , -+ .buf = buf , -+ }, -+ }; -+ -+ dt_addr[0] = 0; -+ dt_addr[1] = reg; -+ -+ ret = i2c_transfer(client->adapter, msgs, 2); -+ if ( ret < 0) { -+ dev_err(&client->dev, "read error\n"); -+ return -EIO; -+ } -+ return ret; -+} -+ -+static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr, -+ char *buf, loff_t off, size_t count) -+{ -+ struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); -+ struct eeprom_data *data = i2c_get_clientdata(client); -+ int rc; -+ -+ mutex_lock(&data->update_lock); -+ -+ if (off >= EEPROM_SIZE) -+ return 0; -+ -+ if (off + count > EEPROM_SIZE) -+ count = EEPROM_SIZE - off; -+ -+ rc = i2c_read(client,off,buf,count); -+ if (rc < 0){ -+ mutex_unlock(&data->update_lock); -+ return -EIO; -+ } -+ -+ mutex_unlock(&data->update_lock); -+ return count; -+} -+ -+static struct bin_attribute eeprom_attr = { -+ .attr = { -+ .name = "eeprom", -+ .mode = S_IRUGO, -+ }, -+ .size = EEPROM_SIZE, -+ .read = eeprom_read, -+ .write = eeprom_write, -+ -+}; -+ -+static int eeprom_attach_adapter(struct i2c_adapter *adapter) -+{ -+ return i2c_probe(adapter, &addr_data, eeprom_detect); -+} -+ -+/* This function is called by i2c_probe */ -+static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) -+{ -+ struct i2c_client *new_client; -+ struct eeprom_data *data; -+ int err = 0; -+ -+ /* There are three ways we can read the EEPROM data: -+ (1) I2C block reads (faster, but unsupported by most adapters) -+ (2) Consecutive byte reads (100% overhead) -+ (3) Regular byte data reads (200% overhead) -+ The third method is not implemented by this driver because all -+ known adapters support at least the second. */ -+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA -+ | I2C_FUNC_SMBUS_BYTE)) -+ goto exit; -+ -+ if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { -+ err = -ENOMEM; -+ goto exit; -+ } -+ -+ new_client = &data->client; -+ memset(data->data, 0xff, EEPROM_SIZE); -+ i2c_set_clientdata(new_client, data); -+ new_client->addr = address; -+ new_client->adapter = adapter; -+ new_client->driver = &eeprom_driver; -+ new_client->flags = 0; -+ -+ /* Fill in the remaining client fields */ -+ strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); -+ data->valid = 0; -+ mutex_init(&data->update_lock); -+ data->nature = 0x00; -+ -+ /* Tell the I2C layer a new client has arrived */ -+ if ((err = i2c_attach_client(new_client))) -+ goto exit_kfree; -+ -+ /* create the sysfs eeprom file */ -+ err = sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr); -+ if (err) -+ goto exit_detach; -+ -+ return 0; -+ -+exit_detach: -+ i2c_detach_client(new_client); -+exit_kfree: -+ kfree(data); -+exit: -+ return err; -+} -+ -+static int eeprom_detach_client(struct i2c_client *client) -+{ -+ int err; -+ -+ sysfs_remove_bin_file(&client->dev.kobj, &eeprom_attr); -+ -+ err = i2c_detach_client(client); -+ if (err) -+ return err; -+ -+ kfree(i2c_get_clientdata(client)); -+ -+ return 0; -+} -+ -+static int __init eeprom_init(void) -+{ -+ return i2c_add_driver(&eeprom_driver); -+ -+} -+ -+static void __exit eeprom_exit(void) -+{ -+ i2c_del_driver(&eeprom_driver); -+} -+ -+ -+MODULE_AUTHOR("Guillaume Ligneul guillaume.ligneul@gmail.com"); -+MODULE_DESCRIPTION("I2C EEPROM driver for AT24C32"); -+MODULE_LICENSE("GPL"); -+ -+module_init(eeprom_init); -+module_exit(eeprom_exit); -diff -Nru linux-2.6.26-officiel/drivers/i2c/chips/Makefile /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Makefile ---- linux-2.6.26-officiel/drivers/i2c/chips/Makefile 2008-11-06 11:12:07.000000000 +0100 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/i2c/chips/Makefile 2008-11-06 11:18:20.000000000 +0100 -@@ -9,7 +9,7 @@ - # * I/O expander drivers go to drivers/gpio - # - -- -+obj-$(CONFIG_AT24C32) += at24c32.o - obj-$(CONFIG_ISL12024EEPROM) += isl12024-eeprom.o - obj-$(CONFIG_DS1682) += ds1682.o - obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o diff --git a/packages/linux/linux-2.6.26/boc01/006-081216-at24c32.patch b/packages/linux/linux-2.6.26/boc01/006-081216-at24c32.patch new file mode 100644 index 0000000000..0ffec7f742 --- /dev/null +++ b/packages/linux/linux-2.6.26/boc01/006-081216-at24c32.patch @@ -0,0 +1,361 @@ +Index: linux-2.6.26-NEW/drivers/i2c/chips/Makefile +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/i2c/chips/Makefile ++++ linux-2.6.26-NEW/drivers/i2c/chips/Makefile +@@ -9,7 +9,6 @@ + # * I/O expander drivers go to drivers/gpio + # + +- + obj-$(CONFIG_ISL12024EEPROM) += isl12024-eeprom.o + obj-$(CONFIG_DS1682) += ds1682.o + obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o +@@ -22,6 +21,7 @@ obj-$(CONFIG_ISP1301_OMAP) += isp1301_om + obj-$(CONFIG_TPS65010) += tps65010.o + obj-$(CONFIG_MENELAUS) += menelaus.o + obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o ++obj-$(CONFIG_EEPROM_RW) += eeprom-rw.o + + ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) + EXTRA_CFLAGS += -DDEBUG +Index: linux-2.6.26-NEW/drivers/i2c/chips/eeprom-rw.c +=================================================================== +--- /dev/null ++++ linux-2.6.26-NEW/drivers/i2c/chips/eeprom-rw.c +@@ -0,0 +1,319 @@ ++/* ++ eeprom-rw.c ++ ++ Mostly rewritten Feb 2008 by Davide Rizzo <[EMAIL PROTECTED]> ++ Starting from drivers/i2c/chips/eeprom.c ++ ++ Copyright (C) 1998, 1999 Frodo Looijaard <[EMAIL PROTECTED]> and ++ Philip Edelbrock <[EMAIL PROTECTED]> ++ Copyright (C) 2003 Greg Kroah-Hartman <[EMAIL PROTECTED]> ++ Copyright (C) 2003 IBM Corp. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++*/ ++ ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/slab.h> ++#include <linux/sched.h> ++#include <linux/jiffies.h> ++#include <linux/i2c.h> ++#include <linux/mutex.h> ++#include <linux/delay.h> ++ ++/* To avoid false aliases, it scans only address 0x50. ++ Drawback: it cannot manage chips with hardware strapped address != 0 */ ++static unsigned short normal_i2c[] = {0x50, I2C_CLIENT_END}; ++ ++/* Insmod parameters */ ++I2C_CLIENT_INSMOD_1(eeprom); ++ ++struct eeprom_device { ++ int double_address, total_size, page_size, virt_device_len; ++ int pin_address_mask; ++ const char *name; ++}; ++ ++static char *eeprom_name = "2432"; ++module_param_named(CHIP, eeprom_name, charp, S_IRUGO | S_IWUSR); ++MODULE_PARM_DESC(CHIP, "Eeprom type (ex.2408,2416...)"); ++ ++static const struct eeprom_device eeproms[] = { ++ {0, 16, 1, 16, 0, "2400"}, ++ {0, 128, 8, 128, 0, "2401"}, ++ {0, 128, 16, 128, 7, "24014"}, ++ {0, 256, 8, 256, 0, "2402"}, ++ {0, 256, 16, 256, 7, "24024"}, ++ {0, 256, 16, 256, 7, "24025"}, ++ {0, 512, 16, 256, 0, "2404"}, ++ {0, 1024, 16, 256, 0, "2408"}, ++ {0, 2048, 16, 256, 0, "2416"}, ++ {1, 4096, 32, 4096, 7, "2432"}, ++ {1, 8192, 32, 8192, 7, "2464"}, ++ {1, 8192, 64, 8192, 7, "2465"}, ++ {1, 16384, 64, 16384, 7, "24128"}, ++ {1, 32768, 64, 32768, 7, "24256"}, ++ {1, 65536, 128, 65536, 7, "24512"}, ++ {1, 65536, 64, 32768, 3, "24515"}, ++ {1, 131072, 256, 65536, 2, "241024"}, ++ {1, 131072, 128, 65536, 3, "241025"}, ++ {0, 0, 0, 0, 0, NULL} ++}; ++ ++#define MAX_EEPROM_PAGE_SIZE 256 ++ ++/* Each client has this additional data */ ++struct eeprom_info { ++ struct i2c_client client; ++ struct mutex update_lock; ++ const struct eeprom_device *selected_eeprom; ++ char buf[MAX_EEPROM_PAGE_SIZE + 2]; ++}; ++ ++static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *t, ++ char *buf, loff_t loff, size_t count) ++{ ++ struct i2c_client *client = ++ to_i2c_client(container_of(kobj, struct device, kobj)); ++ struct eeprom_info *info = i2c_get_clientdata(client); ++ char offset[2]; ++ int ret, off = (int)loff; ++ struct i2c_msg msgrd[2]; ++ if (off >= info->selected_eeprom->total_size) ++ return(-EINVAL); ++ if (off + count > info->selected_eeprom->total_size) ++ count = info->selected_eeprom->total_size - off; ++ if (count == 0) ++ return(-EINVAL); ++ mutex_lock(&info->update_lock); ++ offset[0] = off >> 8; ++ offset[1] = off & 0xFF; ++ msgrd[0].addr = msgrd[1].addr = client->addr + off / ++ info->selected_eeprom->virt_device_len; ++ msgrd[0].flags = 0; ++ if (info->selected_eeprom->double_address) { ++ msgrd[0].len = 2; ++ msgrd[0].buf = offset; ++ } else { ++ msgrd[0].len = 1; ++ msgrd[0].buf = &offset[1]; ++ } ++ msgrd[1].flags = I2C_M_RD; /* |I2C_M_NOSTART; */ ++ msgrd[1].len = count; ++ msgrd[1].buf = buf; ++ ret = i2c_transfer(client->adapter, msgrd, 2); ++ mutex_unlock(&info->update_lock); ++ return (ret == 2) ? count : ret; ++} ++ ++static ssize_t eeprom_write(struct kobject *kobj, struct bin_attribute *t, ++ char *buf, loff_t loff, size_t count) ++{ ++ struct i2c_client *client = ++ to_i2c_client(container_of(kobj, struct device, kobj)); ++ struct eeprom_info *info = i2c_get_clientdata(client); ++ struct i2c_msg msgwr, msgack; ++ int i, tx = 0, off = (int)loff; ++ if (off >= info->selected_eeprom->total_size) ++ return -EINVAL; ++ if ((off + count) > info->selected_eeprom->total_size) ++ count = info->selected_eeprom->total_size-off; ++ if (count == 0) ++ return -EINVAL; ++ msgwr.flags = 0; ++ msgack.flags = 0; ++ msgack.len = 0; ++ mutex_lock(&info->update_lock); ++ while (count) { ++ int len = info->selected_eeprom->page_size - ++ (off % info->selected_eeprom->page_size); ++ if (len > count) ++ len = count; ++ msgwr.addr = msgack.addr = client->addr + ++ off / info->selected_eeprom->virt_device_len; ++ info->buf[0] = off >> 8; ++ info->buf[1] = off & 0xFF; ++ memcpy(info->buf + 2, buf, len); ++ if (info->selected_eeprom->double_address) { ++ msgwr.buf = info->buf; ++ msgwr.len = len + 2; ++ } else { ++ msgwr.buf = 1 + info->buf; ++ msgwr.len = len + 1; ++ } ++ if (i2c_transfer(client->adapter, &msgwr, 1) != 1) ++ break; ++ for (i = 0; i < 20; i++) { ++ if (i2c_transfer(client->adapter, &msgack, 1) == 1) ++ break; ++ mdelay(1); ++ } ++ if (i >= 20) ++ break; ++ count -= len; ++ off += len; ++ buf += len; ++ tx += len; ++ } ++ mutex_unlock(&info->update_lock); ++ return tx; ++} ++ ++static struct bin_attribute eeprom_attr = { ++ .attr = ++ { ++ .name = "data", ++ .mode = S_IRUGO | S_IWUSR, ++ .owner = THIS_MODULE, ++ }, ++/* .size = selected_eeprom->total_size, */ ++ .read = eeprom_read, ++ .write = eeprom_write, ++}; ++ ++static ssize_t chip_show(struct device *dev, struct device_attribute *attr, ++ char *buffer) ++{ ++ struct eeprom_info *info = (struct eeprom_info *)dev_get_drvdata(dev); ++ return sprintf(buffer, "%s\n", info->selected_eeprom->name); ++} ++ ++static ssize_t chip_store(struct device *dev, struct device_attribute *attr, ++ const char *buffer, size_t count) ++{ ++ struct eeprom_info *info = (struct eeprom_info *)dev_get_drvdata(dev); ++ const struct eeprom_device *ei_pt; ++ if (buffer[count - 1] == '\n') ++ count--; ++ for (ei_pt = eeproms; ei_pt->name; ei_pt++) ++ if (strncasecmp(buffer, ei_pt->name, count) == 0) { ++ mutex_lock(&info->update_lock); ++ info->selected_eeprom = ei_pt; ++ sysfs_remove_bin_file(&info->client.dev.kobj, ++ &eeprom_attr); ++ eeprom_attr.size = info->selected_eeprom->total_size; ++ sysfs_create_bin_file(&info->client.dev.kobj, ++ &eeprom_attr); ++ mutex_unlock(&info->update_lock); ++ } ++ return count; ++} ++ ++static DEVICE_ATTR(chip, S_IRUGO | S_IWUSR, chip_show, chip_store); ++ ++static int eeprom_attach_adapter(struct i2c_adapter *adapter); ++static int eeprom_detach_client(struct i2c_client *client); ++ ++/* This is the driver that will be inserted */ ++static struct i2c_driver eeprom_driver = { ++ .driver = ++ { ++ .name = "eeprom", ++ }, ++ .attach_adapter = eeprom_attach_adapter, ++ .detach_client = eeprom_detach_client, ++}; ++ ++/* This function is called by i2c_probe */ ++static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) ++{ ++ struct i2c_client *new_client; ++ struct eeprom_info *info; ++ struct i2c_msg msg; ++ int err = 0; ++ const struct eeprom_device *ei_pt; ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE_DATA | ++ I2C_FUNC_SMBUS_BYTE)) ++ goto exit; ++ for (ei_pt = eeproms; ei_pt->name; ei_pt++) ++ if (strcasecmp(eeprom_name, ei_pt->name) == 0) ++ break; ++/* if((address&0x07)%(ei_pt->total_size/ei_pt->virt_device_len)!=0) ++ goto exit; */ ++ msg.addr = address; ++ msg.flags = 0; ++ msg.len = 0; ++ if (i2c_transfer(adapter, &msg, 1) != 1) ++ goto exit; ++ info = kzalloc(sizeof(struct eeprom_info), GFP_KERNEL); ++ if (!info) { ++ err = -ENOMEM; ++ goto exit; ++ } ++ info->selected_eeprom = ei_pt; ++ new_client = &info->client; ++ new_client->addr = address; ++ new_client->adapter = adapter; ++ new_client->driver = &eeprom_driver; ++ new_client->flags = 0; ++ strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); ++ mutex_init(&info->update_lock); ++ i2c_set_clientdata(new_client, info); ++ err = i2c_attach_client(new_client); ++ if (err) ++ goto exit_kfree; ++ eeprom_attr.size = ei_pt->total_size; ++ err = sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr); ++ if (err) ++ goto exit_detach; ++ err = sysfs_create_file(&new_client->dev.kobj, &dev_attr_chip.attr); ++ if (err) ++ goto exit_detach2; ++ return 0; ++exit_detach2: ++ sysfs_remove_bin_file(&new_client->dev.kobj, &eeprom_attr); ++exit_detach: ++ i2c_detach_client(new_client); ++exit_kfree: ++ kfree(info); ++exit: ++ return err; ++} ++ ++static int eeprom_attach_adapter(struct i2c_adapter *adapter) ++{ ++ return(i2c_probe(adapter, &addr_data, eeprom_detect)); ++} ++ ++static int eeprom_detach_client(struct i2c_client *client) ++{ ++ int err; ++ sysfs_remove_bin_file(&client->dev.kobj, &eeprom_attr); ++ sysfs_remove_file(&client->dev.kobj, &dev_attr_chip.attr); ++ err = i2c_detach_client(client); ++ if (err) ++ return(err); ++ kfree(i2c_get_clientdata(client)); ++ return 0; ++} ++ ++static int __init eeprom_init(void) ++{ ++ return(i2c_add_driver(&eeprom_driver)); ++} ++ ++static void __exit eeprom_exit(void) ++{ ++ i2c_del_driver(&eeprom_driver); ++} ++ ++MODULE_AUTHOR("Davide Rizzo <[EMAIL PROTECTED]>"); ++MODULE_DESCRIPTION("I2C EEPROM driver"); ++MODULE_LICENSE("GPL"); ++ ++module_init(eeprom_init); ++module_exit(eeprom_exit); ++ +Index: linux-2.6.26-NEW/drivers/i2c/chips/Kconfig +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/i2c/chips/Kconfig ++++ linux-2.6.26-NEW/drivers/i2c/chips/Kconfig +@@ -148,4 +148,12 @@ config MENELAUS + and other features that are often used in portable devices like + cell phones and PDAs. + ++config EEPROM_RW ++ tristate "EEPROM" ++ help ++ If you say yes here you get read/write access to the EEPROM data ++ ++ This driver can also be built as a module. If so, the module ++ will be called eeprom-rw. ++ + endmenu diff --git a/packages/linux/linux-2.6.26/boc01/007-081127-lm73.patch b/packages/linux/linux-2.6.26/boc01/007-081216-lm73.patch index 14787f8b04..93d1a18121 100644 --- a/packages/linux/linux-2.6.26/boc01/007-081127-lm73.patch +++ b/packages/linux/linux-2.6.26/boc01/007-081216-lm73.patch @@ -1,7 +1,8 @@ -diff -Nru linux-2.6.26/drivers/hwmon/Kconfig linux-2.6.26.mod/drivers/hwmon/Kconfig ---- linux-2.6.26/drivers/hwmon/Kconfig 2008-07-13 23:51:29.000000000 +0200 -+++ linux-2.6.26.mod/drivers/hwmon/Kconfig 2008-11-18 11:54:04.000000000 +0100 -@@ -390,6 +390,15 @@ +Index: linux-2.6.26-NEW/drivers/hwmon/Kconfig +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/hwmon/Kconfig ++++ linux-2.6.26-NEW/drivers/hwmon/Kconfig +@@ -390,6 +390,15 @@ config SENSORS_LM70 This driver can also be built as a module. If so, the module will be called lm70. @@ -17,9 +18,22 @@ diff -Nru linux-2.6.26/drivers/hwmon/Kconfig linux-2.6.26.mod/drivers/hwmon/Kcon config SENSORS_LM75 tristate "National Semiconductor LM75 and compatibles" depends on I2C -diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73.c ---- linux-2.6.26/drivers/hwmon/lm73.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.26.mod/drivers/hwmon/lm73.c 2008-11-27 11:46:31.000000000 +0100 +Index: linux-2.6.26-NEW/drivers/hwmon/Makefile +=================================================================== +--- linux-2.6.26-NEW.orig/drivers/hwmon/Makefile ++++ linux-2.6.26-NEW/drivers/hwmon/Makefile +@@ -47,6 +47,7 @@ obj-$(CONFIG_SENSORS_IT87) += it87.o + obj-$(CONFIG_SENSORS_K8TEMP) += k8temp.o + obj-$(CONFIG_SENSORS_LM63) += lm63.o + obj-$(CONFIG_SENSORS_LM70) += lm70.o ++obj-$(CONFIG_SENSORS_LM73) += lm73.o + obj-$(CONFIG_SENSORS_LM75) += lm75.o + obj-$(CONFIG_SENSORS_LM77) += lm77.o + obj-$(CONFIG_SENSORS_LM78) += lm78.o +Index: linux-2.6.26-NEW/drivers/hwmon/lm73.c +=================================================================== +--- /dev/null ++++ linux-2.6.26-NEW/drivers/hwmon/lm73.c @@ -0,0 +1,241 @@ + /* + * LM73 Sensor driver @@ -112,7 +126,7 @@ diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73. + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + int nr = attr->index; -+ ++ + long tmp = simple_strtol(buf, NULL, 10); + + lm73_write_value(client, LM73_REG_TEMP[nr], tmp); @@ -156,7 +170,7 @@ diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73. + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_WORD_DATA)) + goto exit; -+ ++ + if (!(data = kzalloc(sizeof(struct lm73_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; @@ -215,23 +229,24 @@ diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73. +static int lm73_read_value(struct i2c_client *client, u8 reg) +{ + short sVal; -+ ++ + if (reg == LM73_REG_CONF) + return i2c_smbus_read_byte_data(client, reg); + else + { + sVal = swab16(i2c_smbus_read_word_data(client, reg)); + sVal = sVal >> 7; -+ -+ if(sVal & 0xFFFF) -+ { ++ ++ if ( sVal & 0xFFFF ) { + sVal = sVal - 0x1; + sVal = ~sVal; -+ ++ + return -sVal; + } ++ else { ++ return sVal; ++ } + } -+ +} + +static int lm73_write_value(struct i2c_client *client, u8 reg, short value) @@ -239,10 +254,9 @@ diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73. + if (reg == LM73_REG_CONF) + return i2c_smbus_write_byte_data(client, reg, value); + else -+ { -+ value = value<<7; ++ { ++ value = value<<7; + return i2c_smbus_write_word_data(client, reg, swab16(value)); -+ + } +} + @@ -262,14 +276,3 @@ diff -Nru linux-2.6.26/drivers/hwmon/lm73.c linux-2.6.26.mod/drivers/hwmon/lm73. + +module_init(sensors_lm73_init); +module_exit(sensors_lm73_exit); -diff -Nru linux-2.6.26/drivers/hwmon/Makefile linux-2.6.26.mod/drivers/hwmon/Makefile ---- linux-2.6.26/drivers/hwmon/Makefile 2008-07-13 23:51:29.000000000 +0200 -+++ linux-2.6.26.mod/drivers/hwmon/Makefile 2008-11-18 11:54:04.000000000 +0100 -@@ -47,6 +47,7 @@ - obj-$(CONFIG_SENSORS_K8TEMP) += k8temp.o - obj-$(CONFIG_SENSORS_LM63) += lm63.o - obj-$(CONFIG_SENSORS_LM70) += lm70.o -+obj-$(CONFIG_SENSORS_LM73) += lm73.o - obj-$(CONFIG_SENSORS_LM75) += lm75.o - obj-$(CONFIG_SENSORS_LM77) += lm77.o - obj-$(CONFIG_SENSORS_LM78) += lm78.o diff --git a/packages/linux/linux-2.6.26/boc01/011-081105-gpio.patch b/packages/linux/linux-2.6.26/boc01/011-081105-gpio.patch deleted file mode 100644 index 86bf4ff84b..0000000000 --- a/packages/linux/linux-2.6.26/boc01/011-081105-gpio.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff -Nru linux-2.6.26-officiel/drivers/char/Kconfig /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/char/Kconfig ---- linux-2.6.26-officiel/drivers/char/Kconfig 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/char/Kconfig 2008-09-26 14:44:59.000000000 +0200 -@@ -1006,6 +1006,14 @@ - tristate "NEC VR4100 series General-purpose I/O Unit support" - depends on CPU_VR41XX - -+config GPIO_MPC8313 -+ tristate "mpc8313e gpio" -+ depends on PPC_MPC831x -+ select INPUT -+ default y -+ help -+ test -+ - config RAW_DRIVER - tristate "RAW driver (/dev/raw/rawN)" - depends on BLOCK -diff -Nru linux-2.6.26-officiel/drivers/char/Makefile /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/char/Makefile ---- linux-2.6.26-officiel/drivers/char/Makefile 2008-07-13 23:51:29.000000000 +0200 -+++ /home/guilig/workspace/kernel-goobie-2.6.26/src/drivers/char/Makefile 2008-09-26 14:44:59.000000000 +0200 -@@ -111,6 +111,8 @@ - obj-$(CONFIG_PS3_FLASH) += ps3flash.o - |
