Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252494
b: refs/heads/master
c: aa08465
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Cernekee authored and David Woodhouse committed May 25, 2011
1 parent b67db38 commit c0d7565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16004f3685541c57a280bae3fde6562256fd0ba5
refs/heads/master: aa0846534b9c7238187b4276e83efb9969d4c6e3
11 changes: 7 additions & 4 deletions trunk/drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/sched.h>
#include <linux/mod_devicetable.h>

#include <linux/mtd/cfi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>

Expand Down Expand Up @@ -76,6 +77,8 @@
#define FAST_READ_DUMMY_BYTE 0
#endif

#define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16)

/****************************************************************************/

struct m25p {
Expand Down Expand Up @@ -872,9 +875,9 @@ static int __devinit m25p_probe(struct spi_device *spi)
* up with the software protection bits set
*/

if (info->jedec_id >> 16 == 0x1f ||
info->jedec_id >> 16 == 0x89 ||
info->jedec_id >> 16 == 0xbf) {
if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL ||
JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL ||
JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) {
write_enable(flash);
write_sr(flash, 0);
}
Expand All @@ -892,7 +895,7 @@ static int __devinit m25p_probe(struct spi_device *spi)
flash->mtd.read = m25p80_read;

/* sst flash chips use AAI word program */
if (info->jedec_id >> 16 == 0xbf)
if (JEDEC_MFR(info->jedec_id) == CFI_MFR_SST)
flash->mtd.write = sst_write;
else
flash->mtd.write = m25p80_write;
Expand Down

0 comments on commit c0d7565

Please sign in to comment.