1 commit c8a1de474f49bd928f84e7a99b6f3d23a65b5637
2 Author: Rafał Miłecki <zajec5@gmail.com>
3 Date: Sun Mar 24 21:53:24 2013 +0100
5 mtd: bcm47xxsflash: implement ChipCommon R/W ops
7 They are needed for erasing/writing. Use a magic pointers and small
8 functions to preapre code for adding other buses support in the future
11 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
12 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
14 --- a/drivers/mtd/devices/bcm47xxsflash.c
15 +++ b/drivers/mtd/devices/bcm47xxsflash.c
16 @@ -48,6 +48,17 @@ static void bcm47xxsflash_fill_mtd(struc
18 **************************************************/
20 +static int bcm47xxsflash_bcma_cc_read(struct bcm47xxsflash *b47s, u16 offset)
22 + return bcma_cc_read32(b47s->bcma_cc, offset);
25 +static void bcm47xxsflash_bcma_cc_write(struct bcm47xxsflash *b47s, u16 offset,
28 + bcma_cc_write32(b47s->bcma_cc, offset, value);
31 static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
33 struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);
34 @@ -62,6 +73,8 @@ static int bcm47xxsflash_bcma_probe(stru
37 b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash);
38 + b47s->cc_read = bcm47xxsflash_bcma_cc_read;
39 + b47s->cc_write = bcm47xxsflash_bcma_cc_write;
41 switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) {
42 case BCMA_CC_FLASHT_STSER:
43 --- a/drivers/mtd/devices/bcm47xxsflash.h
44 +++ b/drivers/mtd/devices/bcm47xxsflash.h
45 @@ -60,6 +60,8 @@ enum bcm47xxsflash_type {
47 struct bcm47xxsflash {
48 struct bcma_drv_cc *bcma_cc;
49 + int (*cc_read)(struct bcm47xxsflash *b47s, u16 offset);
50 + void (*cc_write)(struct bcm47xxsflash *b47s, u16 offset, u32 value);
52 enum bcm47xxsflash_type type;