diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-07 06:55:07 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-07 06:55:07 -0400 |
commit | c314dfdc358847eef0fc07ec8682e1acc8cadd00 (patch) | |
tree | 46cd8005aeafaca0e6298f37e18c6bc0c3b41384 /drivers/mtd/chips/cfi_util.c | |
parent | 8c64038e4c077b2b37c6b27d0c40c77a3ddfaeef (diff) |
[MTD] [NOR] Rename and export new cfi_qry_*() functions
They need to be exported, so let's give them less generic-sounding names
while we're at it.
Original export patch, along with the suggestion about the nomenclature,
from Stephen Rothwell.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips/cfi_util.c')
-rw-r--r-- | drivers/mtd/chips/cfi_util.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index 8d7553670526..34d40e25d312 100644 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include <linux/mtd/cfi.h> | 24 | #include <linux/mtd/cfi.h> |
25 | #include <linux/mtd/compatmac.h> | 25 | #include <linux/mtd/compatmac.h> |
26 | 26 | ||
27 | int __xipram qry_present(struct map_info *map, __u32 base, | 27 | int __xipram cfi_qry_present(struct map_info *map, __u32 base, |
28 | struct cfi_private *cfi) | 28 | struct cfi_private *cfi) |
29 | { | 29 | { |
30 | int osf = cfi->interleave * cfi->device_type; /* scale factor */ | 30 | int osf = cfi->interleave * cfi->device_type; /* scale factor */ |
31 | map_word val[3]; | 31 | map_word val[3]; |
@@ -50,35 +50,39 @@ int __xipram qry_present(struct map_info *map, __u32 base, | |||
50 | 50 | ||
51 | return 1; /* "QRY" found */ | 51 | return 1; /* "QRY" found */ |
52 | } | 52 | } |
53 | EXPORT_SYMBOL_GPL(cfi_qry_present); | ||
53 | 54 | ||
54 | int __xipram qry_mode_on(uint32_t base, struct map_info *map, | 55 | int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, |
55 | struct cfi_private *cfi) | 56 | struct cfi_private *cfi) |
56 | { | 57 | { |
57 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | 58 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); |
58 | cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); | 59 | cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); |
59 | if (qry_present(map, base, cfi)) | 60 | if (cfi_qry_present(map, base, cfi)) |
60 | return 1; | 61 | return 1; |
61 | /* QRY not found probably we deal with some odd CFI chips */ | 62 | /* QRY not found probably we deal with some odd CFI chips */ |
62 | /* Some revisions of some old Intel chips? */ | 63 | /* Some revisions of some old Intel chips? */ |
63 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | 64 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); |
64 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); | 65 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); |
65 | cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); | 66 | cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); |
66 | if (qry_present(map, base, cfi)) | 67 | if (cfi_qry_present(map, base, cfi)) |
67 | return 1; | 68 | return 1; |
68 | /* ST M29DW chips */ | 69 | /* ST M29DW chips */ |
69 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | 70 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); |
70 | cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); | 71 | cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); |
71 | if (qry_present(map, base, cfi)) | 72 | if (cfi_qry_present(map, base, cfi)) |
72 | return 1; | 73 | return 1; |
73 | /* QRY not found */ | 74 | /* QRY not found */ |
74 | return 0; | 75 | return 0; |
75 | } | 76 | } |
76 | void __xipram qry_mode_off(uint32_t base, struct map_info *map, | 77 | EXPORT_SYMBOL_GPL(cfi_qry_mode_on); |
77 | struct cfi_private *cfi) | 78 | |
79 | void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map, | ||
80 | struct cfi_private *cfi) | ||
78 | { | 81 | { |
79 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | 82 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); |
80 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); | 83 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); |
81 | } | 84 | } |
85 | EXPORT_SYMBOL_GPL(cfi_qry_mode_off); | ||
82 | 86 | ||
83 | struct cfi_extquery * | 87 | struct cfi_extquery * |
84 | __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name) | 88 | __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name) |
@@ -104,7 +108,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n | |||
104 | #endif | 108 | #endif |
105 | 109 | ||
106 | /* Switch it into Query Mode */ | 110 | /* Switch it into Query Mode */ |
107 | qry_mode_on(base, map, cfi); | 111 | cfi_qry_mode_on(base, map, cfi); |
108 | /* Read in the Extended Query Table */ | 112 | /* Read in the Extended Query Table */ |
109 | for (i=0; i<size; i++) { | 113 | for (i=0; i<size; i++) { |
110 | ((unsigned char *)extp)[i] = | 114 | ((unsigned char *)extp)[i] = |
@@ -112,7 +116,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n | |||
112 | } | 116 | } |
113 | 117 | ||
114 | /* Make sure it returns to read mode */ | 118 | /* Make sure it returns to read mode */ |
115 | qry_mode_off(base, map, cfi); | 119 | cfi_qry_mode_off(base, map, cfi); |
116 | 120 | ||
117 | #ifdef CONFIG_MTD_XIP | 121 | #ifdef CONFIG_MTD_XIP |
118 | (void) map_read(map, base); | 122 | (void) map_read(map, base); |