1. 程式人生 > >Device Tree(八)裝置樹驅動模板

Device Tree(八)裝置樹驅動模板

/*
 * 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");