From e0173a3b73c59a30c5c7e9905f3b6869548f900d Mon Sep 17 00:00:00 2001 From: Leonid Kogan Date: Wed, 4 May 2016 12:34:39 +0200 Subject: [PATCH] =?UTF-8?q?Versuch=20Original-Source=20von=20=C3=84nderung?= =?UTF-8?q?en=20zu=20befreien.=20Die=20notwendigen=20=C3=84nderungen=20hin?= =?UTF-8?q?sichtlich=20bcm2709=5Fraw=5Fuart=5Fdevice=20sind=20nun=20in=20d?= =?UTF-8?q?em=20Modul=20intergriert.=20Dadurch=20ist=20es=20m=C3=B6glich?= =?UTF-8?q?=20diesen=20separat=20auf=20beliebigen=20Kernel=20zu=20kompilie?= =?UTF-8?q?ren,=20ohne=20das=20ganze=20Kernel=20tauschen=20zu=20m=C3=BCsse?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux-4.1/arch/arm/mach-bcm2709/bcm2709.c | 27 ----------- .../drivers/char/broadcom/bcm2835_raw_uart.c | 45 +++++++++++++++---- 2 files changed, 37 insertions(+), 35 deletions(-) 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" ); + +