blob: a6e25c6c66cac1d54f1966891ea19cb49b5d9425 [file] [log] [blame]
Martin Sperl1ea29b32015-09-11 11:22:04 +00001/*
2 * Driver for Broadcom BCM2835 auxiliary SPI Controllers
3 *
4 * the driver does not rely on the native chipselects at all
5 * but only uses the gpio type chipselects
6 *
7 * Based on: spi-bcm2835.c
8 *
9 * Copyright (C) 2015 Martin Sperl
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 */
21
22#include <linux/clk.h>
23#include <linux/completion.h>
24#include <linux/delay.h>
25#include <linux/err.h>
26#include <linux/interrupt.h>
27#include <linux/io.h>
28#include <linux/kernel.h>
29#include <linux/module.h>
30#include <linux/of.h>
31#include <linux/of_address.h>
32#include <linux/of_device.h>
33#include <linux/of_gpio.h>
34#include <linux/of_irq.h>
35#include <linux/regmap.h>
36#include <linux/spi/spi.h>
37#include <linux/spinlock.h>
38
39/*
40 * spi register defines
41 *
42 * note there is garbage in the "official" documentation,
43 * so some data is taken from the file:
44 * brcm_usrlib/dag/vmcsx/vcinclude/bcm2708_chip/aux_io.h
45 * inside of:
46 * http://www.broadcom.com/docs/support/videocore/Brcm_Android_ICS_Graphics_Stack.tar.gz
47 */
48
49/* SPI register offsets */
50#define BCM2835_AUX_SPI_CNTL0 0x00
51#define BCM2835_AUX_SPI_CNTL1 0x04
52#define BCM2835_AUX_SPI_STAT 0x08
53#define BCM2835_AUX_SPI_PEEK 0x0C
54#define BCM2835_AUX_SPI_IO 0x20
55#define BCM2835_AUX_SPI_TXHOLD 0x30
56
57/* Bitfields in CNTL0 */
58#define BCM2835_AUX_SPI_CNTL0_SPEED 0xFFF00000
59#define BCM2835_AUX_SPI_CNTL0_SPEED_MAX 0xFFF
60#define BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT 20
61#define BCM2835_AUX_SPI_CNTL0_CS 0x000E0000
62#define BCM2835_AUX_SPI_CNTL0_POSTINPUT 0x00010000
63#define BCM2835_AUX_SPI_CNTL0_VAR_CS 0x00008000
64#define BCM2835_AUX_SPI_CNTL0_VAR_WIDTH 0x00004000
65#define BCM2835_AUX_SPI_CNTL0_DOUTHOLD 0x00003000
66#define BCM2835_AUX_SPI_CNTL0_ENABLE 0x00000800
67#define BCM2835_AUX_SPI_CNTL0_CPHA_IN 0x00000400
68#define BCM2835_AUX_SPI_CNTL0_CLEARFIFO 0x00000200
69#define BCM2835_AUX_SPI_CNTL0_CPHA_OUT 0x00000100
70#define BCM2835_AUX_SPI_CNTL0_CPOL 0x00000080
71#define BCM2835_AUX_SPI_CNTL0_MSBF_OUT 0x00000040
72#define BCM2835_AUX_SPI_CNTL0_SHIFTLEN 0x0000003F
73
74/* Bitfields in CNTL1 */
75#define BCM2835_AUX_SPI_CNTL1_CSHIGH 0x00000700
76#define BCM2835_AUX_SPI_CNTL1_IDLE 0x00000080
77#define BCM2835_AUX_SPI_CNTL1_TXEMPTY 0x00000040
78#define BCM2835_AUX_SPI_CNTL1_MSBF_IN 0x00000002
79#define BCM2835_AUX_SPI_CNTL1_KEEP_IN 0x00000001
80
81/* Bitfields in STAT */
82#define BCM2835_AUX_SPI_STAT_TX_LVL 0xFF000000
83#define BCM2835_AUX_SPI_STAT_RX_LVL 0x00FF0000
84#define BCM2835_AUX_SPI_STAT_TX_FULL 0x00000400
85#define BCM2835_AUX_SPI_STAT_TX_EMPTY 0x00000200
86#define BCM2835_AUX_SPI_STAT_RX_FULL 0x00000100
87#define BCM2835_AUX_SPI_STAT_RX_EMPTY 0x00000080
88#define BCM2835_AUX_SPI_STAT_BUSY 0x00000040
89#define BCM2835_AUX_SPI_STAT_BITCOUNT 0x0000003F
90
91/* timeout values */
92#define BCM2835_AUX_SPI_POLLING_LIMIT_US 30
93#define BCM2835_AUX_SPI_POLLING_JIFFIES 2
94
95#define BCM2835_AUX_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \
96 | SPI_NO_CS)
97
98struct bcm2835aux_spi {
99 void __iomem *regs;
100 struct clk *clk;
101 int irq;
102 u32 cntl[2];
103 const u8 *tx_buf;
104 u8 *rx_buf;
105 int tx_len;
106 int rx_len;
Martin Sperl72aac022015-10-16 14:17:19 +0000107 int pending;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000108};
109
110static inline u32 bcm2835aux_rd(struct bcm2835aux_spi *bs, unsigned reg)
111{
112 return readl(bs->regs + reg);
113}
114
115static inline void bcm2835aux_wr(struct bcm2835aux_spi *bs, unsigned reg,
116 u32 val)
117{
118 writel(val, bs->regs + reg);
119}
120
121static inline void bcm2835aux_rd_fifo(struct bcm2835aux_spi *bs)
122{
123 u32 data;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000124 int count = min(bs->rx_len, 3);
125
126 data = bcm2835aux_rd(bs, BCM2835_AUX_SPI_IO);
127 if (bs->rx_buf) {
Martin Sperl72aac022015-10-16 14:17:19 +0000128 switch (count) {
129 case 4:
130 *bs->rx_buf++ = (data >> 24) & 0xff;
131 /* fallthrough */
132 case 3:
133 *bs->rx_buf++ = (data >> 16) & 0xff;
134 /* fallthrough */
135 case 2:
136 *bs->rx_buf++ = (data >> 8) & 0xff;
137 /* fallthrough */
138 case 1:
139 *bs->rx_buf++ = (data >> 0) & 0xff;
140 /* fallthrough - no default */
141 }
Martin Sperl1ea29b32015-09-11 11:22:04 +0000142 }
143 bs->rx_len -= count;
Martin Sperl72aac022015-10-16 14:17:19 +0000144 bs->pending -= count;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000145}
146
147static inline void bcm2835aux_wr_fifo(struct bcm2835aux_spi *bs)
148{
149 u32 data;
150 u8 byte;
151 int count;
152 int i;
153
154 /* gather up to 3 bytes to write to the FIFO */
155 count = min(bs->tx_len, 3);
156 data = 0;
157 for (i = 0; i < count; i++) {
158 byte = bs->tx_buf ? *bs->tx_buf++ : 0;
159 data |= byte << (8 * (2 - i));
160 }
161
162 /* and set the variable bit-length */
163 data |= (count * 8) << 24;
164
165 /* and decrement length */
166 bs->tx_len -= count;
Martin Sperl72aac022015-10-16 14:17:19 +0000167 bs->pending += count;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000168
169 /* write to the correct TX-register */
170 if (bs->tx_len)
171 bcm2835aux_wr(bs, BCM2835_AUX_SPI_TXHOLD, data);
172 else
173 bcm2835aux_wr(bs, BCM2835_AUX_SPI_IO, data);
174}
175
176static void bcm2835aux_spi_reset_hw(struct bcm2835aux_spi *bs)
177{
178 /* disable spi clearing fifo and interrupts */
179 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, 0);
180 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0,
181 BCM2835_AUX_SPI_CNTL0_CLEARFIFO);
182}
183
184static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
185{
186 struct spi_master *master = dev_id;
187 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
188 irqreturn_t ret = IRQ_NONE;
189
190 /* check if we have data to read */
191 while (bs->rx_len &&
192 (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
193 BCM2835_AUX_SPI_STAT_RX_EMPTY))) {
194 bcm2835aux_rd_fifo(bs);
195 ret = IRQ_HANDLED;
196 }
197
198 /* check if we have data to write */
199 while (bs->tx_len &&
Martin Sperl72aac022015-10-16 14:17:19 +0000200 (bs->pending < 12) &&
Martin Sperl1ea29b32015-09-11 11:22:04 +0000201 (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
202 BCM2835_AUX_SPI_STAT_TX_FULL))) {
203 bcm2835aux_wr_fifo(bs);
204 ret = IRQ_HANDLED;
205 }
206
207 /* and check if we have reached "done" */
208 while (bs->rx_len &&
209 (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
210 BCM2835_AUX_SPI_STAT_BUSY))) {
211 bcm2835aux_rd_fifo(bs);
212 ret = IRQ_HANDLED;
213 }
214
Stephan Olbrichf29ab182016-02-09 19:10:33 +0100215 if (!bs->tx_len) {
216 /* disable tx fifo empty interrupt */
217 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1] |
218 BCM2835_AUX_SPI_CNTL1_IDLE);
219 }
220
Stephan Olbrichb4e2ade2016-02-14 11:04:28 +0100221 /* and if rx_len is 0 then disable interrupts and wake up completion */
Martin Sperl1ea29b32015-09-11 11:22:04 +0000222 if (!bs->rx_len) {
Stephan Olbrichb4e2ade2016-02-14 11:04:28 +0100223 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
Martin Sperl1ea29b32015-09-11 11:22:04 +0000224 complete(&master->xfer_completion);
225 }
226
227 /* and return */
228 return ret;
229}
230
231static int __bcm2835aux_spi_transfer_one_irq(struct spi_master *master,
232 struct spi_device *spi,
233 struct spi_transfer *tfr)
234{
235 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
236
237 /* enable interrupts */
238 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1] |
239 BCM2835_AUX_SPI_CNTL1_TXEMPTY |
240 BCM2835_AUX_SPI_CNTL1_IDLE);
241
242 /* and wait for finish... */
243 return 1;
244}
245
246static int bcm2835aux_spi_transfer_one_irq(struct spi_master *master,
247 struct spi_device *spi,
248 struct spi_transfer *tfr)
249{
250 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
251
252 /* fill in registers and fifos before enabling interrupts */
253 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
254 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]);
255
256 /* fill in tx fifo with data before enabling interrupts */
257 while ((bs->tx_len) &&
Martin Sperl72aac022015-10-16 14:17:19 +0000258 (bs->pending < 12) &&
Martin Sperl1ea29b32015-09-11 11:22:04 +0000259 (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
260 BCM2835_AUX_SPI_STAT_TX_FULL))) {
261 bcm2835aux_wr_fifo(bs);
262 }
263
264 /* now run the interrupt mode */
265 return __bcm2835aux_spi_transfer_one_irq(master, spi, tfr);
266}
267
268static int bcm2835aux_spi_transfer_one_poll(struct spi_master *master,
269 struct spi_device *spi,
Martin Sperl72aac022015-10-16 14:17:19 +0000270 struct spi_transfer *tfr)
Martin Sperl1ea29b32015-09-11 11:22:04 +0000271{
272 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
273 unsigned long timeout;
274 u32 stat;
275
276 /* configure spi */
277 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
278 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]);
279
280 /* set the timeout */
281 timeout = jiffies + BCM2835_AUX_SPI_POLLING_JIFFIES;
282
283 /* loop until finished the transfer */
284 while (bs->rx_len) {
285 /* read status */
286 stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT);
287
288 /* fill in tx fifo with remaining data */
289 if ((bs->tx_len) && (!(stat & BCM2835_AUX_SPI_STAT_TX_FULL))) {
290 bcm2835aux_wr_fifo(bs);
291 continue;
292 }
293
294 /* read data from fifo for both cases */
295 if (!(stat & BCM2835_AUX_SPI_STAT_RX_EMPTY)) {
296 bcm2835aux_rd_fifo(bs);
297 continue;
298 }
299 if (!(stat & BCM2835_AUX_SPI_STAT_BUSY)) {
300 bcm2835aux_rd_fifo(bs);
301 continue;
302 }
303
304 /* there is still data pending to read check the timeout */
305 if (bs->rx_len && time_after(jiffies, timeout)) {
306 dev_dbg_ratelimited(&spi->dev,
307 "timeout period reached: jiffies: %lu remaining tx/rx: %d/%d - falling back to interrupt mode\n",
308 jiffies - timeout,
309 bs->tx_len, bs->rx_len);
310 /* forward to interrupt handler */
311 return __bcm2835aux_spi_transfer_one_irq(master,
312 spi, tfr);
313 }
314 }
315
Martin Sperl1ea29b32015-09-11 11:22:04 +0000316 /* and return without waiting for completion */
317 return 0;
318}
319
320static int bcm2835aux_spi_transfer_one(struct spi_master *master,
321 struct spi_device *spi,
322 struct spi_transfer *tfr)
323{
324 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
325 unsigned long spi_hz, clk_hz, speed;
Martin Sperl72aac022015-10-16 14:17:19 +0000326 unsigned long spi_used_hz;
327 unsigned long long xfer_time_us;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000328
329 /* calculate the registers to handle
330 *
331 * note that we use the variable data mode, which
332 * is not optimal for longer transfers as we waste registers
333 * resulting (potentially) in more interrupts when transferring
334 * more than 12 bytes
335 */
Martin Sperl1ea29b32015-09-11 11:22:04 +0000336
337 /* set clock */
338 spi_hz = tfr->speed_hz;
339 clk_hz = clk_get_rate(bs->clk);
340
341 if (spi_hz >= clk_hz / 2) {
342 speed = 0;
343 } else if (spi_hz) {
344 speed = DIV_ROUND_UP(clk_hz, 2 * spi_hz) - 1;
345 if (speed > BCM2835_AUX_SPI_CNTL0_SPEED_MAX)
346 speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX;
347 } else { /* the slowest we can go */
348 speed = BCM2835_AUX_SPI_CNTL0_SPEED_MAX;
349 }
Stephan Olbrichb4e2ade2016-02-14 11:04:28 +0100350 /* mask out old speed from previous spi_transfer */
351 bs->cntl[0] &= ~(BCM2835_AUX_SPI_CNTL0_SPEED);
352 /* set the new speed */
Martin Sperl1ea29b32015-09-11 11:22:04 +0000353 bs->cntl[0] |= speed << BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT;
354
355 spi_used_hz = clk_hz / (2 * (speed + 1));
356
Martin Sperl1ea29b32015-09-11 11:22:04 +0000357 /* set transmit buffers and length */
358 bs->tx_buf = tfr->tx_buf;
359 bs->rx_buf = tfr->rx_buf;
360 bs->tx_len = tfr->len;
361 bs->rx_len = tfr->len;
Martin Sperl72aac022015-10-16 14:17:19 +0000362 bs->pending = 0;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000363
Martin Sperl72aac022015-10-16 14:17:19 +0000364 /* calculate the estimated time in us the transfer runs
365 * note that there are are 2 idle clocks after each
366 * chunk getting transferred - in our case the chunk size
367 * is 3 bytes, so we approximate this by 9 bits/byte
368 */
369 xfer_time_us = tfr->len * 9 * 1000000;
370 do_div(xfer_time_us, spi_used_hz);
Martin Sperl1ea29b32015-09-11 11:22:04 +0000371
372 /* run in polling mode for short transfers */
373 if (xfer_time_us < BCM2835_AUX_SPI_POLLING_LIMIT_US)
Martin Sperl72aac022015-10-16 14:17:19 +0000374 return bcm2835aux_spi_transfer_one_poll(master, spi, tfr);
Martin Sperl1ea29b32015-09-11 11:22:04 +0000375
376 /* run in interrupt mode for all others */
377 return bcm2835aux_spi_transfer_one_irq(master, spi, tfr);
378}
379
Stephan Olbrichb4e2ade2016-02-14 11:04:28 +0100380static int bcm2835aux_spi_prepare_message(struct spi_master *master,
381 struct spi_message *msg)
382{
383 struct spi_device *spi = msg->spi;
384 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
385
386 bs->cntl[0] = BCM2835_AUX_SPI_CNTL0_ENABLE |
387 BCM2835_AUX_SPI_CNTL0_VAR_WIDTH |
388 BCM2835_AUX_SPI_CNTL0_MSBF_OUT;
389 bs->cntl[1] = BCM2835_AUX_SPI_CNTL1_MSBF_IN;
390
391 /* handle all the modes */
392 if (spi->mode & SPI_CPOL)
393 bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPOL;
394 if (spi->mode & SPI_CPHA)
395 bs->cntl[0] |= BCM2835_AUX_SPI_CNTL0_CPHA_OUT |
396 BCM2835_AUX_SPI_CNTL0_CPHA_IN;
397
398 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
399 bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL0, bs->cntl[0]);
400
401 return 0;
402}
403
404static int bcm2835aux_spi_unprepare_message(struct spi_master *master,
405 struct spi_message *msg)
406{
407 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
408
409 bcm2835aux_spi_reset_hw(bs);
410
411 return 0;
412}
413
Martin Sperl1ea29b32015-09-11 11:22:04 +0000414static void bcm2835aux_spi_handle_err(struct spi_master *master,
415 struct spi_message *msg)
416{
417 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
418
419 bcm2835aux_spi_reset_hw(bs);
420}
421
422static int bcm2835aux_spi_probe(struct platform_device *pdev)
423{
424 struct spi_master *master;
425 struct bcm2835aux_spi *bs;
426 struct resource *res;
427 unsigned long clk_hz;
428 int err;
429
430 master = spi_alloc_master(&pdev->dev, sizeof(*bs));
431 if (!master) {
432 dev_err(&pdev->dev, "spi_alloc_master() failed\n");
433 return -ENOMEM;
434 }
435
436 platform_set_drvdata(pdev, master);
437 master->mode_bits = BCM2835_AUX_SPI_MODE_BITS;
438 master->bits_per_word_mask = SPI_BPW_MASK(8);
439 master->num_chipselect = -1;
440 master->transfer_one = bcm2835aux_spi_transfer_one;
441 master->handle_err = bcm2835aux_spi_handle_err;
Stephan Olbrichb4e2ade2016-02-14 11:04:28 +0100442 master->prepare_message = bcm2835aux_spi_prepare_message;
443 master->unprepare_message = bcm2835aux_spi_unprepare_message;
Martin Sperl1ea29b32015-09-11 11:22:04 +0000444 master->dev.of_node = pdev->dev.of_node;
445
446 bs = spi_master_get_devdata(master);
447
448 /* the main area */
449 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
450 bs->regs = devm_ioremap_resource(&pdev->dev, res);
451 if (IS_ERR(bs->regs)) {
452 err = PTR_ERR(bs->regs);
453 goto out_master_put;
454 }
455
456 bs->clk = devm_clk_get(&pdev->dev, NULL);
457 if ((!bs->clk) || (IS_ERR(bs->clk))) {
458 err = PTR_ERR(bs->clk);
459 dev_err(&pdev->dev, "could not get clk: %d\n", err);
460 goto out_master_put;
461 }
462
Martin Sperl07bce092015-10-15 10:10:20 +0000463 bs->irq = platform_get_irq(pdev, 0);
Martin Sperl1ea29b32015-09-11 11:22:04 +0000464 if (bs->irq <= 0) {
465 dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq);
466 err = bs->irq ? bs->irq : -ENODEV;
467 goto out_master_put;
468 }
469
470 /* this also enables the HW block */
471 err = clk_prepare_enable(bs->clk);
472 if (err) {
473 dev_err(&pdev->dev, "could not prepare clock: %d\n", err);
474 goto out_master_put;
475 }
476
477 /* just checking if the clock returns a sane value */
478 clk_hz = clk_get_rate(bs->clk);
479 if (!clk_hz) {
480 dev_err(&pdev->dev, "clock returns 0 Hz\n");
481 err = -ENODEV;
482 goto out_clk_disable;
483 }
484
Martin Sperl07bce092015-10-15 10:10:20 +0000485 /* reset SPI-HW block */
486 bcm2835aux_spi_reset_hw(bs);
487
Martin Sperl1ea29b32015-09-11 11:22:04 +0000488 err = devm_request_irq(&pdev->dev, bs->irq,
489 bcm2835aux_spi_interrupt,
490 IRQF_SHARED,
491 dev_name(&pdev->dev), master);
492 if (err) {
493 dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
494 goto out_clk_disable;
495 }
496
Martin Sperl1ea29b32015-09-11 11:22:04 +0000497 err = devm_spi_register_master(&pdev->dev, master);
498 if (err) {
499 dev_err(&pdev->dev, "could not register SPI master: %d\n", err);
500 goto out_clk_disable;
501 }
502
503 return 0;
504
505out_clk_disable:
506 clk_disable_unprepare(bs->clk);
507out_master_put:
508 spi_master_put(master);
509 return err;
510}
511
512static int bcm2835aux_spi_remove(struct platform_device *pdev)
513{
514 struct spi_master *master = platform_get_drvdata(pdev);
515 struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
516
517 bcm2835aux_spi_reset_hw(bs);
518
519 /* disable the HW block by releasing the clock */
520 clk_disable_unprepare(bs->clk);
521
522 return 0;
523}
524
525static const struct of_device_id bcm2835aux_spi_match[] = {
526 { .compatible = "brcm,bcm2835-aux-spi", },
527 {}
528};
529MODULE_DEVICE_TABLE(of, bcm2835aux_spi_match);
530
531static struct platform_driver bcm2835aux_spi_driver = {
532 .driver = {
533 .name = "spi-bcm2835aux",
534 .of_match_table = bcm2835aux_spi_match,
535 },
536 .probe = bcm2835aux_spi_probe,
537 .remove = bcm2835aux_spi_remove,
538};
539module_platform_driver(bcm2835aux_spi_driver);
540
541MODULE_DESCRIPTION("SPI controller driver for Broadcom BCM2835 aux");
542MODULE_AUTHOR("Martin Sperl <kernel@martin.sperl.org>");
543MODULE_LICENSE("GPL v2");