diff -Nru linux-2.6.24/arch/arm/mach-pxa/trizeps4.c linux-2.6.24-patch/arch/arm/mach-pxa/trizeps4.c
--- linux-2.6.24/arch/arm/mach-pxa/trizeps4.c	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24-patch/arch/arm/mach-pxa/trizeps4.c	2008-02-22 20:48:09.000000000 +0100
@@ -270,6 +270,12 @@
 	local_irq_restore(flags);
 }
 
+/* a I2C based RTC is known on CONXS board */
+static struct i2c_board_info __initdata trizeps4_i2c_devices[] = {
+	{ I2C_BOARD_INFO("rtc-pcf8593", 0x51),
+	  .type = "rtc-pcf8593",
+	},
+};
 #else
 /* for other baseboards define dummies */
 void board_pcmcia_power(int power)	{;}
@@ -277,6 +283,10 @@
 #define board_mci_power			NULL
 #define board_irda_mode			NULL
 
+/* for other baseboards no known i2c devices */
+static struct i2c_board_info __initdata trizeps4_i2c_devices[] = {
+	{ NULL },
+};
 #endif		/* CONFIG_MACH_TRIZEPS4_CONXS */
 EXPORT_SYMBOL(board_pcmcia_power);
 
@@ -296,11 +306,10 @@
 	err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int,
 			  IRQF_DISABLED | IRQF_TRIGGER_RISING,
 			  "MMC card detect", data);
-	if (err) {
+	if (err) 
 		printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
-		return -1;
-	}
-	return 0;
+
+	return err;
 }
 
 static void trizeps4_mci_exit(struct device *dev, void *data)
@@ -420,7 +429,7 @@
 
 static struct pxafb_mach_info toshiba_lcd = {
     .modes		= &toshiba_lcd_mode,
-    .num_modes	= 1,
+    .num_modes		= 1,
     .cmap_inverse	= 0,
     .cmap_static	= 0,
     .lccr0		= LCCR0_Color | LCCR0_Act,
@@ -438,6 +447,8 @@
 	pxa_set_mci_info(&trizeps4_mci_platform_data);
 	pxa_set_ficp_info(&trizeps4_ficp_platform_data);
 	pxa_set_ohci_info(&trizeps4_ohci_platform_data);
+	i2c_register_board_info(0, trizeps4_i2c_devices,
+			ARRAY_SIZE(trizeps4_i2c_devices)); 
 }
 
 static void __init trizeps4_map_io(void)
diff -Nru linux-2.6.24/drivers/pcmcia/Makefile linux-2.6.24-patch/drivers/pcmcia/Makefile
--- linux-2.6.24/drivers/pcmcia/Makefile	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24-patch/drivers/pcmcia/Makefile	2008-02-20 21:38:21.000000000 +0100
@@ -70,5 +70,6 @@
 pxa2xx_cs-$(CONFIG_ARCH_LUBBOCK)		+= pxa2xx_lubbock.o sa1111_generic.o
 pxa2xx_cs-$(CONFIG_MACH_MAINSTONE)		+= pxa2xx_mainstone.o
 pxa2xx_cs-$(CONFIG_PXA_SHARPSL)			+= pxa2xx_sharpsl.o
+pxa2xx_cs-$(CONFIG_MACH_TRIZEPS4)               += pxa2xx_trizeps4.o
 pxa2xx_cs-$(CONFIG_MACH_ARMCORE)		+= pxa2xx_cm_x270.o
 
diff -Nru linux-2.6.24/drivers/pcmcia/pxa2xx_trizeps4.c linux-2.6.24-patch/drivers/pcmcia/pxa2xx_trizeps4.c
--- linux-2.6.24/drivers/pcmcia/pxa2xx_trizeps4.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.24-patch/drivers/pcmcia/pxa2xx_trizeps4.c	2008-02-19 21:19:36.000000000 +0100
@@ -0,0 +1,234 @@
+/*
+ * linux/drivers/pcmcia/pxa2xx_trizeps4.c
+ *
+ * TRIZEPS4 PCMCIA specific routines.
+ *
+ * Author:	Jürgen Schindele
+ * Created:	20 02, 2006
+ * Copyright:	Jürgen Schindele
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <pcmcia/ss.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/trizeps4.h>
+
+#include "soc_common.h"
+
+extern void board_pcmcia_power(int power);
+
+static struct pcmcia_irqs irqs[] = {
+	{ 0, TRIZEPS4_CD_IRQ, "PCMCIA0 CD" }
+};
+
+static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+    /* we dont have voltage/card/ready detection
+     * so we dont need interrupts for it
+     * TODO set default state on power
+     */
+    /*
+     * Setup default state of GPIO outputs
+     * before we enable them as outputs.
+     */
+    GPSR(GPIO48_nPOE) =			
+	GPIO_bit(GPIO48_nPOE) |
+	GPIO_bit(GPIO49_nPWE) |
+	GPIO_bit(GPIO50_nPIOR) |
+	GPIO_bit(GPIO51_nPIOW) |
+	GPIO_bit(GPIO54_nPCE_2);
+
+    GPSR(GPIO102_nPCE_1) = GPIO102_nPCE_1;
+
+    pxa_gpio_mode(GPIO48_nPOE_MD);
+    pxa_gpio_mode(GPIO49_nPWE_MD);
+    pxa_gpio_mode(GPIO50_nPIOR_MD);
+    pxa_gpio_mode(GPIO51_nPIOW_MD);
+    pxa_gpio_mode(GPIO102_nPCE_1_MD);
+    pxa_gpio_mode(GPIO54_nPCE_2_MD);
+    pxa_gpio_mode(GPIO104_pSKTSEL_MD);
+    pxa_gpio_mode(GPIO55_nPREG_MD);
+    pxa_gpio_mode(GPIO56_nPWAIT_MD);
+    pxa_gpio_mode(GPIO57_nIOIS16_MD);
+    /* card detect */
+    pxa_gpio_mode(GPIO_PCD | GPIO_IN);
+    /* card interrupt */
+    pxa_gpio_mode(GPIO_PRDY | GPIO_IN);
+
+    switch (skt->nr) {
+      case 0:
+	skt->irq = TRIZEPS4_READY_NINT;
+	break;
+
+      case 1:
+      default:
+	break;
+    }
+    /* release the reset of this card */
+    /* FIXME Remove Card Reset ?? */
+    printk(KERN_DEBUG "%s: sock %d irq %d\n", __FUNCTION__, skt->nr, skt->irq);
+
+    /* supplementory irqs for the socket */
+    /* FIXME are interrupts delivered by ConXS Board ?? */
+    return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
+}
+
+static void trizeps_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+    /* nothing to do */
+}
+
+static unsigned long trizeps_pcmcia_status[2];
+
+static void trizeps_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
+{
+    unsigned short status=0, change;
+#ifdef CONFIG_MACH_TRIZEPS4_CONXS
+    status = ConXS_CFSR; 
+    change = (status ^ trizeps_pcmcia_status[skt->nr]) & ConXS_CFSR_BVD_MASK;
+
+    if (change) {
+	trizeps_pcmcia_status[skt->nr] = status;
+	if (status & ConXS_CFSR_BVD1) {
+	    /* enable_irq empty */
+	}
+	else {
+	    /* disable_irq empty */
+	}
+    }
+
+    switch (skt->nr) {
+      case 0:
+	/* just fill in fix states */
+	state->detect = (GPLR(GPIO_PCD)  & GPIO_bit(GPIO_PCD))  ? 0 : 1;  
+	state->ready  = (GPLR(GPIO_PRDY) & GPIO_bit(GPIO_PRDY)) ? 1 : 0; 
+	state->bvd1   = (status & ConXS_CFSR_BVD1) ? 1 : 0;
+	state->bvd2   = (status & ConXS_CFSR_BVD2) ? 1 : 0;
+	state->vs_3v  = (status & ConXS_CFSR_VS1) ? 0 : 1;
+	state->vs_Xv  = (status & ConXS_CFSR_VS2) ? 0 : 1;
+	state->wrprot = 0;	/* not available */
+	break;
+
+      case 1:
+	/* on ConXS we only have one slot second is inactive */
+	state->detect = 0;
+	state->ready  = 0;
+	state->bvd1   = 0;
+	state->bvd2   = 0;
+	state->vs_3v  = 0;
+	state->vs_Xv  = 0;
+	state->wrprot = 0;
+	break;
+
+    }
+#endif
+}
+
+static int trizeps_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
+{
+    int ret = 0;
+    unsigned short power = 0;
+
+    /* we do nothing here just check a bit */
+    switch (state->Vcc) {
+      case 0:  power &= 0xfc; break;
+      case 33: power |= ConXS_BCR_S0_VCC_3V3; break;
+      case 50:
+	       printk(KERN_ERR "%s(): Vcc 5V not supported in socket\n", __FUNCTION__);
+	       break;
+      default:
+	       printk(KERN_ERR "%s(): bad Vcc %u\n", __FUNCTION__, state->Vcc);
+	       ret = -1;
+    }
+
+    switch (state->Vpp) {
+      case 0:  power &= 0xf3; break;
+      case 33: power |= ConXS_BCR_S0_VPP_3V3; break;
+      case 120:
+	       printk(KERN_ERR "%s(): Vpp 12V not supported in socket\n", __FUNCTION__);
+	       break;
+      default:
+		if(state->Vpp != state->Vcc) {
+		    printk(KERN_ERR "%s(): bad Vpp %u\n", __FUNCTION__, state->Vpp);
+		    ret = -1;
+		}
+    }
+
+    switch (skt->nr) {
+      case 0:			 /* ony have one socket */
+	board_pcmcia_power(power);
+	break;
+
+      case 1:			/* do nothing */
+      default:
+	break;
+    }
+
+    return ret;
+}
+
+static void trizeps_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+    /* default is on */
+    board_pcmcia_power(0x9);
+}
+
+static void trizeps_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+}
+
+static struct pcmcia_low_level trizeps_pcmcia_ops = {
+    .owner		= THIS_MODULE,
+    .hw_init		= trizeps_pcmcia_hw_init,
+    .hw_shutdown	= trizeps_pcmcia_hw_shutdown,
+    .socket_state	= trizeps_pcmcia_socket_state,
+    .configure_socket	= trizeps_pcmcia_configure_socket,
+    .socket_init	= trizeps_pcmcia_socket_init,
+    .socket_suspend	= trizeps_pcmcia_socket_suspend,
+    .nr			= 2,
+    .first		= 0,
+};
+
+static struct platform_device *trizeps_pcmcia_device;
+
+static int __init trizeps_pcmcia_init(void)
+{
+	int ret;
+
+	trizeps_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
+	if (!trizeps_pcmcia_device)
+		return -ENOMEM;
+
+	trizeps_pcmcia_device->dev.platform_data = &trizeps_pcmcia_ops;
+
+	ret = platform_device_add(trizeps_pcmcia_device);
+
+	if (ret)
+		platform_device_put(trizeps_pcmcia_device);
+
+	return ret;
+}
+
+static void __exit trizeps_pcmcia_exit(void)
+{
+	platform_device_unregister(trizeps_pcmcia_device);
+}
+
+fs_initcall(trizeps_pcmcia_init);
+module_exit(trizeps_pcmcia_exit);
+
+MODULE_LICENSE("GPL");
diff -Nru linux-2.6.24/drivers/pcmcia/soc_common.c linux-2.6.24-patch/drivers/pcmcia/soc_common.c
--- linux-2.6.24/drivers/pcmcia/soc_common.c	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24-patch/drivers/pcmcia/soc_common.c	2008-02-20 21:36:52.000000000 +0100
@@ -747,7 +747,7 @@
 
 		add_timer(&skt->poll_timer);
 
-		device_create_file(&skt->socket.dev, &dev_attr_status);
+		ret = device_create_file(&skt->socket.dev, &dev_attr_status);
 	}
 
 	dev_set_drvdata(dev, sinfo);
diff -Nru linux-2.6.24/drivers/rtc/Makefile linux-2.6.24-patch/drivers/rtc/Makefile
--- linux-2.6.24/drivers/rtc/Makefile	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24-patch/drivers/rtc/Makefile	2008-02-20 21:59:06.000000000 +0100
@@ -37,6 +37,7 @@
 obj-$(CONFIG_RTC_DRV_OMAP)	+= rtc-omap.o
 obj-$(CONFIG_RTC_DRV_PCF8563)	+= rtc-pcf8563.o
 obj-$(CONFIG_RTC_DRV_PCF8583)	+= rtc-pcf8583.o
+obj-$(CONFIG_RTC_DRV_PCF8583)	+= rtc-pcf8593.o
 obj-$(CONFIG_RTC_DRV_PL031)	+= rtc-pl031.o
 obj-$(CONFIG_RTC_DRV_RS5C313)	+= rtc-rs5c313.o
 obj-$(CONFIG_RTC_DRV_RS5C348)	+= rtc-rs5c348.o
diff -Nru linux-2.6.24/drivers/rtc/rtc-pcf8593.c linux-2.6.24-patch/drivers/rtc/rtc-pcf8593.c
--- linux-2.6.24/drivers/rtc/rtc-pcf8593.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.24-patch/drivers/rtc/rtc-pcf8593.c	2008-02-22 20:57:29.000000000 +0100
@@ -0,0 +1,420 @@
+/*
+ *  drivers/rtc/rtc-pcf8593.c
+ *
+ *  Copyright (C) 2000 Russell King
+ *  Copyright (C) 2008 Jürgen Schindele
+ *
+ * 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.
+ *
+ *  Driver for PCF8593 RTC & RAM chip
+ *
+ *  Converted to the generic RTC susbsystem by G. Liakhovetski (2006)
+ */
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+#include <linux/rtc.h>
+#include <linux/bcd.h>
+
+struct rtc_mem {
+	unsigned int	loc;
+	unsigned int	nr;
+	unsigned char	*data;
+};
+
+struct pcf8593 {
+	struct i2c_client *client;
+	struct rtc_device *rtc;
+	unsigned char ctrl;
+};
+
+#define CTRL_STOP	0x80
+#define CTRL_HOLD	0x40
+#define CTRL_32KHZ	0x00
+#define CTRL_MASK	0x08
+#define CTRL_ALARMEN	0x04
+#define CTRL_ALARM	0x02
+#define CTRL_TIMER	0x01
+
+static struct i2c_driver pcf8593_driver;
+
+#define get_ctrl(x)    ((struct pcf8593 *)i2c_get_clientdata(x))->ctrl
+#define set_ctrl(x, v) get_ctrl(x) = v
+
+#define CMOS_YEAR	(9)
+#define CMOS_CHECKSUM	(15)
+
+static int pcf8593_get_datetime(struct i2c_client *client, struct rtc_time *dt)
+{
+	unsigned char buf[8], addr[1] = { 1 };
+	struct i2c_msg msgs[2] = {
+		{
+			.addr = client->addr,
+			.flags = 0,
+			.len = 1,
+			.buf = addr,
+		}, {
+			.addr = client->addr,
+			.flags = I2C_M_RD,
+			.len = 6,
+			.buf = buf,
+		}
+	};
+	int ret;
+
+	dev_dbg(&client->dev, "%s: %p\n", "get_datetime", client);
+
+	memset(buf, 0, sizeof(buf));
+
+	ret = i2c_transfer(client->adapter, msgs, 2);
+	if (ret == 2) {
+		dt->tm_year = buf[4] >> 6;
+		dt->tm_wday = buf[5] >> 5;
+
+		buf[4] &= 0x3f;
+		buf[5] &= 0x1f;
+
+		dt->tm_sec = BCD2BIN(buf[1]);
+		dt->tm_min = BCD2BIN(buf[2]);
+		dt->tm_hour = BCD2BIN(buf[3]);
+		dt->tm_mday = BCD2BIN(buf[4]);
+		dt->tm_mon = BCD2BIN(buf[5]) - 1;
+	}
+
+	return ret == 2 ? 0 : -EIO;
+}
+
+static int pcf8593_set_datetime(struct i2c_client *client, struct rtc_time *dt, int datetoo)
+{
+	unsigned char buf[8];
+	int ret, len = 6;
+
+	buf[0] = 0;
+	buf[1] = get_ctrl(client) | 0x80;
+	buf[2] = 0;
+	buf[3] = BIN2BCD(dt->tm_sec);
+	buf[4] = BIN2BCD(dt->tm_min);
+	buf[5] = BIN2BCD(dt->tm_hour);
+
+	dev_dbg(&client->dev, "%s: %p\n", "set_datetime", client);
+
+	if (datetoo) {
+		len = 8;
+		buf[6] = BIN2BCD(dt->tm_mday) | (dt->tm_year << 6);
+		buf[7] = BIN2BCD(dt->tm_mon + 1)  | (dt->tm_wday << 5);
+	}
+
+	ret = i2c_master_send(client, (char *)buf, len);
+	if (ret != len)
+		return -EIO;
+
+	buf[1] = get_ctrl(client);
+	ret = i2c_master_send(client, (char *)buf, 2);
+
+	return ret == 2 ? 0 : -EIO;
+}
+
+static int pcf8593_get_ctrl(struct i2c_client *client, unsigned char *ctrl)
+{
+	*ctrl = get_ctrl(client);
+	return 0;
+}
+
+static int pcf8593_set_ctrl(struct i2c_client *client, unsigned char *ctrl)
+{
+	unsigned char buf[2];
+
+	buf[0] = 0;
+	buf[1] = *ctrl;
+	set_ctrl(client, *ctrl);
+
+	return i2c_master_send(client, (char *)buf, 2);
+}
+
+static int pcf8593_read_mem(struct i2c_client *client, struct rtc_mem *mem)
+{
+	unsigned char addr[1];
+	struct i2c_msg msgs[2] = {
+		{
+			.addr = client->addr,
+			.flags = 0,
+			.len = 1,
+			.buf = addr,
+		}, {
+			.addr = client->addr,
+			.flags = I2C_M_RD,
+			.len = mem->nr,
+			.buf = mem->data,
+		}
+	};
+
+	dev_dbg(&client->dev, "%s: %p\n", "read_mem", client);
+
+	if (mem->loc < 8)
+		return -EINVAL;
+
+	addr[0] = mem->loc;
+
+	return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
+}
+
+static int pcf8593_write_mem(struct i2c_client *client, struct rtc_mem *mem)
+{
+	unsigned char addr[1];
+	struct i2c_msg msgs[2] = {
+		{
+			.addr = client->addr,
+			.flags = 0,
+			.len = 1,
+			.buf = addr,
+		}, {
+			.addr = client->addr,
+			.flags = I2C_M_NOSTART,
+			.len = mem->nr,
+			.buf = mem->data,
+		}
+	};
+
+	dev_dbg(&client->dev, "%s: %p\n", "write_mem", client);
+
+	if (mem->loc < 8)
+		return -EINVAL;
+
+	addr[0] = mem->loc;
+
+	return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
+}
+
+static int pcf8593_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	unsigned char ctrl, year[2];
+	struct rtc_mem mem = { CMOS_YEAR, sizeof(year), year };
+	int real_year, year_offset, err;
+
+	dev_dbg(&client->dev, "%s: %p\n", "read_time", client);
+	/*
+	 * Ensure that the RTC is running.
+	 */
+	pcf8593_get_ctrl(client, &ctrl);
+	if (ctrl & (CTRL_STOP | CTRL_HOLD)) {
+		unsigned char new_ctrl = ctrl & ~(CTRL_STOP | CTRL_HOLD);
+
+		printk(KERN_WARNING "RTC: resetting control %02x -> %02x\n",
+		       ctrl, new_ctrl);
+
+		if ((err = pcf8593_set_ctrl(client, &new_ctrl)) < 0)
+			return err;
+	}
+
+	if (pcf8593_get_datetime(client, tm) ||
+	    pcf8593_read_mem(client, &mem))
+		return -EIO;
+
+	real_year =  BCD2BIN(year[1]) * 100;
+	real_year += BCD2BIN(year[0]);
+
+	/*
+	 * The RTC year holds the LSB two bits of the current
+	 * year, which should reflect the LSB two bits of the
+	 * CMOS copy of the year.  Any difference indicates
+	 * that we have to correct the CMOS version.
+	 */
+	year_offset = tm->tm_year - (real_year & 3);
+	if (year_offset < 0)
+		/*
+		 * RTC year wrapped.  Adjust it appropriately.
+		 */
+		year_offset += 4;
+
+	tm->tm_year = (real_year) - 1900;
+
+	return 0;
+}
+
+static int pcf8593_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	unsigned char year[2], chk;
+	struct rtc_mem cmos_year  = { CMOS_YEAR, sizeof(year), year };
+	struct rtc_mem cmos_check = { CMOS_CHECKSUM, 1, &chk };
+	unsigned int proper_year = tm->tm_year + 1900;
+	int ret;
+
+	dev_dbg(&client->dev, "%s: %p\n", "set_time", client);
+	/*
+	 * The RTC's own 2-bit year must reflect the least
+	 * significant two bits of the CMOS year.
+	 */
+
+	ret = pcf8593_set_datetime(client, tm, 1);
+	if (ret)
+		return ret;
+
+	ret = pcf8593_read_mem(client, &cmos_check);
+	if (ret)
+		return ret;
+
+	ret = pcf8593_read_mem(client, &cmos_year);
+	if (ret)
+		return ret;
+
+	chk -= year[1] + year[0];
+
+	year[1] = proper_year / 100;
+	year[0] = proper_year % 100;
+
+	chk += year[1] + year[0];
+
+	ret = pcf8593_write_mem(client, &cmos_year);
+
+	if (ret)
+		return ret;
+
+	ret = pcf8593_write_mem(client, &cmos_check);
+
+	return ret;
+}
+
+static const struct rtc_class_ops pcf8593_rtc_ops = {
+	.read_time	= pcf8593_rtc_read_time,
+	.set_time	= pcf8593_rtc_set_time,
+};
+
+static ssize_t pcf8593_memory_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 pcf8593 *pcf = i2c_get_clientdata(client); */
+	return 0;
+}
+
+static ssize_t pcf8593_memory_write(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 pcf8593 *pcf = i2c_get_clientdata(client); */
+	return 0;
+}
+
+static struct bin_attribute memory_attr = {
+	.attr = {
+		.name = "memory",
+		.mode = S_IRUGO,
+	},
+	.size  = 64,
+	.read  = pcf8593_memory_read,
+	.write = pcf8593_memory_write,
+};
+
+static int pcf8593_detach(struct i2c_client *client)
+{
+	int err;
+	struct pcf8593 *pcf = i2c_get_clientdata(client);
+	struct rtc_device *rtc = pcf->rtc;
+
+	if (rtc)
+		rtc_device_unregister(rtc);
+
+	if ((err = i2c_detach_client(client)))
+		return err;
+
+	kfree(pcf);
+	return 0;
+}
+
+static int __devinit pcf8593_probe(struct i2c_client *client)
+{
+	struct pcf8593 *pcf;
+	struct rtc_device *rtc;
+	struct i2c_adapter	*adapter = to_i2c_adapter(client->dev.parent);
+	unsigned char buf[16], ad[1] = { 0 };
+	int err;
+	struct i2c_msg msgs[2] = {
+		{
+			.addr = client->addr,
+			.flags = 0,
+			.len = 1,
+			.buf = ad,
+		}, {
+			.addr = client->addr,
+			.flags = I2C_M_RD,
+			.len = 16,
+			.buf = buf,
+		}
+	};
+
+	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
+		return 0;
+
+	pcf = kzalloc(sizeof(*pcf), GFP_KERNEL);
+	if (!pcf)
+		return -ENOMEM;
+
+	pcf->client = client;
+	i2c_set_clientdata(client, pcf);
+
+	client->adapter	= adapter;
+	client->driver	= &pcf8593_driver;
+
+	strlcpy(client->name, pcf8593_driver.driver.name, I2C_NAME_SIZE);
+
+	if (i2c_transfer(client->adapter, msgs, 2) != 2) {
+		err = -EIO;
+		goto exit_kfree;
+	}
+
+	rtc = rtc_device_register(pcf8593_driver.driver.name, &client->dev,
+				  &pcf8593_rtc_ops, THIS_MODULE);
+
+	if (IS_ERR(rtc)) {
+		err = PTR_ERR(rtc);
+		goto exit_detach;
+	}
+
+	pcf->rtc = rtc;
+	set_ctrl(client, buf[0]);
+
+	err = sysfs_create_bin_file(&client->dev.kobj, &memory_attr);
+	return 0;
+
+exit_detach:
+	i2c_detach_client(client);
+
+exit_kfree:
+	kfree(pcf);
+
+	return err;
+}
+
+static struct i2c_driver pcf8593_driver = {
+	.driver = {
+		.name	= "rtc-pcf8593",
+		.owner	= THIS_MODULE,
+	},
+	.id		= I2C_DRIVERID_PCF8593,
+	.probe		= pcf8593_probe,
+	.remove		= pcf8593_detach,
+};
+
+static __init int pcf8593_init(void)
+{
+	return i2c_add_driver(&pcf8593_driver);
+}
+
+static __exit void pcf8593_exit(void)
+{
+	i2c_del_driver(&pcf8593_driver);
+}
+
+module_init(pcf8593_init);
+module_exit(pcf8593_exit);
+
+MODULE_AUTHOR("Jürgen Schindele");
+MODULE_DESCRIPTION("PCF8593 I2C RTC driver");
+MODULE_LICENSE("GPL");
diff -Nru linux-2.6.24/include/linux/i2c-id.h linux-2.6.24-patch/include/linux/i2c-id.h
--- linux-2.6.24/include/linux/i2c-id.h	2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24-patch/include/linux/i2c-id.h	2008-02-20 22:06:01.000000000 +0100
@@ -125,6 +125,7 @@
 #define I2C_DRIVERID_LM4857 	92 	/* LM4857 Audio Amplifier */
 #define I2C_DRIVERID_VP27SMPX	93	/* Panasonic VP27s tuner internal MPX */
 #define I2C_DRIVERID_CS4270	94	/* Cirrus Logic 4270 audio codec */
+#define I2C_DRIVERID_PCF8593	95	/* real time clock */
 
 #define I2C_DRIVERID_I2CDEV	900
 #define I2C_DRIVERID_ARP        902    /* SMBus ARP Client              */
