All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 3/3] ARM: OMAP2+: Add command line parameter for debugSS module control
@ 2013-03-04 11:35 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2013-03-04 11:35 UTC (permalink / raw)
  To: linux-omap
  Cc: tony, khilman, paul, rnayak, linux-arm-kernel, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

Currently there is no clean mechanism to control debugSS module and
you have to always keep clocks enabled, either,

    - By enabling it during boot as part of clk_init function.
    Or
    - By having HWMOD_INIT_NO_IDLE flag in hwmod data.

Based on the discussion,
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg81771.html

This patch introduces new kernel parameter "omap_debugss_en",
which will allow user to control debugSS module enable/disable
part during boot-time.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
---
Tested on
	- AM335x based EVM and BeagleBone platforms

 Documentation/kernel-parameters.txt |    3 +
 arch/arm/mach-omap2/Makefile        |    2 +-
 arch/arm/mach-omap2/debugss.c       |   80 +++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/debugss.c

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6c72381..bf1c822 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2051,6 +2051,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			For example, to override I2C bus2:
 			omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100

+	omap_debugss_en	[OMAP] Enable Debug Sub-System module required
+			for JTAG debugging.
+
 	oprofile.timer=	[HW]
 			Use timer interrupt instead of performance counters

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index d1156cf..aaf5cc2 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -5,7 +5,7 @@
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
-	 omap_device.o sram.o
+	 omap_device.o sram.o debugss.o

 omap-2-3-common				= irq.o
 hwmod-common				= omap_hwmod.o \
diff --git a/arch/arm/mach-omap2/debugss.c b/arch/arm/mach-omap2/debugss.c
new file mode 100644
index 0000000..b45bf2c
--- /dev/null
+++ b/arch/arm/mach-omap2/debugss.c
@@ -0,0 +1,80 @@
+/*
+ * debugss.c: Debug Sus-System related code goes in here
+ *
+ * Copyright (C) {2013} Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is automatically generated from the AM33XX hardware databases.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+
+#include "omap_hwmod.h"
+
+static bool is_debugss_en;
+
+/**
+ * omap_debugss_en - Enable debugss clock/module based on user config
+ *
+ * During kernel bootup, omap2 hwmod framework will disable all the
+ * unused/unclaimed modules, which in turn also disables debugss module.
+ * This breaks any further debugging capability provided by HW.
+ *
+ *
+ * Introduce early param which allows user to enable clock/module -
+ *
+ *   omap_debugss_en	(For all OMAP2 architectures)
+ *
+ * Please note that, with this command-line param, module always remain
+ * enabled.
+ */
+static int __init omap_debugss_en(char *str)
+{
+	is_debugss_en = true;
+	return 0;
+}
+early_param("omap_debugss_en", omap_debugss_en);
+
+static int __init _omap2_debugss_enable(void)
+{
+	const char oh_name[10] = "debugss";
+	struct omap_hwmod *oh;
+	int ret;
+
+	if (is_debugss_en) {
+		struct omap_hwmod_opt_clk *oc;
+		int i;
+
+		oh = omap_hwmod_lookup(oh_name);
+		if (!oh) {
+			pr_err("debugss device not found\n");
+			return 0;
+		}
+
+		/* Make sure that hwmod internal data structures are setup */
+		ret = omap_hwmod_setup_one(oh_name);
+		if (ret) {
+			pr_err("failed to setup hwmod for %s\n", oh_name);
+			return 0;
+		}
+		/* Enable optional clocks */
+		for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)	{
+			if (oc->_clk)
+				clk_prepare_enable(oc->_clk);
+		}
+		/* Enable debugss clock/module  */
+		omap_hwmod_enable(oh);
+	}
+
+	return 0;
+}
+device_initcall(_omap2_debugss_enable);
--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [RFC PATCH 1/3] ARM: AM33XX: clock: Add debugSS clock nodes to clock tree
@ 2013-03-04 11:35 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2013-03-04 11:35 UTC (permalink / raw)
  To: linux-omap
  Cc: tony, khilman, paul, rnayak, linux-arm-kernel, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

Represent debugSS clock interface as provided in
CM_WKUP_DEBUGSS_CLKCTRL register, which includes,
	- Clock gate for optional DEBUG_CLKA and DBGSYSCLK
	- Clock Mux for TRC_PMD and STM_PMD
	- Clock divider for STM and TPIU

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/cclock33xx_data.c |   47 +++++++++++++++++++++++++++++---
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
index 3d5a0e5..12db88c 100644
--- a/arch/arm/mach-omap2/cclock33xx_data.c
+++ b/arch/arm/mach-omap2/cclock33xx_data.c
@@ -422,15 +422,11 @@ DEFINE_STRUCT_CLK(smartreflex1_fck, dpll_core_ck_parents, clk_ops_null);
  *  - Driver code is not yet migrated to use hwmod/runtime pm
  *  - Modules outside kernel access (to disable them by default)
  *
- *     - debugss
  *     - mmu (gfx domain)
  *     - cefuse
  *     - usbotg_fck (its additional clock and not really a modulemode)
  *     - ieee5000
  */
-DEFINE_CLK_GATE(debugss_ick, "dpll_core_m4_ck", &dpll_core_m4_ck, 0x0,
-		AM33XX_CM_WKUP_DEBUGSS_CLKCTRL, AM33XX_MODULEMODE_SWCTRL_SHIFT,
-		0x0, NULL);

 DEFINE_CLK_GATE(mmu_fck, "dpll_core_m4_ck", &dpll_core_m4_ck, 0x0,
 		AM33XX_CM_GFX_MMUDATA_CLKCTRL, AM33XX_MODULEMODE_SWCTRL_SHIFT,
@@ -833,6 +829,42 @@ static struct clk_hw_omap wdt1_fck_hw = {
 DEFINE_STRUCT_CLK(wdt1_fck, wdt_ck_parents, gpio_fck_ops);

 /*
+ * debugss optional clocks
+ */
+DEFINE_CLK_GATE(dbg_sysclk_ck, "sys_clkin_ck", &sys_clkin_ck,
+		0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
+		AM33XX_OPTFCLKEN_DBGSYSCLK_SHIFT, 0x0, NULL);
+
+DEFINE_CLK_GATE(dbg_clka_ck, "dpll_core_m4_ck", &dpll_core_m4_ck,
+		0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
+		AM33XX_OPTCLK_DEBUG_CLKA_SHIFT, 0x0, NULL);
+
+static const char *stm_pmd_clock_mux_ck_parents[] = {
+	"dbg_sysclk_ck", "dbg_clka_ck",
+};
+
+DEFINE_CLK_MUX(stm_pmd_clock_mux_ck, stm_pmd_clock_mux_ck_parents, NULL, 0x0,
+	       AM33XX_CM_WKUP_DEBUGSS_CLKCTRL, AM33XX_STM_PMD_CLKSEL_SHIFT,
+	       AM33XX_STM_PMD_CLKSEL_WIDTH, 0x0, NULL);
+
+DEFINE_CLK_MUX(trace_pmd_clk_mux_ck, stm_pmd_clock_mux_ck_parents, NULL, 0x0,
+	       AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
+	       AM33XX_TRC_PMD_CLKSEL_SHIFT,
+	       AM33XX_TRC_PMD_CLKSEL_WIDTH, 0x0, NULL);
+
+DEFINE_CLK_DIVIDER(stm_clk_div_ck, "stm_pmd_clock_mux_ck",
+		   &stm_pmd_clock_mux_ck, 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
+		   AM33XX_STM_PMD_CLKDIVSEL_SHIFT,
+		   AM33XX_STM_PMD_CLKDIVSEL_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
+		   NULL);
+
+DEFINE_CLK_DIVIDER(trace_clk_div_ck, "trace_pmd_clk_mux_ck",
+		   &trace_pmd_clk_mux_ck, 0x0, AM33XX_CM_WKUP_DEBUGSS_CLKCTRL,
+		   AM33XX_TRC_PMD_CLKDIVSEL_SHIFT,
+		   AM33XX_TRC_PMD_CLKDIVSEL_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
+		   NULL);
+
+/*
  * clkdev
  */
 static struct omap_clk am33xx_clks[] = {
@@ -869,7 +901,6 @@ static struct omap_clk am33xx_clks[] = {
 	CLK("481cc000.d_can",	NULL,		&dcan0_fck,	CK_AM33XX),
 	CLK(NULL,	"dcan1_fck",		&dcan1_fck,	CK_AM33XX),
 	CLK("481d0000.d_can",	NULL,		&dcan1_fck,	CK_AM33XX),
-	CLK(NULL,	"debugss_ick",		&debugss_ick,	CK_AM33XX),
 	CLK(NULL,	"pruss_ocp_gclk",	&pruss_ocp_gclk,	CK_AM33XX),
 	CLK(NULL,	"mcasp0_fck",		&mcasp0_fck,	CK_AM33XX),
 	CLK(NULL,	"mcasp1_fck",		&mcasp1_fck,	CK_AM33XX),
@@ -910,6 +941,12 @@ static struct omap_clk am33xx_clks[] = {
 	CLK(NULL,	"clkout2_div_ck",	&clkout2_div_ck,	CK_AM33XX),
 	CLK(NULL,	"timer_32k_ck",		&clkdiv32k_ick,	CK_AM33XX),
 	CLK(NULL,	"timer_sys_ck",		&sys_clkin_ck,	CK_AM33XX),
+	CLK(NULL,	"dbg_sysclk_ck",	&dbg_sysclk_ck,	CK_AM33XX),
+	CLK(NULL,	"dbg_clka_ck",		&dbg_clka_ck,	CK_AM33XX),
+	CLK(NULL,	"stm_pmd_clock_mux_ck",	&stm_pmd_clock_mux_ck,	CK_AM33XX),
+	CLK(NULL,	"trace_pmd_clk_mux_ck",	&trace_pmd_clk_mux_ck,	CK_AM33XX),
+	CLK(NULL,	"stm_clk_div_ck",	&stm_clk_div_ck,	CK_AM33XX),
+	CLK(NULL,	"trace_clk_div_ck",	&trace_clk_div_ck,	CK_AM33XX),
 };


--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [RFC PATCH 0/3] ARM: OMAP2+: Add command line parameter for debugSS module control
@ 2013-03-04 11:35 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2013-03-04 11:35 UTC (permalink / raw)
  To: linux-omap
  Cc: tony, khilman, paul, rnayak, linux-arm-kernel, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

Currently there is no clean mechanism to control debugSS module and
you have to always keep clocks enabled, either,

    - By enabling it during boot as part of clk_init function
      (post common-clock migration).
    Or
    - By having HWMOD_INIT_NO_IDLE flag in hwmod data
      (Joel submitted patch for AM335x earlier).

Based on the discussion with Kevin H,
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg81771.html

This patch introduces new kernel parameter "omap_debugss_en",
which will allow user to control debugSS module enable/disable
part during boot-time.

In case of OMAP3, the debugSS is part of EMU domain and
is currently controlled by clock tree alone.

In case of OMAP4, the debugSS is part of EMU domain and
is currently controlled by clock tree, as MODULEMODE_SWCTRL
is not defined for hwmod.

In case of AM335x, the debugSS is in wakeup domain and is currently
controlled through hwmod alone. Currently we keep it always enabled.

Testing:
	- Tested on AM335x based EVM and BeagleBone platform

	  As required, without this flag the debugSS module will be disabled
	  during kernel boot.

OMAP (2/3/4) may require some changes from clock/hwmod perspective
in order to use this new parameter.
I am still looking into OMAP spec and this RFC version of patch-series
is to get comments or opinion from list.

Vaibhav Hiremath (3):
  ARM: AM33XX: clock: Add debugSS clock nodes to clock tree
  ARM: AM33XX: hwmod: Add hwmod data for debugSS
  ARM: OMAP2+: Add command line parameter for debugSS module control

 Documentation/kernel-parameters.txt        |    3 +
 arch/arm/mach-omap2/Makefile               |    2 +-
 arch/arm/mach-omap2/cclock33xx_data.c      |   47 +++++++++++++++--
 arch/arm/mach-omap2/debugss.c              |   80 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   69 ++++++++++++++++--------
 5 files changed, 173 insertions(+), 28 deletions(-)
 create mode 100644 arch/arm/mach-omap2/debugss.c


^ permalink raw reply	[flat|nested] 270+ messages in thread
* [PATCH-V5 2/3] arm:omap:am33xx: Add AM335XEVM machine support
@ 2011-12-02  6:43 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-12-02  6:43 UTC (permalink / raw)
  To: linux-omap
  Cc: tony, khilman, linux-arm-kernel, paul, Afzal Mohammed, Vaibhav Hiremath

From: Afzal Mohammed <afzal@ti.com>

This patch adds minimal support for AM335X EVM.
The approach taken here is to add AM335X EVM support
to AM3517EVM, considering the fact that with device tree
developement we will get rid of board-*.c.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/Kconfig              |    5 +++++
 arch/arm/mach-omap2/Makefile             |    1 +
 arch/arm/mach-omap2/board-am3517evm.c    |   21 +++++++++++++++++++++
 arch/arm/mach-omap2/io.c                 |    7 +++++++
 arch/arm/mach-omap2/timer.c              |    2 ++
 arch/arm/plat-omap/include/plat/common.h |    2 ++
 6 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 09ea525..c0e4a70 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -326,6 +326,11 @@ config MACH_TI8168EVM
 	depends on SOC_OMAPTI816X
 	default y

+config MACH_AM335XEVM
+	bool "AM335X Evaluation Module"
+	depends on SOC_OMAPAM33XX
+	default y
+
 config MACH_OMAP_4430SDP
 	bool "OMAP 4430 SDP board"
 	default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index a12a069..89099a3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -233,6 +233,7 @@ obj-$(CONFIG_MACH_CRANEBOARD)		+= board-am3517crane.o

 obj-$(CONFIG_MACH_SBC3530)		+= board-omap3stalker.o
 obj-$(CONFIG_MACH_TI8168EVM)		+= board-ti8168evm.o
+obj-$(CONFIG_MACH_AM335XEVM)		+= board-am3517evm.o

 # Platform specific device init code

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index f7df8d3..090457f 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -516,3 +516,24 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
 	.init_machine	= am3517_evm_init,
 	.timer		= &omap3_timer,
 MACHINE_END
+
+static struct omap_board_config_kernel am335x_evm_config[] __initdata = {
+};
+
+static void __init am335x_evm_init(void)
+{
+	omap_serial_init();
+	omap_sdrc_init(NULL, NULL);
+	omap_board_config = am335x_evm_config;
+	omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
+}
+
+MACHINE_START(AM335XEVM, "am335xevm")
+	/* Maintainer: Texas Instruments */
+	.atag_offset	= 0x100,
+	.map_io		= am33xx_map_io,
+	.init_early	= am33xx_init_early,
+	.init_irq	= ti816x_init_irq,
+	.timer		= &omap3_am33xx_timer,
+	.init_machine	= am335x_evm_init,
+MACHINE_END
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 74e84c6..e958c04 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -460,6 +460,13 @@ void __init ti816x_init_early(void)
 	omap_hwmod_init_postsetup();
 	omap3xxx_clk_init();
 }
+
+void __init am33xx_init_early(void)
+{
+	omap2_set_globals_am33xx();
+	omap_common_init_early();
+	omap3xxx_clk_init();
+}
 #endif

 #ifdef CONFIG_ARCH_OMAP4
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 037b0d7..7b29197 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -333,6 +333,8 @@ OMAP_SYS_TIMER(3)
 OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE,
 			2, OMAP3_MPU_SOURCE)
 OMAP_SYS_TIMER(3_secure)
+OMAP_SYS_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, 2, OMAP4_MPU_SOURCE)
+OMAP_SYS_TIMER(3_am33xx)
 #endif

 #ifdef CONFIG_ARCH_OMAP4
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index bb8a6c1..9d7cc3c 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -39,6 +39,7 @@ extern struct sys_timer omap1_timer;
 extern struct sys_timer omap2_timer;
 extern struct sys_timer omap3_timer;
 extern struct sys_timer omap3_secure_timer;
+extern struct sys_timer omap3_am33xx_timer;
 extern struct sys_timer omap4_timer;
 extern bool omap_32k_timer_init(void);
 extern int __init omap_init_clocksource_32k(void);
@@ -55,6 +56,7 @@ void omap3_init_early(void);	/* Do not use this one */
 void am35xx_init_early(void);
 void ti816x_init_early(void);
 void omap4430_init_early(void);
+void am33xx_init_early(void);

 extern int omap_dss_reset(struct omap_hwmod *);

--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [PATCH-V5 1/3] arm:omap:am33xx: Update common OMAP machine specific sources
@ 2011-12-02  6:43 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-12-02  6:43 UTC (permalink / raw)
  To: linux-omap
  Cc: tony, khilman, linux-arm-kernel, paul, Afzal Mohammed, Vaibhav Hiremath

From: Afzal Mohammed <afzal@ti.com>

This patch updates the common machine specific source files for
support for AM33XX/AM335x with cpu type, macros for identification of
AM33XX/AM335X device.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/clock3xxx_data.c       |    3 +++
 arch/arm/mach-omap2/common.c               |   21 +++++++++++++++++++++
 arch/arm/mach-omap2/id.c                   |    6 ++++++
 arch/arm/mach-omap2/io.c                   |   24 ++++++++++++++++++++++++
 arch/arm/mach-omap2/serial.c               |    4 ++--
 arch/arm/plat-omap/include/plat/am33xx.h   |   25 +++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h   |    2 ++
 arch/arm/plat-omap/include/plat/hardware.h |    1 +
 arch/arm/plat-omap/include/plat/io.h       |   20 ++++++++++++++++++++
 arch/arm/plat-omap/include/plat/omap34xx.h |    2 ++
 arch/arm/plat-omap/io.c                    |    5 +++++
 11 files changed, 111 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/am33xx.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 5d0064a..c1ab6bc 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3517,6 +3517,9 @@ int __init omap3xxx_clk_init(void)
 	} else if (cpu_is_ti816x()) {
 		cpu_mask = RATE_IN_TI816X;
 		cpu_clkflg = CK_TI816X;
+	} else if (cpu_is_am33xx()) {
+		cpu_mask = RATE_IN_AM33XX;
+		cpu_clkflg = CK_AM33XX;
 	} else if (cpu_is_omap34xx()) {
 		if (omap_rev() == OMAP3430_REV_ES1_0) {
 			cpu_mask = RATE_IN_3430ES1;
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 110e5b9..16bac26 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -128,6 +128,27 @@ void __init omap2_set_globals_ti816x(void)
 {
 	__omap2_set_globals(&ti816x_globals);
 }
+
+#define AM33XX_TAP_BASE		(AM33XX_CTRL_BASE + \
+				TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals am33xx_globals = {
+	.class  = AM335X_CLASS,
+	.tap    = AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE),
+	.ctrl   = AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
+	.prm    = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
+	.cm     = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
+};
+
+void __init omap2_set_globals_am33xx(void)
+{
+	__omap2_set_globals(&am33xx_globals);
+}
+
+void __init am33xx_map_io(void)
+{
+	omapam33xx_map_common_io();
+}
 #endif

 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index f1784ee..37fe42f 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -340,6 +340,10 @@ static void __init omap3_check_revision(const char **cpu_rev)
 			break;
 		}
 		break;
+	case 0xb944:
+		omap_revision = AM335X_REV_ES1_0;
+		*cpu_rev = "1.0";
+		break;
 	default:
 		/* Unknown default to latest silicon rev as default */
 		omap_revision = OMAP3630_REV_ES1_2;
@@ -432,6 +436,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
 		cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
 	} else if (cpu_is_ti816x()) {
 		cpu_name = "TI816X";
+	} else if (cpu_is_am335x()) {
+		cpu_name =  "AM335X";
 	} else if (omap3_has_iva() && omap3_has_sgx()) {
 		/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
 		cpu_name = "OMAP3430/3530";
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index da9bc4a..74e84c6 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -183,7 +183,24 @@ static struct map_desc omapti816x_io_desc[] __initdata = {
 		.pfn		= __phys_to_pfn(L4_34XX_PHYS),
 		.length		= L4_34XX_SIZE,
 		.type		= MT_DEVICE
+	}
+};
+#endif
+
+#ifdef CONFIG_SOC_OMAPAM33XX
+static struct map_desc omapam33xx_io_desc[] __initdata = {
+	{
+		.virtual	= L4_34XX_VIRT,
+		.pfn		= __phys_to_pfn(L4_34XX_PHYS),
+		.length		= L4_34XX_SIZE,
+		.type		= MT_DEVICE
 	},
+	{
+		.virtual	= L4_WK_AM33XX_VIRT,
+		.pfn		= __phys_to_pfn(L4_WK_AM33XX_PHYS),
+		.length		= L4_WK_AM33XX_SIZE,
+		.type		= MT_DEVICE
+	}
 };
 #endif

@@ -270,6 +287,13 @@ void __init omapti816x_map_common_io(void)
 }
 #endif

+#ifdef CONFIG_SOC_OMAPAM33XX
+void __init omapam33xx_map_common_io(void)
+{
+	iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
+}
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 void __init omap44xx_map_common_io(void)
 {
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0dbd5a2..03fc153 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -464,7 +464,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 		mod_timer(&uart->timer, jiffies + uart->timeout);
 	omap_uart_smart_idle_enable(uart, 0);

-	if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
+	if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx())) {
 		u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
 		u32 wk_mask = 0;
 		u32 padconf = 0;
@@ -828,7 +828,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
 	}

 	/* Enable the MDR1 errata for OMAP3 */
-	if (cpu_is_omap34xx() && !cpu_is_ti816x())
+	if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx()))
 		uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
 }

diff --git a/arch/arm/plat-omap/include/plat/am33xx.h b/arch/arm/plat-omap/include/plat/am33xx.h
new file mode 100644
index 0000000..06c19bb
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/am33xx.h
@@ -0,0 +1,25 @@
+/*
+ * This file contains the address info for various AM33XX modules.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARCH_AM33XX_H
+#define __ASM_ARCH_AM33XX_H
+
+#define L4_SLOW_AM33XX_BASE	0x48000000
+
+#define AM33XX_SCM_BASE		0x44E10000
+#define AM33XX_CTRL_BASE	AM33XX_SCM_BASE
+#define AM33XX_PRCM_BASE	0x44E00000
+
+#endif /* __ASM_ARCH_AM33XX_H */
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 3ff3e36..bb8a6c1 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -82,6 +82,7 @@ void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
 void omap2_set_globals_ti816x(void);
+void omap2_set_globals_am33xx(void);

 /* These get called from omap2_set_globals_xxxx(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
@@ -92,6 +93,7 @@ void omap2_set_globals_prcm(struct omap_globals *);
 void omap242x_map_io(void);
 void omap243x_map_io(void);
 void omap3_map_io(void);
+void am33xx_map_io(void);
 void omap4_map_io(void);


diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
index e87efe1..e6521e1 100644
--- a/arch/arm/plat-omap/include/plat/hardware.h
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -287,5 +287,6 @@
 #include <plat/omap34xx.h>
 #include <plat/omap44xx.h>
 #include <plat/ti816x.h>
+#include <plat/am33xx.h>

 #endif	/* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 7f2969e..ffed821 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -73,6 +73,9 @@
 #define OMAP4_L3_IO_OFFSET	0xb4000000
 #define OMAP4_L3_IO_ADDRESS(pa)	IOMEM((pa) + OMAP4_L3_IO_OFFSET) /* L3 */

+#define AM33XX_L4_WK_IO_OFFSET	0xb5000000
+#define AM33XX_L4_WK_IO_ADDRESS(pa)	IOMEM((pa) + AM33XX_L4_WK_IO_OFFSET)
+
 #define OMAP4_L3_PER_IO_OFFSET	0xb1100000
 #define OMAP4_L3_PER_IO_ADDRESS(pa)	IOMEM((pa) + OMAP4_L3_PER_IO_OFFSET)

@@ -154,6 +157,15 @@
 #define L4_34XX_SIZE		SZ_4M   /* 1MB of 128MB used, want 1MB sect */

 /*
+ * ----------------------------------------------------------------------------
+ * AM33XX specific IO mapping
+ * ----------------------------------------------------------------------------
+ */
+#define L4_WK_AM33XX_PHYS	L4_WK_AM33XX_BASE
+#define L4_WK_AM33XX_VIRT	(L4_WK_AM33XX_PHYS + AM33XX_L4_WK_IO_OFFSET)
+#define L4_WK_AM33XX_SIZE	SZ_4M   /* 1MB of 128MB used, want 1MB sect */
+
+/*
  * Need to look at the Size 4M for L4.
  * VPOM3430 was not working for Int controller
  */
@@ -316,6 +328,14 @@ static inline void omapti816x_map_common_io(void)
 }
 #endif

+#ifdef CONFIG_SOC_OMAPAM33XX
+extern void omapam33xx_map_common_io(void);
+#else
+static inline void omapam33xx_map_common_io(void)
+{
+}
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 extern void omap44xx_map_common_io(void);
 #else
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h
index b9e8588..0d818ac 100644
--- a/arch/arm/plat-omap/include/plat/omap34xx.h
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -35,6 +35,8 @@
 #define L4_EMU_34XX_BASE	0x54000000
 #define L3_34XX_BASE		0x68000000

+#define L4_WK_AM33XX_BASE	0x44C00000
+
 #define OMAP3430_32KSYNCT_BASE	0x48320000
 #define OMAP3430_CM_BASE	0x48004800
 #define OMAP3430_PRM_BASE	0x48306800
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index 333871f..14c421a 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -94,6 +94,11 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
 	if (cpu_is_ti816x()) {
 		if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
 			return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
+	} else if (cpu_is_am33xx()) {
+		if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
+			return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
+		if (BETWEEN(p, L4_WK_AM33XX_PHYS, L4_WK_AM33XX_SIZE))
+			return XLATE(p, L4_WK_AM33XX_PHYS, L4_WK_AM33XX_VIRT);
 	} else if (cpu_is_omap34xx()) {
 		if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
 			return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [PATCH-V5 0/3] Introducing TI's New SoC/board AM335XEVM
@ 2011-12-02  6:43 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-12-02  6:43 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, khilman, linux-arm-kernel, paul, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

This patch set adds support for AM335x device having
Cortex-A8 MPU.

Official website - http://www.ti.com/product/am3359

AM335X is treated as another OMAP3 variant, where,
along with existing cpu class OMAP34XX, new cpu class AM33XX is created
and the respective type is AM335X, which is newly added device in
the family.
This means, cpu_is_omap34xx(), cpu_is_am33xx() and
cpu_is_am335x() checks return success for AM335X.

Also, I have validated OMAP3 boot test with this patch-series on
OMAP3EVM.

Changes from V4:
	- Patches have been reviewed by Kevin Hilman.
	- As per Kevin Hilman's comments updated comment in debug-macro.S,
	  for AM33XX.

Changes from V3:
	- Common platform patch has already been accepted and available
	  under linux-omap/soc and linux-omap/master branch.
  	- Clean-up where cpu_is_xxxx instances are being used and patches
	  has been submitted to the list.
  	- These patches have been created on top of cleanup patches -
	    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg58276.html
	    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg58277.html
	- Based on Tony's request, rebased patches against linux-omap/fixes
	  (+ common platform patch).

Changes from V2(RFC):
	- Rebased against Paul's OMAP_CHIP* cleanup patches
	    git://git.pwsan.com/linux-2.6_omap_chip_remove_cleanup_3.2

Changes from V1(RFC):
	- Created separate cpu/SoC class for AM33XX family of devices,
	  due to all known facts. This is been mentioned in main-chain
	    https://patchwork.kernel.org/patch/1056312/
	- BUG Fix in debug-macro.S, which was leading to build failure.
	    https://patchwork.kernel.org/patch/1056302/

Afzal Mohammed (3):
  arm:omap:am33xx: Update common OMAP machine specific sources
  arm:omap:am33xx: Add AM335XEVM machine support
  arm:omap:am33xx: Add low level debugging support

 arch/arm/mach-omap2/Kconfig                    |    5 ++++
 arch/arm/mach-omap2/Makefile                   |    1 +
 arch/arm/mach-omap2/board-am3517evm.c          |   21 ++++++++++++++++
 arch/arm/mach-omap2/clock3xxx_data.c           |    3 ++
 arch/arm/mach-omap2/common.c                   |   21 ++++++++++++++++
 arch/arm/mach-omap2/id.c                       |    6 ++++
 arch/arm/mach-omap2/include/mach/debug-macro.S |   17 ++++++++++++-
 arch/arm/mach-omap2/io.c                       |   31 ++++++++++++++++++++++++
 arch/arm/mach-omap2/serial.c                   |    4 +-
 arch/arm/mach-omap2/timer.c                    |    2 +
 arch/arm/plat-omap/include/plat/am33xx.h       |   25 +++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h       |    4 +++
 arch/arm/plat-omap/include/plat/hardware.h     |    1 +
 arch/arm/plat-omap/include/plat/io.h           |   20 +++++++++++++++
 arch/arm/plat-omap/include/plat/omap34xx.h     |    2 +
 arch/arm/plat-omap/include/plat/serial.h       |    4 +++
 arch/arm/plat-omap/include/plat/uncompress.h   |    6 ++++
 arch/arm/plat-omap/io.c                        |    5 ++++
 18 files changed, 175 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/am33xx.h


^ permalink raw reply	[flat|nested] 270+ messages in thread
* [PATCH-V3 4/4] arm:omap:am33xx: Add low level debugging support
@ 2011-09-20 14:32 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-09-20 14:32 UTC (permalink / raw)
  To: linux-omap
  Cc: khilman, paul, tony, linux-arm-kernel, Afzal Mohammed, Vaibhav Hiremath

From: Afzal Mohammed <afzal@ti.com>

Add support for low level debugging on AM335X EVM (AM33XX family).
Currently only support for UART1 console, which is used on AM335X EVM
is added.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 arch/arm/mach-omap2/include/mach/debug-macro.S |   22 ++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/serial.h       |    4 ++++
 arch/arm/plat-omap/include/plat/uncompress.h   |    6 ++++++
 3 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 48adfe9..f649973 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -78,6 +78,8 @@ omap_uart_lsr:	.word	0
 		beq	82f			@ configure UART2
 		cmp	\rp, #TI816XUART3	@ ti816x UART offsets different
 		beq	83f			@ configure UART3
+		cmp	\rp, #AM33XXUART1	@ AM33XX UART offsets different
+		beq	84f			@ configure UART1
 		cmp	\rp, #ZOOM_UART		@ only on zoom2/3
 		beq	95f			@ configure ZOOM_UART

@@ -106,6 +108,9 @@ omap_uart_lsr:	.word	0
 		b	98f
 83:		mov	\rp, #UART_OFFSET(TI816X_UART3_BASE)
 		b	98f
+84:		ldr	\rp, =AM33XX_UART1_BASE
+		and	\rp, \rp, #0x00ffffff
+		b	97f
 95:		ldr	\rp, =ZOOM_UART_BASE
 		mrc	p15, 0, \rv, c1, c0
 		tst	\rv, #1			@ MMU enabled?
@@ -121,6 +126,23 @@ omap_uart_lsr:	.word	0
 		b	10b

 		/* Store both phys and virt address for the uart */
+97:		add	\rp, \rp, #0x44000000	@ phys base
+		mrc	p15, 0, \rv, c1, c0
+		tst	\rv, #1			@ MMU enabled?
+		ldreq	\rv, =omap_uart_v2p(omap_uart_phys)	@ MMU disabled
+		ldrne	\rv, =omap_uart_phys	@ MMU enabled
+		str	\rp, [\rv, #0]
+		sub	\rp, \rp, #0x44000000	@ phys base
+		add	\rp, \rp, #0xf9000000	@ virt base
+		add	\rv, \rv, #4		@ omap_uart_virt
+		str	\rp, [\rv, #0]
+		mov	\rp, #(UART_LSR << OMAP_PORT_SHIFT)
+		add	\rv, \rv, #4		@ omap_uart_lsr
+		str	\rp, [\rv, #0]
+
+		b	10b
+
+		/* Store both phys and virt address for the uart */
 98:		add	\rp, \rp, #0x48000000	@ phys base
 		mrc	p15, 0, \rv, c1, c0
 		tst	\rv, #1			@ MMU enabled?
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index de3b10c..ad19377 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -59,6 +59,9 @@
 /* AM3505/3517 UART4 */
 #define AM35XX_UART4_BASE	0x4809E000	/* Only on AM3505/3517 */

+/* AM33XX serial port */
+#define AM33XX_UART1_BASE	0x44E09000
+
 /* External port on Zoom2/3 */
 #define ZOOM_UART_BASE		0x10000000
 #define ZOOM_UART_VIRT		0xfa400000
@@ -92,6 +95,7 @@
 #define TI816XUART1		81
 #define TI816XUART2		82
 #define TI816XUART3		83
+#define AM33XXUART1		84
 #define ZOOM_UART		95		/* Only on zoom2/3 */

 /* This is only used by 8250.c for omap1510 */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index a067484..bd1e051 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -97,6 +97,10 @@ static inline void flush(void)
 	_DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,	\
 		TI816XUART##p)

+#define DEBUG_LL_AM33XX(p, mach)					\
+	_DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT,	\
+		AM33XXUART##p)
+
 static inline void __arch_decomp_setup(unsigned long arch_id)
 {
 	int port = 0;
@@ -173,6 +177,8 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 		/* TI8168 base boards using UART3 */
 		DEBUG_LL_TI816X(3, ti8168evm);

+		/* AM33XX base boards using UART1 */
+		DEBUG_LL_AM33XX(1, am335xevm);
 	} while (0);
 }

--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [PATCH-V3 3/4] arm:omap:am33xx: Create board support and enable build for AM335XEVM
@ 2011-09-20 14:32 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-09-20 14:32 UTC (permalink / raw)
  To: linux-omap
  Cc: khilman, paul, tony, linux-arm-kernel, Afzal Mohammed, Vaibhav Hiremath

From: Afzal Mohammed <afzal@ti.com>

This patch adds minimal support and build configuration for
AM335X EVM.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 arch/arm/mach-omap2/Kconfig           |    5 +++
 arch/arm/mach-omap2/Makefile          |    2 +
 arch/arm/mach-omap2/board-am335xevm.c |   57 +++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-am335xevm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 12ab835..8533008 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -315,6 +315,11 @@ config MACH_TI8168EVM
 	depends on SOC_OMAPTI816X
 	default y

+config MACH_AM335XEVM
+	bool "AM335X Evaluation Module"
+	depends on SOC_OMAPAM33XX
+	default y
+
 config MACH_OMAP_4430SDP
 	bool "OMAP 4430 SDP board"
 	default y
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5a6fe73..47d8de1 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -259,6 +259,8 @@ obj-$(CONFIG_MACH_CRANEBOARD)		+= board-am3517crane.o
 obj-$(CONFIG_MACH_SBC3530)		+= board-omap3stalker.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_TI8168EVM)		+= board-ti8168evm.o
+obj-$(CONFIG_MACH_AM335XEVM)		+= board-am335xevm.o
+
 # Platform specific device init code
 usbfs-$(CONFIG_ARCH_OMAP_OTG)		:= usb-fs.o
 obj-y					+= $(usbfs-m) $(usbfs-y)
diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
new file mode 100644
index 0000000..afa3f26
--- /dev/null
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -0,0 +1,57 @@
+/*
+ * Code for AM335X EVM.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <mach/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <plat/irqs.h>
+#include <plat/board.h>
+#include <plat/common.h>
+
+static struct omap_board_config_kernel am335x_evm_config[] __initdata = {
+};
+
+static void __init am335x_init_early(void)
+{
+	omap2_init_common_infrastructure();
+	omap2_init_common_devices(NULL, NULL);
+}
+
+static void __init am335x_evm_init(void)
+{
+	omap_serial_init();
+	omap_board_config = am335x_evm_config;
+	omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
+}
+
+static void __init am335x_evm_map_io(void)
+{
+	omap2_set_globals_am33xx();
+	omapam33xx_map_common_io();
+}
+
+MACHINE_START(AM335XEVM, "am335xevm")
+	/* Maintainer: Texas Instruments */
+	.boot_params	= 0x80000100,
+	.map_io		= am335x_evm_map_io,
+	.init_early	= am335x_init_early,
+	.init_irq	= ti816x_init_irq,
+	.timer		= &omap3_timer,
+	.init_machine	= am335x_evm_init,
+MACHINE_END
--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [PATCH-V3 2/4] arm:omap:am33xx: Update common OMAP machine specific sources
@ 2011-09-20 14:32 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-09-20 14:32 UTC (permalink / raw)
  To: linux-omap
  Cc: khilman, paul, tony, linux-arm-kernel, Afzal Mohammed, Vaibhav Hiremath

From: Afzal Mohammed <afzal@ti.com>

This patch updates the common machine specific source files for
support for AM33XX/AM335x with cpu type, macros for identification of
AM33XX/AM335X device.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 arch/arm/mach-omap2/clock3xxx_data.c       |    6 +++++-
 arch/arm/mach-omap2/common.c               |   16 ++++++++++++++++
 arch/arm/mach-omap2/id.c                   |   10 ++++++++--
 arch/arm/mach-omap2/io.c                   |   25 +++++++++++++++++++++++++
 arch/arm/mach-omap2/serial.c               |    6 +++---
 arch/arm/plat-omap/include/plat/am33xx.h   |   25 +++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h   |    1 +
 arch/arm/plat-omap/include/plat/hardware.h |    1 +
 arch/arm/plat-omap/include/plat/io.h       |   20 ++++++++++++++++++++
 arch/arm/plat-omap/include/plat/omap34xx.h |    2 ++
 arch/arm/plat-omap/io.c                    |    5 +++++
 11 files changed, 111 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/plat/am33xx.h

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index dadb8c6..2ee472c 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3493,6 +3493,9 @@ int __init omap3xxx_clk_init(void)
 	} else if (cpu_is_ti816x()) {
 		cpu_mask = RATE_IN_TI816X;
 		cpu_clkflg = CK_TI816X;
+	} else if (cpu_is_am33xx()) {
+		cpu_mask = RATE_IN_AM33XX;
+		cpu_clkflg = CK_AM33XX;
 	} else if (cpu_is_omap34xx()) {
 		if (omap_rev() == OMAP3430_REV_ES1_0) {
 			cpu_mask = RATE_IN_3430ES1;
@@ -3576,7 +3579,8 @@ int __init omap3xxx_clk_init(void)
 	 * Lock DPLL5 -- here only until other device init code can
 	 * handle this
 	 */
-	if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
+	if (!cpu_is_ti816x() && !cpu_is_am33xx() &&
+			(omap_rev() >= OMAP3430_REV_ES2_0))
 		omap3_clk_lock_dpll5();

 	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 3f20cbb..395a9b6 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -119,6 +119,22 @@ void __init omap2_set_globals_ti816x(void)
 {
 	__omap2_set_globals(&ti816x_globals);
 }
+
+#define AM33XX_TAP_BASE		(AM33XX_CTRL_BASE + \
+				TI816X_CONTROL_DEVICE_ID - 0x204)
+
+static struct omap_globals am33xx_globals = {
+	.class  = OMAP343X_CLASS,
+	.tap    = OMAP2_L4_IO_ADDRESS(AM33XX_TAP_BASE),
+	.ctrl   = AM33XX_CTRL_BASE,
+	.prm    = AM33XX_PRCM_BASE,
+	.cm     = AM33XX_PRCM_BASE,
+};
+
+void __init omap2_set_globals_am33xx(void)
+{
+	__omap2_set_globals(&am33xx_globals);
+}
 #endif

 #if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index d27daf9..540b6f1 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -337,6 +337,10 @@ static void __init omap3_check_revision(const char **cpu_rev)
 			break;
 		}
 		break;
+	case 0xb944:
+		omap_revision = AM335X_REV_ES1_0;
+		*cpu_rev = "1.0";
+		break;
 	default:
 		/* Unknown default to latest silicon rev as default */
 		omap_revision = OMAP3630_REV_ES1_2;
@@ -429,6 +433,8 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
 		cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
 	} else if (cpu_is_ti816x()) {
 		cpu_name = "TI816X";
+	} else if (cpu_is_am335x()) {
+		cpu_name =  "AM335X";
 	} else if (omap3_has_iva() && omap3_has_sgx()) {
 		/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
 		cpu_name = "OMAP3430/3530";
@@ -469,8 +475,8 @@ void __init omap2_check_revision(void)
 	} else if (cpu_is_omap34xx()) {
 		omap3_check_revision(&cpu_rev);

-		/* TI816X doesn't have feature register */
-		if (!cpu_is_ti816x())
+		/* TI816X/AM335X doesn't have feature register */
+		if (!cpu_is_ti816x() && !cpu_is_am33xx())
 			omap3_check_features();
 		else
 			ti816x_check_features();
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 40b6d47..ccd50de 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -182,7 +182,24 @@ static struct map_desc omapti816x_io_desc[] __initdata = {
 		.pfn		= __phys_to_pfn(L4_34XX_PHYS),
 		.length		= L4_34XX_SIZE,
 		.type		= MT_DEVICE
+	}
+};
+#endif
+
+#ifdef CONFIG_SOC_OMAPAM33XX
+static struct map_desc omapam33xx_io_desc[] __initdata = {
+	{
+		.virtual	= L4_34XX_VIRT,
+		.pfn		= __phys_to_pfn(L4_34XX_PHYS),
+		.length		= L4_34XX_SIZE,
+		.type		= MT_DEVICE
 	},
+	{
+		.virtual	= L4_WK_AM33XX_VIRT,
+		.pfn		= __phys_to_pfn(L4_WK_AM33XX_PHYS),
+		.length		= L4_WK_AM33XX_SIZE,
+		.type		= MT_DEVICE
+	}
 };
 #endif

@@ -286,6 +303,14 @@ void __init omapti816x_map_common_io(void)
 }
 #endif

+#ifdef CONFIG_SOC_OMAPAM33XX
+void __init omapam33xx_map_common_io(void)
+{
+	iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
+	_omap2_map_common_io();
+}
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 void __init omap44xx_map_common_io(void)
 {
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 466fc72..b7782ee 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -486,7 +486,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 		mod_timer(&uart->timer, jiffies + uart->timeout);
 	omap_uart_smart_idle_enable(uart, 0);

-	if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
+	if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx())) {
 		u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
 		u32 wk_mask = 0;
 		u32 padconf = 0;
@@ -768,7 +768,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
 	 */
 	uart->regshift = p->regshift;
 	uart->membase = p->membase;
-	if (cpu_is_omap44xx() || cpu_is_ti816x())
+	if (cpu_is_omap44xx() || cpu_is_ti816x() || cpu_is_am33xx())
 		uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
 	else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
 			>= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
@@ -851,7 +851,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
 	}

 	/* Enable the MDR1 errata for OMAP3 */
-	if (cpu_is_omap34xx() && !cpu_is_ti816x())
+	if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx()))
 		uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
 }

diff --git a/arch/arm/plat-omap/include/plat/am33xx.h b/arch/arm/plat-omap/include/plat/am33xx.h
new file mode 100644
index 0000000..06c19bb
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/am33xx.h
@@ -0,0 +1,25 @@
+/*
+ * This file contains the address info for various AM33XX modules.
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARCH_AM33XX_H
+#define __ASM_ARCH_AM33XX_H
+
+#define L4_SLOW_AM33XX_BASE	0x48000000
+
+#define AM33XX_SCM_BASE		0x44E10000
+#define AM33XX_CTRL_BASE	AM33XX_SCM_BASE
+#define AM33XX_PRCM_BASE	0x44E00000
+
+#endif /* __ASM_ARCH_AM33XX_H */
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 4564cc6..6827e34 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -67,6 +67,7 @@ void omap2_set_globals_243x(void);
 void omap2_set_globals_3xxx(void);
 void omap2_set_globals_443x(void);
 void omap2_set_globals_ti816x(void);
+void omap2_set_globals_am33xx(void);

 /* These get called from omap2_set_globals_xxxx(), do not call these */
 void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
index e87efe1..e6521e1 100644
--- a/arch/arm/plat-omap/include/plat/hardware.h
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -287,5 +287,6 @@
 #include <plat/omap34xx.h>
 #include <plat/omap44xx.h>
 #include <plat/ti816x.h>
+#include <plat/am33xx.h>

 #endif	/* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index d72ec85..0c54a00 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -73,6 +73,9 @@
 #define OMAP4_L3_IO_OFFSET	0xb4000000
 #define OMAP4_L3_IO_ADDRESS(pa)	IOMEM((pa) + OMAP4_L3_IO_OFFSET) /* L3 */

+#define AM33XX_L4_WK_IO_OFFSET	0xb5000000
+#define AM33XX_L4_WK_IO_ADDRESS(pa)	IOMEM((pa) + AM33XX_L4_WK_IO_OFFSET)
+
 #define OMAP4_L3_PER_IO_OFFSET	0xb1100000
 #define OMAP4_L3_PER_IO_ADDRESS(pa)	IOMEM((pa) + OMAP4_L3_PER_IO_OFFSET)

@@ -154,6 +157,15 @@
 #define L4_34XX_SIZE		SZ_4M   /* 1MB of 128MB used, want 1MB sect */

 /*
+ * ----------------------------------------------------------------------------
+ * AM33XX specific IO mapping
+ * ----------------------------------------------------------------------------
+ */
+#define L4_WK_AM33XX_PHYS		L4_WK_AM33XX_BASE
+#define L4_WK_AM33XX_VIRT		(L4_WK_AM33XX_PHYS + AM33XX_L4_WK_IO_OFFSET)
+#define L4_WK_AM33XX_SIZE		SZ_4M   /* 1MB of 128MB used, want 1MB sect */
+
+/*
  * Need to look at the Size 4M for L4.
  * VPOM3430 was not working for Int controller
  */
@@ -291,6 +303,14 @@ static inline void omapti816x_map_common_io(void)
 }
 #endif

+#ifdef CONFIG_SOC_OMAPAM33XX
+extern void omapam33xx_map_common_io(void);
+#else
+static inline void omapam33xx_map_common_io(void)
+{
+}
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 extern void omap44xx_map_common_io(void);
 #else
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h
index b9e8588..0d818ac 100644
--- a/arch/arm/plat-omap/include/plat/omap34xx.h
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -35,6 +35,8 @@
 #define L4_EMU_34XX_BASE	0x54000000
 #define L3_34XX_BASE		0x68000000

+#define L4_WK_AM33XX_BASE	0x44C00000
+
 #define OMAP3430_32KSYNCT_BASE	0x48320000
 #define OMAP3430_CM_BASE	0x48004800
 #define OMAP3430_PRM_BASE	0x48306800
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index f1ecfa9..25a32b2 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -88,6 +88,11 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
 	if (cpu_is_ti816x()) {
 		if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
 			return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
+	} else if (cpu_is_am33xx()) {
+		if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
+			return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
+		if (BETWEEN(p, L4_WK_AM33XX_PHYS, L4_WK_AM33XX_SIZE))
+			return XLATE(p, L4_WK_AM33XX_PHYS, L4_WK_AM33XX_VIRT);
 	} else if (cpu_is_omap34xx()) {
 		if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
 			return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [PATCH-V3 1/4] arm:omap:am33xx: Update common omap platform files
@ 2011-09-20 14:32 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-09-20 14:32 UTC (permalink / raw)
  To: linux-omap
  Cc: khilman, paul, tony, linux-arm-kernel, Afzal Mohammed,
	Vaibhav Hiremath, Hemant Pedanekar

From: Afzal Mohammed <afzal@ti.com>

This patch updates the common platform files with AM335X device
support (AM33XX family).

The approach taken in this patch is,
AM33XX device will be considered as OMAP3 variant, and a separate
SoC class created for AM33XX family of devices with a subclass type
for AM335X device, which is newly added device in the family.

This means, cpu_is_omap34xx(), cpu_is_am33xx() and cpu_is_am335x()
checks will return success on AM335X device.
A kernel config option CONFIG_SOC_OMAPAM33XX is added under OMAP3
to include support for AM33XX build.

Also, cpu_mask and RATE_IN_XXX flags have crossed 8 bit hence
struct clksel_rate.flags, struct prcm_config.flags and cpu_mask
are changed to u16 from u8.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Hemant Pedanekar <hemantp@ti.com>
---
 arch/arm/mach-omap2/Kconfig                   |    5 +++++
 arch/arm/mach-omap2/clock.c                   |    2 +-
 arch/arm/mach-omap2/clock.h                   |    2 +-
 arch/arm/mach-omap2/opp2xxx.h                 |    2 +-
 arch/arm/plat-omap/include/plat/clkdev_omap.h |    1 +
 arch/arm/plat-omap/include/plat/clock.h       |    3 ++-
 arch/arm/plat-omap/include/plat/cpu.h         |   25 +++++++++++++++++++++++++
 7 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 57b66d5..12ab835 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -78,6 +78,11 @@ config SOC_OMAPTI816X
 	depends on ARCH_OMAP3
 	default y

+config SOC_OMAPAM33XX
+	bool "AM33XX support"
+	depends on ARCH_OMAP3
+	default y
+
 config OMAP_PACKAGE_ZAF
        bool

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 1f3481f..f57ed5b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -35,7 +35,7 @@
 #include "cm-regbits-24xx.h"
 #include "cm-regbits-34xx.h"

-u8 cpu_mask;
+u16 cpu_mask;

 /*
  * clkdm_control: if true, then when a clock is enabled in the
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 48ac568..687d3d3 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -130,7 +130,7 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
 			       const char *core_ck_name,
 			       const char *mpu_ck_name);

-extern u8 cpu_mask;
+extern u16 cpu_mask;

 extern const struct clkops clkops_omap2_dflt_wait;
 extern const struct clkops clkops_dummy;
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 8affc66..8fae534 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -51,7 +51,7 @@ struct prcm_config {
 	unsigned long cm_clksel2_pll;	/* dpllx1 or x2 out */
 	unsigned long cm_clksel_mdm;	/* modem dividers 2430 only */
 	unsigned long base_sdrc_rfr;	/* base refresh timing for a set */
-	unsigned char flags;
+	unsigned short flags;
 };


diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 387a963..6d84c0c 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -40,6 +40,7 @@ struct omap_clk {
 #define CK_443X		(1 << 11)
 #define CK_TI816X	(1 << 12)
 #define CK_446X		(1 << 13)
+#define CK_AM33XX	(1 << 14)	/* AM33xx specific clocks */


 #define CK_34XX		(CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 197ca03..168c54e 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -59,6 +59,7 @@ struct clkops {
 #define RATE_IN_4430		(1 << 5)
 #define RATE_IN_TI816X		(1 << 6)
 #define RATE_IN_4460		(1 << 7)
+#define RATE_IN_AM33XX		(1 << 8)

 #define RATE_IN_24XX		(RATE_IN_242X | RATE_IN_243X)
 #define RATE_IN_34XX		(RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
@@ -84,7 +85,7 @@ struct clkops {
 struct clksel_rate {
 	u32			val;
 	u8			div;
-	u8			flags;
+	u16			flags;
 };

 /**
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 2f90269..9f4d5c3 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -78,6 +78,14 @@ static inline int is_omap ##class (void)		\
 	return (GET_OMAP_CLASS == (id)) ? 1 : 0;	\
 }

+#define GET_AM_CLASS	((omap_rev() >> 24) & 0xff)
+
+#define IS_AM_CLASS(class, id)			\
+static inline int is_am ##class (void)		\
+{							\
+	return (GET_AM_CLASS == (id)) ? 1 : 0;	\
+}
+
 #define GET_OMAP_SUBCLASS	((omap_rev() >> 20) & 0x0fff)

 #define IS_OMAP_SUBCLASS(subclass, id)			\
@@ -92,12 +100,19 @@ static inline int is_ti ##subclass (void)		\
 	return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;	\
 }

+#define IS_AM_SUBCLASS(subclass, id)			\
+static inline int is_am ##subclass (void)		\
+{							\
+	return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;	\
+}
+
 IS_OMAP_CLASS(7xx, 0x07)
 IS_OMAP_CLASS(15xx, 0x15)
 IS_OMAP_CLASS(16xx, 0x16)
 IS_OMAP_CLASS(24xx, 0x24)
 IS_OMAP_CLASS(34xx, 0x34)
 IS_OMAP_CLASS(44xx, 0x44)
+IS_AM_CLASS(33xx, 0x33)

 IS_OMAP_SUBCLASS(242x, 0x242)
 IS_OMAP_SUBCLASS(243x, 0x243)
@@ -107,6 +122,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 IS_OMAP_SUBCLASS(446x, 0x446)

 IS_TI_SUBCLASS(816x, 0x816)
+IS_AM_SUBCLASS(335x, 0x335)

 #define cpu_is_omap7xx()		0
 #define cpu_is_omap15xx()		0
@@ -117,6 +133,8 @@ IS_TI_SUBCLASS(816x, 0x816)
 #define cpu_is_omap34xx()		0
 #define cpu_is_omap343x()		0
 #define cpu_is_ti816x()			0
+#define cpu_is_am33xx()			0
+#define cpu_is_am335x()			0
 #define cpu_is_omap44xx()		0
 #define cpu_is_omap443x()		0
 #define cpu_is_omap446x()		0
@@ -323,6 +341,8 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3505
 # undef cpu_is_omap3517
 # undef cpu_is_ti816x
+# undef cpu_is_am33xx
+# undef cpu_is_am335x
 # define cpu_is_omap3430()		is_omap3430()
 # define cpu_is_omap3503()		(cpu_is_omap3430() &&		\
 						(!omap3_has_iva()) &&	\
@@ -340,6 +360,8 @@ IS_OMAP_TYPE(3517, 0x3517)
 # undef cpu_is_omap3630
 # define cpu_is_omap3630()		is_omap363x()
 # define cpu_is_ti816x()		is_ti816x()
+# define cpu_is_am33xx()		is_am33xx()
+# define cpu_is_am335x()		is_am335x()
 #endif

 # if defined(CONFIG_ARCH_OMAP4)
@@ -386,6 +408,9 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define TI8168_REV_ES1_0	TI816X_CLASS
 #define TI8168_REV_ES1_1	(TI816X_CLASS | (0x1 << 8))

+#define AM335X_CLASS		0x33500034
+#define AM335X_REV_ES1_0	AM335X_CLASS
+
 #define OMAP443X_CLASS		0x44300044
 #define OMAP4430_REV_ES1_0	(OMAP443X_CLASS | (0x10 << 8))
 #define OMAP4430_REV_ES2_0	(OMAP443X_CLASS | (0x20 << 8))
--
1.7.0.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* [RFC PATCH-V2 0/4] Introducing TI's New SoC/board AM335XEVM
@ 2011-08-29 12:46 ` hvaibhav at ti.com
  0 siblings, 0 replies; 270+ messages in thread
From: hvaibhav @ 2011-08-29 12:46 UTC (permalink / raw)
  To: linux-omap; +Cc: tony, khilman, paul, linux-arm-kernel, Vaibhav Hiremath

From: Vaibhav Hiremath <hvaibhav@ti.com>

This patch set adds support for AM335x device having
Cortex-A8 MPU.

AM335X is treated as another OMAP3 variant, where,
along with existing cpu class OMAP34XX, new cpu class AM33XX is created
and the respective type is AM335X, which is newly added device in the family.
This means, cpu_is_omap34xx(), cpu_is_am33xx() and
cpu_is_am335x() checks return success for AM335X.

Currently submitting this patch series as a RFC (V2), to initiate the
discussion on the approach we have chosen for AM335x device support.
Based on the feedback, will submit the final version of patch series
immediately.

This patch series is created on top of linux-omap/master and
Hemant's TI814X patches submitted recently.

http://www.mail-archive.com/linux-omap@vger.kernel.org/msg53457.html

Also, I have validated OMAP3 boot test with this patch-series on OMAP3EVM.

Changes from V1:
  - Created separate cpu/SoC class for AM33XX family of devices,
    due to all known facts. This is been mentioned in main-chain

      https://patchwork.kernel.org/patch/1056312/

  - BUG Fix in debug-macro.S, which was leading to build failure.

      https://patchwork.kernel.org/patch/1056302/

Afzal Mohammed (4):
  AM335X: Update common omap platform files
  AM335X: Update common OMAP machine specific sources
  AM335X: Create board support and enable build for AM335XEVM
  AM335X: Add low level debugging support

 arch/arm/mach-omap2/Kconfig                    |   10 ++++
 arch/arm/mach-omap2/Makefile                   |    2 +
 arch/arm/mach-omap2/board-am335xevm.c          |   57 ++++++++++++++++++++++++
 arch/arm/mach-omap2/clock3xxx_data.c           |    3 +
 arch/arm/mach-omap2/common.c                   |   16 +++++++
 arch/arm/mach-omap2/id.c                       |    6 +++
 arch/arm/mach-omap2/include/mach/debug-macro.S |   22 +++++++++
 arch/arm/mach-omap2/io.c                       |   25 ++++++++++
 arch/arm/plat-omap/include/plat/am33xx.h       |   25 ++++++++++
 arch/arm/plat-omap/include/plat/clkdev_omap.h  |    1 +
 arch/arm/plat-omap/include/plat/clock.h        |    1 +
 arch/arm/plat-omap/include/plat/common.h       |    1 +
 arch/arm/plat-omap/include/plat/cpu.h          |   23 ++++++++++
 arch/arm/plat-omap/include/plat/hardware.h     |    1 +
 arch/arm/plat-omap/include/plat/io.h           |   20 ++++++++
 arch/arm/plat-omap/include/plat/omap34xx.h     |    2 +
 arch/arm/plat-omap/include/plat/serial.h       |    4 ++
 arch/arm/plat-omap/include/plat/uncompress.h   |    6 +++
 arch/arm/plat-omap/io.c                        |    3 +
 19 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-am335xevm.c
 create mode 100644 arch/arm/plat-omap/include/plat/am33xx.h


^ permalink raw reply	[flat|nested] 270+ messages in thread
* [PATCH (V2)] TVP514x: Migration to sub-device framework
@ 2009-05-06 18:31 hvaibhav
  2009-06-14 10:14 ` Hans Verkuil
  0 siblings, 1 reply; 270+ messages in thread
From: hvaibhav @ 2009-05-06 18:31 UTC (permalink / raw)
  To: linux-media
  Cc: linux-omap, davinci-linux-open-source, Vaibhav Hiremath,
	Brijesh Jadav, Hardik Shah

From: Vaibhav Hiremath <hvaibhav@ti.com>

This patch converts TVP514x driver to sub-device framework
from V4L2-int framework.

NOTE: Please note that this patch has not been tested on any board,
      only compilation/build tested.

Changes (From Previous post):
    - Added static function to_decoder which will replace all
      container_of instances.
    - "unsigned int" replaced with "u32".
    - Cleaned up for line indentation.
    - pdata initialized, was missing in earlier patch.

TODO:
    - Add support for some basic video/core functionality like,
        .g_chip_ident
	.reset
	.g_input_status
    - Migration master driver to validate this driver.
    - validate on Davinci and OMAP boards.

Reviewed By "Hans Verkuil".

Signed-off-by: Brijesh Jadav <brijesh.j@ti.com>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
 drivers/media/video/tvp514x.c      |  854 ++++++++++++++----------------------
 drivers/media/video/tvp514x_regs.h |   10 -
 include/media/tvp514x.h            |    4 -
 3 files changed, 330 insertions(+), 538 deletions(-)

diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 4262e60..12b49ad 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -31,7 +31,11 @@
 #include <linux/i2c.h>
 #include <linux/delay.h>
 #include <linux/videodev2.h>
-#include <media/v4l2-int-device.h>
+
+#include <media/v4l2-device.h>
+#include <media/v4l2-common.h>
+#include <media/v4l2-chip-ident.h>
+#include <media/v4l2-i2c-drv.h>
 #include <media/tvp514x.h>

 #include "tvp514x_regs.h"
@@ -49,13 +53,13 @@ static int debug;
 module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");

-#define dump_reg(client, reg, val)				\
+#define dump_reg(sd, reg, val)				\
 	do {							\
-		val = tvp514x_read_reg(client, reg);		\
-		v4l_info(client, "Reg(0x%.2X): 0x%.2X\n", reg, val); \
+		val = tvp514x_read_reg(sd, reg);		\
+		v4l2_info(sd, "Reg(0x%.2X): 0x%.2X\n", reg, val); \
 	} while (0)

-/**
+/*
  * enum tvp514x_std - enum for supported standards
  */
 enum tvp514x_std {
@@ -64,15 +68,7 @@ enum tvp514x_std {
 	STD_INVALID
 };

-/**
- * enum tvp514x_state - enum for different decoder states
- */
-enum tvp514x_state {
-	STATE_NOT_DETECTED,
-	STATE_DETECTED
-};
-
-/**
+/*
  * struct tvp514x_std_info - Structure to store standard informations
  * @width: Line width in pixels
  * @height:Number of active lines
@@ -87,35 +83,29 @@ struct tvp514x_std_info {
 };

 static struct tvp514x_reg tvp514x_reg_list_default[0x40];
-/**
+/*
  * struct tvp514x_decoder - TVP5146/47 decoder object
- * @v4l2_int_device: Slave handle
- * @tvp514x_slave: Slave pointer which is used by @v4l2_int_device
+ * @sd: Subdevice Slave handle
  * @tvp514x_regs: copy of hw's regs with preset values.
  * @pdata: Board specific
- * @client: I2C client data
- * @id: Entry from I2C table
  * @ver: Chip version
- * @state: TVP5146/47 decoder state - detected or not-detected
+ * @state: TVP5146/47 decoder state - enabled or disabled.
  * @pix: Current pixel format
  * @num_fmts: Number of formats
  * @fmt_list: Format list
  * @current_std: Current standard
  * @num_stds: Number of standards
  * @std_list: Standards list
- * @route: input and output routing at chip level
+ * @input: Input routing at chip level
+ * @output: Output routing at chip level
  */
 struct tvp514x_decoder {
-	struct v4l2_int_device v4l2_int_device;
-	struct v4l2_int_slave tvp514x_slave;
+	struct v4l2_subdev sd;
 	struct tvp514x_reg tvp514x_regs[ARRAY_SIZE(tvp514x_reg_list_default)];
 	const struct tvp514x_platform_data *pdata;
-	struct i2c_client *client;
-
-	struct i2c_device_id *id;

 	int ver;
-	enum tvp514x_state state;
+	int state;

 	struct v4l2_pix_format pix;
 	int num_fmts;
@@ -124,8 +114,11 @@ struct tvp514x_decoder {
 	enum tvp514x_std current_std;
 	int num_stds;
 	struct tvp514x_std_info *std_list;
-
-	struct v4l2_routing route;
+	/*
+	 * Input and Output Routing parameters
+	 */
+	u32 input;
+	u32 output;
 };

 /* TVP514x default register values */
@@ -191,7 +184,8 @@ static struct tvp514x_reg tvp514x_reg_list_default[] = {
 	{TOK_TERM, 0, 0},
 };

-/* List of image formats supported by TVP5146/47 decoder
+/*
+ * List of image formats supported by TVP5146/47 decoder
  * Currently we are using 8 bit mode only, but can be
  * extended to 10/20 bit mode.
  */
@@ -240,35 +234,27 @@ static struct tvp514x_std_info tvp514x_std_list[] = {
 	},
 	/* Standard: need to add for additional standard */
 };
-/*
- * Control structure for Auto Gain
- *     This is temporary data, will get replaced once
- *     v4l2_ctrl_query_fill supports it.
- */
-static const struct v4l2_queryctrl tvp514x_autogain_ctrl = {
-	.id = V4L2_CID_AUTOGAIN,
-	.name = "Gain, Automatic",
-	.type = V4L2_CTRL_TYPE_BOOLEAN,
-	.minimum = 0,
-	.maximum = 1,
-	.step = 1,
-	.default_value = 1,
-};

+
+static inline struct tvp514x_decoder *to_decoder(struct v4l2_subdev *sd)
+{
+	return container_of(sd, struct tvp514x_decoder, sd);
+}
 /*
  * Read a value from a register in an TVP5146/47 decoder device.
  * Returns value read if successful, or non-zero (-1) otherwise.
  */
-static int tvp514x_read_reg(struct i2c_client *client, u8 reg)
+static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg)
 {
-	int err;
-	int retry = 0;
+	int err, retry = 0;
+	struct i2c_client *client = v4l2_get_subdevdata(sd);
+
 read_again:

 	err = i2c_smbus_read_byte_data(client, reg);
 	if (err == -1) {
 		if (retry <= I2C_RETRY_COUNT) {
-			v4l_warn(client, "Read: retry ... %d\n", retry);
+			v4l2_warn(sd, "Read: retry ... %d\n", retry);
 			retry++;
 			msleep_interruptible(10);
 			goto read_again;
@@ -282,16 +268,17 @@ read_again:
  * Write a value to a register in an TVP5146/47 decoder device.
  * Returns zero if successful, or non-zero otherwise.
  */
-static int tvp514x_write_reg(struct i2c_client *client, u8 reg, u8 val)
+static int tvp514x_write_reg(struct v4l2_subdev *sd, u8 reg, u8 val)
 {
-	int err;
-	int retry = 0;
+	int err, retry = 0;
+	struct i2c_client *client = v4l2_get_subdevdata(sd);
+
 write_again:

 	err = i2c_smbus_write_byte_data(client, reg, val);
 	if (err) {
 		if (retry <= I2C_RETRY_COUNT) {
-			v4l_warn(client, "Write: retry ... %d\n", retry);
+			v4l2_warn(sd, "Write: retry ... %d\n", retry);
 			retry++;
 			msleep_interruptible(10);
 			goto write_again;
@@ -311,7 +298,7 @@ write_again:
  * reglist - list of registers to be written
  * Returns zero if successful, or non-zero otherwise.
  */
-static int tvp514x_write_regs(struct i2c_client *client,
+static int tvp514x_write_regs(struct v4l2_subdev *sd,
 			      const struct tvp514x_reg reglist[])
 {
 	int err;
@@ -326,9 +313,9 @@ static int tvp514x_write_regs(struct i2c_client *client,
 		if (next->token == TOK_SKIP)
 			continue;

-		err = tvp514x_write_reg(client, next->reg, (u8) next->val);
+		err = tvp514x_write_reg(sd, next->reg, (u8) next->val);
 		if (err) {
-			v4l_err(client, "Write failed. Err[%d]\n", err);
+			v4l2_err(sd, "Write failed. Err[%d]\n", err);
 			return err;
 		}
 	}
@@ -339,17 +326,15 @@ static int tvp514x_write_regs(struct i2c_client *client,
  * tvp514x_get_current_std:
  * Returns the current standard detected by TVP5146/47
  */
-static enum tvp514x_std tvp514x_get_current_std(struct tvp514x_decoder
-						*decoder)
+static enum tvp514x_std tvp514x_get_current_std(struct v4l2_subdev *sd)
 {
 	u8 std, std_status;

-	std = tvp514x_read_reg(decoder->client, REG_VIDEO_STD);
-	if ((std & VIDEO_STD_MASK) == VIDEO_STD_AUTO_SWITCH_BIT) {
+	std = tvp514x_read_reg(sd, REG_VIDEO_STD);
+	if ((std & VIDEO_STD_MASK) == VIDEO_STD_AUTO_SWITCH_BIT)
 		/* use the standard status register */
-		std_status = tvp514x_read_reg(decoder->client,
-				REG_VIDEO_STD_STATUS);
-	} else
+		std_status = tvp514x_read_reg(sd, REG_VIDEO_STD_STATUS);
+	else
 		std_status = std;	/* use the standard register itself */

 	switch (std_status & VIDEO_STD_MASK) {
@@ -369,70 +354,71 @@ static enum tvp514x_std tvp514x_get_current_std(struct tvp514x_decoder
 /*
  * TVP5146/47 register dump function
  */
-static void tvp514x_reg_dump(struct tvp514x_decoder *decoder)
+static void tvp514x_reg_dump(struct v4l2_subdev *sd)
 {
 	u8 value;

-	dump_reg(decoder->client, REG_INPUT_SEL, value);
-	dump_reg(decoder->client, REG_AFE_GAIN_CTRL, value);
-	dump_reg(decoder->client, REG_VIDEO_STD, value);
-	dump_reg(decoder->client, REG_OPERATION_MODE, value);
-	dump_reg(decoder->client, REG_COLOR_KILLER, value);
-	dump_reg(decoder->client, REG_LUMA_CONTROL1, value);
-	dump_reg(decoder->client, REG_LUMA_CONTROL2, value);
-	dump_reg(decoder->client, REG_LUMA_CONTROL3, value);
-	dump_reg(decoder->client, REG_BRIGHTNESS, value);
-	dump_reg(decoder->client, REG_CONTRAST, value);
-	dump_reg(decoder->client, REG_SATURATION, value);
-	dump_reg(decoder->client, REG_HUE, value);
-	dump_reg(decoder->client, REG_CHROMA_CONTROL1, value);
-	dump_reg(decoder->client, REG_CHROMA_CONTROL2, value);
-	dump_reg(decoder->client, REG_COMP_PR_SATURATION, value);
-	dump_reg(decoder->client, REG_COMP_Y_CONTRAST, value);
-	dump_reg(decoder->client, REG_COMP_PB_SATURATION, value);
-	dump_reg(decoder->client, REG_COMP_Y_BRIGHTNESS, value);
-	dump_reg(decoder->client, REG_AVID_START_PIXEL_LSB, value);
-	dump_reg(decoder->client, REG_AVID_START_PIXEL_MSB, value);
-	dump_reg(decoder->client, REG_AVID_STOP_PIXEL_LSB, value);
-	dump_reg(decoder->client, REG_AVID_STOP_PIXEL_MSB, value);
-	dump_reg(decoder->client, REG_HSYNC_START_PIXEL_LSB, value);
-	dump_reg(decoder->client, REG_HSYNC_START_PIXEL_MSB, value);
-	dump_reg(decoder->client, REG_HSYNC_STOP_PIXEL_LSB, value);
-	dump_reg(decoder->client, REG_HSYNC_STOP_PIXEL_MSB, value);
-	dump_reg(decoder->client, REG_VSYNC_START_LINE_LSB, value);
-	dump_reg(decoder->client, REG_VSYNC_START_LINE_MSB, value);
-	dump_reg(decoder->client, REG_VSYNC_STOP_LINE_LSB, value);
-	dump_reg(decoder->client, REG_VSYNC_STOP_LINE_MSB, value);
-	dump_reg(decoder->client, REG_VBLK_START_LINE_LSB, value);
-	dump_reg(decoder->client, REG_VBLK_START_LINE_MSB, value);
-	dump_reg(decoder->client, REG_VBLK_STOP_LINE_LSB, value);
-	dump_reg(decoder->client, REG_VBLK_STOP_LINE_MSB, value);
-	dump_reg(decoder->client, REG_SYNC_CONTROL, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER1, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER2, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER3, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER4, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER5, value);
-	dump_reg(decoder->client, REG_OUTPUT_FORMATTER6, value);
-	dump_reg(decoder->client, REG_CLEAR_LOST_LOCK, value);
+	dump_reg(sd, REG_INPUT_SEL, value);
+	dump_reg(sd, REG_AFE_GAIN_CTRL, value);
+	dump_reg(sd, REG_VIDEO_STD, value);
+	dump_reg(sd, REG_OPERATION_MODE, value);
+	dump_reg(sd, REG_COLOR_KILLER, value);
+	dump_reg(sd, REG_LUMA_CONTROL1, value);
+	dump_reg(sd, REG_LUMA_CONTROL2, value);
+	dump_reg(sd, REG_LUMA_CONTROL3, value);
+	dump_reg(sd, REG_BRIGHTNESS, value);
+	dump_reg(sd, REG_CONTRAST, value);
+	dump_reg(sd, REG_SATURATION, value);
+	dump_reg(sd, REG_HUE, value);
+	dump_reg(sd, REG_CHROMA_CONTROL1, value);
+	dump_reg(sd, REG_CHROMA_CONTROL2, value);
+	dump_reg(sd, REG_COMP_PR_SATURATION, value);
+	dump_reg(sd, REG_COMP_Y_CONTRAST, value);
+	dump_reg(sd, REG_COMP_PB_SATURATION, value);
+	dump_reg(sd, REG_COMP_Y_BRIGHTNESS, value);
+	dump_reg(sd, REG_AVID_START_PIXEL_LSB, value);
+	dump_reg(sd, REG_AVID_START_PIXEL_MSB, value);
+	dump_reg(sd, REG_AVID_STOP_PIXEL_LSB, value);
+	dump_reg(sd, REG_AVID_STOP_PIXEL_MSB, value);
+	dump_reg(sd, REG_HSYNC_START_PIXEL_LSB, value);
+	dump_reg(sd, REG_HSYNC_START_PIXEL_MSB, value);
+	dump_reg(sd, REG_HSYNC_STOP_PIXEL_LSB, value);
+	dump_reg(sd, REG_HSYNC_STOP_PIXEL_MSB, value);
+	dump_reg(sd, REG_VSYNC_START_LINE_LSB, value);
+	dump_reg(sd, REG_VSYNC_START_LINE_MSB, value);
+	dump_reg(sd, REG_VSYNC_STOP_LINE_LSB, value);
+	dump_reg(sd, REG_VSYNC_STOP_LINE_MSB, value);
+	dump_reg(sd, REG_VBLK_START_LINE_LSB, value);
+	dump_reg(sd, REG_VBLK_START_LINE_MSB, value);
+	dump_reg(sd, REG_VBLK_STOP_LINE_LSB, value);
+	dump_reg(sd, REG_VBLK_STOP_LINE_MSB, value);
+	dump_reg(sd, REG_SYNC_CONTROL, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER1, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER2, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER3, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER4, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER5, value);
+	dump_reg(sd, REG_OUTPUT_FORMATTER6, value);
+	dump_reg(sd, REG_CLEAR_LOST_LOCK, value);
 }

 /*
  * Configure the TVP5146/47 with the current register settings
  * Returns zero if successful, or non-zero otherwise.
  */
-static int tvp514x_configure(struct tvp514x_decoder *decoder)
+static int tvp514x_configure(struct v4l2_subdev *sd,
+		struct tvp514x_decoder *decoder)
 {
 	int err;

 	/* common register initialization */
 	err =
-	    tvp514x_write_regs(decoder->client, decoder->tvp514x_regs);
+	    tvp514x_write_regs(sd, decoder->tvp514x_regs);
 	if (err)
 		return err;

 	if (debug)
-		tvp514x_reg_dump(decoder);
+		tvp514x_reg_dump(sd);

 	return 0;
 }
@@ -445,15 +431,17 @@ static int tvp514x_configure(struct tvp514x_decoder *decoder)
  * Returns ENODEV error number if no device is detected, or zero
  * if a device is detected.
  */
-static int tvp514x_detect(struct tvp514x_decoder *decoder)
+static int tvp514x_detect(struct v4l2_subdev *sd,
+		struct tvp514x_decoder *decoder)
 {
 	u8 chip_id_msb, chip_id_lsb, rom_ver;
+	struct i2c_client *client = v4l2_get_subdevdata(sd);

-	chip_id_msb = tvp514x_read_reg(decoder->client, REG_CHIP_ID_MSB);
-	chip_id_lsb = tvp514x_read_reg(decoder->client, REG_CHIP_ID_LSB);
-	rom_ver = tvp514x_read_reg(decoder->client, REG_ROM_VERSION);
+	chip_id_msb = tvp514x_read_reg(sd, REG_CHIP_ID_MSB);
+	chip_id_lsb = tvp514x_read_reg(sd, REG_CHIP_ID_LSB);
+	rom_ver = tvp514x_read_reg(sd, REG_ROM_VERSION);

-	v4l_dbg(1, debug, decoder->client,
+	v4l2_dbg(1, debug, sd,
 		 "chip id detected msb:0x%x lsb:0x%x rom version:0x%x\n",
 		 chip_id_msb, chip_id_lsb, rom_ver);
 	if ((chip_id_msb != TVP514X_CHIP_ID_MSB)
@@ -462,19 +450,16 @@ static int tvp514x_detect(struct tvp514x_decoder *decoder)
 		/* We didn't read the values we expected, so this must not be
 		 * an TVP5146/47.
 		 */
-		v4l_err(decoder->client,
-			"chip id mismatch msb:0x%x lsb:0x%x\n",
-			chip_id_msb, chip_id_lsb);
+		v4l2_err(sd, "chip id mismatch msb:0x%x lsb:0x%x\n",
+				chip_id_msb, chip_id_lsb);
 		return -ENODEV;
 	}

 	decoder->ver = rom_ver;
-	decoder->state = STATE_DETECTED;

-	v4l_info(decoder->client,
-			"%s found at 0x%x (%s)\n", decoder->client->name,
-			decoder->client->addr << 1,
-			decoder->client->adapter->name);
+	v4l2_info(sd, "%s (Version - 0x%.2x) found at 0x%x (%s)\n",
+			client->name, decoder->ver,
+			client->addr << 1, client->adapter->name);
 	return 0;
 }

@@ -483,17 +468,17 @@ static int tvp514x_detect(struct tvp514x_decoder *decoder)
  * TVP5146/47 decoder driver.
  */

-/**
- * ioctl_querystd - V4L2 decoder interface handler for VIDIOC_QUERYSTD ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_querystd - V4L2 decoder interface handler for VIDIOC_QUERYSTD ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @std_id: standard V4L2 std_id ioctl enum
  *
  * Returns the current standard detected by TVP5146/47. If no active input is
  * detected, returns -EINVAL
  */
-static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id)
+static int tvp514x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std_id)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	enum tvp514x_std current_std;
 	enum tvp514x_input input_sel;
 	u8 sync_lock_status, lock_mask;
@@ -502,11 +487,11 @@ static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id)
 		return -EINVAL;

 	/* get the current standard */
-	current_std = tvp514x_get_current_std(decoder);
+	current_std = tvp514x_get_current_std(sd);
 	if (current_std == STD_INVALID)
 		return -EINVAL;

-	input_sel = decoder->route.input;
+	input_sel = decoder->input;

 	switch (input_sel) {
 	case INPUT_CVBS_VI1A:
@@ -544,42 +529,39 @@ static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id)
 		return -EINVAL;
 	}
 	/* check whether signal is locked */
-	sync_lock_status = tvp514x_read_reg(decoder->client, REG_STATUS1);
+	sync_lock_status = tvp514x_read_reg(sd, REG_STATUS1);
 	if (lock_mask != (sync_lock_status & lock_mask))
 		return -EINVAL;	/* No input detected */

 	decoder->current_std = current_std;
 	*std_id = decoder->std_list[current_std].standard.id;

-	v4l_dbg(1, debug, decoder->client, "Current STD: %s",
+	v4l2_dbg(1, debug, sd, "Current STD: %s",
 			decoder->std_list[current_std].standard.name);
 	return 0;
 }

-/**
- * ioctl_s_std - V4L2 decoder interface handler for VIDIOC_S_STD ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_std - V4L2 decoder interface handler for VIDIOC_S_STD ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @std_id: standard V4L2 v4l2_std_id ioctl enum
  *
  * If std_id is supported, sets the requested standard. Otherwise, returns
  * -EINVAL
  */
-static int ioctl_s_std(struct v4l2_int_device *s, v4l2_std_id *std_id)
+static int tvp514x_s_std(struct v4l2_subdev *sd, v4l2_std_id std_id)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	int err, i;

-	if (std_id == NULL)
-		return -EINVAL;
-
 	for (i = 0; i < decoder->num_stds; i++)
-		if (*std_id & decoder->std_list[i].standard.id)
+		if (std_id & decoder->std_list[i].standard.id)
 			break;

 	if ((i == decoder->num_stds) || (i == STD_INVALID))
 		return -EINVAL;

-	err = tvp514x_write_reg(decoder->client, REG_VIDEO_STD,
+	err = tvp514x_write_reg(sd, REG_VIDEO_STD,
 				decoder->std_list[i].video_std);
 	if (err)
 		return err;
@@ -588,24 +570,24 @@ static int ioctl_s_std(struct v4l2_int_device *s, v4l2_std_id *std_id)
 	decoder->tvp514x_regs[REG_VIDEO_STD].val =
 		decoder->std_list[i].video_std;

-	v4l_dbg(1, debug, decoder->client, "Standard set to: %s",
+	v4l2_dbg(1, debug, sd, "Standard set to: %s",
 			decoder->std_list[i].standard.name);
 	return 0;
 }

-/**
- * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @index: number of the input
  *
  * If index is valid, selects the requested input. Otherwise, returns -EINVAL if
  * the input is not supported or there is no active signal present in the
  * selected input.
  */
-static int ioctl_s_routing(struct v4l2_int_device *s,
-				struct v4l2_routing *route)
+static int tvp514x_s_routing(struct v4l2_subdev *sd,
+				u32 input, u32 output, u32 config)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	int err;
 	enum tvp514x_input input_sel;
 	enum tvp514x_output output_sel;
@@ -613,20 +595,20 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
 	u8 sync_lock_status, lock_mask;
 	int try_count = LOCK_RETRY_COUNT;

-	if ((!route) || (route->input >= INPUT_INVALID) ||
-			(route->output >= OUTPUT_INVALID))
+	if ((input >= INPUT_INVALID) ||
+			(output >= OUTPUT_INVALID))
 		return -EINVAL;	/* Index out of bound */

-	input_sel = route->input;
-	output_sel = route->output;
+	input_sel = input;
+	output_sel = output;

-	err = tvp514x_write_reg(decoder->client, REG_INPUT_SEL, input_sel);
+	err = tvp514x_write_reg(sd, REG_INPUT_SEL, input_sel);
 	if (err)
 		return err;

-	output_sel |= tvp514x_read_reg(decoder->client,
+	output_sel |= tvp514x_read_reg(sd,
 			REG_OUTPUT_FORMATTER1) & 0x7;
-	err = tvp514x_write_reg(decoder->client, REG_OUTPUT_FORMATTER1,
+	err = tvp514x_write_reg(sd, REG_OUTPUT_FORMATTER1,
 			output_sel);
 	if (err)
 		return err;
@@ -637,7 +619,7 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
 	/* Clear status */
 	msleep(LOCK_RETRY_DELAY);
 	err =
-	    tvp514x_write_reg(decoder->client, REG_CLEAR_LOST_LOCK, 0x01);
+	    tvp514x_write_reg(sd, REG_CLEAR_LOST_LOCK, 0x01);
 	if (err)
 		return err;

@@ -682,11 +664,11 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
 		msleep(LOCK_RETRY_DELAY);

 		/* get the current standard for future reference */
-		current_std = tvp514x_get_current_std(decoder);
+		current_std = tvp514x_get_current_std(sd);
 		if (current_std == STD_INVALID)
 			continue;

-		sync_lock_status = tvp514x_read_reg(decoder->client,
+		sync_lock_status = tvp514x_read_reg(sd,
 				REG_STATUS1);
 		if (lock_mask == (sync_lock_status & lock_mask))
 			break;	/* Input detected */
@@ -696,28 +678,26 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
 		return -EINVAL;

 	decoder->current_std = current_std;
-	decoder->route.input = route->input;
-	decoder->route.output = route->output;
+	decoder->input = input;
+	decoder->output = output;

-	v4l_dbg(1, debug, decoder->client,
-			"Input set to: %d, std : %d",
+	v4l2_dbg(1, debug, sd, "Input set to: %d, std : %d",
 			input_sel, current_std);

 	return 0;
 }

-/**
- * ioctl_queryctrl - V4L2 decoder interface handler for VIDIOC_QUERYCTRL ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_queryctrl - V4L2 decoder interface handler for VIDIOC_QUERYCTRL ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @qctrl: standard V4L2 v4l2_queryctrl structure
  *
  * If the requested control is supported, returns the control information.
  * Otherwise, returns -EINVAL if the control is not supported.
  */
 static int
-ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl)
+tvp514x_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qctrl)
 {
-	struct tvp514x_decoder *decoder = s->priv;
 	int err = -EINVAL;

 	if (qctrl == NULL)
@@ -744,30 +724,27 @@ ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl)
 		err = v4l2_ctrl_query_fill(qctrl, -180, 180, 180, 0);
 		break;
 	case V4L2_CID_AUTOGAIN:
-		/* Autogain is either 0 or 1*/
-		memcpy(qctrl, &tvp514x_autogain_ctrl,
-				sizeof(struct v4l2_queryctrl));
-		err = 0;
+		/*
+		 * Auto Gain supported is -
+		 * 	0 - 1 (Default - 1)
+		 */
+		err = v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 1);
 		break;
 	default:
-		v4l_err(decoder->client,
-			"invalid control id %d\n", qctrl->id);
+		v4l2_err(sd, "invalid control id %d\n", qctrl->id);
 		return err;
 	}

-	v4l_dbg(1, debug, decoder->client,
-			"Query Control: %s : Min - %d, Max - %d, Def - %d",
-			qctrl->name,
-			qctrl->minimum,
-			qctrl->maximum,
+	v4l2_dbg(1, debug, sd, "Query Control:%s: Min - %d, Max - %d, Def - %d",
+			qctrl->name, qctrl->minimum, qctrl->maximum,
 			qctrl->default_value);

 	return err;
 }

-/**
- * ioctl_g_ctrl - V4L2 decoder interface handler for VIDIOC_G_CTRL ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_g_ctrl - V4L2 decoder interface handler for VIDIOC_G_CTRL ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @ctrl: pointer to v4l2_control structure
  *
  * If the requested control is supported, returns the control's current
@@ -775,9 +752,9 @@ ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl)
  * supported.
  */
 static int
-ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl)
+tvp514x_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);

 	if (ctrl == NULL)
 		return -EINVAL;
@@ -811,74 +788,70 @@ ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl)

 		break;
 	default:
-		v4l_err(decoder->client,
-			"invalid control id %d\n", ctrl->id);
+		v4l2_err(sd, "invalid control id %d\n", ctrl->id);
 		return -EINVAL;
 	}

-	v4l_dbg(1, debug, decoder->client,
-			"Get Control: ID - %d - %d",
+	v4l2_dbg(1, debug, sd, "Get Control: ID - %d - %d",
 			ctrl->id, ctrl->value);
 	return 0;
 }

-/**
- * ioctl_s_ctrl - V4L2 decoder interface handler for VIDIOC_S_CTRL ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_ctrl - V4L2 decoder interface handler for VIDIOC_S_CTRL ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @ctrl: pointer to v4l2_control structure
  *
  * If the requested control is supported, sets the control's current
  * value in HW. Otherwise, returns -EINVAL if the control is not supported.
  */
 static int
-ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl)
+tvp514x_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	int err = -EINVAL, value;

 	if (ctrl == NULL)
 		return err;

-	value = (__s32) ctrl->value;
+	value = ctrl->value;

 	switch (ctrl->id) {
 	case V4L2_CID_BRIGHTNESS:
 		if (ctrl->value < 0 || ctrl->value > 255) {
-			v4l_err(decoder->client,
-					"invalid brightness setting %d\n",
+			v4l2_err(sd, "invalid brightness setting %d\n",
 					ctrl->value);
 			return -ERANGE;
 		}
-		err = tvp514x_write_reg(decoder->client, REG_BRIGHTNESS,
+		err = tvp514x_write_reg(sd, REG_BRIGHTNESS,
 				value);
 		if (err)
 			return err;
+
 		decoder->tvp514x_regs[REG_BRIGHTNESS].val = value;
 		break;
 	case V4L2_CID_CONTRAST:
 		if (ctrl->value < 0 || ctrl->value > 255) {
-			v4l_err(decoder->client,
-					"invalid contrast setting %d\n",
+			v4l2_err(sd, "invalid contrast setting %d\n",
 					ctrl->value);
 			return -ERANGE;
 		}
-		err = tvp514x_write_reg(decoder->client, REG_CONTRAST,
-				value);
+		err = tvp514x_write_reg(sd, REG_CONTRAST, value);
 		if (err)
 			return err;
+
 		decoder->tvp514x_regs[REG_CONTRAST].val = value;
 		break;
 	case V4L2_CID_SATURATION:
 		if (ctrl->value < 0 || ctrl->value > 255) {
-			v4l_err(decoder->client,
-					"invalid saturation setting %d\n",
+			v4l2_err(sd, "invalid saturation setting %d\n",
 					ctrl->value);
 			return -ERANGE;
 		}
-		err = tvp514x_write_reg(decoder->client, REG_SATURATION,
-				value);
+		err = tvp514x_write_reg(sd, REG_SATURATION, value);
 		if (err)
 			return err;
+
 		decoder->tvp514x_regs[REG_SATURATION].val = value;
 		break;
 	case V4L2_CID_HUE:
@@ -889,15 +862,13 @@ ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl)
 		else if (value == 0)
 			value = 0;
 		else {
-			v4l_err(decoder->client,
-					"invalid hue setting %d\n",
-					ctrl->value);
+			v4l2_err(sd, "invalid hue setting %d\n", ctrl->value);
 			return -ERANGE;
 		}
-		err = tvp514x_write_reg(decoder->client, REG_HUE,
-				value);
+		err = tvp514x_write_reg(sd, REG_HUE, value);
 		if (err)
 			return err;
+
 		decoder->tvp514x_regs[REG_HUE].val = value;
 		break;
 	case V4L2_CID_AUTOGAIN:
@@ -906,41 +877,38 @@ ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl)
 		else if (value == 0)
 			value = 0x0C;
 		else {
-			v4l_err(decoder->client,
-					"invalid auto gain setting %d\n",
+			v4l2_err(sd, "invalid auto gain setting %d\n",
 					ctrl->value);
 			return -ERANGE;
 		}
-		err = tvp514x_write_reg(decoder->client, REG_AFE_GAIN_CTRL,
-				value);
+		err = tvp514x_write_reg(sd, REG_AFE_GAIN_CTRL, value);
 		if (err)
 			return err;
+
 		decoder->tvp514x_regs[REG_AFE_GAIN_CTRL].val = value;
 		break;
 	default:
-		v4l_err(decoder->client,
-			"invalid control id %d\n", ctrl->id);
+		v4l2_err(sd, "invalid control id %d\n", ctrl->id);
 		return err;
 	}

-	v4l_dbg(1, debug, decoder->client,
-			"Set Control: ID - %d - %d",
+	v4l2_dbg(1, debug, sd, "Set Control: ID - %d - %d",
 			ctrl->id, ctrl->value);

 	return err;
 }

-/**
- * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure
  *
  * Implement the VIDIOC_ENUM_FMT ioctl to enumerate supported formats
  */
 static int
-ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt)
+tvp514x_enum_fmt_cap(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmt)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	int index;

 	if (fmt == NULL)
@@ -956,16 +924,15 @@ ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt)
 	memcpy(fmt, &decoder->fmt_list[index],
 		sizeof(struct v4l2_fmtdesc));

-	v4l_dbg(1, debug, decoder->client,
-			"Current FMT: index - %d (%s)",
+	v4l2_dbg(1, debug, sd, "Current FMT: index - %d (%s)",
 			decoder->fmt_list[index].index,
 			decoder->fmt_list[index].description);
 	return 0;
 }

-/**
- * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure
  *
  * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This
@@ -973,9 +940,9 @@ ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt)
  * without actually making it take effect.
  */
 static int
-ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
+tvp514x_try_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	int ifmt;
 	struct v4l2_pix_format *pix;
 	enum tvp514x_std current_std;
@@ -989,7 +956,7 @@ ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
 	pix = &f->fmt.pix;

 	/* Calculate height and width based on current standard */
-	current_std = tvp514x_get_current_std(decoder);
+	current_std = tvp514x_get_current_std(sd);
 	if (current_std == STD_INVALID)
 		return -EINVAL;

@@ -1012,17 +979,16 @@ ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
 	pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
 	pix->priv = 0;

-	v4l_dbg(1, debug, decoder->client,
-			"Try FMT: pixelformat - %s, bytesperline - %d"
+	v4l2_dbg(1, debug, sd, "Try FMT: pixelformat - %s, bytesperline - %d"
 			"Width - %d, Height - %d",
 			decoder->fmt_list[ifmt].description, pix->bytesperline,
 			pix->width, pix->height);
 	return 0;
 }

-/**
- * ioctl_s_fmt_cap - V4L2 decoder interface handler for VIDIOC_S_FMT ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_fmt_cap - V4L2 decoder interface handler for VIDIOC_S_FMT ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure
  *
  * If the requested format is supported, configures the HW to use that
@@ -1030,9 +996,9 @@ ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
  * correctly configured.
  */
 static int
-ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
+tvp514x_s_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	struct v4l2_pix_format *pix;
 	int rval;

@@ -1043,7 +1009,7 @@ ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
 		return -EINVAL;	/* only capture is supported */

 	pix = &f->fmt.pix;
-	rval = ioctl_try_fmt_cap(s, f);
+	rval = tvp514x_try_fmt_cap(sd, f);
 	if (rval)
 		return rval;

@@ -1052,18 +1018,18 @@ ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
 	return rval;
 }

-/**
- * ioctl_g_fmt_cap - V4L2 decoder interface handler for ioctl_g_fmt_cap
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_g_fmt_cap - V4L2 decoder interface handler for tvp514x_g_fmt_cap
+ * @sd: pointer to standard V4L2 sub-device structure
  * @f: pointer to standard V4L2 v4l2_format structure
  *
  * Returns the decoder's current pixel format in the v4l2_format
  * parameter.
  */
 static int
-ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)
+tvp514x_g_fmt_cap(struct v4l2_subdev *sd, struct v4l2_format *f)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);

 	if (f == NULL)
 		return -EINVAL;
@@ -1073,25 +1039,24 @@ ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f)

 	f->fmt.pix = decoder->pix;

-	v4l_dbg(1, debug, decoder->client,
-			"Current FMT: bytesperline - %d"
+	v4l2_dbg(1, debug, sd, "Current FMT: bytesperline - %d"
 			"Width - %d, Height - %d",
 			decoder->pix.bytesperline,
 			decoder->pix.width, decoder->pix.height);
 	return 0;
 }

-/**
- * ioctl_g_parm - V4L2 decoder interface handler for VIDIOC_G_PARM ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_g_parm - V4L2 decoder interface handler for VIDIOC_G_PARM ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure
  *
  * Returns the decoder's video CAPTURE parameters.
  */
 static int
-ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
+tvp514x_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	struct v4l2_captureparm *cparm;
 	enum tvp514x_std current_std;

@@ -1105,7 +1070,7 @@ ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
 	a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

 	/* get the current standard */
-	current_std = tvp514x_get_current_std(decoder);
+	current_std = tvp514x_get_current_std(sd);
 	if (current_std == STD_INVALID)
 		return -EINVAL;

@@ -1119,18 +1084,18 @@ ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
 	return 0;
 }

-/**
- * ioctl_s_parm - V4L2 decoder interface handler for VIDIOC_S_PARM ioctl
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_parm - V4L2 decoder interface handler for VIDIOC_S_PARM ioctl
+ * @sd: pointer to standard V4L2 sub-device structure
  * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure
  *
  * Configures the decoder to use the input parameters, if possible. If
  * not possible, returns the appropriate error code.
  */
 static int
-ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
+tvp514x_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
 {
-	struct tvp514x_decoder *decoder = s->priv;
+	struct tvp514x_decoder *decoder = to_decoder(sd);
 	struct v4l2_fract *timeperframe;
 	enum tvp514x_std current_std;

@@ -1143,7 +1108,7 @@ ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
 	timeperframe = &a->parm.capture.timeperframe;

 	/* get the current standard */
-	current_std = tvp514x_get_current_std(decoder);
+	current_std = tvp514x_get_current_std(sd);
 	if (current_std == STD_INVALID)
 		return -EINVAL;

@@ -1155,112 +1120,59 @@ ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
 	return 0;
 }

-/**
- * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num
- * @s: pointer to standard V4L2 device structure
- * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure
- *
- * Gets slave interface parameters.
- * Calculates the required xclk value to support the requested
- * clock parameters in p. This value is returned in the p
- * parameter.
- */
-static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p)
-{
-	struct tvp514x_decoder *decoder = s->priv;
-	int rval;
-
-	if (p == NULL)
-		return -EINVAL;
-
-	if (NULL == decoder->pdata->ifparm)
-		return -EINVAL;
-
-	rval = decoder->pdata->ifparm(p);
-	if (rval) {
-		v4l_err(decoder->client, "g_ifparm.Err[%d]\n", rval);
-		return rval;
-	}
-
-	p->u.bt656.clock_curr = TVP514X_XCLK_BT656;
-
-	return 0;
-}
-
-/**
- * ioctl_g_priv - V4L2 decoder interface handler for vidioc_int_g_priv_num
- * @s: pointer to standard V4L2 device structure
- * @p: void pointer to hold decoder's private data address
- *
- * Returns device's (decoder's) private data area address in p parameter
- */
-static int ioctl_g_priv(struct v4l2_int_device *s, void *p)
-{
-	struct tvp514x_decoder *decoder = s->priv;
-
-	if (NULL == decoder->pdata->priv_data_set)
-		return -EINVAL;
-
-	return decoder->pdata->priv_data_set(p);
-}
-
-/**
- * ioctl_s_power - V4L2 decoder interface handler for vidioc_int_s_power_num
- * @s: pointer to standard V4L2 device structure
+/*
+ * tvp514x_s_stream - V4L2 decoder interface handler for vidioc_int_s_power_num
+ * @sd: pointer to standard V4L2 sub-device structure
  * @on: power state to which device is to be set
  *
  * Sets devices power state to requrested state, if possible.
  */
-static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on)
+static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable)
 {
-	struct tvp514x_decoder *decoder = s->priv;
 	int err = 0;
+	struct i2c_client *client = v4l2_get_subdevdata(sd);
+	struct tvp514x_decoder *decoder = to_decoder(sd);

-	switch (on) {
-	case V4L2_POWER_OFF:
-		/* Power Down Sequence */
-		err =
-		    tvp514x_write_reg(decoder->client, REG_OPERATION_MODE,
-					0x01);
-		/* Disable mux for TVP5146/47 decoder data path */
-		if (decoder->pdata->power_set)
-			err |= decoder->pdata->power_set(on);
-		decoder->state = STATE_NOT_DETECTED;
-		break;
+	if (decoder->state == enable)
+		return 0;

-	case V4L2_POWER_STANDBY:
-		if (decoder->pdata->power_set)
-			err = decoder->pdata->power_set(on);
+	switch (enable) {
+	case 0:
+	{
+		/* Power Down Sequence */
+		err = tvp514x_write_reg(sd, REG_OPERATION_MODE, 0x01);
+		if (err) {
+			v4l2_err(sd, "Unable to turn off decoder\n");
+			return err;
+		}
+		decoder->state = enable;
 		break;
+	}
+	case 1:
+	{
+		struct tvp514x_reg *int_seq = (struct tvp514x_reg *)
+				client->driver->id_table->driver_data;

-	case V4L2_POWER_ON:
-		/* Enable mux for TVP5146/47 decoder data path */
-		if ((decoder->pdata->power_set) &&
-				(decoder->state == STATE_NOT_DETECTED)) {
-			int i;
-			struct tvp514x_init_seq *int_seq =
-				(struct tvp514x_init_seq *)
-				decoder->id->driver_data;
-
-			err = decoder->pdata->power_set(on);
-
-			/* Power Up Sequence */
-			for (i = 0; i < int_seq->no_regs; i++) {
-				err |= tvp514x_write_reg(decoder->client,
-						int_seq->init_reg_seq[i].reg,
-						int_seq->init_reg_seq[i].val);
-			}
-			/* Detect the sensor is not already detected */
-			err |= tvp514x_detect(decoder);
-			if (err) {
-				v4l_err(decoder->client,
-						"Unable to detect decoder\n");
-				return err;
-			}
+		/* Power Up Sequence */
+		err = tvp514x_write_regs(sd, int_seq);
+		if (err) {
+			v4l2_err(sd, "Unable to turn on decoder\n");
+			return err;
+		}
+		/* Detect the sensor is not already detected */
+		err = tvp514x_detect(sd, decoder);
+		if (err) {
+			v4l2_err(sd, "Unable to detect decoder\n");
+			return err;
+		}
+		err = tvp514x_configure(sd, decoder);
+		if (err) {
+			v4l2_err(sd, "Unable to configure decoder\n");
+			return err;
 		}
-		err |= tvp514x_configure(decoder);
+		decoder->state = enable;
 		break;
-
+	}
 	default:
 		err = -ENODEV;
 		break;
@@ -1269,93 +1181,37 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on)
 	return err;
 }

-/**
- * ioctl_init - V4L2 decoder interface handler for VIDIOC_INT_INIT
- * @s: pointer to standard V4L2 device structure
- *
- * Initialize the decoder device (calls tvp514x_configure())
- */
-static int ioctl_init(struct v4l2_int_device *s)
-{
-	struct tvp514x_decoder *decoder = s->priv;
-
-	/* Set default standard to auto */
-	decoder->tvp514x_regs[REG_VIDEO_STD].val =
-	    VIDEO_STD_AUTO_SWITCH_BIT;
-
-	return tvp514x_configure(decoder);
-}
-
-/**
- * ioctl_dev_exit - V4L2 decoder interface handler for vidioc_int_dev_exit_num
- * @s: pointer to standard V4L2 device structure
- *
- * Delinitialise the dev. at slave detach. The complement of ioctl_dev_init.
- */
-static int ioctl_dev_exit(struct v4l2_int_device *s)
-{
-	return 0;
-}
-
-/**
- * ioctl_dev_init - V4L2 decoder interface handler for vidioc_int_dev_init_num
- * @s: pointer to standard V4L2 device structure
- *
- * Initialise the device when slave attaches to the master. Returns 0 if
- * TVP5146/47 device could be found, otherwise returns appropriate error.
- */
-static int ioctl_dev_init(struct v4l2_int_device *s)
-{
-	struct tvp514x_decoder *decoder = s->priv;
-	int err;
-
-	err = tvp514x_detect(decoder);
-	if (err < 0) {
-		v4l_err(decoder->client,
-			"Unable to detect decoder\n");
-		return err;
-	}
-
-	v4l_info(decoder->client,
-		 "chip version 0x%.2x detected\n", decoder->ver);
+static const struct v4l2_subdev_core_ops tvp514x_core_ops = {
+	.queryctrl = tvp514x_queryctrl,
+	.g_ctrl = tvp514x_g_ctrl,
+	.s_ctrl = tvp514x_s_ctrl,
+	.s_std = tvp514x_s_std,
+};

-	return 0;
-}
+static const struct v4l2_subdev_video_ops tvp514x_video_ops = {
+	.s_routing = tvp514x_s_routing,
+	.querystd = tvp514x_querystd,
+	.enum_fmt = tvp514x_enum_fmt_cap,
+	.g_fmt = tvp514x_g_fmt_cap,
+	.try_fmt = tvp514x_try_fmt_cap,
+	.s_fmt = tvp514x_s_fmt_cap,
+	.g_parm = tvp514x_g_parm,
+	.s_parm = tvp514x_s_parm,
+	.s_stream = tvp514x_s_stream,
+};

-static struct v4l2_int_ioctl_desc tvp514x_ioctl_desc[] = {
-	{vidioc_int_dev_init_num, (v4l2_int_ioctl_func*) ioctl_dev_init},
-	{vidioc_int_dev_exit_num, (v4l2_int_ioctl_func*) ioctl_dev_exit},
-	{vidioc_int_s_power_num, (v4l2_int_ioctl_func*) ioctl_s_power},
-	{vidioc_int_g_priv_num, (v4l2_int_ioctl_func*) ioctl_g_priv},
-	{vidioc_int_g_ifparm_num, (v4l2_int_ioctl_func*) ioctl_g_ifparm},
-	{vidioc_int_init_num, (v4l2_int_ioctl_func*) ioctl_init},
-	{vidioc_int_enum_fmt_cap_num,
-	 (v4l2_int_ioctl_func *) ioctl_enum_fmt_cap},
-	{vidioc_int_try_fmt_cap_num,
-	 (v4l2_int_ioctl_func *) ioctl_try_fmt_cap},
-	{vidioc_int_g_fmt_cap_num,
-	 (v4l2_int_ioctl_func *) ioctl_g_fmt_cap},
-	{vidioc_int_s_fmt_cap_num,
-	 (v4l2_int_ioctl_func *) ioctl_s_fmt_cap},
-	{vidioc_int_g_parm_num, (v4l2_int_ioctl_func *) ioctl_g_parm},
-	{vidioc_int_s_parm_num, (v4l2_int_ioctl_func *) ioctl_s_parm},
-	{vidioc_int_queryctrl_num,
-	 (v4l2_int_ioctl_func *) ioctl_queryctrl},
-	{vidioc_int_g_ctrl_num, (v4l2_int_ioctl_func *) ioctl_g_ctrl},
-	{vidioc_int_s_ctrl_num, (v4l2_int_ioctl_func *) ioctl_s_ctrl},
-	{vidioc_int_querystd_num, (v4l2_int_ioctl_func *) ioctl_querystd},
-	{vidioc_int_s_std_num, (v4l2_int_ioctl_func *) ioctl_s_std},
-	{vidioc_int_s_video_routing_num,
-		(v4l2_int_ioctl_func *) ioctl_s_routing},
+static const struct v4l2_subdev_ops tvp514x_ops = {
+	.core = &tvp514x_core_ops,
+	.video = &tvp514x_video_ops,
 };

 static struct tvp514x_decoder tvp514x_dev = {
-	.state = STATE_NOT_DETECTED,
+	.state = 0,

 	.fmt_list = tvp514x_fmt_list,
 	.num_fmts = ARRAY_SIZE(tvp514x_fmt_list),

-	.pix = {		/* Default to NTSC 8-bit YUV 422 */
+	.pix = {/* Default to NTSC 8-bit YUV 422 */
 		.width = NTSC_NUM_ACTIVE_PIXELS,
 		.height = NTSC_NUM_ACTIVE_LINES,
 		.pixelformat = V4L2_PIX_FMT_UYVY,
@@ -1369,20 +1225,13 @@ static struct tvp514x_decoder tvp514x_dev = {
 	.current_std = STD_NTSC_MJ,
 	.std_list = tvp514x_std_list,
 	.num_stds = ARRAY_SIZE(tvp514x_std_list),
-	.v4l2_int_device = {
-		.module = THIS_MODULE,
-		.name = TVP514X_MODULE_NAME,
-		.type = v4l2_int_type_slave,
-	},
-	.tvp514x_slave = {
-		.ioctls = tvp514x_ioctl_desc,
-		.num_ioctls = ARRAY_SIZE(tvp514x_ioctl_desc),
-	},
+
 };

-/**
+/*
  * tvp514x_probe - decoder driver i2c probe handler
  * @client: i2c driver client device structure
+ * @id: i2c driver id table
  *
  * Register decoder as an i2c client device and V4L2
  * device.
@@ -1391,67 +1240,59 @@ static int
 tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct tvp514x_decoder *decoder;
-	int err;
+	struct v4l2_subdev *sd;

 	/* Check if the adapter supports the needed features */
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 		return -EIO;

+	if (!client->dev.platform_data) {
+		v4l2_err(client, "No platform data!!\n");
+		return -ENODEV;
+	}
+
 	decoder = kzalloc(sizeof(*decoder), GFP_KERNEL);
 	if (!decoder)
 		return -ENOMEM;

-	if (!client->dev.platform_data) {
-		v4l_err(client, "No platform data!!\n");
-		err = -ENODEV;
-		goto out_free;
-	}
-
+	/*
+	 * Initialize the tvp514x_decoder with default configuration
+	 */
 	*decoder = tvp514x_dev;
-	decoder->v4l2_int_device.priv = decoder;
-	decoder->pdata = client->dev.platform_data;
-	decoder->v4l2_int_device.u.slave = &decoder->tvp514x_slave;
+	/* Copy default register configuration */
 	memcpy(decoder->tvp514x_regs, tvp514x_reg_list_default,
 			sizeof(tvp514x_reg_list_default));
+
+	/*
+	 * Copy board specific information here
+	 */
+	decoder->pdata = client->dev.platform_data;
+
 	/*
 	 * Fetch platform specific data, and configure the
 	 * tvp514x_reg_list[] accordingly. Since this is one
 	 * time configuration, no need to preserve.
 	 */
 	decoder->tvp514x_regs[REG_OUTPUT_FORMATTER2].val |=
-			(decoder->pdata->clk_polarity << 1);
+		(decoder->pdata->clk_polarity << 1);
 	decoder->tvp514x_regs[REG_SYNC_CONTROL].val |=
-			((decoder->pdata->hs_polarity << 2) |
-			(decoder->pdata->vs_polarity << 3));
-	/*
-	 * Save the id data, required for power up sequence
-	 */
-	decoder->id = (struct i2c_device_id *)id;
-	/* Attach to Master */
-	strcpy(decoder->v4l2_int_device.u.slave->attach_to,
-			decoder->pdata->master);
-	decoder->client = client;
-	i2c_set_clientdata(client, decoder);
+		((decoder->pdata->hs_polarity << 2) |
+		 (decoder->pdata->vs_polarity << 3));
+	/* Set default standard to auto */
+	decoder->tvp514x_regs[REG_VIDEO_STD].val =
+		VIDEO_STD_AUTO_SWITCH_BIT;

 	/* Register with V4L2 layer as slave device */
-	err = v4l2_int_device_register(&decoder->v4l2_int_device);
-	if (err) {
-		i2c_set_clientdata(client, NULL);
-		v4l_err(client,
-			"Unable to register to v4l2. Err[%d]\n", err);
-		goto out_free;
-
-	} else
-		v4l_info(client, "Registered to v4l2 master %s!!\n",
-				decoder->pdata->master);
+	sd = &decoder->sd;
+	v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
+
+	v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
+
 	return 0;

-out_free:
-	kfree(decoder);
-	return err;
 }

-/**
+/*
  * tvp514x_remove - decoder driver i2c remove handler
  * @client: i2c driver client device structure
  *
@@ -1460,13 +1301,10 @@ out_free:
  */
 static int __exit tvp514x_remove(struct i2c_client *client)
 {
-	struct tvp514x_decoder *decoder = i2c_get_clientdata(client);
+	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct tvp514x_decoder *decoder = to_decoder(sd);

-	if (!client->adapter)
-		return -ENODEV;	/* our client isn't attached */
-
-	v4l2_int_device_unregister(&decoder->v4l2_int_device);
-	i2c_set_clientdata(client, NULL);
+	v4l2_device_unregister_subdev(sd);
 	kfree(decoder);
 	return 0;
 }
@@ -1485,11 +1323,9 @@ static const struct tvp514x_reg tvp5146_init_reg_seq[] = {
 	{TOK_WRITE, REG_VBUS_DATA_ACCESS_NO_VBUS_ADDR_INCR, 0x00},
 	{TOK_WRITE, REG_OPERATION_MODE, 0x01},
 	{TOK_WRITE, REG_OPERATION_MODE, 0x00},
+	{TOK_TERM, 0, 0},
 };
-static const struct tvp514x_init_seq tvp5146_init = {
-	.no_regs = ARRAY_SIZE(tvp5146_init_reg_seq),
-	.init_reg_seq = tvp5146_init_reg_seq,
-};
+
 /*
  * TVP5147 Init/Power on Sequence
  */
@@ -1512,22 +1348,18 @@ static const struct tvp514x_reg tvp5147_init_reg_seq[] =	{
 	{TOK_WRITE, REG_VBUS_DATA_ACCESS_NO_VBUS_ADDR_INCR, 0x00},
 	{TOK_WRITE, REG_OPERATION_MODE, 0x01},
 	{TOK_WRITE, REG_OPERATION_MODE, 0x00},
+	{TOK_TERM, 0, 0},
 };
-static const struct tvp514x_init_seq tvp5147_init = {
-	.no_regs = ARRAY_SIZE(tvp5147_init_reg_seq),
-	.init_reg_seq = tvp5147_init_reg_seq,
-};
+
 /*
  * TVP5146M2/TVP5147M1 Init/Power on Sequence
  */
 static const struct tvp514x_reg tvp514xm_init_reg_seq[] = {
 	{TOK_WRITE, REG_OPERATION_MODE, 0x01},
 	{TOK_WRITE, REG_OPERATION_MODE, 0x00},
+	{TOK_TERM, 0, 0},
 };
-static const struct tvp514x_init_seq tvp514xm_init = {
-	.no_regs = ARRAY_SIZE(tvp514xm_init_reg_seq),
-	.init_reg_seq = tvp514xm_init_reg_seq,
-};
+
 /*
  * I2C Device Table -
  *
@@ -1535,48 +1367,22 @@ static const struct tvp514x_init_seq tvp514xm_init = {
  * driver_data - Driver data
  */
 static const struct i2c_device_id tvp514x_id[] = {
-	{"tvp5146", (unsigned long)&tvp5146_init},
-	{"tvp5146m2", (unsigned long)&tvp514xm_init},
-	{"tvp5147", (unsigned long)&tvp5147_init},
-	{"tvp5147m1", (unsigned long)&tvp514xm_init},
+	{"tvp5146", (unsigned long)tvp5146_init_reg_seq},
+	{"tvp5146m2", (unsigned long)tvp514xm_init_reg_seq},
+	{"tvp5147", (unsigned long)tvp5147_init_reg_seq},
+	{"tvp5147m1", (unsigned long)tvp514xm_init_reg_seq},
 	{},
 };

 MODULE_DEVICE_TABLE(i2c, tvp514x_id);

-static struct i2c_driver tvp514x_i2c_driver = {
-	.driver = {
-		   .name = TVP514X_MODULE_NAME,
-		   .owner = THIS_MODULE,
-		   },
+static struct v4l2_i2c_driver_data v4l2_i2c_data = {
+	.name = TVP514X_MODULE_NAME,
 	.probe = tvp514x_probe,
 	.remove = __exit_p(tvp514x_remove),
 	.id_table = tvp514x_id,
 };

-/**
- * tvp514x_init
- *
- * Module init function
- */
-static int __init tvp514x_init(void)
-{
-	return i2c_add_driver(&tvp514x_i2c_driver);
-}
-
-/**
- * tvp514x_cleanup
- *
- * Module exit function
- */
-static void __exit tvp514x_cleanup(void)
-{
-	i2c_del_driver(&tvp514x_i2c_driver);
-}
-
-module_init(tvp514x_init);
-module_exit(tvp514x_cleanup);
-
 MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("TVP514X linux decoder driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/tvp514x_regs.h b/drivers/media/video/tvp514x_regs.h
index 351620a..18f29ad 100644
--- a/drivers/media/video/tvp514x_regs.h
+++ b/drivers/media/video/tvp514x_regs.h
@@ -284,14 +284,4 @@ struct tvp514x_reg {
 	u32 val;
 };

-/**
- * struct tvp514x_init_seq - Structure for TVP5146/47/46M2/47M1 power up
- *		Sequence.
- * @ no_regs - Number of registers to write for power up sequence.
- * @ init_reg_seq - Array of registers and respective value to write.
- */
-struct tvp514x_init_seq {
-	unsigned int no_regs;
-	const struct tvp514x_reg *init_reg_seq;
-};
 #endif				/* ifndef _TVP514X_REGS_H */
diff --git a/include/media/tvp514x.h b/include/media/tvp514x.h
index 5e7ee96..74387e8 100644
--- a/include/media/tvp514x.h
+++ b/include/media/tvp514x.h
@@ -104,10 +104,6 @@ enum tvp514x_output {
  * @ vs_polarity: VSYNC Polarity configuration for current interface.
  */
 struct tvp514x_platform_data {
-	char *master;
-	int (*power_set) (enum v4l2_power on);
-	int (*ifparm) (struct v4l2_ifparm *p);
-	int (*priv_data_set) (void *);
 	/* Interface control params */
 	bool clk_polarity;
 	bool hs_polarity;
--
1.6.2.4


^ permalink raw reply related	[flat|nested] 270+ messages in thread
* RE: [PATCH 2/2] TVP514x V4L int device driver support
@ 2008-11-24 11:23 ` Hans Verkuil
  0 siblings, 0 replies; 270+ messages in thread
From: Hans Verkuil @ 2008-11-24 11:23 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: David Brownell, video4linux-list, linux-omap,
	davinci-linux-open-source-bounces

>
>
> Thanks,
> Vaibhav Hiremath
>
>> -----Original Message-----
>> From: Hans Verkuil [mailto:hverkuil@xs4all.nl]
>> Sent: Monday, November 24, 2008 3:02 PM
>> To: Hiremath, Vaibhav
>> Cc: David Brownell; video4linux-list@redhat.com; linux-
>> omap@vger.kernel.org; davinci-linux-open-source-
>> bounces@linux.davincidsp.com
>> Subject: RE: [PATCH 2/2] TVP514x V4L int device driver support
>>
>> >
>> >
>> > Thanks,
>> > Vaibhav Hiremath
>> >
>> >> -----Original Message-----
>> >> From: video4linux-list-bounces@redhat.com [mailto:video4linux-
>> list-
>> >> bounces@redhat.com] On Behalf Of Hans Verkuil
>> >> Sent: Monday, November 24, 2008 1:24 PM
>> >> To: David Brownell
>> >> Cc: video4linux-list@redhat.com; linux-omap@vger.kernel.org;
>> >> davinci-linux-open-source-bounces@linux.davincidsp.com
>> >> Subject: Re: [PATCH 2/2] TVP514x V4L int device driver support
>> >>
>> >> On Monday 24 November 2008 07:32:31 David Brownell wrote:
>> >> > On Sunday 23 November 2008, Trilok Soni wrote:
>> >> > > > 2) Please use the media/v4l2-i2c-drv.h or
>> >> > > > media/v4l2-i2c-drv-legacy.h header to hide some of the i2c
>> >> > > > complexity (again, see e.g. saa7115.c). The i2c API tends
>> to
>> >> > > > change a lot (and some changes are upcoming) so
>> >> >
>> >> > What "changes" do you mean?  Since this is not a legacy-style
>> >> > driver (yay!), the upcoming changes won't affect it at all.
>> >>
>> >> Oops, sorry. I thought it was a legacy driver, but it isn't.
>> There
>> >> are
>> >> changes upcoming for legacy drivers, but not for new-style
>> drivers.
>> >>
>> >> > > > using this header will mean that i2c driver changes will be
>> >> > > > minimal in the future. In addition it will ensure that this
>> >> > > > driver can be compiled with older kernels as well once it
>> is
>> >> part
>> >> > > > of the v4l-dvb repository.
>> >> > >
>> >> > > I don't agree with having support to compile with older
>> kernels.
>> >> >
>> >> > Right.  Folk wanting legacy tvp5146 and tvp5140 support could
>> >> > try to use the legacy drivers from the DaVinci tree.
>> >>
>> >> The v4l-dvb mercurial tree at www.linuxtv.org/hg which is the
>> main
>> >> v4l-dvb repository can support kernels >= 2.6.16. Before new
>> stuff
>> >> is
>> >> merged with the git kernel all the compatibility stuff for old
>> >> kernels
>> >> is stripped out, so you don't see it in the actual kernel code.
>> >> Using
>> >> the media/v4l2-i2c-drv.h header makes it much easier to support
>> >> these
>> >> older kernels and it actually reduces the code size as well. Most
>> >> v4l
>> >> i2c drivers are already converted or will be converted soon. It's
>> a
>> >> v4l
>> >> thing.
>> >>
>> >> > > Even though I2C APIs change as lot it is for good, and
>> creating
>> >> > > abstractions doesn't help as saa7xxx is family of chips where
>> I
>> >> > > don't see the case here. Once this driver is mainlined if
>> >> someone
>> >> > > does i2c subsystem change which breaks this driver from
>> building
>> >> > > then he/she has to make changes to all the code affecting it.
>> >> >
>> >> > And AFAIK no such change is anticipated.  The conversion from
>> >> > legacy style I2C drivers to "new style" driver-model friendly
>> >> > drivers is progressing fairly well, so that legacy support can
>> >> > be completely removed.
>> >> >
>> >> > > I am not in favour of adding support to compile with older
>> >> kernels.
>> >> >
>> >> > My two cents:  I'm not in favor either.  In fact that's the
>> >> > general policy for mainline drivers, and I'm surprised to hear
>> >> > any maintainer suggest it be added.
>> >>
>> >> Again, it's specific to v4l drivers. You don't have to do it, but
>> it
>> >> makes it consistent with the other v4l i2c drivers and when the
>> >> driver
>> >> is in the v4l-dvb repository you get support for older kernels
>> for
>> >> free.
>> >>
>> > [Hiremath, Vaibhav] Again only to maintain consistency, supporting
>> legacy
>> > wrapper is not good practice (In my opinion). Why can't we have
>> new driver
>> > coming with new interface and old drivers still can have legacy
>> wrappers?
>>
>> It's no big deal for me, it was just a suggestion. We have noticed
>> that a
>> lot of people actually use the v4l-dvb repository to be able to get
>> the
>> latest v4l-dvb drivers for older kernels. Using these wrappers makes
>> it
>> trivial to provide that service, that's all. Just concentrate on
>> points 1
>> (trivial to fix) and 4 (the only really important and 'must fix'
>> issue).
>>
> [Hiremath, Vaibhav] Thanks Hans.
> Point 1 - I completely agree to your point and will fix this.
>
> Point 4 - If I understand it correctly, you are referring to parameters,
> functions exported from board specific file.
>
> Let me explain the TVP514x driver interface -
>
> Board specific file (for me arch/arm/mach-omap2/board-omap3evm-dc.c)
> exports Default register list (tvp514x_reg), input list supported
> (tvp514x_input_info), etc...
> The platform specific structure for tvp514x is looking like -
>
> static struct tvp514x_platform_data tvp5146_pdata = {
>         .power_set = tvp5146_power_set,
>         .priv_data_set = tvp5146_set_prv_data,
>         .ifparm = tvp5146_ifparm,
>
>         /* TVP5146 regsiter list, contains default values */
>         .reg_list = tvp5146_reg_list,
>
>         /* Number of supported inputs */
>         .num_inputs = TVP5146_NUM_INPUTS,
>         .input_list = tvp5146_input_list,
> };
>
>
> Are you talking about the dependency for default register list and input
> list on board specific file?

Yes. The basic rule is that only the i2c driver knows about what registers
to use. Bridge drivers should not care about that.

Things like input settings are done through the VIDIOC_INT_S_VIDEO_ROUTING
and VIDIOC_INT_S_AUDIO_ROUTING internal commands. The i2c driver header
provides high-level defines for that (which can actually map directly to
register values, but that's an implementation issue).

Again, the saa7115.c and media/saa7115.h files are very good examples of
this. And the ivtv-cards.c source is a good example of how it is used in
practice.

For the record, I'm using ivtv so often as an example because 1) I'm the
maintainer of that driver, but also because 2) it uses no less than 13 i2c
modules in various combinations and also gpio to control similar chips
that are not on the i2c bus. So that makes it an excellent non-trivial
example of how to use sub devices like tvp514x.

> I believe we can very well move it to tvp driver file, actually I found it
> easy to have complete default configuration list coming from board
> specific file instead of asking/taking some (required) params only.

It works great as long as there is only one user of tvp514x, but as soon
as a different board comes along then you run into problems.

It shouldn't be a big deal to move the default registers to the driver and
to add routing support to be able to select which inputs are used. Just
remember that the media/tvp514x.h header should be high-level and that
bridge drivers should not set registers directly. Knowledge of the
register map belongs to tvp514x.c only.

Regards,

        Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 270+ messages in thread
* RE: [PATCH 2/2] TVP514x V4L int device driver support
@ 2008-11-24 10:22 Hans Verkuil
  0 siblings, 0 replies; 270+ messages in thread
From: Hans Verkuil @ 2008-11-24 10:22 UTC (permalink / raw)
  To: Hiremath, Vaibhav; +Cc: video4linux-list, linux-omap, davinci-linux-open-source

> Hans,
>
> Thanks,
> Vaibhav Hiremath
>
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of Trilok Soni
>> Sent: Monday, November 24, 2008 2:13 PM
>> To: Hans Verkuil
>> Cc: video4linux-list@redhat.com; linux-omap@vger.kernel.org;
>> davinci-linux-open-source@linux.davincidsp.com
>> Subject: Re: [PATCH 2/2] TVP514x V4L int device driver support
>>
>> Hi Hans,
>>
>> >
>> > The v4l2-int-device.h stuff should never have been added. Ditto
>> for
>> > parts of the soc-camera framework that duplicates v4l2-int-
>> device.h. My
>> > new v4l2_subdev support will replace the three methods of using
>> i2c
>> > devices (or similar) that are currently in use. It's exactly to
>> reduce
>> > the confusion that I'm working on this.
>> >
>> > It's been discussed before on the v4l mailinglist and the relevant
>> > developers are aware of this. It's almost finished, just need to
>> track
>> > down a single remaining oops.
>>
>> Right, I will wait for your updates.
>>
>> I am planning to send omap24xxcam and ov9640 drivers (now deleted)
>> available from linux-omap tree after syncing them with latest
>> linux-2.6.x tree, and the whole driver and the sensor is written
>> using
>> v4l2-int-device framework. I am going to send it anyway, so that it
>> can have some review comments.
>>
> [Hiremath, Vaibhav] Is your current development accessible through
> linuxtv.org? Can you share it with us, so that we can have a look into it?
> Which driver you are migrating to new interface (which I can refer to as a
> sample)?

Yes, it is. Look at these two trees:

http://linuxtv.org/hg/~hverkuil/v4l-dvb-media2
http://linuxtv.org/hg/~hverkuil/v4l-dvb-ng

The second tree is meant to be merged into the v4l-dvb master, but is
missing the converted ivtv driver: there is still a kernel oops there in a
corner case when loading the ivtv driver that I need to fix first.

The first tree has slightly older (but almost identical) code and a
converted ivtv driver that you can look at. Most important are the files
Documentation/video4linux/v4l2-framework.txt that explains the new structs
and the v4l2-device.h and v4l2-subdev.h headers.

Note that there are currently no sensor support ops in v4l2-subdev.h. This
will have to be added (should be trivial).

> Again I would like to know, how are we handling current drivers
> (soc-camera and v4l2-int)?

soc-camera and v4l2-int are the exceptions. All other drivers use the i2c
command function to communicate with i2c drivers (ioctl-like API).

Just a note on soc-camera: it's only the soc_camera_ops struct that I want
to see replaced (eventually) by v4l2_subdev. What I want is that subdevice
drivers like tvp514x, but also sensor drivers like mt9xxxx should be
independent of the host (bridge) driver. That way they can be reused
properly. For example, having the mt9m001.c driver use soc_camera makes it
much harder to use with e.g. a USB webcam driver which is not based on the
soc_camera framework.

Regards,

       Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 270+ messages in thread
* RE: [PATCH 2/2] TVP514x V4L int device driver support
@ 2008-11-24  9:32 ` Hans Verkuil
  0 siblings, 0 replies; 270+ messages in thread
From: Hans Verkuil @ 2008-11-24  9:32 UTC (permalink / raw)
  To: Hiremath, Vaibhav
  Cc: David Brownell, video4linux-list, linux-omap,
	davinci-linux-open-source-bounces

>
>
> Thanks,
> Vaibhav Hiremath
>
>> -----Original Message-----
>> From: video4linux-list-bounces@redhat.com [mailto:video4linux-list-
>> bounces@redhat.com] On Behalf Of Hans Verkuil
>> Sent: Monday, November 24, 2008 1:24 PM
>> To: David Brownell
>> Cc: video4linux-list@redhat.com; linux-omap@vger.kernel.org;
>> davinci-linux-open-source-bounces@linux.davincidsp.com
>> Subject: Re: [PATCH 2/2] TVP514x V4L int device driver support
>>
>> On Monday 24 November 2008 07:32:31 David Brownell wrote:
>> > On Sunday 23 November 2008, Trilok Soni wrote:
>> > > > 2) Please use the media/v4l2-i2c-drv.h or
>> > > > media/v4l2-i2c-drv-legacy.h header to hide some of the i2c
>> > > > complexity (again, see e.g. saa7115.c). The i2c API tends to
>> > > > change a lot (and some changes are upcoming) so
>> >
>> > What "changes" do you mean?  Since this is not a legacy-style
>> > driver (yay!), the upcoming changes won't affect it at all.
>>
>> Oops, sorry. I thought it was a legacy driver, but it isn't. There
>> are
>> changes upcoming for legacy drivers, but not for new-style drivers.
>>
>> > > > using this header will mean that i2c driver changes will be
>> > > > minimal in the future. In addition it will ensure that this
>> > > > driver can be compiled with older kernels as well once it is
>> part
>> > > > of the v4l-dvb repository.
>> > >
>> > > I don't agree with having support to compile with older kernels.
>> >
>> > Right.  Folk wanting legacy tvp5146 and tvp5140 support could
>> > try to use the legacy drivers from the DaVinci tree.
>>
>> The v4l-dvb mercurial tree at www.linuxtv.org/hg which is the main
>> v4l-dvb repository can support kernels >= 2.6.16. Before new stuff
>> is
>> merged with the git kernel all the compatibility stuff for old
>> kernels
>> is stripped out, so you don't see it in the actual kernel code.
>> Using
>> the media/v4l2-i2c-drv.h header makes it much easier to support
>> these
>> older kernels and it actually reduces the code size as well. Most
>> v4l
>> i2c drivers are already converted or will be converted soon. It's a
>> v4l
>> thing.
>>
>> > > Even though I2C APIs change as lot it is for good, and creating
>> > > abstractions doesn't help as saa7xxx is family of chips where I
>> > > don't see the case here. Once this driver is mainlined if
>> someone
>> > > does i2c subsystem change which breaks this driver from building
>> > > then he/she has to make changes to all the code affecting it.
>> >
>> > And AFAIK no such change is anticipated.  The conversion from
>> > legacy style I2C drivers to "new style" driver-model friendly
>> > drivers is progressing fairly well, so that legacy support can
>> > be completely removed.
>> >
>> > > I am not in favour of adding support to compile with older
>> kernels.
>> >
>> > My two cents:  I'm not in favor either.  In fact that's the
>> > general policy for mainline drivers, and I'm surprised to hear
>> > any maintainer suggest it be added.
>>
>> Again, it's specific to v4l drivers. You don't have to do it, but it
>> makes it consistent with the other v4l i2c drivers and when the
>> driver
>> is in the v4l-dvb repository you get support for older kernels for
>> free.
>>
> [Hiremath, Vaibhav] Again only to maintain consistency, supporting legacy
> wrapper is not good practice (In my opinion). Why can't we have new driver
> coming with new interface and old drivers still can have legacy wrappers?

It's no big deal for me, it was just a suggestion. We have noticed that a
lot of people actually use the v4l-dvb repository to be able to get the
latest v4l-dvb drivers for older kernels. Using these wrappers makes it
trivial to provide that service, that's all. Just concentrate on points 1
(trivial to fix) and 4 (the only really important and 'must fix' issue).

Regards,

        Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 270+ messages in thread

end of thread, other threads:[~2013-05-29 19:07 UTC | newest]

Thread overview: 270+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <hvaibhav@ti.com>
2008-11-21 15:22 ` [PATCH 2/2] TVP514x V4L int device driver support hvaibhav
2008-11-21 16:16   ` Hans Verkuil
2008-11-21 18:12   ` Trilok Soni
2008-11-21 18:12     ` Trilok Soni
2008-11-21 19:07     ` Hiremath, Vaibhav
2008-11-21 19:07       ` Hiremath, Vaibhav
2008-11-21 19:11     ` David Brownell
2008-11-23 22:00   ` Hans Verkuil
2008-11-23 22:04     ` Koen Kooi
2008-11-24  6:16     ` Trilok Soni
2008-11-24  6:16       ` Trilok Soni
2008-11-24  6:32       ` David Brownell
2008-11-24  7:53         ` Hans Verkuil
2008-11-24  8:53           ` Hiremath, Vaibhav
2008-11-24  8:53             ` Hiremath, Vaibhav
2008-11-24  8:04       ` Hans Verkuil
2008-11-24  8:04         ` Hans Verkuil
2008-11-24  8:43         ` Trilok Soni
2008-11-24  8:43           ` Trilok Soni
2008-11-24  8:59           ` Hiremath, Vaibhav
2008-11-24  8:59             ` Hiremath, Vaibhav
2008-11-24 10:06   ` David Brownell
2008-11-26 17:04 ` [PATCH 1/2] Add Input/Output related ioctl support hvaibhav
2008-11-26 17:15   ` Hans Verkuil
2008-11-26 17:15     ` Hans Verkuil
2008-11-26 17:05 ` [PATCH 2/2] TVP514x Driver with Review comments fixed hvaibhav
2008-11-26 17:05   ` hvaibhav
2008-11-26 17:48   ` Hans Verkuil
2008-12-02 15:35 ` [PATCH 2/2] TVP514x Driver with Review comments fixed [V4] hvaibhav
2008-12-02 15:35   ` hvaibhav
2008-12-02 17:20   ` Hans Verkuil
2008-12-03  3:58     ` Hiremath, Vaibhav
2008-12-03  3:58       ` Hiremath, Vaibhav
2008-12-03 13:43     ` V4L2 PIXEL buffer conversion Jonathan Lafontaine
2008-12-02 19:29   ` [PATCH 2/2] TVP514x Driver with Review comments fixed [V4] David Brownell
2008-12-02 19:44   ` David Brownell
2009-11-18  6:58 ` [U-Boot] [PATCH] OMAP3EVM: Added NAND support hvaibhav at ti.com
2009-11-18  7:30   ` Dirk Behme
2009-11-18  8:25     ` Hiremath, Vaibhav
2009-11-18 18:07   ` Nishanth Menon
2009-11-18 18:18     ` Scott Wood
2009-11-18 18:40     ` Hiremath, Vaibhav
2009-11-18  8:26 ` hvaibhav at ti.com
2009-11-18  8:36   ` Dirk Behme
2009-11-18 14:40     ` Hiremath, Vaibhav
2009-11-23 11:05 ` [U-Boot] [PATCH V4] " hvaibhav at ti.com
2009-11-27 15:51   ` Tom
2009-11-30 17:49     ` Hiremath, Vaibhav
2009-11-23 11:06 ` [U-Boot] [PATCH] omap3_mmc: Encapsulate twl4030 under option CONFIG_TWL4030_POWER hvaibhav at ti.com
2009-11-27 14:03   ` Tom
2009-11-30 17:43     ` Hiremath, Vaibhav
2009-11-23 11:06 ` [U-Boot] [PATCH 1/5] Introducing AM3517EVM support hvaibhav at ti.com
2009-11-23 19:43   ` Wolfgang Denk
2009-11-26  4:24     ` Hiremath, Vaibhav
2009-11-23 11:08 ` [U-Boot] [PATCH 0/5] Introducing TI's New SoC/board AM3517EVM hvaibhav at ti.com
2009-11-23 13:50   ` Paulraj, Sandeep
2009-11-23 14:16     ` Hiremath, Vaibhav
2009-11-23 20:03     ` Wolfgang Denk
2009-11-26  4:49       ` Hiremath, Vaibhav
2009-11-25 20:24   ` Tom
2009-11-23 11:08 ` [U-Boot] [PATCH 2/5] am3517_evm_config options added to Makfile hvaibhav at ti.com
2009-11-23 19:44   ` Wolfgang Denk
2009-11-26  4:25     ` Hiremath, Vaibhav
2009-11-23 11:08 ` [U-Boot] [PATCH 3/5] Added configuration file for AM3517EVM hvaibhav at ti.com
2009-11-23 19:46   ` Wolfgang Denk
2009-11-26  4:43     ` Hiremath, Vaibhav
2009-11-26 16:04       ` Tom
2009-11-30 17:01         ` Hiremath, Vaibhav
2009-12-05  0:20       ` Wolfgang Denk
2009-11-23 11:08 ` [U-Boot] [PATCH 4/5] AM3517EVM: Add mux configuration hvaibhav at ti.com
2009-11-23 19:49   ` Wolfgang Denk
2009-11-26  4:45     ` Hiremath, Vaibhav
2009-11-26 16:07       ` Tom
2009-12-05  0:23       ` Wolfgang Denk
2009-11-23 11:09 ` [U-Boot] [PATCH 5/5] AM3517: Add support for EMIF4 hvaibhav at ti.com
2009-11-23 19:50   ` Wolfgang Denk
2009-11-26  4:48     ` Hiremath, Vaibhav
2009-11-26 16:14       ` Tom
2009-11-30 17:03         ` Hiremath, Vaibhav
2010-01-30 10:16 ` [U-Boot] [PATCH 0/3] Add Support for AM3517EVM with EMIF4 hvaibhav at ti.com
2010-02-02 18:40   ` Hiremath, Vaibhav
2010-02-03 13:24     ` Tom
2010-02-03 13:26       ` Hiremath, Vaibhav
2010-01-30 10:16 ` [U-Boot] [PATCH 1/3] OMAP3: Consolidate SDRC related operations hvaibhav at ti.com
2010-02-07 16:13   ` Tom
2010-02-10  9:35     ` Hiremath, Vaibhav
2010-04-23 14:55 ` [U-Boot] [RESEND:PATCH-V4] OMAP3EVM: Added NAND support hvaibhav at ti.com
2010-05-05 20:01   ` Wolfgang Denk
2010-05-06  5:36     ` Hiremath, Vaibhav
2010-05-06 10:40       ` Nishanth Menon
2010-05-06 10:50         ` Wolfgang Denk
2010-05-06 10:54           ` Nishanth Menon
2010-05-06 11:03             ` Wolfgang Denk
2010-05-06 11:11               ` Nishanth Menon
2010-05-06 11:28                 ` Wolfgang Denk
2010-05-06 11:04           ` Hiremath, Vaibhav
2010-05-06 10:59       ` Wolfgang Denk
2010-04-23 14:55 ` [U-Boot] [PATCH-V2 2/4] omap3: Consolidate SDRC related operations hvaibhav at ti.com
2010-05-05 20:07   ` Wolfgang Denk
2010-05-06  6:49     ` Hiremath, Vaibhav
2010-05-06 10:55       ` Wolfgang Denk
2010-04-23 14:55 ` [U-Boot] [PATCH-V2 3/4] AM35x: Add support for AM3517EVM hvaibhav at ti.com
2010-05-05 20:12   ` Wolfgang Denk
2010-05-06  6:52     ` Hiremath, Vaibhav
2010-05-06 10:52       ` Wolfgang Denk
2010-04-23 14:55 ` [U-Boot] [PATCH-V2 4/4] AM35x: Add support for EMIF4 hvaibhav at ti.com
2010-05-05 20:14   ` Wolfgang Denk
2010-05-06  6:56     ` Hiremath, Vaibhav
2010-05-06 10:56       ` Wolfgang Denk
2010-05-06 17:19 ` [U-Boot] [PATCH-V5] OMAP3EVM: Added NAND support hvaibhav at ti.com
2010-05-11  4:59   ` Hiremath, Vaibhav
2010-05-11  8:59     ` Wolfgang Denk
2010-05-11  9:01       ` Hiremath, Vaibhav
2010-05-11 20:11       ` Scott Wood
2010-05-06 17:23 ` [U-Boot] [PATCH-V3 1/2] AM35x: Add support for AM3517EVM hvaibhav at ti.com
2010-05-11  5:00   ` Hiremath, Vaibhav
2010-05-31  9:40   ` Wolfgang Denk
2010-06-03 17:27     ` Hiremath, Vaibhav
2010-06-07  8:56     ` Hiremath, Vaibhav
2010-06-07 12:24       ` Wolfgang Denk
2010-06-07 14:23         ` Hiremath, Vaibhav
2010-05-06 17:23 ` [U-Boot] [PATCH-V3 2/2] AM35x: Add support for EMIF4 hvaibhav at ti.com
2010-05-31  9:43   ` Wolfgang Denk
2010-06-03 17:28     ` Hiremath, Vaibhav
2010-06-07 14:59 ` [U-Boot] [PATCH-V4 1/2] AM35x: Add support for AM3517EVM hvaibhav at ti.com
2010-06-07 21:20   ` Paulraj, Sandeep
2010-11-29 16:21 ` [U-Boot] [PATCH] AM3517:Fix for ARM Relocation support hvaibhav at ti.com
2010-11-29 16:24   ` Hiremath, Vaibhav
2010-11-29 16:32     ` Paulraj, Sandeep
2010-11-29 16:22 ` [U-Boot] [PATCH] AM3517:Build FIX: undef CONFIG_CMD_NFS support hvaibhav at ti.com
2010-11-29 21:36   ` Paulraj, Sandeep
2010-11-29 16:23 ` [U-Boot] [PATCH] AM3517:EMIF4: fix SDRAM size to 256Mb hvaibhav at ti.com
2010-11-29 21:36   ` Paulraj, Sandeep
2010-11-29 21:37   ` Paulraj, Sandeep
2011-08-01 14:21 ` [U-Boot] [PATCH] omap3evm: Use generic MMC driver hvaibhav at ti.com
2011-08-17  2:32   ` Andy Fleming
2011-08-01 14:21 ` [U-Boot] [PATCH] am3517evm: " hvaibhav at ti.com
2011-08-17  2:33   ` Andy Fleming
2013-03-15  7:11 ` [U-Boot] [PATCH] am335x: Enable DDR PHY dynamic power down bit for DDR3 boards Vaibhav Hiremath
2013-03-15 15:05   ` Tom Rini
2013-03-15 15:56     ` Lars Poeschel
2013-03-26 14:53   ` [U-Boot] " Tom Rini
2013-03-04 11:35 [RFC PATCH 3/3] ARM: OMAP2+: Add command line parameter for debugSS module control hvaibhav
2013-03-04 11:35 ` hvaibhav at ti.com
2013-04-08 17:29 ` Tony Lindgren
2013-04-08 17:29   ` Tony Lindgren
2013-04-09  8:07   ` Hiremath, Vaibhav
2013-04-09  8:07     ` Hiremath, Vaibhav
2013-04-09 16:34     ` Tony Lindgren
2013-04-09 16:34       ` Tony Lindgren
2013-04-10  5:11       ` Hiremath, Vaibhav
2013-04-10  5:11         ` Hiremath, Vaibhav
2013-04-10 17:07         ` Tony Lindgren
2013-04-10 17:07           ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2013-03-04 11:35 [RFC PATCH 1/3] ARM: AM33XX: clock: Add debugSS clock nodes to clock tree hvaibhav
2013-03-04 11:35 ` hvaibhav at ti.com
2013-05-29 19:07 ` Paul Walmsley
2013-05-29 19:07   ` Paul Walmsley
2013-03-04 11:35 [RFC PATCH 0/3] ARM: OMAP2+: Add command line parameter for debugSS module control hvaibhav
2013-03-04 11:35 ` hvaibhav at ti.com
2013-03-14 11:29 ` Hiremath, Vaibhav
2013-03-14 11:29   ` Hiremath, Vaibhav
2013-04-08 17:30   ` Tony Lindgren
2013-04-08 17:30     ` Tony Lindgren
2013-04-09  8:11     ` Hiremath, Vaibhav
2013-04-09  8:11       ` Hiremath, Vaibhav
2011-12-02  6:43 [PATCH-V5 2/3] arm:omap:am33xx: Add AM335XEVM machine support hvaibhav
2011-12-02  6:43 ` hvaibhav at ti.com
2012-05-02  9:23 ` Paul Walmsley
2012-05-02  9:23   ` Paul Walmsley
2012-05-02  9:34   ` Hiremath, Vaibhav
2012-05-02  9:34     ` Hiremath, Vaibhav
2012-05-03 15:57     ` Tony Lindgren
2012-05-03 15:57       ` Tony Lindgren
2012-05-03 16:41       ` Hiremath, Vaibhav
2012-05-03 16:41         ` Hiremath, Vaibhav
2012-05-03 19:37         ` Tony Lindgren
2012-05-03 19:37           ` Tony Lindgren
2012-05-04  6:14           ` Hiremath, Vaibhav
2012-05-04  6:14             ` Hiremath, Vaibhav
2012-05-03 21:17         ` Kevin Hilman
2012-05-03 21:17           ` Kevin Hilman
2012-05-04  6:00           ` Hiremath, Vaibhav
2012-05-04  6:00             ` Hiremath, Vaibhav
2012-05-04 20:05             ` Tony Lindgren
2012-05-04 20:05               ` Tony Lindgren
2012-05-07 14:38               ` Hiremath, Vaibhav
2012-05-07 14:38                 ` Hiremath, Vaibhav
2012-05-07 17:32                 ` Tony Lindgren
2012-05-07 17:32                   ` Tony Lindgren
2012-05-07 18:55                   ` Hiremath, Vaibhav
2012-05-07 18:55                     ` Hiremath, Vaibhav
2012-05-08 19:06                     ` Tony Lindgren
2012-05-08 19:06                       ` Tony Lindgren
2012-05-08 19:57                       ` Hiremath, Vaibhav
2012-05-08 19:57                         ` Hiremath, Vaibhav
2012-05-04  6:28       ` Hiremath, Vaibhav
2012-05-04  6:28         ` Hiremath, Vaibhav
2012-05-04 20:00         ` Tony Lindgren
2012-05-04 20:00           ` Tony Lindgren
2011-12-02  6:43 [PATCH-V5 1/3] arm:omap:am33xx: Update common OMAP machine specific sources hvaibhav
2011-12-02  6:43 ` hvaibhav at ti.com
2011-12-07 21:09 ` Tony Lindgren
2011-12-07 21:09   ` Tony Lindgren
2011-12-02  6:43 [PATCH-V5 0/3] Introducing TI's New SoC/board AM335XEVM hvaibhav
2011-12-02  6:43 ` hvaibhav at ti.com
2011-12-07  0:24 ` Kevin Hilman
2011-12-07  0:24   ` Kevin Hilman
2011-12-07 21:10   ` Tony Lindgren
2011-12-07 21:10     ` Tony Lindgren
2011-12-08 13:45     ` Hiremath, Vaibhav
2011-12-08 13:45       ` Hiremath, Vaibhav
2011-12-08 17:18       ` Tony Lindgren
2011-12-08 17:18         ` Tony Lindgren
2012-02-01  6:53         ` Hiremath, Vaibhav
2012-02-01  6:53           ` Hiremath, Vaibhav
2012-01-18  8:47     ` Hiremath, Vaibhav
2012-01-18  8:47       ` Hiremath, Vaibhav
2011-09-20 14:32 [PATCH-V3 4/4] arm:omap:am33xx: Add low level debugging support hvaibhav
2011-09-20 14:32 ` hvaibhav at ti.com
2011-10-06 23:09 ` Tony Lindgren
2011-10-06 23:09   ` Tony Lindgren
2011-11-07 15:17   ` Hiremath, Vaibhav
2011-11-07 15:17     ` Hiremath, Vaibhav
2011-11-07 18:16     ` Tony Lindgren
2011-11-07 18:16       ` Tony Lindgren
2011-09-20 14:32 [PATCH-V3 3/4] arm:omap:am33xx: Create board support and enable build for AM335XEVM hvaibhav
2011-09-20 14:32 ` hvaibhav at ti.com
2011-10-06 23:07 ` Tony Lindgren
2011-10-06 23:07   ` Tony Lindgren
2011-09-20 14:32 [PATCH-V3 2/4] arm:omap:am33xx: Update common OMAP machine specific sources hvaibhav
2011-09-20 14:32 ` hvaibhav at ti.com
2011-09-26 18:45 ` Kevin Hilman
2011-09-26 18:45   ` Kevin Hilman
2011-09-30 12:09   ` Premi, Sanjeev
2011-09-30 12:09     ` Premi, Sanjeev
2011-09-30 17:09     ` Kevin Hilman
2011-09-30 17:09       ` Kevin Hilman
2011-10-06 23:03       ` Tony Lindgren
2011-10-06 23:03         ` Tony Lindgren
2011-11-03 13:48         ` Hiremath, Vaibhav
2011-11-03 13:48           ` Hiremath, Vaibhav
2011-11-05  9:41 ` Hiremath, Vaibhav
2011-11-05  9:41   ` Hiremath, Vaibhav
2011-11-05 10:29   ` Hiremath, Vaibhav
2011-11-05 10:29     ` Hiremath, Vaibhav
2011-09-20 14:32 [PATCH-V3 1/4] arm:omap:am33xx: Update common omap platform files hvaibhav
2011-09-20 14:32 ` hvaibhav at ti.com
2011-10-06 23:03 ` Tony Lindgren
2011-10-06 23:03   ` Tony Lindgren
2011-08-29 12:46 [RFC PATCH-V2 0/4] Introducing TI's New SoC/board AM335XEVM hvaibhav
2011-08-29 12:46 ` hvaibhav at ti.com
2011-09-15  0:32 ` Tony Lindgren
2011-09-15  0:32   ` Tony Lindgren
2011-09-15  7:13   ` Hiremath, Vaibhav
2011-09-15  7:13     ` Hiremath, Vaibhav
2009-05-06 18:31 [PATCH (V2)] TVP514x: Migration to sub-device framework hvaibhav
2009-06-14 10:14 ` Hans Verkuil
2009-06-14 12:44   ` Hans Verkuil
2009-06-14 14:32     ` tcm825x.c: migrating to sub-device framework? (was: TVP514x: Migration to sub-device framework) Hans Verkuil
2009-06-15  8:45       ` tcm825x.c: migrating to sub-device framework? Sakari Ailus
2009-06-14 19:50   ` [PATCH (V2)] TVP514x: Migration to sub-device framework David Brownell
2009-06-14 19:50     ` David Brownell
2008-11-24 11:23 [PATCH 2/2] TVP514x V4L int device driver support Hans Verkuil
2008-11-24 11:23 ` Hans Verkuil
2008-11-24 10:22 Hans Verkuil
2008-11-24  9:32 Hans Verkuil
2008-11-24  9:32 ` Hans Verkuil
2008-11-24 10:46 ` Hiremath, Vaibhav
2008-11-24 10:46   ` Hiremath, Vaibhav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.