diff options
| author | Alessandro Zummo <a.zummo@towertech.it> | 2006-03-27 04:16:37 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:51 -0500 |
| commit | 6fc7f10cee28c7fa190920fefda8c696d5bf3074 (patch) | |
| tree | 549dd6be7fb058bf404deae6f72cd01f9ec177b3 | |
| parent | 0c86edc0d4970649f39748c4ce4f2895f728468f (diff) | |
[PATCH] RTC subsystem: I2C cleanup
This patch, completely optional, removes from drivers/i2c/chips all the
drivers that are implemented in the new RTC subsystem.
It should be noted that none of the current driver is actually integrated,
i.e. usable without further patches.
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | drivers/i2c/chips/Kconfig | 18 | ||||
| -rw-r--r-- | drivers/i2c/chips/Makefile | 2 | ||||
| -rw-r--r-- | drivers/i2c/chips/rtc8564.c | 385 | ||||
| -rw-r--r-- | drivers/i2c/chips/rtc8564.h | 78 | ||||
| -rw-r--r-- | drivers/i2c/chips/x1205.c | 698 | ||||
| -rw-r--r-- | include/linux/x1205.h | 31 |
6 files changed, 0 insertions, 1212 deletions
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig index f9fae28f5612..7aa5c38f0855 100644 --- a/drivers/i2c/chips/Kconfig +++ b/drivers/i2c/chips/Kconfig | |||
| @@ -65,15 +65,6 @@ config SENSORS_PCF8591 | |||
| 65 | This driver can also be built as a module. If so, the module | 65 | This driver can also be built as a module. If so, the module |
| 66 | will be called pcf8591. | 66 | will be called pcf8591. |
| 67 | 67 | ||
| 68 | config SENSORS_RTC8564 | ||
| 69 | tristate "Epson 8564 RTC chip" | ||
| 70 | depends on I2C && EXPERIMENTAL | ||
| 71 | help | ||
| 72 | If you say yes here you get support for the Epson 8564 RTC chip. | ||
| 73 | |||
| 74 | This driver can also be built as a module. If so, the module | ||
| 75 | will be called i2c-rtc8564. | ||
| 76 | |||
| 77 | config ISP1301_OMAP | 68 | config ISP1301_OMAP |
| 78 | tristate "Philips ISP1301 with OMAP OTG" | 69 | tristate "Philips ISP1301 with OMAP OTG" |
| 79 | depends on I2C && ARCH_OMAP_OTG | 70 | depends on I2C && ARCH_OMAP_OTG |
| @@ -126,13 +117,4 @@ config SENSORS_MAX6875 | |||
| 126 | This driver can also be built as a module. If so, the module | 117 | This driver can also be built as a module. If so, the module |
| 127 | will be called max6875. | 118 | will be called max6875. |
| 128 | 119 | ||
| 129 | config RTC_X1205_I2C | ||
| 130 | tristate "Xicor X1205 RTC chip" | ||
| 131 | depends on I2C && EXPERIMENTAL | ||
| 132 | help | ||
| 133 | If you say yes here you get support for the Xicor X1205 RTC chip. | ||
| 134 | |||
| 135 | This driver can also be built as a module. If so, the module | ||
| 136 | will be called x1205. | ||
| 137 | |||
| 138 | endmenu | 120 | endmenu |
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 46178b57b1f1..779868ef2e26 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile | |||
| @@ -10,10 +10,8 @@ obj-$(CONFIG_SENSORS_M41T00) += m41t00.o | |||
| 10 | obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o | 10 | obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o |
| 11 | obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o | 11 | obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o |
| 12 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o | 12 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o |
| 13 | obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o | ||
| 14 | obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o | 13 | obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o |
| 15 | obj-$(CONFIG_TPS65010) += tps65010.o | 14 | obj-$(CONFIG_TPS65010) += tps65010.o |
| 16 | obj-$(CONFIG_RTC_X1205_I2C) += x1205.o | ||
| 17 | 15 | ||
| 18 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) | 16 | ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) |
| 19 | EXTRA_CFLAGS += -DDEBUG | 17 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/i2c/chips/rtc8564.c b/drivers/i2c/chips/rtc8564.c deleted file mode 100644 index 0d8699b3f488..000000000000 --- a/drivers/i2c/chips/rtc8564.c +++ /dev/null | |||
| @@ -1,385 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/drivers/i2c/chips/rtc8564.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002-2004 Stefan Eletzhofer | ||
| 5 | * | ||
| 6 | * based on linux/drivers/acron/char/pcf8583.c | ||
| 7 | * Copyright (C) 2000 Russell King | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * Driver for system3's EPSON RTC 8564 chip | ||
| 14 | */ | ||
| 15 | #include <linux/module.h> | ||
| 16 | #include <linux/kernel.h> | ||
| 17 | #include <linux/bcd.h> | ||
| 18 | #include <linux/i2c.h> | ||
| 19 | #include <linux/slab.h> | ||
| 20 | #include <linux/string.h> | ||
| 21 | #include <linux/rtc.h> /* get the user-level API */ | ||
| 22 | #include <linux/init.h> | ||
| 23 | |||
| 24 | #include "rtc8564.h" | ||
| 25 | |||
| 26 | #ifdef DEBUG | ||
| 27 | # define _DBG(x, fmt, args...) do{ if (debug>=x) printk(KERN_DEBUG"%s: " fmt "\n", __FUNCTION__, ##args); } while(0); | ||
| 28 | #else | ||
| 29 | # define _DBG(x, fmt, args...) do { } while(0); | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #define _DBGRTCTM(x, rtctm) if (debug>=x) printk("%s: secs=%d, mins=%d, hours=%d, mday=%d, " \ | ||
| 33 | "mon=%d, year=%d, wday=%d VL=%d\n", __FUNCTION__, \ | ||
| 34 | (rtctm).secs, (rtctm).mins, (rtctm).hours, (rtctm).mday, \ | ||
| 35 | (rtctm).mon, (rtctm).year, (rtctm).wday, (rtctm).vl); | ||
| 36 | |||
| 37 | struct rtc8564_data { | ||
| 38 | struct i2c_client client; | ||
| 39 | u16 ctrl; | ||
| 40 | }; | ||
| 41 | |||
| 42 | static inline u8 _rtc8564_ctrl1(struct i2c_client *client) | ||
| 43 | { | ||
| 44 | struct rtc8564_data *data = i2c_get_clientdata(client); | ||
| 45 | return data->ctrl & 0xff; | ||
| 46 | } | ||
| 47 | static inline u8 _rtc8564_ctrl2(struct i2c_client *client) | ||
| 48 | { | ||
| 49 | struct rtc8564_data *data = i2c_get_clientdata(client); | ||
| 50 | return (data->ctrl & 0xff00) >> 8; | ||
| 51 | } | ||
| 52 | |||
| 53 | #define CTRL1(c) _rtc8564_ctrl1(c) | ||
| 54 | #define CTRL2(c) _rtc8564_ctrl2(c) | ||
| 55 | |||
| 56 | static int debug; | ||
| 57 | module_param(debug, int, S_IRUGO | S_IWUSR); | ||
| 58 | |||
| 59 | static struct i2c_driver rtc8564_driver; | ||
| 60 | |||
| 61 | static unsigned short ignore[] = { I2C_CLIENT_END }; | ||
| 62 | static unsigned short normal_addr[] = { 0x51, I2C_CLIENT_END }; | ||
| 63 | |||
| 64 | static struct i2c_client_address_data addr_data = { | ||
| 65 | .normal_i2c = normal_addr, | ||
| 66 | .probe = ignore, | ||
| 67 | .ignore = ignore, | ||
| 68 | }; | ||
| 69 | |||
| 70 | static int rtc8564_read_mem(struct i2c_client *client, struct mem *mem); | ||
| 71 | static int rtc8564_write_mem(struct i2c_client *client, struct mem *mem); | ||
| 72 | |||
| 73 | static int rtc8564_read(struct i2c_client *client, unsigned char adr, | ||
| 74 | unsigned char *buf, unsigned char len) | ||
| 75 | { | ||
| 76 | int ret = -EIO; | ||
| 77 | unsigned char addr[1] = { adr }; | ||
| 78 | struct i2c_msg msgs[2] = { | ||
| 79 | {client->addr, 0, 1, addr}, | ||
| 80 | {client->addr, I2C_M_RD, len, buf} | ||
| 81 | }; | ||
| 82 | |||
| 83 | _DBG(1, "client=%p, adr=%d, buf=%p, len=%d", client, adr, buf, len); | ||
| 84 | |||
| 85 | if (!buf) { | ||
| 86 | ret = -EINVAL; | ||
| 87 | goto done; | ||
| 88 | } | ||
| 89 | |||
| 90 | ret = i2c_transfer(client->adapter, msgs, 2); | ||
| 91 | if (ret == 2) { | ||
| 92 | ret = 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | done: | ||
| 96 | return ret; | ||
| 97 | } | ||
| 98 | |||
| 99 | static int rtc8564_write(struct i2c_client *client, unsigned char adr, | ||
| 100 | unsigned char *data, unsigned char len) | ||
| 101 | { | ||
| 102 | int ret = 0; | ||
| 103 | unsigned char _data[16]; | ||
| 104 | struct i2c_msg wr; | ||
| 105 | int i; | ||
| 106 | |||
| 107 | if (!data || len > 15) { | ||
| 108 | ret = -EINVAL; | ||
| 109 | goto done; | ||
| 110 | } | ||
| 111 | |||
| 112 | _DBG(1, "client=%p, adr=%d, buf=%p, len=%d", client, adr, data, len); | ||
| 113 | |||
| 114 | _data[0] = adr; | ||
| 115 | for (i = 0; i < len; i++) { | ||
| 116 | _data[i + 1] = data[i]; | ||
| 117 | _DBG(5, "data[%d] = 0x%02x (%d)", i, data[i], data[i]); | ||
| 118 | } | ||
| 119 | |||
| 120 | wr.addr = client->addr; | ||
| 121 | wr.flags = 0; | ||
| 122 | wr.len = len + 1; | ||
| 123 | wr.buf = _data; | ||
| 124 | |||
| 125 | ret = i2c_transfer(client->adapter, &wr, 1); | ||
| 126 | if (ret == 1) { | ||
| 127 | ret = 0; | ||
| 128 | } | ||
| 129 | |||
| 130 | done: | ||
| 131 | return ret; | ||
| 132 | } | ||
| 133 | |||
| 134 | static int rtc8564_attach(struct i2c_adapter *adap, int addr, int kind) | ||
| 135 | { | ||
| 136 | int ret; | ||
| 137 | struct i2c_client *new_client; | ||
| 138 | struct rtc8564_data *d; | ||
