美文网首页
注册platform device

注册platform device

作者: 嵌入式工作 | 来源:发表于2018-08-03 20:06 被阅读0次

    1修改 vim drivers/char/Kconfig ,添加HELLO_CTL

    config HELLO_CTL
            tristate "Enable HELLO config"
            default y
            help
              Enable HELLO config
    
    config LEDS_CTL
            bool "Enable LEDS config"
            default y
            help
              Enable LEDS config
    
    

    2修改 vim arch/arm/mach-exynos/mach-itop4412.c
    1加入s3c_device_hello_ctl

    #ifdef CONFIG_HELLO_CTL
    struct platform_device s3c_device_hello_ctl =
    {
    
    .name = "hello",
    .id = -1,
    };
    
    #endif
    
    #ifdef CONFIG_LEDS_CTL
    struct platform_device s3c_device_leds_ctl = {
            .name   = "leds",
            .id             = -1,
    };
    #endif
    

    2 加入列表中

    #ifdef CONFIG_HELLO_CTL
            &s3c_device_hello_ctl,
    #endif
    
    #ifdef CONFIG_LEDS_CTL
            &s3c_device_leds_ctl,
    #endif
    

    3编译make zImage

    相关文章

      网友评论

          本文标题:注册platform device

          本文链接:https://www.haomeiwen.com/subject/kxbuvftx.html