eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 1 | /* |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 2 | * pca953x.c - 4/8/16 bit I/O ports |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005 Ben Gardner <bgardner@wabtec.com> |
| 5 | * Copyright (C) 2007 Marvell International Ltd. |
| 6 | * |
| 7 | * Derived from drivers/i2c/chips/pca9539.c |
| 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 as published by |
| 11 | * the Free Software Foundation; version 2 of the License. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/module.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/i2c.h> |
Guennadi Liakhovetski | d1c057e3 | 2008-02-06 01:39:02 -0800 | [diff] [blame] | 17 | #include <linux/i2c/pca953x.h> |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 18 | |
| 19 | #include <asm/gpio.h> |
| 20 | |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 21 | #define PCA953X_INPUT 0 |
| 22 | #define PCA953X_OUTPUT 1 |
| 23 | #define PCA953X_INVERT 2 |
| 24 | #define PCA953X_DIRECTION 3 |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 25 | |
Jean Delvare | 3760f73 | 2008-04-29 23:11:40 +0200 | [diff] [blame] | 26 | static const struct i2c_device_id pca953x_id[] = { |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 27 | { "pca9534", 8, }, |
| 28 | { "pca9535", 16, }, |
| 29 | { "pca9536", 4, }, |
| 30 | { "pca9537", 4, }, |
| 31 | { "pca9538", 8, }, |
| 32 | { "pca9539", 16, }, |
David Brownell | 69292b3 | 2008-05-23 13:04:42 -0700 | [diff] [blame] | 33 | { "pca9554", 8, }, |
Will Newton | f39e578 | 2008-05-01 04:35:10 -0700 | [diff] [blame] | 34 | { "pca9555", 16, }, |
| 35 | { "pca9557", 8, }, |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 36 | |
David Brownell | 7059d4b | 2008-07-04 09:59:37 -0700 | [diff] [blame] | 37 | { "max7310", 8, }, |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 38 | { "pca6107", 8, }, |
| 39 | { "tca6408", 8, }, |
| 40 | { "tca6416", 16, }, |
| 41 | /* NYET: { "tca6424", 24, }, */ |
Jean Delvare | 3760f73 | 2008-04-29 23:11:40 +0200 | [diff] [blame] | 42 | { } |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 43 | }; |
Jean Delvare | 3760f73 | 2008-04-29 23:11:40 +0200 | [diff] [blame] | 44 | MODULE_DEVICE_TABLE(i2c, pca953x_id); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 45 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 46 | struct pca953x_chip { |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 47 | unsigned gpio_start; |
| 48 | uint16_t reg_output; |
| 49 | uint16_t reg_direction; |
| 50 | |
| 51 | struct i2c_client *client; |
| 52 | struct gpio_chip gpio_chip; |
Daniel Silverstone | 77906a54 | 2009-06-17 16:26:15 -0700 | [diff] [blame^] | 53 | char **names; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 54 | }; |
| 55 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 56 | static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 57 | { |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 58 | int ret; |
| 59 | |
| 60 | if (chip->gpio_chip.ngpio <= 8) |
| 61 | ret = i2c_smbus_write_byte_data(chip->client, reg, val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 62 | else |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 63 | ret = i2c_smbus_write_word_data(chip->client, reg << 1, val); |
| 64 | |
| 65 | if (ret < 0) { |
| 66 | dev_err(&chip->client->dev, "failed writing register\n"); |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 67 | return ret; |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | return 0; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 71 | } |
| 72 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 73 | static int pca953x_read_reg(struct pca953x_chip *chip, int reg, uint16_t *val) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 74 | { |
| 75 | int ret; |
| 76 | |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 77 | if (chip->gpio_chip.ngpio <= 8) |
| 78 | ret = i2c_smbus_read_byte_data(chip->client, reg); |
| 79 | else |
| 80 | ret = i2c_smbus_read_word_data(chip->client, reg << 1); |
| 81 | |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 82 | if (ret < 0) { |
| 83 | dev_err(&chip->client->dev, "failed reading register\n"); |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 84 | return ret; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | *val = (uint16_t)ret; |
| 88 | return 0; |
| 89 | } |
| 90 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 91 | static int pca953x_gpio_direction_input(struct gpio_chip *gc, unsigned off) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 92 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 93 | struct pca953x_chip *chip; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 94 | uint16_t reg_val; |
| 95 | int ret; |
| 96 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 97 | chip = container_of(gc, struct pca953x_chip, gpio_chip); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 98 | |
| 99 | reg_val = chip->reg_direction | (1u << off); |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 100 | ret = pca953x_write_reg(chip, PCA953X_DIRECTION, reg_val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 101 | if (ret) |
| 102 | return ret; |
| 103 | |
| 104 | chip->reg_direction = reg_val; |
| 105 | return 0; |
| 106 | } |
| 107 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 108 | static int pca953x_gpio_direction_output(struct gpio_chip *gc, |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 109 | unsigned off, int val) |
| 110 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 111 | struct pca953x_chip *chip; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 112 | uint16_t reg_val; |
| 113 | int ret; |
| 114 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 115 | chip = container_of(gc, struct pca953x_chip, gpio_chip); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 116 | |
| 117 | /* set output level */ |
| 118 | if (val) |
| 119 | reg_val = chip->reg_output | (1u << off); |
| 120 | else |
| 121 | reg_val = chip->reg_output & ~(1u << off); |
| 122 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 123 | ret = pca953x_write_reg(chip, PCA953X_OUTPUT, reg_val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 124 | if (ret) |
| 125 | return ret; |
| 126 | |
| 127 | chip->reg_output = reg_val; |
| 128 | |
| 129 | /* then direction */ |
| 130 | reg_val = chip->reg_direction & ~(1u << off); |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 131 | ret = pca953x_write_reg(chip, PCA953X_DIRECTION, reg_val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 132 | if (ret) |
| 133 | return ret; |
| 134 | |
| 135 | chip->reg_direction = reg_val; |
| 136 | return 0; |
| 137 | } |
| 138 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 139 | static int pca953x_gpio_get_value(struct gpio_chip *gc, unsigned off) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 140 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 141 | struct pca953x_chip *chip; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 142 | uint16_t reg_val; |
| 143 | int ret; |
| 144 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 145 | chip = container_of(gc, struct pca953x_chip, gpio_chip); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 146 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 147 | ret = pca953x_read_reg(chip, PCA953X_INPUT, ®_val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 148 | if (ret < 0) { |
| 149 | /* NOTE: diagnostic already emitted; that's all we should |
| 150 | * do unless gpio_*_value_cansleep() calls become different |
| 151 | * from their nonsleeping siblings (and report faults). |
| 152 | */ |
| 153 | return 0; |
| 154 | } |
| 155 | |
| 156 | return (reg_val & (1u << off)) ? 1 : 0; |
| 157 | } |
| 158 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 159 | static void pca953x_gpio_set_value(struct gpio_chip *gc, unsigned off, int val) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 160 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 161 | struct pca953x_chip *chip; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 162 | uint16_t reg_val; |
| 163 | int ret; |
| 164 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 165 | chip = container_of(gc, struct pca953x_chip, gpio_chip); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 166 | |
| 167 | if (val) |
| 168 | reg_val = chip->reg_output | (1u << off); |
| 169 | else |
| 170 | reg_val = chip->reg_output & ~(1u << off); |
| 171 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 172 | ret = pca953x_write_reg(chip, PCA953X_OUTPUT, reg_val); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 173 | if (ret) |
| 174 | return; |
| 175 | |
| 176 | chip->reg_output = reg_val; |
| 177 | } |
| 178 | |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 179 | static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 180 | { |
| 181 | struct gpio_chip *gc; |
| 182 | |
| 183 | gc = &chip->gpio_chip; |
| 184 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 185 | gc->direction_input = pca953x_gpio_direction_input; |
| 186 | gc->direction_output = pca953x_gpio_direction_output; |
| 187 | gc->get = pca953x_gpio_get_value; |
| 188 | gc->set = pca953x_gpio_set_value; |
Arnaud Patard | 8420780 | 2008-03-10 11:43:48 -0700 | [diff] [blame] | 189 | gc->can_sleep = 1; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 190 | |
| 191 | gc->base = chip->gpio_start; |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 192 | gc->ngpio = gpios; |
| 193 | gc->label = chip->client->name; |
David Brownell | d8f388d | 2008-07-25 01:46:07 -0700 | [diff] [blame] | 194 | gc->dev = &chip->client->dev; |
Guennadi Liakhovetski | d72cbed | 2008-04-28 02:14:45 -0700 | [diff] [blame] | 195 | gc->owner = THIS_MODULE; |
Daniel Silverstone | 77906a54 | 2009-06-17 16:26:15 -0700 | [diff] [blame^] | 196 | gc->names = chip->names; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 197 | } |
| 198 | |
Jean Delvare | d2653e9 | 2008-04-29 23:11:39 +0200 | [diff] [blame] | 199 | static int __devinit pca953x_probe(struct i2c_client *client, |
Jean Delvare | 3760f73 | 2008-04-29 23:11:40 +0200 | [diff] [blame] | 200 | const struct i2c_device_id *id) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 201 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 202 | struct pca953x_platform_data *pdata; |
| 203 | struct pca953x_chip *chip; |
Will Newton | f39e578 | 2008-05-01 04:35:10 -0700 | [diff] [blame] | 204 | int ret; |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 205 | |
| 206 | pdata = client->dev.platform_data; |
Ben Dooks | a342d21 | 2009-01-15 13:50:45 -0800 | [diff] [blame] | 207 | if (pdata == NULL) { |
| 208 | dev_dbg(&client->dev, "no platform data\n"); |
| 209 | return -EINVAL; |
| 210 | } |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 211 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 212 | chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 213 | if (chip == NULL) |
| 214 | return -ENOMEM; |
| 215 | |
| 216 | chip->client = client; |
| 217 | |
| 218 | chip->gpio_start = pdata->gpio_base; |
| 219 | |
Daniel Silverstone | 77906a54 | 2009-06-17 16:26:15 -0700 | [diff] [blame^] | 220 | chip->names = pdata->names; |
| 221 | |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 222 | /* initialize cached registers from their original values. |
| 223 | * we can't share this chip with another i2c master. |
| 224 | */ |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 225 | pca953x_setup_gpio(chip, id->driver_data); |
| 226 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 227 | ret = pca953x_read_reg(chip, PCA953X_OUTPUT, &chip->reg_output); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 228 | if (ret) |
| 229 | goto out_failed; |
| 230 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 231 | ret = pca953x_read_reg(chip, PCA953X_DIRECTION, &chip->reg_direction); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 232 | if (ret) |
| 233 | goto out_failed; |
| 234 | |
| 235 | /* set platform specific polarity inversion */ |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 236 | ret = pca953x_write_reg(chip, PCA953X_INVERT, pdata->invert); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 237 | if (ret) |
| 238 | goto out_failed; |
| 239 | |
Guennadi Liakhovetski | f5e8ff4 | 2008-02-06 01:39:04 -0800 | [diff] [blame] | 240 | |
| 241 | ret = gpiochip_add(&chip->gpio_chip); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 242 | if (ret) |
| 243 | goto out_failed; |
| 244 | |
| 245 | if (pdata->setup) { |
| 246 | ret = pdata->setup(client, chip->gpio_chip.base, |
| 247 | chip->gpio_chip.ngpio, pdata->context); |
| 248 | if (ret < 0) |
| 249 | dev_warn(&client->dev, "setup failed, %d\n", ret); |
| 250 | } |
| 251 | |
| 252 | i2c_set_clientdata(client, chip); |
| 253 | return 0; |
| 254 | |
| 255 | out_failed: |
| 256 | kfree(chip); |
| 257 | return ret; |
| 258 | } |
| 259 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 260 | static int pca953x_remove(struct i2c_client *client) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 261 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 262 | struct pca953x_platform_data *pdata = client->dev.platform_data; |
| 263 | struct pca953x_chip *chip = i2c_get_clientdata(client); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 264 | int ret = 0; |
| 265 | |
| 266 | if (pdata->teardown) { |
| 267 | ret = pdata->teardown(client, chip->gpio_chip.base, |
| 268 | chip->gpio_chip.ngpio, pdata->context); |
| 269 | if (ret < 0) { |
| 270 | dev_err(&client->dev, "%s failed, %d\n", |
| 271 | "teardown", ret); |
| 272 | return ret; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | ret = gpiochip_remove(&chip->gpio_chip); |
| 277 | if (ret) { |
| 278 | dev_err(&client->dev, "%s failed, %d\n", |
| 279 | "gpiochip_remove()", ret); |
| 280 | return ret; |
| 281 | } |
| 282 | |
| 283 | kfree(chip); |
| 284 | return 0; |
| 285 | } |
| 286 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 287 | static struct i2c_driver pca953x_driver = { |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 288 | .driver = { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 289 | .name = "pca953x", |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 290 | }, |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 291 | .probe = pca953x_probe, |
| 292 | .remove = pca953x_remove, |
Jean Delvare | 3760f73 | 2008-04-29 23:11:40 +0200 | [diff] [blame] | 293 | .id_table = pca953x_id, |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 294 | }; |
| 295 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 296 | static int __init pca953x_init(void) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 297 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 298 | return i2c_add_driver(&pca953x_driver); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 299 | } |
David Brownell | 2f8d119 | 2008-10-15 22:03:13 -0700 | [diff] [blame] | 300 | /* register after i2c postcore initcall and before |
| 301 | * subsys initcalls that may rely on these GPIOs |
| 302 | */ |
| 303 | subsys_initcall(pca953x_init); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 304 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 305 | static void __exit pca953x_exit(void) |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 306 | { |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 307 | i2c_del_driver(&pca953x_driver); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 308 | } |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 309 | module_exit(pca953x_exit); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 310 | |
| 311 | MODULE_AUTHOR("eric miao <eric.miao@marvell.com>"); |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 312 | MODULE_DESCRIPTION("GPIO expander driver for PCA953x"); |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 313 | MODULE_LICENSE("GPL"); |