diff options
Diffstat (limited to 'arch/arm/mach-omap2')
36 files changed, 679 insertions, 371 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index e0a318df95b..497e9dc2795 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -36,6 +36,7 @@ config ARCH_OMAP3  	select ARM_L1_CACHE_SHIFT_6 if !ARCH_OMAP4  	select ARCH_HAS_OPP  	select PM_OPP if PM +	select ARM_CPU_SUSPEND if PM  config ARCH_OMAP4  	bool "TI OMAP4" @@ -50,6 +51,7 @@ config ARCH_OMAP4  	select ARCH_HAS_OPP  	select PM_OPP if PM  	select USB_ARCH_HAS_EHCI +	select ARM_CPU_SUSPEND if PM  comment "OMAP Core Type"  	depends on ARCH_OMAP2 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 512978586b2..69ab1c06913 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -221,16 +221,12 @@ obj-$(CONFIG_MACH_CM_T35)		+= board-cm-t35.o  obj-$(CONFIG_MACH_CM_T3517)		+= board-cm-t3517.o  obj-$(CONFIG_MACH_IGEP0020)		+= board-igep0020.o  obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK)	+= board-omap3touchbook.o -obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o \ -					   omap_phy_internal.o -obj-$(CONFIG_MACH_OMAP4_PANDA)		+= board-omap4panda.o \ -					   omap_phy_internal.o +obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o +obj-$(CONFIG_MACH_OMAP4_PANDA)		+= board-omap4panda.o -obj-$(CONFIG_MACH_PCM049)		+= board-omap4pcm049.o \ -					   omap_phy_internal.o +obj-$(CONFIG_MACH_PCM049)		+= board-omap4pcm049.o -obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o \ -					   omap_phy_internal.o +obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o  obj-$(CONFIG_MACH_CRANEBOARD)		+= board-am3517crane.o @@ -250,6 +246,8 @@ obj-y					+= $(omap-hsmmc-m) $(omap-hsmmc-y)  usbfs-$(CONFIG_ARCH_OMAP_OTG)		:= usb-fs.o  obj-y					+= $(usbfs-m) $(usbfs-y)  obj-y					+= usb-musb.o +obj-y					+= omap_phy_internal.o +  obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o  obj-y					+= usb-host.o diff --git a/arch/arm/mach-omap2/Makefile.boot b/arch/arm/mach-omap2/Makefile.boot index 565aff7f37a..b03e562acc6 100644 --- a/arch/arm/mach-omap2/Makefile.boot +++ b/arch/arm/mach-omap2/Makefile.boot @@ -1,3 +1,3 @@ -  zreladdr-y		:= 0x80008000 +  zreladdr-y		+= 0x80008000  params_phys-y		:= 0x80000100  initrd_phys-y		:= 0x80800000 diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 638cecb9ea1..d704f0ac328 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -39,6 +39,9 @@  #include <plat/usb.h>  #include <plat/gpmc-smc91x.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> +  #include "mux.h"  #include "hsmmc.h"  #include "common-board-devices.h" @@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = {  	.resource	= &sdp2430_flash_resource,  }; -static struct platform_device sdp2430_lcd_device = { -	.name		= "sdp2430_lcd", -	.id		= -1, -}; -  static struct platform_device *sdp2430_devices[] __initdata = {  	&sdp2430_flash_device, +}; + +/* LCD */ +#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO	91 +#define SDP2430_LCD_PANEL_ENABLE_GPIO		154 + +static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev) +{ +	gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1); +	gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1); + +	return 0; +} + +static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev) +{ +	gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0); +	gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0); +} + +static struct panel_generic_dpi_data sdp2430_panel_data = { +	.name			= "nec_nl2432dr22-11b", +	.platform_enable	= sdp2430_panel_enable_lcd, +	.platform_disable	= sdp2430_panel_disable_lcd, +}; + +static struct omap_dss_device sdp2430_lcd_device = { +	.name			= "lcd", +	.driver_name		= "generic_dpi_panel", +	.type			= OMAP_DISPLAY_TYPE_DPI, +	.phy.dpi.data_lines	= 16, +	.data			= &sdp2430_panel_data, +}; + +static struct omap_dss_device *sdp2430_dss_devices[] = {  	&sdp2430_lcd_device,  }; -static struct omap_lcd_config sdp2430_lcd_config __initdata = { -	.ctrl_name	= "internal", +static struct omap_dss_board_info sdp2430_dss_data = { +	.num_devices	= ARRAY_SIZE(sdp2430_dss_devices), +	.devices	= sdp2430_dss_devices, +	.default_device	= &sdp2430_lcd_device,  }; +static void __init sdp2430_display_init(void) +{ +	int r; + +	static struct gpio gpios[] __initdata = { +		{ SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, +			"LCD reset" }, +		{ SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, +			"LCD Backlight" }, +	}; + +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); +	if (r) { +		pr_err("Cannot request LCD GPIOs, error %d\n", r); +		return; +	} + +	omap_display_init(&sdp2430_dss_data); +} +  #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)  static struct omap_smc91x_platform_data board_smc91x_data = { @@ -137,10 +192,6 @@ static inline void board_smc91x_init(void)  #endif -static struct omap_board_config_kernel sdp2430_config[] __initdata = { -	{OMAP_TAG_LCD, &sdp2430_lcd_config}, -}; -  static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {  	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),  }; @@ -223,9 +274,6 @@ static void __init omap_2430sdp_init(void)  {  	omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); -	omap_board_config = sdp2430_config; -	omap_board_config_size = ARRAY_SIZE(sdp2430_config); -  	omap2430_i2c_init();  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); @@ -242,6 +290,8 @@ static void __init omap_2430sdp_init(void)  	/* Turn off secondary LCD backlight */  	gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,  			 "Secondary LCD backlight"); + +	sdp2430_display_init();  }  MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 5b5999caf71..77142c13fa1 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -37,7 +37,7 @@  #include <plat/dma.h>  #include <plat/gpmc.h>  #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/gpmc-smc91x.h> @@ -186,8 +186,7 @@ static struct omap_dss_device sdp3430_lcd_device = {  	.platform_disable	= sdp3430_panel_disable_lcd,  }; -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= sdp3430_panel_enable_dvi,  	.platform_disable	= sdp3430_panel_disable_dvi,  }; @@ -195,7 +194,7 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device sdp3430_dvi_device = {  	.name			= "dvi",  	.type			= OMAP_DISPLAY_TYPE_DPI, -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 6d2b61409c1..515646886b5 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -38,6 +38,8 @@  #include <plat/mmc.h>  #include <plat/omap4-keypad.h>  #include <video/omapdss.h> +#include <video/omap-panel-nokia-dsi.h> +#include <video/omap-panel-picodlp.h>  #include <linux/wl12xx.h>  #include "mux.h" @@ -52,6 +54,8 @@  #define OMAP4_SFH7741_ENABLE_GPIO		188  #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */  #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ +#define DISPLAY_SEL_GPIO	59	/* LCD2/PicoDLP switch */ +#define DLP_POWER_ON_GPIO	40  #define GPIO_WIFI_PMENA		54  #define GPIO_WIFI_IRQ		53 @@ -340,11 +344,6 @@ static int __init omap_ethernet_init(void)  	return status;  } -static struct platform_device sdp4430_lcd_device = { -	.name		= "sdp4430_lcd", -	.id		= -1, -}; -  static struct regulator_consumer_supply sdp4430_vbat_supply[] = {  	REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"),  	REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), @@ -374,21 +373,12 @@ static struct platform_device sdp4430_vbat = {  };  static struct platform_device *sdp4430_devices[] __initdata = { -	&sdp4430_lcd_device,  	&sdp4430_gpio_keys_device,  	&sdp4430_leds_gpio,  	&sdp4430_leds_pwm,  	&sdp4430_vbat,  }; -static struct omap_lcd_config sdp4430_lcd_config __initdata = { -	.ctrl_name	= "internal", -}; - -static struct omap_board_config_kernel sdp4430_config[] __initdata = { -	{ OMAP_TAG_LCD,		&sdp4430_lcd_config }, -}; -  static struct omap_musb_board_data musb_board_data = {  	.interface_type		= MUSB_INTERFACE_UTMI,  	.mode			= MUSB_OTG, @@ -642,37 +632,202 @@ static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)  	gpio_free(HDMI_GPIO_HPD);  } -static struct omap_dss_device sdp4430_hdmi_device = { -	.name = "hdmi", -	.driver_name = "hdmi_panel", -	.type = OMAP_DISPLAY_TYPE_HDMI, -	.clocks	= { -		.dispc	= { +static struct nokia_dsi_panel_data dsi1_panel = { +		.name		= "taal", +		.reset_gpio	= 102, +		.use_ext_te	= false, +		.ext_te_gpio	= 101, +		.esd_interval	= 0, +}; + +static struct omap_dss_device sdp4430_lcd_device = { +	.name			= "lcd", +	.driver_name		= "taal", +	.type			= OMAP_DISPLAY_TYPE_DSI, +	.data			= &dsi1_panel, +	.phy.dsi		= { +		.clk_lane	= 1, +		.clk_pol	= 0, +		.data1_lane	= 2, +		.data1_pol	= 0, +		.data2_lane	= 3, +		.data2_pol	= 0, + +		.module		= 0, +	}, + +	.clocks = { +		.dispc = { +			.channel = { +				/* Logic Clock = 172.8 MHz */ +				.lck_div	= 1, +				/* Pixel Clock = 34.56 MHz */ +				.pck_div	= 5, +				.lcd_clk_src	= OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, +			}, +			.dispc_fclk_src	= OMAP_DSS_CLK_SRC_FCK, +		}, + +		.dsi = { +			.regn		= 16,	/* Fint = 2.4 MHz */ +			.regm		= 180,	/* DDR Clock = 216 MHz */ +			.regm_dispc	= 5,	/* PLL1_CLK1 = 172.8 MHz */ +			.regm_dsi	= 5,	/* PLL1_CLK2 = 172.8 MHz */ + +			.lp_clk_div	= 10,	/* LP Clock = 8.64 MHz */ +			.dsi_fclk_src	= OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, +		}, +	}, +	.channel		= OMAP_DSS_CHANNEL_LCD, +}; + +static struct nokia_dsi_panel_data dsi2_panel = { +		.name		= "taal", +		.reset_gpio	= 104, +		.use_ext_te	= false, +		.ext_te_gpio	= 103, +		.esd_interval	= 0, +}; + +static struct omap_dss_device sdp4430_lcd2_device = { +	.name			= "lcd2", +	.driver_name		= "taal", +	.type			= OMAP_DISPLAY_TYPE_DSI, +	.data			= &dsi2_panel, +	.phy.dsi		= { +		.clk_lane	= 1, +		.clk_pol	= 0, +		.data1_lane	= 2, +		.data1_pol	= 0, +		.data2_lane	= 3, +		.data2_pol	= 0, + +		.module		= 1, +	}, + +	.clocks = { +		.dispc = { +			.channel = { +				/* Logic Clock = 172.8 MHz */ +				.lck_div	= 1, +				/* Pixel Clock = 34.56 MHz */ +				.pck_div	= 5, +				.lcd_clk_src	= OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, +			},  			.dispc_fclk_src	= OMAP_DSS_CLK_SRC_FCK,  		}, -		.hdmi	= { -			.regn	= 15, -			.regm2	= 1, + +		.dsi = { +			.regn		= 16,	/* Fint = 2.4 MHz */ +			.regm		= 180,	/* DDR Clock = 216 MHz */ +			.regm_dispc	= 5,	/* PLL1_CLK1 = 172.8 MHz */ +			.regm_dsi	= 5,	/* PLL1_CLK2 = 172.8 MHz */ + +			.lp_clk_div	= 10,	/* LP Clock = 8.64 MHz */ +			.dsi_fclk_src	= OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI,  		},  	}, +	.channel		= OMAP_DSS_CHANNEL_LCD2, +}; + +static void sdp4430_lcd_init(void) +{ +	int r; + +	r = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT, +		"lcd1_reset_gpio"); +	if (r) +		pr_err("%s: Could not get lcd1_reset_gpio\n", __func__); + +	r = gpio_request_one(dsi2_panel.reset_gpio, GPIOF_DIR_OUT, +		"lcd2_reset_gpio"); +	if (r) +		pr_err("%s: Could not get lcd2_reset_gpio\n", __func__); +} + +static struct omap_dss_device sdp4430_hdmi_device = { +	.name = "hdmi", +	.driver_name = "hdmi_panel", +	.type = OMAP_DISPLAY_TYPE_HDMI,  	.platform_enable = sdp4430_panel_enable_hdmi,  	.platform_disable = sdp4430_panel_disable_hdmi,  	.channel = OMAP_DSS_CHANNEL_DIGIT,  }; +static struct picodlp_panel_data sdp4430_picodlp_pdata = { +	.picodlp_adapter_id	= 2, +	.emu_done_gpio		= 44, +	.pwrgood_gpio		= 45, +}; + +static void sdp4430_picodlp_init(void) +{ +	int r; +	const struct gpio picodlp_gpios[] = { +		{DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW, +			"DLP POWER ON"}, +		{sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN, +			"DLP EMU DONE"}, +		{sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW, +			"DLP PWRGOOD"}, +	}; + +	r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios)); +	if (r) +		pr_err("Cannot request PicoDLP GPIOs, error %d\n", r); +} + +static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev) +{ +	gpio_set_value(DISPLAY_SEL_GPIO, 0); +	gpio_set_value(DLP_POWER_ON_GPIO, 1); + +	return 0; +} + +static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev) +{ +	gpio_set_value(DLP_POWER_ON_GPIO, 0); +	gpio_set_value(DISPLAY_SEL_GPIO, 1); +} + +static struct omap_dss_device sdp4430_picodlp_device = { +	.name			= "picodlp", +	.driver_name		= "picodlp_panel", +	.type			= OMAP_DISPLAY_TYPE_DPI, +	.phy.dpi.data_lines	= 24, +	.channel		= OMAP_DSS_CHANNEL_LCD2, +	.platform_enable	= sdp4430_panel_enable_picodlp, +	.platform_disable	= sdp4430_panel_disable_picodlp, +	.data			= &sdp4430_picodlp_pdata, +}; +  static struct omap_dss_device *sdp4430_dss_devices[] = { +	&sdp4430_lcd_device, +	&sdp4430_lcd2_device,  	&sdp4430_hdmi_device, +	&sdp4430_picodlp_device,  };  static struct omap_dss_board_info sdp4430_dss_data = {  	.num_devices	= ARRAY_SIZE(sdp4430_dss_devices),  	.devices	= sdp4430_dss_devices, -	.default_device	= &sdp4430_hdmi_device, +	.default_device	= &sdp4430_lcd_device,  }; -void omap_4430sdp_display_init(void) +static void omap_4430sdp_display_init(void)  { +	int r; + +	/* Enable LCD2 by default (instead of Pico DLP) */ +	r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, +			"display_sel"); +	if (r) +		pr_err("%s: Could not get display_sel GPIO\n", __func__); + +	sdp4430_lcd_init();  	sdp4430_hdmi_mux_init(); +	sdp4430_picodlp_init();  	omap_display_init(&sdp4430_dss_data);  } @@ -796,9 +951,6 @@ static void __init omap_4430sdp_init(void)  		package = OMAP_PACKAGE_CBL;  	omap4_mux_init(board_mux, NULL, package); -	omap_board_config = sdp4430_config; -	omap_board_config_size = ARRAY_SIZE(sdp4430_config); -  	omap4_i2c_init();  	omap_sfh7741prox_init();  	platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 65a5912278a..d314f033c9d 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -36,6 +36,7 @@  #include <plat/usb.h>  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include "mux.h"  #include "control.h" @@ -333,8 +334,7 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)  	dvi_enabled = 0;  } -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= am3517_evm_panel_enable_dvi,  	.platform_disable	= am3517_evm_panel_disable_dvi,  }; @@ -342,7 +342,7 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device am3517_evm_dvi_device = {  	.type			= OMAP_DISPLAY_TYPE_DPI,  	.name			= "dvi", -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 29c409b68b5..de8134b7f58 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -40,6 +40,9 @@  #include <plat/common.h>  #include <plat/gpmc.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> +  #include "mux.h"  #include "control.h" @@ -149,11 +152,6 @@ static struct platform_device apollon_smc91x_device = {  	.resource	= apollon_smc91x_resources,  }; -static struct platform_device apollon_lcd_device = { -	.name		= "apollon_lcd", -	.id		= -1, -}; -  static struct omap_led_config apollon_led_config[] = {  	{  		.cdev	= { @@ -191,7 +189,6 @@ static struct platform_device apollon_led_device = {  static struct platform_device *apollon_devices[] __initdata = {  	&apollon_onenand_device,  	&apollon_smc91x_device, -	&apollon_lcd_device,  	&apollon_led_device,  }; @@ -265,12 +262,26 @@ static struct omap_usb_config apollon_usb_config __initdata = {  	.pins[0]	= 6,  }; -static struct omap_lcd_config apollon_lcd_config __initdata = { -	.ctrl_name	= "internal", +static struct panel_generic_dpi_data apollon_panel_data = { +	.name			= "apollon", +}; + +static struct omap_dss_device apollon_lcd_device = { +	.name			= "lcd", +	.driver_name		= "generic_dpi_panel", +	.type			= OMAP_DISPLAY_TYPE_DPI, +	.phy.dpi.data_lines	= 18, +	.data			= &apollon_panel_data, +}; + +static struct omap_dss_device *apollon_dss_devices[] = { +	&apollon_lcd_device,  }; -static struct omap_board_config_kernel apollon_config[] __initdata = { -	{ OMAP_TAG_LCD,		&apollon_lcd_config }, +static struct omap_dss_board_info apollon_dss_data = { +	.num_devices	= ARRAY_SIZE(apollon_dss_devices), +	.devices	= apollon_dss_devices, +	.default_device	= &apollon_lcd_device,  };  static struct gpio apollon_gpio_leds[] __initdata = { @@ -308,8 +319,6 @@ static void __init omap_apollon_init(void)  	u32 v;  	omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); -	omap_board_config = apollon_config; -	omap_board_config_size = ARRAY_SIZE(apollon_config);  	apollon_init_smc91x();  	apollon_led_init(); @@ -335,6 +344,7 @@ static void __init omap_apollon_init(void)  	platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));  	omap_serial_init();  	omap_sdrc_init(NULL, NULL); +	omap_display_init(&apollon_dss_data);  }  MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 5665e688bd2..bd1bcacb40f 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -43,6 +43,7 @@  #include <plat/usb.h>  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/mcspi.h>  #include <mach/hardware.h> @@ -242,8 +243,7 @@ static struct omap_dss_device cm_t35_lcd_device = {  	.phy.dpi.data_lines	= 18,  }; -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= cm_t35_panel_enable_dvi,  	.platform_disable	= cm_t35_panel_disable_dvi,  }; @@ -251,7 +251,7 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device cm_t35_dvi_device = {  	.name			= "dvi",  	.type			= OMAP_DISPLAY_TYPE_DPI, -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 556df32d88e..42918940c53 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -47,6 +47,7 @@  #include <plat/usb.h>  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/mcspi.h>  #include <linux/input/matrix_keypad.h> @@ -139,7 +140,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = {  };  static struct panel_generic_dpi_data lcd_panel = { -	.name			= "generic", +	.name			= "innolux_at070tn83",  	.platform_enable        = devkit8000_panel_enable_lcd,  	.platform_disable       = devkit8000_panel_disable_lcd,  }; @@ -152,8 +153,7 @@ static struct omap_dss_device devkit8000_lcd_device = {  	.phy.dpi.data_lines     = 24,  }; -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable        = devkit8000_panel_enable_dvi,  	.platform_disable       = devkit8000_panel_disable_dvi,  }; @@ -161,7 +161,7 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device devkit8000_dvi_device = {  	.name                   = "dvi",  	.type                   = OMAP_DISPLAY_TYPE_DPI, -	.driver_name            = "generic_dpi_panel", +	.driver_name            = "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines     = 24,  }; @@ -267,7 +267,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {  static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {  	REGULATOR_SUPPLY("vdds_dsi", "omapdss"), -	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),  };  /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index fe75c195f69..c12666ee701 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -10,7 +10,7 @@   * it under the terms of the GNU General Public License version 2 as   * published by the Free Software Foundation.   */ - +#include <linux/gpio.h>  #include <linux/kernel.h>  #include <linux/init.h>  #include <linux/platform_device.h> @@ -31,7 +31,6 @@  #include <asm/mach/arch.h>  #include <asm/mach/map.h> -#include <mach/gpio.h>  #include <plat/usb.h>  #include <plat/board.h>  #include <plat/common.h> @@ -40,6 +39,9 @@  #include <plat/dma.h>  #include <plat/gpmc.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> +  #include "mux.h"  #include "control.h" @@ -157,17 +159,33 @@ static struct platform_device h4_kp_device = {  	},  }; -static struct platform_device h4_lcd_device = { -	.name		= "lcd_h4", -	.id		= -1, -}; -  static struct platform_device *h4_devices[] __initdata = {  	&h4_flash_device,  	&h4_kp_device, +}; + +static struct panel_generic_dpi_data h4_panel_data = { +	.name			= "h4", +}; + +static struct omap_dss_device h4_lcd_device = { +	.name			= "lcd", +	.driver_name		= "generic_dpi_panel", +	.type			= OMAP_DISPLAY_TYPE_DPI, +	.phy.dpi.data_lines	= 16, +	.data			= &h4_panel_data, +}; + +static struct omap_dss_device *h4_dss_devices[] = {  	&h4_lcd_device,  }; +static struct omap_dss_board_info h4_dss_data = { +	.num_devices	= ARRAY_SIZE(h4_dss_devices), +	.devices	= h4_dss_devices, +	.default_device	= &h4_lcd_device, +}; +  /* 2420 Sysboot setup (2430 is different) */  static u32 get_sysboot_value(void)  { @@ -271,10 +289,6 @@ static void __init h4_init_flash(void)  	h4_flash_resource.end	= base + SZ_64M - 1;  } -static struct omap_lcd_config h4_lcd_config __initdata = { -	.ctrl_name	= "internal", -}; -  static struct omap_usb_config h4_usb_config __initdata = {  	/* S1.10 OFF -- usb "download port"  	 * usb0 switched to Mini-B port and isp1105 transceiver; @@ -286,10 +300,6 @@ static struct omap_usb_config h4_usb_config __initdata = {  	.hmc_mode	= 0x00,		/* 0:dev|otg 1:disable 2:disable */  }; -static struct omap_board_config_kernel h4_config[] __initdata = { -	{ OMAP_TAG_LCD,		&h4_lcd_config }, -}; -  static struct at24_platform_data m24c01 = {  	.byte_len	= SZ_1K / 8,  	.page_size	= 16, @@ -320,9 +330,6 @@ static void __init omap_h4_init(void)  {  	omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); -	omap_board_config = h4_config; -	omap_board_config_size = ARRAY_SIZE(h4_config); -  	/*  	 * Make sure the serial ports are muxed on at this point.  	 * You have to mux them off in device drivers later on @@ -362,6 +369,8 @@ static void __init omap_h4_init(void)  	omap_serial_init();  	omap_sdrc_init(NULL, NULL);  	h4_init_flash(); + +	omap_display_init(&h4_dss_data);  }  MACHINE_START(OMAP_H4, "OMAP2420 H4 board") diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index e20cad6a083..d0a3f78a9b6 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -32,7 +32,7 @@  #include <plat/gpmc.h>  #include <plat/usb.h>  #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/onenand.h>  #include "mux.h" @@ -455,16 +455,16 @@ static void igep2_disable_dvi(struct omap_dss_device *dssdev)  	gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);  } -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= igep2_enable_dvi,  	.platform_disable	= igep2_disable_dvi, +	.i2c_bus_num = 3,  };  static struct omap_dss_device igep2_dvi_device = {  	.type			= OMAP_DISPLAY_TYPE_DPI,  	.name			= "dvi", -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 0fa28be2cfd..e179da0c4da 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -10,7 +10,7 @@   * it under the terms of the GNU General Public License version 2 as   * published by the Free Software Foundation.   */ - +#include <linux/gpio.h>  #include <linux/kernel.h>  #include <linux/init.h>  #include <linux/platform_device.h> @@ -27,6 +27,7 @@  #include <linux/io.h>  #include <linux/smsc911x.h>  #include <linux/mmc/host.h> +#include <linux/gpio.h>  #include <mach/hardware.h>  #include <asm/mach-types.h> @@ -34,7 +35,6 @@  #include <asm/mach/map.h>  #include <plat/mcspi.h> -#include <mach/gpio.h>  #include <plat/board.h>  #include <plat/common.h>  #include <plat/gpmc.h> @@ -44,6 +44,9 @@  #include <plat/usb.h>  #include <plat/gpmc-smsc911x.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> +  #include "board-flash.h"  #include "mux.h"  #include "hsmmc.h" @@ -180,23 +183,102 @@ static inline void __init ldp_init_smsc911x(void)  	gpmc_smsc911x_init(&smsc911x_cfg);  } -static struct platform_device ldp_lcd_device = { -	.name		= "ldp_lcd", -	.id		= -1, +/* LCD */ + +static int ldp_backlight_gpio; +static int ldp_lcd_enable_gpio; + +#define LCD_PANEL_RESET_GPIO		55 +#define LCD_PANEL_QVGA_GPIO		56 + +static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev) +{ +	if (gpio_is_valid(ldp_lcd_enable_gpio)) +		gpio_direction_output(ldp_lcd_enable_gpio, 1); +	if (gpio_is_valid(ldp_backlight_gpio)) +		gpio_direction_output(ldp_backlight_gpio, 1); + +	return 0; +} + +static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev) +{ +	if (gpio_is_valid(ldp_lcd_enable_gpio)) +		gpio_direction_output(ldp_lcd_enable_gpio, 0); +	if (gpio_is_valid(ldp_backlight_gpio)) +		gpio_direction_output(ldp_backlight_gpio, 0); +} + +static struct panel_generic_dpi_data ldp_panel_data = { +	.name			= "nec_nl2432dr22-11b", +	.platform_enable	= ldp_panel_enable_lcd, +	.platform_disable	= ldp_panel_disable_lcd,  }; -static struct omap_lcd_config ldp_lcd_config __initdata = { -	.ctrl_name	= "internal", +static struct omap_dss_device ldp_lcd_device = { +	.name			= "lcd", +	.driver_name		= "generic_dpi_panel", +	.type			= OMAP_DISPLAY_TYPE_DPI, +	.phy.dpi.data_lines	= 18, +	.data			= &ldp_panel_data, +}; + +static struct omap_dss_device *ldp_dss_devices[] = { +	&ldp_lcd_device,  }; -static struct omap_board_config_kernel ldp_config[] __initdata = { -	{ OMAP_TAG_LCD,		&ldp_lcd_config }, +static struct omap_dss_board_info ldp_dss_data = { +	.num_devices	= ARRAY_SIZE(ldp_dss_devices), +	.devices	= ldp_dss_devices, +	.default_device	= &ldp_lcd_device,  }; +static void __init ldp_display_init(void) +{ +	int r; + +	static struct gpio gpios[] __initdata = { +		{LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"}, +		{LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"}, +	}; + +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); +	if (r) { +		pr_err("Cannot request LCD GPIOs, error %d\n", r); +		return; +	} + +	omap_display_init(&ldp_dss_data); +} + +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) +{ +	int r; + +	struct gpio gpios[] = { +		{gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, +		{gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, +	}; + +	r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); +	if (r) { +		pr_err("Cannot request LCD GPIOs, error %d\n", r); +		ldp_backlight_gpio = -EINVAL; +		ldp_lcd_enable_gpio = -EINVAL; +		return r; +	} + +	ldp_backlight_gpio = gpio + 15; +	ldp_lcd_enable_gpio = gpio + 7; + +	return 0; +} +  static struct twl4030_gpio_platform_data ldp_gpio_data = {  	.gpio_base	= OMAP_MAX_GPIO_LINES,  	.irq_base	= TWL4030_GPIO_IRQ_BASE,  	.irq_end	= TWL4030_GPIO_IRQ_END, +	.setup		= ldp_twl_gpio_setup,  };  static struct regulator_consumer_supply ldp_vmmc1_supply[] = { @@ -238,10 +320,31 @@ static struct regulator_init_data ldp_vaux1 = {  	.consumer_supplies		= ldp_vaux1_supplies,  }; +static struct regulator_consumer_supply ldp_vpll2_supplies[] = { +	REGULATOR_SUPPLY("vdds_dsi", "omapdss"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), +}; + +static struct regulator_init_data ldp_vpll2 = { +	.constraints = { +		.name			= "VDVI", +		.min_uV			= 1800000, +		.max_uV			= 1800000, +		.apply_uV		= true, +		.valid_modes_mask	= REGULATOR_MODE_NORMAL +					| REGULATOR_MODE_STANDBY, +		.valid_ops_mask		= REGULATOR_CHANGE_MODE +					| REGULATOR_CHANGE_STATUS, +	}, +	.num_consumer_supplies	= ARRAY_SIZE(ldp_vpll2_supplies), +	.consumer_supplies	= ldp_vpll2_supplies, +}; +  static struct twl4030_platform_data ldp_twldata = {  	/* platform_data for children goes here */  	.vmmc1		= &ldp_vmmc1,  	.vaux1		= &ldp_vaux1, +	.vpll2		= &ldp_vpll2,  	.gpio		= &ldp_gpio_data,  	.keypad		= &ldp_kp_twl4030_data,  }; @@ -267,7 +370,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {  };  static struct platform_device *ldp_devices[] __initdata = { -	&ldp_lcd_device,  	&ldp_gpio_keys_device,  }; @@ -312,8 +414,6 @@ static struct mtd_partition ldp_nand_partitions[] = {  static void __init omap_ldp_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); -	omap_board_config = ldp_config; -	omap_board_config_size = ARRAY_SIZE(ldp_config);  	ldp_init_smsc911x();  	omap_i2c_init();  	platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); @@ -325,6 +425,7 @@ static void __init omap_ldp_init(void)  		ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);  	omap2_hsmmc_init(mmc); +	ldp_display_init();  }  MACHINE_START(OMAP_LDP, "OMAP LDP board") diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 0b8e0fc03aa..70261bcda3f 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -42,7 +42,7 @@  #include <plat/board.h>  #include <plat/common.h>  #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/gpmc.h>  #include <plat/nand.h>  #include <plat/usb.h> @@ -203,16 +203,16 @@ static void beagle_disable_dvi(struct omap_dss_device *dssdev)  		gpio_set_value(dssdev->reset_gpio, 0);  } -static struct panel_generic_dpi_data dvi_panel = { -	.name = "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable = beagle_enable_dvi,  	.platform_disable = beagle_disable_dvi, +	.i2c_bus_num = 3,  };  static struct omap_dss_device beagle_dvi_device = {  	.type = OMAP_DISPLAY_TYPE_DPI,  	.name = "dvi", -	.driver_name = "generic_dpi_panel", +	.driver_name = "dvi",  	.data = &dvi_panel,  	.phy.dpi.data_lines = 24,  	.reset_gpio = -EINVAL, @@ -444,11 +444,6 @@ static struct platform_device keys_gpio = {  	},  }; -static void __init omap3_beagle_init_early(void) -{ -	omap2_init_common_infrastructure(); -} -  static struct platform_device *omap3_beagle_devices[] __initdata = {  	&leds_gpio,  	&keys_gpio, @@ -555,7 +550,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")  	.atag_offset	= 0x100,  	.reserve	= omap_reserve,  	.map_io		= omap3_map_io, -	.init_early	= omap3_beagle_init_early, +	.init_early	= omap3_init_early,  	.init_irq	= omap3_init_irq,  	.init_machine	= omap3_beagle_init,  	.timer		= &omap3_secure_timer, diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index aa6a9351ce4..2d24e287e8c 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -45,7 +45,7 @@  #include <plat/common.h>  #include <plat/mcspi.h>  #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include "mux.h"  #include "sdram-micron-mt46h32m32lf-6.h" @@ -247,8 +247,7 @@ static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)  	dvi_enabled = 0;  } -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= omap3_evm_enable_dvi,  	.platform_disable	= omap3_evm_disable_dvi,  }; @@ -256,7 +255,7 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device omap3_evm_dvi_device = {  	.name			= "dvi",  	.type			= OMAP_DISPLAY_TYPE_DPI, -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index fed2f7dfdf8..f7811f4cfc3 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -335,7 +335,7 @@ static struct regulator_consumer_supply pandora_vmmc3_supply[] = {  static struct regulator_consumer_supply pandora_vdds_supplies[] = {  	REGULATOR_SUPPLY("vdds_sdi", "omapdss"),  	REGULATOR_SUPPLY("vdds_dsi", "omapdss"), -	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),  };  static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 170e1ebd6e6..ddb7d6663c6 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c @@ -41,6 +41,7 @@  #include <plat/usb.h>  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/mcspi.h>  #include <linux/input/matrix_keypad.h> @@ -107,39 +108,6 @@ static void __init omap3_stalker_display_init(void)  	return;  } -static int omap3_stalker_enable_lcd(struct omap_dss_device *dssdev) -{ -	if (dvi_enabled) { -		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); -		return -EINVAL; -	} -	gpio_set_value(DSS_ENABLE_GPIO, 1); -	gpio_set_value(LCD_PANEL_BKLIGHT_GPIO, 1); -	lcd_enabled = 1; -	return 0; -} - -static void omap3_stalker_disable_lcd(struct omap_dss_device *dssdev) -{ -	gpio_set_value(DSS_ENABLE_GPIO, 0); -	gpio_set_value(LCD_PANEL_BKLIGHT_GPIO, 0); -	lcd_enabled = 0; -} - -static struct panel_generic_dpi_data lcd_panel = { -	.name			= "generic", -	.platform_enable	= omap3_stalker_enable_lcd, -	.platform_disable	= omap3_stalker_disable_lcd, -}; - -static struct omap_dss_device omap3_stalker_lcd_device = { -	.name			= "lcd", -	.driver_name		= "generic_dpi_panel", -	.data			= &lcd_panel, -	.phy.dpi.data_lines	= 24, -	.type			= OMAP_DISPLAY_TYPE_DPI, -}; -  static int omap3_stalker_enable_tv(struct omap_dss_device *dssdev)  {  	return 0; @@ -179,8 +147,7 @@ static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)  	dvi_enabled = 0;  } -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= omap3_stalker_enable_dvi,  	.platform_disable	= omap3_stalker_disable_dvi,  }; @@ -188,13 +155,12 @@ static struct panel_generic_dpi_data dvi_panel = {  static struct omap_dss_device omap3_stalker_dvi_device = {  	.name			= "dvi",  	.type			= OMAP_DISPLAY_TYPE_DPI, -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  };  static struct omap_dss_device *omap3_stalker_dss_devices[] = { -	&omap3_stalker_lcd_device,  	&omap3_stalker_tv_device,  	&omap3_stalker_dvi_device,  }; diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index c2d5348f542..a2d0d1971e2 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c @@ -104,15 +104,6 @@ static struct omap2_hsmmc_info mmc[] = {  	{}	/* Terminator */  }; -static struct platform_device omap3_touchbook_lcd_device = { -	.name		= "omap3touchbook_lcd", -	.id		= -1, -}; - -static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = { -	.ctrl_name	= "internal", -}; -  static struct regulator_consumer_supply touchbook_vmmc1_supply[] = {  	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),  }; @@ -165,14 +156,12 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = {  static struct regulator_consumer_supply touchbook_vdac_supply[] = {  {  	.supply		= "vdac", -	.dev		= &omap3_touchbook_lcd_device.dev,  },  };  static struct regulator_consumer_supply touchbook_vdvi_supply[] = {  {  	.supply		= "vdvi", -	.dev		= &omap3_touchbook_lcd_device.dev,  },  }; @@ -316,10 +305,6 @@ static struct platform_device keys_gpio = {  	},  }; -static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = { -	{ OMAP_TAG_LCD,		&omap3_touchbook_lcd_config }, -}; -  #ifdef CONFIG_OMAP_MUX  static struct omap_board_mux board_mux[] __initdata = {  	{ .reg_offset = OMAP_MUX_TERMINATOR }, @@ -327,7 +312,6 @@ static struct omap_board_mux board_mux[] __initdata = {  #endif  static struct platform_device *omap3_touchbook_devices[] __initdata = { -	&omap3_touchbook_lcd_device,  	&leds_gpio,  	&keys_gpio,  }; @@ -364,8 +348,6 @@ early_param("tbr", early_touchbook_revision);  static void __init omap3_touchbook_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); -	omap_board_config = omap3_touchbook_config; -	omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);  	pm_power_off = omap3_touchbook_poweroff; diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 2141894eb9f..a8c2c4263e3 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -40,7 +40,7 @@  #include <plat/common.h>  #include <plat/usb.h>  #include <plat/mmc.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include "hsmmc.h"  #include "control.h" @@ -449,16 +449,16 @@ static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)  }  /* Using generic display panel */ -static struct panel_generic_dpi_data omap4_dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data omap4_dvi_panel = {  	.platform_enable	= omap4_panda_enable_dvi,  	.platform_disable	= omap4_panda_disable_dvi, +	.i2c_bus_num = 3,  };  struct omap_dss_device omap4_panda_dvi_device = {  	.type			= OMAP_DISPLAY_TYPE_DPI,  	.name			= "dvi", -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &omap4_dvi_panel,  	.phy.dpi.data_lines	= 24,  	.reset_gpio		= PANDA_DVI_TFP410_POWER_DOWN_GPIO, diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 9f13dc22df7..4cf7aeabab8 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -46,6 +46,7 @@  #include <plat/common.h>  #include <video/omapdss.h>  #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h>  #include <plat/gpmc.h>  #include <mach/hardware.h>  #include <plat/nand.h> @@ -182,16 +183,16 @@ static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)  	dvi_enabled = 0;  } -static struct panel_generic_dpi_data dvi_panel = { -	.name			= "generic", +static struct panel_dvi_platform_data dvi_panel = {  	.platform_enable	= overo_panel_enable_dvi,  	.platform_disable	= overo_panel_disable_dvi, +	.i2c_bus_num		= 3,  };  static struct omap_dss_device overo_dvi_device = {  	.name			= "dvi",  	.type			= OMAP_DISPLAY_TYPE_DPI, -	.driver_name		= "generic_dpi_panel", +	.driver_name		= "dvi",  	.data			= &dvi_panel,  	.phy.dpi.data_lines	= 24,  }; diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 5a886cd2c59..ba1aa07bdb2 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -900,7 +900,6 @@ static struct twl4030_platform_data rx51_twldata __initdata = {  };  static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = { -	.id			= TPA6130A2,  	.power_gpio		= 98,  }; diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 74c8aadc0a1..4af7c4b2881 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -79,29 +79,6 @@ static struct cpuidle_params rx51_cpuidle_params[] = {  	{7505 + 15274, 484329, 1},  }; -static struct omap_lcd_config rx51_lcd_config = { -	.ctrl_name	= "internal", -}; - -static struct omap_fbmem_config rx51_fbmem0_config = { -	.size = 752 * 1024, -}; - -static struct omap_fbmem_config rx51_fbmem1_config = { -	.size = 752 * 1024, -}; - -static struct omap_fbmem_config rx51_fbmem2_config = { -	.size = 752 * 1024, -}; - -static struct omap_board_config_kernel rx51_config[] = { -	{ OMAP_TAG_FBMEM,	&rx51_fbmem0_config }, -	{ OMAP_TAG_FBMEM,	&rx51_fbmem1_config }, -	{ OMAP_TAG_FBMEM,	&rx51_fbmem2_config }, -	{ OMAP_TAG_LCD,		&rx51_lcd_config }, -}; -  extern void __init rx51_peripherals_init(void);  #ifdef CONFIG_OMAP_MUX @@ -121,8 +98,6 @@ static void __init rx51_init(void)  	struct omap_sdrc_params *sdrc_params;  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); -	omap_board_config = rx51_config; -	omap_board_config_size = ARRAY_SIZE(rx51_config);  	omap3_pm_init_cpuidle(rx51_cpuidle_params);  	omap_serial_init(); diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index e26c79cb6ce..e6ee8842285 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c @@ -37,7 +37,6 @@ static void __init ti8168_evm_init(void)  static void __init ti8168_evm_map_io(void)  { -	omap2_set_globals_ti816x();  	omapti816x_map_common_io();  } diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index de61f15c48e..110e5b9db14 100644 --- a/arch/arm/mach-omap2/common.c +++ b/arch/arm/mach-omap2/common.c @@ -45,11 +45,11 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)  static struct omap_globals omap242x_globals = {  	.class	= OMAP242X_CLASS,  	.tap	= OMAP2_L4_IO_ADDRESS(0x48014000), -	.sdrc	= OMAP2420_SDRC_BASE, -	.sms	= OMAP2420_SMS_BASE, -	.ctrl	= OMAP242X_CTRL_BASE, -	.prm	= OMAP2420_PRM_BASE, -	.cm	= OMAP2420_CM_BASE, +	.sdrc	= OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE), +	.sms	= OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE), +	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE), +	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE), +	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),  };  void __init omap2_set_globals_242x(void) @@ -59,7 +59,6 @@ void __init omap2_set_globals_242x(void)  void __init omap242x_map_io(void)  { -	omap2_set_globals_242x();  	omap242x_map_common_io();  }  #endif @@ -69,11 +68,11 @@ void __init omap242x_map_io(void)  static struct omap_globals omap243x_globals = {  	.class	= OMAP243X_CLASS,  	.tap	= OMAP2_L4_IO_ADDRESS(0x4900a000), -	.sdrc	= OMAP243X_SDRC_BASE, -	.sms	= OMAP243X_SMS_BASE, -	.ctrl	= OMAP243X_CTRL_BASE, -	.prm	= OMAP2430_PRM_BASE, -	.cm	= OMAP2430_CM_BASE, +	.sdrc	= OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE), +	.sms	= OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE), +	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE), +	.prm	= OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE), +	.cm	= OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),  };  void __init omap2_set_globals_243x(void) @@ -83,7 +82,6 @@ void __init omap2_set_globals_243x(void)  void __init omap243x_map_io(void)  { -	omap2_set_globals_243x();  	omap243x_map_common_io();  }  #endif @@ -93,11 +91,11 @@ void __init omap243x_map_io(void)  static struct omap_globals omap3_globals = {  	.class	= OMAP343X_CLASS,  	.tap	= OMAP2_L4_IO_ADDRESS(0x4830A000), -	.sdrc	= OMAP343X_SDRC_BASE, -	.sms	= OMAP343X_SMS_BASE, -	.ctrl	= OMAP343X_CTRL_BASE, -	.prm	= OMAP3430_PRM_BASE, -	.cm	= OMAP3430_CM_BASE, +	.sdrc	= OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE), +	.sms	= OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE), +	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE), +	.prm	= OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE), +	.cm	= OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),  };  void __init omap2_set_globals_3xxx(void) @@ -107,7 +105,6 @@ void __init omap2_set_globals_3xxx(void)  void __init omap3_map_io(void)  { -	omap2_set_globals_3xxx();  	omap34xx_map_common_io();  } @@ -122,9 +119,9 @@ void __init omap3_map_io(void)  static struct omap_globals ti816x_globals = {  	.class  = OMAP343X_CLASS,  	.tap    = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE), -	.ctrl   = TI816X_CTRL_BASE, -	.prm    = TI816X_PRCM_BASE, -	.cm     = TI816X_PRCM_BASE, +	.ctrl   = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE), +	.prm    = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE), +	.cm     = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),  };  void __init omap2_set_globals_ti816x(void) @@ -137,11 +134,11 @@ void __init omap2_set_globals_ti816x(void)  static struct omap_globals omap4_globals = {  	.class	= OMAP443X_CLASS,  	.tap	= OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE), -	.ctrl	= OMAP443X_SCM_BASE, -	.ctrl_pad	= OMAP443X_CTRL_BASE, -	.prm	= OMAP4430_PRM_BASE, -	.cm	= OMAP4430_CM_BASE, -	.cm2	= OMAP4430_CM2_BASE, +	.ctrl	= OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE), +	.ctrl_pad	= OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE), +	.prm	= OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), +	.cm	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), +	.cm2	= OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),  };  void __init omap2_set_globals_443x(void) @@ -153,7 +150,6 @@ void __init omap2_set_globals_443x(void)  void __init omap4_map_io(void)  { -	omap2_set_globals_443x();  	omap44xx_map_common_io();  }  #endif diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index aab884fecc5..e34d27f8c49 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -149,17 +149,11 @@ static struct omap3_control_regs control_context;  void __init omap2_set_globals_control(struct omap_globals *omap2_globals)  { -	/* Static mapping, never released */ -	if (omap2_globals->ctrl) { -		omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K); -		WARN_ON(!omap2_ctrl_base); -	} +	if (omap2_globals->ctrl) +		omap2_ctrl_base = omap2_globals->ctrl; -	/* Static mapping, never released */ -	if (omap2_globals->ctrl_pad) { -		omap4_ctrl_pad_base = ioremap(omap2_globals->ctrl_pad, SZ_4K); -		WARN_ON(!omap4_ctrl_pad_base); -	} +	if (omap2_globals->ctrl_pad) +		omap4_ctrl_pad_base = omap2_globals->ctrl_pad;  }  void __iomem *omap_ctrl_base_get(void) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 0f8e0eb1816..68ec03152d5 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -8,7 +8,7 @@   * the Free Software Foundation; either version 2 of the License, or   * (at your option) any later version.   */ - +#include <linux/gpio.h>  #include <linux/kernel.h>  #include <linux/init.h>  #include <linux/platform_device.h> @@ -27,7 +27,6 @@  #include <plat/tc.h>  #include <plat/board.h>  #include <plat/mcbsp.h> -#include <mach/gpio.h>  #include <plat/mmc.h>  #include <plat/dma.h>  #include <plat/omap_hwmod.h> @@ -316,6 +315,38 @@ static void omap_init_audio(void)  static inline void omap_init_audio(void) {}  #endif +#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ +		defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) + +static struct omap_device_pm_latency omap_mcpdm_latency[] = { +	{ +		.deactivate_func = omap_device_idle_hwmods, +		.activate_func = omap_device_enable_hwmods, +		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, +	}, +}; + +static void omap_init_mcpdm(void) +{ +	struct omap_hwmod *oh; +	struct omap_device *od; + +	oh = omap_hwmod_lookup("mcpdm"); +	if (!oh) { +		printk(KERN_ERR "Could not look up mcpdm hw_mod\n"); +		return; +	} + +	od = omap_device_build("omap-mcpdm", -1, oh, NULL, 0, +				omap_mcpdm_latency, +				ARRAY_SIZE(omap_mcpdm_latency), 0); +	if (IS_ERR(od)) +		printk(KERN_ERR "Could not build omap_device for omap-mcpdm-dai\n"); +} +#else +static inline void omap_init_mcpdm(void) {} +#endif +  #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)  #include <plat/mcspi.h> @@ -660,6 +691,7 @@ static int __init omap2_init_devices(void)  	 * in alphabetical order so they're easier to sort through.  	 */  	omap_init_audio(); +	omap_init_mcpdm();  	omap_init_camera();  	omap_init_mbox();  	omap_init_mcspi(); diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 8ad0a2f0367..4036821a01f 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -27,6 +27,8 @@  #include <plat/omap_device.h>  #include <plat/omap-pm.h> +#include "control.h" +  static struct platform_device omap_display_device = {  	.name          = "omapdss",  	.id            = -1, @@ -53,7 +55,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = {  	{ "dss_dispc", "omapdss_dispc", -1 },  	{ "dss_rfbi", "omapdss_rfbi", -1 },  	{ "dss_venc", "omapdss_venc", -1 }, -	{ "dss_dsi1", "omapdss_dsi1", -1 }, +	{ "dss_dsi1", "omapdss_dsi", 0 },  };  static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { @@ -61,11 +63,58 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {  	{ "dss_dispc", "omapdss_dispc", -1 },  	{ "dss_rfbi", "omapdss_rfbi", -1 },  	{ "dss_venc", "omapdss_venc", -1 }, -	{ "dss_dsi1", "omapdss_dsi1", -1 }, -	{ "dss_dsi2", "omapdss_dsi2", -1 }, +	{ "dss_dsi1", "omapdss_dsi", 0 }, +	{ "dss_dsi2", "omapdss_dsi", 1 },  	{ "dss_hdmi", "omapdss_hdmi", -1 },  }; +static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) +{ +	u32 enable_mask, enable_shift; +	u32 pipd_mask, pipd_shift; +	u32 reg; + +	if (dsi_id == 0) { +		enable_mask = OMAP4_DSI1_LANEENABLE_MASK; +		enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT; +		pipd_mask = OMAP4_DSI1_PIPD_MASK; +		pipd_shift = OMAP4_DSI1_PIPD_SHIFT; +	} else if (dsi_id == 1) { +		enable_mask = OMAP4_DSI2_LANEENABLE_MASK; +		enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT; +		pipd_mask = OMAP4_DSI2_PIPD_MASK; +		pipd_shift = OMAP4_DSI2_PIPD_SHIFT; +	} else { +		return -ENODEV; +	} + +	reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); + +	reg &= ~enable_mask; +	reg &= ~pipd_mask; + +	reg |= (lanes << enable_shift) & enable_mask; +	reg |= (lanes << pipd_shift) & pipd_mask; + +	omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY); + +	return 0; +} + +static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) +{ +	if (cpu_is_omap44xx()) +		return omap4_dsi_mux_pads(dsi_id, lane_mask); + +	return 0; +} + +static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) +{ +	if (cpu_is_omap44xx()) +		omap4_dsi_mux_pads(dsi_id, 0); +} +  int __init omap_display_init(struct omap_dss_board_info *board_data)  {  	int r = 0; @@ -88,6 +137,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)  		oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);  	} +	if (board_data->dsi_enable_pads == NULL) +		board_data->dsi_enable_pads = omap_dsi_enable_pads; +	if (board_data->dsi_disable_pads == NULL) +		board_data->dsi_disable_pads = omap_dsi_disable_pads; +  	pdata.board_data = board_data;  	pdata.board_data->get_context_loss_count =  		omap_pm_get_dev_context_loss_count; diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index f01273006e4..a5d8dce2a70 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -34,8 +34,8 @@  #include "clock2xxx.h"  #include "clock3xxx.h"  #include "clock44xx.h" -#include "io.h" +#include <plat/common.h>  #include <plat/omap-pm.h>  #include "voltage.h"  #include "powerdomain.h" @@ -43,6 +43,7 @@  #include "clockdomain.h"  #include <plat/omap_hwmod.h>  #include <plat/multi.h> +#include <plat/common.h>  /*   * The machine specific code may provide the extra mapping besides the @@ -239,26 +240,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = {  };  #endif -static void __init _omap2_map_common_io(void) -{ -	/* Normally devicemaps_init() would flush caches and tlb after -	 * mdesc->map_io(), but we must also do it here because of the CPU -	 * revision check below. -	 */ -	local_flush_tlb_all(); -	flush_cache_all(); - -	omap2_check_revision(); -	omap_sram_init(); -	omap_init_consistent_dma_size(); -} -  #ifdef CONFIG_SOC_OMAP2420  void __init omap242x_map_common_io(void)  {  	iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));  	iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); -	_omap2_map_common_io();  }  #endif @@ -267,7 +253,6 @@ void __init omap243x_map_common_io(void)  {  	iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));  	iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); -	_omap2_map_common_io();  }  #endif @@ -275,7 +260,6 @@ void __init omap243x_map_common_io(void)  void __init omap34xx_map_common_io(void)  {  	iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); -	_omap2_map_common_io();  }  #endif @@ -283,7 +267,6 @@ void __init omap34xx_map_common_io(void)  void __init omapti816x_map_common_io(void)  {  	iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); -	_omap2_map_common_io();  }  #endif @@ -291,7 +274,6 @@ void __init omapti816x_map_common_io(void)  void __init omap44xx_map_common_io(void)  {  	iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); -	_omap2_map_common_io();  }  #endif @@ -337,33 +319,16 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)  /* See irq.c, omap4-common.c and entry-macro.S */  void __iomem *omap_irq_base; -void __init omap2_init_common_infrastructure(void) +static void __init omap_common_init_early(void)  { -	u8 postsetup_state; +	omap2_check_revision(); +	omap_ioremap_init(); +	omap_init_consistent_dma_size(); +} -	if (cpu_is_omap242x()) { -		omap2xxx_voltagedomains_init(); -		omap242x_powerdomains_init(); -		omap242x_clockdomains_init(); -		omap2420_hwmod_init(); -	} else if (cpu_is_omap243x()) { -		omap2xxx_voltagedomains_init(); -		omap243x_powerdomains_init(); -		omap243x_clockdomains_init(); -		omap2430_hwmod_init(); -	} else if (cpu_is_omap34xx()) { -		omap3xxx_voltagedomains_init(); -		omap3xxx_powerdomains_init(); -		omap3xxx_clockdomains_init(); -		omap3xxx_hwmod_init(); -	} else if (cpu_is_omap44xx()) { -		omap44xx_voltagedomains_init(); -		omap44xx_powerdomains_init(); -		omap44xx_clockdomains_init(); -		omap44xx_hwmod_init(); -	} else { -		pr_err("Could not init hwmod data - unknown SoC\n"); -        } +static void __init omap_hwmod_init_postsetup(void) +{ +	u8 postsetup_state;  	/* Set the default postsetup state for all hwmods */  #ifdef CONFIG_PM_RUNTIME @@ -392,67 +357,101 @@ void __init omap2_init_common_infrastructure(void)  				     &postsetup_state);  	omap_pm_if_early_init(); - -	if (cpu_is_omap2420()) -		omap2420_clk_init(); -	else if (cpu_is_omap2430()) -		omap2430_clk_init(); -	else if (cpu_is_omap34xx()) -		omap3xxx_clk_init(); -	else if (cpu_is_omap44xx()) -		omap4xxx_clk_init(); -	else -		pr_err("Could not init clock framework - unknown SoC\n");  }  void __init omap2420_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap2_set_globals_242x(); +	omap_common_init_early(); +	omap2xxx_voltagedomains_init(); +	omap242x_powerdomains_init(); +	omap242x_clockdomains_init(); +	omap2420_hwmod_init(); +	omap_hwmod_init_postsetup(); +	omap2420_clk_init();  }  void __init omap2430_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap2_set_globals_243x(); +	omap_common_init_early(); +	omap2xxx_voltagedomains_init(); +	omap243x_powerdomains_init(); +	omap243x_clockdomains_init(); +	omap2430_hwmod_init(); +	omap_hwmod_init_postsetup(); +	omap2430_clk_init(); +} + +/* + * Currently only board-omap3beagle.c should call this because of the + * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. + */ +void __init omap3_init_early(void) +{ +	omap2_set_globals_3xxx(); +	omap_common_init_early(); +	omap3xxx_voltagedomains_init(); +	omap3xxx_powerdomains_init(); +	omap3xxx_clockdomains_init(); +	omap3xxx_hwmod_init(); +	omap_hwmod_init_postsetup(); +	omap3xxx_clk_init();  }  void __init omap3430_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap3_init_early();  }  void __init omap35xx_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap3_init_early();  }  void __init omap3630_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap3_init_early();  }  void __init am35xx_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap3_init_early();  }  void __init ti816x_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap2_set_globals_ti816x(); +	omap_common_init_early(); +	omap3xxx_voltagedomains_init(); +	omap3xxx_powerdomains_init(); +	omap3xxx_clockdomains_init(); +	omap3xxx_hwmod_init(); +	omap_hwmod_init_postsetup(); +	omap3xxx_clk_init();  }  void __init omap4430_init_early(void)  { -	omap2_init_common_infrastructure(); +	omap2_set_globals_443x(); +	omap_common_init_early(); +	omap44xx_voltagedomains_init(); +	omap44xx_powerdomains_init(); +	omap44xx_clockdomains_init(); +	omap44xx_hwmod_init(); +	omap_hwmod_init_postsetup(); +	omap4xxx_clk_init();  }  void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,  				      struct omap_sdrc_params *sdrc_cs1)  { +	omap_sram_init(); +  	if (cpu_is_omap24xx() || omap3_has_sdrc()) {  		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);  		_omap2_init_reprogram_sdrc();  	} -  }  /* diff --git a/arch/arm/mach-omap2/io.h b/arch/arm/mach-omap2/io.h index fd230c6cded..e69de29bb2d 100644 --- a/arch/arm/mach-omap2/io.h +++ b/arch/arm/mach-omap2/io.h @@ -1,7 +0,0 @@ - -#ifndef __MACH_OMAP2_IO_H__ -#define __MACH_OMAP2_IO_H__ - -extern int __init omap_sram_init(void); - -#endif /*  __MACH_OMAP2_IO_H__ */ diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index f286012783c..eefc37912ef 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c @@ -66,7 +66,7 @@  	 ((pgsz) == MMU_CAM_PGSZ_4K)  ? 0xfffff000 : 0) -static void __iommu_set_twl(struct iommu *obj, bool on) +static void __iommu_set_twl(struct omap_iommu *obj, bool on)  {  	u32 l = iommu_read_reg(obj, MMU_CNTL); @@ -85,7 +85,7 @@ static void __iommu_set_twl(struct iommu *obj, bool on)  } -static int omap2_iommu_enable(struct iommu *obj) +static int omap2_iommu_enable(struct omap_iommu *obj)  {  	u32 l, pa;  	unsigned long timeout; @@ -127,7 +127,7 @@ static int omap2_iommu_enable(struct iommu *obj)  	return 0;  } -static void omap2_iommu_disable(struct iommu *obj) +static void omap2_iommu_disable(struct omap_iommu *obj)  {  	u32 l = iommu_read_reg(obj, MMU_CNTL); @@ -138,12 +138,12 @@ static void omap2_iommu_disable(struct iommu *obj)  	dev_dbg(obj->dev, "%s is shutting down\n", obj->name);  } -static void omap2_iommu_set_twl(struct iommu *obj, bool on) +static void omap2_iommu_set_twl(struct omap_iommu *obj, bool on)  {  	__iommu_set_twl(obj, false);  } -static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) +static u32 omap2_iommu_fault_isr(struct omap_iommu *obj, u32 *ra)  {  	u32 stat, da;  	u32 errs = 0; @@ -173,13 +173,13 @@ static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)  	return errs;  } -static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) +static void omap2_tlb_read_cr(struct omap_iommu *obj, struct cr_regs *cr)  {  	cr->cam = iommu_read_reg(obj, MMU_READ_CAM);  	cr->ram = iommu_read_reg(obj, MMU_READ_RAM);  } -static void omap2_tlb_load_cr(struct iommu *obj, struct cr_regs *cr) +static void omap2_tlb_load_cr(struct omap_iommu *obj, struct cr_regs *cr)  {  	iommu_write_reg(obj, cr->cam | MMU_CAM_V, MMU_CAM);  	iommu_write_reg(obj, cr->ram, MMU_RAM); @@ -193,7 +193,8 @@ static u32 omap2_cr_to_virt(struct cr_regs *cr)  	return cr->cam & mask;  } -static struct cr_regs *omap2_alloc_cr(struct iommu *obj, struct iotlb_entry *e) +static struct cr_regs *omap2_alloc_cr(struct omap_iommu *obj, +						struct iotlb_entry *e)  {  	struct cr_regs *cr; @@ -230,7 +231,8 @@ static u32 omap2_get_pte_attr(struct iotlb_entry *e)  	return attr;  } -static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf) +static ssize_t +omap2_dump_cr(struct omap_iommu *obj, struct cr_regs *cr, char *buf)  {  	char *p = buf; @@ -254,7 +256,8 @@ static ssize_t omap2_dump_cr(struct iommu *obj, struct cr_regs *cr, char *buf)  			goto out;					\  	} while (0) -static ssize_t omap2_iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t len) +static ssize_t +omap2_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len)  {  	char *p = buf; @@ -280,7 +283,7 @@ out:  	return p - buf;  } -static void omap2_iommu_save_ctx(struct iommu *obj) +static void omap2_iommu_save_ctx(struct omap_iommu *obj)  {  	int i;  	u32 *p = obj->ctx; @@ -293,7 +296,7 @@ static void omap2_iommu_save_ctx(struct iommu *obj)  	BUG_ON(p[0] != IOMMU_ARCH_VERSION);  } -static void omap2_iommu_restore_ctx(struct iommu *obj) +static void omap2_iommu_restore_ctx(struct omap_iommu *obj)  {  	int i;  	u32 *p = obj->ctx; @@ -343,13 +346,13 @@ static const struct iommu_functions omap2_iommu_ops = {  static int __init omap2_iommu_init(void)  { -	return install_iommu_arch(&omap2_iommu_ops); +	return omap_install_iommu_arch(&omap2_iommu_ops);  }  module_init(omap2_iommu_init);  static void __exit omap2_iommu_exit(void)  { -	uninstall_iommu_arch(&omap2_iommu_ops); +	omap_uninstall_iommu_arch(&omap2_iommu_ops);  }  module_exit(omap2_iommu_exit); diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 889464dc7b2..4412ddb7b3f 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c @@ -102,8 +102,11 @@ void __init smp_init_cpus(void)  {  	unsigned int i, ncores; -	/* Never released */ -	scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); +	/* +	 * Currently we can't call ioremap here because +	 * SoC detection won't work until after init_early. +	 */ +	scu_base =  OMAP2_L4_IO_ADDRESS(OMAP44XX_SCU_BASE);  	BUG_ON(!scu_base);  	ncores = scu_get_core_count(scu_base); diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 393afac9caf..7695e5d4331 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -5370,7 +5370,7 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {  	&omap44xx_mcbsp4_hwmod,  	/* mcpdm class */ -/*	&omap44xx_mcpdm_hwmod, */ +	&omap44xx_mcpdm_hwmod,  	/* mcspi class */  	&omap44xx_mcspi1_hwmod, diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 2e40a5cf016..8db5f035eb0 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c @@ -151,17 +151,10 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,  void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)  { -	/* Static mapping, never released */ -	if (omap2_globals->prm) { -		prm_base = ioremap(omap2_globals->prm, SZ_8K); -		WARN_ON(!prm_base); -	} -	if (omap2_globals->cm) { -		cm_base = ioremap(omap2_globals->cm, SZ_8K); -		WARN_ON(!cm_base); -	} -	if (omap2_globals->cm2) { -		cm2_base = ioremap(omap2_globals->cm2, SZ_8K); -		WARN_ON(!cm2_base); -	} +	if (omap2_globals->prm) +		prm_base = omap2_globals->prm; +	if (omap2_globals->cm) +		cm_base = omap2_globals->cm; +	if (omap2_globals->cm2) +		cm2_base = omap2_globals->cm2;  } diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c index da6f3a63b5d..8f278287477 100644 --- a/arch/arm/mach-omap2/sdrc.c +++ b/arch/arm/mach-omap2/sdrc.c @@ -117,15 +117,10 @@ int omap2_sdrc_get_params(unsigned long r,  void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)  { -	/* Static mapping, never released */ -	if (omap2_globals->sdrc) { -		omap2_sdrc_base = ioremap(omap2_globals->sdrc, SZ_64K); -		WARN_ON(!omap2_sdrc_base); -	} -	if (omap2_globals->sms) { -		omap2_sms_base = ioremap(omap2_globals->sms, SZ_64K); -		WARN_ON(!omap2_sms_base); -	} +	if (omap2_globals->sdrc) +		omap2_sdrc_base = omap2_globals->sdrc; +	if (omap2_globals->sms) +		omap2_sms_base = omap2_globals->sms;  }  /** diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index bb606c9709b..0347b93211e 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -248,7 +248,7 @@ static void sr_stop_vddautocomp(struct omap_sr *sr)   * driver register and sr device intializtion API's. Only one call   * will ultimately succeed.   * - * Currently this function registers interrrupt handler for a particular SR + * Currently this function registers interrupt handler for a particular SR   * if smartreflex class driver is already registered and has   * requested for interrupts and the SR interrupt line in present.   */ diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index daa056ed873..52243577216 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -99,7 +99,7 @@ static struct regulator_init_data omap3_vdac_idata = {  static struct regulator_consumer_supply omap3_vpll2_supplies[] = {  	REGULATOR_SUPPLY("vdds_dsi", "omapdss"), -	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),  };  static struct regulator_init_data omap3_vpll2_idata = { @@ -235,6 +235,12 @@ static struct regulator_init_data omap4_vana_idata = {  	},  }; +static struct regulator_consumer_supply omap4_vcxio_supply[] = { +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), +	REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.1"), +}; +  static struct regulator_init_data omap4_vcxio_idata = {  	.constraints = {  		.min_uV			= 1800000, @@ -243,7 +249,10 @@ static struct regulator_init_data omap4_vcxio_idata = {  					| REGULATOR_MODE_STANDBY,  		.valid_ops_mask		= REGULATOR_CHANGE_MODE  					| REGULATOR_CHANGE_STATUS, +		.always_on		= true,  	}, +	.num_consumer_supplies	= ARRAY_SIZE(omap4_vcxio_supply), +	.consumer_supplies	= omap4_vcxio_supply,  };  static struct regulator_init_data omap4_vusb_idata = {  |