Board and platform data related changes for omaps

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJP++wDAAoJEBvUPslcq6VzhF4P/AqzPc9rhqgLv+jaXlrD1E5k
 XGKOObZks2lni9ivcQvgwCdedjoJW5BQVZKrQi8u0Sa7PJExUwsef1H23Df0O4u+
 DKaKz4H/k7Jc4qd8W6N9VI4DcSjR1n0QO9x3xvnLa92zR9s6xF1oU+Aia+rPkgbI
 3WQDqlmOGzEHz8fPK9iOxgz55y2gBmyP7v+Qdj33yDPoRsPcMG3GCw0r+iVtjGMZ
 cxLbpICz3gXTSIdN0bPsuivDxjJNYQo2u3bNMMnx5TNULvBjCBKXtFEzVqHe8rxd
 QXhLjcbDL7SLW/Fs/wAPfcr4F2UlRiK04B7aavf0fxRO1Fw6IfhdnQJ2k94YTNWT
 M5AFavtlN/Pm49QPlkf9Jkj+LxGTpTe6kvbmCTpAd2De2W8HshIUy9iLI3leX5RR
 /Ks/Uq7Wr9atXGHgEnZ61ub+7vsqf3DhYXdRebeW/o6nf1kYZLwV/5xIVsbh5E4o
 FGQg9BOk1PhzUe6W0cMc6PxQh1lIvE48uacpSWUrhu3pFba54JC85GN4ICzmTnPx
 mhEccnfzPGnEf6p8UhYFVZAR82c3dw5OeMSwYqOMEI2Tce2KHsXPiv2xlvXWonm3
 cP8UAFawoV+1zMlOw6pf+6cMZ9FMkqBq49s5PtI3YBKGo5mBgB55+gv90tSKHwLa
 vrOx7j5e/9rcdvJs1V2i
 =/t77
 -----END PGP SIGNATURE-----

Merge tag 'omap-devel-board-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/boards

From Tony Lindgren <tony@atomide.com>:
Board and platform data related changes for omaps

* tag 'omap-devel-board-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP3: Fix omap3evm randconfig error introduced by VBUS support
  ARM: OMAP: board-omap4panda: MUX configuration for sys_nirq2
  ARM: OMAP: board-4430sdp: MUX configuration for sys_nirq2
  ARM: OMAP3530evm: set pendown_state and debounce time for ads7846
  ARM: omap3evm: enable VBUS switch for EHCI tranceiver
  ARM: OMAP3EVM: Adding USB internal LDOs board file
  ARM: OMAP3EVM: Add NAND flash definition
  ARM: OMAP3: cm-t35: add tvp5150 decoder support
  ARM: OMAP3: cm-t35: add mt9t001 camera sensor support
  omap2+: add drm device

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2012-07-10 16:54:25 +02:00
commit e190df2400
10 changed files with 263 additions and 15 deletions

View File

@ -189,6 +189,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

View File

@ -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 },
};

View File

@ -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)

View File

@ -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();

View File

@ -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 },
};

View File

@ -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 = {
@ -63,14 +74,17 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
struct spi_board_info *spi_bi = &ads7846_spi_board_info;
int err;
if (board_pdata && board_pdata->get_pendown_state) {
if (gpio_pendown) {
err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
if (err) {
pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
return;
}
gpio_export(gpio_pendown, 0);
/* TS GPIOPendown doesn't allow user to change the direction */
gpio_export(gpio_pendown, false);
/* Set proper debouce time for ads7846. */
if (gpio_debounce)
gpio_set_debounce(gpio_pendown, gpio_debounce);
}

View File

@ -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;

61
arch/arm/mach-omap2/drm.c Normal file
View File

@ -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

View File

@ -25,8 +25,8 @@
#include <linux/types.h>
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <linux/platform_data/omap_drm.h>
#include "omap_drm.h"
#include "omap_priv.h"
#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */

View File

@ -1,8 +1,8 @@
/*
* include/drm/omap_priv.h
* DRM/KMS platform data for TI OMAP platforms
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
* 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
@ -17,13 +17,11 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __OMAP_PRIV_H__
#define __OMAP_PRIV_H__
#ifndef __PLATFORM_DATA_OMAP_DRM_H__
#define __PLATFORM_DATA_OMAP_DRM_H__
/* Non-userspace facing APIs
*/
/* optional platform data to configure the default configuration of which
/*
* Optional platform data to configure the default configuration of which
* pipes/overlays/CRTCs are used.. if this is not provided, then instead the
* first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
* one manager, with priority given to managers that are connected to
@ -49,7 +47,6 @@ struct omap_kms_platform_data {
struct omap_drm_platform_data {
struct omap_kms_platform_data *kms_pdata;
struct omap_dmm_platform_data *dmm_pdata;
};
#endif /* __OMAP_DRM_H__ */
#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */