diff options
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0002.c')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index d74ec46aa032..94bb61e19047 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -71,8 +71,8 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr | |||
71 | static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr); | 71 | static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr); |
72 | #include "fwh_lock.h" | 72 | #include "fwh_lock.h" |
73 | 73 | ||
74 | static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, size_t len); | 74 | static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); |
75 | static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, size_t len); | 75 | static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); |
76 | 76 | ||
77 | static struct mtd_chip_driver cfi_amdstd_chipdrv = { | 77 | static struct mtd_chip_driver cfi_amdstd_chipdrv = { |
78 | .probe = NULL, /* Not usable directly */ | 78 | .probe = NULL, /* Not usable directly */ |
@@ -322,6 +322,14 @@ static struct cfi_fixup fixup_table[] = { | |||
322 | }; | 322 | }; |
323 | 323 | ||
324 | 324 | ||
325 | static void cfi_fixup_major_minor(struct cfi_private *cfi, | ||
326 | struct cfi_pri_amdstd *extp) | ||
327 | { | ||
328 | if (cfi->mfr == CFI_MFR_SAMSUNG && cfi->id == 0x257e && | ||
329 | extp->MajorVersion == '0') | ||
330 | extp->MajorVersion = '1'; | ||
331 | } | ||
332 | |||
325 | struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | 333 | struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) |
326 | { | 334 | { |
327 | struct cfi_private *cfi = map->fldrv_priv; | 335 | struct cfi_private *cfi = map->fldrv_priv; |
@@ -363,6 +371,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
363 | return NULL; | 371 | return NULL; |
364 | } | 372 | } |
365 | 373 | ||
374 | cfi_fixup_major_minor(cfi, extp); | ||
375 | |||
366 | if (extp->MajorVersion != '1' || | 376 | if (extp->MajorVersion != '1' || |
367 | (extp->MinorVersion < '0' || extp->MinorVersion > '4')) { | 377 | (extp->MinorVersion < '0' || extp->MinorVersion > '4')) { |
368 | printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query " | 378 | printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query " |
@@ -1774,12 +1784,12 @@ out_unlock: | |||
1774 | return ret; | 1784 | return ret; |
1775 | } | 1785 | } |
1776 | 1786 | ||
1777 | static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, size_t len) | 1787 | static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
1778 | { | 1788 | { |
1779 | return cfi_varsize_frob(mtd, do_atmel_lock, ofs, len, NULL); | 1789 | return cfi_varsize_frob(mtd, do_atmel_lock, ofs, len, NULL); |
1780 | } | 1790 | } |
1781 | 1791 | ||
1782 | static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, size_t len) | 1792 | static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
1783 | { | 1793 | { |
1784 | return cfi_varsize_frob(mtd, do_atmel_unlock, ofs, len, NULL); | 1794 | return cfi_varsize_frob(mtd, do_atmel_unlock, ofs, len, NULL); |
1785 | } | 1795 | } |