diff options
Diffstat (limited to 'arch/arm/mach-omap2')
| -rw-r--r-- | arch/arm/mach-omap2/Makefile | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 3 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 89 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 78 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 3 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common-board-devices.c | 11 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common-board-devices.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/drm.c | 61 | 
8 files changed, 249 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b779ddd86fa..19b771d0c0d 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -217,6 +217,10 @@ endif  # OMAP2420 MSDI controller integration support ("MMC")  obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o +ifneq ($(CONFIG_DRM_OMAP),) +obj-y					+= drm.o +endif +  # Specific board support  obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o  obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 8e17284a803..ad8a7d94afc 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -821,6 +821,9 @@ static void __init omap_4430sdp_display_init(void)  #ifdef CONFIG_OMAP_MUX  static struct omap_board_mux board_mux[] __initdata = {  	OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), +	/* NIRQ2 for twl6040 */ +	OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 | +		  OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),  	{ .reg_offset = OMAP_MUX_TERMINATOR },  }; diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index ded100c80a9..97d719047af 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -490,6 +490,71 @@ static struct twl4030_platform_data cm_t35_twldata = {  	.power		= &cm_t35_power_data,  }; +#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) +#include <media/omap3isp.h> +#include "devices.h" + +static struct i2c_board_info cm_t35_isp_i2c_boardinfo[] = { +	{ +		I2C_BOARD_INFO("mt9t001", 0x5d), +	}, +	{ +		I2C_BOARD_INFO("tvp5150", 0x5c), +	}, +}; + +static struct isp_subdev_i2c_board_info cm_t35_isp_primary_subdevs[] = { +	{ +		.board_info = &cm_t35_isp_i2c_boardinfo[0], +		.i2c_adapter_id = 3, +	}, +	{ NULL, 0, }, +}; + +static struct isp_subdev_i2c_board_info cm_t35_isp_secondary_subdevs[] = { +	{ +		.board_info = &cm_t35_isp_i2c_boardinfo[1], +		.i2c_adapter_id = 3, +	}, +	{ NULL, 0, }, +}; + +static struct isp_v4l2_subdevs_group cm_t35_isp_subdevs[] = { +	{ +		.subdevs = cm_t35_isp_primary_subdevs, +		.interface = ISP_INTERFACE_PARALLEL, +		.bus = { +			.parallel = { +				.clk_pol = 1, +			}, +		}, +	}, +	{ +		.subdevs = cm_t35_isp_secondary_subdevs, +		.interface = ISP_INTERFACE_PARALLEL, +		.bus = { +			.parallel = { +				.clk_pol = 0, +			}, +		}, +	}, +	{ NULL, 0, }, +}; + +static struct isp_platform_data cm_t35_isp_pdata = { +	.subdevs = cm_t35_isp_subdevs, +}; + +static void __init cm_t35_init_camera(void) +{ +	if (omap3_init_camera(&cm_t35_isp_pdata) < 0) +		pr_warn("CM-T3x: Failed registering camera device!\n"); +} + +#else +static inline void cm_t35_init_camera(void) {} +#endif /* CONFIG_VIDEO_OMAP3 */ +  static void __init cm_t35_init_i2c(void)  {  	omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB, @@ -497,6 +562,8 @@ static void __init cm_t35_init_i2c(void)  			      TWL_COMMON_PDATA_AUDIO);  	omap3_pmic_init("tps65930", &cm_t35_twldata); + +	omap_register_i2c_bus(3, 400, NULL, 0);  }  #ifdef CONFIG_OMAP_MUX @@ -574,6 +641,27 @@ static struct omap_board_mux board_mux[] __initdata = {  	OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),  	OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), +	/* Camera */ +	OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_VS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_XCLKA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_FLD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), +	OMAP3_MUX(CAM_D8, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), +	OMAP3_MUX(CAM_D9, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), +	OMAP3_MUX(CAM_STROBE, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), + +	OMAP3_MUX(CAM_D10, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN), +	OMAP3_MUX(CAM_D11, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN), +  	/* display controls */  	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),  	OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), @@ -646,6 +734,7 @@ static void __init cm_t3x_common_init(void)  	usb_musb_init(NULL);  	cm_t35_init_usbh(); +	cm_t35_init_camera();  }  static void __init cm_t35_init(void) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 639bd07ea38..ef230a0eb5e 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -24,6 +24,10 @@  #include <linux/leds.h>  #include <linux/interrupt.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/nand.h> +  #include <linux/spi/spi.h>  #include <linux/spi/ads7846.h>  #include <linux/i2c/twl.h> @@ -43,6 +47,7 @@  #include <plat/board.h>  #include <plat/usb.h> +#include <plat/nand.h>  #include "common.h"  #include <plat/mcspi.h>  #include <video/omapdss.h> @@ -53,7 +58,6 @@  #include "hsmmc.h"  #include "common-board-devices.h" -#define OMAP3_EVM_TS_GPIO	175  #define OMAP3_EVM_EHCI_VBUS	22  #define OMAP3_EVM_EHCI_SELECT	61 @@ -355,6 +359,19 @@ static int omap3evm_twl_gpio_setup(struct device *dev,  	platform_device_register(&leds_gpio); +	/* Enable VBUS switch by setting TWL4030.GPIO2DIR as output +	 * for starting USB tranceiver +	 */ +#ifdef CONFIG_TWL4030_CORE +	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { +		u8 val; + +		twl_i2c_read_u8(TWL4030_MODULE_GPIO, &val, REG_GPIODATADIR1); +		val |= 0x04; /* TWL4030.GPIO2DIR BIT at GPIODATADIR1(0x9B) */ +		twl_i2c_write_u8(TWL4030_MODULE_GPIO, val, REG_GPIODATADIR1); +	} +#endif +  	return 0;  } @@ -461,6 +478,28 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {  };  #endif +/* VAUX2 for USB */ +static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = { +	REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"),	/* OMAP ISP */ +	REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"),	/* OMAP ISP */ +	REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"), +	REGULATOR_SUPPLY("vaux2", NULL), +}; + +static struct regulator_init_data omap3evm_vaux2 = { +	.constraints = { +		.min_uV		= 2800000, +		.max_uV		= 2800000, +		.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(omap3evm_vaux2_supplies), +	.consumer_supplies		= omap3evm_vaux2_supplies, +}; +  static struct twl4030_platform_data omap3evm_twldata = {  	/* platform_data for children goes here */  	.keypad		= &omap3evm_kp_data, @@ -607,6 +646,37 @@ static struct regulator_consumer_supply dummy_supplies[] = {  	REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),  }; +static struct mtd_partition omap3evm_nand_partitions[] = { +	/* All the partition sizes are listed in terms of NAND block size */ +	{ +		.name           = "X-Loader", +		.offset         = 0, +		.size           = 4*(SZ_128K), +		.mask_flags     = MTD_WRITEABLE +	}, +	{ +		.name           = "U-Boot", +		.offset         = MTDPART_OFS_APPEND, +		.size           = 14*(SZ_128K), +		.mask_flags     = MTD_WRITEABLE +	}, +	{ +		.name           = "U-Boot Env", +		.offset         = MTDPART_OFS_APPEND, +		.size           = 2*(SZ_128K) +	}, +	{ +		.name           = "Kernel", +		.offset         = MTDPART_OFS_APPEND, +		.size           = 40*(SZ_128K) +	}, +	{ +		.name           = "File system", +		.size           = MTDPART_SIZ_FULL, +		.offset         = MTDPART_OFS_APPEND, +	}, +}; +  static void __init omap3_evm_init(void)  {  	struct omap_board_mux *obm; @@ -623,6 +693,9 @@ static void __init omap3_evm_init(void)  	omap_mux_init_gpio(63, OMAP_PIN_INPUT);  	omap_hsmmc_init(mmc); +	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) +		omap3evm_twldata.vaux2 = &omap3evm_vaux2; +  	omap3_evm_i2c_init();  	omap_display_init(&omap3_evm_dss_data); @@ -656,6 +729,9 @@ static void __init omap3_evm_init(void)  	}  	usb_musb_init(&musb_board_data);  	usbhs_init(&usbhs_bdata); +	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions, +			     ARRAY_SIZE(omap3evm_nand_partitions)); +  	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);  	omap3evm_init_smsc911x();  	omap3_evm_display_init(); diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 982fb2622ab..b627cdc12b8 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -379,6 +379,9 @@ static struct omap_board_mux board_mux[] __initdata = {  	OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),  	/* dispc2_data0 */  	OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), +	/* NIRQ2 for twl6040 */ +	OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 | +		  OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),  	{ .reg_offset = OMAP_MUX_TERMINATOR },  }; diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index c1875862679..14734746457 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c @@ -35,6 +35,16 @@ static struct omap2_mcspi_device_config ads7846_mcspi_config = {  	.turbo_mode	= 0,  }; +/* + * ADS7846 driver maybe request a gpio according to the value + * of pdata->get_pendown_state, but we have done this. So set + * get_pendown_state to avoid twice gpio requesting. + */ +static int omap3_get_pendown_state(void) +{ +	return !gpio_get_value(OMAP3_EVM_TS_GPIO); +} +  static struct ads7846_platform_data ads7846_config = {  	.x_max			= 0x0fff,  	.y_max			= 0x0fff, @@ -45,6 +55,7 @@ static struct ads7846_platform_data ads7846_config = {  	.debounce_rep		= 1,  	.gpio_pendown		= -EINVAL,  	.keep_vref_on		= 1, +	.get_pendown_state	= &omap3_get_pendown_state,  };  static struct spi_board_info ads7846_spi_board_info __initdata = { diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h index a0b4a42836a..4c4ef6a6166 100644 --- a/arch/arm/mach-omap2/common-board-devices.h +++ b/arch/arm/mach-omap2/common-board-devices.h @@ -4,6 +4,7 @@  #include "twl-common.h"  #define NAND_BLOCK_SIZE	SZ_128K +#define OMAP3_EVM_TS_GPIO	175  struct mtd_partition;  struct ads7846_platform_data; diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c new file mode 100644 index 00000000000..72e0f01b715 --- /dev/null +++ b/arch/arm/mach-omap2/drm.c @@ -0,0 +1,61 @@ +/* + * DRM/KMS device registration for TI OMAP platforms + * + * Copyright (C) 2012 Texas Instruments + * Author: Rob Clark <rob.clark@linaro.org> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * 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, see <http://www.gnu.org/licenses/>. + */ + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/mm.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/dma-mapping.h> + +#include <plat/omap_device.h> +#include <plat/omap_hwmod.h> + +#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) + +static struct platform_device omap_drm_device = { +	.dev = { +		.coherent_dma_mask = DMA_BIT_MASK(32), +	}, +	.name = "omapdrm", +	.id = 0, +}; + +static int __init omap_init_drm(void) +{ +	struct omap_hwmod *oh = NULL; +	struct platform_device *pdev; + +	/* lookup and populate the DMM information, if present - OMAP4+ */ +	oh = omap_hwmod_lookup("dmm"); + +	if (oh) { +		pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0, +					false); +		WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", +			oh->name); +	} + +	return platform_device_register(&omap_drm_device); + +} + +arch_initcall(omap_init_drm); + +#endif  |