4 * Copyright (C) 2007 Alex Dubov <oakad@yahoo.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Special thanks to Carlos Corbacho for providing various MemoryStick cards
11 * that made this driver possible.
15 #include <linux/tifm.h>
16 #include <linux/memstick.h>
17 #include <linux/highmem.h>
18 #include <linux/scatterlist.h>
19 #include <linux/log2.h>
22 #define DRIVER_NAME "tifm_ms"
23 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
24 #define DRIVER_VERSION "0.1"
26 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
29 module_param(no_dma
, bool, 0644);
31 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
32 #define TIFM_MS_TIMEOUT 0x00100
33 #define TIFM_MS_BADCRC 0x00200
34 #define TIFM_MS_EOTPC 0x01000
35 #define TIFM_MS_INT 0x02000
37 /* The meaning of the bit majority in this constant is unknown. */
38 #define TIFM_MS_SERIAL 0x04010
41 * Some control bits of TIFM appear to conform to Sony's reference design,
42 * so I'm just assuming they all are.
44 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
46 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
47 #define TIFM_MS_SYS_LATCH 0x00100
48 #define TIFM_MS_SYS_NOT_RDY 0x00800
49 #define TIFM_MS_SYS_DATA 0x10000
51 #define TIFM_MS_STAT_DRQ 0x04000
52 #define TIFM_MS_STAT_MSINT 0x02000
53 #define TIFM_MS_STAT_RDY 0x01000
54 #define TIFM_MS_STAT_CRC 0x00200
55 #define TIFM_MS_STAT_TOE 0x00100
56 #define TIFM_MS_STAT_EMP 0x00020
57 #define TIFM_MS_STAT_FUL 0x00010
58 #define TIFM_MS_STAT_CED 0x00008
59 #define TIFM_MS_STAT_ERR 0x00004
60 #define TIFM_MS_STAT_BRQ 0x00002
61 #define TIFM_MS_STAT_CNK 0x00001
63 #define TIFM_MS_SYS_DMA 0x10000
64 #define TIFM_MS_SYS_RESET 0x08000
65 #define TIFM_MS_SYS_SRAC 0x04000
66 #define TIFM_MS_SYS_INTEN 0x02000
67 #define TIFM_MS_SYS_NOCRC 0x01000
68 #define TIFM_MS_SYS_INTCLR 0x00800
69 #define TIFM_MS_SYS_MSIEN 0x00400
70 #define TIFM_MS_SYS_FCLR 0x00200
71 #define TIFM_MS_SYS_FDIR 0x00100
72 #define TIFM_MS_SYS_DAM 0x00080
73 #define TIFM_MS_SYS_DRM 0x00040
74 #define TIFM_MS_SYS_DRQSL 0x00020
75 #define TIFM_MS_SYS_REI 0x00010
76 #define TIFM_MS_SYS_REO 0x00008
77 #define TIFM_MS_SYS_BSY_MASK 0x00007
79 #define TIFM_MS_SYS_FIFO (TIFM_MS_SYS_INTEN | TIFM_MS_SYS_MSIEN \
80 | TIFM_MS_SYS_FCLR | TIFM_MS_SYS_BSY_MASK)
81 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
85 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
94 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
99 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
100 unsigned short eject
:1,
102 unsigned short cmd_flags
;
104 struct timer_list timer
;
105 struct memstick_request
*req
;
106 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
107 unsigned int mode_mask
;
108 unsigned int block_pos
;
109 unsigned long timeout_jiffies
;
110 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
112 struct timer_list timer
;
113 struct memstick_request
*req
;
115 unsigned char eject
:1,
117 unsigned char cmd_flags
;
118 unsigned char io_pos
;
119 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
120 unsigned int io_word
;
123 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
124 static void tifm_ms_read_fifo(struct tifm_ms
*host
, unsigned int fifo_offset
,
125 struct page
*pg
, unsigned int page_off
,
128 static unsigned int tifm_ms_read_data(struct tifm_ms
*host
,
129 unsigned char *buf
, unsigned int length
)
130 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
132 struct tifm_dev
*sock
= host
->dev
;
133 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
134 unsigned int cnt
= 0, off
= 0;
135 unsigned char *buf
= kmap_atomic(pg
, KM_BIO_DST_IRQ
) + page_off
;
137 unsigned int off
= 0;
139 while (host
->io_pos
&& length
) {
140 buf
[off
++] = host
->io_word
& 0xff;
145 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
147 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
148 if (host
->cmd_flags
& DATA_CARRY
) {
149 while ((fifo_offset
& 3) && length
) {
154 while (!(TIFM_MS_STAT_EMP
& readl(sock
->addr
+ SOCK_MS_STATUS
))) {
157 *(unsigned int *)(buf
+ off
) = __raw_readl(sock
->addr
164 && !(TIFM_MS_STAT_EMP
& readl(sock
->addr
+ SOCK_MS_STATUS
))) {
165 host
->io_word
= readl(sock
->addr
+ SOCK_MS_DATA
);
166 for (host
->io_pos
= 4; host
->io_pos
; --host
->io_pos
) {
167 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
168 buf
[off
++] = host
->io_word
& 0xff;
171 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
176 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
178 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
179 if (!(fifo_offset
& 3))
180 host
->cmd_flags
&= ~DATA_CARRY
;
184 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
187 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
189 host
->io_word
= readl(sock
->addr
+ SOCK_FIFO_ACCESS
192 while (length
&& cnt
) {
193 buf
[off
++] = (host
->io_word
>> 8) & 0xff;
197 fifo_offset
+= 4 - cnt
;
201 host
->cmd_flags
|= DATA_CARRY
;
203 kunmap_atomic(buf
- page_off
, KM_BIO_DST_IRQ
);
206 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
209 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
210 static void tifm_ms_write_fifo(struct tifm_ms
*host
, unsigned int fifo_offset
,
211 struct page
*pg
, unsigned int page_off
,
214 static unsigned int tifm_ms_write_data(struct tifm_ms
*host
,
215 unsigned char *buf
, unsigned int length
)
216 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
218 struct tifm_dev
*sock
= host
->dev
;
219 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
220 unsigned int cnt
= 0, off
= 0;
221 unsigned char *buf
= kmap_atomic(pg
, KM_BIO_SRC_IRQ
) + page_off
;
223 unsigned int off
= 0;
224 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
226 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
227 if (host
->cmd_flags
& DATA_CARRY
) {
228 while (fifo_offset
& 3) {
229 host
->io_word
|= buf
[off
++] << (8 * (fifo_offset
& 3));
232 while (host
->io_pos
< 4 && length
) {
233 host
->io_word
|= buf
[off
++] << (host
->io_pos
* 8);
235 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
237 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
240 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
242 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
243 if (!(fifo_offset
& 3)) {
244 writel(host
->io_word
, sock
->addr
+ SOCK_FIFO_ACCESS
247 host
->cmd_flags
&= ~DATA_CARRY
;
252 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
255 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
259 if (host
->io_pos
== 4
260 && !(TIFM_MS_STAT_FUL
& readl(sock
->addr
+ SOCK_MS_STATUS
))) {
261 writel(TIFM_MS_SYS_FDIR
| readl(sock
->addr
+ SOCK_MS_SYSTEM
),
262 sock
->addr
+ SOCK_MS_SYSTEM
);
263 writel(host
->io_word
, sock
->addr
+ SOCK_MS_DATA
);
265 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
267 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
268 while (length
&& cnt
) {
269 host
->io_word
|= buf
[off
++] << (4 - cnt
);
273 fifo_offset
+= 4 - cnt
;
275 writel(host
->io_word
, sock
->addr
+ SOCK_FIFO_ACCESS
281 host
->cmd_flags
|= DATA_CARRY
;
283 } else if (host
->io_pos
) {
286 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
288 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
289 kunmap_atomic(buf
- page_off
, KM_BIO_SRC_IRQ
);
294 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
296 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
297 static void tifm_ms_move_block(struct tifm_ms
*host
, unsigned int length
)
300 unsigned int off
= host
->req
->sg
.offset
+ host
->block_pos
;
301 unsigned int p_off
, p_cnt
;
305 while (!(TIFM_MS_STAT_FUL
& readl(sock
->addr
+ SOCK_MS_STATUS
))) {
308 writel(TIFM_MS_SYS_FDIR
| readl(sock
->addr
+ SOCK_MS_SYSTEM
),
309 sock
->addr
+ SOCK_MS_SYSTEM
);
310 __raw_writel(*(unsigned int *)(buf
+ off
),
311 sock
->addr
+ SOCK_MS_DATA
);
315 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
317 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
318 dev_dbg(&host
->dev
->dev
, "moving block\n");
319 local_irq_save(flags
);
322 pg
= nth_page(sg_page(&host
->req
->sg
), off
>> PAGE_SHIFT
);
323 p_off
= offset_in_page(off
);
324 p_cnt
= PAGE_SIZE
- p_off
;
325 p_cnt
= min(p_cnt
, t_size
);
329 host
->io_word
|= buf
[off
+ 2] << 16;
332 host
->io_word
|= buf
[off
+ 1] << 8;
335 host
->io_word
|= buf
[off
];
338 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
340 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
341 if (host
->req
->data_dir
== WRITE
)
342 tifm_ms_write_fifo(host
, length
- t_size
,
345 tifm_ms_read_fifo(host
, length
- t_size
,
349 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
351 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
354 local_irq_restore(flags
);
357 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
360 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
361 static int tifm_ms_transfer_data(struct tifm_ms
*host
, int skip
)
363 static unsigned int tifm_ms_transfer_data(struct tifm_ms
*host
)
364 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
366 struct tifm_dev
*sock
= host
->dev
;
367 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
368 unsigned int length
= host
->req
->sg
.length
- host
->block_pos
;
372 unsigned int t_size
, p_off
, p_cnt
;
375 unsigned long flags
= 0;
377 if (host
->req
->long_data
) {
378 length
= host
->req
->sg
.length
- host
->block_pos
;
379 off
= host
->req
->sg
.offset
+ host
->block_pos
;
381 length
= host
->req
->data_len
- host
->block_pos
;
384 dev_dbg(&sock
->dev
, "fifo data transfer, %d, %d\n", length
,
388 if (host
->req
->long_data
) {
389 pg
= nth_page(sg_page(&host
->req
->sg
),
391 p_off
= offset_in_page(off
);
392 p_cnt
= PAGE_SIZE
- p_off
;
393 p_cnt
= min(p_cnt
, length
);
395 local_irq_save(flags
);
396 buf
= kmap_atomic(pg
, KM_BIO_SRC_IRQ
) + p_off
;
398 buf
= host
->req
->data
+ host
->block_pos
;
399 p_cnt
= host
->req
->data_len
- host
->block_pos
;
401 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
403 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
407 t_size
= host
->req
->data_dir
== WRITE
408 ? tifm_ms_write_data(host
, buf
, p_cnt
)
409 : tifm_ms_read_data(host
, buf
, p_cnt
);
410 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
412 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
413 if (length
> TIFM_FIFO_SIZE
)
414 length
= TIFM_FIFO_SIZE
;
416 if (host
->req
->long_data
) {
417 kunmap_atomic(buf
- p_off
, KM_BIO_SRC_IRQ
);
418 local_irq_restore(flags
);
420 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
422 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
424 tifm_ms_move_block(host
, length
);
425 host
->block_pos
+= length
;
429 host
->block_pos
+= t_size
;
432 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
435 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
436 if ((host
->req
->data_dir
== READ
)
437 && (host
->block_pos
== host
->req
->sg
.length
))
440 writel(ilog2(length
) - 2, sock
->addr
+ SOCK_FIFO_PAGE_SIZE
);
441 if (host
->req
->data_dir
== WRITE
)
442 writel((1 << 8) | TIFM_DMA_TX
, sock
->addr
+ SOCK_DMA_CONTROL
);
444 writel((1 << 8), sock
->addr
+ SOCK_DMA_CONTROL
);
446 dev_dbg(&sock
->dev
, "fifo data transfer, %d remaining\n", length
);
447 if (!length
&& (host
->req
->data_dir
== WRITE
)) {
449 writel(TIFM_MS_SYS_FDIR
450 | readl(sock
->addr
+ SOCK_MS_SYSTEM
),
451 sock
->addr
+ SOCK_MS_SYSTEM
);
452 writel(host
->io_word
, sock
->addr
+ SOCK_MS_DATA
);
454 writel(TIFM_MS_SYS_FDIR
455 | readl(sock
->addr
+ SOCK_MS_SYSTEM
),
456 sock
->addr
+ SOCK_MS_SYSTEM
);
457 writel(0, sock
->addr
+ SOCK_MS_DATA
);
459 readl(sock
->addr
+ SOCK_MS_DATA
);
461 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
463 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
467 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
470 static int tifm_ms_issue_cmd(struct tifm_ms
*host
)
472 struct tifm_dev
*sock
= host
->dev
;
474 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
475 unsigned int data_len
= 0, cmd
= 0, cmd_mask
= 0, cnt
, tval
= 0;
477 unsigned int data_len
, cmd
, sys_param
;
478 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
481 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
487 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
489 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
490 if (host
->req
->io_type
== MEMSTICK_IO_SG
) {
492 if (1 != tifm_map_sg(sock
, &host
->req
->sg
, 1,
493 host
->req
->data_dir
== READ
495 : PCI_DMA_TODEVICE
)) {
496 host
->req
->error
= -ENOMEM
;
497 return host
->req
->error
;
499 data_len
= sg_dma_len(&host
->req
->sg
);
501 data_len
= host
->req
->sg
.length
;
503 writel(TIFM_FIFO_INT_SETALL
,
504 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_CLEAR
);
505 writel(TIFM_FIFO_ENABLE
,
506 sock
->addr
+ SOCK_FIFO_CONTROL
);
507 writel(TIFM_FIFO_INTMASK
,
508 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_SET
);
510 data
= host
->req
->data
;
511 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
513 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
515 writel(ilog2(data_len
) - 2,
516 sock
->addr
+ SOCK_FIFO_PAGE_SIZE
);
517 writel(sg_dma_address(&host
->req
->sg
),
518 sock
->addr
+ SOCK_DMA_ADDRESS
);
519 if (host
->req
->data_dir
== WRITE
)
520 writel((1 << 8) | TIFM_DMA_TX
| TIFM_DMA_EN
,
521 sock
->addr
+ SOCK_DMA_CONTROL
);
523 writel((1 << 8) | TIFM_DMA_EN
,
524 sock
->addr
+ SOCK_DMA_CONTROL
);
526 tifm_ms_transfer_data(host
,
527 host
->req
->data_dir
== READ
);
530 host
->use_dma
= !no_dma
;
531 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
533 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
534 cmd_mask
= readl(sock
->addr
+ SOCK_MS_SYSTEM
);
535 cmd_mask
|= TIFM_MS_SYS_DATA
| TIFM_MS_SYS_NOT_RDY
;
536 writel(cmd_mask
, sock
->addr
+ SOCK_MS_SYSTEM
);
537 } else if (host
->req
->io_type
== MEMSTICK_IO_VAL
) {
538 data
= host
->req
->data
;
540 if (host
->req
->long_data
) {
541 data_len
= host
->req
->sg
.length
;
542 if (!is_power_of_2(data_len
))
545 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
546 data_len
= host
->req
->data_len
;
547 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
551 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
553 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
554 cmd_mask
= host
->mode_mask
| 0x2607; /* unknown constant */
556 if (host
->req
->data_dir
== WRITE
) {
557 cmd_mask
|= TIFM_MS_SYS_LATCH
;
558 writel(cmd_mask
, sock
->addr
+ SOCK_MS_SYSTEM
);
559 for (cnt
= 0; (data_len
- cnt
) >= 4; cnt
+= 4) {
560 writel(TIFM_MS_SYS_LATCH
561 | readl(sock
->addr
+ SOCK_MS_SYSTEM
),
562 sock
->addr
+ SOCK_MS_SYSTEM
);
563 __raw_writel(*(unsigned int *)(data
+ cnt
),
564 sock
->addr
+ SOCK_MS_DATA
);
565 dev_dbg(&sock
->dev
, "writing %x\n",
566 *(int *)(data
+ cnt
));
568 switch (data_len
- cnt
) {
570 tval
|= data
[cnt
+ 2] << 16;
572 tval
|= data
[cnt
+ 1] << 8;
575 writel(TIFM_MS_SYS_LATCH
576 | readl(sock
->addr
+ SOCK_MS_SYSTEM
),
577 sock
->addr
+ SOCK_MS_SYSTEM
);
578 writel(tval
, sock
->addr
+ SOCK_MS_DATA
);
579 dev_dbg(&sock
->dev
, "writing %x\n", tval
);
582 writel(TIFM_FIFO_INT_SETALL
,
583 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_CLEAR
);
584 writel(TIFM_FIFO_ENABLE
,
585 sock
->addr
+ SOCK_FIFO_CONTROL
);
588 if (1 != tifm_map_sg(sock
, &host
->req
->sg
, 1,
589 host
->req
->data_dir
== READ
591 : PCI_DMA_TODEVICE
)) {
592 host
->req
->error
= -ENOMEM
;
593 return host
->req
->error
;
595 data_len
= sg_dma_len(&host
->req
->sg
);
596 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
598 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
599 writel(TIFM_MS_SYS_LATCH
600 | readl(sock
->addr
+ SOCK_MS_SYSTEM
),
601 sock
->addr
+ SOCK_MS_SYSTEM
);
602 writel(0, sock
->addr
+ SOCK_MS_DATA
);
603 dev_dbg(&sock
->dev
, "writing %x\n", 0);
605 writel(ilog2(data_len
) - 2,
606 sock
->addr
+ SOCK_FIFO_PAGE_SIZE
);
607 writel(TIFM_FIFO_INTMASK
,
608 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_SET
);
609 sys_param
= TIFM_DMA_EN
| (1 << 8);
610 if (host
->req
->data_dir
== WRITE
)
611 sys_param
|= TIFM_DMA_TX
;
613 writel(TIFM_FIFO_INTMASK
,
614 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_SET
);
615 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
617 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
619 writel(cmd_mask
, sock
->addr
+ SOCK_MS_SYSTEM
);
621 writel(sg_dma_address(&host
->req
->sg
),
622 sock
->addr
+ SOCK_DMA_ADDRESS
);
623 writel(sys_param
, sock
->addr
+ SOCK_DMA_CONTROL
);
625 writel(host
->mode_mask
| TIFM_MS_SYS_FIFO
,
626 sock
->addr
+ SOCK_MS_SYSTEM
);
627 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
629 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
630 cmd_mask
= readl(sock
->addr
+ SOCK_MS_SYSTEM
);
631 cmd_mask
&= ~TIFM_MS_SYS_DATA
;
632 cmd_mask
|= TIFM_MS_SYS_NOT_RDY
;
633 dev_dbg(&sock
->dev
, "mask %x\n", cmd_mask
);
634 writel(cmd_mask
, sock
->addr
+ SOCK_MS_SYSTEM
);
638 writel(TIFM_FIFO_MORE
,
639 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_SET
);
641 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
643 mod_timer(&host
->timer
, jiffies
+ host
->timeout_jiffies
);
644 writel(TIFM_CTRL_LED
| readl(sock
->addr
+ SOCK_CONTROL
),
645 sock
->addr
+ SOCK_CONTROL
);
646 host
->req
->error
= 0;
648 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
650 sys_param
= readl(sock
->addr
+ SOCK_MS_SYSTEM
);
651 sys_param
|= TIFM_MS_SYS_INTCLR
;
654 sys_param
|= TIFM_MS_SYS_DMA
;
656 sys_param
&= ~TIFM_MS_SYS_DMA
;
658 writel(sys_param
, sock
->addr
+ SOCK_MS_SYSTEM
);
660 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
661 cmd
= (host
->req
->tpc
& 0xf) << 12;
663 writel(cmd
, sock
->addr
+ SOCK_MS_COMMAND
);
665 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
666 dev_dbg(&sock
->dev
, "executing TPC %x, %x\n", cmd
, cmd_mask
);
668 dev_dbg(&sock
->dev
, "executing TPC %x, %x\n", cmd
, sys_param
);
669 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
673 static void tifm_ms_complete_cmd(struct tifm_ms
*host
)
675 struct tifm_dev
*sock
= host
->dev
;
676 struct memstick_host
*msh
= tifm_get_drvdata(sock
);
677 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
678 unsigned int tval
= 0, data_len
;
681 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
684 del_timer(&host
->timer
);
685 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
686 if (host
->req
->io_type
== MEMSTICK_IO_SG
) {
688 tifm_unmap_sg(sock
, &host
->req
->sg
, 1,
689 host
->req
->data_dir
== READ
692 } else if (host
->req
->io_type
== MEMSTICK_IO_VAL
) {
693 writel(~TIFM_MS_SYS_DATA
& readl(sock
->addr
+ SOCK_MS_SYSTEM
),
694 sock
->addr
+ SOCK_MS_SYSTEM
);
696 data
= host
->req
->data
;
697 data_len
= host
->req
->data_len
;
699 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
701 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
702 if (host
->req
->data_dir
== READ
) {
703 for (rc
= 0; (data_len
- rc
) >= 4; rc
+= 4)
705 = __raw_readl(sock
->addr
709 tval
= readl(sock
->addr
+ SOCK_MS_DATA
);
710 switch (data_len
- rc
) {
712 data
[rc
+ 2] = (tval
>> 16) & 0xff;
714 data
[rc
+ 1] = (tval
>> 8) & 0xff;
716 data
[rc
] = tval
& 0xff;
718 readl(sock
->addr
+ SOCK_MS_DATA
);
723 tifm_unmap_sg(sock
, &host
->req
->sg
, 1,
724 host
->req
->data_dir
== READ
727 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
729 writel((~TIFM_CTRL_LED
) & readl(sock
->addr
+ SOCK_CONTROL
),
730 sock
->addr
+ SOCK_CONTROL
);
732 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
734 dev_dbg(&sock
->dev
, "TPC complete\n");
735 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
737 rc
= memstick_next_req(msh
, &host
->req
);
738 } while (!rc
&& tifm_ms_issue_cmd(host
));
741 static int tifm_ms_check_status(struct tifm_ms
*host
)
743 if (!host
->req
->error
) {
744 if (!(host
->cmd_flags
& CMD_READY
))
746 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
747 if ((host
->req
->io_type
== MEMSTICK_IO_SG
)
748 && !(host
->cmd_flags
& FIFO_READY
))
750 if (!(host
->cmd_flags
& FIFO_READY
))
751 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
753 if (host
->req
->need_card_int
754 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
755 && !(host
->cmd_flags
& CARD_READY
))
757 && !(host
->cmd_flags
& CARD_INT
))
758 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
764 /* Called from interrupt handler */
765 static void tifm_ms_data_event(struct tifm_dev
*sock
)
767 struct tifm_ms
*host
;
768 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
769 unsigned int fifo_status
= 0;
771 unsigned int fifo_status
= 0, host_status
= 0;
772 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
775 spin_lock(&sock
->lock
);
776 host
= memstick_priv((struct memstick_host
*)tifm_get_drvdata(sock
));
777 fifo_status
= readl(sock
->addr
+ SOCK_DMA_FIFO_STATUS
);
778 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
779 dev_dbg(&sock
->dev
, "data event: fifo_status %x, flags %x\n",
780 fifo_status
, host
->cmd_flags
);
782 host_status
= readl(sock
->addr
+ SOCK_MS_STATUS
);
784 "data event: fifo_status %x, host_status %x, flags %x\n",
785 fifo_status
, host_status
, host
->cmd_flags
);
786 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
789 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
790 if (fifo_status
& TIFM_FIFO_READY
) {
791 if (!host
->no_dma
|| tifm_ms_transfer_data(host
, 0)) {
793 if (host
->use_dma
&& (fifo_status
& 1)) {
794 host
->cmd_flags
|= FIFO_READY
;
795 rc
= tifm_ms_check_status(host
);
797 if (!host
->use_dma
&& (fifo_status
& TIFM_FIFO_MORE
)) {
798 if (!tifm_ms_transfer_data(host
)) {
799 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
800 host
->cmd_flags
|= FIFO_READY
;
801 rc
= tifm_ms_check_status(host
);
806 writel(fifo_status
, sock
->addr
+ SOCK_DMA_FIFO_STATUS
);
808 tifm_ms_complete_cmd(host
);
810 spin_unlock(&sock
->lock
);
814 /* Called from interrupt handler */
815 static void tifm_ms_card_event(struct tifm_dev
*sock
)
817 struct tifm_ms
*host
;
818 unsigned int host_status
= 0;
821 spin_lock(&sock
->lock
);
822 host
= memstick_priv((struct memstick_host
*)tifm_get_drvdata(sock
));
823 host_status
= readl(sock
->addr
+ SOCK_MS_STATUS
);
824 dev_dbg(&sock
->dev
, "host event: host_status %x, flags %x\n",
825 host_status
, host
->cmd_flags
);
828 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
829 if (host_status
& TIFM_MS_TIMEOUT
)
831 if (host_status
& TIFM_MS_STAT_TOE
)
832 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
833 host
->req
->error
= -ETIME
;
834 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
835 else if (host_status
& TIFM_MS_BADCRC
)
837 else if (host_status
& TIFM_MS_STAT_CRC
)
838 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
839 host
->req
->error
= -EILSEQ
;
841 if (host
->req
->error
) {
842 writel(TIFM_FIFO_INT_SETALL
,
843 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_CLEAR
);
844 writel(TIFM_DMA_RESET
, sock
->addr
+ SOCK_DMA_CONTROL
);
847 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
848 if (host_status
& TIFM_MS_EOTPC
)
850 if (host_status
& TIFM_MS_STAT_RDY
)
851 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
852 host
->cmd_flags
|= CMD_READY
;
853 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
854 if (host_status
& TIFM_MS_INT
)
855 host
->cmd_flags
|= CARD_READY
;
858 if (host_status
& TIFM_MS_STAT_MSINT
)
859 host
->cmd_flags
|= CARD_INT
;
860 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
862 rc
= tifm_ms_check_status(host
);
866 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
867 writel(TIFM_MS_SYS_NOT_RDY
| readl(sock
->addr
+ SOCK_MS_SYSTEM
),
868 sock
->addr
+ SOCK_MS_SYSTEM
);
869 writel((~TIFM_MS_SYS_DATA
) & readl(sock
->addr
+ SOCK_MS_SYSTEM
),
871 writel(TIFM_MS_SYS_INTCLR
| readl(sock
->addr
+ SOCK_MS_SYSTEM
),
872 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
873 sock
->addr
+ SOCK_MS_SYSTEM
);
876 tifm_ms_complete_cmd(host
);
878 spin_unlock(&sock
->lock
);
882 static void tifm_ms_request(struct memstick_host
*msh
)
884 struct tifm_ms
*host
= memstick_priv(msh
);
885 struct tifm_dev
*sock
= host
->dev
;
889 spin_lock_irqsave(&sock
->lock
, flags
);
891 printk(KERN_ERR
"%s : unfinished request detected\n",
893 spin_unlock_irqrestore(&sock
->lock
, flags
);
894 tifm_eject(host
->dev
);
900 rc
= memstick_next_req(msh
, &host
->req
);
902 host
->req
->error
= -ETIME
;
904 spin_unlock_irqrestore(&sock
->lock
, flags
);
909 rc
= memstick_next_req(msh
, &host
->req
);
910 } while (!rc
&& tifm_ms_issue_cmd(host
));
912 spin_unlock_irqrestore(&sock
->lock
, flags
);
916 static void tifm_ms_set_param(struct memstick_host
*msh
,
917 enum memstick_param param
,
920 struct tifm_ms
*host
= memstick_priv(msh
);
921 struct tifm_dev
*sock
= host
->dev
;
924 spin_lock_irqsave(&sock
->lock
, flags
);
928 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
929 /* this is set by card detection mechanism */
931 /* also affected by media detection mechanism */
932 if (value
== MEMSTICK_POWER_ON
) {
933 host
->mode_mask
= TIFM_MS_SYS_SRAC
| TIFM_MS_SYS_REI
;
934 writel(TIFM_MS_SYS_RESET
, sock
->addr
+ SOCK_MS_SYSTEM
);
935 writel(TIFM_MS_SYS_FCLR
| TIFM_MS_SYS_INTCLR
,
936 sock
->addr
+ SOCK_MS_SYSTEM
);
937 writel(0xffffffff, sock
->addr
+ SOCK_MS_STATUS
);
938 } else if (value
== MEMSTICK_POWER_OFF
) {
939 writel(TIFM_MS_SYS_FCLR
| TIFM_MS_SYS_INTCLR
,
940 sock
->addr
+ SOCK_MS_SYSTEM
);
941 writel(0xffffffff, sock
->addr
+ SOCK_MS_STATUS
);
943 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
945 case MEMSTICK_INTERFACE
:
946 if (value
== MEMSTICK_SERIAL
) {
947 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
948 host
->mode_mask
= TIFM_MS_SERIAL
;
950 host
->mode_mask
= TIFM_MS_SYS_SRAC
| TIFM_MS_SYS_REI
;
951 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
952 writel((~TIFM_CTRL_FAST_CLK
)
953 & readl(sock
->addr
+ SOCK_CONTROL
),
954 sock
->addr
+ SOCK_CONTROL
);
955 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
956 } else if (value
== MEMSTICK_PARALLEL
) {
958 } else if (value
== MEMSTICK_PAR4
) {
959 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
961 writel(TIFM_CTRL_FAST_CLK
962 | readl(sock
->addr
+ SOCK_CONTROL
),
963 sock
->addr
+ SOCK_CONTROL
);
968 spin_unlock_irqrestore(&sock
->lock
, flags
);
971 static void tifm_ms_abort(unsigned long data
)
973 struct tifm_ms
*host
= (struct tifm_ms
*)data
;
975 dev_dbg(&host
->dev
->dev
, "status %x\n",
976 readl(host
->dev
->addr
+ SOCK_MS_STATUS
));
978 "%s : card failed to respond for a long period of time "
980 host
->dev
->dev
.bus_id
, host
->req
? host
->req
->tpc
: 0,
983 tifm_eject(host
->dev
);
986 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
987 static int tifm_ms_initialize_host(struct tifm_ms
*host
)
989 struct tifm_dev
*sock
= host
->dev
;
990 struct memstick_host
*msh
= tifm_get_drvdata(sock
);
992 host
->mode_mask
= TIFM_MS_SERIAL
;
993 writel(0x8000, sock
->addr
+ SOCK_MS_SYSTEM
);
994 writel(0x0200 | TIFM_MS_SYS_NOT_RDY
, sock
->addr
+ SOCK_MS_SYSTEM
);
995 writel(0xffffffff, sock
->addr
+ SOCK_MS_STATUS
);
996 if (tifm_has_ms_pif(sock
))
997 msh
->caps
|= MEMSTICK_CAP_PARALLEL
;
1003 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1004 static int tifm_ms_probe(struct tifm_dev
*sock
)
1006 struct memstick_host
*msh
;
1007 struct tifm_ms
*host
;
1010 if (!(TIFM_SOCK_STATE_OCCUPIED
1011 & readl(sock
->addr
+ SOCK_PRESENT_STATE
))) {
1012 printk(KERN_WARNING
"%s : card gone, unexpectedly\n",
1017 msh
= memstick_alloc_host(sizeof(struct tifm_ms
), &sock
->dev
);
1021 host
= memstick_priv(msh
);
1022 tifm_set_drvdata(sock
, msh
);
1024 host
->timeout_jiffies
= msecs_to_jiffies(1000);
1025 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1026 host
->no_dma
= no_dma
;
1028 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1030 setup_timer(&host
->timer
, tifm_ms_abort
, (unsigned long)host
);
1032 msh
->request
= tifm_ms_request
;
1033 msh
->set_param
= tifm_ms_set_param
;
1034 sock
->card_event
= tifm_ms_card_event
;
1035 sock
->data_event
= tifm_ms_data_event
;
1036 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1037 rc
= tifm_ms_initialize_host(host
);
1039 if (tifm_has_ms_pif(sock
))
1040 msh
->caps
|= MEMSTICK_CAP_PAR4
;
1041 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1043 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1045 rc
= memstick_add_host(msh
);
1047 rc
= memstick_add_host(msh
);
1048 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1052 memstick_free_host(msh
);
1056 static void tifm_ms_remove(struct tifm_dev
*sock
)
1058 struct memstick_host
*msh
= tifm_get_drvdata(sock
);
1059 struct tifm_ms
*host
= memstick_priv(msh
);
1061 unsigned long flags
;
1063 spin_lock_irqsave(&sock
->lock
, flags
);
1066 del_timer(&host
->timer
);
1067 writel(TIFM_FIFO_INT_SETALL
,
1068 sock
->addr
+ SOCK_DMA_FIFO_INT_ENABLE_CLEAR
);
1069 writel(TIFM_DMA_RESET
, sock
->addr
+ SOCK_DMA_CONTROL
);
1070 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1071 if ((host
->req
->io_type
== MEMSTICK_IO_SG
) && !host
->no_dma
)
1074 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1075 tifm_unmap_sg(sock
, &host
->req
->sg
, 1,
1076 host
->req
->data_dir
== READ
1078 : PCI_DMA_FROMDEVICE
);
1079 host
->req
->error
= -ETIME
;
1082 rc
= memstick_next_req(msh
, &host
->req
);
1084 host
->req
->error
= -ETIME
;
1087 spin_unlock_irqrestore(&sock
->lock
, flags
);
1089 memstick_remove_host(msh
);
1090 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1092 writel(0x0200 | TIFM_MS_SYS_NOT_RDY
, sock
->addr
+ SOCK_MS_SYSTEM
);
1093 writel(0xffffffff, sock
->addr
+ SOCK_MS_STATUS
);
1096 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1097 memstick_free_host(msh
);
1102 static int tifm_ms_suspend(struct tifm_dev
*sock
, pm_message_t state
)
1104 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1106 struct memstick_host
*msh
= tifm_get_drvdata(sock
);
1108 memstick_suspend_host(msh
);
1109 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1113 static int tifm_ms_resume(struct tifm_dev
*sock
)
1115 struct memstick_host
*msh
= tifm_get_drvdata(sock
);
1116 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1117 struct tifm_ms
*host
= memstick_priv(msh
);
1119 tifm_ms_initialize_host(host
);
1120 memstick_detect_change(msh
);
1122 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1124 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1126 memstick_resume_host(msh
);
1127 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1133 #define tifm_ms_suspend NULL
1134 #define tifm_ms_resume NULL
1136 #endif /* CONFIG_PM */
1138 static struct tifm_device_id tifm_ms_id_tbl
[] = {
1139 { TIFM_TYPE_MS
}, { 0 }
1142 static struct tifm_driver tifm_ms_driver
= {
1144 .name
= DRIVER_NAME
,
1145 .owner
= THIS_MODULE
1147 .id_table
= tifm_ms_id_tbl
,
1148 .probe
= tifm_ms_probe
,
1149 .remove
= tifm_ms_remove
,
1150 .suspend
= tifm_ms_suspend
,
1151 .resume
= tifm_ms_resume
1154 static int __init
tifm_ms_init(void)
1156 return tifm_register_driver(&tifm_ms_driver
);
1159 static void __exit
tifm_ms_exit(void)
1161 tifm_unregister_driver(&tifm_ms_driver
);
1164 MODULE_AUTHOR("Alex Dubov");
1165 MODULE_DESCRIPTION("TI FlashMedia MemoryStick driver");
1166 MODULE_LICENSE("GPL");
1167 MODULE_DEVICE_TABLE(tifm
, tifm_ms_id_tbl
);
1168 <<<<<<< HEAD
:drivers
/memstick
/host
/tifm_ms
.c
1169 MODULE_VERSION(DRIVER_VERSION
);
1171 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:drivers
/memstick
/host
/tifm_ms
.c
1173 module_init(tifm_ms_init
);
1174 module_exit(tifm_ms_exit
);