Add 'const' keyword to chip write and other function prototypes

Corresponding to flashrom svn r1789.

Inspired by and mostly based on a patch
Signed-off-by: Mark Marshall <mark.marshall@omicron.at>

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
diff --git a/chipdrivers.h b/chipdrivers.h
index 851e90a..f270b55 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -28,8 +28,8 @@
 #include "flash.h"	/* for chipaddr and flashctx */
 
 /* spi.c */
-int spi_aai_write(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
-int spi_chip_write_256(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
+int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, int unsigned len);
 
 /* spi25.c */
@@ -54,12 +54,12 @@
 int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 int spi_block_erase_db(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 erasefunc_t *spi_get_erasefn_from_opcode(uint8_t opcode);
-int spi_chip_write_1(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 int spi_byte_program(struct flashctx *flash, unsigned int addr, uint8_t databyte);
-int spi_nbyte_program(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len);
+int spi_nbyte_program(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len);
 int spi_nbyte_read(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len);
 int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize);
-int spi_write_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize);
+int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize);
 
 /* spi25_statusreg.c */
 uint8_t spi_read_status_register(struct flashctx *flash);
@@ -107,7 +107,7 @@
 /* opaque.c */
 int probe_opaque(struct flashctx *flash);
 int read_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
-int write_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_opaque(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen);
 
 /* at45db.c */
@@ -116,7 +116,7 @@
 int spi_disable_blockprotect_at45db(struct flashctx *flash);
 int spi_read_at45db(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
 int spi_read_at45db_e8(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
-int spi_write_at45db(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int spi_write_at45db(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 int spi_erase_at45db_page(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 int spi_erase_at45db_block(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 int spi_erase_at45db_sector(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
@@ -127,7 +127,7 @@
 uint8_t wait_82802ab(struct flashctx *flash);
 int probe_82802ab(struct flashctx *flash);
 int erase_block_82802ab(struct flashctx *flash, unsigned int page, unsigned int pagesize);
-int write_82802ab(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_82802ab(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 void print_status_82802ab(uint8_t status);
 int unlock_82802ab(struct flashctx *flash);
 int unlock_28f004s5(struct flashctx *flash);
@@ -140,8 +140,8 @@
 int write_byte_program_jedec(struct flashctx *flash, chipaddr bios, uint8_t *src,
 			     chipaddr dst);
 int probe_jedec(struct flashctx *flash);
-int write_jedec(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
-int write_jedec_1(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
+int write_jedec_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int pagesize);
 int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize);
 int erase_chip_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize);
@@ -150,7 +150,7 @@
 int probe_m29f400bt(struct flashctx *flash);
 int block_erase_m29f400bt(struct flashctx *flash, unsigned int start, unsigned int len);
 int block_erase_chip_m29f400bt(struct flashctx *flash, unsigned int start, unsigned int len);
-int write_m29f400bt(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_m29f400bt(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 void protect_m29f400bt(struct flashctx *flash, chipaddr bios);
 
 /* pm49fl00x.c */
@@ -160,7 +160,7 @@
 /* sst28sf040.c */
 int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen);
 int erase_sector_28sf040(struct flashctx *flash, unsigned int address, unsigned int sector_size);
-int write_28sf040(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_28sf040(struct flashctx *flash, const uint8_t *buf,unsigned int start, unsigned int len);
 int unprotect_28sf040(struct flashctx *flash);
 int protect_28sf040(struct flashctx *flash);
 
@@ -202,6 +202,6 @@
 int probe_en29lv640b(struct flashctx *flash);
 int block_erase_en29lv640b(struct flashctx *flash, unsigned int start, unsigned int len);
 int block_erase_chip_en29lv640b(struct flashctx *flash, unsigned int start, unsigned int len);
-int write_en29lv640b(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
+int write_en29lv640b(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
 
 #endif /* !__CHIPDRIVERS_H__ */