[PATCH 0/3] Initial support for Technexion Thunderboard : defconfig

2009-12-13 Thread Daniel Toussaint

Dear All,

Patches reformatted for mainline.

Signed-off-by: Daniel Toussaint daniel.toussa...@technexion.com
diff -Nur linux-2.6.32-pristine/arch/arm/configs/omap3_thunder_defconfig linux-2.6.32-patched/arch/arm/configs/omap3_thunder_defconfig
--- linux-2.6.32-pristine/arch/arm/configs/omap3_thunder_defconfig	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.32-patched/arch/arm/configs/omap3_thunder_defconfig	2009-12-11 12:57:19.0 +0100
@@ -0,0 +1,1936 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.32
+# Thu Dec 10 15:55:58 2009
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPUFREQ=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0x
+CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+CONFIG_CONSTRUCTORS=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_TINY_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_SLOW_WORK is not set
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED=cfq
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+CONFIG_FREEZER=y
+
+#
+# System Type

[PATCH 1/3] Initial support for Technexion Thunderboard : boardsupport

2009-12-13 Thread Daniel Toussaint

Dear All,

Patches reformatted for mainline.

Daniel Toussaint

Signed-off-by: Daniel Toussaint daniel.toussa...@technexion.com
diff -Nur linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c
--- linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c	2009-12-11 13:09:42.0 +0100
@@ -0,0 +1,455 @@
+/*
+ * Copyright (C) 2009 Technexion
+ * Modified from mach-omap2/board-omap3beagleboard.c
+ *
+ * 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.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/clk.h
+#include linux/io.h
+#include linux/leds.h
+#include linux/gpio.h
+#include linux/input.h
+#include linux/gpio_keys.h
+
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+
+#include linux/regulator/machine.h
+#include linux/i2c/twl4030.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include mach/board.h
+#include mach/usb.h
+#include linux/usb/otg.h
+#include mach/common.h
+#include mach/gpmc.h
+#include mach/nand.h
+
+#include mmc-twl4030.h
+
+#include linux/spi/spi.h
+#include linux/spi/ads7846.h
+#include mach/mcspi.h
+#include mach/mmc.h
+
+#define OMAP3_THUNDER_TS_GPIO	136
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+#define NAND_BLOCK_SIZE	SZ_128K
+
+#define THUNDER_DVI_PANEL_EN_GPIO 199
+#define THUNDER_LCD_PANEL_ENVDD 138
+#define THUNDER_LCD_PON 139
+
+static struct mtd_partition omap3thunder_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= X-Loader,
+		.offset		= 0,
+		.size		= 4 * NAND_BLOCK_SIZE,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= U-Boot,
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x8 */
+		.size		= 15 * NAND_BLOCK_SIZE,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= U-Boot Env,
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x26 */
+		.size		= 1 * NAND_BLOCK_SIZE,
+	},
+	{
+		.name		= Kernel,
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x28 */
+		.size		= 32 * NAND_BLOCK_SIZE,
+	},
+	{
+		.name		= File System,
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x68 */
+		.size		= MTDPART_SIZ_FULL,
+	},
+};
+
+static struct omap_nand_platform_data omap3thunder_nand_data = {
+	.options	= NAND_BUSWIDTH_16,
+	.parts		= omap3thunder_nand_partitions,
+	.nr_parts	= ARRAY_SIZE(omap3thunder_nand_partitions),
+	.dma_channel	= -1,		/* disable DMA in OMAP NAND driver */
+	.nand_setup	= NULL,
+	.dev_ready	= NULL,
+};
+
+static struct resource omap3thunder_nand_resource = {
+	.flags		= IORESOURCE_MEM,
+};
+
+static struct platform_device omap3thunder_nand_device = {
+	.name		= omap2-nand,
+	.id		= -1,
+	.dev		= {
+		.platform_data	= omap3thunder_nand_data,
+	},
+	.num_resources	= 1,
+	.resource	= omap3thunder_nand_resource,
+};
+
+#include sdram-micron-mt46h32m32lf-6.h
+
+static struct omap_uart_config omap3_thunder_uart_config __initdata = {
+	.enabled_uarts	= ((1  0) | (1  1) | (1  2)),
+};
+
+static struct twl4030_usb_data thunder_usb_data = {
+	.usb_mode	= T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_hsmmc_info mmc[] = {
+	{
+		.mmc		= 1,
+		.wires		= 8,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= 29,
+	},
+	{
+		.mmc		= 2,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+	},
+	{}	/* Terminator */
+};
+
+static struct regulator_consumer_supply thunder_vmmc1_supply = {
+	.supply		= vmmc,
+};
+
+static struct regulator_consumer_supply thunder_vmmc2_supply = {
+	.supply		= vmmc,
+};
+
+static struct regulator_consumer_supply thunder_vsim_supply = {
+	.supply			= vmmc_aux,
+};
+
+static struct gpio_led gpio_leds[] = {
+	{
+		.name			= thunderboard::usr0,
+		.default_trigger= heartbeat,
+		.gpio			= -EINVAL,	/* gets replaced */
+		.active_low		= true,
+	},
+};
+
+static int thunder_twl_gpio_setup(struct device *dev,
+		unsigned gpio, unsigned ngpio)
+{
+	mmc[0].gpio_cd = gpio + 0;
+	twl4030_mmc_init(mmc);
+
+	/* link regulators to MMC adapters */
+	thunder_vmmc1_supply.dev = mmc[0].dev;
+	thunder_vmmc2_supply.dev = mmc[1].dev;
+	thunder_vsim_supply.dev = mmc[0].dev;
+
+	/* the LED marked LED 2 (LEDA) */
+	gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
+	/* gpio + 7 == DVI Enable */
+	gpio_request(gpio + 7, EN_DVI);
+	gpio_direction_output(gpio + 7,	0);
+	return 0;
+}
+
+static struct twl4030_gpio_platform_data thunder_gpio_data = {
+	.gpio_base	= OMAP_MAX_GPIO_LINES,
+	.irq_base	= TWL4030_GPIO_IRQ_BASE,
+	.irq_end	= TWL4030_GPIO_IRQ_END,
+	.use_leds	= false,
+	.pullups	= BIT(1),
+	.pulldowns

[PATCH 2/3] Initial support for Technexion Thunderboard : Asoc sound

2009-12-13 Thread Daniel Toussaint

Dear All,

Patches reformatted for mainline.

Daniel Toussaint


Signed-off-by: Daniel Toussaint daniel.toussa...@technexion.com
diff -Nur linux-2.6.32-pristine/sound/soc/omap/Kconfig linux-2.6.32-patched/sound/soc/omap/Kconfig
--- linux-2.6.32-pristine/sound/soc/omap/Kconfig	2009-12-03 04:51:21.0 +0100
+++ linux-2.6.32-patched/sound/soc/omap/Kconfig	2009-12-11 12:56:11.0 +0100
@@ -98,4 +98,11 @@
 	select SND_SOC_TWL4030
 	help
 	  Say Y if you want to add support for Soc audio on Zoom2 board.
+config SND_OMAP_SOC_OMAP3_THUNDER
+ tristate SoC Audio support for OMAP3 Thunder
+ depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP3_THUNDER
+ select SND_OMAP_SOC_MCBSP
+ select SND_SOC_TWL4030
+ help
+   Say Y if you want to add support for SoC audio on the Thunder Board.

diff -Nur linux-2.6.32-pristine/sound/soc/omap/Makefile linux-2.6.32-patched/sound/soc/omap/Makefile
--- linux-2.6.32-pristine/sound/soc/omap/Makefile	2009-12-03 04:51:21.0 +0100
+++ linux-2.6.32-patched/sound/soc/omap/Makefile	2009-12-11 12:56:11.0 +0100
@@ -16,6 +16,8 @@
 snd-soc-omap3pandora-objs := omap3pandora.o
 snd-soc-omap3beagle-objs := omap3beagle.o
 snd-soc-zoom2-objs := zoom2.o
+snd-soc-omap3thunder-objs := omap3thunder.o
+

 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_AMS_DELTA) += snd-soc-ams-delta.o
@@ -27,3 +29,4 @@
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
 obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
+
diff -Nur linux-2.6.32-pristine/sound/soc/omap/omap3thunder.c linux-2.6.32-patched/sound/soc/omap/omap3thunder.c
--- linux-2.6.32-pristine/sound/soc/omap/omap3thunder.c	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.32-patched/sound/soc/omap/omap3thunder.c	2009-12-13 13:46:58.0 +0100
@@ -0,0 +1,162 @@
+/*
+ * omap3 audio support for Technexion Thunder boards.
+ * Modified from omap3beagle.c
+ * Daniel Toussaint daniel.toussa...@technexion.com
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+
+#include linux/clk.h
+#include linux/platform_device.h
+#include sound/core.h
+#include sound/pcm.h
+#include sound/soc.h
+#include sound/soc-dapm.h
+
+#include asm/mach-types.h
+#include plat/hardware.h
+#include plat/gpio.h
+#include plat/mcbsp.h
+
+#include omap-mcbsp.h
+#include omap-pcm.h
+#include ../codecs/twl4030.h
+
+static int omap3thunder_hw_params(struct snd_pcm_substream *substream,
+	struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream-private_data;
+	struct snd_soc_dai *codec_dai = rtd-dai-codec_dai;
+	struct snd_soc_dai *cpu_dai = rtd-dai-cpu_dai;
+	unsigned int fmt;
+	int ret;
+
+	switch (params_channels(params)) {
+	case 2: /* Stereo I2S mode */
+		fmt =	SND_SOC_DAIFMT_I2S |
+			SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBM_CFM;
+		break;
+	case 4: /* Four channel TDM mode */
+		fmt =	SND_SOC_DAIFMT_DSP_A |
+			SND_SOC_DAIFMT_IB_NF |
+			SND_SOC_DAIFMT_CBM_CFM;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	/* Set codec DAI configuration */
+	ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+	if (ret  0) {
+		printk(KERN_ERR can't set codec DAI configuration\n);
+		return ret;
+	}
+
+	/* Set cpu DAI configuration */
+	ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+	if (ret  0) {
+		printk(KERN_ERR can't set cpu DAI configuration\n);
+		return ret;
+	}
+
+	/* Set the codec system clock for DAC and ADC */
+	ret = snd_soc_dai_set_sysclk(codec_dai, 0, 2600,
+ SND_SOC_CLOCK_IN);
+	if (ret  0) {
+		printk(KERN_ERR can't set codec system clock\n);
+		return ret;
+	}
+
+	return 0;
+}
+
+static struct snd_soc_ops omap3thunder_ops = {
+	.hw_params = omap3thunder_hw_params,
+};
+
+/* Digital audio interface glue - connects codec -- CPU */
+static struct snd_soc_dai_link omap3thunder_dai = {
+	.name = TWL4030,
+	.stream_name = TWL4030,
+	.cpu_dai = omap_mcbsp_dai[0],
+	.codec_dai = twl4030_dai[TWL4030_DAI_HIFI],
+	.ops = omap3thunder_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_omap3thunder = {
+	.name = omap3thunder,
+	.platform = omap_soc_platform,
+	.dai_link = omap3thunder_dai,
+	.num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap3thunder_snd_devdata = {
+	.card = snd_soc_omap3thunder,
+	.codec_dev

Re: [PATCH] Initial support for OMAP3 Thunder board

2009-12-11 Thread Daniel Toussaint
On Thu, Dec 10, 2009 at 11:45 PM, Tony Lindgren t...@atomide.com wrote:
 * Daniel Toussaint dan...@dmhome.net [091210 14:29]:
 
  Cool. Can you please split the the patches into following
  separate patches:
 
  1. Add minimal board support
  2. Add defconfig
  3. Add ASoC support
  4. Add DSS2 support

 Ok, so can the DSS2 related stuff be ifdef-ed in the board file ,or
 does it have to be completely seperated ?

 Please leave it out for now as the DSS2 code is not merged yet.

 That can be patched in later on, it's best to leave out all the
 dependencies from patches when possible.

 Also, your patches need to be against current Linus' mainline
 tree, not against linux-omap master branch as we already have
 DSS2 merged in for testing.
Mainline ? ok. I noticed mainline is still using mach/ instead
of plat/ and there no support for the ehci reset with GPIO's.
Or am I looking at the wrong tree ?



 Regards,

 Tony

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Initial support for OMAP3 Thunder board

2009-12-10 Thread Daniel Toussaint

Dear All,

See attached patch for this board: 
http://www.technexion.com/index.php/thunder
The patch contains board file, support for an LCD panel under DSS2 and 
support for Alsa sound.


/Signed-off-by Daniel Toussaint dan...@dmhome.net


///
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 16c0c13..e5493a5 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -151,6 +151,11 @@ config MACH_OMAP_4430SDP
 	bool OMAP 4430 SDP board
 	depends on ARCH_OMAP4
 
+config MACH_OMAP3_THUNDER
+	bool Thunder OMAP3530 board 
+	depends on ARCH_OMAP3  ARCH_OMAP34XX 
+	 select OMAP_PACKAGE_CUS
+
 config OMAP3_EMU
 	bool OMAP3 debugging peripherals
 	depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0c5d886..bd76499 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -105,6 +105,9 @@ obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o
 
 obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
 
+obj-$(CONFIG_MACH_OMAP3_THUNDER) += board-omap3thunder.o \
+	   mmc-twl4030.o
+
 # Platform specific device init code
 obj-y	+= usb-musb.o
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
diff --git a/arch/arm/mach-omap2/board-omap3thunder.c b/arch/arm/mach-omap2/board-omap3thunder.c
new file mode 100644
index 000..d6ea9de
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3thunder.c
@@ -0,0 +1,647 @@
+/*
+ * linux/arch/arm/mach-omap2/board-omap3touchbook.c
+ *
+ * Copyright (C) 2009 Technexion 
+ *
+ * Modified from mach-omap2/board-omap3beagleboard.c
+ *
+ *
+ * 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.
+ */
+
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/clk.h
+#include linux/io.h
+#include linux/leds.h
+#include linux/gpio.h
+#include linux/input.h
+#include linux/gpio_keys.h
+
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+
+#include linux/regulator/machine.h
+#include linux/i2c/twl4030.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include plat/board.h
+#include plat/usb.h
+#include linux/usb/otg.h
+#include plat/common.h
+#include plat/gpmc.h
+#include plat/nand.h
+#include plat/mux.h
+#include plat/display.h
+
+#include mmc-twl4030.h
+#include mux.h
+
+
+#include linux/spi/spi.h
+#include linux/spi/ads7846.h
+#include plat/mcspi.h 
+
+#include plat/mmc.h 
+
+
+#define OMAP3_THUNDER_TS_GPIO	136
+
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZE		SZ_128K
+
+#define THUNDER_DVI_PANEL_EN_GPIO 199 /* GPIO 7 on TWL4030 */
+#define THUNDER_LCD_PANEL_ENVDD 138 
+#define THUNDER_LCD_PON 139
+
+#define TWL_INTBR_GPBR1 0x0c
+#define TWL_INTBR_PMBR1 0x0d
+#define TWL_PWM0_ON0x00
+#define TWL_PWM0_OFF   0x01
+
+static int lcd_enabled;
+static int dvi_enabled;
+
+static void __init thunder_display_init(void)
+{
+	gpio_request(THUNDER_LCD_PANEL_ENVDD, lcd_panel_envdd);
+	gpio_request(THUNDER_LCD_PON, lcd_panel_pon);
+	gpio_direction_output(THUNDER_LCD_PON, 1); 
+	gpio_direction_output(THUNDER_LCD_PANEL_ENVDD, 0);
+	return;
+}
+
+static int thunder_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(THUNDER_LCD_PANEL_ENVDD, 0);
+	gpio_set_value(THUNDER_LCD_PON, 1);
+
+	/* This turns on the backlight, move this to backlight code later */
+	twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 0x81, TWL_PWM0_ON);
+twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, 0x04, TWL_INTBR_PMBR1);
+twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 6 + 40 , TWL_PWM0_OFF);
+twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, 0x05, TWL_INTBR_GPBR1);
+	twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 6 + 50 , TWL_PWM0_OFF);
+	/* End of turning on Backlight */
+
+	lcd_enabled = 1;
+	return 0;
+}
+
+static void thunder_disable_lcd(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(THUNDER_LCD_PANEL_ENVDD, 1);
+	gpio_set_value(THUNDER_LCD_PON, 0);
+	lcd_enabled = 0;
+}
+
+
+static int thunder_set_backlight ( struct omap_dss_device *dssdev, int level) 
+{
+	return 0;
+}
+
+static int thunder_get_backlight ( struct omap_dss_device *dssdev)
+{
+	return 10;
+}
+
+
+static struct omap_dss_device thunder_lcd_device = {
+	.type			= OMAP_DISPLAY_TYPE_DPI,
+	.name			= lcd,
+	.driver_name		= panel-lg-lb043wq2,
+	.phy.dpi.data_lines	= 24,
+	.platform_enable	= thunder_enable_lcd,
+	.platform_disable	= thunder_disable_lcd,
+
+	.get_backlight  	= thunder_get_backlight,
+	.set_backlight 		= thunder_set_backlight,
+	.max_backlight_level= 100,
+};
+
+static int

Re: [PATCH] Initial support for OMAP3 Thunder board

2009-12-10 Thread Daniel Toussaint

 Cool. Can you please split the the patches into following
 separate patches:

 1. Add minimal board support
 2. Add defconfig
 3. Add ASoC support
 4. Add DSS2 support

Ok, so can the DSS2 related stuff be ifdef-ed in the board file ,or
does it have to be completely seperated ?
Thanks

 Then please run all the patches through scripts/checkpatch.pl --strict
 and fix the errors and warnings.

 And please make sure things keep compiling through the
 all the patches, otherwise git bisect will break.

 Cheers,

 Tony


 /Signed-off-by Daniel Toussaint dan...@dmhome.net


 ///

 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
 index 16c0c13..e5493a5 100644
 --- a/arch/arm/mach-omap2/Kconfig
 +++ b/arch/arm/mach-omap2/Kconfig
 @@ -151,6 +151,11 @@ config MACH_OMAP_4430SDP
       bool OMAP 4430 SDP board
       depends on ARCH_OMAP4

 +config MACH_OMAP3_THUNDER
 +     bool Thunder OMAP3530 board
 +     depends on ARCH_OMAP3  ARCH_OMAP34XX
 +      select OMAP_PACKAGE_CUS
 +
  config OMAP3_EMU
       bool OMAP3 debugging peripherals
       depends on ARCH_OMAP3
 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index 0c5d886..bd76499 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -105,6 +105,9 @@ obj-$(CONFIG_MACH_OMAP_4430SDP)           += 
 board-4430sdp.o

  obj-$(CONFIG_MACH_OMAP3517EVM)     += board-am3517evm.o

 +obj-$(CONFIG_MACH_OMAP3_THUNDER)         += board-omap3thunder.o \
 +                                                mmc-twl4030.o
 +
  # Platform specific device init code
  obj-y                                        += usb-musb.o
  obj-$(CONFIG_MACH_OMAP2_TUSB6010)    += usb-tusb6010.o
 diff --git a/arch/arm/mach-omap2/board-omap3thunder.c 
 b/arch/arm/mach-omap2/board-omap3thunder.c
 new file mode 100644
 index 000..d6ea9de
 --- /dev/null
 +++ b/arch/arm/mach-omap2/board-omap3thunder.c
 @@ -0,0 +1,647 @@
 +/*
 + * linux/arch/arm/mach-omap2/board-omap3touchbook.c
 + *
 + * Copyright (C) 2009 Technexion
 + *
 + * Modified from mach-omap2/board-omap3beagleboard.c
 + *
 + *
 + * 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.
 + */
 +
 +
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/platform_device.h
 +#include linux/delay.h
 +#include linux/err.h
 +#include linux/clk.h
 +#include linux/io.h
 +#include linux/leds.h
 +#include linux/gpio.h
 +#include linux/input.h
 +#include linux/gpio_keys.h
 +
 +#include linux/mtd/mtd.h
 +#include linux/mtd/partitions.h
 +#include linux/mtd/nand.h
 +
 +#include linux/regulator/machine.h
 +#include linux/i2c/twl4030.h
 +
 +#include mach/hardware.h
 +#include asm/mach-types.h
 +#include asm/mach/arch.h
 +#include asm/mach/map.h
 +#include asm/mach/flash.h
 +
 +#include plat/board.h
 +#include plat/usb.h
 +#include linux/usb/otg.h
 +#include plat/common.h
 +#include plat/gpmc.h
 +#include plat/nand.h
 +#include plat/mux.h
 +#include plat/display.h
 +
 +#include mmc-twl4030.h
 +#include mux.h
 +
 +
 +#include linux/spi/spi.h
 +#include linux/spi/ads7846.h
 +#include plat/mcspi.h
 +
 +#include plat/mmc.h
 +
 +
 +#define OMAP3_THUNDER_TS_GPIO        136
 +
 +#define GPMC_CS0_BASE  0x60
 +#define GPMC_CS_SIZE   0x30
 +
 +#define NAND_BLOCK_SIZE              SZ_128K
 +
 +#define THUNDER_DVI_PANEL_EN_GPIO 199 /* GPIO 7 on TWL4030 */
 +#define THUNDER_LCD_PANEL_ENVDD 138
 +#define THUNDER_LCD_PON 139
 +
 +#define TWL_INTBR_GPBR1 0x0c
 +#define TWL_INTBR_PMBR1 0x0d
 +#define TWL_PWM0_ON    0x00
 +#define TWL_PWM0_OFF   0x01
 +
 +static int lcd_enabled;
 +static int dvi_enabled;
 +
 +static void __init thunder_display_init(void)
 +{
 +     gpio_request(THUNDER_LCD_PANEL_ENVDD, lcd_panel_envdd);
 +     gpio_request(THUNDER_LCD_PON, lcd_panel_pon);
 +     gpio_direction_output(THUNDER_LCD_PON, 1);
 +     gpio_direction_output(THUNDER_LCD_PANEL_ENVDD, 0);
 +     return;
 +}
 +
 +static int thunder_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(THUNDER_LCD_PANEL_ENVDD, 0);
 +     gpio_set_value(THUNDER_LCD_PON, 1);
 +
 +     /* This turns on the backlight, move this to backlight code later */
 +     twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 0x81, TWL_PWM0_ON);
 +        twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, 0x04, TWL_INTBR_PMBR1);
 +        twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 6 + 40 , TWL_PWM0_OFF);
 +        twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, 0x05, TWL_INTBR_GPBR1);
 +     twl4030_i2c_write_u8(TWL4030_MODULE_PWM0, 6 + 50 , TWL_PWM0_OFF);
 +     /* End of turning on Backlight */
 +
 +     lcd_enabled = 1;
 +     return 0;
 +}
 +
 +static void thunder_disable_lcd(struct omap_dss_device *dssdev)
 +{
 +     gpio_set_value(THUNDER_LCD_PANEL_ENVDD, 1

Re: [PATCH 3/4] Add support for DEVKIT8000 LCD

2009-11-12 Thread Daniel Toussaint



On Thu, Nov 12, 2009 at 7:46 PM, Tomi Valkeinen 
tomi.valkei...@nokia.com mailto:tomi.valkei...@nokia.com wrote:


   On Thu, 2009-11-12 at 11:23 +0100, ext Kim Botherway wrote:
 This patch add support for the Timll DEVKIT8000 LCD panel

   I don't handle old omapfb patches. I think you should contact Imre Deak
   for those, although my advise would be to use the new display subsystem
   driver.


Question more or less related to this thread : when submitting new 
boards, it is better to work with DSS2 directly right ? I am also 
preparing a new board patch at this point, so I would like to know what 
is the sanest way to work ? Patch the linux-omap-2.6 tree with DSS2 
patches , and then diff from there ? Or is is wiser to first submit 
without display related items, and wait for linux-omap-2.6 tree to have 
DSS2 support - which is going to happen soon I guess. 


Thanks




Tomi


   --
   To unsubscribe from this list: send the line unsubscribe linux-omap in
   the body of a message to majord...@vger.kernel.org
   mailto:majord...@vger.kernel.org
   More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html