Skip to contentSkip to conversation

i2c: New Xicor X1205 RTC driver

PATCH New Jean Delvare 1 participant 1 message Oct 17, 2005 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 8/14 i2c: New Xicor X1205 RTC driver

From: Alessandro Zummo <[email protected]>
Content-Disposition: inline; filename=i2c-x1205.patch

New driver for the Xicor X1205 RTC chip.

---
 Documentation/i2c/chips/x1205 |   38 ++
 drivers/i2c/chips/Kconfig     |    9 +
 drivers/i2c/chips/Makefile    |    1 +
 drivers/i2c/chips/x1205.c     |  698 +++++++++++++++++++++++++++++++++++++++++
 include/linux/x1205.h         |   31 ++
 5 files changed, 777 insertions(+)
drivers/i2c/chips/Kconfig +9 -0
@@ -126,4 +126,13 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called max6875.
 
+config RTC_X1205_I2C
+	tristate "Xicor X1205 RTC chip"
+	depends on I2C && EXPERIMENTAL
+	help
+	  If you say yes here you get support for the Xicor X1205 RTC chip.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called x1205.
+
 endmenu
drivers/i2c/chips/Makefile +1 -0
@@ -13,6 +13,7 @@
 obj-$(CONFIG_SENSORS_RTC8564)	+= rtc8564.o
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
+obj-$(CONFIG_RTC_X1205_I2C)	+= x1205.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/i2c/chips/x1205.c new file +697 -0

697 lines not on this page · raw message

include/linux/x1205.h new file +31 -0
@@ -0,0 +1,31 @@
+/*
+ *  x1205.h - defines for drivers/i2c/chips/x1205.c
+ *  Copyright 2004 Karen Spearel
+ *  Copyright 2005 Alessandro Zummo
+ *
+ *  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.
+ */
+
+#ifndef __LINUX_X1205_H__
+#define __LINUX_X1205_H__
+
+/* commands */
+
+#define X1205_CMD_GETDATETIME	0
+#define X1205_CMD_SETTIME	1
+#define X1205_CMD_SETDATETIME	2
+#define X1205_CMD_GETALARM	3
+#define X1205_CMD_SETALARM	4
+#define X1205_CMD_GETDTRIM	5
+#define X1205_CMD_SETDTRIM	6
+#define X1205_CMD_GETATRIM	7
+#define X1205_CMD_SETATRIM	8
+
+extern int x1205_do_command(unsigned int cmd, void *arg);
+extern int x1205_direct_attach(int adapter_id,
+	struct i2c_client_address_data *address_data);
+
+#endif /* __LINUX_X1205_H__ */
Documentation/i2c/chips/x1205 new file +37 -0
@@ -0,0 +1,38 @@
+Kernel driver x1205
+=========+
+Supported chips:
+  * Xicor X1205 RTC
+    Prefix: 'x1205'
+    Addresses scanned: none
+    Datasheet: http://www.intersil.com/cda/deviceinfo/0,1477,X1205,00.html
+
+Authors:
+	Karen Spearel <[email protected]>,
+	Alessandro Zummo <[email protected]>
+
+Description
+-----------
+
+This module aims to provide complete access to the Xicor X1205 RTC.
+Recently Xicor has merged with Intersil, but the chip is
+still sold under the Xicor brand.
+
+This chip is located at address 0x6f and uses a 2-byte register addressing.
+Two bytes need to be written to read a single register, while most
+other chips just require one and take the second one as the data
+to be written. To prevent corrupting unknown chips, the user must
+explicitely set the probe parameter.
+
+example:
+
+modprobe x1205 probe=0,0x6f
+
+The module supports one more option, hctosys, which is used to set the
+software clock from the x1205. On systems where the x1205 is the
+only hardware rtc, this parameter could be used to achieve a correct
+date/time earlier in the system boot sequence.
+
+example:
+
+modprobe x1205 probe=0,0x6f hctosys=1
Signature · 1 line
Jean Delvare