From: Dinh Nguyen <Dinh.Nguyen@freescale.com> Update /plat-mxc/gpio.c to support Freescale's MX51 Babbage HW. This patch applies to 2.6.34-rc4. Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com> --- arch/arm/mach-mx5/board-mx51_babbage.c | 5 +++- arch/arm/mach-mx5/devices.c | 33 ++++++++++++++++++++++++++++++- arch/arm/plat-mxc/gpio.c | 32 +++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index ee67a71..afbe400 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c @@ -1,5 +1,5 @@ /* - * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> * * The code contained herein is licensed under the GNU General Public @@ -12,6 +12,7 @@ #include <linux/init.h> #include <linux/platform_device.h> +#include <linux/gpio.h> #include <mach/common.h> #include <mach/hardware.h> @@ -75,6 +76,8 @@ static void __init mxc_board_init(void) ARRAY_SIZE(mx51babbage_pads)); mxc_init_imx_uart(); platform_add_devices(devices, ARRAY_SIZE(devices)); + + mxc_register_gpios(); } static void __init mx51_babbage_timer_init(void) diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index d6fd396..73f2342 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c @@ -1,5 +1,6 @@ /* * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com> + * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License @@ -11,7 +12,9 @@ #include <linux/platform_device.h> #include <mach/hardware.h> +#include <mach/gpio.h> ...
First, I'm glad to see Freescale sending patches for mainline code - thanks for doing this :) Other people might give more detailed feedback, but I'll still comment on some things that caught my eye. On Tue, Apr 13, 2010 at 11:10:24AM -0500, Dinh.Nguyen@freescale.com wrote: --
-----Original Message----- From: Daniel Mack [mailto:daniel@caiaq.de] Sent: Tuesday, April 13, 2010 11:46 AM To: Nguyen Dinh-R00091 Cc: linux-kernel@vger.kernel.org; amit.kucheria@canonical.com; linux@arm.linux.org.uk; s.hauer@pengutronix.de; grant.likely@secretlab.ca; Herring Robert-RA7055; linux-arm-kernel@lists.infradead.org; bryan.wu@canonical.com; valentin.longchamp@epfl.ch Subject: Re: [PATCH 2.6.34-rc4 1/8] mx5: Add registration of GPIOs for MX51 Babbage board. First, I'm glad to see Freescale sending patches for mainline code - thanks for doing this :) Other people might give more detailed feedback, but I'll still comment on some things that caught my eye. [Dinh-FSL] - Thanks Daniel! On Tue, Apr 13, 2010 at 11:10:24AM -0500, Dinh.Nguyen@freescale.com wrote: Use ARRAY_SIZE() instead of the hard-coded constant. Where is that macro defined? [Dinh-FSL] - This macro is optional so that the interrupts can be broken --
What's the purpose of doing so? Such compile time depencies are not a good idea since the board may want to decide whether to split the interrupts or not. Note that we support kernels for more than one board. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --
And I would have expected at least one active user. As it stands, it's just dead code. Daniel --
Ack, this should be removed. Anyone wanting this code will send a seperate patch and can explain what and why he wants to do. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --
On other i.MXs this is called in plat-mxc/irq.c. It should be called in -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --
