diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2013-03-24 16:53:24 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 13:20:32 -0400 |
commit | 265dfbd9ae4388d582dd58e66aff24f4c30831ed (patch) | |
tree | 896d1f92829835a0a5fb0d6f6175f46a782ad158 /drivers/mtd/devices | |
parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) |
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>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/bcm47xxsflash.c | 13 | ||||
-rw-r--r-- | drivers/mtd/devices/bcm47xxsflash.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c index 18e7761137a3..d1f0dec07a49 100644 --- a/drivers/mtd/devices/bcm47xxsflash.c +++ b/drivers/mtd/devices/bcm47xxsflash.c | |||
@@ -48,6 +48,17 @@ static void bcm47xxsflash_fill_mtd(struct bcm47xxsflash *b47s) | |||
48 | * BCMA | 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 | static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) | 62 | static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) |
52 | { | 63 | { |
53 | struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); | 64 | struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev); |
@@ -62,6 +73,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) | |||
62 | sflash->priv = b47s; | 73 | sflash->priv = b47s; |
63 | 74 | ||
64 | b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); | 75 | b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); |
76 | b47s->cc_read = bcm47xxsflash_bcma_cc_read; | ||
77 | b47s->cc_write = bcm47xxsflash_bcma_cc_write; | ||
65 | 78 | ||
66 | switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { | 79 | switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { |
67 | case BCMA_CC_FLASHT_STSER: | 80 | case BCMA_CC_FLASHT_STSER: |
diff --git a/drivers/mtd/devices/bcm47xxsflash.h b/drivers/mtd/devices/bcm47xxsflash.h index f22f8c46dfc0..fe93daf4f489 100644 --- a/drivers/mtd/devices/bcm47xxsflash.h +++ b/drivers/mtd/devices/bcm47xxsflash.h | |||
@@ -60,6 +60,8 @@ enum bcm47xxsflash_type { | |||
60 | 60 | ||
61 | struct bcm47xxsflash { | 61 | struct bcm47xxsflash { |
62 | struct bcma_drv_cc *bcma_cc; | 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 | enum bcm47xxsflash_type type; | 66 | enum bcm47xxsflash_type type; |
65 | 67 | ||