Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 1 | /* |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 2 | * SPI driver for Micrel/Kendin KS8995M and KSZ8864RMN ethernet switches |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2008 Gabor Juhos <juhosg at openwrt.org> |
| 5 | * |
| 6 | * This file was based on: drivers/spi/at25.c |
| 7 | * Copyright (C) 2006 David Brownell |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License version 2 as published |
| 11 | * by the Free Software Foundation. |
| 12 | */ |
| 13 | |
Joe Perches | 8d24248 | 2012-06-09 07:49:07 +0000 | [diff] [blame] | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 15 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 16 | #include <linux/types.h> |
| 17 | #include <linux/kernel.h> |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 18 | #include <linux/module.h> |
| 19 | #include <linux/delay.h> |
| 20 | #include <linux/device.h> |
| 21 | |
| 22 | #include <linux/spi/spi.h> |
| 23 | |
| 24 | #define DRV_VERSION "0.1.1" |
| 25 | #define DRV_DESC "Micrel KS8995 Ethernet switch SPI driver" |
| 26 | |
| 27 | /* ------------------------------------------------------------------------ */ |
| 28 | |
| 29 | #define KS8995_REG_ID0 0x00 /* Chip ID0 */ |
| 30 | #define KS8995_REG_ID1 0x01 /* Chip ID1 */ |
| 31 | |
| 32 | #define KS8995_REG_GC0 0x02 /* Global Control 0 */ |
| 33 | #define KS8995_REG_GC1 0x03 /* Global Control 1 */ |
| 34 | #define KS8995_REG_GC2 0x04 /* Global Control 2 */ |
| 35 | #define KS8995_REG_GC3 0x05 /* Global Control 3 */ |
| 36 | #define KS8995_REG_GC4 0x06 /* Global Control 4 */ |
| 37 | #define KS8995_REG_GC5 0x07 /* Global Control 5 */ |
| 38 | #define KS8995_REG_GC6 0x08 /* Global Control 6 */ |
| 39 | #define KS8995_REG_GC7 0x09 /* Global Control 7 */ |
| 40 | #define KS8995_REG_GC8 0x0a /* Global Control 8 */ |
| 41 | #define KS8995_REG_GC9 0x0b /* Global Control 9 */ |
| 42 | |
| 43 | #define KS8995_REG_PC(p, r) ((0x10 * p) + r) /* Port Control */ |
| 44 | #define KS8995_REG_PS(p, r) ((0x10 * p) + r + 0xe) /* Port Status */ |
| 45 | |
| 46 | #define KS8995_REG_TPC0 0x60 /* TOS Priority Control 0 */ |
| 47 | #define KS8995_REG_TPC1 0x61 /* TOS Priority Control 1 */ |
| 48 | #define KS8995_REG_TPC2 0x62 /* TOS Priority Control 2 */ |
| 49 | #define KS8995_REG_TPC3 0x63 /* TOS Priority Control 3 */ |
| 50 | #define KS8995_REG_TPC4 0x64 /* TOS Priority Control 4 */ |
| 51 | #define KS8995_REG_TPC5 0x65 /* TOS Priority Control 5 */ |
| 52 | #define KS8995_REG_TPC6 0x66 /* TOS Priority Control 6 */ |
| 53 | #define KS8995_REG_TPC7 0x67 /* TOS Priority Control 7 */ |
| 54 | |
| 55 | #define KS8995_REG_MAC0 0x68 /* MAC address 0 */ |
| 56 | #define KS8995_REG_MAC1 0x69 /* MAC address 1 */ |
| 57 | #define KS8995_REG_MAC2 0x6a /* MAC address 2 */ |
| 58 | #define KS8995_REG_MAC3 0x6b /* MAC address 3 */ |
| 59 | #define KS8995_REG_MAC4 0x6c /* MAC address 4 */ |
| 60 | #define KS8995_REG_MAC5 0x6d /* MAC address 5 */ |
| 61 | |
| 62 | #define KS8995_REG_IAC0 0x6e /* Indirect Access Control 0 */ |
| 63 | #define KS8995_REG_IAC1 0x6f /* Indirect Access Control 0 */ |
| 64 | #define KS8995_REG_IAD7 0x70 /* Indirect Access Data 7 */ |
| 65 | #define KS8995_REG_IAD6 0x71 /* Indirect Access Data 6 */ |
| 66 | #define KS8995_REG_IAD5 0x72 /* Indirect Access Data 5 */ |
| 67 | #define KS8995_REG_IAD4 0x73 /* Indirect Access Data 4 */ |
| 68 | #define KS8995_REG_IAD3 0x74 /* Indirect Access Data 3 */ |
| 69 | #define KS8995_REG_IAD2 0x75 /* Indirect Access Data 2 */ |
| 70 | #define KS8995_REG_IAD1 0x76 /* Indirect Access Data 1 */ |
| 71 | #define KS8995_REG_IAD0 0x77 /* Indirect Access Data 0 */ |
| 72 | |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 73 | #define KSZ8864_REG_ID1 0xfe /* Chip ID in bit 7 */ |
| 74 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 75 | #define KS8995_REGS_SIZE 0x80 |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 76 | #define KSZ8864_REGS_SIZE 0x100 |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 77 | |
| 78 | #define ID1_CHIPID_M 0xf |
| 79 | #define ID1_CHIPID_S 4 |
| 80 | #define ID1_REVISION_M 0x7 |
| 81 | #define ID1_REVISION_S 1 |
| 82 | #define ID1_START_SW 1 /* start the switch */ |
| 83 | |
| 84 | #define FAMILY_KS8995 0x95 |
| 85 | #define CHIPID_M 0 |
| 86 | |
| 87 | #define KS8995_CMD_WRITE 0x02U |
| 88 | #define KS8995_CMD_READ 0x03U |
| 89 | |
| 90 | #define KS8995_RESET_DELAY 10 /* usec */ |
| 91 | |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 92 | enum ks8995_chip_variant { |
| 93 | ks8995, |
| 94 | ksz8864, |
| 95 | max_variant |
| 96 | }; |
| 97 | |
| 98 | struct ks8995_chip_params { |
| 99 | char *name; |
| 100 | int regs_size; |
| 101 | }; |
| 102 | |
| 103 | static const struct ks8995_chip_params ks8995_chip[] = { |
| 104 | [ks8995] = { |
| 105 | .name = "KS8995MA", |
| 106 | .regs_size = KS8995_REGS_SIZE, |
| 107 | }, |
| 108 | [ksz8864] = { |
| 109 | .name = "KSZ8864RMN", |
| 110 | .regs_size = KSZ8864_REGS_SIZE, |
| 111 | }, |
| 112 | }; |
| 113 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 114 | struct ks8995_pdata { |
| 115 | /* not yet implemented */ |
| 116 | }; |
| 117 | |
| 118 | struct ks8995_switch { |
| 119 | struct spi_device *spi; |
| 120 | struct mutex lock; |
| 121 | struct ks8995_pdata *pdata; |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 122 | struct bin_attribute regs_attr; |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 123 | const struct ks8995_chip_params *chip; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 124 | }; |
| 125 | |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 126 | static const struct spi_device_id ks8995_id[] = { |
| 127 | {"ks8995", ks8995}, |
| 128 | {"ksz8864", ksz8864}, |
| 129 | { } |
| 130 | }; |
| 131 | MODULE_DEVICE_TABLE(spi, ks8995_id); |
| 132 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 133 | static inline u8 get_chip_id(u8 val) |
| 134 | { |
| 135 | return (val >> ID1_CHIPID_S) & ID1_CHIPID_M; |
| 136 | } |
| 137 | |
| 138 | static inline u8 get_chip_rev(u8 val) |
| 139 | { |
| 140 | return (val >> ID1_REVISION_S) & ID1_REVISION_M; |
| 141 | } |
| 142 | |
| 143 | /* ------------------------------------------------------------------------ */ |
| 144 | static int ks8995_read(struct ks8995_switch *ks, char *buf, |
| 145 | unsigned offset, size_t count) |
| 146 | { |
| 147 | u8 cmd[2]; |
| 148 | struct spi_transfer t[2]; |
| 149 | struct spi_message m; |
| 150 | int err; |
| 151 | |
| 152 | spi_message_init(&m); |
| 153 | |
| 154 | memset(&t, 0, sizeof(t)); |
| 155 | |
| 156 | t[0].tx_buf = cmd; |
| 157 | t[0].len = sizeof(cmd); |
| 158 | spi_message_add_tail(&t[0], &m); |
| 159 | |
| 160 | t[1].rx_buf = buf; |
| 161 | t[1].len = count; |
| 162 | spi_message_add_tail(&t[1], &m); |
| 163 | |
| 164 | cmd[0] = KS8995_CMD_READ; |
| 165 | cmd[1] = offset; |
| 166 | |
| 167 | mutex_lock(&ks->lock); |
| 168 | err = spi_sync(ks->spi, &m); |
| 169 | mutex_unlock(&ks->lock); |
| 170 | |
| 171 | return err ? err : count; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | static int ks8995_write(struct ks8995_switch *ks, char *buf, |
| 176 | unsigned offset, size_t count) |
| 177 | { |
| 178 | u8 cmd[2]; |
| 179 | struct spi_transfer t[2]; |
| 180 | struct spi_message m; |
| 181 | int err; |
| 182 | |
| 183 | spi_message_init(&m); |
| 184 | |
| 185 | memset(&t, 0, sizeof(t)); |
| 186 | |
| 187 | t[0].tx_buf = cmd; |
| 188 | t[0].len = sizeof(cmd); |
| 189 | spi_message_add_tail(&t[0], &m); |
| 190 | |
| 191 | t[1].tx_buf = buf; |
| 192 | t[1].len = count; |
| 193 | spi_message_add_tail(&t[1], &m); |
| 194 | |
| 195 | cmd[0] = KS8995_CMD_WRITE; |
| 196 | cmd[1] = offset; |
| 197 | |
| 198 | mutex_lock(&ks->lock); |
| 199 | err = spi_sync(ks->spi, &m); |
| 200 | mutex_unlock(&ks->lock); |
| 201 | |
| 202 | return err ? err : count; |
| 203 | } |
| 204 | |
| 205 | static inline int ks8995_read_reg(struct ks8995_switch *ks, u8 addr, u8 *buf) |
| 206 | { |
Florian Fainelli | 7aff967 | 2013-12-17 21:38:13 -0800 | [diff] [blame] | 207 | return ks8995_read(ks, buf, addr, 1) != 1; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | static inline int ks8995_write_reg(struct ks8995_switch *ks, u8 addr, u8 val) |
| 211 | { |
| 212 | char buf = val; |
| 213 | |
Florian Fainelli | 7aff967 | 2013-12-17 21:38:13 -0800 | [diff] [blame] | 214 | return ks8995_write(ks, &buf, addr, 1) != 1; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | /* ------------------------------------------------------------------------ */ |
| 218 | |
| 219 | static int ks8995_stop(struct ks8995_switch *ks) |
| 220 | { |
| 221 | return ks8995_write_reg(ks, KS8995_REG_ID1, 0); |
| 222 | } |
| 223 | |
| 224 | static int ks8995_start(struct ks8995_switch *ks) |
| 225 | { |
| 226 | return ks8995_write_reg(ks, KS8995_REG_ID1, 1); |
| 227 | } |
| 228 | |
| 229 | static int ks8995_reset(struct ks8995_switch *ks) |
| 230 | { |
| 231 | int err; |
| 232 | |
| 233 | err = ks8995_stop(ks); |
| 234 | if (err) |
| 235 | return err; |
| 236 | |
| 237 | udelay(KS8995_RESET_DELAY); |
| 238 | |
| 239 | return ks8995_start(ks); |
| 240 | } |
| 241 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 242 | static ssize_t ks8995_registers_read(struct file *filp, struct kobject *kobj, |
| 243 | struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) |
| 244 | { |
| 245 | struct device *dev; |
| 246 | struct ks8995_switch *ks8995; |
| 247 | |
| 248 | dev = container_of(kobj, struct device, kobj); |
| 249 | ks8995 = dev_get_drvdata(dev); |
| 250 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 251 | return ks8995_read(ks8995, buf, off, count); |
| 252 | } |
| 253 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 254 | static ssize_t ks8995_registers_write(struct file *filp, struct kobject *kobj, |
| 255 | struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) |
| 256 | { |
| 257 | struct device *dev; |
| 258 | struct ks8995_switch *ks8995; |
| 259 | |
| 260 | dev = container_of(kobj, struct device, kobj); |
| 261 | ks8995 = dev_get_drvdata(dev); |
| 262 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 263 | return ks8995_write(ks8995, buf, off, count); |
| 264 | } |
| 265 | |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 266 | static const struct bin_attribute ks8995_registers_attr = { |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 267 | .attr = { |
| 268 | .name = "registers", |
| 269 | .mode = S_IRUSR | S_IWUSR, |
| 270 | }, |
| 271 | .size = KS8995_REGS_SIZE, |
| 272 | .read = ks8995_registers_read, |
| 273 | .write = ks8995_registers_write, |
| 274 | }; |
| 275 | |
| 276 | /* ------------------------------------------------------------------------ */ |
Bill Pemberton | 633d159 | 2012-12-03 09:24:14 -0500 | [diff] [blame] | 277 | static int ks8995_probe(struct spi_device *spi) |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 278 | { |
| 279 | struct ks8995_switch *ks; |
| 280 | struct ks8995_pdata *pdata; |
| 281 | u8 ids[2]; |
| 282 | int err; |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 283 | int variant = spi_get_device_id(spi)->driver_data; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 284 | |
| 285 | /* Chip description */ |
| 286 | pdata = spi->dev.platform_data; |
| 287 | |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 288 | if (variant >= max_variant) { |
| 289 | dev_err(&spi->dev, "bad chip variant %d\n", variant); |
| 290 | return -ENODEV; |
| 291 | } |
| 292 | |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 293 | ks = devm_kzalloc(&spi->dev, sizeof(*ks), GFP_KERNEL); |
Joe Perches | e68ed8f | 2013-02-03 17:28:15 +0000 | [diff] [blame] | 294 | if (!ks) |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 295 | return -ENOMEM; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 296 | |
| 297 | mutex_init(&ks->lock); |
| 298 | ks->pdata = pdata; |
| 299 | ks->spi = spi_dev_get(spi); |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 300 | ks->chip = &ks8995_chip[variant]; |
| 301 | |
Jingoo Han | 5d5f184 | 2013-04-05 20:37:07 +0000 | [diff] [blame] | 302 | spi_set_drvdata(spi, ks); |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 303 | |
| 304 | spi->mode = SPI_MODE_0; |
| 305 | spi->bits_per_word = 8; |
| 306 | err = spi_setup(spi); |
| 307 | if (err) { |
| 308 | dev_err(&spi->dev, "spi_setup failed, err=%d\n", err); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 309 | return err; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | err = ks8995_read(ks, ids, KS8995_REG_ID0, sizeof(ids)); |
| 313 | if (err < 0) { |
| 314 | dev_err(&spi->dev, "unable to read id registers, err=%d\n", |
| 315 | err); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 316 | return err; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 317 | } |
| 318 | |
| 319 | switch (ids[0]) { |
| 320 | case FAMILY_KS8995: |
| 321 | break; |
| 322 | default: |
| 323 | dev_err(&spi->dev, "unknown family id:%02x\n", ids[0]); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 324 | return -ENODEV; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 325 | } |
| 326 | |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 327 | ks->regs_attr.size = ks->chip->regs_size; |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 328 | memcpy(&ks->regs_attr, &ks8995_registers_attr, sizeof(ks->regs_attr)); |
| 329 | if (get_chip_id(ids[1]) != CHIPID_M) { |
| 330 | u8 val; |
| 331 | |
| 332 | /* Check if this is a KSZ8864RMN */ |
| 333 | err = ks8995_read(ks, &val, KSZ8864_REG_ID1, sizeof(val)); |
| 334 | if (err < 0) { |
| 335 | dev_err(&spi->dev, |
| 336 | "unable to read chip id register, err=%d\n", |
| 337 | err); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 338 | return err; |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 339 | } |
| 340 | if ((val & 0x80) == 0) { |
| 341 | dev_err(&spi->dev, "unknown chip:%02x,0\n", ids[1]); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 342 | return err; |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 343 | } |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 344 | } |
| 345 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 346 | err = ks8995_reset(ks); |
| 347 | if (err) |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 348 | return err; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 349 | |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 350 | err = sysfs_create_bin_file(&spi->dev.kobj, &ks->regs_attr); |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 351 | if (err) { |
| 352 | dev_err(&spi->dev, "unable to create sysfs file, err=%d\n", |
| 353 | err); |
Himangi Saraogi | b32a8b6 | 2014-08-03 13:39:43 +0530 | [diff] [blame] | 354 | return err; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 355 | } |
| 356 | |
Philipp Zabel | 240a12d | 2014-04-03 11:28:10 +0200 | [diff] [blame] | 357 | if (get_chip_id(ids[1]) == CHIPID_M) { |
| 358 | dev_info(&spi->dev, |
| 359 | "KS8995 device found, Chip ID:%x, Revision:%x\n", |
| 360 | get_chip_id(ids[1]), get_chip_rev(ids[1])); |
| 361 | } else { |
| 362 | dev_info(&spi->dev, "KSZ8864 device found, Revision:%x\n", |
| 363 | get_chip_rev(ids[1])); |
| 364 | } |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 365 | |
| 366 | return 0; |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 367 | } |
| 368 | |
Bill Pemberton | 633d159 | 2012-12-03 09:24:14 -0500 | [diff] [blame] | 369 | static int ks8995_remove(struct spi_device *spi) |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 370 | { |
Vladimir Zapolskiy | 30349bd | 2014-11-04 01:25:09 +0200 | [diff] [blame] | 371 | struct ks8995_switch *ks = spi_get_drvdata(spi); |
| 372 | |
| 373 | sysfs_remove_bin_file(&spi->dev.kobj, &ks->regs_attr); |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 374 | |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 375 | return 0; |
| 376 | } |
| 377 | |
| 378 | /* ------------------------------------------------------------------------ */ |
| 379 | |
| 380 | static struct spi_driver ks8995_driver = { |
| 381 | .driver = { |
| 382 | .name = "spi-ks8995", |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 383 | }, |
| 384 | .probe = ks8995_probe, |
Bill Pemberton | 633d159 | 2012-12-03 09:24:14 -0500 | [diff] [blame] | 385 | .remove = ks8995_remove, |
Helmut Buchsbaum | aa54c8d | 2016-02-09 20:47:13 +0100 | [diff] [blame^] | 386 | .id_table = ks8995_id, |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 387 | }; |
| 388 | |
Sachin Kamat | 1a9561a | 2013-05-27 01:51:39 +0000 | [diff] [blame] | 389 | module_spi_driver(ks8995_driver); |
Frederic LAMBERT | a8e510f | 2011-12-18 07:33:41 +0000 | [diff] [blame] | 390 | |
| 391 | MODULE_DESCRIPTION(DRV_DESC); |
| 392 | MODULE_VERSION(DRV_VERSION); |
| 393 | MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>"); |
| 394 | MODULE_LICENSE("GPL v2"); |