Release 4.7 drivers/mtd/onenand/generic.c
/*
* linux/drivers/mtd/onenand/generic.c
*
* Copyright (c) 2005 Samsung Electronics
* Kyungmin Park <kyungmin.park@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Overview:
* This is a device driver for the OneNAND flash for generic boards.
*/
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/partitions.h>
#include <linux/io.h>
/*
* Note: Driver name and platform data format have been updated!
*
* This version of the driver is named "onenand-flash" and takes struct
* onenand_platform_data as platform data. The old ARM-specific version
* with the name "onenand" used to take struct flash_platform_data.
*/
#define DRIVER_NAME "onenand-flash"
struct onenand_info {
struct mtd_info mtd;
struct onenand_chip onenand;
};
static int generic_onenand_probe(struct platform_device *pdev)
{
struct onenand_info *info;
struct onenand_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct resource *res = pdev->resource;
unsigned long size = resource_size(res);
int err;
info = kzalloc(sizeof(struct onenand_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
if (!request_mem_region(res->start, size, dev_name(&pdev->dev))) {
err = -EBUSY;
goto out_free_info;
}
info->onenand.base = ioremap(res->start, size);
if (!info->onenand.base) {
err = -ENOMEM;
goto out_release_mem_region;
}
info->onenand.mmcontrol = pdata ? pdata->mmcontrol : NULL;
info->onenand.irq = platform_get_irq(pdev, 0);
info->mtd.dev.parent = &pdev->dev;
info->mtd.priv = &info->onenand;
if (onenand_scan(&info->mtd, 1)) {
err = -ENXIO;
goto out_iounmap;
}
err = mtd_device_parse_register(&info->mtd, NULL, NULL,
pdata ? pdata->parts : NULL,
pdata ? pdata->nr_parts : 0);
platform_set_drvdata(pdev, info);
return 0;
out_iounmap:
iounmap(info->onenand.base);
out_release_mem_region:
release_mem_region(res->start, size);
out_free_info:
kfree(info);
return err;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
kyungmin park | kyungmin park | 245 | 87.19% | 2 | 15.38% |
magnus damm | magnus damm | 12 | 4.27% | 1 | 7.69% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 7 | 2.49% | 2 | 15.38% |
lei ming | lei ming | 5 | 1.78% | 1 | 7.69% |
jingoo han | jingoo han | 4 | 1.42% | 1 | 7.69% |
frans klaver | frans klaver | 3 | 1.07% | 1 | 7.69% |
kay sievers | kay sievers | 1 | 0.36% | 1 | 7.69% |
brian norris | brian norris | 1 | 0.36% | 1 | 7.69% |
burman yan | burman yan | 1 | 0.36% | 1 | 7.69% |
jamie iles | jamie iles | 1 | 0.36% | 1 | 7.69% |
artem bityutskiy | artem bityutskiy | 1 | 0.36% | 1 | 7.69% |
| Total | 281 | 100.00% | 13 | 100.00% |
static int generic_onenand_remove(struct platform_device *pdev)
{
struct onenand_info *info = platform_get_drvdata(pdev);
struct resource *res = pdev->resource;
unsigned long size = resource_size(res);
if (info) {
onenand_release(&info->mtd);
release_mem_region(res->start, size);
iounmap(info->onenand.base);
kfree(info);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
kyungmin park | kyungmin park | 73 | 92.41% | 1 | 33.33% |
lei ming | lei ming | 3 | 3.80% | 1 | 33.33% |
magnus damm | magnus damm | 3 | 3.80% | 1 | 33.33% |
| Total | 79 | 100.00% | 3 | 100.00% |
static struct platform_driver generic_onenand_driver = {
.driver = {
.name = DRIVER_NAME,
},
.probe = generic_onenand_probe,
.remove = generic_onenand_remove,
};
module_platform_driver(generic_onenand_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>");
MODULE_DESCRIPTION("Glue layer for OneNAND flash on generic boards");
MODULE_ALIAS("platform:" DRIVER_NAME);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
kyungmin park | kyungmin park | 392 | 86.53% | 3 | 17.65% |
magnus damm | magnus damm | 17 | 3.75% | 1 | 5.88% |
lei ming | lei ming | 14 | 3.09% | 1 | 5.88% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 7 | 1.55% | 2 | 11.76% |
axel lin | axel lin | 7 | 1.55% | 1 | 5.88% |
jingoo han | jingoo han | 4 | 0.88% | 1 | 5.88% |
frans klaver | frans klaver | 3 | 0.66% | 1 | 5.88% |
tim schmielau | tim schmielau | 3 | 0.66% | 1 | 5.88% |
jamie iles | jamie iles | 1 | 0.22% | 1 | 5.88% |
artem bityutskiy | artem bityutskiy | 1 | 0.22% | 1 | 5.88% |
burman yan | burman yan | 1 | 0.22% | 1 | 5.88% |
dan williams | dan williams | 1 | 0.22% | 1 | 5.88% |
kay sievers | kay sievers | 1 | 0.22% | 1 | 5.88% |
brian norris | brian norris | 1 | 0.22% | 1 | 5.88% |
| Total | 453 | 100.00% | 17 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.