xref: /linux/drivers/spi/spi-microchip-core.c (revision 76d9b92e68f2bb55890f935c5143f4fef97a935d)
1 // SPDX-License-Identifier: (GPL-2.0)
2 /*
3  * Microchip CoreSPI SPI controller driver
4  *
5  * Copyright (c) 2018-2022 Microchip Technology Inc. and its subsidiaries
6  *
7  * Author: Daire McNamara <daire.mcnamara@microchip.com>
8  * Author: Conor Dooley <conor.dooley@microchip.com>
9  *
10  */
11 
12 #include <linux/clk.h>
13 #include <linux/delay.h>
14 #include <linux/err.h>
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
17 #include <linux/io.h>
18 #include <linux/module.h>
19 #include <linux/of.h>
20 #include <linux/platform_device.h>
21 #include <linux/spi/spi.h>
22 
23 #define MAX_LEN				(0xffff)
24 #define MAX_CS				(1)
25 #define DEFAULT_FRAMESIZE		(8)
26 #define FIFO_DEPTH			(32)
27 #define CLK_GEN_MODE1_MAX		(255)
28 #define CLK_GEN_MODE0_MAX		(15)
29 #define CLK_GEN_MIN			(0)
30 #define MODE_X_MASK_SHIFT		(24)
31 
32 #define CONTROL_ENABLE			BIT(0)
33 #define CONTROL_MASTER			BIT(1)
34 #define CONTROL_RX_DATA_INT		BIT(4)
35 #define CONTROL_TX_DATA_INT		BIT(5)
36 #define CONTROL_RX_OVER_INT		BIT(6)
37 #define CONTROL_TX_UNDER_INT		BIT(7)
38 #define CONTROL_SPO			BIT(24)
39 #define CONTROL_SPH			BIT(25)
40 #define CONTROL_SPS			BIT(26)
41 #define CONTROL_FRAMEURUN		BIT(27)
42 #define CONTROL_CLKMODE			BIT(28)
43 #define CONTROL_BIGFIFO			BIT(29)
44 #define CONTROL_OENOFF			BIT(30)
45 #define CONTROL_RESET			BIT(31)
46 
47 #define CONTROL_MODE_MASK		GENMASK(3, 2)
48 #define  MOTOROLA_MODE			(0)
49 #define CONTROL_FRAMECNT_MASK		GENMASK(23, 8)
50 #define CONTROL_FRAMECNT_SHIFT		(8)
51 
52 #define STATUS_ACTIVE			BIT(14)
53 #define STATUS_SSEL			BIT(13)
54 #define STATUS_FRAMESTART		BIT(12)
55 #define STATUS_TXFIFO_EMPTY_NEXT_READ	BIT(11)
56 #define STATUS_TXFIFO_EMPTY		BIT(10)
57 #define STATUS_TXFIFO_FULL_NEXT_WRITE	BIT(9)
58 #define STATUS_TXFIFO_FULL		BIT(8)
59 #define STATUS_RXFIFO_EMPTY_NEXT_READ	BIT(7)
60 #define STATUS_RXFIFO_EMPTY		BIT(6)
61 #define STATUS_RXFIFO_FULL_NEXT_WRITE	BIT(5)
62 #define STATUS_RXFIFO_FULL		BIT(4)
63 #define STATUS_TX_UNDERRUN		BIT(3)
64 #define STATUS_RX_OVERFLOW		BIT(2)
65 #define STATUS_RXDAT_RXED		BIT(1)
66 #define STATUS_TXDAT_SENT		BIT(0)
67 
68 #define INT_TXDONE			BIT(0)
69 #define INT_RXRDY			BIT(1)
70 #define INT_RX_CHANNEL_OVERFLOW		BIT(2)
71 #define INT_TX_CHANNEL_UNDERRUN		BIT(3)
72 
73 #define INT_ENABLE_MASK (CONTROL_RX_DATA_INT | CONTROL_TX_DATA_INT | \
74 			 CONTROL_RX_OVER_INT | CONTROL_TX_UNDER_INT)
75 
76 #define REG_CONTROL		(0x00)
77 #define REG_FRAME_SIZE		(0x04)
78 #define REG_STATUS		(0x08)
79 #define REG_INT_CLEAR		(0x0c)
80 #define REG_RX_DATA		(0x10)
81 #define REG_TX_DATA		(0x14)
82 #define REG_CLK_GEN		(0x18)
83 #define REG_SLAVE_SELECT	(0x1c)
84 #define  SSEL_MASK		GENMASK(7, 0)
85 #define  SSEL_DIRECT		BIT(8)
86 #define  SSELOUT_SHIFT		9
87 #define  SSELOUT		BIT(SSELOUT_SHIFT)
88 #define REG_MIS			(0x20)
89 #define REG_RIS			(0x24)
90 #define REG_CONTROL2		(0x28)
91 #define REG_COMMAND		(0x2c)
92 #define REG_PKTSIZE		(0x30)
93 #define REG_CMD_SIZE		(0x34)
94 #define REG_HWSTATUS		(0x38)
95 #define REG_STAT8		(0x3c)
96 #define REG_CTRL2		(0x48)
97 #define REG_FRAMESUP		(0x50)
98 
99 struct mchp_corespi {
100 	void __iomem *regs;
101 	struct clk *clk;
102 	const u8 *tx_buf;
103 	u8 *rx_buf;
104 	u32 clk_gen; /* divider for spi output clock generated by the controller */
105 	u32 clk_mode;
106 	int irq;
107 	int tx_len;
108 	int rx_len;
109 	int pending;
110 };
111 
112 static inline u32 mchp_corespi_read(struct mchp_corespi *spi, unsigned int reg)
113 {
114 	return readl(spi->regs + reg);
115 }
116 
117 static inline void mchp_corespi_write(struct mchp_corespi *spi, unsigned int reg, u32 val)
118 {
119 	writel(val, spi->regs + reg);
120 }
121 
122 static inline void mchp_corespi_disable(struct mchp_corespi *spi)
123 {
124 	u32 control = mchp_corespi_read(spi, REG_CONTROL);
125 
126 	control &= ~CONTROL_ENABLE;
127 
128 	mchp_corespi_write(spi, REG_CONTROL, control);
129 }
130 
131 static inline void mchp_corespi_read_fifo(struct mchp_corespi *spi)
132 {
133 	u8 data;
134 	int fifo_max, i = 0;
135 
136 	fifo_max = min(spi->rx_len, FIFO_DEPTH);
137 
138 	while ((i < fifo_max) && !(mchp_corespi_read(spi, REG_STATUS) & STATUS_RXFIFO_EMPTY)) {
139 		data = mchp_corespi_read(spi, REG_RX_DATA);
140 
141 		if (spi->rx_buf)
142 			*spi->rx_buf++ = data;
143 		i++;
144 	}
145 	spi->rx_len -= i;
146 	spi->pending -= i;
147 }
148 
149 static void mchp_corespi_enable_ints(struct mchp_corespi *spi)
150 {
151 	u32 control, mask = INT_ENABLE_MASK;
152 
153 	mchp_corespi_disable(spi);
154 
155 	control = mchp_corespi_read(spi, REG_CONTROL);
156 
157 	control |= mask;
158 	mchp_corespi_write(spi, REG_CONTROL, control);
159 
160 	control |= CONTROL_ENABLE;
161 	mchp_corespi_write(spi, REG_CONTROL, control);
162 }
163 
164 static void mchp_corespi_disable_ints(struct mchp_corespi *spi)
165 {
166 	u32 control, mask = INT_ENABLE_MASK;
167 
168 	mchp_corespi_disable(spi);
169 
170 	control = mchp_corespi_read(spi, REG_CONTROL);
171 	control &= ~mask;
172 	mchp_corespi_write(spi, REG_CONTROL, control);
173 
174 	control |= CONTROL_ENABLE;
175 	mchp_corespi_write(spi, REG_CONTROL, control);
176 }
177 
178 static inline void mchp_corespi_set_xfer_size(struct mchp_corespi *spi, int len)
179 {
180 	u32 control;
181 	u16 lenpart;
182 
183 	/*
184 	 * Disable the SPI controller. Writes to transfer length have
185 	 * no effect when the controller is enabled.
186 	 */
187 	mchp_corespi_disable(spi);
188 
189 	/*
190 	 * The lower 16 bits of the frame count are stored in the control reg
191 	 * for legacy reasons, but the upper 16 written to a different register:
192 	 * FRAMESUP. While both the upper and lower bits can be *READ* from the
193 	 * FRAMESUP register, writing to the lower 16 bits is a NOP
194 	 */
195 	lenpart = len & 0xffff;
196 
197 	control = mchp_corespi_read(spi, REG_CONTROL);
198 	control &= ~CONTROL_FRAMECNT_MASK;
199 	control |= lenpart << CONTROL_FRAMECNT_SHIFT;
200 	mchp_corespi_write(spi, REG_CONTROL, control);
201 
202 	lenpart = len & 0xffff0000;
203 	mchp_corespi_write(spi, REG_FRAMESUP, lenpart);
204 
205 	control |= CONTROL_ENABLE;
206 	mchp_corespi_write(spi, REG_CONTROL, control);
207 }
208 
209 static inline void mchp_corespi_write_fifo(struct mchp_corespi *spi)
210 {
211 	u8 byte;
212 	int fifo_max, i = 0;
213 
214 	fifo_max = min(spi->tx_len, FIFO_DEPTH);
215 	mchp_corespi_set_xfer_size(spi, fifo_max);
216 
217 	while ((i < fifo_max) && !(mchp_corespi_read(spi, REG_STATUS) & STATUS_TXFIFO_FULL)) {
218 		byte = spi->tx_buf ? *spi->tx_buf++ : 0xaa;
219 		mchp_corespi_write(spi, REG_TX_DATA, byte);
220 		i++;
221 	}
222 
223 	spi->tx_len -= i;
224 	spi->pending += i;
225 }
226 
227 static inline void mchp_corespi_set_framesize(struct mchp_corespi *spi, int bt)
228 {
229 	u32 control;
230 
231 	/*
232 	 * Disable the SPI controller. Writes to the frame size have
233 	 * no effect when the controller is enabled.
234 	 */
235 	mchp_corespi_disable(spi);
236 
237 	mchp_corespi_write(spi, REG_FRAME_SIZE, bt);
238 
239 	control = mchp_corespi_read(spi, REG_CONTROL);
240 	control |= CONTROL_ENABLE;
241 	mchp_corespi_write(spi, REG_CONTROL, control);
242 }
243 
244 static void mchp_corespi_set_cs(struct spi_device *spi, bool disable)
245 {
246 	u32 reg;
247 	struct mchp_corespi *corespi = spi_controller_get_devdata(spi->controller);
248 
249 	reg = mchp_corespi_read(corespi, REG_SLAVE_SELECT);
250 	reg &= ~BIT(spi_get_chipselect(spi, 0));
251 	reg |= !disable << spi_get_chipselect(spi, 0);
252 
253 	mchp_corespi_write(corespi, REG_SLAVE_SELECT, reg);
254 }
255 
256 static int mchp_corespi_setup(struct spi_device *spi)
257 {
258 	struct mchp_corespi *corespi = spi_controller_get_devdata(spi->controller);
259 	u32 reg;
260 
261 	if (spi_is_csgpiod(spi))
262 		return 0;
263 
264 	/*
265 	 * Active high targets need to be specifically set to their inactive
266 	 * states during probe by adding them to the "control group" & thus
267 	 * driving their select line low.
268 	 */
269 	if (spi->mode & SPI_CS_HIGH) {
270 		reg = mchp_corespi_read(corespi, REG_SLAVE_SELECT);
271 		reg |= BIT(spi_get_chipselect(spi, 0));
272 		mchp_corespi_write(corespi, REG_SLAVE_SELECT, reg);
273 	}
274 	return 0;
275 }
276 
277 static void mchp_corespi_init(struct spi_controller *host, struct mchp_corespi *spi)
278 {
279 	unsigned long clk_hz;
280 	u32 control = mchp_corespi_read(spi, REG_CONTROL);
281 
282 	control |= CONTROL_MASTER;
283 
284 	control &= ~CONTROL_MODE_MASK;
285 	control |= MOTOROLA_MODE;
286 
287 	mchp_corespi_set_framesize(spi, DEFAULT_FRAMESIZE);
288 
289 	/* max. possible spi clock rate is the apb clock rate */
290 	clk_hz = clk_get_rate(spi->clk);
291 	host->max_speed_hz = clk_hz;
292 
293 	/*
294 	 * The controller must be configured so that it doesn't remove Chip
295 	 * Select until the entire message has been transferred, even if at
296 	 * some points TX FIFO becomes empty.
297 	 *
298 	 * BIGFIFO mode is also enabled, which sets the fifo depth to 32 frames
299 	 * for the 8 bit transfers that this driver uses.
300 	 */
301 	control = mchp_corespi_read(spi, REG_CONTROL);
302 	control |= CONTROL_SPS | CONTROL_BIGFIFO;
303 
304 	mchp_corespi_write(spi, REG_CONTROL, control);
305 
306 	mchp_corespi_enable_ints(spi);
307 
308 	/*
309 	 * It is required to enable direct mode, otherwise control over the chip
310 	 * select is relinquished to the hardware. SSELOUT is enabled too so we
311 	 * can deal with active high targets.
312 	 */
313 	mchp_corespi_write(spi, REG_SLAVE_SELECT, SSELOUT | SSEL_DIRECT);
314 
315 	control = mchp_corespi_read(spi, REG_CONTROL);
316 
317 	control &= ~CONTROL_RESET;
318 	control |= CONTROL_ENABLE;
319 
320 	mchp_corespi_write(spi, REG_CONTROL, control);
321 }
322 
323 static inline void mchp_corespi_set_clk_gen(struct mchp_corespi *spi)
324 {
325 	u32 control;
326 
327 	mchp_corespi_disable(spi);
328 
329 	control = mchp_corespi_read(spi, REG_CONTROL);
330 	if (spi->clk_mode)
331 		control |= CONTROL_CLKMODE;
332 	else
333 		control &= ~CONTROL_CLKMODE;
334 
335 	mchp_corespi_write(spi, REG_CLK_GEN, spi->clk_gen);
336 	mchp_corespi_write(spi, REG_CONTROL, control);
337 	mchp_corespi_write(spi, REG_CONTROL, control | CONTROL_ENABLE);
338 }
339 
340 static inline void mchp_corespi_set_mode(struct mchp_corespi *spi, unsigned int mode)
341 {
342 	u32 control, mode_val;
343 
344 	switch (mode & SPI_MODE_X_MASK) {
345 	case SPI_MODE_0:
346 		mode_val = 0;
347 		break;
348 	case SPI_MODE_1:
349 		mode_val = CONTROL_SPH;
350 		break;
351 	case SPI_MODE_2:
352 		mode_val = CONTROL_SPO;
353 		break;
354 	case SPI_MODE_3:
355 		mode_val = CONTROL_SPH | CONTROL_SPO;
356 		break;
357 	}
358 
359 	/*
360 	 * Disable the SPI controller. Writes to the frame size have
361 	 * no effect when the controller is enabled.
362 	 */
363 	mchp_corespi_disable(spi);
364 
365 	control = mchp_corespi_read(spi, REG_CONTROL);
366 	control &= ~(SPI_MODE_X_MASK << MODE_X_MASK_SHIFT);
367 	control |= mode_val;
368 
369 	mchp_corespi_write(spi, REG_CONTROL, control);
370 
371 	control |= CONTROL_ENABLE;
372 	mchp_corespi_write(spi, REG_CONTROL, control);
373 }
374 
375 static irqreturn_t mchp_corespi_interrupt(int irq, void *dev_id)
376 {
377 	struct spi_controller *host = dev_id;
378 	struct mchp_corespi *spi = spi_controller_get_devdata(host);
379 	u32 intfield = mchp_corespi_read(spi, REG_MIS) & 0xf;
380 	bool finalise = false;
381 
382 	/* Interrupt line may be shared and not for us at all */
383 	if (intfield == 0)
384 		return IRQ_NONE;
385 
386 	if (intfield & INT_TXDONE) {
387 		mchp_corespi_write(spi, REG_INT_CLEAR, INT_TXDONE);
388 
389 		if (spi->rx_len)
390 			mchp_corespi_read_fifo(spi);
391 
392 		if (spi->tx_len)
393 			mchp_corespi_write_fifo(spi);
394 
395 		if (!spi->rx_len)
396 			finalise = true;
397 	}
398 
399 	if (intfield & INT_RXRDY)
400 		mchp_corespi_write(spi, REG_INT_CLEAR, INT_RXRDY);
401 
402 	if (intfield & INT_RX_CHANNEL_OVERFLOW) {
403 		mchp_corespi_write(spi, REG_INT_CLEAR, INT_RX_CHANNEL_OVERFLOW);
404 		finalise = true;
405 		dev_err(&host->dev,
406 			"%s: RX OVERFLOW: rxlen: %d, txlen: %d\n", __func__,
407 			spi->rx_len, spi->tx_len);
408 	}
409 
410 	if (intfield & INT_TX_CHANNEL_UNDERRUN) {
411 		mchp_corespi_write(spi, REG_INT_CLEAR, INT_TX_CHANNEL_UNDERRUN);
412 		finalise = true;
413 		dev_err(&host->dev,
414 			"%s: TX UNDERFLOW: rxlen: %d, txlen: %d\n", __func__,
415 			spi->rx_len, spi->tx_len);
416 	}
417 
418 	if (finalise)
419 		spi_finalize_current_transfer(host);
420 
421 	return IRQ_HANDLED;
422 }
423 
424 static int mchp_corespi_calculate_clkgen(struct mchp_corespi *spi,
425 					 unsigned long target_hz)
426 {
427 	unsigned long clk_hz, spi_hz, clk_gen;
428 
429 	clk_hz = clk_get_rate(spi->clk);
430 	if (!clk_hz)
431 		return -EINVAL;
432 	spi_hz = min(target_hz, clk_hz);
433 
434 	/*
435 	 * There are two possible clock modes for the controller generated
436 	 * clock's division ratio:
437 	 * CLK_MODE = 0: 1 / (2^(CLK_GEN + 1)) where CLK_GEN = 0 to 15.
438 	 * CLK_MODE = 1: 1 / (2 * CLK_GEN + 1) where CLK_GEN = 0 to 255.
439 	 * First try mode 1, fall back to 0 and if we have tried both modes and
440 	 * we /still/ can't get a good setting, we then throw the toys out of
441 	 * the pram and give up
442 	 * clk_gen is the register name for the clock divider on MPFS.
443 	 */
444 	clk_gen = DIV_ROUND_UP(clk_hz, 2 * spi_hz) - 1;
445 	if (clk_gen > CLK_GEN_MODE1_MAX || clk_gen <= CLK_GEN_MIN) {
446 		clk_gen = DIV_ROUND_UP(clk_hz, spi_hz);
447 		clk_gen = fls(clk_gen) - 1;
448 
449 		if (clk_gen > CLK_GEN_MODE0_MAX)
450 			return -EINVAL;
451 
452 		spi->clk_mode = 0;
453 	} else {
454 		spi->clk_mode = 1;
455 	}
456 
457 	spi->clk_gen = clk_gen;
458 	return 0;
459 }
460 
461 static int mchp_corespi_transfer_one(struct spi_controller *host,
462 				     struct spi_device *spi_dev,
463 				     struct spi_transfer *xfer)
464 {
465 	struct mchp_corespi *spi = spi_controller_get_devdata(host);
466 	int ret;
467 
468 	ret = mchp_corespi_calculate_clkgen(spi, (unsigned long)xfer->speed_hz);
469 	if (ret) {
470 		dev_err(&host->dev, "failed to set clk_gen for target %u Hz\n", xfer->speed_hz);
471 		return ret;
472 	}
473 
474 	mchp_corespi_set_clk_gen(spi);
475 
476 	spi->tx_buf = xfer->tx_buf;
477 	spi->rx_buf = xfer->rx_buf;
478 	spi->tx_len = xfer->len;
479 	spi->rx_len = xfer->len;
480 	spi->pending = 0;
481 
482 	mchp_corespi_set_xfer_size(spi, (spi->tx_len > FIFO_DEPTH)
483 				   ? FIFO_DEPTH : spi->tx_len);
484 
485 	if (spi->tx_len)
486 		mchp_corespi_write_fifo(spi);
487 	return 1;
488 }
489 
490 static int mchp_corespi_prepare_message(struct spi_controller *host,
491 					struct spi_message *msg)
492 {
493 	struct spi_device *spi_dev = msg->spi;
494 	struct mchp_corespi *spi = spi_controller_get_devdata(host);
495 
496 	mchp_corespi_set_framesize(spi, DEFAULT_FRAMESIZE);
497 	mchp_corespi_set_mode(spi, spi_dev->mode);
498 
499 	return 0;
500 }
501 
502 static int mchp_corespi_probe(struct platform_device *pdev)
503 {
504 	struct spi_controller *host;
505 	struct mchp_corespi *spi;
506 	struct resource *res;
507 	u32 num_cs;
508 	int ret = 0;
509 
510 	host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
511 	if (!host)
512 		return dev_err_probe(&pdev->dev, -ENOMEM,
513 				     "unable to allocate host for SPI controller\n");
514 
515 	platform_set_drvdata(pdev, host);
516 
517 	if (of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs))
518 		num_cs = MAX_CS;
519 
520 	host->num_chipselect = num_cs;
521 	host->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
522 	host->use_gpio_descriptors = true;
523 	host->setup = mchp_corespi_setup;
524 	host->bits_per_word_mask = SPI_BPW_MASK(8);
525 	host->transfer_one = mchp_corespi_transfer_one;
526 	host->prepare_message = mchp_corespi_prepare_message;
527 	host->set_cs = mchp_corespi_set_cs;
528 	host->dev.of_node = pdev->dev.of_node;
529 
530 	spi = spi_controller_get_devdata(host);
531 
532 	spi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
533 	if (IS_ERR(spi->regs))
534 		return PTR_ERR(spi->regs);
535 
536 	spi->irq = platform_get_irq(pdev, 0);
537 	if (spi->irq < 0)
538 		return spi->irq;
539 
540 	ret = devm_request_irq(&pdev->dev, spi->irq, mchp_corespi_interrupt,
541 			       IRQF_SHARED, dev_name(&pdev->dev), host);
542 	if (ret)
543 		return dev_err_probe(&pdev->dev, ret,
544 				     "could not request irq\n");
545 
546 	spi->clk = devm_clk_get_enabled(&pdev->dev, NULL);
547 	if (IS_ERR(spi->clk))
548 		return dev_err_probe(&pdev->dev, PTR_ERR(spi->clk),
549 				     "could not get clk\n");
550 
551 	mchp_corespi_init(host, spi);
552 
553 	ret = devm_spi_register_controller(&pdev->dev, host);
554 	if (ret) {
555 		mchp_corespi_disable(spi);
556 		return dev_err_probe(&pdev->dev, ret,
557 				     "unable to register host for SPI controller\n");
558 	}
559 
560 	dev_info(&pdev->dev, "Registered SPI controller %d\n", host->bus_num);
561 
562 	return 0;
563 }
564 
565 static void mchp_corespi_remove(struct platform_device *pdev)
566 {
567 	struct spi_controller *host  = platform_get_drvdata(pdev);
568 	struct mchp_corespi *spi = spi_controller_get_devdata(host);
569 
570 	mchp_corespi_disable_ints(spi);
571 	mchp_corespi_disable(spi);
572 }
573 
574 #define MICROCHIP_SPI_PM_OPS (NULL)
575 
576 /*
577  * Platform driver data structure
578  */
579 
580 #if defined(CONFIG_OF)
581 static const struct of_device_id mchp_corespi_dt_ids[] = {
582 	{ .compatible = "microchip,mpfs-spi" },
583 	{ /* sentinel */ }
584 };
585 MODULE_DEVICE_TABLE(of, mchp_corespi_dt_ids);
586 #endif
587 
588 static struct platform_driver mchp_corespi_driver = {
589 	.probe = mchp_corespi_probe,
590 	.driver = {
591 		.name = "microchip-corespi",
592 		.pm = MICROCHIP_SPI_PM_OPS,
593 		.of_match_table = of_match_ptr(mchp_corespi_dt_ids),
594 	},
595 	.remove_new = mchp_corespi_remove,
596 };
597 module_platform_driver(mchp_corespi_driver);
598 MODULE_DESCRIPTION("Microchip coreSPI SPI controller driver");
599 MODULE_AUTHOR("Daire McNamara <daire.mcnamara@microchip.com>");
600 MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
601 MODULE_LICENSE("GPL");
602