#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/concat.h>
#include <linux/mtd/cfi_endian.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/gpio/consumer.h>
#include "physmap-bt1-rom.h"
#include "physmap-gemini.h"
#include "physmap-ixp4xx.h"
#include "physmap-versatile.h"
struct physmap_flash_info { … };
static void physmap_flash_remove(struct platform_device *dev)
{ … }
static void physmap_set_vpp(struct map_info *map, int state)
{ … }
#if IS_ENABLED(CONFIG_MTD_PHYSMAP_GPIO_ADDR)
static void physmap_set_addr_gpios(struct physmap_flash_info *info,
unsigned long ofs)
{ … }
#define win_mask(order) …
static map_word physmap_addr_gpios_read(struct map_info *map,
unsigned long ofs)
{ … }
static void physmap_addr_gpios_copy_from(struct map_info *map, void *buf,
unsigned long ofs, ssize_t len)
{ … }
static void physmap_addr_gpios_write(struct map_info *map, map_word mw,
unsigned long ofs)
{ … }
static void physmap_addr_gpios_copy_to(struct map_info *map, unsigned long ofs,
const void *buf, ssize_t len)
{ … }
static int physmap_addr_gpios_map_init(struct map_info *map)
{ … }
#else
static int physmap_addr_gpios_map_init(struct map_info *map)
{
return -ENOTSUPP;
}
#endif
#if IS_ENABLED(CONFIG_MTD_PHYSMAP_OF)
static const struct of_device_id of_flash_match[] = …;
MODULE_DEVICE_TABLE(of, of_flash_match);
static const char * const of_default_part_probes[] = …;
static const char * const *of_get_part_probes(struct platform_device *dev)
{ … }
static const char *of_select_probe_type(struct platform_device *dev)
{ … }
static int physmap_flash_of_init(struct platform_device *dev)
{ … }
#else
#define of_flash_match …
static int physmap_flash_of_init(struct platform_device *dev)
{
return -ENOTSUPP;
}
#endif
static const char * const rom_probe_types[] = …;
static const char * const part_probe_types[] = …;
static int physmap_flash_pdata_init(struct platform_device *dev)
{ … }
static int physmap_flash_probe(struct platform_device *dev)
{ … }
#ifdef CONFIG_PM
static void physmap_flash_shutdown(struct platform_device *dev)
{ … }
#else
#define physmap_flash_shutdown …
#endif
static struct platform_driver physmap_flash_driver = …;
#ifdef CONFIG_MTD_PHYSMAP_COMPAT
static struct physmap_flash_data physmap_flash_data = …;
static struct resource physmap_flash_resource = …;
static struct platform_device physmap_flash = …;
#endif
static int __init physmap_init(void)
{ … }
static void __exit physmap_exit(void)
{ … }
module_init(…) …;
module_exit(physmap_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
#ifndef CONFIG_MTD_PHYSMAP_COMPAT
MODULE_ALIAS("platform:physmap-flash");
#endif