Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: bcm47xxsflash: implement ChipCommon R/W ops

They are needed for erasing/writing. Use a magic pointers and small
functions to prepare code for adding other buses support in the future
(like SSB).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Rafał Miłecki and committed by
David Woodhouse
265dfbd9 c095ba72

+15
+13
drivers/mtd/devices/bcm47xxsflash.c
··· 48 48 * BCMA 49 49 **************************************************/ 50 50 51 + static int bcm47xxsflash_bcma_cc_read(struct bcm47xxsflash *b47s, u16 offset) 52 + { 53 + return bcma_cc_read32(b47s->bcma_cc, offset); 54 + } 55 + 56 + static void bcm47xxsflash_bcma_cc_write(struct bcm47xxsflash *b47s, u16 offset, 57 + u32 value) 58 + { 59 + bcma_cc_write32(b47s->bcma_cc, offset, value); 60 + } 61 + 51 62 static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) 52 63 { 53 64 struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); ··· 73 62 sflash->priv = b47s; 74 63 75 64 b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); 65 + b47s->cc_read = bcm47xxsflash_bcma_cc_read; 66 + b47s->cc_write = bcm47xxsflash_bcma_cc_write; 76 67 77 68 switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { 78 69 case BCMA_CC_FLASHT_STSER:
+2
drivers/mtd/devices/bcm47xxsflash.h
··· 60 60 61 61 struct bcm47xxsflash { 62 62 struct bcma_drv_cc *bcma_cc; 63 + int (*cc_read)(struct bcm47xxsflash *b47s, u16 offset); 64 + void (*cc_write)(struct bcm47xxsflash *b47s, u16 offset, u32 value); 63 65 64 66 enum bcm47xxsflash_type type; 65 67