Device Tree(八)设备树驱动模板

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/JerryGou/article/details/85269731
/*
 * Copyright (c) 2018 LouisGou <[email protected]>
 *
 * 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.
 *
 * Louis MTD NAND driver
*/


#include <linux/module.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/of_platform.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/jiffies.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/io.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/mtd/partitions.h>


enum Louis_cpu_type {
    TYPE_LOUIS210,
};

static int Louis_nand_probe(struct platform_device *pdev)
{
    return 0;
}

static int Louis_nand_remove(struct platform_device *pdev)
{
    return 0; 
}

static const struct of_device_id Louis_nand_match[] = {
    {.compatible = "samsung, Louis210-nand", .data = TYPE_LOUIS210},
    {},
};
MODULE_DEVICE_TABLE(of, Louis_nand_match);

static struct platform_driver Louis_nand_driver = {
    .probe      = Louis_nand_probe,
    .remove     = Louis_nand_remove,
    .driver     = {
        .name   = "Louis-nand",
        .owner  = THIS_MODULE,
        .of_match_table     = Louis_nand_match,
    },
};
module_platform_driver(Louis_nand_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("LouisGou <[email protected]>");
MODULE_DESCRIPTION("Louis MTD NAND driver");

猜你喜欢

转载自blog.csdn.net/JerryGou/article/details/85269731