eukrea_mbimxsd: factorize motherboard support
PATCH 1/3 eukrea_mbimxsd: factorize motherboard support
This motherboard is used for both an i.MX25 and an i.MX35 machines so we can have only one file to support it in plat-mxc.
---
v2 : rebased against last imx-for-2.6.36 branch
arch/arm/mach-mx25/Kconfig | 14 -
arch/arm/mach-mx25/Makefile | 1 -
arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c | 261 --------------------
arch/arm/mach-mx25/mach-cpuimx25.c | 2 +-
arch/arm/mach-mx3/Kconfig | 14 -
arch/arm/mach-mx3/Makefile | 1 -
arch/arm/mach-mx3/mach-cpuimx35.c | 2 +-
arch/arm/plat-mxc/Kconfig | 8 +
arch/arm/plat-mxc/Makefile | 1 +
.../eukrea_mbimxsd-baseboard.c | 184 +++++++++++---
.../plat-mxc/include/mach/board-eukrea_cpuimx35.h | 40 ---
...d-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} | 10 +-
12 files changed, 163 insertions(+), 375 deletions(-)
delete mode 100644 arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c
rename arch/arm/{mach-mx3 => plat-mxc}/eukrea_mbimxsd-baseboard.c (69%)
delete mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx35.h
rename arch/arm/plat-mxc/include/mach/{board-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} (83%)arch/arm/mach-mx25/Kconfig +0 -14
@@ -14,18 +14,4 @@ config MACH_EUKREA_CPUIMX25 select IMX_HAVE_PLATFORM_MXC_NAND select MXC_ULPI if USB_ULPI -choice - prompt "Baseboard" - depends on MACH_EUKREA_CPUIMX25 - default MACH_EUKREA_MBIMXSD_BASEBOARD - -config MACH_EUKREA_MBIMXSD_BASEBOARD - prompt "Eukrea MBIMXSD development board" - bool - help - This adds board specific devices that can be found on Eukrea's - MBIMXSD evaluation board. - -endchoice - endif
arch/arm/mach-mx25/Makefile +0 -1
@@ -2,4 +2,3 @@ obj-y := mm.o devices.o obj-$(CONFIG_ARCH_MX25) += clock.o obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-cpuimx25.o -obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o
arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c deleted +0 -261
261 lines not on this page · raw message
arch/arm/mach-mx25/mach-cpuimx25.c +1 -1
@@ -29,7 +29,7 @@#include <linux/usb/ulpi.h> #include <linux/fsl_devices.h> -#include <mach/board-eukrea_cpuimx25.h> +#include <mach/board-eukrea_cpuimxsd.h> #include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
arch/arm/mach-mx3/Kconfig +0 -14
@@ -163,18 +163,4 @@ config MACH_EUKREA_CPUIMX35 Include support for Eukrea CPUIMX35 platform. This includes specific configurations for the board and its peripherals. -choice - prompt "Baseboard" - depends on MACH_EUKREA_CPUIMX35 - default MACH_EUKREA_MBIMXSD_BASEBOARD - -config MACH_EUKREA_MBIMXSD_BASEBOARD - prompt "Eukrea MBIMXSD development board" - bool - help - This adds board specific devices that can be found on Eukrea's - MBIMXSD evaluation board. - -endchoice - endif
arch/arm/mach-mx3/Makefile +0 -1
@@ -25,4 +25,3 @@ obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o -obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o
arch/arm/mach-mx3/mach-cpuimx35.c +1 -1
@@ -37,7 +37,7 @@#include <asm/mach/time.h> #include <asm/mach/map.h> -#include <mach/board-eukrea_cpuimx35.h> +#include <mach/board-eukrea_cpuimxsd.h> #include <mach/hardware.h> #include <mach/common.h> #include <mach/iomux-mx35.h>
arch/arm/plat-mxc/Kconfig +8 -0
@@ -91,6 +91,14 @@ config MXC_DEBUG_BOARD data/address de-multiplexing and decode, signal level shift, interrupt control and various board functions. +config MACH_EUKREA_MBIMXSD_BASEBOARD + prompt "Eukrea MBIMXSD development board" + depends on MACH_EUKREA_CPUIMX25 || MACH_EUKREA_CPUIMX35 + bool + help + This adds board specific devices that can be found on Eukrea's + MBIMXSD evaluation board. + config MXC_ULPI bool
arch/arm/plat-mxc/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o +obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o ifdef CONFIG_SND_IMX_SOC obj-y += ssi-fiq.o obj-y += ssi-fiq-ksym.o
arch/arm/plat-mxc/eukrea_mbimxsd-baseboard.c renamed from arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c +147 -37
240 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx35.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Copyright (C) 2010 Eric Benard - eric at eukrea.com -* -* Based on board-pcm038.h which is : -* Copyright (C) 2008 Juergen Beisert (kernel at pengutronix.de) -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -* MA 02110-1301, USA. -*/ - -#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ -#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ - -#ifndef __ASSEMBLY__ -/* -* This CPU module needs a baseboard to work. After basic initializing -* its own devices, it calls baseboard's init function. -* TODO: Add your own baseboard init function and call it from -* inside eukrea_cpuimx25_init(). -* -* This example here is for the development board. Refer -* eukrea_mbimx25-baseboard.c -*/ - -extern void eukrea_mbimxsd_baseboard_init (void ); - -#endif - -#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ */
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimxsd.h renamed from arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx25.h +5 -5
@@ -19,22 +19,22 @@* MA 02110-1301, USA. */ -#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX25_H__ -#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX25_H__ +#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMXSD_H__ +#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMXSD_H__#ifndef __ASSEMBLY__/* * This CPU module needs a baseboard to work. After basic initializing * its own devices, it calls baseboard's init function. * TODO: Add your own baseboard init function and call it from -* inside eukrea_cpuimx25_init(). +* inside eukrea_cpuimx25_init() or eukrea_cpuimx35_init(). * * This example here is for the development board. Refer -* eukrea_mbimx25-baseboard.c +* eukrea_mbimxsd-baseboard.c */ extern void eukrea_mbimxsd_baseboard_init (void );#endif -#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX25_H__ */ +#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMXSD_H__ */
Signature · 1 line
1.6.3.3
PATCH 2/3 imx25: fix low level debug
DEBUG_LL is actually broken on i.MX25, this patch fix it.
--- arch/arm/mach-mx25/clock.c | 3 +++ arch/arm/plat-mxc/include/mach/debug-macro.S | 4 ++-- arch/arm/plat-mxc/include/mach/mx25.h | 8 +++----- 3 files changed, 8 insertions(+), 7 deletions(-)
arch/arm/mach-mx25/clock.c +3 -0
@@ -292,6 +292,9 @@ int __init mx25_clocks_init(void)__raw_writel ((1 <<19 ),CRM_BASE +CCM_CGCR0 );__raw_writel ((0xf <<16 ) | (3 <<26 ),CRM_BASE +CCM_CGCR1 );__raw_writel ((1 <<5 ),CRM_BASE +CCM_CGCR2 ); +#if defined(CONFIG_DEBUG_LL ) && !defined(CONFIG_DEBUG_ICEDCC ) +clk_enable (&uart1_clk); +#endif /* Clock source for lcdc and csi is upll */ __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7) | (1 << 0),
arch/arm/plat-mxc/include/mach/debug-macro.S +2 -2
@@ -23,8 +23,8 @@ #error "CONFIG_DEBUG_LL is incompatible with multiple archs" #endif #include <mach/mx25.h> -#define UART_PADDR UART1_BASE_ADDR -#define UART_VADDR MX25_AIPS1_IO_ADDRESS(UART1_BASE_ADDR) +#define UART_PADDR MX25_UART1_BASE_ADDR +#define UART_VADDR MX25_AIPS1_IO_ADDRESS(MX25_UART1_BASE_ADDR) #endif #ifdef CONFIG_ARCH_MX2
arch/arm/plat-mxc/include/mach/mx25.h +3 -5
@@ -31,6 +31,9 @@ IMX_IO_ADDRESS(x, MX25_AIPS2) ?: \ IMX_IO_ADDRESS(x, MX25_AVIC)) +#define MX25_AIPS1_IO_ADDRESS (x) \ + (((x) - MX25_AIPS1_BASE_ADDR) + MX25_AIPS1_BASE_ADDR_VIRT) +#define MX25_UART1_BASE_ADDR 0x43f90000#define MX25_UART2_BASE_ADDR 0x43f94000#define MX25_AUDMUX_BASE_ADDR 0x43fb0000
@@ -70,9 +73,4 @@#define MX25_INT_UART1 45#define MX25_INT_FEC 57 -#if defined(IMX_NEEDS_DEPRECATED_SYMBOLS ) -#define UART1_BASE_ADDR MX25_UART1_BASE_ADDR -#define UART2_BASE_ADDR MX25_UART2_BASE_ADDR -#endif -#endif /* ifndef __MACH_MX25_H__ */
Signature · 1 line
1.6.3.3
PATCH 3/3 imxfb: add pwmr controlled backlight support
---
v2 : updated to use backlight infrastructure
drivers/video/imxfb.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 71 insertions(+), 1 deletions(-)
drivers/video/imxfb.c +71 -1
@@ -175,6 +175,7 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +struct backlight_device *bl;void (*lcd_power)(int );void (*backlight_power)(int );
@@ -449,6 +450,73 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } + + +static int imxfb_bl_get_brightness (struct backlight_device *bl) +{ +struct imxfb_info *fbi =bl_get_data (bl); + +return readl (fbi->regs +LCDC_PWMR ) &0xFF ; +} + +static int imxfb_bl_update_status (struct backlight_device *bl) +{ +struct imxfb_info *fbi =bl_get_data (bl); +int brightness = bl->props.brightness; + +if (bl->props.power !=FB_BLANK_UNBLANK ) + brightness =0 ; +if (bl->props.fb_blank !=FB_BLANK_UNBLANK ) + brightness =0 ; + + fbi->pwmr = (fbi->pwmr & ~0xFF ) | brightness; + +if (bl->props.fb_blank !=FB_BLANK_UNBLANK ) +clk_enable (fbi->clk); +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +if (bl->props.fb_blank !=FB_BLANK_UNBLANK ) +clk_disable (fbi->clk); + +return 0 ; +} + +static const struct backlight_ops imxfb_lcdc_bl_ops = { + .update_status = imxfb_bl_update_status, + .get_brightness = imxfb_bl_get_brightness, +}; + +static void imxfb_init_backlight (struct imxfb_info *fbi) +{ +struct backlight_properties props; +struct backlight_device *bl; + +if (fbi->bl) +return ; + +memset (&props,0 ,sizeof (struct backlight_properties )); + props.max_brightness =0xff ; +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); + + bl =backlight_device_register ("imxfb-bl" , &fbi->pdev->dev, fbi, + &imxfb_lcdc_bl_ops, &props); +if (IS_ERR (bl)) { +dev_err (&fbi->pdev->dev,"error %ld on backlight register\n" , +PTR_ERR (bl)); +return ; + } + + fbi->bl = bl; + bl->props.power =FB_BLANK_UNBLANK ; + bl->props.fb_blank =FB_BLANK_UNBLANK ; + bl->props.brightness =imxfb_bl_get_brightness (bl); +} + +static void imxfb_exit_backlight (struct imxfb_info *fbi) +{ +if (fbi->bl) +backlight_device_unregister (fbi->bl); +} +static void imxfb_enable_controller (struct imxfb_info *fbi) {pr_debug ("Enabling LCD controller\n" );
@@ -579,7 +647,6 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); -writel (fbi->pwmr, fbi->regs +LCDC_PWMR );writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -779,6 +846,8 @@ static int __init imxfb_probe(struct platform_device *pdev) }imxfb_enable_controller (fbi); + fbi->pdev = pdev; +imxfb_init_backlight (fbi);return 0 ;
@@ -816,6 +885,7 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +imxfb_exit_backlight (fbi);unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.6.3.3
PATCH 3/3 imxfb: add pwmr controlled backlight support
Hello Eric,
Quoted 3 lines
Signed-off-by Eric B?nard <[email protected]>---
v2 : updated to use backlight infrastructure
this should have a dependency on CONFIG_BACKLIGHT_CLASS_DEVICE. As Sascha already took your patch you can just try to build mx27_defconfig on his for-rmk branch :-|
Instead of a dependency I would prefer to have imxfb usable without CONFIG_BACKLIGHT_CLASS_DEVICE. From a quick look there are drivers that have that. (I checked drivers/video/sa1100fb.c + drivers/video/backlight/locomolcd.c.)
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
--- drivers/video/imxfb.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
drivers/video/imxfb.c +11 -2
@@ -175,7 +175,9 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE struct backlight_device *bl; +#endif void (*lcd_power)(int );void (*backlight_power)(int );
@@ -450,8 +452,7 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } - - +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE static int imxfb_bl_get_brightness (struct backlight_device *bl) {struct imxfb_info *fbi =bl_get_data (bl);
@@ -516,6 +517,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)if (fbi->bl) backlight_device_unregister(fbi->bl); } +#endif static void imxfb_enable_controller (struct imxfb_info *fbi) {
@@ -647,6 +649,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); +#ifndef CONFIG_BACKLIGHT_CLASS_DEVICE +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +#endif writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -847,7 +852,9 @@ static int __init imxfb_probe(struct platform_device *pdev)imxfb_enable_controller (fbi); fbi->pdev = pdev; +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE imxfb_init_backlight (fbi); +#endif return 0 ;
@@ -885,7 +892,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE imxfb_exit_backlight (fbi); +#endif unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.6.3.3
PATCH 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Quoted 10 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>--- drivers/video/imxfb.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)drivers/video/imxfb.c +0
-0
drivers/video/imxfb.c struct imxfb_info { · line 180
Quoted 6 lines
drivers/video/imxfb.c +2
-0@@ -175,7 +175,9 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE struct backlight_device *bl; +#endif
I'm always unsure about these .._MODULE symbols. If imxfb and backlight support both are compiled modular, is backlight support picked up if #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE is used to guard it?
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH v2 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
---
v2: handle CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
drivers/video/imxfb.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-)
drivers/video/imxfb.c +16 -2
@@ -175,7 +175,10 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )struct backlight_device *bl; +#endif void (*lcd_power)(int );void (*backlight_power)(int );
@@ -450,8 +453,8 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } - - +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )static int imxfb_bl_get_brightness (struct backlight_device *bl) {struct imxfb_info *fbi =bl_get_data (bl);
@@ -516,6 +519,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)if (fbi->bl) backlight_device_unregister(fbi->bl); } +#endif static void imxfb_enable_controller (struct imxfb_info *fbi) {
@@ -647,6 +651,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); +#if ! defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) && \ + ! defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +#endif writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -847,7 +855,10 @@ static int __init imxfb_probe(struct platform_device *pdev)imxfb_enable_controller (fbi); fbi->pdev = pdev; +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )imxfb_init_backlight (fbi); +#endif return 0 ;
@@ -885,7 +896,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )imxfb_exit_backlight (fbi); +#endif unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.6.3.3
PATCH v2 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Quoted 12 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
v2: handleCONFIG_BACKLIGHT_CLASS_DEVICE_MODULEdrivers/video/imxfb.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-)drivers/video/imxfb.c +0
-0
drivers/video/imxfb.c struct imxfb_info { · line 181
Quoted 7 lines
drivers/video/imxfb.c +3
-0@@ -175,7 +175,10 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )struct backlight_device *bl; +#endif
I suspect this fails to build with
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_FB_IMX=y
Maybe do the following:
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \ (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) == defined(CONFIG_FB_IMX_MODULE))
#define BACKLIGHT_AVAILABLE
#endif
and use #ifdef BACKLIGHT_AVAILABLE to guard the backlight code?
I didn't test this though.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH v2 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Le 29/07/2010 14:45, Uwe Kleine-K?nig a ?crit :
Quoted 14 lines · Eric B?nard
Quoted 13 lines
Signed-off-by Eric B?nard<[email protected]>---
v2: handleCONFIG_BACKLIGHT_CLASS_DEVICE_MODULEdrivers/video/imxfb.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-)drivers/video/imxfb.c +0
-0@@ -175,7 +175,10 @@ struct imxfb_info {
Quoted 10 lines
drivers/video/imxfb.c struct imxfb_info { · line 181
Quoted 6 lines
drivers/video/imxfb.c +3
-0struct imx_fb_videomode *mode;int num_modes; +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE )struct backlight_device *bl; +#endif I suspect this fails to build with
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_FB_IMX=y
you're right, I tested both =y and both =m but not one =y one =m :-(
Quoted 11 lines
Maybe do the following:
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \ (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) == defined(CONFIG_FB_IMX_MODULE))#define
BACKLIGHT_AVAILABLE
#endifand use #ifdef
BACKLIGHT_AVAILABLEto guard the backlight code?I didn't test this though.
patch follows (compile tested with all cases, including this new one ;-).
Eric
PATCH v3 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
In reply to Uwe Kleine-König---
v3: handle CONFIG_BACKLIGHT_CLASS_DEVICE=m & CONFIG_FB_IMX=y case as per
suggested by Uwe
v2: handle CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
drivers/video/imxfb.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
drivers/video/imxfb.c +17 -2
@@ -40,6 +40,12 @@*/ #define DEBUG_VAR 1 +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) && \ + defined(CONFIG_FB_IMX__MODULE )) +#define PWMR_BACKLIGHT_AVAILABLE +#endif +#define DRIVER_NAME "imx-fb"#define LCDC_SSA 0x00
@@ -175,7 +181,9 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#ifdef PWMR_BACKLIGHT_AVAILABLE struct backlight_device *bl; +#endif void (*lcd_power)(int );void (*backlight_power)(int );
@@ -450,8 +458,7 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } - - +#ifdef PWMR_BACKLIGHT_AVAILABLE static int imxfb_bl_get_brightness (struct backlight_device *bl) {struct imxfb_info *fbi =bl_get_data (bl);
@@ -516,6 +523,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)if (fbi->bl) backlight_device_unregister(fbi->bl); } +#endif static void imxfb_enable_controller (struct imxfb_info *fbi) {
@@ -647,6 +655,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); +#ifndef PWMR_BACKLIGHT_AVAILABLE +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +#endif writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -847,7 +858,9 @@ static int __init imxfb_probe(struct platform_device *pdev)imxfb_enable_controller (fbi); fbi->pdev = pdev; +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_init_backlight (fbi); +#endif return 0 ;
@@ -885,7 +898,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_exit_backlight (fbi); +#endif unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.6.3.3
PATCH v3 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Hello.
Quoted 1 line · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>
[...]
drivers/video/imxfb.c line 45
Quoted 11 lines
drivers/video/imxfb.c +3
-0@@ -40,6 +40,12 @@*/ #define DEBUG_VAR 1 +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) && \ + defined(CONFIG_FB_IMX__MODULE ))
Are you sure there should be two underscores before MODULE?
WBR, Sergei
PATCH v3 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Hi,
Le 29/07/2010 15:23, Sergei Shtylyov a ?crit :
Quoted 6 lines
Quoted 3 lines
+#if
defined(CONFIG_BACKLIGHT_CLASS_DEVICE)|| \
+ (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)&& \
+defined(CONFIG_FB_IMX__MODULE))Are you sure there should be two underscores before MODULE?
no ... that was only compile tested as you can see :-( Thanks and sorry for the noise for such a stupid patch !
Eric
PATCH v4 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
In reply to Sergei Shtylyov---
v4: fix typo in CONFIG_FB_IMX_MODULE
v3: handle CONFIG_BACKLIGHT_CLASS_DEVICE=m & CONFIG_FB_IMX=y case as per
suggested by Uwe
v2: handle CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
drivers/video/imxfb.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
drivers/video/imxfb.c +17 -2
@@ -40,6 +40,12 @@*/ #define DEBUG_VAR 1 +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) && \ + defined(CONFIG_FB_IMX_MODULE )) +#define PWMR_BACKLIGHT_AVAILABLE +#endif +#define DRIVER_NAME "imx-fb"#define LCDC_SSA 0x00
@@ -175,7 +181,9 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#ifdef PWMR_BACKLIGHT_AVAILABLE struct backlight_device *bl; +#endif void (*lcd_power)(int );void (*backlight_power)(int );
@@ -450,8 +458,7 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } - - +#ifdef PWMR_BACKLIGHT_AVAILABLE static int imxfb_bl_get_brightness (struct backlight_device *bl) {struct imxfb_info *fbi =bl_get_data (bl);
@@ -516,6 +523,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)if (fbi->bl) backlight_device_unregister(fbi->bl); } +#endif static void imxfb_enable_controller (struct imxfb_info *fbi) {
@@ -647,6 +655,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); +#ifndef PWMR_BACKLIGHT_AVAILABLE +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +#endif writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -847,7 +858,9 @@ static int __init imxfb_probe(struct platform_device *pdev)imxfb_enable_controller (fbi); fbi->pdev = pdev; +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_init_backlight (fbi); +#endif return 0 ;
@@ -885,7 +898,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_exit_backlight (fbi); +#endif unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.6.3.3
PATCH v4 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
Hello,
Quoted 6 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
v4: fix typo inCONFIG_FB_IMX_MODULE
v3: handleCONFIG_BACKLIGHT_CLASS_DEVICE=m&CONFIG_FB_IMX=ycase as per
suggested by Uwe
v2: handleCONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
looks ok to me now (though I didn't compile test). (i.e. something like:
)
Sascha, can you please take this.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
From: Eric B?nard <[email protected]>
This fixes the following build failure:
drivers/built-in.o: In function `imxfb_probe': mxcmmc.c:(.init.text+0xd04): undefined reference to `backlight_device_register' drivers/built-in.o: In function `imxfb_remove': mxcmmc.c:(.devexit.text+0x44): undefined reference to `backlight_device_unregister'
that was introduced by
7a2bb23 (imxfb: add pwmr controlled backlight support)
---
KernelVersion: v2.6.35-rc1-118-g7a2bb23
drivers/video/imxfb.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
drivers/video/imxfb.c +17 -2
@@ -40,6 +40,12 @@*/ #define DEBUG_VAR 1 +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) && \ + defined(CONFIG_FB_IMX_MODULE )) +#define PWMR_BACKLIGHT_AVAILABLE +#endif +#define DRIVER_NAME "imx-fb"#define LCDC_SSA 0x00
@@ -175,7 +181,9 @@ struct imxfb_info {struct imx_fb_videomode *mode;int num_modes; +#ifdef PWMR_BACKLIGHT_AVAILABLE struct backlight_device *bl; +#endif void (*lcd_power)(int );void (*backlight_power)(int );
@@ -450,8 +458,7 @@ static int imxfb_set_par(struct fb_info *info)return 0 ; } - - +#ifdef PWMR_BACKLIGHT_AVAILABLE static int imxfb_bl_get_brightness (struct backlight_device *bl) {struct imxfb_info *fbi =bl_get_data (bl);
@@ -516,6 +523,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)if (fbi->bl) backlight_device_unregister(fbi->bl); } +#endif static void imxfb_enable_controller (struct imxfb_info *fbi) {
@@ -647,6 +655,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf fbi->regs + LCDC_SIZE);writel (fbi->pcr, fbi->regs +LCDC_PCR ); +#ifndef PWMR_BACKLIGHT_AVAILABLE +writel (fbi->pwmr, fbi->regs +LCDC_PWMR ); +#endif writel (fbi->lscr1, fbi->regs +LCDC_LSCR1 );writel (fbi->dmacr, fbi->regs +LCDC_DMACR );
@@ -847,7 +858,9 @@ static int __init imxfb_probe(struct platform_device *pdev)imxfb_enable_controller (fbi); fbi->pdev = pdev; +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_init_backlight (fbi); +#endif return 0 ;
@@ -885,7 +898,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)imxfb_disable_controller (fbi); +#ifdef PWMR_BACKLIGHT_AVAILABLE imxfb_exit_backlight (fbi); +#endif unregister_framebuffer (info); pdata = pdev->dev.platform_data;
Signature · 1 line
1.7.1
PATCH v3 1/1 video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
In reply to Eric BénardQuoted 14 lines · Eric B?nard
Signed-off-by Eric B?nard <[email protected]>---
v3: handleCONFIG_BACKLIGHT_CLASS_DEVICE=m&CONFIG_FB_IMX=ycase as per
suggested by Uwe
v2: handleCONFIG_BACKLIGHT_CLASS_DEVICE_MODULEdrivers/video/imxfb.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)drivers/video/imxfb.c +0
-0
drivers/video/imxfb.c line 45
Quoted 6 lines
drivers/video/imxfb.c +3
-0@@ -40,6 +40,12 @@*/ #define DEBUG_VAR 1 +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || \ + (defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) && \ + defined(CONFIG_FB_IMX__MODULE ))
^^
should be just one '_'.
Lothar Wa?mann
Signature · 9 lines
___________________________________________________________ Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Gesch?ftsf?hrer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | info at karo-electronics.de ___________________________________________________________
PATCH 3/3 imxfb: add pwmr controlled backlight support
In reply to Uwe Kleine-KönigHi Uwe,
Le 29/07/2010 07:16, Uwe Kleine-K?nig a ?crit :
Quoted 12 lines
Quoted 3 lines
Signed-off-by Eric B?nard<[email protected]>---
v2 : updated to use backlight infrastructurethis should have a dependency on
CONFIG_BACKLIGHT_CLASS_DEVICE. As Sascha already took your patch you can just try to buildmx27_defconfigon his for-rmk branch :-|Instead of a dependency I would prefer to have imxfb usable without
CONFIG_BACKLIGHT_CLASS_DEVICE. From a quick look there are drivers that have that. (I checkeddrivers/video/sa1100fb.c+drivers/video/backlight/locomolcd.c.)
I've just sent a patch which fixes this build failure with mx27_defconfig. When CONFIG_BACKLIGHT_CLASS_DEVICE is not selected, the driver is now as it was before my patch.
I'll try to put the backligh things in a driver into backlight directory when I find time, which will remove the #ifdef
Also, I confirm the patch you sent for arch/arm/plat-mxc/include/mach/gpio.h is necessary to compile a kernel using mx27_defconfig .
Thanks,
Eric
PATCH 1/3 eukrea_mbimxsd: factorize motherboard support
In reply to Eric BénardHiho,
Quoted 2 lines · Eric B?nard
This motherboard is used for both an i.MX25 and an i.MX35 machines so we can have only one file to support it in plat-mxc.
"This fixes the warning ..." please
Quoted 715 lines
Signed-off-by Eric B?nard <[email protected]>---
v2 : rebased against last imx-for-2.6.36 brancharch/arm/mach-mx25/Kconfig | 14 - arch/arm/mach-mx25/Makefile | 1 - arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c | 261 -------------------- arch/arm/mach-mx25/mach-cpuimx25.c | 2 +- arch/arm/mach-mx3/Kconfig | 14 - arch/arm/mach-mx3/Makefile | 1 - arch/arm/mach-mx3/mach-cpuimx35.c | 2 +- arch/arm/plat-mxc/Kconfig | 8 + arch/arm/plat-mxc/Makefile | 1 + .../eukrea_mbimxsd-baseboard.c | 184 +++++++++++--- .../plat-mxc/include/mach/board-eukrea_cpuimx35.h | 40 --- ...d-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} | 10 +- 12 files changed, 163 insertions(+), 375 deletions(-) delete mode 100644 arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c rename arch/arm/{mach-mx3 => plat-mxc}/eukrea_mbimxsd-baseboard.c (69%) delete mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx35.h rename arch/arm/plat-mxc/include/mach/{board-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} (83%)arch/arm/mach-mx25/Kconfig +0
-14@@ -14,18 +14,4 @@ config MACH_EUKREA_CPUIMX25 select IMX_HAVE_PLATFORM_MXC_NAND select MXC_ULPI if USB_ULPI -choice - prompt "Baseboard" - depends on MACH_EUKREA_CPUIMX25 - default MACH_EUKREA_MBIMXSD_BASEBOARD - -config MACH_EUKREA_MBIMXSD_BASEBOARD - prompt "Eukrea MBIMXSD development board" - bool - help - This adds board specific devices that can be found on Eukrea's - MBIMXSD evaluation board. - -endchoice - endifarch/arm/mach-mx25/Makefile +0
-1@@ -2,4 +2,3 @@ obj-y := mm.o devices.o obj-$(CONFIG_ARCH_MX25) += clock.o obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-cpuimx25.o -obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.oarch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c deleted +0
-261@@ -1,261 +0,0 @@ -/* -* Copyright (C) 2010 Eric Benard - eric at eukrea.com -* -* Based on pcm970-baseboard.c which is : -* Copyright (C) 2008 Juergen Beisert (kernel at pengutronix.de) -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -* MA 02110-1301, USA. -*/ - -#include <linux/gpio.h> -#include <linux/leds.h> -#include <linux/platform_device.h> -#include <linux/gpio_keys.h> -#include <linux/input.h> -#include <video/platform_lcd.h> - -#include <mach/board-eukrea_cpuimx25.h> -#include <mach/hardware.h> -#include <mach/iomux-mx25.h> -#include <mach/common.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <mach/mx25.h> -#include <mach/imx-uart.h> -#include <mach/imxfb.h> -#include <mach/ssi.h> -#include <mach/audmux.h> - -#include "devices-imx25.h" -#include "devices.h" - -static struct pad_desc eukrea_mbimxsd_pads[] = { -/* LCD */ -MX25_PAD_LD0__LD0 , -MX25_PAD_LD1__LD1 , -MX25_PAD_LD2__LD2 , -MX25_PAD_LD3__LD3 , -MX25_PAD_LD4__LD4 , -MX25_PAD_LD5__LD5 , -MX25_PAD_LD6__LD6 , -MX25_PAD_LD7__LD7 , -MX25_PAD_LD8__LD8 , -MX25_PAD_LD9__LD9 , -MX25_PAD_LD10__LD10 , -MX25_PAD_LD11__LD11 , -MX25_PAD_LD12__LD12 , -MX25_PAD_LD13__LD13 , -MX25_PAD_LD14__LD14 , -MX25_PAD_LD15__LD15 , -MX25_PAD_GPIO_E__LD16 , -MX25_PAD_GPIO_F__LD17 , -MX25_PAD_HSYNC__HSYNC , -MX25_PAD_VSYNC__VSYNC , -MX25_PAD_LSCLK__LSCLK , -MX25_PAD_OE_ACD__OE_ACD , -MX25_PAD_CONTRAST__CONTRAST , -/* LCD_PWR */ -MX25_PAD_PWM__GPIO_1_26 , -/* LED */ -MX25_PAD_POWER_FAIL__GPIO_3_19 , -/* SWITCH */ -MX25_PAD_VSTBY_ACK__GPIO_3_18 , -/* UART2 */ -MX25_PAD_UART2_RTS__UART2_RTS , -MX25_PAD_UART2_CTS__UART2_CTS , -MX25_PAD_UART2_TXD__UART2_TXD , -MX25_PAD_UART2_RXD__UART2_RXD , -/* SD1 */ -MX25_PAD_SD1_CMD__SD1_CMD , -MX25_PAD_SD1_CLK__SD1_CLK , -MX25_PAD_SD1_DATA0__SD1_DATA0 , -MX25_PAD_SD1_DATA1__SD1_DATA1 , -MX25_PAD_SD1_DATA2__SD1_DATA2 , -MX25_PAD_SD1_DATA3__SD1_DATA3 , -/* SD1 CD */ -MX25_PAD_DE_B__GPIO_2_20 , -/* I2S */ -MX25_PAD_KPP_COL3__AUD5_TXFS , -MX25_PAD_KPP_COL2__AUD5_TXC , -MX25_PAD_KPP_COL1__AUD5_RXD , -MX25_PAD_KPP_COL0__AUD5_TXD , -}; - -#define GPIO_LED1 83 -#define GPIO_SWITCH1 82 -#define GPIO_SD1CD 52 -#define GPIO_LCDPWR 26 - -static struct imx_fb_videomode eukrea_mximxsd_modes[] = { - { - .mode = { - .name ="CMO-QVGA" , - .refresh =60 , - .xres =320 , - .yres =240 , - .pixclock =KHZ2PICOS (6500 ), - .left_margin =30 , - .right_margin =38 , - .upper_margin =20 , - .lower_margin =3 , - .hsync_len =15 , - .vsync_len =4 , - }, - .bpp =16 , - .pcr =0xCAD08B80 , - }, -}; - -static struct imx_fb_platform_data eukrea_mximxsd_fb_pdata = { - .mode = eukrea_mximxsd_modes, - .num_modes =ARRAY_SIZE (eukrea_mximxsd_modes), - .pwmr =0x00A903FF , - .lscr1 =0x00120300 , - .dmacr =0x00040060 , -}; - -static void eukrea_mbimxsd_lcd_power_set (struct plat_lcd_data *pd, -unsigned int power) -{ -if (power) -gpio_direction_output (GPIO_LCDPWR ,1 ); -else -gpio_direction_output (GPIO_LCDPWR ,0 ); -} - -static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = { - .set_power = eukrea_mbimxsd_lcd_power_set, -}; - -static struct platform_device eukrea_mbimxsd_lcd_powerdev = { - .name ="platform-lcd" , - .dev.platform_data = &eukrea_mbimxsd_lcd_power_data, -}; - -static struct gpio_led eukrea_mbimxsd_leds[] = { - { - .name ="led1" , - .default_trigger ="heartbeat" , - .active_low =1 , - .gpio =GPIO_LED1 , - }, -}; - -static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { - .leds = eukrea_mbimxsd_leds, - .num_leds =ARRAY_SIZE (eukrea_mbimxsd_leds), -}; - -static struct platform_device eukrea_mbimxsd_leds_gpio = { - .name ="leds-gpio" , - .id =-1 , - .dev = { - .platform_data = &eukrea_mbimxsd_led_info, - }, -}; - -static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { - { - .gpio =GPIO_SWITCH1 , - .code =BTN_0 , - .desc ="BP1" , - .active_low =1 , - .wakeup =1 , - }, -}; - -static struct gpio_keys_platform_data eukrea_mbimxsd_button_data = { - .buttons = eukrea_mbimxsd_gpio_buttons, - .nbuttons =ARRAY_SIZE (eukrea_mbimxsd_gpio_buttons), -}; - -static struct platform_device eukrea_mbimxsd_button_device = { - .name ="gpio-keys" , - .id =-1 , - .num_resources =0 , - .dev = { - .platform_data = &eukrea_mbimxsd_button_data, - } -}; - -static struct platform_device *platform_devices[]__initdata = { - &eukrea_mbimxsd_leds_gpio, - &eukrea_mbimxsd_button_device, - &eukrea_mbimxsd_lcd_powerdev, -}; - -static const struct imxuart_platform_data uart_pdata__initconst = { - .flags =IMXUART_HAVE_RTSCTS , -}; - -static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { - { -I2C_BOARD_INFO ("tlv320aic23" ,0x1a ), - }, -}; - -struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { - .flags =IMX_SSI_SYN |IMX_SSI_NET |IMX_SSI_USE_I2S_SLAVE , -}; - -/* -* system init for baseboard usage. Will be called by cpuimx25 init. -* -* Add platform devices present on this baseboard and init -* them from CPU side as far as required to use them later on -*/ -void __init eukrea_mbimxsd_baseboard_init (void ) -{ -if (mxc_iomux_v3_setup_multiple_pads (eukrea_mbimxsd_pads, -ARRAY_SIZE (eukrea_mbimxsd_pads))) -printk (KERN_ERR "error setting mbimxsd pads !\n" ); - -#if defined(CONFIG_SND_SOC_EUKREA_TLV320 ) -/* SSI unit master I2S codec connected to SSI_AUD5*/ -mxc_audmux_v2_configure_port (0 , -MXC_AUDMUX_V2_PTCR_SYN | -MXC_AUDMUX_V2_PTCR_TFSDIR | -MXC_AUDMUX_V2_PTCR_TFSEL (4 ) | -MXC_AUDMUX_V2_PTCR_TCLKDIR | -MXC_AUDMUX_V2_PTCR_TCSEL (4 ), -MXC_AUDMUX_V2_PDCR_RXDSEL (4 ) - ); -mxc_audmux_v2_configure_port (4 , -MXC_AUDMUX_V2_PTCR_SYN , -MXC_AUDMUX_V2_PDCR_RXDSEL (0 ) - ); -#endif - -imx25_add_imx_uart1 (&uart_pdata); -mxc_register_device (&mx25_fb_device, &eukrea_mximxsd_fb_pdata); -mxc_register_device (&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); - -gpio_request (GPIO_LED1 ,"LED1" ); -gpio_direction_output (GPIO_LED1 ,1 ); -gpio_free (GPIO_LED1 ); - -gpio_request (GPIO_SWITCH1 ,"SWITCH1" ); -gpio_direction_input (GPIO_SWITCH1 ); -gpio_free (GPIO_SWITCH1 ); - -gpio_request (GPIO_LCDPWR ,"LCDPWR" ); -gpio_direction_output (GPIO_LCDPWR ,1 ); -gpio_free (GPIO_SWITCH1 ); - -i2c_register_board_info (0 , eukrea_mbimxsd_i2c_devices, -ARRAY_SIZE (eukrea_mbimxsd_i2c_devices)); - -platform_add_devices (platform_devices,ARRAY_SIZE (platform_devices)); -}arch/arm/mach-mx25/mach-cpuimx25.c +1
-1@@ -29,7 +29,7 @@#include <linux/usb/ulpi.h> #include <linux/fsl_devices.h> -#include <mach/board-eukrea_cpuimx25.h> +#include <mach/board-eukrea_cpuimxsd.h> #include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> arch/arm/mach-mx3/Kconfig +0
-14@@ -163,18 +163,4 @@ config MACH_EUKREA_CPUIMX35 Include support for Eukrea CPUIMX35 platform. This includes specific configurations for the board and its peripherals. -choice - prompt "Baseboard" - depends on MACH_EUKREA_CPUIMX35 - default MACH_EUKREA_MBIMXSD_BASEBOARD - -config MACH_EUKREA_MBIMXSD_BASEBOARD - prompt "Eukrea MBIMXSD development board" - bool - help - This adds board specific devices that can be found on Eukrea's - MBIMXSD evaluation board. - -endchoice - endifarch/arm/mach-mx3/Makefile +0
-1@@ -25,4 +25,3 @@ obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o -obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.oarch/arm/mach-mx3/mach-cpuimx35.c +1
-1@@ -37,7 +37,7 @@#include <asm/mach/time.h> #include <asm/mach/map.h> -#include <mach/board-eukrea_cpuimx35.h> +#include <mach/board-eukrea_cpuimxsd.h> #include <mach/hardware.h> #include <mach/common.h> #include <mach/iomux-mx35.h> arch/arm/plat-mxc/Kconfig +8
-0@@ -91,6 +91,14 @@ config MXC_DEBUG_BOARD data/address de-multiplexing and decode, signal level shift, interrupt control and various board functions. +config MACH_EUKREA_MBIMXSD_BASEBOARD + prompt "Eukrea MBIMXSD development board" + depends on MACH_EUKREA_CPUIMX25 || MACH_EUKREA_CPUIMX35 + bool + help + This adds board specific devices that can be found on Eukrea's + MBIMXSD evaluation board. + config MXC_ULPI boolarch/arm/plat-mxc/Makefile +1
-0@@ -16,6 +16,7 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o +obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o ifdef CONFIG_SND_IMX_SOC obj-y += ssi-fiq.o obj-y += ssi-fiq-ksym.oarch/arm/plat-mxc/eukrea_mbimxsd-baseboard.c renamed from arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c +147
-37@@ -36,49 +36,119 @@#include <asm/mach/time.h> #include <asm/mach/map.h> -#include <mach/board-eukrea_cpuimx35.h> #include <mach/hardware.h> #include <mach/common.h> -#include <mach/imx-uart.h> +#include <mach/board-eukrea_cpuimxsd.h> + +#if defined(CONFIG_MACH_EUKREA_CPUIMX25 ) +#include <mach/iomux-mx25.h> +#include <mach/mx25.h> +#include <mach/imxfb.h> +#include "../mach-mx25/devices-imx25.h" +#include "../mach-mx25/devices.h" +#endif + +#if defined(CONFIG_MACH_EUKREA_CPUIMX35 )#include <mach/iomux-mx35.h> #include <mach/ipu.h> #include <mach/mx3fb.h> -#include <mach/audmux.h> +#include "../mach-mx3/devices-imx35.h" +#include "../mach-mx3/devices.h" +#endif + +#include <mach/imx-uart.h> #include <mach/ssi.h> +#include <mach/audmux.h> -#include "devices-imx35.h" -#include "devices.h" +#if defined(CONFIG_MACH_EUKREA_CPUIMX25 ) +static struct pad_desc eukrea_mbimxsd_pads[] = { +/* LCD */ +MX25_PAD_LD0__LD0 , +MX25_PAD_LD1__LD1 , +MX25_PAD_LD2__LD2 , +MX25_PAD_LD3__LD3 , +MX25_PAD_LD4__LD4 , +MX25_PAD_LD5__LD5 , +MX25_PAD_LD6__LD6 , +MX25_PAD_LD7__LD7 , +MX25_PAD_LD8__LD8 , +MX25_PAD_LD9__LD9 , +MX25_PAD_LD10__LD10 , +MX25_PAD_LD11__LD11 , +MX25_PAD_LD12__LD12 , +MX25_PAD_LD13__LD13 , +MX25_PAD_LD14__LD14 , +MX25_PAD_LD15__LD15 , +MX25_PAD_GPIO_E__LD16 , +MX25_PAD_GPIO_F__LD17 , +MX25_PAD_HSYNC__HSYNC , +MX25_PAD_VSYNC__VSYNC , +MX25_PAD_LSCLK__LSCLK , +MX25_PAD_OE_ACD__OE_ACD , +MX25_PAD_CONTRAST__CONTRAST , +/* LCD_PWR */ +MX25_PAD_PWM__GPIO_1_26 , +/* LED */ +MX25_PAD_POWER_FAIL__GPIO_3_19 , +/* SWITCH */ +MX25_PAD_VSTBY_ACK__GPIO_3_18 , +/* UART2 */ +MX25_PAD_UART2_RTS__UART2_RTS , +MX25_PAD_UART2_CTS__UART2_CTS , +MX25_PAD_UART2_TXD__UART2_TXD , +MX25_PAD_UART2_RXD__UART2_RXD , +/* SD1 */ +MX25_PAD_SD1_CMD__SD1_CMD , +MX25_PAD_SD1_CLK__SD1_CLK , +MX25_PAD_SD1_DATA0__SD1_DATA0 , +MX25_PAD_SD1_DATA1__SD1_DATA1 , +MX25_PAD_SD1_DATA2__SD1_DATA2 , +MX25_PAD_SD1_DATA3__SD1_DATA3 , +/* SD1 CD */ +MX25_PAD_DE_B__GPIO_2_20 , +/* I2S */ +MX25_PAD_KPP_COL3__AUD5_TXFS , +MX25_PAD_KPP_COL2__AUD5_TXC , +MX25_PAD_KPP_COL1__AUD5_RXD , +MX25_PAD_KPP_COL0__AUD5_TXD , +}; -static const struct fb_videomode fb_modedb[] = { +#define GPIO_LED1 83 +#define GPIO_SWITCH1 82 +#define GPIO_SD1CD 52 +#define GPIO_LCDPWR 26 +#define SSI_PORT 4 + +static struct imx_fb_videomode eukrea_mximxsd_modes[] = { { - .name ="CMO_QVGA" , - .refresh =60 , - .xres =320 , - .yres =240 , - .pixclock =KHZ2PICOS (6500 ), - .left_margin =68 , - .right_margin =20 , - .upper_margin =15 , - .lower_margin =4 , - .hsync_len =30 , - .vsync_len =3 , - .sync =0 , - .vmode =FB_VMODE_NONINTERLACED , - .flag =0 , + .mode = { + .name ="CMO-QVGA" , + .refresh =60 , + .xres =320 , + .yres =240 , + .pixclock =KHZ2PICOS (6500 ), + .left_margin =30 , + .right_margin =38 , + .upper_margin =20 , + .lower_margin =3 , + .hsync_len =15 , + .vsync_len =4 , + }, + .bpp =16 , + .pcr =0xCAD08B80 , }, }; -static struct ipu_platform_data mx3_ipu_data = { - .irq_base =MXC_IPU_IRQ_START , -}; - -static struct mx3fb_platform_data mx3fb_pdata = { - .dma_dev = &mx3_ipu.dev, - .name ="CMO_QVGA" , - .mode = fb_modedb, - .num_modes =ARRAY_SIZE (fb_modedb), +static struct imx_fb_platform_data eukrea_mximxsd_fb_pdata = { + .mode = eukrea_mximxsd_modes, + .num_modes =ARRAY_SIZE (eukrea_mximxsd_modes), + .pwmr =0x00A903FF , + .lscr1 =0x00120300 , + .dmacr =0x00040060 , }; +#endif +#if defined(CONFIG_MACH_EUKREA_CPUIMX35 )static struct pad_desc eukrea_mbimxsd_pads[] = {/* LCD */ MX35_PAD_LD0__IPU_DISPB_DAT_0,@@ -126,6 +196,38 @@ static struct pad_desc eukrea_mbimxsd_pads[] = {#define GPIO_LED1 (2 * 32 + 29)#define GPIO_SWITCH1 (2 * 32 + 25)#define GPIO_LCDPWR (4) +#define SSI_PORT (3) + +static const struct fb_videomode fb_modedb[] = { + { + .name ="CMO_QVGA" , + .refresh =60 , + .xres =320 , + .yres =240 , + .pixclock =KHZ2PICOS (6500 ), + .left_margin =68 , + .right_margin =20 , + .upper_margin =15 , + .lower_margin =4 , + .hsync_len =30 , + .vsync_len =3 , + .sync =0 , + .vmode =FB_VMODE_NONINTERLACED , + .flag =0 , + }, +}; + +static struct ipu_platform_data mx3_ipu_data = { + .irq_base =MXC_IPU_IRQ_START , +}; + +static struct mx3fb_platform_data mx3fb_pdata = { + .dma_dev = &mx3_ipu.dev, + .name ="CMO_QVGA" , + .mode = fb_modedb, + .num_modes =ARRAY_SIZE (fb_modedb), +}; +#endif static void eukrea_mbimxsd_lcd_power_set (struct plat_lcd_data *pd,unsigned int power)@@ -207,12 +309,14 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { }, }; +#if defined(CONFIG_SND_SOC_EUKREA_TLV320 )struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata = { .flags =IMX_SSI_SYN |IMX_SSI_NET |IMX_SSI_USE_I2S_SLAVE , }; +#endif /* -* system init for baseboard usage. Will be called by cpuimx35 init. +* system init for baseboard usage. Will be called by cpuimxX5 init. * * Add platform devices present on this baseboard and init * them from CPU side as far as required to use them later on @@ -224,26 +328,32 @@ void __init eukrea_mbimxsd_baseboard_init(void)printk (KERN_ERR "error setting mbimxsd pads !\n" );#if defined(CONFIG_SND_SOC_EUKREA_TLV320 ) -/* SSI unit master I2S codec connected to SSI_AUD4 */ +/* SSI unit master I2S codec connected to SSI_AUD */ mxc_audmux_v2_configure_port (0 ,MXC_AUDMUX_V2_PTCR_SYN |MXC_AUDMUX_V2_PTCR_TFSDIR | -MXC_AUDMUX_V2_PTCR_TFSEL (3 ) | +MXC_AUDMUX_V2_PTCR_TFSEL (SSI_PORT ) |MXC_AUDMUX_V2_PTCR_TCLKDIR | -MXC_AUDMUX_V2_PTCR_TCSEL (3 ), -MXC_AUDMUX_V2_PDCR_RXDSEL (3 ) +MXC_AUDMUX_V2_PTCR_TCSEL (SSI_PORT ), +MXC_AUDMUX_V2_PDCR_RXDSEL (SSI_PORT ) ); -mxc_audmux_v2_configure_port (3 , +mxc_audmux_v2_configure_port (SSI_PORT ,MXC_AUDMUX_V2_PTCR_SYN ,MXC_AUDMUX_V2_PDCR_RXDSEL (0 ) ); +mxc_register_device (&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata);#endif +#if defined(CONFIG_MACH_EUKREA_CPUIMX25 ) +imx25_add_imx_uart1 (&uart_pdata); +mxc_register_device (&mx25_fb_device, &eukrea_mximxsd_fb_pdata); +#endif + +#if defined(CONFIG_MACH_EUKREA_CPUIMX35 )imx35_add_imx_uart1 (&uart_pdata);mxc_register_device (&mx3_ipu, &mx3_ipu_data);mxc_register_device (&mx3_fb, &mx3fb_pdata); - -mxc_register_device (&imx_ssi_device0, &eukrea_mbimxsd_ssi_pdata); +#endif gpio_request (GPIO_LED1 ,"LED1" );gpio_direction_output (GPIO_LED1 ,1 );arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx35.h deleted +0
-40@@ -1,40 +0,0 @@ -/* -* Copyright (C) 2010 Eric Benard - eric at eukrea.com -* -* Based on board-pcm038.h which is : -* Copyright (C) 2008 Juergen Beisert (kernel at pengutronix.de) -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -* MA 02110-1301, USA. -*/ - -#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ -#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ - -#ifndef __ASSEMBLY__ -/* -* This CPU module needs a baseboard to work. After basic initializing -* its own devices, it calls baseboard's init function. -* TODO: Add your own baseboard init function and call it from -* inside eukrea_cpuimx25_init(). -* -* This example here is for the development board. Refer -* eukrea_mbimx25-baseboard.c -*/ - -extern void eukrea_mbimxsd_baseboard_init (void ); - -#endif - -#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX35_H__ */ arch/arm/plat-mxc/include/mach/board-eukrea_cpuimxsd.h renamed from arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx25.h +0
-0
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimxsd.h line 22
Quoted 6 lines
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimxsd.h renamed from arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx25.h +1
-2@@ -19,22 +19,22 @@* MA 02110-1301, USA. */ -#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX25_H__ -#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX25_H__ +#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMXSD_H__
#ifndef __MACH_BOARD_EUKREA_CPUIMXSD_H__ please
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |