diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 11:33:28 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:25 -0500 |
| commit | a750b5ce5e1174ea68f66bf79962c479f7f23998 (patch) | |
| tree | 41548ab2e6b90f5c5faad8de30b96a4b9615e071 /include/linux | |
| parent | a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d (diff) | |
mtd: introduce mtd_get_fact_prot_info interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mtd/mtd.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index abbc96ad3b2..9a7a7f2d229 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -192,18 +192,14 @@ struct mtd_info { | |||
| 192 | struct mtd_oob_ops *ops); | 192 | struct mtd_oob_ops *ops); |
| 193 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | 193 | int (*write_oob) (struct mtd_info *mtd, loff_t to, |
| 194 | struct mtd_oob_ops *ops); | 194 | struct mtd_oob_ops *ops); |
| 195 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, | ||
| 196 | size_t len); | ||
| 195 | 197 | ||
| 196 | /* Backing device capabilities for this device | 198 | /* Backing device capabilities for this device |
| 197 | * - provides mmap capabilities | 199 | * - provides mmap capabilities |
| 198 | */ | 200 | */ |
| 199 | struct backing_dev_info *backing_dev_info; | 201 | struct backing_dev_info *backing_dev_info; |
| 200 | 202 | ||
| 201 | /* | ||
| 202 | * Methods to access the protection register area, present in some | ||
| 203 | * flash devices. The user data is one time programmable but the | ||
| 204 | * factory data is read only. | ||
| 205 | */ | ||
| 206 | int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | ||
| 207 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 203 | int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
| 208 | int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); | 204 | int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); |
| 209 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 205 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
| @@ -330,6 +326,17 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, | |||
| 330 | return mtd->write_oob(mtd, to, ops); | 326 | return mtd->write_oob(mtd, to, ops); |
| 331 | } | 327 | } |
| 332 | 328 | ||
| 329 | /* | ||
| 330 | * Method to access the protection register area, present in some flash | ||
| 331 | * devices. The user data is one time programmable but the factory data is read | ||
| 332 | * only. | ||
| 333 | */ | ||
| 334 | static inline int mtd_get_fact_prot_info(struct mtd_info *mtd, | ||
| 335 | struct otp_info *buf, size_t len) | ||
| 336 | { | ||
| 337 | return mtd->get_fact_prot_info(mtd, buf, len); | ||
| 338 | } | ||
| 339 | |||
| 333 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 340 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 334 | { | 341 | { |
| 335 | return dev ? dev_get_drvdata(dev) : NULL; | 342 | return dev ? dev_get_drvdata(dev) : NULL; |
