Skip to content

Commit

Permalink
Merge tag 'omap-devel-board-for-v3.6' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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>
  • Loading branch information
Arnd Bergmann committed Jul 10, 2012
2 parents 388d037 + b103a2e commit e190df2
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 15 deletions.
4 changes: 4 additions & 0 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};

Expand Down
89 changes: 89 additions & 0 deletions arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,80 @@ 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,
TWL_COMMON_REGULATOR_VDAC |
TWL_COMMON_PDATA_AUDIO);

omap3_pmic_init("tps65930", &cm_t35_twldata);

omap_register_i2c_bus(3, 400, NULL, 0);
}

#ifdef CONFIG_OMAP_MUX
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down
78 changes: 77 additions & 1 deletion arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};

Expand Down
18 changes: 16 additions & 2 deletions arch/arm/mach-omap2/common-board-devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {
Expand All @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/common-board-devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
61 changes: 61 additions & 0 deletions arch/arm/mach-omap2/drm.c
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit e190df2

Please sign in to comment.