diff options
| author | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-03-25 18:29:54 +0100 |
|---|---|---|
| committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-03-25 18:29:54 +0100 |
| commit | 95e0882e2dfabe457550a885e0eb24893df31742 (patch) | |
| tree | a34220ed25168022c53d9cb5697f3666a427b30c /recipes/linux | |
| parent | 451b1c687105655a4f2c9c477b05535041e25060 (diff) | |
| parent | ac41ae95b1dbe54c05adf494c0fa44b3abbfeca3 (diff) | |
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'recipes/linux')
67 files changed, 136505 insertions, 21889 deletions
diff --git a/recipes/linux/linux-2.6.27/boc01/005-090217-isl12024.patch b/recipes/linux/linux-2.6.27/boc01/005-090226-isl12024.patch index 672e405de0..0c29cdc3de 100644 --- a/recipes/linux/linux-2.6.27/boc01/005-090217-isl12024.patch +++ b/recipes/linux/linux-2.6.27/boc01/005-090226-isl12024.patch @@ -1,3 +1,16 @@ +Index: linux-2.6.27/drivers/i2c/chips/at24.c +=================================================================== +--- linux-2.6.27.orig/drivers/i2c/chips/at24.c ++++ linux-2.6.27/drivers/i2c/chips/at24.c +@@ -114,6 +114,8 @@ static const struct i2c_device_id at24_i + { "spd", AT24_DEVICE_MAGIC(2048 / 8, + AT24_FLAG_READONLY | AT24_FLAG_IRUGO) }, + { "24c04", AT24_DEVICE_MAGIC(4096 / 8, 0) }, ++ /* Intersil RTC/Unique-ID isl12024 eeprom handled here */ ++ { "isl12024",AT24_DEVICE_MAGIC(4096 / 8, AT24_FLAG_ADDR16) }, + /* 24rf08 quirk is handled at i2c-core */ + { "24c08", AT24_DEVICE_MAGIC(8192 / 8, 0) }, + { "24c16", AT24_DEVICE_MAGIC(16384 / 8, 0) }, Index: linux-2.6.27/drivers/rtc/Kconfig =================================================================== --- linux-2.6.27.orig/drivers/rtc/Kconfig @@ -27,18 +40,124 @@ Index: linux-2.6.27/drivers/rtc/Makefile obj-$(CONFIG_RTC_DRV_M41T80) += rtc-m41t80.o obj-$(CONFIG_RTC_DRV_M41T94) += rtc-m41t94.o obj-$(CONFIG_RTC_DRV_M48T59) += rtc-m48t59.o +Index: linux-2.6.27/drivers/rtc/isl12024.h +=================================================================== +--- /dev/null ++++ linux-2.6.27/drivers/rtc/isl12024.h +@@ -0,0 +1,100 @@ ++/* ++ * Intersil ISL12024 chip registers definitions ++ * ++ * ++ * Copyright (C) 2008, CenoSYS (www.cenosys.com). ++ * Guillaume Ligneul ++ * Guillaume.ligneul@gmail.com ++ * ++ * 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 ++ */ ++ ++#ifndef ISL12024_H_ ++#define ISL12024_H_ ++ ++#define ISL12024_REG_SR 0x3F /* status register */ ++#define ISL12024_REG_Y2K 0x37 ++#define ISL12024_REG_DW 0x36 ++#define ISL12024_REG_YR 0x35 ++#define ISL12024_REG_MO 0x34 ++#define ISL12024_REG_DT 0x33 ++#define ISL12024_REG_HR 0x32 ++#define ISL12024_REG_MN 0x31 ++#define ISL12024_REG_SC 0x30 ++#define ISL12024_REG_DTR 0x13 ++#define ISL12024_REG_ATR 0x12 ++#define ISL12024_REG_INT 0x11 ++#define ISL12024_REG_0 0x10 ++#define ISL12024_REG_Y2K1 0x0F ++#define ISL12024_REG_DWA1 0x0E ++#define ISL12024_REG_YRA1 0x0D ++#define ISL12024_REG_MOA1 0x0C ++#define ISL12024_REG_DTA1 0x0B ++#define ISL12024_REG_HRA1 0x0A ++#define ISL12024_REG_MNA1 0x09 ++#define ISL12024_REG_SCA1 0x08 ++#define ISL12024_REG_Y2K0 0x07 ++#define ISL12024_REG_DWA0 0x06 ++#define ISL12024_REG_YRA0 0x05 ++#define ISL12024_REG_MOA0 0x04 ++#define ISL12024_REG_DTA0 0x03 ++#define ISL12024_REG_HRA0 0x02 ++#define ISL12024_REG_MNA0 0x01 ++#define ISL12024_REG_SCA0 0x00 ++ ++#define ISL12024_CCR_BASE 0x30 /* Base address of CCR */ ++#define ISL12024_ALM0_BASE 0x00 /* Base address of ALARM0 */ ++ ++#define ISL12024_SR_RTCF 0x01 /* Clock failure */ ++#define ISL12024_SR_WEL 0x02 /* Write Enable Latch */ ++#define ISL12024_SR_RWEL 0x04 /* Register Write Enable */ ++#define ISL12024_SR_AL0 0x20 /* Alarm 0 match */ ++ ++#define ISL12024_DTR_DTR0 0x01 ++#define ISL12024_DTR_DTR1 0x02 ++#define ISL12024_DTR_DTR2 0x04 ++ ++#define ISL12024_HR_MIL 0x80 /* Set in ccr.hour for 24 hr mode */ ++ ++#define ISL12024_INT_AL0E 0x20 /* Alarm 0 enable */ ++ ++/* I2C ADDRESS */ ++#define ISL12024_I2C_ADDR 0xDE ++#define ISL12024_I2C_EEPROM_ADDR 0x57 ++ ++/* device id section */ ++#define ISL12024_REG_ID 0x20 ++ ++/* Register map */ ++/* rtc section */ ++#define ISL12024_REG_HR_MIL (1<<7) /* 24h/12h mode */ ++#define ISL12024_REG_HR_PM (1<<5) /* PM/AM bit in 12h mode */ ++//#define ISL12024_REG_DT 0x33 /* Date */ ++//#define ISL12024_REG_MO 0x34 /* Month */ ++//#define ISL12024_REG_YR 0x35 /* Year */ ++//#define ISL12024_REG_DW 0x36 ++//#define ISL12024_REG_Y2K 0x37 ++#define ISL12024_RTC_SECTION_LEN 8 ++ ++/* control/status section */ ++//#define ISL12024_REG_SR 0x3F ++//#define ISL12024_REG_SR_BAT (1<<7) /* battery */ ++//#define ISL12024_REG_SR_AL1 (1<<6) /* alarm 0 */ ++//#define ISL12024_REG_SR_AL0 (1<<5) /* alarm 1 */ ++//#define ISL12024_REG_SR_OSCF (1<<4) /* oscillator fail */ ++//#define ISL12024_REG_SR_RWEL (1<<2) /* register write enable latch */ ++//#define ISL12024_REG_SR_WEL (1<<1) /* write enable latch */ ++//#define ISL12024_REG_SR_RTCF (1<<0) /* rtc fail */ ++//#define ISL12024_REG_INT 0x11 ++ ++#define CCR_SEC 0 ++#define CCR_MIN 1 ++#define CCR_HOUR 2 ++#define CCR_MDAY 3 ++#define CCR_MONTH 4 ++#define CCR_YEAR 5 ++#define CCR_WDAY 6 ++#define CCR_Y2K 7 ++ ++#endif /*ISL12024_H_*/ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c =================================================================== --- /dev/null +++ linux-2.6.27/drivers/rtc/rtc-isl12024.c -@@ -0,0 +1,517 @@ +@@ -0,0 +1,541 @@ +/* + * Intersil ISL12024 class driver + * + * + * Copyright (C) 2007, CenoSYS (www.cenosys.com). -+ * Guillaume Ligneul -+ * Guillaume.ligneul@gmail.com ++ * ++ * Guillaume Ligneul <guillaume.ligneul@gmail.com> ++ * Sylvain Giroudon <sylvain.giroudon@goobie.fr> + * + * 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 @@ -57,33 +176,30 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c +#define DBG 1 +#undef DBG + -+static u8 buf_id[ISL12024_RTC_SECTION_LEN] = { 0 ,}; -+ +#define DRV_NAME "isl12024" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2" + +/* i2c configuration */ -+ +static const unsigned short normal_i2c[] = { + ISL12024_I2C_ADDR >>1, I2C_CLIENT_END +}; +I2C_CLIENT_INSMOD; + -+/* Procfs management */ -+static struct proc_dir_entry * root_proc = NULL; -+static struct proc_dir_entry * entry_proc = NULL; -+static int read_proc (char * page, char ** start, off_t off, int count, int * eof, void * data); -+ +static int isl12024_get_status(struct i2c_client *client, unsigned char *sr); +static int isl12024_fix_osc(struct i2c_client *client); + -+ +static int isl12024_attach_adapter(struct i2c_adapter *adapter); +static int isl12024_detach_client(struct i2c_client *client); + -+// To debug (may be add in includ/linux/i2c-id.h) ++ ++/* Bufer to store unique identifier in */ ++static u8 buf_id[ISL12024_RTC_SECTION_LEN] = { 0 }; ++ ++ ++// To debug (may be added in include/linux/i2c-id.h) +#define I2C_DRIVERID_ISL12024 97 + ++ +static struct i2c_driver isl12024_driver = { + .driver = { + .name = DRV_NAME, @@ -93,6 +209,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + .detach_client = &isl12024_detach_client, +}; + ++ +int +isl12024_i2c_read_regs(struct i2c_client *client, u8 reg, u8 buf[], + unsigned len) @@ -151,14 +268,16 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + + memcpy(&i2c_buf[2], &buf[0], len ); + -+ + ret = i2c_transfer(client->adapter, msgs, 1); -+ printk(KERN_INFO "i2c_transfer %d\n",ret); ++ if ( ret < 0 ) ++ printk(KERN_ERR DRV_NAME ": i2c_transfer failed (%d)\n", ret); ++ + return ret; +} + +EXPORT_SYMBOL(isl12024_i2c_set_regs); + ++ +static int isl12024_i2c_validate_client(struct i2c_client *client) +{ + u8 regs[ISL12024_RTC_SECTION_LEN] = { 0, }; @@ -183,6 +302,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return 0; +} + ++ +static int isl12024_read_time(struct i2c_client *client, + struct rtc_time *tm) +{ @@ -190,8 +310,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + int err; + u8 regs[ISL12024_RTC_SECTION_LEN] = { 0, }; + -+ printk(KERN_INFO "%s\n ",__FUNCTION__ ); -+ ++ //printk(KERN_INFO DRV_NAME "%s\n ",__FUNCTION__ ); + + if (isl12024_get_status(client, &sr) < 0) { + dev_err(&client->dev, "%s: reading SR failed\n", __func__); @@ -203,7 +322,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c +#ifdef DBG + int i; + for(i=0; i<ISL12024_RTC_SECTION_LEN; i++) -+ printk(KERN_INFO "0x%2X\n", regs[i]); ++ printk(KERN_INFO DRV_NAME "0x%2X\n", regs[i]); +#endif + + if (err < 0) { @@ -234,6 +353,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return rtc_valid_tm(tm); +} + ++ +static int isl12024_get_status(struct i2c_client *client, unsigned char *sr) +{ + static unsigned char sr_addr[2] = { 0, ISL12024_REG_SR }; @@ -252,6 +372,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return 0; +} + ++ +static int isl12024_set_datetime(struct i2c_client *client, struct rtc_time *tm, + int datetoo, u8 reg_base, unsigned char alm_enable) +{ @@ -373,6 +494,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return 0; +} + ++ +static int isl12024_fix_osc(struct i2c_client *client) +{ + int err; @@ -381,24 +503,27 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + + err = isl12024_set_datetime(client, &tm, 0, ISL12024_CCR_BASE, 0); -+ if (err < 0) -+ printk(KERN_INFO "unable to restart the oscillator\n"); ++ if ( err < 0 ) ++ printk(KERN_ERR DRV_NAME ": Unable to restart the oscillator (%d)\n", err); + + return err; +} + ++ +static int isl12024_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return isl12024_read_time(to_i2c_client(dev), tm); + +} + ++ +static int isl12024_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + return isl12024_set_datetime(to_i2c_client(dev), + tm, 1, ISL12024_CCR_BASE, 0); +} + ++ +static int +isl12024_rtc_proc(struct device *dev, struct seq_file *seq) +{ @@ -408,32 +533,48 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return 0; +} + ++ +static const struct rtc_class_ops isl12024_rtc_ops = { + .proc = isl12024_rtc_proc, + .read_time = isl12024_rtc_read_time, + .set_time = isl12024_rtc_set_time, +}; + -+static int read_proc (char * page, char ** start, off_t off, int count, int * eof, void * data) ++static int ++read_proc(char * page, char ** start, off_t off, int count, int * eof, void * data) +{ -+ int i=0; ++ int len = 0; ++ int i; + -+ printk("id: 0x"); -+ for(i=0;i<ISL12024_RTC_SECTION_LEN;i++) -+ printk("%02X",buf_id[i]); -+ printk("\n"); -+ return 0; ++ for (i = 0; i < ISL12024_RTC_SECTION_LEN; i++) ++ len += sprintf(page+len, "%02X", buf_id[i]); ++ len += sprintf(page+len, "\n"); ++ ++ len -= off; ++ if ( len < count ) { ++ *eof = 1; ++ if ( len <= 0 ) ++ return 0; ++ } else { ++ len = count; ++ } ++ ++ *start = page + off; ++ ++ return len; +} + ++ +static int +isl12024_probe(struct i2c_adapter *adapter, int addr, int kind) +{ -+ + int rc = 0; + int err = 0; + unsigned char sr; + struct i2c_client *new_client = NULL; + struct rtc_device *rtc = NULL; ++ struct proc_dir_entry *proc_root; ++ struct proc_dir_entry *proc_entry; + + if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { + rc = -ENODEV; @@ -467,7 +608,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + &isl12024_rtc_ops, THIS_MODULE); + + if (IS_ERR(rtc)) { -+ printk("Error during rtc registration\n"); ++ printk(KERN_ERR DRV_NAME ": Error during rtc registration\n"); + rc = PTR_ERR(rtc); + goto failout; + } @@ -475,30 +616,28 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + i2c_set_clientdata(new_client, rtc); + + /* Check for power failures and eventualy enable the osc */ -+ if ((err = isl12024_get_status(new_client, &sr)) == 0) { -+ if (sr & ISL12024_SR_RTCF) { -+ printk(KERN_INFO "power failure detected, " -+ "please set the clock\n"); -+ udelay(50); -+ isl12024_fix_osc(new_client); -+ } ++ if ((err = isl12024_get_status(new_client, &sr)) == 0) { ++ if (sr & ISL12024_SR_RTCF) { ++ printk(KERN_INFO DRV_NAME ": Power failure detected, please set the clock\n"); ++ udelay(50); ++ isl12024_fix_osc(new_client); + } -+ else -+ printk(KERN_INFO "couldn't read status\n"); -+ -+ root_proc = proc_mkdir( "isl12024", 0 ); -+ entry_proc = create_proc_entry("id", S_IFREG | S_IRUGO | S_IWUSR, root_proc); ++ } ++ else { ++ printk(KERN_ERR DRV_NAME ": Couldn't read status\n"); ++ } + -+ if (entry_proc == NULL) -+ return -1; ++ proc_root = proc_mkdir(DRV_NAME, 0); ++ proc_entry = create_proc_entry("id", S_IFREG | S_IRUGO, proc_root); ++ if (proc_entry == NULL) ++ return -1; + -+ entry_proc->owner = THIS_MODULE; -+ entry_proc->read_proc = read_proc; ++ proc_entry->owner = THIS_MODULE; ++ proc_entry->read_proc = read_proc; + -+ /* read unique id from eeprom */ ++ /* Read unique id from eeprom */ + isl12024_i2c_read_regs(new_client, ISL12024_REG_ID, buf_id, sizeof(buf_id)); + -+ + return 0; + + failout: @@ -506,12 +645,14 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return rc; +} + ++ +static int +isl12024_attach_adapter (struct i2c_adapter *adapter) +{ + return i2c_probe(adapter, &addr_data, isl12024_probe); +} + ++ +static int +isl12024_detach_client(struct i2c_client *client) +{ @@ -530,6 +671,7 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + return 0; +} + ++ +/* module init/exit */ + +static int __init isl12024_init(void) @@ -549,121 +691,3 @@ Index: linux-2.6.27/drivers/rtc/rtc-isl12024.c + +module_init(isl12024_init); +module_exit(isl12024_exit); -Index: linux-2.6.27/drivers/i2c/chips/at24.c -=================================================================== ---- linux-2.6.27.orig/drivers/i2c/chips/at24.c -+++ linux-2.6.27/drivers/i2c/chips/at24.c -@@ -114,6 +114,8 @@ static const struct i2c_device_id at24_i - { "spd", AT24_DEVICE_MAGIC(2048 / 8, - AT24_FLAG_READONLY | AT24_FLAG_IRUGO) }, - { "24c04", AT24_DEVICE_MAGIC(4096 / 8, 0) }, -+ /* Intersil RTC/Unique-ID isl12024 eeprom handled here */ -+ { "isl12024",AT24_DEVICE_MAGIC(4096 / 8, AT24_FLAG_ADDR16) }, - /* 24rf08 quirk is handled at i2c-core */ - { "24c08", AT24_DEVICE_MAGIC(8192 / 8, 0) }, - { "24c16", AT24_DEVICE_MAGIC(16384 / 8, 0) }, -Index: linux-2.6.27/drivers/rtc/isl12024.h -=================================================================== ---- /dev/null -+++ linux-2.6.27/drivers/rtc/isl12024.h -@@ -0,0 +1,100 @@ -+/* -+ * Intersil ISL12024 chip registers definitions -+ * -+ * -+ * Copyright (C) 2008, CenoSYS (www.cenosys.com). -+ * Guillaume Ligneul -+ * Guillaume.ligneul@gmail.com -+ * -+ * 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 -+ */ -+ -+#ifndef ISL12024_H_ -+#define ISL12024_H_ -+ -+#define ISL12024_REG_SR 0x3F /* status register */ -+#define ISL12024_REG_Y2K 0x37 -+#define ISL12024_REG_DW 0x36 -+#define ISL12024_REG_YR 0x35 -+#define ISL12024_REG_MO 0x34 -+#define ISL12024_REG_DT 0x33 -+#define ISL12024_REG_HR 0x32 -+#define ISL12024_REG_MN 0x31 -+#d |
