2 * Blackfin On-Chip Two Wire Interface Driver
4 * Copyright 2005-2007 Analog Devices Inc.
6 * Enter bugs at http://blackfin.uclinux.org/
8 * Licensed under the GPL-2 or later.
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/i2c.h>
15 #include <linux/slab.h>
18 #include <linux/timer.h>
19 #include <linux/spinlock.h>
20 #include <linux/completion.h>
21 #include <linux/interrupt.h>
22 #include <linux/platform_device.h>
23 #include <linux/delay.h>
26 #include <asm/portmux.h>
27 #include <asm/bfin_twi.h>
30 #define TWI_I2C_MODE_STANDARD 1
31 #define TWI_I2C_MODE_STANDARDSUB 2
32 #define TWI_I2C_MODE_COMBINED 3
33 #define TWI_I2C_MODE_REPEAT 4
35 static void bfin_twi_handle_interrupt(struct bfin_twi_iface
*iface
,
36 unsigned short twi_int_status
)
38 unsigned short mast_stat
= read_MASTER_STAT(iface
);
40 if (twi_int_status
& XMTSERV
) {
41 if (iface
->writeNum
<= 0) {
42 /* start receive immediately after complete sending in
45 if (iface
->cur_mode
== TWI_I2C_MODE_COMBINED
)
46 write_MASTER_CTL(iface
,
47 read_MASTER_CTL(iface
) | MDIR
);
48 else if (iface
->manual_stop
)
49 write_MASTER_CTL(iface
,
50 read_MASTER_CTL(iface
) | STOP
);
51 else if (iface
->cur_mode
== TWI_I2C_MODE_REPEAT
&&
52 iface
->cur_msg
+ 1 < iface
->msg_num
) {
53 if (iface
->pmsg
[iface
->cur_msg
+ 1].flags
&
55 write_MASTER_CTL(iface
,
56 read_MASTER_CTL(iface
) |
59 write_MASTER_CTL(iface
,
60 read_MASTER_CTL(iface
) &
64 /* Transmit next data */
65 while (iface
->writeNum
> 0 &&
66 (read_FIFO_STAT(iface
) & XMTSTAT
) != XMT_FULL
) {
67 write_XMT_DATA8(iface
, *(iface
->transPtr
++));
71 if (twi_int_status
& RCVSERV
) {
72 while (iface
->readNum
> 0 &&
73 (read_FIFO_STAT(iface
) & RCVSTAT
)) {
74 /* Receive next data */
75 *(iface
->transPtr
) = read_RCV_DATA8(iface
);
76 if (iface
->cur_mode
== TWI_I2C_MODE_COMBINED
) {
77 /* Change combine mode into sub mode after
80 iface
->cur_mode
= TWI_I2C_MODE_STANDARDSUB
;
81 /* Get read number from first byte in block
84 if (iface
->readNum
== 1 && iface
->manual_stop
)
85 iface
->readNum
= *iface
->transPtr
+ 1;
91 if (iface
->readNum
== 0) {
92 if (iface
->manual_stop
) {
93 /* Temporary workaround to avoid possible bus stall -
94 * Flush FIFO before issuing the STOP condition
96 read_RCV_DATA16(iface
);
97 write_MASTER_CTL(iface
,
98 read_MASTER_CTL(iface
) | STOP
);
99 } else if (iface
->cur_mode
== TWI_I2C_MODE_REPEAT
&&
100 iface
->cur_msg
+ 1 < iface
->msg_num
) {
101 if (iface
->pmsg
[iface
->cur_msg
+ 1].flags
& I2C_M_RD
)
102 write_MASTER_CTL(iface
,
103 read_MASTER_CTL(iface
) | MDIR
);
105 write_MASTER_CTL(iface
,
106 read_MASTER_CTL(iface
) & ~MDIR
);
110 if (twi_int_status
& MERR
) {
111 write_INT_MASK(iface
, 0);
112 write_MASTER_STAT(iface
, 0x3e);
113 write_MASTER_CTL(iface
, 0);
114 iface
->result
= -EIO
;
116 if (mast_stat
& LOSTARB
)
117 dev_dbg(&iface
->adap
.dev
, "Lost Arbitration\n");
118 if (mast_stat
& ANAK
)
119 dev_dbg(&iface
->adap
.dev
, "Address Not Acknowledged\n");
120 if (mast_stat
& DNAK
)
121 dev_dbg(&iface
->adap
.dev
, "Data Not Acknowledged\n");
122 if (mast_stat
& BUFRDERR
)
123 dev_dbg(&iface
->adap
.dev
, "Buffer Read Error\n");
124 if (mast_stat
& BUFWRERR
)
125 dev_dbg(&iface
->adap
.dev
, "Buffer Write Error\n");
127 /* Faulty slave devices, may drive SDA low after a transfer
128 * finishes. To release the bus this code generates up to 9
129 * extra clocks until SDA is released.
132 if (read_MASTER_STAT(iface
) & SDASEN
) {
135 write_MASTER_CTL(iface
, SCLOVR
);
137 write_MASTER_CTL(iface
, 0);
139 } while ((read_MASTER_STAT(iface
) & SDASEN
) && cnt
--);
141 write_MASTER_CTL(iface
, SDAOVR
| SCLOVR
);
143 write_MASTER_CTL(iface
, SDAOVR
);
145 write_MASTER_CTL(iface
, 0);
148 /* If it is a quick transfer, only address without data,
149 * not an err, return 1.
151 if (iface
->cur_mode
== TWI_I2C_MODE_STANDARD
&&
152 iface
->transPtr
== NULL
&&
153 (twi_int_status
& MCOMP
) && (mast_stat
& DNAK
))
156 complete(&iface
->complete
);
159 if (twi_int_status
& MCOMP
) {
160 if (twi_int_status
& (XMTSERV
| RCVSERV
) &&
161 (read_MASTER_CTL(iface
) & MEN
) == 0 &&
162 (iface
->cur_mode
== TWI_I2C_MODE_REPEAT
||
163 iface
->cur_mode
== TWI_I2C_MODE_COMBINED
)) {
165 write_INT_MASK(iface
, 0);
166 write_MASTER_CTL(iface
, 0);
167 } else if (iface
->cur_mode
== TWI_I2C_MODE_COMBINED
) {
168 if (iface
->readNum
== 0) {
169 /* set the read number to 1 and ask for manual
170 * stop in block combine mode
173 iface
->manual_stop
= 1;
174 write_MASTER_CTL(iface
,
175 read_MASTER_CTL(iface
) | (0xff << 6));
177 /* set the readd number in other
180 write_MASTER_CTL(iface
,
181 (read_MASTER_CTL(iface
) &
183 (iface
->readNum
<< 6));
185 /* remove restart bit and enable master receive */
186 write_MASTER_CTL(iface
,
187 read_MASTER_CTL(iface
) & ~RSTART
);
188 } else if (iface
->cur_mode
== TWI_I2C_MODE_REPEAT
&&
189 iface
->cur_msg
+ 1 < iface
->msg_num
) {
191 iface
->transPtr
= iface
->pmsg
[iface
->cur_msg
].buf
;
192 iface
->writeNum
= iface
->readNum
=
193 iface
->pmsg
[iface
->cur_msg
].len
;
194 /* Set Transmit device address */
195 write_MASTER_ADDR(iface
,
196 iface
->pmsg
[iface
->cur_msg
].addr
);
197 if (iface
->pmsg
[iface
->cur_msg
].flags
& I2C_M_RD
)
198 iface
->read_write
= I2C_SMBUS_READ
;
200 iface
->read_write
= I2C_SMBUS_WRITE
;
201 /* Transmit first data */
202 if (iface
->writeNum
> 0) {
203 write_XMT_DATA8(iface
,
204 *(iface
->transPtr
++));
209 if (iface
->pmsg
[iface
->cur_msg
].len
<= 255) {
210 write_MASTER_CTL(iface
,
211 (read_MASTER_CTL(iface
) &
213 (iface
->pmsg
[iface
->cur_msg
].len
<< 6));
214 iface
->manual_stop
= 0;
216 write_MASTER_CTL(iface
,
217 (read_MASTER_CTL(iface
) |
219 iface
->manual_stop
= 1;
221 /* remove restart bit before last message */
222 if (iface
->cur_msg
+ 1 == iface
->msg_num
)
223 write_MASTER_CTL(iface
,
224 read_MASTER_CTL(iface
) & ~RSTART
);
227 write_INT_MASK(iface
, 0);
228 write_MASTER_CTL(iface
, 0);
230 complete(&iface
->complete
);
234 /* Interrupt handler */
235 static irqreturn_t
bfin_twi_interrupt_entry(int irq
, void *dev_id
)
237 struct bfin_twi_iface
*iface
= dev_id
;
239 unsigned short twi_int_status
;
241 spin_lock_irqsave(&iface
->lock
, flags
);
243 twi_int_status
= read_INT_STAT(iface
);
246 /* Clear interrupt status */
247 write_INT_STAT(iface
, twi_int_status
);
248 bfin_twi_handle_interrupt(iface
, twi_int_status
);
250 spin_unlock_irqrestore(&iface
->lock
, flags
);
255 * One i2c master transfer
257 static int bfin_twi_do_master_xfer(struct i2c_adapter
*adap
,
258 struct i2c_msg
*msgs
, int num
)
260 struct bfin_twi_iface
*iface
= adap
->algo_data
;
261 struct i2c_msg
*pmsg
;
264 if (!(read_CONTROL(iface
) & TWI_ENA
))
267 if (read_MASTER_STAT(iface
) & BUSBUSY
)
271 iface
->msg_num
= num
;
275 if (pmsg
->flags
& I2C_M_TEN
) {
276 dev_err(&adap
->dev
, "10 bits addr not supported!\n");
280 if (iface
->msg_num
> 1)
281 iface
->cur_mode
= TWI_I2C_MODE_REPEAT
;
282 iface
->manual_stop
= 0;
283 iface
->transPtr
= pmsg
->buf
;
284 iface
->writeNum
= iface
->readNum
= pmsg
->len
;
286 init_completion(&(iface
->complete
));
287 /* Set Transmit device address */
288 write_MASTER_ADDR(iface
, pmsg
->addr
);
290 /* FIFO Initiation. Data in FIFO should be
291 * discarded before start a new operation.
293 write_FIFO_CTL(iface
, 0x3);
294 write_FIFO_CTL(iface
, 0);
296 if (pmsg
->flags
& I2C_M_RD
)
297 iface
->read_write
= I2C_SMBUS_READ
;
299 iface
->read_write
= I2C_SMBUS_WRITE
;
300 /* Transmit first data */
301 if (iface
->writeNum
> 0) {
302 write_XMT_DATA8(iface
, *(iface
->transPtr
++));
308 write_INT_STAT(iface
, MERR
| MCOMP
| XMTSERV
| RCVSERV
);
310 /* Interrupt mask . Enable XMT, RCV interrupt */
311 write_INT_MASK(iface
, MCOMP
| MERR
| RCVSERV
| XMTSERV
);
313 if (pmsg
->len
<= 255)
314 write_MASTER_CTL(iface
, pmsg
->len
<< 6);
316 write_MASTER_CTL(iface
, 0xff << 6);
317 iface
->manual_stop
= 1;
321 write_MASTER_CTL(iface
, read_MASTER_CTL(iface
) | MEN
|
322 (iface
->msg_num
> 1 ? RSTART
: 0) |
323 ((iface
->read_write
== I2C_SMBUS_READ
) ? MDIR
: 0) |
324 ((CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ
> 100) ? FAST
: 0));
326 while (!iface
->result
) {
327 if (!wait_for_completion_timeout(&iface
->complete
,
330 dev_err(&adap
->dev
, "master transfer timeout\n");
334 if (iface
->result
== 1)
335 rc
= iface
->cur_msg
+ 1;
343 * Generic i2c master transfer entrypoint
345 static int bfin_twi_master_xfer(struct i2c_adapter
*adap
,
346 struct i2c_msg
*msgs
, int num
)
348 return bfin_twi_do_master_xfer(adap
, msgs
, num
);
352 * One I2C SMBus transfer
354 int bfin_twi_do_smbus_xfer(struct i2c_adapter
*adap
, u16 addr
,
355 unsigned short flags
, char read_write
,
356 u8 command
, int size
, union i2c_smbus_data
*data
)
358 struct bfin_twi_iface
*iface
= adap
->algo_data
;
361 if (!(read_CONTROL(iface
) & TWI_ENA
))
364 if (read_MASTER_STAT(iface
) & BUSBUSY
)
370 /* Prepare datas & select mode */
372 case I2C_SMBUS_QUICK
:
373 iface
->transPtr
= NULL
;
374 iface
->cur_mode
= TWI_I2C_MODE_STANDARD
;
378 iface
->transPtr
= NULL
;
380 if (read_write
== I2C_SMBUS_READ
)
384 iface
->transPtr
= &data
->byte
;
386 iface
->cur_mode
= TWI_I2C_MODE_STANDARD
;
388 case I2C_SMBUS_BYTE_DATA
:
389 if (read_write
== I2C_SMBUS_READ
) {
391 iface
->cur_mode
= TWI_I2C_MODE_COMBINED
;
394 iface
->cur_mode
= TWI_I2C_MODE_STANDARDSUB
;
396 iface
->transPtr
= &data
->byte
;
398 case I2C_SMBUS_WORD_DATA
:
399 if (read_write
== I2C_SMBUS_READ
) {
401 iface
->cur_mode
= TWI_I2C_MODE_COMBINED
;
404 iface
->cur_mode
= TWI_I2C_MODE_STANDARDSUB
;
406 iface
->transPtr
= (u8
*)&data
->word
;
408 case I2C_SMBUS_PROC_CALL
:
411 iface
->cur_mode
= TWI_I2C_MODE_COMBINED
;
412 iface
->transPtr
= (u8
*)&data
->word
;
414 case I2C_SMBUS_BLOCK_DATA
:
415 if (read_write
== I2C_SMBUS_READ
) {
417 iface
->cur_mode
= TWI_I2C_MODE_COMBINED
;
419 iface
->writeNum
= data
->block
[0] + 1;
420 iface
->cur_mode
= TWI_I2C_MODE_STANDARDSUB
;
422 iface
->transPtr
= data
->block
;
424 case I2C_SMBUS_I2C_BLOCK_DATA
:
425 if (read_write
== I2C_SMBUS_READ
) {
426 iface
->readNum
= data
->block
[0];
427 iface
->cur_mode
= TWI_I2C_MODE_COMBINED
;
429 iface
->writeNum
= data
->block
[0];
430 iface
->cur_mode
= TWI_I2C_MODE_STANDARDSUB
;
432 iface
->transPtr
= (u8
*)&data
->block
[1];
439 iface
->manual_stop
= 0;
440 iface
->read_write
= read_write
;
441 iface
->command
= command
;
442 init_completion(&(iface
->complete
));
444 /* FIFO Initiation. Data in FIFO should be discarded before
445 * start a new operation.
447 write_FIFO_CTL(iface
, 0x3);
448 write_FIFO_CTL(iface
, 0);
451 write_INT_STAT(iface
, MERR
| MCOMP
| XMTSERV
| RCVSERV
);
453 /* Set Transmit device address */
454 write_MASTER_ADDR(iface
, addr
);
456 switch (iface
->cur_mode
) {
457 case TWI_I2C_MODE_STANDARDSUB
:
458 write_XMT_DATA8(iface
, iface
->command
);
459 write_INT_MASK(iface
, MCOMP
| MERR
|
460 ((iface
->read_write
== I2C_SMBUS_READ
) ?
463 if (iface
->writeNum
+ 1 <= 255)
464 write_MASTER_CTL(iface
, (iface
->writeNum
+ 1) << 6);
466 write_MASTER_CTL(iface
, 0xff << 6);
467 iface
->manual_stop
= 1;
470 write_MASTER_CTL(iface
, read_MASTER_CTL(iface
) | MEN
|
471 ((CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ
>100) ? FAST
: 0));
473 case TWI_I2C_MODE_COMBINED
:
474 write_XMT_DATA8(iface
, iface
->command
);
475 write_INT_MASK(iface
, MCOMP
| MERR
| RCVSERV
| XMTSERV
);
477 if (iface
->writeNum
> 0)
478 write_MASTER_CTL(iface
, (iface
->writeNum
+ 1) << 6);
480 write_MASTER_CTL(iface
, 0x1 << 6);
482 write_MASTER_CTL(iface
, read_MASTER_CTL(iface
) | MEN
| RSTART
|
483 ((CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ
>100) ? FAST
: 0));
486 write_MASTER_CTL(iface
, 0);
487 if (size
!= I2C_SMBUS_QUICK
) {
488 /* Don't access xmit data register when this is a
491 if (iface
->read_write
!= I2C_SMBUS_READ
) {
492 if (iface
->writeNum
> 0) {
493 write_XMT_DATA8(iface
,
494 *(iface
->transPtr
++));
495 if (iface
->writeNum
<= 255)
496 write_MASTER_CTL(iface
,
497 iface
->writeNum
<< 6);
499 write_MASTER_CTL(iface
,
501 iface
->manual_stop
= 1;
505 write_XMT_DATA8(iface
, iface
->command
);
506 write_MASTER_CTL(iface
, 1 << 6);
509 if (iface
->readNum
> 0 && iface
->readNum
<= 255)
510 write_MASTER_CTL(iface
,
511 iface
->readNum
<< 6);
512 else if (iface
->readNum
> 255) {
513 write_MASTER_CTL(iface
, 0xff << 6);
514 iface
->manual_stop
= 1;
519 write_INT_MASK(iface
, MCOMP
| MERR
|
520 ((iface
->read_write
== I2C_SMBUS_READ
) ?
524 write_MASTER_CTL(iface
, read_MASTER_CTL(iface
) | MEN
|
525 ((iface
->read_write
== I2C_SMBUS_READ
) ? MDIR
: 0) |
526 ((CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ
> 100) ? FAST
: 0));
530 while (!iface
->result
) {
531 if (!wait_for_completion_timeout(&iface
->complete
,
534 dev_err(&adap
->dev
, "smbus transfer timeout\n");
538 rc
= (iface
->result
>= 0) ? 0 : -1;
544 * Generic I2C SMBus transfer entrypoint
546 int bfin_twi_smbus_xfer(struct i2c_adapter
*adap
, u16 addr
,
547 unsigned short flags
, char read_write
,
548 u8 command
, int size
, union i2c_smbus_data
*data
)
550 return bfin_twi_do_smbus_xfer(adap
, addr
, flags
,
551 read_write
, command
, size
, data
);
555 * Return what the adapter supports
557 static u32
bfin_twi_functionality(struct i2c_adapter
*adap
)
559 return I2C_FUNC_SMBUS_QUICK
| I2C_FUNC_SMBUS_BYTE
|
560 I2C_FUNC_SMBUS_BYTE_DATA
| I2C_FUNC_SMBUS_WORD_DATA
|
561 I2C_FUNC_SMBUS_BLOCK_DATA
| I2C_FUNC_SMBUS_PROC_CALL
|
562 I2C_FUNC_I2C
| I2C_FUNC_SMBUS_I2C_BLOCK
;
565 static const struct i2c_algorithm bfin_twi_algorithm
= {
566 .master_xfer
= bfin_twi_master_xfer
,
567 .smbus_xfer
= bfin_twi_smbus_xfer
,
568 .functionality
= bfin_twi_functionality
,
571 #ifdef CONFIG_PM_SLEEP
572 static int i2c_bfin_twi_suspend(struct device
*dev
)
574 struct bfin_twi_iface
*iface
= dev_get_drvdata(dev
);
576 iface
->saved_clkdiv
= read_CLKDIV(iface
);
577 iface
->saved_control
= read_CONTROL(iface
);
579 free_irq(iface
->irq
, iface
);
582 write_CONTROL(iface
, iface
->saved_control
& ~TWI_ENA
);
587 static int i2c_bfin_twi_resume(struct device
*dev
)
589 struct bfin_twi_iface
*iface
= dev_get_drvdata(dev
);
591 int rc
= request_irq(iface
->irq
, bfin_twi_interrupt_entry
,
592 0, to_platform_device(dev
)->name
, iface
);
594 dev_err(dev
, "Can't get IRQ %d !\n", iface
->irq
);
598 /* Resume TWI interface clock as specified */
599 write_CLKDIV(iface
, iface
->saved_clkdiv
);
602 write_CONTROL(iface
, iface
->saved_control
);
607 static SIMPLE_DEV_PM_OPS(i2c_bfin_twi_pm
,
608 i2c_bfin_twi_suspend
, i2c_bfin_twi_resume
);
609 #define I2C_BFIN_TWI_PM_OPS (&i2c_bfin_twi_pm)
611 #define I2C_BFIN_TWI_PM_OPS NULL
614 static int i2c_bfin_twi_probe(struct platform_device
*pdev
)
616 struct bfin_twi_iface
*iface
;
617 struct i2c_adapter
*p_adap
;
618 struct resource
*res
;
620 unsigned int clkhilow
;
622 iface
= devm_kzalloc(&pdev
->dev
, sizeof(struct bfin_twi_iface
),
625 dev_err(&pdev
->dev
, "Cannot allocate memory\n");
629 spin_lock_init(&(iface
->lock
));
631 /* Find and map our resources */
632 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
633 iface
->regs_base
= devm_ioremap_resource(&pdev
->dev
, res
);
634 if (IS_ERR(iface
->regs_base
)) {
635 dev_err(&pdev
->dev
, "Cannot map IO\n");
636 return PTR_ERR(iface
->regs_base
);
639 iface
->irq
= platform_get_irq(pdev
, 0);
640 if (iface
->irq
< 0) {
641 dev_err(&pdev
->dev
, "No IRQ specified\n");
645 p_adap
= &iface
->adap
;
646 p_adap
->nr
= pdev
->id
;
647 strlcpy(p_adap
->name
, pdev
->name
, sizeof(p_adap
->name
));
648 p_adap
->algo
= &bfin_twi_algorithm
;
649 p_adap
->algo_data
= iface
;
650 p_adap
->class = I2C_CLASS_DEPRECATED
;
651 p_adap
->dev
.parent
= &pdev
->dev
;
652 p_adap
->timeout
= 5 * HZ
;
655 rc
= peripheral_request_list(
656 dev_get_platdata(&pdev
->dev
),
659 dev_err(&pdev
->dev
, "Can't setup pin mux!\n");
663 rc
= devm_request_irq(&pdev
->dev
, iface
->irq
, bfin_twi_interrupt_entry
,
664 0, pdev
->name
, iface
);
666 dev_err(&pdev
->dev
, "Can't get IRQ %d !\n", iface
->irq
);
671 /* Set TWI internal clock as 10MHz */
672 write_CONTROL(iface
, ((get_sclk() / 1000 / 1000 + 5) / 10) & 0x7F);
675 * We will not end up with a CLKDIV=0 because no one will specify
676 * 20kHz SCL or less in Kconfig now. (5 * 1000 / 20 = 250)
678 clkhilow
= ((10 * 1000 / CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ
) + 1) / 2;
680 /* Set Twi interface clock as specified */
681 write_CLKDIV(iface
, (clkhilow
<< 8) | clkhilow
);
684 write_CONTROL(iface
, read_CONTROL(iface
) | TWI_ENA
);
686 rc
= i2c_add_numbered_adapter(p_adap
);
690 platform_set_drvdata(pdev
, iface
);
692 dev_info(&pdev
->dev
, "Blackfin BF5xx on-chip I2C TWI Controller, "
693 "regs_base@%p\n", iface
->regs_base
);
698 peripheral_free_list(dev_get_platdata(&pdev
->dev
));
702 static int i2c_bfin_twi_remove(struct platform_device
*pdev
)
704 struct bfin_twi_iface
*iface
= platform_get_drvdata(pdev
);
706 i2c_del_adapter(&(iface
->adap
));
707 peripheral_free_list(dev_get_platdata(&pdev
->dev
));
712 static struct platform_driver i2c_bfin_twi_driver
= {
713 .probe
= i2c_bfin_twi_probe
,
714 .remove
= i2c_bfin_twi_remove
,
716 .name
= "i2c-bfin-twi",
717 .pm
= I2C_BFIN_TWI_PM_OPS
,
721 static int __init
i2c_bfin_twi_init(void)
723 return platform_driver_register(&i2c_bfin_twi_driver
);
726 static void __exit
i2c_bfin_twi_exit(void)
728 platform_driver_unregister(&i2c_bfin_twi_driver
);
731 subsys_initcall(i2c_bfin_twi_init
);
732 module_exit(i2c_bfin_twi_exit
);
734 MODULE_AUTHOR("Bryan Wu, Sonic Zhang");
735 MODULE_DESCRIPTION("Blackfin BF5xx on-chip I2C TWI Controller Driver");
736 MODULE_LICENSE("GPL");
737 MODULE_ALIAS("platform:i2c-bfin-twi");