22 #include <linux/kernel.h>
23 #include <linux/module.h>
24 #include <linux/errno.h>
26 #include <linux/string.h>
27 #include <linux/slab.h>
32 #include <linux/bitmap.h>
39 #define CREATE_TRACE_POINTS
64 static unsigned int reliable_mode;
67 "2=reliable) : MLC normal operations are in normal mode");
78 .eccpos = {7, 8, 9, 10, 11, 12, 13, 14},
79 .oobfree = {{0, 7}, {15, 1} },
87 trace_docg3_io(0, 8, reg, (
int)val);
91 static inline u16 doc_readw(
struct docg3 *docg3,
u16 reg)
95 trace_docg3_io(0, 16, reg, (
int)val);
99 static inline void doc_writeb(
struct docg3 *docg3,
u8 val,
u16 reg)
102 trace_docg3_io(1, 8, reg, val);
105 static inline void doc_writew(
struct docg3 *docg3,
u16 val,
u16 reg)
108 trace_docg3_io(1, 16, reg, val);
111 static inline void doc_flash_command(
struct docg3 *docg3,
u8 cmd)
116 static inline void doc_flash_sequence(
struct docg3 *docg3,
u8 seq)
121 static inline void doc_flash_address(
struct docg3 *docg3,
u8 addr)
126 static char const *part_probes[] = {
"cmdlinepart",
"saftlpart",
NULL };
128 static int doc_register_readb(
struct docg3 *docg3,
int reg)
133 val = doc_readb(docg3, reg);
134 doc_vdbg(
"Read register %04x : %02x\n", reg, val);
138 static int doc_register_readw(
struct docg3 *docg3,
int reg)
143 val = doc_readw(docg3, reg);
144 doc_vdbg(
"Read register %04x : %04x\n", reg, val);
159 static void doc_delay(
struct docg3 *docg3,
int nbNOPs)
164 for (i = 0; i < nbNOPs; i++)
168 static int is_prot_seq_error(
struct docg3 *docg3)
176 static int doc_is_ready(
struct docg3 *docg3)
184 static int doc_wait_ready(
struct docg3 *docg3)
186 int maxWaitCycles = 100;
191 }
while (!doc_is_ready(docg3) && maxWaitCycles--);
193 if (maxWaitCycles > 0)
199 static int doc_reset_seq(
struct docg3 *docg3)
207 ret = doc_wait_ready(docg3);
209 doc_dbg(
"doc_reset_seq() -> isReady=%s\n", ret ?
"false" :
"true");
222 static void doc_read_data_area(
struct docg3 *docg3,
void *
buf,
int len,
229 doc_dbg(
"doc_read_data_area(buf=%p, len=%d)\n", buf, len);
236 for (i = 0; i < len4; i += 2) {
249 for (i = 0; i < cdr; i++) {
267 static void doc_write_data_area(
struct docg3 *docg3,
const void *buf,
int len)
273 doc_dbg(
"doc_write_data_area(buf=%p, len=%d)\n", buf, len);
279 for (i = 0; i < len4; i += 2) {
285 for (i = 0; i < cdr; i++) {
308 static void doc_set_reliable_mode(
struct docg3 *docg3)
310 static char *strmode[] = {
"normal",
"fast",
"reliable",
"invalid" };
326 doc_err(
"doc_set_reliable_mode(): invalid mode\n");
342 static void doc_set_asic_mode(
struct docg3 *docg3,
u8 mode)
346 for (i = 0; i < 12; i++)
350 doc_dbg(
"doc_set_asic_mode(%02x)\n", mode);
364 static void doc_set_device_id(
struct docg3 *docg3,
int id)
368 doc_dbg(
"doc_set_device_id(%d)\n",
id);
388 static int doc_set_extra_page_mode(
struct docg3 *docg3)
392 doc_dbg(
"doc_set_extra_page_mode()\n");
409 static void doc_setup_addr_sector(
struct docg3 *docg3,
int sector)
412 doc_flash_address(docg3, sector & 0xff);
413 doc_flash_address(docg3, (sector >> 8) & 0xff);
414 doc_flash_address(docg3, (sector >> 16) & 0xff);
424 static void doc_setup_writeaddr_sector(
struct docg3 *docg3,
int sector,
int ofs)
428 doc_flash_address(docg3, ofs & 0xff);
429 doc_flash_address(docg3, sector & 0xff);
430 doc_flash_address(docg3, (sector >> 8) & 0xff);
431 doc_flash_address(docg3, (sector >> 16) & 0xff);
447 static int doc_read_seek(
struct docg3 *docg3,
int block0,
int block1,
int page,
452 doc_dbg(
"doc_seek(blocks=(%d,%d), page=%d, ofs=%d, wear=%d)\n",
453 block0, block1, page, ofs, wear);
465 doc_set_reliable_mode(docg3);
467 ret = doc_set_extra_page_mode(docg3);
474 doc_setup_addr_sector(docg3, sector);
478 doc_setup_addr_sector(docg3, sector);
496 static int doc_write_seek(
struct docg3 *docg3,
int block0,
int block1,
int page,
501 doc_dbg(
"doc_write_seek(blocks=(%d,%d), page=%d, ofs=%d)\n",
502 block0, block1, page, ofs);
504 doc_set_reliable_mode(docg3);
520 doc_setup_writeaddr_sector(docg3, sector, ofs);
524 ret = doc_wait_ready(docg3);
530 doc_setup_writeaddr_sector(docg3, sector, ofs);
548 static int doc_read_page_ecc_init(
struct docg3 *docg3,
int len)
556 return doc_wait_ready(docg3);
569 static int doc_write_page_ecc_init(
struct docg3 *docg3,
int len)
577 return doc_wait_ready(docg3);
587 static void doc_ecc_disable(
struct docg3 *docg3)
601 static void doc_hamming_ecc_init(
struct docg3 *docg3,
int nb_bytes)
634 static int doc_ecc_bch_fix_data(
struct docg3 *docg3,
void *buf,
u8 *hwecc)
640 ecc[i] = bitrev8(hwecc[i]);
648 for (i = 0; i < numerrs; i++)
649 errorpos[i] = (errorpos[i] & ~7) | (7 - (errorpos[
i] & 7));
650 for (i = 0; i < numerrs; i++)
655 doc_dbg(
"doc_ecc_bch_fix_data: flipped %d bits\n", numerrs);
686 static int doc_read_page_prepare(
struct docg3 *docg3,
int block0,
int block1,
689 int wear_area = 0, ret = 0;
691 doc_dbg(
"doc_read_page_prepare(blocks=(%d,%d), page=%d, ofsInPage=%d)\n",
692 block0, block1, page, offset);
698 doc_set_device_id(docg3, docg3->
device_id);
699 ret = doc_reset_seq(docg3);
704 ret = doc_read_seek(docg3, block0, block1, page, wear_area, offset);
710 doc_wait_ready(docg3);
716 doc_flash_address(docg3, offset >> 2);
718 doc_wait_ready(docg3);
744 static int doc_read_page_getbytes(
struct docg3 *docg3,
int len,
u_char *buf,
745 int first,
int last_odd)
747 if (last_odd && len > 0) {
748 doc_read_data_area(docg3, buf, 1, first);
749 doc_read_data_area(docg3, buf ? buf + 1 : buf, len - 1, 0);
751 doc_read_data_area(docg3, buf, len, first);
764 static void doc_write_page_putbytes(
struct docg3 *docg3,
int len,
767 doc_write_data_area(docg3, buf, len);
776 static void doc_get_bch_hw_ecc(
struct docg3 *docg3,
u8 *hwecc)
788 static void doc_page_finish(
struct docg3 *docg3)
802 static void doc_read_page_finish(
struct docg3 *docg3)
804 doc_page_finish(docg3);
805 doc_set_device_id(docg3, 0);
823 static void calc_block_sector(loff_t
from,
int *block0,
int *block1,
int *page,
824 int *ofs,
int reliable)
829 if (reliable == 1 || reliable == 2)
834 *block1 = *block0 + 1;
835 *page = sector % pages_biblock;
837 if (reliable == 1 || reliable == 2)
856 static int doc_read_oob(
struct mtd_info *mtd, loff_t from,
859 struct docg3 *docg3 = mtd->
priv;
863 size_t len, ooblen, nbdata, nboob;
865 int max_bitflips = 0;
879 doc_dbg(
"doc_read_oob(from=%lld, mode=%d, data=(%p:%zu), oob=(%p:%zu))\n",
880 from, ops->
mode, buf, len, oobbuf, ooblen);
884 if (from + len > mtd->
size)
892 while (ret >= 0 && (len > 0 || ooblen > 0)) {
893 calc_block_sector(from - skip, &block0, &block1, &page, &ofs,
896 nboob =
min_t(
size_t, ooblen, (
size_t)DOC_LAYOUT_OOB_SIZE);
897 ret = doc_read_page_prepare(docg3, block0, block1, page, ofs);
903 ret = doc_read_page_getbytes(docg3, skip,
NULL, 1, 0);
906 ret = doc_read_page_getbytes(docg3, nbdata, buf, 0, skip % 2);
909 doc_read_page_getbytes(docg3,
911 NULL, 0, (skip + nbdata) % 2);
912 ret = doc_read_page_getbytes(docg3, nboob, oobbuf, 0, 0);
915 doc_read_page_getbytes(docg3, DOC_LAYOUT_OOB_SIZE - nboob,
918 doc_get_bch_hw_ecc(docg3, hwecc);
921 if (nboob >= DOC_LAYOUT_OOB_SIZE) {
922 doc_dbg(
"OOB - INFO: %*phC\n", 7, oobbuf);
923 doc_dbg(
"OOB - HAMMING: %02x\n", oobbuf[7]);
924 doc_dbg(
"OOB - BCH_ECC: %*phC\n", 7, oobbuf + 8);
925 doc_dbg(
"OOB - UNUSED: %02x\n", oobbuf[15]);
927 doc_dbg(
"ECC checks: ECCConf1=%x\n", eccconf1);
928 doc_dbg(
"ECC HW_ECC: %*phC\n", 7, hwecc);
931 if (is_prot_seq_error(docg3))
939 ret = doc_ecc_bch_fix_data(docg3, buf, hwecc);
946 max_bitflips =
max(max_bitflips, ret);
951 doc_read_page_finish(docg3);
966 doc_read_page_finish(docg3);
984 static int doc_read(
struct mtd_info *mtd, loff_t from,
size_t len,
985 size_t *retlen,
u_char *buf)
990 memset(&ops, 0,
sizeof(ops));
995 ret = doc_read_oob(mtd, from, &ops);
1000 static int doc_reload_bbt(
struct docg3 *docg3)
1003 int ret = 0, nbpages,
page;
1007 for (page = 0; !ret && (page < nbpages); page++) {
1008 ret = doc_read_page_prepare(docg3, block, block + 1,
1011 ret = doc_read_page_ecc_init(docg3,
1018 doc_read_page_finish(docg3);
1029 static int doc_block_isbad(
struct mtd_info *mtd, loff_t from)
1031 struct docg3 *docg3 = mtd->
priv;
1032 int block0, block1,
page, ofs, is_good;
1034 calc_block_sector(from, &block0, &block1, &page, &ofs,
1036 doc_dbg(
"doc_block_isbad(from=%lld) => block=(%d,%d), page=%d, ofs=%d\n",
1037 from, block0, block1, page, ofs);
1044 is_good = docg3->
bbt[block0 >> 3] & (1 << (block0 & 0x7));
1059 static int doc_get_erase_count(
struct docg3 *docg3, loff_t from)
1062 int ret, plane1_erase_count, plane2_erase_count;
1063 int block0, block1,
page, ofs;
1065 doc_dbg(
"doc_get_erase_count(from=%lld, buf=%p)\n", from, buf);
1068 calc_block_sector(from, &block0, &block1, &page, &ofs, docg3->
reliable);
1072 ret = doc_reset_seq(docg3);
1074 ret = doc_read_page_prepare(docg3, block0, block1, page,
1079 doc_read_page_finish(docg3);
1083 plane1_erase_count = (
u8)(~buf[1]) | ((
u8)(~buf[4]) << 8)
1084 | ((
u8)(~buf[5]) << 16);
1085 plane2_erase_count = (
u8)(~buf[3]) | ((
u8)(~buf[6]) << 8)
1086 | ((
u8)(~buf[7]) << 16);
1088 return max(plane1_erase_count, plane2_erase_count);
1100 static int doc_get_op_status(
struct docg3 *docg3)
1106 doc_delay(docg3, 5);
1108 doc_ecc_disable(docg3);
1109 doc_read_data_area(docg3, &status, 1, 1);
1123 static int doc_write_erase_wait_status(
struct docg3 *docg3)
1127 for (i = 0; !doc_is_ready(docg3) && i < 5; i++)
1129 if (!doc_is_ready(docg3)) {
1130 doc_dbg(
"Timeout reached and the chip is still not ready\n");
1135 status = doc_get_op_status(docg3);
1137 doc_dbg(
"Erase/Write failed on (a) plane(s), status = %x\n",
1143 doc_page_finish(docg3);
1158 static int doc_erase_block(
struct docg3 *docg3,
int block0,
int block1)
1162 doc_dbg(
"doc_erase_block(blocks=(%d,%d))\n", block0, block1);
1163 ret = doc_reset_seq(docg3);
1167 doc_set_reliable_mode(docg3);
1172 doc_setup_addr_sector(docg3, sector);
1175 doc_setup_addr_sector(docg3, sector);
1176 doc_delay(docg3, 1);
1179 doc_delay(docg3, 2);
1181 if (is_prot_seq_error(docg3)) {
1182 doc_err(
"Erase blocks %d,%d error\n", block0, block1);
1186 return doc_write_erase_wait_status(docg3);
1202 struct docg3 *docg3 = mtd->
priv;
1204 int block0, block1,
page,
ret, ofs = 0;
1206 doc_dbg(
"doc_erase(from=%lld, len=%lld\n", info->
addr, info->
len);
1209 calc_block_sector(info->
addr + info->
len, &block0, &block1, &page,
1212 if (info->
addr + info->
len > mtd->
size || page || ofs)
1216 calc_block_sector(info->
addr, &block0, &block1, &page, &ofs,
1219 doc_set_device_id(docg3, docg3->
device_id);
1220 doc_set_reliable_mode(docg3);
1221 for (len = info->
len; !ret && len > 0; len -= mtd->
erasesize) {
1223 ret = doc_erase_block(docg3, block0, block1);
1259 static int doc_write_page(
struct docg3 *docg3, loff_t to,
const u_char *buf,
1260 const u_char *oob,
int autoecc)
1262 int block0, block1,
page,
ret, ofs = 0;
1265 doc_dbg(
"doc_write_page(to=%lld)\n", to);
1266 calc_block_sector(to, &block0, &block1, &page, &ofs, docg3->
reliable);
1268 doc_set_device_id(docg3, docg3->
device_id);
1269 ret = doc_reset_seq(docg3);
1274 ret = doc_write_seek(docg3, block0, block1, page, ofs);
1279 doc_delay(docg3, 2);
1280 doc_write_page_putbytes(docg3, DOC_LAYOUT_PAGE_SIZE, buf);
1282 if (oob && autoecc) {
1284 doc_delay(docg3, 2);
1288 doc_delay(docg3, 2);
1291 doc_delay(docg3, 2);
1293 doc_get_bch_hw_ecc(docg3, hwecc);
1295 doc_delay(docg3, 2);
1299 if (oob && !autoecc)
1300 doc_write_page_putbytes(docg3, DOC_LAYOUT_OOB_SIZE, oob);
1302 doc_delay(docg3, 2);
1303 doc_page_finish(docg3);
1304 doc_delay(docg3, 2);
1306 doc_delay(docg3, 2);
1312 ret = doc_write_erase_wait_status(docg3);
1315 doc_read_page_finish(docg3);
1325 static int doc_guess_autoecc(
struct mtd_oob_ops *ops)
1329 switch (ops->
mode) {
1349 static void doc_fill_autooob(
u8 *
dst,
u8 *oobsrc)
1372 static int doc_backup_oob(
struct docg3 *docg3, loff_t to,
1375 int ooblen = ops->
ooblen, autoecc;
1377 if (ooblen != DOC_LAYOUT_OOB_SIZE)
1379 autoecc = doc_guess_autoecc(ops);
1410 static int doc_write_oob(
struct mtd_info *mtd, loff_t ofs,
1413 struct docg3 *docg3 = mtd->
priv;
1414 int ret, autoecc, oobdelta;
1432 doc_dbg(
"doc_write_oob(from=%lld, mode=%d, data=(%p:%zu), oob=(%p:%zu))\n",
1433 ofs, ops->
mode, buf, len, oobbuf, ooblen);
1434 switch (ops->
mode) {
1445 if ((len % DOC_LAYOUT_PAGE_SIZE) || (ooblen % oobdelta) ||
1446 (ofs % DOC_LAYOUT_PAGE_SIZE))
1448 if (len && ooblen &&
1449 (len / DOC_LAYOUT_PAGE_SIZE) != (ooblen / oobdelta))
1451 if (ofs + len > mtd->
size)
1457 if (len == 0 && ooblen == 0)
1459 if (len == 0 && ooblen > 0)
1460 return doc_backup_oob(docg3, ofs, ops);
1462 autoecc = doc_guess_autoecc(ops);
1467 while (!ret && len > 0) {
1468 memset(oob, 0,
sizeof(oob));
1472 doc_fill_autooob(oob, oobbuf);
1473 else if (ooblen > 0)
1474 memcpy(oob, oobbuf, DOC_LAYOUT_OOB_SIZE);
1475 ret = doc_write_page(docg3, ofs, buf, oob, autoecc);
1488 doc_set_device_id(docg3, 0);
1506 static int doc_write(
struct mtd_info *mtd, loff_t to,
size_t len,
1507 size_t *retlen,
const u_char *buf)
1509 struct docg3 *docg3 = mtd->
priv;
1513 doc_dbg(
"doc_write(to=%lld, len=%zu)\n", to, len);
1514 ops.
datbuf = (
char *)buf;
1521 ret = doc_write_oob(mtd, to, &ops);
1526 static struct docg3 *sysfs_dev2docg3(
struct device *
dev,
1531 struct mtd_info **docg3_floors = platform_get_drvdata(pdev);
1533 floor = attr->
attr.name[1] -
'0';
1543 struct docg3 *docg3 = sysfs_dev2docg3(dev, attr);
1547 doc_set_device_id(docg3, docg3->
device_id);
1549 doc_set_device_id(docg3, 0);
1558 struct docg3 *docg3 = sysfs_dev2docg3(dev, attr);
1562 doc_set_device_id(docg3, docg3->
device_id);
1564 doc_set_device_id(docg3, 0);
1572 const char *buf,
size_t count)
1574 struct docg3 *docg3 = sysfs_dev2docg3(dev, attr);
1581 doc_set_device_id(docg3, docg3->
device_id);
1584 doc_set_device_id(docg3, 0);
1591 const char *buf,
size_t count)
1593 struct docg3 *docg3 = sysfs_dev2docg3(dev, attr);
1596 if (count != DOC_LAYOUT_DPS_KEY_LENGTH)
1600 doc_set_device_id(docg3, docg3->
device_id);
1603 doc_set_device_id(docg3, 0);
1608 #define FLOOR_SYSFS(id) { \
1609 __ATTR(f##id##_dps0_is_keylocked, S_IRUGO, dps0_is_key_locked, NULL), \
1610 __ATTR(f##id##_dps1_is_keylocked, S_IRUGO, dps1_is_key_locked, NULL), \
1611 __ATTR(f##id##_dps0_protection_key, S_IWUGO, NULL, dps0_insert_key), \
1612 __ATTR(f##id##_dps1_protection_key, S_IWUGO, NULL, dps1_insert_key), \
1622 int ret = 0,
floor, i = 0;
1627 for (i = 0; !ret && i < 4; i++)
1635 }
while (--floor >= 0);
1647 for (i = 0; i < 4; i++)
1654 static int dbg_flashctrl_show(
struct seq_file *
s,
void *
p)
1656 struct docg3 *docg3 = (
struct docg3 *)s->
private;
1666 "FlashControl : 0x%02x (%s,CE# %s,%s,%s,flash %s)\n",
1677 static int dbg_asicmode_show(
struct seq_file *s,
void *p)
1679 struct docg3 *docg3 = (
struct docg3 *)s->
private;
1681 int pos = 0, pctrl, mode;
1685 mode = pctrl & 0x03;
1689 "%04x : RAM_WE=%d,RSTIN_RESET=%d,BDETCT_RESET=%d,WRITE_ENABLE=%d,POWERDOWN=%d,MODE=%d%d (",
1696 mode >> 1, mode & 0x1);
1714 static int dbg_device_id_show(
struct seq_file *s,
void *p)
1716 struct docg3 *docg3 = (
struct docg3 *)s->
private;
1729 static int dbg_protection_show(
struct seq_file *s,
void *p)
1731 struct docg3 *docg3 = (
struct docg3 *)s->
private;
1733 int protect, dps0, dps0_low, dps0_high, dps1, dps1_low, dps1_high;
1766 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, "
1767 "WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n",
1768 dps0, dps0_low, dps0_high,
1775 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, "
1776 "WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n",
1777 dps1, dps1_low, dps1_high,
1778 !!(dps1 & DOC_DPS_OTP_PROTECTED),
1779 !!(dps1 & DOC_DPS_READ_PROTECTED),
1780 !!(dps1 & DOC_DPS_WRITE_PROTECTED),
1781 !!(dps1 & DOC_DPS_HW_LOCK_ENABLED),
1787 static int __init doc_dbg_register(
struct docg3 *docg3)
1796 &flashcontrol_fops);
1799 docg3, &asic_mode_fops);
1802 docg3, &device_id_fops);
1805 docg3, &protection_fops);
1815 static void __exit doc_dbg_unregister(
struct docg3 *docg3)
1827 struct docg3 *docg3 = mtd->
priv;
1853 mtd->
_read = doc_read;
1878 int ret, bbt_nbpages;
1879 u16 chip_id, chip_id_inv;
1880 struct docg3 *docg3;
1884 docg3 = kzalloc(
sizeof(
struct docg3),
GFP_KERNEL);
1892 8 * DOC_LAYOUT_PAGE_SIZE);
1893 docg3->
bbt = kzalloc(bbt_nbpages * DOC_LAYOUT_PAGE_SIZE,
GFP_KERNEL);
1900 doc_set_device_id(docg3, docg3->
device_id);
1905 chip_id = doc_register_readw(docg3,
DOC_CHIPID);
1909 if (chip_id != (
u16)(~chip_id_inv)) {
1915 doc_info(
"Found a G3 DiskOnChip at addr %p, floor %d\n",
1919 doc_err(
"Chip id %04x is not a DiskOnChip G3 chip\n", chip_id);
1923 doc_set_driver_info(chip_id, mtd);
1926 doc_reload_bbt(docg3);
1934 return ERR_PTR(ret);
1941 static void doc_release_device(
struct mtd_info *mtd)
1943 struct docg3 *docg3 = mtd->
priv;
1962 struct mtd_info **docg3_floors, *mtd;
1963 struct docg3 *docg3;
1965 cascade = platform_get_drvdata(pdev);
1966 docg3_floors = cascade->
floors;
1967 mtd = docg3_floors[0];
1971 for (i = 0; i < 12; i++)
1989 struct mtd_info **docg3_floors, *mtd;
1990 struct docg3 *docg3;
1993 cascade = platform_get_drvdata(pdev);
1994 docg3_floors = cascade->
floors;
1996 mtd = docg3_floors[
floor];
2006 for (i = 0; i < 10; i++) {
2013 doc_dbg(
"docg3_suspend(): floor %d powerdown ok\n",
2016 doc_err(
"docg3_suspend(): floor %d powerdown failed\n",
2022 mtd = docg3_floors[0];
2049 dev_err(dev,
"No I/O memory resource defined\n");
2055 cascade = kzalloc(
sizeof(*cascade) * DOC_MAX_NBFLOORS,
2067 mtd = doc_probe_device(cascade, floor, dev);
2086 ret = doc_register_sysfs(pdev, cascade);
2092 platform_set_drvdata(pdev, cascade);
2093 doc_dbg_register(cascade->
floors[0]->priv);
2098 dev_info(dev,
"No supported DiskOnChip found\n");
2102 if (cascade->
floors[floor])
2103 doc_release_device(cascade->
floors[floor]);
2121 struct docg3 *docg3 = cascade->
floors[0]->priv;
2125 doc_unregister_sysfs(pdev, cascade);
2126 doc_dbg_unregister(docg3);
2128 if (cascade->
floors[floor])
2129 doc_release_device(cascade->
floors[floor]);
2142 .suspend = docg3_suspend,
2143 .resume = docg3_resume,
2147 static int __init docg3_init(
void)
2154 static void __exit docg3_exit(
void)