diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-07-19 20:02:56 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-07-19 20:02:56 +0200 |
commit | 8c57a5e7b2820f349c95b8c8393fec1e0f4070d2 (patch) | |
tree | 8ef0f3c986968392ccdc70ca43b23eba729e2019 /drivers/bcma/driver_chipcommon_pflash.c | |
parent | Input: pixcir_ts - add support for axis inversion / swapping (diff) | |
parent | Input: ts4800-ts - add missing of_node_put after calling of_parse_phandle (diff) | |
download | linux-8c57a5e7b2820f349c95b8c8393fec1e0f4070d2.tar.xz linux-8c57a5e7b2820f349c95b8c8393fec1e0f4070d2.zip |
Merge branch 'for-linus' into next
Sync up to bring in wacom_w8001 changes to avoid merge conflicts later.
Diffstat (limited to 'drivers/bcma/driver_chipcommon_pflash.c')
-rw-r--r-- | drivers/bcma/driver_chipcommon_pflash.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/bcma/driver_chipcommon_pflash.c b/drivers/bcma/driver_chipcommon_pflash.c new file mode 100644 index 000000000000..3b497c9ee0d4 --- /dev/null +++ b/drivers/bcma/driver_chipcommon_pflash.c @@ -0,0 +1,49 @@ +/* + * Broadcom specific AMBA + * ChipCommon parallel flash + * + * Licensed under the GNU/GPL. See COPYING for details. + */ + +#include "bcma_private.h" + +#include <linux/bcma/bcma.h> +#include <linux/mtd/physmap.h> +#include <linux/platform_device.h> + +static const char * const part_probes[] = { "bcm47xxpart", NULL }; + +static struct physmap_flash_data bcma_pflash_data = { + .part_probe_types = part_probes, +}; + +static struct resource bcma_pflash_resource = { + .name = "bcma_pflash", + .flags = IORESOURCE_MEM, +}; + +struct platform_device bcma_pflash_dev = { + .name = "physmap-flash", + .dev = { + .platform_data = &bcma_pflash_data, + }, + .resource = &bcma_pflash_resource, + .num_resources = 1, +}; + +int bcma_pflash_init(struct bcma_drv_cc *cc) +{ + struct bcma_pflash *pflash = &cc->pflash; + + pflash->present = true; + + if (!(bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & BCMA_CC_FLASH_CFG_DS)) + bcma_pflash_data.width = 1; + else + bcma_pflash_data.width = 2; + + bcma_pflash_resource.start = BCMA_SOC_FLASH2; + bcma_pflash_resource.end = BCMA_SOC_FLASH2 + BCMA_SOC_FLASH2_SZ; + + return 0; +} |