* [PATCH v7 1/8] davinci: vpif: remove machine specific inclusion from driver
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2011-12-22 13:10 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 2/8] ARM: davinci: create new common platform header for davinci Manjunath Hadli
` (6 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
remove machine specific inclusion from the driver which
comes in the way of platform code consolidation.
currently was seen that these header inclusions were
not necessary.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: LMML <linux-media@vger.kernel.org>
---
drivers/media/video/davinci/vpif.h | 2 --
drivers/media/video/davinci/vpif_display.c | 2 --
include/media/davinci/vpif_types.h | 2 ++
sound/soc/codecs/cq93vc.c | 2 --
4 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
index 25036cb..8bcac65 100644
--- a/drivers/media/video/davinci/vpif.h
+++ b/drivers/media/video/davinci/vpif.h
@@ -18,8 +18,6 @@
#include <linux/io.h>
#include <linux/videodev2.h>
-#include <mach/hardware.h>
-#include <mach/dm646x.h>
#include <media/davinci/vpif_types.h>
/* Maximum channel allowed */
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index 286f029..7fa34b4 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -39,8 +39,6 @@
#include <media/v4l2-ioctl.h>
#include <media/v4l2-chip-ident.h>
-#include <mach/dm646x.h>
-
#include "vpif_display.h"
#include "vpif.h"
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index 9929b05..bd8217c 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -17,6 +17,8 @@
#ifndef _VPIF_TYPES_H
#define _VPIF_TYPES_H
+#include <linux/i2c.h>
+
#define VPIF_CAPTURE_MAX_CHANNELS 2
enum vpif_if_type {
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c
index 46dbfd0..ff4eb7a 100644
--- a/sound/soc/codecs/cq93vc.c
+++ b/sound/soc/codecs/cq93vc.c
@@ -38,8 +38,6 @@
#include <sound/soc.h>
#include <sound/initval.h>
-#include <mach/dm365.h>
-
static inline unsigned int cq93vc_read(struct snd_soc_codec *codec,
unsigned int reg)
{
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 1/8] davinci: vpif: remove machine specific inclusion from driver
2011-12-21 13:43 ` [PATCH v7 1/8] davinci: vpif: remove machine specific inclusion from driver Manjunath Hadli
@ 2011-12-22 13:10 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2011-12-22 13:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:34, Hadli, Manjunath wrote:
> remove machine specific inclusion from the driver which
> comes in the way of platform code consolidation.
I think it would be more readable to use the term "header file"
here and in the headline. Just "machine specific inclusion"
begs the question - "inclusion of what?"
> currently was seen that these header inclusions were
> not necessary.
Sorry about nit-picking, but it is not good to talk in
past tense in commit text. Past tense is natural for you
to use since you write the text after making the changes,
but for the reviewer it is not natural since he is seeing
the commit text and the patch both at once. Also, usage
of "currently" in above line is not necessary. It is assumed
that commit text talks about current state of affairs.
I would have made these changes myself after Mauro's ack,
but..
>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: LMML <linux-media@vger.kernel.org>
> ---
> drivers/media/video/davinci/vpif.h | 2 --
> drivers/media/video/davinci/vpif_display.c | 2 --
> include/media/davinci/vpif_types.h | 2 ++
> sound/soc/codecs/cq93vc.c | 2 --
.. you clubbed this unrelated sound/soc/ change in this patch.
First, the change is not related to VPIF in any way so it
has no business being in this patch. Second, there is no way
the sound/soc folks will have a look at this patch, so basically
the change will end up bypassing the right maintainers if other
reviewers fail to catch it.
Please separate the change into another patch. You can just
post the two patches alone copying the right maintainers
in each instead of posting the entire series again.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 2/8] ARM: davinci: create new common platform header for davinci
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
2011-12-21 13:43 ` [PATCH v7 1/8] davinci: vpif: remove machine specific inclusion from driver Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2012-02-20 13:31 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 3/8] davinci: eliminate use of IO_ADDRESS() on sysmod Manjunath Hadli
` (5 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
remove individual platform header files for dm365, dm355, dm644x
and dm646x and consolidate it into a single and common
header file davinci.h placed in arch/arm/mach-davinci.
This reduces the pollution in the include/mach and is consistent
with Russel's suggestions as part of his "pet peaves" mail.
The further patches in the series take advantage of this consolidation
for easy implementation of IO_ADDRESS elimination.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
---
arch/arm/mach-davinci/board-dm355-evm.c | 3 +-
arch/arm/mach-davinci/board-dm355-leopard.c | 3 +-
arch/arm/mach-davinci/board-dm365-evm.c | 3 +-
arch/arm/mach-davinci/board-dm644x-evm.c | 3 +-
arch/arm/mach-davinci/board-dm646x-evm.c | 2 +-
arch/arm/mach-davinci/board-neuros-osd2.c | 3 +-
arch/arm/mach-davinci/board-sffsdr.c | 3 +-
arch/arm/mach-davinci/davinci.h | 85 +++++++++++++++++++++++++++
arch/arm/mach-davinci/dm355.c | 2 +-
arch/arm/mach-davinci/dm365.c | 2 +-
arch/arm/mach-davinci/dm644x.c | 2 +-
arch/arm/mach-davinci/dm646x.c | 2 +-
arch/arm/mach-davinci/include/mach/dm355.h | 32 ----------
arch/arm/mach-davinci/include/mach/dm365.h | 36 -----------
arch/arm/mach-davinci/include/mach/dm644x.h | 40 -------------
arch/arm/mach-davinci/include/mach/dm646x.h | 34 -----------
16 files changed, 102 insertions(+), 153 deletions(-)
create mode 100644 arch/arm/mach-davinci/davinci.h
delete mode 100644 arch/arm/mach-davinci/include/mach/dm355.h
delete mode 100644 arch/arm/mach-davinci/include/mach/dm365.h
delete mode 100644 arch/arm/mach-davinci/include/mach/dm644x.h
delete mode 100644 arch/arm/mach-davinci/include/mach/dm646x.h
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 4e0e707..f700018 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -26,13 +26,14 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/dm355.h>
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/nand.h>
#include <mach/mmc.h>
#include <mach/usb.h>
+#include "davinci.h"
+
/* NOTE: this is geared for the standard config, with a socketed
* 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
* swap chips, maybe with a different block size, partitioning may
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index ff2d241..103c65a 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -23,13 +23,14 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/dm355.h>
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/nand.h>
#include <mach/mmc.h>
#include <mach/usb.h>
+#include "davinci.h"
+
/* NOTE: this is geared for the standard config, with a socketed
* 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
* swap chips, maybe with a different block size, partitioning may
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 10447c0..7124224 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -32,7 +32,6 @@
#include <asm/mach/arch.h>
#include <mach/mux.h>
-#include <mach/dm365.h>
#include <mach/common.h>
#include <mach/i2c.h>
#include <mach/serial.h>
@@ -42,6 +41,8 @@
#include <media/tvp514x.h>
+#include "davinci.h"
+
static inline int have_imager(void)
{
/* REVISIT when it's supported, trigger via Kconfig */
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 0cf8abf..6d76d7c 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -30,7 +30,6 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/dm644x.h>
#include <mach/common.h>
#include <mach/i2c.h>
#include <mach/serial.h>
@@ -40,6 +39,8 @@
#include <mach/usb.h>
#include <mach/aemif.h>
+#include "davinci.h"
+
#define DM644X_EVM_PHY_ID "0:01"
#define LXT971_PHY_ID (0x001378e2)
#define LXT971_PHY_MASK (0xfffffff0)
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 635bf77..123bea8 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -36,7 +36,6 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/dm646x.h>
#include <mach/common.h>
#include <mach/serial.h>
#include <mach/i2c.h>
@@ -46,6 +45,7 @@
#include <mach/aemif.h>
#include "clock.h"
+#include "davinci.h"
#define NAND_BLOCK_SIZE SZ_128K
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index e5f231a..4a8bacc 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -30,7 +30,6 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <mach/dm644x.h>
#include <mach/common.h>
#include <mach/i2c.h>
#include <mach/serial.h>
@@ -39,6 +38,8 @@
#include <mach/mmc.h>
#include <mach/usb.h>
+#include "davinci.h"
+
#define NEUROS_OSD2_PHY_ID "0:01"
#define LXT971_PHY_ID 0x001378e2
#define LXT971_PHY_MASK 0xfffffff0
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 5dd4da9..abd09bf 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -35,13 +35,14 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
-#include <mach/dm644x.h>
#include <mach/common.h>
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/mux.h>
#include <mach/usb.h>
+#include "davinci.h"
+
#define SFFSDR_PHY_ID "0:01"
static struct mtd_partition davinci_sffsdr_nandflash_partition[] = {
/* U-Boot Environment: Block 0
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
new file mode 100644
index 0000000..238c282
--- /dev/null
+++ b/arch/arm/mach-davinci/davinci.h
@@ -0,0 +1,85 @@
+/*
+ * This file contains the processor specific definitions
+ * of the TI DM644x, DM355, DM365, and DM646x.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated
+ *
+ * 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 __DAVINCI_H
+#define __DAVINCI_H
+
+#include <linux/clk.h>
+#include <linux/videodev2.h>
+#include <linux/davinci_emac.h>
+#include <linux/platform_device.h>
+
+#include <mach/asp.h>
+#include <mach/keyscan.h>
+
+#include <media/davinci/vpfe_capture.h>
+#include <media/davinci/vpif_types.h>
+
+/* DM355 base addresses */
+#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
+#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
+
+#define ASP1_TX_EVT_EN 1
+#define ASP1_RX_EVT_EN 2
+
+/* DM365 base addresses */
+#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000
+#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
+#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
+
+/* DM644x base addresses */
+#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01e00000
+#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
+#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
+#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
+#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
+
+/* DM646x base addresses */
+#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
+#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
+
+/* DM355 function declarations */
+struct spi_board_info;
+
+void __init dm355_init(void);
+void dm355_init_spi0(unsigned chipselect_mask,
+ struct spi_board_info *info, unsigned len);
+void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
+void dm355_set_vpfe_config(struct vpfe_config *cfg);
+
+/* DM365 function declarations */
+void __init dm365_init(void);
+void __init dm365_init_asp(struct snd_platform_data *pdata);
+void __init dm365_init_vc(struct snd_platform_data *pdata);
+void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
+void __init dm365_init_rtc(void);
+void dm365_init_spi0(unsigned chipselect_mask,
+ struct spi_board_info *info, unsigned len);
+void dm365_set_vpfe_config(struct vpfe_config *cfg);
+
+/* DM644x function declarations */
+void __init dm644x_init(void);
+void __init dm644x_init_asp(struct snd_platform_data *pdata);
+void dm644x_set_vpfe_config(struct vpfe_config *cfg);
+
+/* DM646x function declarations */
+void __init dm646x_init(void);
+void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
+void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
+int __init dm646x_init_edma(struct edma_rsv_info *rsv);
+void dm646x_video_init(void);
+void dm646x_setup_vpif(struct vpif_display_config *,
+ struct vpif_capture_config *);
+#endif /*__DAVINCI_H */
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index fe520d4..68423d2 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -18,7 +18,6 @@
#include <asm/mach/map.h>
-#include <mach/dm355.h>
#include <mach/cputype.h>
#include <mach/edma.h>
#include <mach/psc.h>
@@ -33,6 +32,7 @@
#include "clock.h"
#include "mux.h"
+#include "davinci.h"
#define DM355_UART2_BASE (IO_PHYS + 0x206000)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 77edee8..d3f5642 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -21,7 +21,6 @@
#include <asm/mach/map.h>
-#include <mach/dm365.h>
#include <mach/cputype.h>
#include <mach/edma.h>
#include <mach/psc.h>
@@ -37,6 +36,7 @@
#include "clock.h"
#include "mux.h"
+#include "davinci.h"
#define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index b274b21..b1a3567 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -15,7 +15,6 @@
#include <asm/mach/map.h>
-#include <mach/dm644x.h>
#include <mach/cputype.h>
#include <mach/edma.h>
#include <mach/irqs.h>
@@ -29,6 +28,7 @@
#include "clock.h"
#include "mux.h"
+#include "davinci.h"
/*
* Device specific clocks
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 4cf8b68..ef4e753 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -16,7 +16,6 @@
#include <asm/mach/map.h>
-#include <mach/dm646x.h>
#include <mach/cputype.h>
#include <mach/edma.h>
#include <mach/irqs.h>
@@ -30,6 +29,7 @@
#include "clock.h"
#include "mux.h"
+#include "davinci.h"
#define DAVINCI_VPIF_BASE (0x01C12000)
#define VDD3P3V_PWDN_OFFSET (0x48)
diff --git a/arch/arm/mach-davinci/include/mach/dm355.h b/arch/arm/mach-davinci/include/mach/dm355.h
deleted file mode 100644
index 36dff4a..0000000
--- a/arch/arm/mach-davinci/include/mach/dm355.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Chip specific defines for DM355 SoC
- *
- * Author: Kevin Hilman, Deep Root Systems, LLC
- *
- * 2007 (c) Deep Root Systems, LLC. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#ifndef __ASM_ARCH_DM355_H
-#define __ASM_ARCH_DM355_H
-
-#include <mach/hardware.h>
-#include <mach/asp.h>
-#include <media/davinci/vpfe_capture.h>
-
-#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01E10000
-#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-
-#define ASP1_TX_EVT_EN 1
-#define ASP1_RX_EVT_EN 2
-
-struct spi_board_info;
-
-void __init dm355_init(void);
-void dm355_init_spi0(unsigned chipselect_mask,
- struct spi_board_info *info, unsigned len);
-void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
-void dm355_set_vpfe_config(struct vpfe_config *cfg);
-
-#endif /* __ASM_ARCH_DM355_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
deleted file mode 100644
index 51924de..0000000
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2009 Texas Instruments Incorporated
- *
- * 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_DM365_H
-#define __ASM_ARCH_DM665_H
-
-#include <linux/platform_device.h>
-#include <linux/davinci_emac.h>
-#include <mach/hardware.h>
-#include <mach/asp.h>
-#include <mach/keyscan.h>
-#include <media/davinci/vpfe_capture.h>
-
-#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01D10000
-#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
-
-void __init dm365_init(void);
-void __init dm365_init_asp(struct snd_platform_data *pdata);
-void __init dm365_init_vc(struct snd_platform_data *pdata);
-void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
-void __init dm365_init_rtc(void);
-void dm365_init_spi0(unsigned chipselect_mask,
- struct spi_board_info *info, unsigned len);
-
-void dm365_set_vpfe_config(struct vpfe_config *cfg);
-#endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h
deleted file mode 100644
index 724377f..0000000
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file contains the processor specific definitions
- * of the TI DM644x.
- *
- * Copyright (C) 2008 Texas Instruments.
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-#ifndef __ASM_ARCH_DM644X_H
-#define __ASM_ARCH_DM644X_H
-
-#include <linux/davinci_emac.h>
-#include <mach/hardware.h>
-#include <mach/asp.h>
-#include <media/davinci/vpfe_capture.h>
-
-#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01E00000
-#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
-#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
-#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
-
-void __init dm644x_init(void);
-void __init dm644x_init_asp(struct snd_platform_data *pdata);
-void dm644x_set_vpfe_config(struct vpfe_config *cfg);
-
-#endif /* __ASM_ARCH_DM644X_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h
deleted file mode 100644
index eb95864..0000000
--- a/arch/arm/mach-davinci/include/mach/dm646x.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Chip specific defines for DM646x SoC
- *
- * Author: Kevin Hilman, Deep Root Systems, LLC
- *
- * 2007 (c) Deep Root Systems, LLC. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#ifndef __ASM_ARCH_DM646X_H
-#define __ASM_ARCH_DM646X_H
-
-#include <mach/hardware.h>
-#include <mach/asp.h>
-#include <linux/i2c.h>
-#include <linux/videodev2.h>
-#include <linux/davinci_emac.h>
-#include <media/davinci/vpif_types.h>
-
-#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
-#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
-
-void __init dm646x_init(void);
-void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
-void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
-int __init dm646x_init_edma(struct edma_rsv_info *rsv);
-
-void dm646x_video_init(void);
-
-void dm646x_setup_vpif(struct vpif_display_config *,
- struct vpif_capture_config *);
-
-#endif /* __ASM_ARCH_DM646X_H */
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 2/8] ARM: davinci: create new common platform header for davinci
2011-12-21 13:43 ` [PATCH v7 2/8] ARM: davinci: create new common platform header for davinci Manjunath Hadli
@ 2012-02-20 13:31 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 13:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:35, Hadli, Manjunath wrote:
> remove individual platform header files for dm365, dm355, dm644x
> and dm646x and consolidate it into a single and common
> header file davinci.h placed in arch/arm/mach-davinci.
>
> This reduces the pollution in the include/mach and is consistent
> with Russel's suggestions as part of his "pet peaves" mail.
While committing this patch, I fixed Russell's name and added
a link to his post.
>
> The further patches in the series take advantage of this consolidation
> for easy implementation of IO_ADDRESS elimination.
>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
> index 635bf77..123bea8 100644
> --- a/arch/arm/mach-davinci/board-dm646x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm646x-evm.c
> @@ -36,7 +36,6 @@
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
>
> -#include <mach/dm646x.h>
> #include <mach/common.h>
> #include <mach/serial.h>
> #include <mach/i2c.h>
> @@ -46,6 +45,7 @@
> #include <mach/aemif.h>
>
> #include "clock.h"
> +#include "davinci.h"
In cases where multiple local include files are present,
I modified the patch to make davinci.h the first include
file. I did this to keep the new include order closer
to the original order.
> diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
> new file mode 100644
> index 0000000..238c282
> --- /dev/null
> +++ b/arch/arm/mach-davinci/davinci.h
> @@ -0,0 +1,85 @@
> +/*
> + * This file contains the processor specific definitions
> + * of the TI DM644x, DM355, DM365, and DM646x.
> + *
> + * Copyright (C) 2011 Texas Instruments Incorporated
Deep Root Systems had a copyright on one of the files
this code is derived from. I restored the copyright of
Deep Root Systems in the file.
[...]
> +/* DM355 function declarations */
> +struct spi_board_info;
I saw no reason to maintain a forward declaration like this.
I included linux/spi/spi.h in this file instead.
I am making these changes myself since I was delayed in getting
back to you and also since you have already spun 7 versions of
this. I figured you must be getting tired already ;-)
I will push the code to a branch on my tree, please give it a
good test.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 3/8] davinci: eliminate use of IO_ADDRESS() on sysmod
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
2011-12-21 13:43 ` [PATCH v7 1/8] davinci: vpif: remove machine specific inclusion from driver Manjunath Hadli
2011-12-21 13:43 ` [PATCH v7 2/8] ARM: davinci: create new common platform header for davinci Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2012-02-20 14:19 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 4/8] davinci: dm644x: Replace register base value with a defined macro Manjunath Hadli
` (4 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Current devices.c file has a number of instances where
IO_ADDRESS() is used for system module register
access. Eliminate this in favor of a ioremap()
based access.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
---
arch/arm/mach-davinci/davinci.h | 9 +++++++++
arch/arm/mach-davinci/devices.c | 25 ++++++++++++++++---------
arch/arm/mach-davinci/dm355.c | 1 +
arch/arm/mach-davinci/dm365.c | 1 +
arch/arm/mach-davinci/dm644x.c | 1 +
arch/arm/mach-davinci/dm646x.c | 1 +
arch/arm/mach-davinci/include/mach/hardware.h | 2 --
7 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 238c282..065b3a0 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -23,10 +23,19 @@
#include <mach/asp.h>
#include <mach/keyscan.h>
+#include <mach/hardware.h>
#include <media/davinci/vpfe_capture.h>
#include <media/davinci/vpif_types.h>
+#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
+
+#ifndef __ASSEMBLER__
+extern void __iomem *davinci_sysmodbase;
+#define DAVINCI_SYSMODULE_VIRT(x) (davinci_sysmodbase + (x))
+void davinci_map_sysmod(void);
+#endif
+
/* DM355 base addresses */
#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 806a2f0..faff29a 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -23,6 +23,7 @@
#include <mach/mmc.h>
#include <mach/time.h>
+#include "davinci.h"
#include "clock.h"
#define DAVINCI_I2C_BASE 0x01C21000
@@ -36,6 +37,14 @@
/* System control register offsets */
#define DM64XX_VDD3P3V_PWDN 0x48
+void __iomem *davinci_sysmodbase;
+
+void davinci_map_sysmod(void)
+{
+ davinci_sysmodbase = ioremap_nocache(DAVINCI_SYSTEM_MODULE_BASE, 0x800);
+ WARN_ON(!davinci_sysmodbase);
+}
+
static struct resource i2c_resources[] = {
{
.start = DAVINCI_I2C_BASE,
@@ -212,12 +221,12 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
davinci_cfg_reg(DM355_SD1_DATA2);
davinci_cfg_reg(DM355_SD1_DATA3);
} else if (cpu_is_davinci_dm365()) {
- void __iomem *pupdctl1 =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x7c);
-
/* Configure pull down control */
- __raw_writel((__raw_readl(pupdctl1) & ~0xfc0),
- pupdctl1);
+ void __iomem *pupdctl1 = DAVINCI_SYSMODULE_VIRT(0x7c);
+ unsigned v;
+
+ v = __raw_readl(pupdctl1);
+ __raw_writel(v & ~0xfc0, pupdctl1);
mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
@@ -246,11 +255,9 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
} else if (cpu_is_davinci_dm644x()) {
/* REVISIT: should this be in board-init code? */
- void __iomem *base =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
-
/* Power-on 3.3V IO cells */
- __raw_writel(0, base + DM64XX_VDD3P3V_PWDN);
+ __raw_writel(0,
+ DAVINCI_SYSMODULE_VIRT(DM64XX_VDD3P3V_PWDN));
/*Set up the pull regiter for MMC */
davinci_cfg_reg(DM644X_MSTK);
}
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 68423d2..43b4dc3 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -872,6 +872,7 @@ void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
void __init dm355_init(void)
{
davinci_common_init(&davinci_soc_info_dm355);
+ davinci_map_sysmod();
}
static int __init dm355_init_devices(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index d3f5642..3758762 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1139,6 +1139,7 @@ void __init dm365_init_rtc(void)
void __init dm365_init(void)
{
davinci_common_init(&davinci_soc_info_dm365);
+ davinci_map_sysmod();
}
static struct resource dm365_vpss_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index b1a3567..6b95b4b 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -787,6 +787,7 @@ void __init dm644x_init_asp(struct snd_platform_data *pdata)
void __init dm644x_init(void)
{
davinci_common_init(&davinci_soc_info_dm644x);
+ davinci_map_sysmod();
}
static int __init dm644x_init_devices(void)
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index ef4e753..2f28a49 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -913,6 +913,7 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv)
void __init dm646x_init(void)
{
davinci_common_init(&davinci_soc_info_dm646x);
+ davinci_map_sysmod();
}
static int __init dm646x_init_devices(void)
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 414e0b9..0209b1f 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -19,8 +19,6 @@
* and the chip/board init code should then explicitly include
* <chipname>.h
*/
-#define DAVINCI_SYSTEM_MODULE_BASE 0x01C40000
-
/*
* I/O mapping
*/
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 3/8] davinci: eliminate use of IO_ADDRESS() on sysmod
2011-12-21 13:43 ` [PATCH v7 3/8] davinci: eliminate use of IO_ADDRESS() on sysmod Manjunath Hadli
@ 2012-02-20 14:19 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 14:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:36, Hadli, Manjunath wrote:
> Current devices.c file has a number of instances where
> IO_ADDRESS() is used for system module register
You seemed to have limited yourself to devices.c, but there
is one more IO_ADDRESS() usage in dm646x.c which can also be
eliminated with the change you are making in this patch.
I included that clean-up too in this patch.
> access. Eliminate this in favor of a ioremap()
> based access.
Along with IO_ADDRESS() I also found some VPIF specific registers
in system module were being ioremapped separately in DM646x EVM code.
I included fixing that into this patch as well.
I also found duplicate system module register offsets definitions
in code so I consolidated system module register offsets in davinci.h.
>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Arnd had acked one of the earlier versions of this patch.
Please carry forward the acks you receive on previous versions
of the patch (unless the patch is now doing something totally
different). Otherwise, there is no way for a person like me
to add the proper acks before committing.
> ---
> arch/arm/mach-davinci/davinci.h | 9 +++++++++
> arch/arm/mach-davinci/devices.c | 25 ++++++++++++++++---------
> arch/arm/mach-davinci/dm355.c | 1 +
> arch/arm/mach-davinci/dm365.c | 1 +
> arch/arm/mach-davinci/dm644x.c | 1 +
> arch/arm/mach-davinci/dm646x.c | 1 +
> arch/arm/mach-davinci/include/mach/hardware.h | 2 --
> 7 files changed, 29 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
> index 238c282..065b3a0 100644
> --- a/arch/arm/mach-davinci/davinci.h
> +++ b/arch/arm/mach-davinci/davinci.h
> @@ -23,10 +23,19 @@
>
> #include <mach/asp.h>
> #include <mach/keyscan.h>
> +#include <mach/hardware.h>
>
> #include <media/davinci/vpfe_capture.h>
> #include <media/davinci/vpif_types.h>
>
> +#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
> +
> +#ifndef __ASSEMBLER__
> +extern void __iomem *davinci_sysmodbase;
> +#define DAVINCI_SYSMODULE_VIRT(x) (davinci_sysmodbase + (x))
> +void davinci_map_sysmod(void);
> +#endif
I couldn't see the reason why ifndef __ASSEMBLER__ is required here
I don't see this file being included in any assembly file. So, I have
removed it in my commit.
> diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
> index 806a2f0..faff29a 100644
> --- a/arch/arm/mach-davinci/devices.c
> +++ b/arch/arm/mach-davinci/devices.c
> @@ -23,6 +23,7 @@
> #include <mach/mmc.h>
> #include <mach/time.h>
>
> +#include "davinci.h"
> #include "clock.h"
>
> #define DAVINCI_I2C_BASE 0x01C21000
> @@ -36,6 +37,14 @@
> /* System control register offsets */
> #define DM64XX_VDD3P3V_PWDN 0x48
>
> +void __iomem *davinci_sysmodbase;
> +
> +void davinci_map_sysmod(void)
> +{
> + davinci_sysmodbase = ioremap_nocache(DAVINCI_SYSTEM_MODULE_BASE, 0x800);
> + WARN_ON(!davinci_sysmodbase);
I converted this to a bug since this is something basic
for SoC initialization and I did not see a point in going
ahead and failing elsewhere. I also think ioremap() failing
this early in system boot needs attention anyway. I have
included these reasons in a comment above the BUG_ON().
With these items fixed, here is the updated patch.
Thanks,
Sekhar
----8<-----
commit 0180a7edde29929e36b97ca8493bf35b3e39a6dc
Author: Manjunath Hadli <manjunath.hadli@ti.com>
AuthorDate: Wed Dec 21 19:13:36 2011 +0530
Commit: Sekhar Nori <nsekhar@ti.com>
CommitDate: Mon Feb 20 19:38:03 2012 +0530
ARM: davinci: streamline sysmod access
There are instances of IO_ADDRESS() being used for system module
(sysmod) register access. Eliminate this in favor of a ioremap()
based access. ioremap() the entire sysmod address space once during
boot-up and provide a helper macro to access specific register
offsets within the address space.
With this, also eliminate ioremap() of specific sysmodule registers
related to VPIF happening in DM646x EVM code.
While at it, also eliminate some duplicate sysmod register offset macros
defined in code and place offset definitions at one place in davinci.h
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
[nsekhar at ti.com: removed the addition of ifndef __ASSEMBLER__
in davinci.h, eliminate IO_ADDRESS() usage left out in dm646x.c,
cleanup VPIF sysmodule register access as part of this patch and
keep all sysmod offsets in davinci.h Also, convert the WARN_ON()
on failure to setup sysmod base to BUG_ON()]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 74ae0c4..9468904 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -410,8 +410,6 @@ static struct davinci_i2c_platform_data i2c_pdata = {
.bus_delay = 0 /* usec */,
};
-#define VIDCLKCTL_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x38)
-#define VSCLKDIS_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x6c)
#define VCH2CLK_MASK (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8))
#define VCH2CLK_SYSCLK8 (BIT(9))
#define VCH2CLK_AUXCLK (BIT(9) | BIT(8))
@@ -429,8 +427,6 @@ static struct davinci_i2c_platform_data i2c_pdata = {
#define TVP5147_CH0 "tvp514x-0"
#define TVP5147_CH1 "tvp514x-1"
-static void __iomem *vpif_vidclkctl_reg;
-static void __iomem *vpif_vsclkdis_reg;
/* spin lock for updating above registers */
static spinlock_t vpif_reg_lock;
@@ -441,14 +437,14 @@ static int set_vpif_clock(int mux_mode, int hd)
int val = 0;
int err = 0;
- if (!vpif_vidclkctl_reg || !vpif_vsclkdis_reg || !cpld_client)
+ if (!cpld_client)
return -ENXIO;
/* disable the clock */
spin_lock_irqsave(&vpif_reg_lock, flags);
- value = __raw_readl(vpif_vsclkdis_reg);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
value |= (VIDCH3CLK | VIDCH2CLK);
- __raw_writel(value, vpif_vsclkdis_reg);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
spin_unlock_irqrestore(&vpif_reg_lock, flags);
val = i2c_smbus_read_byte(cpld_client);
@@ -464,7 +460,7 @@ static int set_vpif_clock(int mux_mode, int hd)
if (err)
return err;
- value = __raw_readl(vpif_vidclkctl_reg);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
value &= ~(VCH2CLK_MASK);
value &= ~(VCH3CLK_MASK);
@@ -473,13 +469,13 @@ static int set_vpif_clock(int mux_mode, int hd)
else
value |= (VCH2CLK_AUXCLK | VCH3CLK_AUXCLK);
- __raw_writel(value, vpif_vidclkctl_reg);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
spin_lock_irqsave(&vpif_reg_lock, flags);
- value = __raw_readl(vpif_vsclkdis_reg);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
/* enable the clock */
value &= ~(VIDCH3CLK | VIDCH2CLK);
- __raw_writel(value, vpif_vsclkdis_reg);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
spin_unlock_irqrestore(&vpif_reg_lock, flags);
return 0;
@@ -564,7 +560,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
int val;
u32 value;
- if (!vpif_vidclkctl_reg || !cpld_client)
+ if (!cpld_client)
return -ENXIO;
val = i2c_smbus_read_byte(cpld_client);
@@ -572,7 +568,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
return val;
spin_lock_irqsave(&vpif_reg_lock, flags);
- value = __raw_readl(vpif_vidclkctl_reg);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
if (mux_mode) {
val &= VPIF_INPUT_TWO_CHANNEL;
value |= VIDCH1CLK;
@@ -580,7 +576,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
val |= VPIF_INPUT_ONE_CHANNEL;
value &= ~VIDCH1CLK;
}
- __raw_writel(value, vpif_vidclkctl_reg);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
spin_unlock_irqrestore(&vpif_reg_lock, flags);
err = i2c_smbus_write_byte(cpld_client, val);
@@ -674,12 +670,6 @@ static struct vpif_capture_config dm646x_vpif_capture_cfg = {
static void __init evm_init_video(void)
{
- vpif_vidclkctl_reg = ioremap(VIDCLKCTL_OFFSET, 4);
- vpif_vsclkdis_reg = ioremap(VSCLKDIS_OFFSET, 4);
- if (!vpif_vidclkctl_reg || !vpif_vsclkdis_reg) {
- pr_err("Can't map VPIF VIDCLKCTL or VSCLKDIS registers\n");
- return;
- }
spin_lock_init(&vpif_reg_lock);
dm646x_setup_vpif(&dm646x_vpif_display_config,
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 5e4f85e..b1a52fb 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -25,10 +25,21 @@
#include <mach/asp.h>
#include <mach/keyscan.h>
+#include <mach/hardware.h>
#include <media/davinci/vpfe_capture.h>
#include <media/davinci/vpif_types.h>
+#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
+#define SYSMOD_VIDCLKCTL 0x38
+#define SYSMOD_VDD3P3VPWDN 0x48
+#define SYSMOD_VSCLKDIS 0x6c
+#define SYSMOD_PUPDCTL1 0x7c
+
+extern void __iomem *davinci_sysmod_base;
+#define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x))
+void davinci_map_sysmod(void);
+
/* DM355 base addresses */
#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 50c0156..d2f9666 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -23,6 +23,7 @@
#include <mach/mmc.h>
#include <mach/time.h>
+#include "davinci.h"
#include "clock.h"
#define DAVINCI_I2C_BASE 0x01C21000
@@ -33,8 +34,19 @@
#define DM365_MMCSD0_BASE 0x01D11000
#define DM365_MMCSD1_BASE 0x01D00000
-/* System control register offsets */
-#define DM64XX_VDD3P3V_PWDN 0x48
+void __iomem *davinci_sysmod_base;
+
+void davinci_map_sysmod(void)
+{
+ davinci_sysmod_base = ioremap_nocache(DAVINCI_SYSTEM_MODULE_BASE,
+ 0x800);
+ /*
+ * Throw a bug since a lot of board initialization code depends
+ * on system module availability. ioremap() failing this early
+ * need careful looking into anyway.
+ */
+ BUG_ON(!davinci_sysmod_base);
+}
static struct resource i2c_resources[] = {
{
@@ -212,12 +224,12 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
davinci_cfg_reg(DM355_SD1_DATA2);
davinci_cfg_reg(DM355_SD1_DATA3);
} else if (cpu_is_davinci_dm365()) {
- void __iomem *pupdctl1 =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x7c);
-
/* Configure pull down control */
- __raw_writel((__raw_readl(pupdctl1) & ~0xfc0),
- pupdctl1);
+ unsigned v;
+
+ v = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
+ __raw_writel(v & ~0xfc0,
+ DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
@@ -246,11 +258,9 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
} else if (cpu_is_davinci_dm644x()) {
/* REVISIT: should this be in board-init code? */
- void __iomem *base =
- IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
-
/* Power-on 3.3V IO cells */
- __raw_writel(0, base + DM64XX_VDD3P3V_PWDN);
+ __raw_writel(0,
+ DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
/*Set up the pull regiter for MMC */
davinci_cfg_reg(DM644X_MSTK);
}
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 0b0d41c..fd3d09a 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -871,6 +871,7 @@ void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
void __init dm355_init(void)
{
davinci_common_init(&davinci_soc_info_dm355);
+ davinci_map_sysmod();
}
static int __init dm355_init_devices(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index d831d94..1a2e953 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1138,6 +1138,7 @@ void __init dm365_init_rtc(void)
void __init dm365_init(void)
{
davinci_common_init(&davinci_soc_info_dm365);
+ davinci_map_sysmod();
}
static struct resource dm365_vpss_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index c6f47c6..bf14ec0 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -786,6 +786,7 @@ void __init dm644x_init_asp(struct snd_platform_data *pdata)
void __init dm644x_init(void)
{
davinci_common_init(&davinci_soc_info_dm644x);
+ davinci_map_sysmod();
}
static int __init dm644x_init_devices(void)
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 3b84195..9eb87c1 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -32,8 +32,6 @@
#include "mux.h"
#define DAVINCI_VPIF_BASE (0x01C12000)
-#define VDD3P3V_PWDN_OFFSET (0x48)
-#define VSCLKDIS_OFFSET (0x6C)
#define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\
BIT_MASK(0))
@@ -880,15 +878,14 @@ void dm646x_setup_vpif(struct vpif_display_config *display_config,
struct vpif_capture_config *capture_config)
{
unsigned int value;
- void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
- value = __raw_readl(base + VSCLKDIS_OFFSET);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
value &= ~VSCLKDIS_MASK;
- __raw_writel(value, base + VSCLKDIS_OFFSET);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
- value = __raw_readl(base + VDD3P3V_PWDN_OFFSET);
+ value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
value &= ~VDD3P3V_VID_MASK;
- __raw_writel(value, base + VDD3P3V_PWDN_OFFSET);
+ __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
davinci_cfg_reg(DM646X_STSOMUX_DISABLE);
davinci_cfg_reg(DM646X_STSIMUX_DISABLE);
@@ -912,6 +909,7 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv)
void __init dm646x_init(void)
{
davinci_common_init(&davinci_soc_info_dm646x);
+ davinci_map_sysmod();
}
static int __init dm646x_init_devices(void)
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 414e0b9..0209b1f 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -19,8 +19,6 @@
* and the chip/board init code should then explicitly include
* <chipname>.h
*/
-#define DAVINCI_SYSTEM_MODULE_BASE 0x01C40000
-
/*
* I/O mapping
*/
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v7 4/8] davinci: dm644x: Replace register base value with a defined macro
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
` (2 preceding siblings ...)
2011-12-21 13:43 ` [PATCH v7 3/8] davinci: eliminate use of IO_ADDRESS() on sysmod Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2012-02-20 14:29 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency Manjunath Hadli
` (3 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Replace hard coded value of vpss register base to a define macro
DM644X_VPSS_BASE for proper readability
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/dm644x.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 6b95b4b..97aecf2 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -594,13 +594,15 @@ static struct platform_device dm644x_asp_device = {
.resource = dm644x_asp_resources,
};
+#define DM644X_VPSS_BASE 0x01c73400
+
static struct resource dm644x_vpss_resources[] = {
{
/* VPSS Base address */
.name = "vpss",
- .start = 0x01c73400,
- .end = 0x01c73400 + 0xff,
- .flags = IORESOURCE_MEM,
+ .start = DM644X_VPSS_BASE,
+ .end = DM644X_VPSS_BASE + 0xff,
+ .flags = IORESOURCE_MEM,
},
};
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 4/8] davinci: dm644x: Replace register base value with a defined macro
2011-12-21 13:43 ` [PATCH v7 4/8] davinci: dm644x: Replace register base value with a defined macro Manjunath Hadli
@ 2012-02-20 14:29 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 14:29 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:37, Hadli, Manjunath wrote:
> Replace hard coded value of vpss register base to a define macro
> DM644X_VPSS_BASE for proper readability
>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
The subject line does not follow the format we have in place now.
Also in the subject, the term "defined macro" is odd. You have
fixed some indentation issues with earlier code in this patch.
That should find a mention too. I made these (and some other minor)
improvements to the patch text while committing.
Please have a look and take care next time onward. Here is the
new text:
ARM: davinci: dm644x: improve readability using macro
Replace the VPSS base address "magic number" with the
define "DM644X_VPSS_BASE" to improve readability.
While at it, fix the indentation done using spaces in
this part of code.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
` (3 preceding siblings ...)
2011-12-21 13:43 ` [PATCH v7 4/8] davinci: dm644x: Replace register base value with a defined macro Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2011-12-21 14:55 ` Karicheri, Muralidharan
2012-02-20 18:33 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 6/8] davinci: dm644x: move vpfe init from soc to board specific files Manjunath Hadli
` (2 subsequent siblings)
7 siblings, 2 replies; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Add SoC and board prefixes to variable names so that it is
consistent with the rest of the file.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/board-dm644x-evm.c | 24 ++++++++++++------------
arch/arm/mach-davinci/dm644x.c | 12 ++++++------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 6d76d7c..7d940f5 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -190,7 +190,7 @@ static struct platform_device davinci_fb_device = {
.num_resources = 0,
};
-static struct tvp514x_platform_data tvp5146_pdata = {
+static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = {
.clk_polarity = 0,
.hs_polarity = 1,
.vs_polarity = 1
@@ -198,7 +198,7 @@ static struct tvp514x_platform_data tvp5146_pdata = {
#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
/* Inputs available at the TVP5146 */
-static struct v4l2_input tvp5146_inputs[] = {
+static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
{
.index = 0,
.name = "Composite",
@@ -218,7 +218,7 @@ static struct v4l2_input tvp5146_inputs[] = {
* ouput that goes to vpfe. There is a one to one correspondence
* with tvp5146_inputs
*/
-static struct vpfe_route tvp5146_routes[] = {
+static struct vpfe_route dm644xevm_tvp5146_routes[] = {
{
.input = INPUT_CVBS_VI2B,
.output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
@@ -229,13 +229,13 @@ static struct vpfe_route tvp5146_routes[] = {
},
};
-static struct vpfe_subdev_info vpfe_sub_devs[] = {
+static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
{
.name = "tvp5146",
.grp_id = 0,
- .num_inputs = ARRAY_SIZE(tvp5146_inputs),
- .inputs = tvp5146_inputs,
- .routes = tvp5146_routes,
+ .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs),
+ .inputs = dm644xevm_tvp5146_inputs,
+ .routes = dm644xevm_tvp5146_routes,
.can_route = 1,
.ccdc_if_params = {
.if_type = VPFE_BT656,
@@ -244,15 +244,15 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
},
.board_info = {
I2C_BOARD_INFO("tvp5146", 0x5d),
- .platform_data = &tvp5146_pdata,
+ .platform_data = &dm644xevm_tvp5146_pdata,
},
},
};
-static struct vpfe_config vpfe_cfg = {
- .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
+static struct vpfe_config dm644xevm_capture_cfg = {
+ .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
.i2c_adapter_id = 1,
- .sub_devs = vpfe_sub_devs,
+ .sub_devs = dm644xevm_vpfe_sub_devs,
.card_name = "DM6446 EVM",
.ccdc = "DM6446 CCDC",
};
@@ -626,7 +626,7 @@ static void __init
davinci_evm_map_io(void)
{
/* setup input configuration for VPFE input devices */
- dm644x_set_vpfe_config(&vpfe_cfg);
+ dm644x_set_vpfe_config(&dm644xevm_capture_cfg);
dm644x_init();
}
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 97aecf2..acd9ee2 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -614,7 +614,7 @@ static struct platform_device dm644x_vpss_device = {
.resource = dm644x_vpss_resources,
};
-static struct resource vpfe_resources[] = {
+static struct resource dm644x_vpfe_resources[] = {
{
.start = IRQ_VDINT0,
.end = IRQ_VDINT0,
@@ -648,11 +648,11 @@ static struct platform_device dm644x_ccdc_dev = {
},
};
-static struct platform_device vpfe_capture_dev = {
+static struct platform_device dm644x_vpfe_dev = {
.name = CAPTURE_DRV_NAME,
.id = -1,
- .num_resources = ARRAY_SIZE(vpfe_resources),
- .resource = vpfe_resources,
+ .num_resources = ARRAY_SIZE(dm644x_vpfe_resources),
+ .resource = dm644x_vpfe_resources,
.dev = {
.dma_mask = &vpfe_capture_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
@@ -661,7 +661,7 @@ static struct platform_device vpfe_capture_dev = {
void dm644x_set_vpfe_config(struct vpfe_config *cfg)
{
- vpfe_capture_dev.dev.platform_data = cfg;
+ dm644x_vpfe_dev.dev.platform_data = cfg;
}
/*----------------------------------------------------------------------*/
@@ -809,7 +809,7 @@ static int __init dm644x_init_devices(void)
platform_device_register(&dm644x_vpss_device);
platform_device_register(&dm644x_ccdc_dev);
- platform_device_register(&vpfe_capture_dev);
+ platform_device_register(&dm644x_vpfe_dev);
return 0;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency
2011-12-21 13:43 ` [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency Manjunath Hadli
@ 2011-12-21 14:55 ` Karicheri, Muralidharan
2012-01-04 7:37 ` Hadli, Manjunath
2012-02-20 18:33 ` Nori, Sekhar
1 sibling, 1 reply; 18+ messages in thread
From: Karicheri, Muralidharan @ 2011-12-21 14:55 UTC (permalink / raw)
To: linux-arm-kernel
original Message-----
>> From: davinci-linux-open-source-bounces+m-
>> karicheri2=ti.com at linux.davincidsp.com [mailto:davinci-linux-open-source-
>> bounces+m-karicheri2=ti.com at linux.davincidsp.com] On Behalf Of Hadli,
>> Manjunath
>> Sent: Wednesday, December 21, 2011 8:44 AM
>> To: dlos; LAK
>> Subject: [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure
>> variables for consistency
>>
>> Add SoC and board prefixes to variable names so that it is
>> consistent with the rest of the file.
>>
>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>> Acked-by: Sekhar Nori <nsekhar@ti.com>
>> ---
>> arch/arm/mach-davinci/board-dm644x-evm.c | 24 ++++++++++++------------
>> arch/arm/mach-davinci/dm644x.c | 12 ++++++------
>> 2 files changed, 18 insertions(+), 18 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-
>> davinci/board-dm644x-evm.c
>> index 6d76d7c..7d940f5 100644
>> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
>> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
>> @@ -190,7 +190,7 @@ static struct platform_device davinci_fb_device = {
>> .num_resources = 0,
>> };
>>
>> -static struct tvp514x_platform_data tvp5146_pdata = {
>> +static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = {
>> .clk_polarity = 0,
>> .hs_polarity = 1,
>> .vs_polarity = 1
>> @@ -198,7 +198,7 @@ static struct tvp514x_platform_data tvp5146_pdata = {
>>
>> #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
>> /* Inputs available at the TVP5146 */
>> -static struct v4l2_input tvp5146_inputs[] = {
>> +static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
>> {
>> .index = 0,
>> .name = "Composite",
>> @@ -218,7 +218,7 @@ static struct v4l2_input tvp5146_inputs[] = {
>> * ouput that goes to vpfe. There is a one to one correspondence
>> * with tvp5146_inputs
>> */
>> -static struct vpfe_route tvp5146_routes[] = {
>> +static struct vpfe_route dm644xevm_tvp5146_routes[] = {
>> {
>> .input = INPUT_CVBS_VI2B,
>> .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
>> @@ -229,13 +229,13 @@ static struct vpfe_route tvp5146_routes[] = {
>> },
>> };
>>
>> -static struct vpfe_subdev_info vpfe_sub_devs[] = {
>> +static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
>> {
>> .name = "tvp5146",
>> .grp_id = 0,
>> - .num_inputs = ARRAY_SIZE(tvp5146_inputs),
>> - .inputs = tvp5146_inputs,
>> - .routes = tvp5146_routes,
>> + .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs),
>> + .inputs = dm644xevm_tvp5146_inputs,
>> + .routes = dm644xevm_tvp5146_routes,
>> .can_route = 1,
>> .ccdc_if_params = {
>> .if_type = VPFE_BT656,
>> @@ -244,15 +244,15 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
>> },
>> .board_info = {
>> I2C_BOARD_INFO("tvp5146", 0x5d),
>> - .platform_data = &tvp5146_pdata,
>> + .platform_data = &dm644xevm_tvp5146_pdata,
>> },
>> },
>> };
>>
>> -static struct vpfe_config vpfe_cfg = {
>> - .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
>> +static struct vpfe_config dm644xevm_capture_cfg = {
>> + .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
>> .i2c_adapter_id = 1,
>> - .sub_devs = vpfe_sub_devs,
>> + .sub_devs = dm644xevm_vpfe_sub_devs,
>> .card_name = "DM6446 EVM",
>> .ccdc = "DM6446 CCDC",
>> };
>> @@ -626,7 +626,7 @@ static void __init
>> davinci_evm_map_io(void)
>> {
>> /* setup input configuration for VPFE input devices */
>> - dm644x_set_vpfe_config(&vpfe_cfg);
>> + dm644x_set_vpfe_config(&dm644xevm_capture_cfg);
>> dm644x_init();
>> }
>>
>> diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
>> index 97aecf2..acd9ee2 100644
>> --- a/arch/arm/mach-davinci/dm644x.c
>> +++ b/arch/arm/mach-davinci/dm644x.c
>> @@ -614,7 +614,7 @@ static struct platform_device dm644x_vpss_device = {
>> .resource = dm644x_vpss_resources,
>> };
>>
>> -static struct resource vpfe_resources[] = {
>> +static struct resource dm644x_vpfe_resources[] = {
>> {
>> .start = IRQ_VDINT0,
>> .end = IRQ_VDINT0,
>> @@ -648,11 +648,11 @@ static struct platform_device dm644x_ccdc_dev = {
>> },
>> };
>>
>> -static struct platform_device vpfe_capture_dev = {
>> +static struct platform_device dm644x_vpfe_dev = {
>> .name = CAPTURE_DRV_NAME,
>> .id = -1,
>> - .num_resources = ARRAY_SIZE(vpfe_resources),
>> - .resource = vpfe_resources,
>> + .num_resources = ARRAY_SIZE(dm644x_vpfe_resources),
>> + .resource = dm644x_vpfe_resources,
>> .dev = {
>> .dma_mask = &vpfe_capture_dma_mask,
>> .coherent_dma_mask = DMA_BIT_MASK(32),
>> @@ -661,7 +661,7 @@ static struct platform_device vpfe_capture_dev = {
>>
>> void dm644x_set_vpfe_config(struct vpfe_config *cfg)
>> {
>> - vpfe_capture_dev.dev.platform_data = cfg;
>> + dm644x_vpfe_dev.dev.platform_data = cfg;
>> }
>>
>> /*----------------------------------------------------------------------*/
>> @@ -809,7 +809,7 @@ static int __init dm644x_init_devices(void)
>>
>> platform_device_register(&dm644x_vpss_device);
>> platform_device_register(&dm644x_ccdc_dev);
>> - platform_device_register(&vpfe_capture_dev);
>> + platform_device_register(&dm644x_vpfe_dev);
>>
Just a suggestion. Why don't we change these with platform_add_devices() API call and register all of the video devices in once call instead of separate calls to platform_device_register?
>> return 0;
>> }
>> --
>> 1.6.2.4
>>
>> _______________________________________________
>> Davinci-linux-open-source mailing list
>> Davinci-linux-open-source at linux.davincidsp.com
>> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency
2011-12-21 14:55 ` Karicheri, Muralidharan
@ 2012-01-04 7:37 ` Hadli, Manjunath
0 siblings, 0 replies; 18+ messages in thread
From: Hadli, Manjunath @ 2012-01-04 7:37 UTC (permalink / raw)
To: linux-arm-kernel
Murali,
On Wed, Dec 21, 2011 at 20:25:23, Karicheri, Muralidharan wrote:
> original Message-----
> >> From: davinci-linux-open-source-bounces+m-
> >> karicheri2=ti.com at linux.davincidsp.com
> >> [mailto:davinci-linux-open-source-
> >> bounces+m-karicheri2=ti.com at linux.davincidsp.com] On Behalf Of Hadli,
> >> Manjunath
> >> Sent: Wednesday, December 21, 2011 8:44 AM
> >> To: dlos; LAK
> >> Subject: [PATCH v7 5/8] davinci: dm644x: change vpfe capture
> >> structure variables for consistency
> >>
> >> Add SoC and board prefixes to variable names so that it is consistent
> >> with the rest of the file.
> >>
> >> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> >> Acked-by: Sekhar Nori <nsekhar@ti.com>
> >> ---
> >> arch/arm/mach-davinci/board-dm644x-evm.c | 24 ++++++++++++------------
> >> arch/arm/mach-davinci/dm644x.c | 12 ++++++------
> >> 2 files changed, 18 insertions(+), 18 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
> >> b/arch/arm/mach- davinci/board-dm644x-evm.c index 6d76d7c..7d940f5
> >> 100644
> >> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> >> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> >> @@ -190,7 +190,7 @@ static struct platform_device davinci_fb_device = {
> >> .num_resources = 0,
> >> };
> >>
> >> -static struct tvp514x_platform_data tvp5146_pdata = {
> >> +static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = {
> >> .clk_polarity = 0,
> >> .hs_polarity = 1,
> >> .vs_polarity = 1
> >> @@ -198,7 +198,7 @@ static struct tvp514x_platform_data tvp5146_pdata
> >> = {
> >>
> >> #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
> >> /* Inputs available at the TVP5146 */ -static struct v4l2_input
> >> tvp5146_inputs[] = {
> >> +static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
> >> {
> >> .index = 0,
> >> .name = "Composite",
> >> @@ -218,7 +218,7 @@ static struct v4l2_input tvp5146_inputs[] = {
> >> * ouput that goes to vpfe. There is a one to one correspondence
> >> * with tvp5146_inputs
> >> */
> >> -static struct vpfe_route tvp5146_routes[] = {
> >> +static struct vpfe_route dm644xevm_tvp5146_routes[] = {
> >> {
> >> .input = INPUT_CVBS_VI2B,
> >> .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, @@ -229,13 +229,13 @@
> >> static struct vpfe_route tvp5146_routes[] = {
> >> },
> >> };
> >>
> >> -static struct vpfe_subdev_info vpfe_sub_devs[] = {
> >> +static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
> >> {
> >> .name = "tvp5146",
> >> .grp_id = 0,
> >> - .num_inputs = ARRAY_SIZE(tvp5146_inputs),
> >> - .inputs = tvp5146_inputs,
> >> - .routes = tvp5146_routes,
> >> + .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs),
> >> + .inputs = dm644xevm_tvp5146_inputs,
> >> + .routes = dm644xevm_tvp5146_routes,
> >> .can_route = 1,
> >> .ccdc_if_params = {
> >> .if_type = VPFE_BT656,
> >> @@ -244,15 +244,15 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
> >> },
> >> .board_info = {
> >> I2C_BOARD_INFO("tvp5146", 0x5d),
> >> - .platform_data = &tvp5146_pdata,
> >> + .platform_data = &dm644xevm_tvp5146_pdata,
> >> },
> >> },
> >> };
> >>
> >> -static struct vpfe_config vpfe_cfg = {
> >> - .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
> >> +static struct vpfe_config dm644xevm_capture_cfg = {
> >> + .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
> >> .i2c_adapter_id = 1,
> >> - .sub_devs = vpfe_sub_devs,
> >> + .sub_devs = dm644xevm_vpfe_sub_devs,
> >> .card_name = "DM6446 EVM",
> >> .ccdc = "DM6446 CCDC",
> >> };
> >> @@ -626,7 +626,7 @@ static void __init
> >> davinci_evm_map_io(void)
> >> {
> >> /* setup input configuration for VPFE input devices */
> >> - dm644x_set_vpfe_config(&vpfe_cfg);
> >> + dm644x_set_vpfe_config(&dm644xevm_capture_cfg);
> >> dm644x_init();
> >> }
> >>
> >> diff --git a/arch/arm/mach-davinci/dm644x.c
> >> b/arch/arm/mach-davinci/dm644x.c index 97aecf2..acd9ee2 100644
> >> --- a/arch/arm/mach-davinci/dm644x.c
> >> +++ b/arch/arm/mach-davinci/dm644x.c
> >> @@ -614,7 +614,7 @@ static struct platform_device dm644x_vpss_device = {
> >> .resource = dm644x_vpss_resources,
> >> };
> >>
> >> -static struct resource vpfe_resources[] = {
> >> +static struct resource dm644x_vpfe_resources[] = {
> >> {
> >> .start = IRQ_VDINT0,
> >> .end = IRQ_VDINT0,
> >> @@ -648,11 +648,11 @@ static struct platform_device dm644x_ccdc_dev = {
> >> },
> >> };
> >>
> >> -static struct platform_device vpfe_capture_dev = {
> >> +static struct platform_device dm644x_vpfe_dev = {
> >> .name = CAPTURE_DRV_NAME,
> >> .id = -1,
> >> - .num_resources = ARRAY_SIZE(vpfe_resources),
> >> - .resource = vpfe_resources,
> >> + .num_resources = ARRAY_SIZE(dm644x_vpfe_resources),
> >> + .resource = dm644x_vpfe_resources,
> >> .dev = {
> >> .dma_mask = &vpfe_capture_dma_mask,
> >> .coherent_dma_mask = DMA_BIT_MASK(32),
> >> @@ -661,7 +661,7 @@ static struct platform_device vpfe_capture_dev =
> >> {
> >>
> >> void dm644x_set_vpfe_config(struct vpfe_config *cfg) {
> >> - vpfe_capture_dev.dev.platform_data = cfg;
> >> + dm644x_vpfe_dev.dev.platform_data = cfg;
> >> }
> >>
> >>
> >> /*-------------------------------------------------------------------
> >> ---*/ @@ -809,7 +809,7 @@ static int __init dm644x_init_devices(void)
> >>
> >> platform_device_register(&dm644x_vpss_device);
> >> platform_device_register(&dm644x_ccdc_dev);
> >> - platform_device_register(&vpfe_capture_dev);
> >> + platform_device_register(&dm644x_vpfe_dev);
> >>
>
> Just a suggestion. Why don't we change these with platform_add_devices() API call and register all of the video devices in once call instead of separate calls to platform_device_register?
Thak you for the comment. In later patches we have a need to register three subsets of devices - vpfe, vpss and vpbe. So to make things simple, I have used this generic way. I suggest we keep the current format.
Thx,
-Manju
>
> >> return 0;
> >> }
> >> --
> >> 1.6.2.4
> >>
> >> _______________________________________________
> >> Davinci-linux-open-source mailing list
> >> Davinci-linux-open-source at linux.davincidsp.com
> >> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency
2011-12-21 13:43 ` [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency Manjunath Hadli
2011-12-21 14:55 ` Karicheri, Muralidharan
@ 2012-02-20 18:33 ` Nori, Sekhar
1 sibling, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 18:33 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:38, Hadli, Manjunath wrote:
> Add SoC and board prefixes to variable names so that it is
> consistent with the rest of the file.
>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
Again the subject line was not following the conventions
currently in place. I am pretty sure they were in place
at the time you submitted the patch too. Please take care
next time onwards. For now, I have fixed it while committing.
While I was at it, I also modified the subject line to make
it less verbose. Here is what I committed:
ARM: davinci: dm644x: fix inconsistent variable naming
Add dm644x_ prefix to names of v4l2 variables in dm644x.c
Add dm644xevm_ prefix to names of v4l2 variables in board-dm644x-evm.c.
This makes the code consistent with rest of these files.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 6/8] davinci: dm644x: move vpfe init from soc to board specific files
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
` (4 preceding siblings ...)
2011-12-21 13:43 ` [PATCH v7 5/8] davinci: dm644x: change vpfe capture structure variables for consistency Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2012-02-20 19:15 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 7/8] davinci: dm644x: add support for v4l2 video display Manjunath Hadli
2011-12-21 13:43 ` [PATCH v7 8/8] davinci: dm644x EVM: add support for VPBE display Manjunath Hadli
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Move all vpfe platform device registrations to the board specific
file like the rest of the devices, and have all of them together.
This would remove the restriction of inclusion and registration of
vpfe platform devices for non-vpfe boards.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
---
arch/arm/mach-davinci/board-dm644x-evm.c | 3 +--
arch/arm/mach-davinci/davinci.h | 2 +-
arch/arm/mach-davinci/dm644x.c | 29 +++++++++++++++++------------
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 7d940f5..71aae93 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -625,8 +625,6 @@ static struct davinci_uart_config uart_config __initdata = {
static void __init
davinci_evm_map_io(void)
{
- /* setup input configuration for VPFE input devices */
- dm644x_set_vpfe_config(&dm644xevm_capture_cfg);
dm644x_init();
}
@@ -698,6 +696,7 @@ static __init void davinci_evm_init(void)
evm_init_i2c();
davinci_setup_mmc(0, &dm6446evm_mmc_config);
+ dm644x_init_video(&dm644xevm_capture_cfg);
davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_evm_snd_data);
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 065b3a0..680446f 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -81,7 +81,7 @@ void dm365_set_vpfe_config(struct vpfe_config *cfg);
/* DM644x function declarations */
void __init dm644x_init(void);
void __init dm644x_init_asp(struct snd_platform_data *pdata);
-void dm644x_set_vpfe_config(struct vpfe_config *cfg);
+int __init dm644x_init_video(struct vpfe_config *);
/* DM646x function declarations */
void __init dm646x_init(void);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index acd9ee2..27bf9ca 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -659,11 +659,6 @@ static struct platform_device dm644x_vpfe_dev = {
},
};
-void dm644x_set_vpfe_config(struct vpfe_config *cfg)
-{
- dm644x_vpfe_dev.dev.platform_data = cfg;
-}
-
/*----------------------------------------------------------------------*/
static struct map_desc dm644x_io_desc[] = {
@@ -792,14 +787,28 @@ void __init dm644x_init(void)
davinci_map_sysmod();
}
+static struct platform_device *dm644x_video_devices[] __initdata = {
+ &dm644x_vpss_device,
+ &dm644x_ccdc_dev,
+ &dm644x_vpfe_dev,
+};
+
+int __init dm644x_init_video(struct vpfe_config *vpfe_cfg)
+{
+ dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
+ /* Add ccdc clock aliases */
+ clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
+ clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
+ platform_add_devices(dm644x_video_devices,
+ ARRAY_SIZE(dm644x_video_devices));
+ return 0;
+}
+
static int __init dm644x_init_devices(void)
{
if (!cpu_is_davinci_dm644x())
return 0;
- /* Add ccdc clock aliases */
- clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
- clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
platform_device_register(&dm644x_edma_device);
platform_device_register(&dm644x_mdio_device);
@@ -807,10 +816,6 @@ static int __init dm644x_init_devices(void)
clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev),
NULL, &dm644x_emac_device.dev);
- platform_device_register(&dm644x_vpss_device);
- platform_device_register(&dm644x_ccdc_dev);
- platform_device_register(&dm644x_vpfe_dev);
-
return 0;
}
postcore_initcall(dm644x_init_devices);
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 6/8] davinci: dm644x: move vpfe init from soc to board specific files
2011-12-21 13:43 ` [PATCH v7 6/8] davinci: dm644x: move vpfe init from soc to board specific files Manjunath Hadli
@ 2012-02-20 19:15 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 19:15 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:39, Hadli, Manjunath wrote:
> Move all vpfe platform device registrations to the board specific
> file like the rest of the devices, and have all of them together.
I dropped this line from commit text since EMAC and MDIO still
seem to be registered all the time so the "like the rest of the
devices" part isn't really true.
>
> This would remove the restriction of inclusion and registration of
> vpfe platform devices for non-vpfe boards.
I don't think the term "non-vpfe board" is in the right sense.
So, I replace this with the expanded form: "boards which do not use vpfe".
Apart from this, I also added the "ARM: " prefix to subject.
> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
> index 7d940f5..71aae93 100644
> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> +static struct platform_device *dm644x_video_devices[] __initdata = {
> + &dm644x_vpss_device,
> + &dm644x_ccdc_dev,
> + &dm644x_vpfe_dev,
> +};
You add this array here and remove it in the very next patch. That's
not the right way of doing things. I dropped this array when committing
this patch.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 7/8] davinci: dm644x: add support for v4l2 video display
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
` (5 preceding siblings ...)
2011-12-21 13:43 ` [PATCH v7 6/8] davinci: dm644x: move vpfe init from soc to board specific files Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
2012-02-20 20:23 ` Nori, Sekhar
2011-12-21 13:43 ` [PATCH v7 8/8] davinci: dm644x EVM: add support for VPBE display Manjunath Hadli
7 siblings, 1 reply; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
Create platform devices for various video modules like venc,osd,
vpbe and v4l2 driver for dm644x. Change the dm644x_init_video to
make room for display config, and register the vpfe or vpbe devices
based on the config pointer validity to make sure boards without vpfe
or vpbe can be built with minimal changes.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
---
arch/arm/mach-davinci/board-dm644x-evm.c | 2 +-
arch/arm/mach-davinci/davinci.h | 7 +-
arch/arm/mach-davinci/dm644x.c | 163 +++++++++++++++++++++++++++---
3 files changed, 154 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 71aae93..8d6e4f6 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -696,7 +696,7 @@ static __init void davinci_evm_init(void)
evm_init_i2c();
davinci_setup_mmc(0, &dm6446evm_mmc_config);
- dm644x_init_video(&dm644xevm_capture_cfg);
+ dm644x_init_video(&dm644xevm_capture_cfg, NULL);
davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_evm_snd_data);
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 680446f..fcfe2f8 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -27,6 +27,11 @@
#include <media/davinci/vpfe_capture.h>
#include <media/davinci/vpif_types.h>
+#include <media/davinci/vpss.h>
+#include <media/davinci/vpbe_types.h>
+#include <media/davinci/vpbe_venc.h>
+#include <media/davinci/vpbe.h>
+#include <media/davinci/vpbe_osd.h>
#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
@@ -81,7 +86,7 @@ void dm365_set_vpfe_config(struct vpfe_config *cfg);
/* DM644x function declarations */
void __init dm644x_init(void);
void __init dm644x_init_asp(struct snd_platform_data *pdata);
-int __init dm644x_init_video(struct vpfe_config *);
+int __init dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
/* DM646x function declarations */
void __init dm646x_init(void);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 27bf9ca..6809bea 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -627,7 +627,7 @@ static struct resource dm644x_vpfe_resources[] = {
},
};
-static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
+static u64 dm644x_video_dma_mask = DMA_BIT_MASK(32);
static struct resource dm644x_ccdc_resource[] = {
/* CCDC Base address */
{
@@ -643,7 +643,7 @@ static struct platform_device dm644x_ccdc_dev = {
.num_resources = ARRAY_SIZE(dm644x_ccdc_resource),
.resource = dm644x_ccdc_resource,
.dev = {
- .dma_mask = &vpfe_capture_dma_mask,
+ .dma_mask = &dm644x_video_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
@@ -654,7 +654,127 @@ static struct platform_device dm644x_vpfe_dev = {
.num_resources = ARRAY_SIZE(dm644x_vpfe_resources),
.resource = dm644x_vpfe_resources,
.dev = {
- .dma_mask = &vpfe_capture_dma_mask,
+ .dma_mask = &dm644x_video_dma_mask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ },
+};
+
+#define DM644X_OSD_BASE 0x01c72600
+
+static struct resource dm644x_osd_resources[] = {
+ {
+ .start = DM644X_OSD_BASE,
+ .end = DM644X_OSD_BASE + 0x1ff,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct osd_platform_data dm644x_osd_data = {
+ .vpbe_type = VPBE_VERSION_1,
+};
+
+static struct platform_device dm644x_osd_dev = {
+ .name = VPBE_OSD_SUBDEV_NAME,
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dm644x_osd_resources),
+ .resource = dm644x_osd_resources,
+ .dev = {
+ .dma_mask = &dm644x_video_dma_mask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &dm644x_osd_data,
+ },
+};
+
+#define DM644X_VENC_BASE 0x01c72400
+
+static struct resource dm644x_venc_resources[] = {
+ {
+ .start = DM644X_VENC_BASE,
+ .end = DM644X_VENC_BASE + 0x17f,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
+ unsigned int mode)
+{
+ int ret = 0;
+ void __iomem *vpss_clkctl_reg;
+
+ vpss_clkctl_reg = DAVINCI_SYSMODULE_VIRT(0x44);
+
+ switch (type) {
+ case VPBE_ENC_STD:
+ writel(0x18, vpss_clkctl_reg);
+ break;
+ case VPBE_ENC_DV_PRESET:
+ switch (mode) {
+ case V4L2_DV_480P59_94:
+ case V4L2_DV_576P50:
+ writel(0x19, vpss_clkctl_reg);
+ break;
+ case V4L2_DV_720P60:
+ case V4L2_DV_1080I60:
+ case V4L2_DV_1080P30:
+ /*
+ * For HD, use external clock source since
+ * HD requires higher clock rate
+ */
+ writel(0xa, vpss_clkctl_reg);
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
+ break;
+ default:
+ ret = -EINVAL;
+ }
+
+ return ret;
+}
+
+static struct resource dm644x_v4l2_disp_resources[] = {
+ {
+ .start = IRQ_VENCINT,
+ .end = IRQ_VENCINT,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device dm644x_vpbe_display = {
+ .name = "vpbe-v4l2",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dm644x_v4l2_disp_resources),
+ .resource = dm644x_v4l2_disp_resources,
+ .dev = {
+ .dma_mask = &dm644x_video_dma_mask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ },
+};
+
+static struct venc_platform_data dm644x_venc_pdata = {
+ .venc_type = VPBE_VERSION_1,
+ .setup_clock = dm644x_venc_setup_clock,
+};
+
+static struct platform_device dm644x_venc_dev = {
+ .name = VPBE_VENC_SUBDEV_NAME,
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dm644x_venc_resources),
+ .resource = dm644x_venc_resources,
+ .dev = {
+ .dma_mask = &dm644x_video_dma_mask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &dm644x_venc_pdata,
+ },
+};
+
+static struct platform_device dm644x_vpbe_dev = {
+ .name = "vpbe_controller",
+ .id = -1,
+ .dev = {
+ .dma_mask = &dm644x_video_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
@@ -787,20 +907,31 @@ void __init dm644x_init(void)
davinci_map_sysmod();
}
-static struct platform_device *dm644x_video_devices[] __initdata = {
- &dm644x_vpss_device,
- &dm644x_ccdc_dev,
- &dm644x_vpfe_dev,
-};
-
-int __init dm644x_init_video(struct vpfe_config *vpfe_cfg)
+int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
+ struct vpbe_config *vpbe_cfg)
{
- dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
- /* Add ccdc clock aliases */
- clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
- clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
- platform_add_devices(dm644x_video_devices,
- ARRAY_SIZE(dm644x_video_devices));
+ if (vpfe_cfg || vpbe_cfg)
+ platform_device_register(&dm644x_vpss_device);
+
+ if (vpfe_cfg) {
+ dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
+ platform_device_register(&dm644x_ccdc_dev);
+ platform_device_register(&dm644x_vpfe_dev);
+ /* Add ccdc clock aliases */
+ clk_add_alias("master", dm644x_ccdc_dev.name,
+ "vpss_master", NULL);
+ clk_add_alias("slave", dm644x_ccdc_dev.name,
+ "vpss_slave", NULL);
+ }
+
+ if (vpbe_cfg) {
+ dm644x_vpbe_dev.dev.platform_data = vpbe_cfg;
+ platform_device_register(&dm644x_osd_dev);
+ platform_device_register(&dm644x_venc_dev);
+ platform_device_register(&dm644x_vpbe_dev);
+ platform_device_register(&dm644x_vpbe_display);
+ }
+
return 0;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH v7 7/8] davinci: dm644x: add support for v4l2 video display
2011-12-21 13:43 ` [PATCH v7 7/8] davinci: dm644x: add support for v4l2 video display Manjunath Hadli
@ 2012-02-20 20:23 ` Nori, Sekhar
0 siblings, 0 replies; 18+ messages in thread
From: Nori, Sekhar @ 2012-02-20 20:23 UTC (permalink / raw)
To: linux-arm-kernel
Hi Manju,
On Wed, Dec 21, 2011 at 19:13:40, Hadli, Manjunath wrote:
> Create platform devices for various video modules like venc,osd,
> vpbe and v4l2 driver for dm644x. Change the dm644x_init_video to
> make room for display config, and register the vpfe or vpbe devices
> based on the config pointer validity to make sure boards without vpfe
> or vpbe can be built with minimal changes.
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> +static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
> + unsigned int mode)
> +{
> + int ret = 0;
> + void __iomem *vpss_clkctl_reg;
> +
> + vpss_clkctl_reg = DAVINCI_SYSMODULE_VIRT(0x44);
Please define a macro for the register offset in davinci.h
and use it here. You can also get rid of the variable.
> +
> + switch (type) {
> + case VPBE_ENC_STD:
> + writel(0x18, vpss_clkctl_reg);
Can you please use some masks to clarify how this and other such magic
numbers below (0x19, 0xa) are arrived at?
I would have made this change myself as I was doing it for rest
of the patches so far, but I cant seem to find the register definition
in any of the documentation I have looked at so far!
I have pushed patches 3-6 into 'v3.4/cleanup' branch of my tree[1].
Can you re-submit the remaining to patches after rebasing to
this branch? I have very little time left before I plan to send
the first sent of v3.4 changes to Arnd/Olof so please get back
quickly. Thanks for the help here.
You need to pull 'v3.4/cleanup' after the 'dependencies' branch to take care
of some build dependencies.
Thanks,
Sekhar
[1] git://gitorious.org/linux-davinci/linux-davinci.git
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v7 8/8] davinci: dm644x EVM: add support for VPBE display
2011-12-21 13:43 [PATCH v7 0/8] ARM: davinci:add support for dm644x vpbe display driver Manjunath Hadli
` (6 preceding siblings ...)
2011-12-21 13:43 ` [PATCH v7 7/8] davinci: dm644x: add support for v4l2 video display Manjunath Hadli
@ 2011-12-21 13:43 ` Manjunath Hadli
7 siblings, 0 replies; 18+ messages in thread
From: Manjunath Hadli @ 2011-12-21 13:43 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds support for V4L2 video display to DM6446 EVM.
Support for SD and ED modes is provided, along with Composite
and Component outputs.Also added vpbe_config as a parameter for
dm644x_init_video to allow for registration of vpbe platform devices.
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/board-dm644x-evm.c | 108 +++++++++++++++++++++++++++++-
1 files changed, 107 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 8d6e4f6..142154b 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -613,6 +613,112 @@ static void __init evm_init_i2c(void)
i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
}
+#define VENC_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
+
+/* venc standard timings */
+static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = {
+ {
+ .name = "ntsc",
+ .timings_type = VPBE_ENC_STD,
+ .timings = {V4L2_STD_525_60},
+ .interlaced = 1,
+ .xres = 720,
+ .yres = 480,
+ .aspect = {11, 10},
+ .fps = {30000, 1001},
+ .left_margin = 0x79,
+ .upper_margin = 0x10,
+ },
+ {
+ .name = "pal",
+ .timings_type = VPBE_ENC_STD,
+ .timings = {V4L2_STD_625_50},
+ .interlaced = 1,
+ .xres = 720,
+ .yres = 576,
+ .aspect = {54, 59},
+ .fps = {25, 1},
+ .left_margin = 0x7e,
+ .upper_margin = 0x16,
+ },
+};
+
+/* venc dv preset timings */
+static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
+ {
+ .name = "480p59_94",
+ .timings_type = VPBE_ENC_DV_PRESET,
+ .timings = {V4L2_DV_480P59_94},
+ .interlaced = 0,
+ .xres = 720,
+ .yres = 480,
+ .aspect = {1, 1},
+ .fps = {5994, 100},
+ .left_margin = 0x80,
+ .upper_margin = 0x20,
+ },
+ {
+ .name = "576p50",
+ .timings_type = VPBE_ENC_DV_PRESET,
+ .timings = {V4L2_DV_576P50},
+ .interlaced = 0,
+ .xres = 720,
+ .yres = 576,
+ .aspect = {1, 1},
+ .fps = {50, 1},
+ .left_margin = 0x7e,
+ .upper_margin = 0x30,
+ },
+};
+
+/*
+ * The outputs available from VPBE + encoders. Keep the order same
+ * as that of encoders. First those from venc followed by that from
+ * encoders. Index in the output refers to index on a particular encoder.
+ * Driver uses this index to pass it to encoder when it supports more than
+ * one output. Application uses index of the array to set an output.
+ */
+static struct vpbe_output dm644xevm_vpbe_outputs[] = {
+ {
+ .output = {
+ .index = 0,
+ .name = "Composite",
+ .type = V4L2_OUTPUT_TYPE_ANALOG,
+ .std = VENC_STD_ALL,
+ .capabilities = V4L2_OUT_CAP_STD,
+ },
+ .subdev_name = VPBE_VENC_SUBDEV_NAME,
+ .default_mode = "ntsc",
+ .num_modes = ARRAY_SIZE(dm644xevm_enc_std_timing),
+ .modes = dm644xevm_enc_std_timing,
+ },
+ {
+ .output = {
+ .index = 1,
+ .name = "Component",
+ .type = V4L2_OUTPUT_TYPE_ANALOG,
+ .capabilities = V4L2_OUT_CAP_PRESETS,
+ },
+ .subdev_name = VPBE_VENC_SUBDEV_NAME,
+ .default_mode = "480p59_94",
+ .num_modes = ARRAY_SIZE(dm644xevm_enc_preset_timing),
+ .modes = dm644xevm_enc_preset_timing,
+ },
+};
+
+static struct vpbe_config dm644xevm_display_cfg = {
+ .module_name = "dm644x-vpbe-display",
+ .i2c_adapter_id = 1,
+ .osd = {
+ .module_name = VPBE_OSD_SUBDEV_NAME,
+ },
+ .venc = {
+ .module_name = VPBE_VENC_SUBDEV_NAME,
+ },
+ .num_outputs = ARRAY_SIZE(dm644xevm_vpbe_outputs),
+ .outputs = dm644xevm_vpbe_outputs,
+};
+
static struct platform_device *davinci_evm_devices[] __initdata = {
&davinci_fb_device,
&rtc_dev,
@@ -696,7 +802,7 @@ static __init void davinci_evm_init(void)
evm_init_i2c();
davinci_setup_mmc(0, &dm6446evm_mmc_config);
- dm644x_init_video(&dm644xevm_capture_cfg, NULL);
+ dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg);
davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_evm_snd_data);
--
1.6.2.4
^ permalink raw reply related [flat|nested] 18+ messages in thread