diff --git a/linux-4.1/arch/arm/mach-bcm2709/bcm2709.c b/linux-4.1/arch/arm/mach-bcm2709/bcm2709.c index 7c54cf62a..1be476a8d 100644 --- a/linux-4.1/arch/arm/mach-bcm2709/bcm2709.c +++ b/linux-4.1/arch/arm/mach-bcm2709/bcm2709.c @@ -524,29 +524,6 @@ struct platform_device bcm2835_emmc_device = { }; #endif /* CONFIG_MMC_BCM2835 */ - -#if defined(CONFIG_BCM2835_RAW_UART) || defined(CONFIG_BCM2835_RAW_UART_MODULE) -static struct resource bcm2835_raw_uart_resources[] = { - { - .start = UART0_BASE, - .end = UART0_BASE + 0x100 - 1, /*HT: ??*/ - .flags = IORESOURCE_MEM, - }, - { - .start = IRQ_UART, /*TODO: Check*/ - .end = IRQ_UART, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device bcm2709_raw_uart_device = { - .name = "bcm2835-raw-uart", - .id = 0, - .resource = bcm2835_raw_uart_resources, - .num_resources = ARRAY_SIZE(bcm2835_raw_uart_resources), -}; -#endif - static struct platform_device bcm2708_alsa_devices[] = { [0] = { .name = "bcm2835_AUD0", @@ -954,10 +931,6 @@ void __init bcm2709_init(void) bcm2709_init_led(); bcm2709_init_uart1(); -#if defined(CONFIG_BCM2835_RAW_UART) || defined(CONFIG_BCM2835_RAW_UART_MODULE) - bcm_register_device(&bcm2709_raw_uart_device); /*HT*/ -#endif /*defined(CONFIG_BCM2835_RAW_UART) || defined(CONFIG_BCM2835_RAW_UART_MODULE)*/ - /* Only create the platform devices for the ALSA driver in the absence of an enabled "audio" DT node */ if (!use_dt || diff --git a/linux-4.1/drivers/char/broadcom/bcm2835_raw_uart.c b/linux-4.1/drivers/char/broadcom/bcm2835_raw_uart.c index 5a6f1a425..c18ab8715 100644 --- a/linux-4.1/drivers/char/broadcom/bcm2835_raw_uart.c +++ b/linux-4.1/drivers/char/broadcom/bcm2835_raw_uart.c @@ -1179,6 +1179,25 @@ static int bcm2835_raw_uart_remove( struct platform_device *pdev ) return -EFAULT; } +static struct resource bcm2835_raw_uart_resources[] = { + { + .start = UART0_BASE, + .end = UART0_BASE + 0x100 - 1, /*HT: ??*/ + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_UART, /*TODO: Check*/ + .end = IRQ_UART, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device bcm2709_raw_uart_device = { + .name = "bcm2835-raw-uart", + .id = 0, + .resource = bcm2835_raw_uart_resources, + .num_resources = ARRAY_SIZE(bcm2835_raw_uart_resources), +}; @@ -1192,14 +1211,21 @@ static int __init bcm2835_raw_uart_init(void) { int ret; - ret = platform_driver_register( &m_bcm2835_raw_uart_driver ); - if( ret ) - { - printk(KERN_ERR "bcm2835_raw_uart: Failed to register platform driver (%i)\n", ret ); - goto out; - } + ret = platform_device_register( &bcm2709_raw_uart_device ); + if( ret ) + { + printk(KERN_ERR "bcm2835_raw_uart: Failed to register platform driver (%i)\n", ret ); + goto out; + } + + ret = platform_driver_register( &m_bcm2835_raw_uart_driver ); + if( ret ) + { + printk(KERN_ERR "bcm2835_raw_uart: Failed to register platform driver (%i)\n", ret ); + goto out; + } - return 0; + return 0; out: return ret; @@ -1214,7 +1240,8 @@ static int __init bcm2835_raw_uart_init(void) **/ static void __exit bcm2835_raw_uart_exit(void) { - platform_driver_unregister( &m_bcm2835_raw_uart_driver ); + platform_driver_unregister( &m_bcm2835_raw_uart_driver ); + platform_device_unregister( &bcm2709_raw_uart_device ); } module_init( bcm2835_raw_uart_init ); @@ -1222,3 +1249,5 @@ module_exit( bcm2835_raw_uart_exit ); MODULE_DESCRIPTION( "eQ-3 raw BCM2835 uart driver" ); MODULE_LICENSE( "GPL" ); MODULE_AUTHOR( "eQ-3 Entwicklung GmbH" ); + +