Skip to contentSkip to conversation

i2c: New Xicor X1205 RTC driver

PATCH New Greg KH 1 participant 1 message Oct 29, 2005 I2C

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 i2c: New Xicor X1205 RTC driver

[PATCH] i2c: New Xicor X1205 RTC driver

New driver for the Xicor X1205 RTC chip.

---
commit 4d4e5ce8648561b964699afb2df5e7268a84599b
tree 95d88cfc63db1e14cba71074a6108ed9a4b16737
parent ddec748f328af6b67e4d0ce0248a8e9f36751827
author Alessandro Zummo <[email protected]> Mon, 17 Oct 2005 23:04:42 +0200 committer Greg Kroah-Hartman <[email protected]> Fri, 28 Oct 2005 14:02:12 -0700

 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(+), 0 deletions(-)
Documentation/i2c/chips/x1205 new file +37 -0
new file mode 100644
index 0000000..09407c9
@@ -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
drivers/i2c/chips/Kconfig +9 -0
index 6bd44a4..f9fae28 100644
@@ -126,4 +126,13 @@ config SENSORS_MAX6875
 	  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
index a876dd4..46178b5 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591
 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
new file mode 100644
index 0000000..64fd3af
@@ -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__ */