From f786965f8d7d55d0b4c7db2f2e1c5e451efa9f9e Mon Sep 17 00:00:00 2001 From: James Maki Date: Wed, 27 Oct 2010 11:16:46 -0500 Subject: at25 patch to set a8 bit in write instruction --- .../linux-2.6.32/mtcdp/linux-2.6.32.3-at25.patch | 37 ++++++++++++++++++++++ recipes/linux/linux_2.6.32.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-at25.patch diff --git a/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-at25.patch b/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-at25.patch new file mode 100644 index 0000000000..3aa9096b2b --- /dev/null +++ b/recipes/linux/linux-2.6.32/mtcdp/linux-2.6.32.3-at25.patch @@ -0,0 +1,37 @@ +diff -uprN -X linux-2.6.32.3/Documentation/dontdiff linux-2.6.32.3-vanilla/drivers/misc/eeprom/at25.c linux-2.6.32.3/drivers/misc/eeprom/at25.c +--- linux-2.6.32.3-vanilla/drivers/misc/eeprom/at25.c 2010-01-06 17:07:45.000000000 -0600 ++++ linux-2.6.32.3/drivers/misc/eeprom/at25.c 2010-10-27 11:05:36.000000000 -0500 +@@ -147,6 +147,7 @@ at25_ee_write(struct at25_data *at25, co + unsigned written = 0; + unsigned buf_size; + u8 *bounce; ++ int a8; + + if (unlikely(off >= at25->bin.size)) + return -EFBIG; +@@ -163,6 +164,11 @@ at25_ee_write(struct at25_data *at25, co + if (!bounce) + return -ENOMEM; + ++ if (!strcmp(at25->chip.name, "at25040b")) ++ a8 = 1; ++ else ++ a8 = 0; ++ + /* For write, rollover is within the page ... so we write at + * most one page, then manually roll over to the next page. + */ +@@ -183,6 +189,13 @@ at25_ee_write(struct at25_data *at25, co + break; + } + ++ if (a8) { ++ if (offset & BIT(8)) ++ bounce[0] |= BIT(3); ++ else ++ bounce[0] &= ~BIT(3); ++ } ++ + /* 8/16/24-bit address is written MSB first */ + switch (at25->addrlen) { + default: /* case 3 */ diff --git a/recipes/linux/linux_2.6.32.bb b/recipes/linux/linux_2.6.32.bb index 8729261bfa..caa19617ac 100644 --- a/recipes/linux/linux_2.6.32.bb +++ b/recipes/linux/linux_2.6.32.bb @@ -36,6 +36,7 @@ SRC_URI_mtcdp = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;n file://linux-2.6.32.3-atmel_spi.patch;patch=1 \ file://linux-2.6.32.3-at91_mci.patch;patch=1 \ file://linux-2.6.32.3-m25p80.patch;patch=1 \ + file://linux-2.6.32.3-at25.patch;patch=1 \ " SRC_URI[build.md5sum] = "6bd3c5fea1e88bb4d0948ec3688bd8f6" SRC_URI[build.sha256sum] = "e7526a7ae7210bc7c4f4837e9d8a666f9b126d59bee16015c41c5850d29c841f" -- cgit v1.2.3