diff options
| author | Koen Kooi <koen@openembedded.org> | 2009-07-16 16:06:44 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2009-07-16 16:06:44 +0200 |
| commit | 2dff7b788dc52c5da3fd2c5863dfad857a7d1710 (patch) | |
| tree | 3d886c3668bef111888bcef19e02810818c85101 /recipes/linux | |
| parent | aa55a8abaf9adebea97408b95abbe5849b1f9411 (diff) | |
linux-omap 2.6.29: update support for the ISP resizer
Diffstat (limited to 'recipes/linux')
| -rw-r--r-- | recipes/linux/linux-omap-2.6.29/beagleboard/defconfig | 58 | ||||
| -rw-r--r-- | recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch | 153 | ||||
| -rw-r--r-- | recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch (renamed from recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch) | 1163 | ||||
| -rw-r--r-- | recipes/linux/linux-omap-2.6.29/isp/resizer/0024-OMAP3-Resizer-V4L2-buf-layer-issues-fixed.patch (renamed from recipes/linux/linux-omap-2.6.29/isp/standalone/0002-Resizer-bug-fixes-on-top-of-1.0.2-release.patch) | 35 | ||||
| -rw-r--r-- | recipes/linux/linux-omap-2.6.29/isp/resizer/0025-OMAP3-Resizer-Build-issues-fixed.patch | 36 | ||||
| -rw-r--r-- | recipes/linux/linux-omap_2.6.29.bb | 6 |
6 files changed, 174 insertions, 1277 deletions
diff --git a/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig b/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig index 1aa7cf57ac..99be5246a6 100644 --- a/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig +++ b/recipes/linux/linux-omap-2.6.29/beagleboard/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.29-omap1 -# Fri May 29 14:47:52 2009 +# Thu Jul 16 15:21:36 2009 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -32,6 +32,7 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set @@ -189,8 +190,7 @@ CONFIG_ARCH_OMAP3=y # # CONFIG_OMAP_DEBUG_POWERDOMAIN is not set # CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set -CONFIG_OMAP_SMARTREFLEX=y -# CONFIG_OMAP_SMARTREFLEX_TESTING is not set +# CONFIG_OMAP_SMARTREFLEX is not set CONFIG_OMAP_RESET_CLOCKS=y CONFIG_OMAP_BOOT_TAG=y CONFIG_OMAP_BOOT_REASON=y @@ -199,7 +199,7 @@ CONFIG_OMAP_BOOT_REASON=y # CONFIG_OMAP_MUX is not set CONFIG_OMAP_MCBSP=y # CONFIG_OMAP_MBOX_FWK is not set -# CONFIG_OMAP_IOMMU is not set +CONFIG_OMAP_IOMMU=y # CONFIG_OMAP_MPU_TIMER is not set CONFIG_OMAP_32K_TIMER=y CONFIG_OMAP_32K_TIMER_HZ=128 @@ -217,9 +217,9 @@ CONFIG_ARCH_OMAP3430=y # CONFIG_MACH_NOKIA_RX51 is not set # CONFIG_MACH_OMAP_LDP is not set # CONFIG_MACH_OMAP_3430SDP is not set -# CONFIG_MACH_OMAP3EVM is not set +CONFIG_MACH_OMAP3EVM=y CONFIG_MACH_OMAP3_BEAGLE=y -# CONFIG_MACH_OVERO is not set +CONFIG_MACH_OVERO=y # CONFIG_MACH_OMAP3_PANDORA is not set # @@ -268,7 +268,7 @@ CONFIG_VMSPLIT_3G=y # CONFIG_VMSPLIT_2G is not set # CONFIG_VMSPLIT_1G is not set CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PREEMPT is not set +CONFIG_PREEMPT=y CONFIG_HZ=128 CONFIG_AEABI=y # CONFIG_OABI_COMPAT is not set @@ -1034,8 +1034,43 @@ CONFIG_MACVLAN=m CONFIG_EQUALIZER=m CONFIG_TUN=m CONFIG_VETH=m -# CONFIG_NET_ETHERNET is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set +CONFIG_NET_ETHERNET=y CONFIG_MII=y +# CONFIG_AX88796 is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set +# CONFIG_ENC28J60 is not set +CONFIG_SMC911X=y +CONFIG_SMSC911X=y +# CONFIG_DNET is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_B44 is not set # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set @@ -1471,6 +1506,7 @@ CONFIG_MEDIA_TUNER_MXL5005S=m CONFIG_VIDEO_V4L2=m CONFIG_VIDEO_V4L1=m CONFIG_VIDEOBUF_GEN=m +CONFIG_VIDEOBUF_DMA_SG=m CONFIG_VIDEOBUF_VMALLOC=m CONFIG_VIDEOBUF_DVB=m CONFIG_VIDEO_IR=m @@ -1494,7 +1530,8 @@ CONFIG_VIDEO_VIVI=m # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_VIDEO_AU0828 is not set -# CONFIG_VIDEO_OMAP3 is not set +CONFIG_VIDEO_OMAP3=m +CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=m # CONFIG_SOC_CAMERA is not set CONFIG_V4L_USB_DRIVERS=y CONFIG_USB_VIDEO_CLASS=m @@ -1818,6 +1855,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y CONFIG_SND_SOC=y CONFIG_SND_OMAP_SOC=y CONFIG_SND_OMAP_SOC_MCBSP=y +# CONFIG_SND_OMAP_SOC_OVERO is not set CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_ALL_CODECS is not set @@ -2514,6 +2552,7 @@ CONFIG_SCHEDSTATS=y CONFIG_TIMER_STATS=y # CONFIG_DEBUG_OBJECTS is not set # CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_PREEMPT=y # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set @@ -2551,6 +2590,7 @@ CONFIG_TRACING=y # # CONFIG_FUNCTION_TRACER is not set # CONFIG_IRQSOFF_TRACER is not set +# CONFIG_PREEMPT_TRACER is not set # CONFIG_SCHED_TRACER is not set # CONFIG_CONTEXT_SWITCH_TRACER is not set # CONFIG_BOOT_TRACER is not set diff --git a/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch b/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch deleted file mode 100644 index 902f87943d..0000000000 --- a/recipes/linux/linux-omap-2.6.29/isp/base/0001-omap3-Add-base-address-definitions-and-resources-fo.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 742cc1e62f0d04333c51630f3020da000aeb6de1 Mon Sep 17 00:00:00 2001 -From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> -Date: Mon, 2 Mar 2009 19:36:26 +0200 -Subject: [PATCH] omap3: Add base address definitions and resources for OMAP 3 ISP - -This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14] -OMAP34XX: CAM: Resources fixes". - -Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> ---- - arch/arm/mach-omap2/devices.c | 66 ++++++++++++++++++++++++--- - arch/arm/plat-omap/include/mach/omap34xx.h | 28 +++++++++++- - 2 files changed, 85 insertions(+), 9 deletions(-) - -diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c -index dad4528..2568b0c 100644 ---- a/arch/arm/mach-omap2/devices.c -+++ b/arch/arm/mach-omap2/devices.c -@@ -56,10 +56,60 @@ static inline void omap_init_camera(void) - - #elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) - --static struct resource cam_resources[] = { -+static struct resource omap3isp_resources[] = { -+ { -+ .start = OMAP3430_ISP_BASE, -+ .end = OMAP3430_ISP_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_CBUFF_BASE, -+ .end = OMAP3430_ISP_CBUFF_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_CCP2_BASE, -+ .end = OMAP3430_ISP_CCP2_END, -+ .flags = IORESOURCE_MEM, -+ }, - { -- .start = OMAP34XX_CAMERA_BASE, -- .end = OMAP34XX_CAMERA_BASE + 0x1B70, -+ .start = OMAP3430_ISP_CCDC_BASE, -+ .end = OMAP3430_ISP_CCDC_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_HIST_BASE, -+ .end = OMAP3430_ISP_HIST_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_H3A_BASE, -+ .end = OMAP3430_ISP_H3A_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_PREV_BASE, -+ .end = OMAP3430_ISP_PREV_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_RESZ_BASE, -+ .end = OMAP3430_ISP_RESZ_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_SBL_BASE, -+ .end = OMAP3430_ISP_SBL_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_CSI2A_BASE, -+ .end = OMAP3430_ISP_CSI2A_END, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = OMAP3430_ISP_CSI2PHY_BASE, -+ .end = OMAP3430_ISP_CSI2PHY_END, - .flags = IORESOURCE_MEM, - }, - { -@@ -68,16 +118,16 @@ static struct resource cam_resources[] = { - } - }; - --static struct platform_device omap_cam_device = { -- .name = "omap34xxcam", -+static struct platform_device omap3isp_device = { -+ .name = "omap3isp", - .id = -1, -- .num_resources = ARRAY_SIZE(cam_resources), -- .resource = cam_resources, -+ .num_resources = ARRAY_SIZE(omap3isp_resources), -+ .resource = omap3isp_resources, - }; - - static inline void omap_init_camera(void) - { -- platform_device_register(&omap_cam_device); -+ platform_device_register(&omap3isp_device); - } - #else - static inline void omap_init_camera(void) -diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h -index 27a1e45..3bfbdf7 100644 ---- a/arch/arm/plat-omap/include/mach/omap34xx.h -+++ b/arch/arm/plat-omap/include/mach/omap34xx.h -@@ -49,6 +49,33 @@ - #define OMAP343X_CTRL_BASE OMAP343X_SCM_BASE - - #define OMAP34XX_IC_BASE 0x48200000 -+ -+#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000) -+#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100) -+#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400) -+#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600) -+#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00) -+#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00) -+#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00) -+#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000) -+#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200) -+#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) -+#define OMAP3430_ISP_CSI2A_BASE (OMAP3430_ISP_BASE + 0x1800) -+#define OMAP3430_ISP_CSI2PHY_BASE (OMAP3430_ISP_BASE + 0x1970) -+ -+#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F) -+#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077) -+#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF) -+#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7) -+#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047) -+#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F) -+#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F) -+#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB) -+#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB) -+#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F) -+#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F) -+#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007) -+ - #define OMAP34XX_IVA_INTC_BASE 0x40000000 - #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) - #define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000) -@@ -56,7 +83,6 @@ - #define OMAP34XX_SR1_BASE 0x480C9000 - #define OMAP34XX_SR2_BASE 0x480CB000 - --#define OMAP34XX_CAMERA_BASE (L4_34XX_BASE + 0xBC000) - #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) - - --- -1.5.6.5 - diff --git a/recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch b/recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch index f796ce8346..3390599292 100644 --- a/recipes/linux/linux-omap-2.6.29/isp/standalone/0001-Resizer-and-Previewer-driver-added-to-commit.patch +++ b/recipes/linux/linux-omap-2.6.29/isp/resizer/0023-OMAP-Resizer-Basic-Resizer-refreshed-with-latest-gi.patch @@ -1,99 +1,97 @@ -From 3041daa54b49bcb6ab444c7b9e14bc6a1ade6236 Mon Sep 17 00:00:00 2001 -From: Vaibhav Hiremath <hvaibhav@ti.com> -Date: Fri, 13 Feb 2009 14:44:20 +0530 -Subject: [PATCH 1/2] Resizer and Previewer driver added to commit +From 38f3cd5564a466e5251fc2ff47e0504148922304 Mon Sep 17 00:00:00 2001 +From: Vaibhav Hiremath <vaibhav@psp-nfs-02.india.ti.com> +Date: Wed, 29 Apr 2009 17:18:56 +0530 +Subject: [PATCH 23/26] OMAP-Resizer: Basic Resizer refreshed with latest gitorious tree -The Resizer and Previewer driver added to the commit -from the patch submitted by Sergio on 12 Dec 2008. +This is same resizer driver patch posted by Sergio onto +mailing list quite a some time back. This commit refreshes +the same patch on top of latest gitorious.org tree. -The new WTBU code base and Nokia fixes package doesn't contain -standalone resizer driver support. +List of New/Modified files: + modified: drivers/media/video/Kconfig + modified: drivers/media/video/isp/Makefile + modified: drivers/media/video/isp/isp.c + modified: drivers/media/video/isp/ispreg.h + new file: drivers/media/video/isp/omap_resizer.c + new file: include/linux/omap_resizer.h -Following major changes done - - - - Added stand-alone resizer driver support - in isp.c file. - - Seperate Kconfig file created - - hardware access of resizer module fixed as per new - isp.c - -Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> +TODO: + - Resizer driver needs to be independent from camera and ISP + - Custom patches implemented ontop of PSP1.0.2 release + to fix some V4L2-buf layer issues. + - --- - drivers/media/video/Kconfig | 5 +- - drivers/media/video/isp/Kconfig | 16 + - drivers/media/video/isp/Makefile | 7 + - drivers/media/video/isp/isp.c | 12 + - drivers/media/video/isp/ispmmu.c | 1 + - drivers/media/video/isp/omap_previewer.c | 825 +++++++++++++++ - drivers/media/video/isp/omap_previewer.h | 162 +++ - drivers/media/video/isp/omap_resizer.c | 1634 ++++++++++++++++++++++++++++++ - include/linux/omap_resizer.h | 136 +++ - 9 files changed, 2794 insertions(+), 4 deletions(-) - create mode 100644 drivers/media/video/isp/Kconfig - create mode 100644 drivers/media/video/isp/omap_previewer.c - create mode 100644 drivers/media/video/isp/omap_previewer.h + drivers/media/video/Kconfig | 7 + + drivers/media/video/isp/Makefile | 4 + + drivers/media/video/isp/isp.c | 15 + + drivers/media/video/isp/omap_resizer.c | 1634 ++++++++++++++++++++++++++++++++ + include/linux/omap_resizer.h | 136 +++ + 5 files changed, 1796 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/isp/omap_resizer.c create mode 100644 include/linux/omap_resizer.h -diff --git a/drivers/media/video/isp/Kconfig b/drivers/media/video/isp/Kconfig -new file mode 100644 -index 0000000..acda63b ---- /dev/null -+++ b/drivers/media/video/isp/Kconfig -@@ -0,0 +1,16 @@ -+# Kconfig for OMAP3 ISP driver -+ -+config VIDEO_OMAP3_ISP -+ tristate +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 3cdb5a4..d2b4ae1 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -720,6 +720,13 @@ config VIDEO_OMAP3 + ---help--- + Driver for an OMAP 3 camera controller. + ++config VIDEO_OMAP34XX_ISP_RESIZER ++ tristate "OMAP ISP Resizer" ++ depends on VIDEO_V4L2 && ARCH_OMAP34XX + select VIDEOBUF_GEN + select VIDEOBUF_DMA_SG ++ select OMAP_IOMMU + -+config VIDEO_OMAP34XX_ISP_PREVIEWER -+ tristate "OMAP ISP Previewer" -+ depends on !ARCH_OMAP3410 -+ select VIDEO_OMAP3_ISP -+ -+config VIDEO_OMAP34XX_ISP_RESIZER -+ tristate "OMAP ISP Resizer" -+ depends on !ARCH_OMAP3410 -+ select VIDEO_OMAP3_ISP + config SOC_CAMERA + tristate "SoC camera support" + depends on VIDEO_V4L2 && HAS_DMA diff --git a/drivers/media/video/isp/Makefile b/drivers/media/video/isp/Makefile -index 0f9301c..ed10a51 100644 +index f14d617..d171fb9 100644 --- a/drivers/media/video/isp/Makefile +++ b/drivers/media/video/isp/Makefile -@@ -7,6 +7,13 @@ else +@@ -7,6 +7,10 @@ else isp-mod-objs += \ isp.o ispccdc.o ispmmu.o \ isppreview.o ispresizer.o isph3a.o isphist.o isp_af.o ispcsi2.o + -+obj-$(CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER) += \ -+ omap_previewer.o -+ +obj-$(CONFIG_VIDEO_OMAP34XX_ISP_RESIZER) += \ + omap_resizer.o + endif - obj-$(CONFIG_VIDEO_OMAP3_ISP) += isp-mod.o + obj-$(CONFIG_VIDEO_OMAP3) += isp-mod.o diff --git a/drivers/media/video/isp/isp.c b/drivers/media/video/isp/isp.c -index 6034a56..09a1792 100644 +index 54c839b..f1f92b4 100644 --- a/drivers/media/video/isp/isp.c +++ b/drivers/media/video/isp/isp.c -@@ -521,6 +521,13 @@ int isp_set_callback(enum isp_callback_type type, isp_callback_t callback, - OMAP3_ISP_IOMEM_MAIN, - ISP_IRQ0ENABLE); +@@ -505,6 +505,12 @@ int isp_set_callback(enum isp_callback_type type, isp_callback_t callback, + isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE, + IRQ0ENABLE_PRV_DONE_IRQ); break; + case CBK_RESZ_DONE: -+ isp_reg_writel(IRQ0ENABLE_RSZ_DONE_IRQ, OMAP3_ISP_IOMEM_MAIN, -+ ISP_IRQ0STATUS); -+ isp_reg_writel(isp_reg_readl(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE) | -+ IRQ0ENABLE_RSZ_DONE_IRQ, OMAP3_ISP_IOMEM_MAIN, -+ ISP_IRQ0ENABLE); ++ isp_reg_writel(IRQ0ENABLE_RSZ_DONE_IRQ, ++ OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0STATUS); ++ isp_reg_or(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE, ++ IRQ0ENABLE_RSZ_DONE_IRQ); + break; default: break; } -@@ -996,6 +1003,11 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_isp) +@@ -556,6 +562,10 @@ int isp_unset_callback(enum isp_callback_type type) + isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE, + ~IRQ0ENABLE_PRV_DONE_IRQ); + break; ++ case CBK_RESZ_DONE: ++ isp_reg_and(OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE, ++ ~IRQ0ENABLE_RSZ_DONE_IRQ); ++ break; + default: + break; + } +@@ -938,6 +948,11 @@ static irqreturn_t omap34xx_isp_isr(int irq, void *_isp) if (!ispresizer_busy()) ispresizer_config_shadow_registers(); isp_buf_process(bufs); @@ -105,1017 +103,6 @@ index 6034a56..09a1792 100644 } } -diff --git a/drivers/media/video/isp/ispmmu.c b/drivers/media/video/isp/ispmmu.c -index 076aea1..b943d5b 100644 ---- a/drivers/media/video/isp/ispmmu.c -+++ b/drivers/media/video/isp/ispmmu.c -@@ -289,6 +289,7 @@ int ispmmu_get_mapeable_space(void) - return (L2P_TABLE_NR - no_of_l2p_alloted) * ISPMMU_TTB_ENTRIES_NR * - ISPMMU_L2D_ENTRIES_NR; - } -+EXPORT_SYMBOL_GPL(ispmmu_get_mapeable_space); - - /** - * ispmmu_map - Map a physically contiguous buffer to ISP space. -diff --git a/drivers/media/video/isp/omap_previewer.c b/drivers/media/video/isp/omap_previewer.c -new file mode 100644 -index 0000000..634a056 ---- /dev/null -+++ b/drivers/media/video/isp/omap_previewer.c -@@ -0,0 +1,825 @@ -+/* -+ * drivers/media/video/isp/omap_previewer.c -+ * -+ * Wrapper for Preview module in TI's OMAP3430 ISP -+ * -+ * Copyright (C) 2008 Texas Instruments, Inc. -+ * -+ * Contributors: -+ * Leonides Martinez <leonides.martinez@ti.com> -+ * Sergio Aguirre <saaguirre@ti.com> -+ * -+ * This package is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ -+#include <linux/mutex.h> -+#include <linux/cdev.h> -+#include <linux/device.h> -+#include <linux/delay.h> -+#include <linux/fs.h> -+#include <linux/mm.h> -+#include <linux/module.h> -+#include <linux/platform_device.h> -+#include <linux/uaccess.h> -+#include <linux/io.h> -+#include <media/v4l2-dev.h> -+#include <asm/cacheflush.h> -+ -+#include "isp.h" -+#include "ispmmu.h" -+#include "ispreg.h" -+#include "omap_previewer.h" -+ -+#define OMAP_PREV_NAME "omap-previewer" -+ -+static int prev_major = -1; -+static struct device *prev_dev; -+static struct class *prev_class; -+static struct prev_device *prevdevice; -+static struct platform_driver omap_previewer_driver; -+ -+static u32 prev_bufsize; -+ -+/** -+ * prev_calculate_crop - Calculate crop size according to device parameters -+ * @device: Structure containing ISP preview wrapper global information -+ * @crop: Structure containing crop size -+ * -+ * This function is used to calculate frame size reduction depending on -+ * the features enabled by the application. -+ **/ -+static void prev_calculate_crop(struct prev_device *device, -+ struct prev_cropsize *crop) -+{ -+ dev_dbg(prev_dev, "prev_calculate_crop E\n"); -+ -+ if (!device || !crop) { -+ dev_err(prev_dev, "\nErron in argument"); -+ return; -+ } -+ -+ isppreview_try_size(device->params->size_params.hsize, -+ device->params->size_params.vsize, -+ &crop->hcrop, &crop->vcrop); -+ crop->hcrop &= PREV_16PIX_ALIGN_MASK; -+ dev_dbg(prev_dev, "prev_calculate_crop L\n"); -+} -+ -+/** -+ * prev_get_status - Get status of ISP preview module -+ * @status: Structure containing the busy state. -+ * -+ * Checks if the ISP preview module is busy. -+ * -+ * Returns 0 if successful, or -EINVAL if the status parameter is invalid. -+ **/ -+static int prev_get_status(struct prev_status *status) -+{ -+ if (!status) { -+ dev_err(prev_dev, "get_status: invalid parameter\n"); -+ return -EINVAL; -+ } -+ status->hw_busy = (char)isppreview_busy(); -+ return 0; -+} -+ -+/** -+ * prev_hw_setup - Stores the desired configuration in the proper HW registers -+ * @config: Structure containing the desired configuration for ISP preview -+ * module. -+ * -+ * Reads the structure sent, and modifies the desired registers. -+ * -+ * Always returns 0. -+ **/ -+static int prev_hw_setup(struct prev_params *config) -+{ -+ dev_dbg(prev_dev, "prev_hw_setup E\n"); -+ -+ if (config->features & PREV_AVERAGER) -+ isppreview_config_averager(config->average); -+ else -+ isppreview_config_averager(0); -+ -+ if (config->features & PREV_INVERSE_ALAW) -+ isppreview_enable_invalaw(1); -+ else -+ isppreview_enable_invalaw(0); -+ -+ if (config->features & PREV_HORZ_MEDIAN_FILTER) { -+ isppreview_config_hmed(config->hmf_params); -+ isppreview_enable_hmed(1); -+ } else -+ isppreview_enable_hmed(0); -+ -+ if (config->features & PREV_DARK_FRAME_SUBTRACT) { -+ isppreview_set_darkaddr(config->drkf_params.addr); -+ isppreview_config_darklineoffset(config->drkf_params.offset); -+ isppreview_enable_drkframe(1); -+ } else -+ isppreview_enable_drkframe(0); -+ -+ if (config->features & PREV_LENS_SHADING) { -+ isppreview_config_drkf_shadcomp(config->lens_shading_shift); -+ isppreview_enable_shadcomp(1); -+ } else -+ isppreview_enable_shadcomp(0); -+ -+ dev_dbg(prev_dev, "prev_hw_setup L\n"); -+ return 0; -+} -+ -+/** -+ * prev_validate_params - Validate configuration parameters for Preview Wrapper -+ * @params: Structure containing configuration parameters -+ * -+ * Validate configuration parameters for Preview Wrapper -+ * -+ * Returns 0 if successful, or -EINVAL if a parameter value is invalid. -+ **/ -+static int prev_validate_params(struct prev_params *params) -+{ -+ if (!params) { -+ dev_err(prev_dev, "validate_params: error in argument"); -+ goto err_einval; -+ } -+ -+ if ((params->features & PREV_AVERAGER) == PREV_AVERAGER) { -+ if ((params->average != NO_AVE) -+ && (params->average != AVE_2_PIX) -+ && (params->average != AVE_4_PIX) -+ && (params->average != AVE_8_PIX)) { -+ dev_err(prev_dev, "validate_params: wrong pix " -+ "average\n"); -+ goto err_einval; -+ } else if (((params->average == AVE_2_PIX) -+ && (params->size_params.hsize % 2)) -+ || ((params->average == AVE_4_PIX) -+ && (params->size_params.hsize % 4)) -+ || ((params->average == AVE_8_PIX) -+ && (params->size_params.hsize % 8))) { -+ dev_err(prev_dev, "validate_params: " -+ "wrong pix average for input size\n"); -+ goto err_einval; -+ } -+ } -+ -+ if ((params->size_params.pixsize != PREV_INWIDTH_8BIT) -+ && (params->size_params.pixsize -+ != PREV_INWIDTH_10BIT)) { -+ dev_err(prev_dev, "validate_params: wrong pixsize\n"); -+ goto err_einval; -+ } -+ -+ if (params->size_params.hsize > MAX_IMAGE_WIDTH -+ || params->size_params.hsize < 0) { -+ dev_err(prev_dev, "validate_params: wrong hsize\n"); -+ goto err_einval; -+ } -+ -+ if ((params->pix_fmt != YCPOS_YCrYCb) -+ && (YCPOS_YCbYCr != params->pix_fmt) -+ && (YCPOS_CbYCrY != params->pix_fmt) -+ && (YCPOS_CrYCbY != params->pix_fmt)) { -+ dev_err(prev_dev, "validate_params: wrong pix_fmt"); -+ goto err_einval; -+ } -+ -+ if ((params->features & PREV_DARK_FRAME_SUBTRACT) -+ && (params->features -+ & PREV_DARK_FRAME_CAPTURE)) { -+ dev_err(prev_dev, "validate_params: DARK FRAME CAPTURE and " -+ "SUBSTRACT cannot be enabled " -+ "at same time\n"); -+ goto err_einval; -+ } -+ -+ if (params->features & PREV_DARK_FRAME_SUBTRACT) -+ if (!params->drkf_params.addr -+ || (params->drkf_params.offset % 32)) { -+ dev_err(prev_dev, "validate_params: dark frame " -+ "address\n"); -+ goto err_einval; -+ } -+ -+ if (params->features & PREV_LENS_SHADING) -+ if ((params->lens_shading_shift > 7) -+ || !params->drkf_params.addr -+ || (params->drkf_params.offset % 32)) { -+ dev_err(prev_dev, "validate_params: lens shading " -+ "shift\n"); -+ goto err_einval; -+ } -+ -+ if ((params->size_params.in_pitch <= 0) -+ || (params->size_params.in_pitch % 32)) { -+ params->size_params.in_pitch = -+ (params->size_params.hsize * 2) & 0xFFE0; -+ dev_err(prev_dev, "\nError in in_pitch; new value = %d", -+ params->size_params.in_pitch); -+ } -+ -+ return 0; -+err_einval: -+ return -EINVAL; -+} -+ -+/** -+ * preview_isr - Callback from ISP driver for ISP Preview Interrupt -+ * @status: ISP IRQ0STATUS register value -+ * @arg1: Structure containing ISP preview wrapper global information -+ * @arg2: Currently not used -+ **/ -+static void preview_isr(unsigned long status, isp_vbq_callback_ptr arg1, -+ void *arg2) -+{ -+ struct prev_device *device = (struct prev_device *)arg1; -+ -+ if ((status & PREV_DONE) != PREV_DONE) -+ return; -+ -+ if (device) -+ complete(&device->wfc); -+} -+ -+/** -+ * prev_do_preview - Performs the Preview process -+ * @device: Structure containing ISP preview wrapper global information -+ * @arg: Currently not used -+ * -+ * Returns 0 if successful, or -EINVAL if the sent parameters are invalid. -+ **/ -+static int prev_do_preview(struct prev_device *device, int *arg) -+{ -+ int bpp, size; -+ int ret = 0; -+ u32 out_hsize, out_vsize, out_line_offset; -+ -+ dev_dbg(prev_dev, "prev_do_preview E\n"); -+ -+ if (!device) { -+ dev_err(prev_dev, "preview: invalid parameters\n"); -+ return -EINVAL; -+ } -+ -+ if (device->params->size_params.pixsize == PREV_INWIDTH_8BIT) -+ bpp = 1; -+ else -+ bpp = 2; -+ -+ size = device->params->size_params.hsize * -+ device->params->size_params.vsize * bpp; -+ -+ ret = isppreview_set_inaddr(device->isp_addr_read); -+ if (ret) -+ goto out; -+ -+ ret = isppreview_set_outaddr(device->isp_addr_read); -+ if (ret) -+ goto out; -+ -+ isppreview_try_size(device->params->size_params.hsize, -+ device->params->size_params.vsize, -+ &out_hsize, &out_vsize); -+ -+ ret = isppreview_config_inlineoffset(device->params->size_params.hsize -+ * bpp); -+ if (ret) -+ goto out; -+ -+ out_line_offset = (out_hsize * bpp) & PREV_32BYTES_ALIGN_MASK; -+ -+ ret = isppreview_config_outlineoffset(out_line_offset); -+ if (ret) -+ goto out; -+ -+ ret = isppreview_config_size(device->params->size_params.hsize, -+ device->params->size_params.vsize, -+ out_hsize, out_vsize); -+ if (ret) -+ goto out; -+ -+ isppreview_config_datapath(PRV_RAW_MEM, PREVIEW_MEM); -+ -+ ret = isp_set_callback(CBK_PREV_DONE, preview_isr, (void *)device, -+ (void *)NULL); -+ if (ret) { -+ dev_err(prev_dev, "ERROR while setting Previewer callback!\n"); -+ goto out; -+ } -+ isppreview_enable(1); -+ -+ wait_for_completion_interruptible(&device->wfc); -+ -+ if (device->isp_addr_read) { -+ ispmmu_vunmap(device->isp_addr_read); -+ device->isp_addr_read = 0; -+ } -+ -+ ret = isp_unset_callback(CBK_PREV_DONE); -+ -+ dev_dbg(prev_dev, "prev_do_preview L\n"); -+out: -+ return ret; -+} -+ -+/** -+ * previewer_vbq_release - Videobuffer queue release -+ * @q: Structure containing the videobuffer queue. -+ * @vb: Structure containing the videobuffer used for previewer processing. -+ **/ -+static void previewer_vbq_release(struct videobuf_queue *q, -+ struct videobuf_buffer *vb) -+{ -+ struct prev_fh *fh = q->priv_data; -+ struct prev_device *device = fh->device; -+ -+ ispmmu_vunmap(device->isp_addr_read); -+ device->isp_addr_read = 0; -+ spin_lock(&device->vbq_lock); -+ vb->state = VIDEOBUF_NEEDS_INIT; -+ spin_unlock(&device->vbq_lock); -+ dev_dbg(prev_dev, "previewer_vbq_release\n"); -+} -+ -+/** -+ * previewer_vbq_setup - Sets up the videobuffer size and validates count. -+ * @q: Structure containing the videobuffer queue. -+ * @cnt: Number of buffers requested -+ * @size: Size in bytes of the buffer used for previewing -+ * -+ * Always returns 0. -+ **/ -+static int previewer_vbq_setup(struct videobuf_queue *q, -+ unsigned int *cnt, -+ unsigned int *size) -+{ -+ struct prev_fh *fh = q->priv_data; -+ struct prev_device *device = fh->device; -+ u32 bpp = 1; -+ -+ spin_lock(&device->vbq_lock); -+ if (*cnt <= 0) -+ *cnt = VIDEO_MAX_FRAME; -+ -+ if (*cnt > VIDEO_MAX_FRAME) -+ *cnt = VIDEO_MAX_FRAME; -+ -+ if (!device->params->size_params.hsize || -+ !device->params->size_params.vsize) { -+ dev_err(prev_dev, "Can't setup buffer size\n"); -+ spin_unlock(&device->vbq_lock); -+ return -EINVAL; -+ } -+ -+ if (device->params->size_params.pixsize == PREV_INWIDTH_10BIT) -+ bpp = 2; -+ *size = prev_bufsize = bpp * device->params->size_params.hsize -+ * device->params->size_params.vsize; -+ spin_unlock(&device->vbq_lock); -+ dev_dbg(prev_dev, "previewer_vbq_setup\n"); -+ return 0; -+} -+ -+/** -+ * previewer_vbq_prepare - Videobuffer is prepared and mmapped. -+ * @q: Structure containing the videobuffer queue. -+ * @vb: Structure containing the videobuffer used for previewer processing. -+ * @field: Type of field to set in videobuffer device. -+ * -+ * Returns 0 if successful, or -EINVAL if buffer couldn't get allocated, or -+ * -EIO if the ISP MMU mapping fails -+ **/ -+static int previewer_vbq_prepare(struct videobuf_queue *q, -+ struct videobuf_buffer *vb, -+ enum v4l2_field field) -+{ -+ struct prev_fh *fh = q->priv_data; -+ struct prev_device *device = fh->device; -+ int err = -EINVAL; -+ unsigned int isp_addr; -+ struct videobuf_dmabuf *dma = videobuf_to_dma(vb); -+ -+ dev_dbg(prev_dev, "previewer_vbq_prepare E\n"); -+ spin_lock(&device->vbq_lock); -+ if (vb->baddr) { -+ vb->size = prev_bufsize; -+ vb->bsize = prev_bufsize; -+ } else { -+ spin_unlock(&device->vbq_lock); -+ dev_err(prev_dev, "No user buffer allocated\n"); -+ goto out; -+ } -+ -+ vb->width = device->params->size_params.hsize; -+ vb->height = device->params->size_params.vsize; -+ vb->field = field; -+ spin_unlock(&device->vbq_lock); -+ -+ if (vb->state == VIDEOBUF_NEEDS_INIT) { -+ err = videobuf_iolock(q, vb, NULL); -+ if (!err) { -+ isp_addr = ispmmu_vmap(dma->sglist, dma->sglen); -+ if (!isp_addr) -+ err = -EIO; -+ else -+ device->isp_addr_read = isp_addr; -+ } -+ } -+ -+ if (!err) { -+ vb->state = VIDEOBUF_PREPARED; -+ flush_cache_user_range(NULL, vb->baddr, -+ (vb->baddr + vb->bsize)); -+ } else -+ previewer_vbq_release(q, vb); -+ -+ dev_dbg(prev_dev, "previewer_vbq_prepare L\n"); -+out: -+ return err; -+} -+ -+static void previewer_vbq_queue(struct videobuf_queue *q, -+ struct videobuf_buffer *vb) -+{ -+ return; -+} -+ -+/** -+ * previewer_open - Initializes and opens the Preview Wrapper -+ * @inode: Inode structure associated with the Preview Wrapper -+ * @filp: File structure associated with the Preview Wrapper -+ * -+ * Returns 0 if successful, -EACCES if its unable to initialize default config, -+ * -EBUSY if its already opened or the ISP module is not available, or -ENOMEM -+ * if its unable to allocate the device in kernel space memory. -+ **/ -+static int previewer_open(struct inode *inode, struct file *filp) -+{ -+ int ret = 0; -+ struct prev_device *device = prevdevice; -+ struct prev_params *config = isppreview_get_config(); -+ struct prev_fh *fh; -+ -+ if (config == NULL) { -+ dev_err(prev_dev, "Unable to initialize default config " -+ "from isppreviewer\n\n"); -+ return -EACCES; -+ } -+ -+ if (device->opened || (filp->f_flags & O_NONBLOCK)) { -+ dev_err(prev_dev, "previewer_open: device is already " -+ "opened\n"); -+ return -EBUSY; -+ } -+ -+ fh = kzalloc(sizeof(struct prev_fh), GFP_KERNEL); -+ if (NULL == fh) -+ return -ENOMEM; -+ -+ isp_get(); -+ ret = isppreview_request(); -+ if (ret) { -+ isp_put(); -+ dev_err(prev_dev, "Can't acquire isppreview\n"); -+ return ret; -+ } -+ -+ device->params = config; -+ device->opened = 1; -+ -+ filp->private_data = fh; -+ fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
