diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-11-20 16:29:42 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-11-20 16:29:42 +0000 |
commit | c7120182addb4b4957b7a750c3adb76e7c6d24da (patch) | |
tree | da1fc71426a2990db69862ca09d380fa7e9aeb24 /target/linux | |
parent | e68ec7a18316dad7dd671365f729b6382d6e91b9 (diff) |
ar71xx: make ar934x_nfc driver compatible with 3.7
Also add compatibility patches for the currently
supported kernels.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34278 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
4 files changed, 59 insertions, 14 deletions
diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c index 9434d0fe06..7fd04ca621 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c @@ -762,18 +762,6 @@ ar934x_nfc_read_buf(struct mtd_info *mtd, u8 *buf, int len) nfc->buf_index = buf_index; } -static int -ar934x_nfc_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) -{ - int i; - - for (i = 0; i < len; i++) - if (buf[i] != ar934x_nfc_read_byte(mtd)) - return -EFAULT; - - return 0; -} - static void ar934x_nfc_hw_init(struct ar934x_nfc *nfc) { @@ -1059,7 +1047,6 @@ ar934x_nfc_probe(struct platform_device *pdev) nand->read_byte = ar934x_nfc_read_byte; nand->write_buf = ar934x_nfc_write_buf; nand->read_buf = ar934x_nfc_read_buf; - nand->verify_buf = ar934x_nfc_verify_buf; nand->select_chip = ar934x_nfc_select_chip; ret = ar934x_nfc_alloc_buf(nfc, AR934X_NFC_ID_BUF_SIZE); diff --git a/target/linux/ar71xx/patches-3.3/a02-ar934x_nfc-add-NO_AUTOINCR-flag.patch b/target/linux/ar71xx/patches-3.3/a02-ar934x_nfc-add-NO_AUTOINCR-flag.patch index fad9eacb3b..8f7c972fd3 100644 --- a/target/linux/ar71xx/patches-3.3/a02-ar934x_nfc-add-NO_AUTOINCR-flag.patch +++ b/target/linux/ar71xx/patches-3.3/a02-ar934x_nfc-add-NO_AUTOINCR-flag.patch @@ -1,7 +1,7 @@ reverted: --- a/drivers/mtd/nand/ar934x_nfc.c +++ b/drivers/mtd/nand/ar934x_nfc.c -@@ -1051,6 +1051,7 @@ ar934x_nfc_probe(struct platform_device +@@ -1039,6 +1039,7 @@ ar934x_nfc_probe(struct platform_device else mtd->name = dev_name(&pdev->dev); diff --git a/target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch b/target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch new file mode 100644 index 0000000000..c4c462804e --- /dev/null +++ b/target/linux/ar71xx/patches-3.3/a05-ar934x_nfc-add-buffer-verification.patch @@ -0,0 +1,29 @@ +--- a/drivers/mtd/nand/ar934x_nfc.c ++++ b/drivers/mtd/nand/ar934x_nfc.c +@@ -762,6 +762,18 @@ ar934x_nfc_read_buf(struct mtd_info *mtd + nfc->buf_index = buf_index; + } + ++static int ++ar934x_nfc_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i++) ++ if (buf[i] != ar934x_nfc_read_byte(mtd)) ++ return -EFAULT; ++ ++ return 0; ++} ++ + static void + ar934x_nfc_hw_init(struct ar934x_nfc *nfc) + { +@@ -1048,6 +1060,7 @@ ar934x_nfc_probe(struct platform_device + nand->read_byte = ar934x_nfc_read_byte; + nand->write_buf = ar934x_nfc_write_buf; + nand->read_buf = ar934x_nfc_read_buf; ++ nand->verify_buf = ar934x_nfc_verify_buf; + nand->select_chip = ar934x_nfc_select_chip; + + ret = ar934x_nfc_alloc_buf(nfc, AR934X_NFC_ID_BUF_SIZE); diff --git a/target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch b/target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch new file mode 100644 index 0000000000..c4c462804e --- /dev/null +++ b/target/linux/ar71xx/patches-3.6/a05-ar934x_nfc-add-buffer-verification.patch @@ -0,0 +1,29 @@ +--- a/drivers/mtd/nand/ar934x_nfc.c ++++ b/drivers/mtd/nand/ar934x_nfc.c +@@ -762,6 +762,18 @@ ar934x_nfc_read_buf(struct mtd_info *mtd + nfc->buf_index = buf_index; + } + ++static int ++ar934x_nfc_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i++) ++ if (buf[i] != ar934x_nfc_read_byte(mtd)) ++ return -EFAULT; ++ ++ return 0; ++} ++ + static void + ar934x_nfc_hw_init(struct ar934x_nfc *nfc) + { +@@ -1048,6 +1060,7 @@ ar934x_nfc_probe(struct platform_device + nand->read_byte = ar934x_nfc_read_byte; + nand->write_buf = ar934x_nfc_write_buf; + nand->read_buf = ar934x_nfc_read_buf; ++ nand->verify_buf = ar934x_nfc_verify_buf; + nand->select_chip = ar934x_nfc_select_chip; + + ret = ar934x_nfc_alloc_buf(nfc, AR934X_NFC_ID_BUF_SIZE); |