summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.32/mtcdp-embedded/linux-2.6.32.3-at25.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-2.6.32/mtcdp-embedded/linux-2.6.32.3-at25.patch')
-rw-r--r--recipes/linux/linux-2.6.32/mtcdp-embedded/linux-2.6.32.3-at25.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.32/mtcdp-embedded/linux-2.6.32.3-at25.patch b/recipes/linux/linux-2.6.32/mtcdp-embedded/linux-2.6.32.3-at25.patch
new file mode 100644
index 0000000000..3aa9096b2b
--- /dev/null
+++ b/recipes/linux/linux-2.6.32/mtcdp-embedded/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 */