EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

S3C24xxPkg/vivi/drivers/mtd/nor/chipreg.c

Go to the documentation of this file.
00001 /*
00002  * vivi/drivers/mtd/chipreg.c: Registration for chip drivers
00003  *
00004  * Based on linux/drivers/chipreg.c
00005  *
00006  * $Id: chipreg.c,v 1.1.1.1 2004/02/04 06:22:25 laputa Exp $
00007  *
00008  */
00009 
00010 #include <config.h>
00011 #include <mtd/map.h>
00012 
00013 extern struct mtd_info *cfi_probe(struct map_info *map);
00014 extern struct mtd_info *amd_flash_probe(struct map_info *map);
00015 
00016 static struct mtd_chip_driver chip_drivers[] = {
00017 #ifdef CONFIG_MTD_CFI
00018         { cfi_probe,    "cfi_probe" },  
00019 #endif
00020 #ifdef CONFIG_MTD_AMDSTD
00021         { amd_flash_probe, "amd_flash" },
00022 #endif
00023         { NULL,         NULL }
00024 };
00025 
00026 static struct mtd_chip_driver *get_mtd_chip_driver (const char *name)
00027 {
00028         struct mtd_chip_driver *drv = chip_drivers;
00029 
00030         while (drv->name != NULL) {
00031                 if (!strcmp(name, drv->name)) 
00032                         return drv;
00033                 drv++;
00034         }
00035         return NULL;
00036 }
00037 
00038 struct mtd_info *do_map_probe(const char *name, struct map_info *map)
00039 {
00040         struct mtd_chip_driver *drv;
00041         struct mtd_info *ret;
00042 
00043         drv = get_mtd_chip_driver(name);
00044 
00045         if (!drv) return NULL;
00046         ret = drv->probe(map);
00047         if (ret) return ret;
00048         return NULL;
00049 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines