summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/bcm47xxsflash.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2013-03-24 21:53:24 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 18:20:32 +0100
commit265dfbd9ae4388d582dd58e66aff24f4c30831ed (patch)
tree896d1f92829835a0a5fb0d6f6175f46a782ad158 /drivers/mtd/devices/bcm47xxsflash.c
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
downloadblackbird-op-linux-265dfbd9ae4388d582dd58e66aff24f4c30831ed.tar.gz
blackbird-op-linux-265dfbd9ae4388d582dd58e66aff24f4c30831ed.zip
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/bcm47xxsflash.c')
-rw-r--r--drivers/mtd/devices/bcm47xxsflash.c13
1 files changed, 13 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)
* BCMA
**************************************************/
+static int bcm47xxsflash_bcma_cc_read(struct bcm47xxsflash *b47s, u16 offset)
+{
+ return bcma_cc_read32(b47s->bcma_cc, offset);
+}
+
+static void bcm47xxsflash_bcma_cc_write(struct bcm47xxsflash *b47s, u16 offset,
+ u32 value)
+{
+ bcma_cc_write32(b47s->bcma_cc, offset, value);
+}
+
static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
{
struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);
@@ -62,6 +73,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
sflash->priv = b47s;
b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash);
+ b47s->cc_read = bcm47xxsflash_bcma_cc_read;
+ b47s->cc_write = bcm47xxsflash_bcma_cc_write;
switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) {
case BCMA_CC_FLASHT_STSER:
OpenPOWER on IntegriCloud