注册platform device

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)