diff options
author | guoyin.chen <guoyin.chen@freescale.com> | 2013-04-07 10:50:19 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@freescale.com> | 2013-04-07 10:50:19 +0800 |
commit | 7c8718a8d86182a1ea3ad6d89e2ff0201ca2a4a9 (patch) | |
tree | 353f54ee75b1ea2449213c936126b72ea11366ce /drivers | |
parent | 7e09444a91a1d439957a5cbe7a0b659c144ff653 (diff) | |
parent | 790715dfbc95afe64521f9d7ef60ef85c4a33849 (diff) |
Merge remote-tracking branch 'fsl-linux-sdk/imx_3.0.35_4.0.0' into imx_3.0.35_android
Conflicts:
arch/arm/mach-mx6/board-mx6q_hdmidongle.c
drivers/input/touchscreen/egalax_ts.c
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/input/touchscreen/Kconfig | 10 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c | 42 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/Kconfig | 9 | ||||
-rw-r--r-- | drivers/mtd/maps/Makefile | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/imx6x-weimnor.c | 299 | ||||
-rw-r--r-- | drivers/mxc/ipu/ipu_calc_stripes_sizes.c | 42 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_calc_stripes_sizes.c | 42 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_common.c | 3 |
9 files changed, 72 insertions, 380 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index b68c56071c84..d02c72e1cfbe 100755 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -199,6 +199,16 @@ config TOUCHSCREEN_ELAN To compile this driver as a module, choose M here: the module will be called elan-touch. +config TOUCHSCREEN_EGALAX_SINGLE_TOUCH + bool "EETI eGalax touchscreen as single-touch" + default N + depends on TOUCHSCREEN_EGALAX + help + If you say yes here you get single-touch touchscreen support + on the eGalax I2C controller. + If you say "no", you'll get the normal multi-touch. + + config TOUCHSCREEN_FUJITSU tristate "Fujitsu serial touchscreen" select SERIO diff --git a/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c b/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c index f324f4eac489..6d8d4399d7ad 100644 --- a/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c +++ b/drivers/media/video/mxc/capture/ipu_fg_overlay_sdc.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License @@ -55,7 +55,7 @@ static void csi_buf_work_func(struct work_struct *work) task.input.paddr = cam->vf_bufs[1]; task.input.width = cam->crop_current.width; task.input.height = cam->crop_current.height; - task.input.format = IPU_PIX_FMT_UYVY; + task.input.format = IPU_PIX_FMT_NV12; if (buffer_num == 0) task.output.paddr = fbi->fix.smem_start + @@ -124,7 +124,7 @@ static irqreturn_t csi_enc_callback(int irq, void *dev_id) ipu_select_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, csi_buffer_num); if ((cam->crop_current.width != cam->win.w.width) || (cam->crop_current.height != cam->win.w.height) || - (vf_out_format != IPU_PIX_FMT_UYVY) || + (vf_out_format != IPU_PIX_FMT_NV12) || (cam->rotation >= IPU_ROTATE_VERT_FLIP)) schedule_work(&cam->csi_work_struct); csi_buffer_num = (csi_buffer_num == 0) ? 1 : 0; @@ -134,7 +134,6 @@ static irqreturn_t csi_enc_callback(int irq, void *dev_id) static int csi_enc_setup(cam_data *cam) { ipu_channel_params_t params; - u32 pixel_fmt; int err = 0, sensor_protocol = 0; #ifdef CONFIG_MXC_MIPI_CSI2 void *mipi_csi2_info; @@ -213,7 +212,8 @@ static int csi_enc_setup(cam_data *cam) cam->vf_bufs_vaddr[1], (dma_addr_t) cam->vf_bufs[1]); } - csi_mem_bufsize = cam->crop_current.width * cam->crop_current.height * 2; + csi_mem_bufsize = cam->crop_current.width * + cam->crop_current.height * 3/2; cam->vf_bufs_size[0] = PAGE_ALIGN(csi_mem_bufsize); cam->vf_bufs_vaddr[0] = (void *)dma_alloc_coherent(0, cam->vf_bufs_size[0], @@ -246,13 +246,13 @@ static int csi_enc_setup(cam_data *cam) goto out_1; } - pixel_fmt = IPU_PIX_FMT_UYVY; if ((cam->crop_current.width == cam->win.w.width) && (cam->crop_current.height == cam->win.w.height) && - (vf_out_format == IPU_PIX_FMT_UYVY) && + (vf_out_format == IPU_PIX_FMT_NV12) && (cam->rotation < IPU_ROTATE_VERT_FLIP)) { err = ipu_init_channel_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, - pixel_fmt, cam->crop_current.width, + IPU_PIX_FMT_NV12, + cam->crop_current.width, cam->crop_current.height, cam->crop_current.width, IPU_ROTATE_NONE, fbi->fix.smem_start + (fbi->fix.line_length * fbvar.yres), @@ -260,7 +260,8 @@ static int csi_enc_setup(cam_data *cam) cam->offset.u_offset, cam->offset.u_offset); } else { err = ipu_init_channel_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, - pixel_fmt, cam->crop_current.width, + IPU_PIX_FMT_NV12, + cam->crop_current.width, cam->crop_current.height, cam->crop_current.width, IPU_ROTATE_NONE, cam->vf_bufs[0], cam->vf_bufs[1], 0, @@ -347,8 +348,8 @@ out1: static int foreground_start(void *private) { cam_data *cam = (cam_data *) private; - int err = 0, i = 0; - short *tmp, color; + int err = 0, i = 0, screen_size; + char *base; if (!cam) { printk(KERN_ERR "private is NULL\n"); @@ -383,13 +384,11 @@ static int foreground_start(void *private) if (OVERLAY_FB_SUPPORT_NONSTD) { /* Use DP to do CSC so that we can get better performance */ - vf_out_format = IPU_PIX_FMT_UYVY; + vf_out_format = IPU_PIX_FMT_NV12; fbvar.nonstd = vf_out_format; - color = 0x80; } else { vf_out_format = IPU_PIX_FMT_RGB565; fbvar.nonstd = 0; - color = 0x0; } fbvar.bits_per_pixel = 16; @@ -405,10 +404,17 @@ static int foreground_start(void *private) cam->win.w.top); /* Fill black color for framebuffer */ - tmp = (short *) fbi->screen_base; - for (i = 0; i < (fbi->fix.line_length * fbi->var.yres)/2; - i++, tmp++) - *tmp = color; + base = (char *) fbi->screen_base; + screen_size = fbi->var.xres * fbi->var.yres; + if (OVERLAY_FB_SUPPORT_NONSTD) { + memset(base, 0, screen_size); + base += screen_size; + for (i = 0; i < screen_size / 2; i++, base++) + *base = 0x80; + } else { + for (i = 0; i < screen_size * 2; i++, base++) + *base = 0x00; + } console_lock(); fb_blank(fbi, FB_BLANK_UNBLANK); diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 23175edd5634..727fd9c53199 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -1473,8 +1473,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, xip_enable(map, chip, adr); /* FIXME - should have reset delay before continuing */ - printk(KERN_WARNING "MTD %s(): software timeout\n", - __func__ ); + printk(KERN_WARNING "MTD %s(): software timeout, address:0x%.8lx.\n", + __func__, adr); ret = -EIO; op_done: diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 96e6f186bf57..c0c328c5b133 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig @@ -162,15 +162,6 @@ config MTD_PXA2XX help This provides a driver for the NOR flash attached to a PXA2xx chip. -config MTD_IMX6X_WEIMNOR - tristate "CFI Flash device mapped on iMX6x based boards" - depends on MTD_CFI || MTD_JEDECPROBE || MTD_ROM || MTD_LPDDR - help - This provides a driver for the WEIM (Parallel) NOR flash attached to - an iMX6x chip. This driver provides a cached read to take advantage - of paged reads by using memcopy. If you have a board such as the - SabreAI select 'Y' to use the NOR flash chips on it. - config MTD_OCTAGON tristate "JEDEC Flash device mapped on Octagon 5066 SBC" depends on X86 && MTD_JEDEC && MTD_COMPLEX_MAPPINGS diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index 8f437a0b828d..cb48b11affff 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile @@ -18,7 +18,6 @@ obj-$(CONFIG_MTD_ICHXROM) += ichxrom.o obj-$(CONFIG_MTD_CK804XROM) += ck804xrom.o obj-$(CONFIG_MTD_TSUNAMI) += tsunami_flash.o obj-$(CONFIG_MTD_PXA2XX) += pxa2xx-flash.o -obj-$(CONFIG_MTD_IMX6X_WEIMNOR) += imx6x-weimnor.o obj-$(CONFIG_MTD_MBX860) += mbx860.o obj-$(CONFIG_MTD_CEIVA) += ceiva.o obj-$(CONFIG_MTD_OCTAGON) += octagon-5066.o diff --git a/drivers/mtd/maps/imx6x-weimnor.c b/drivers/mtd/maps/imx6x-weimnor.c deleted file mode 100644 index 60a96da32dcf..000000000000 --- a/drivers/mtd/maps/imx6x-weimnor.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved. - * - * 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., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <linux/module.h> -#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/slab.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <linux/mtd/mtd.h> -#include <linux/mtd/map.h> -#include <linux/mtd/partitions.h> -#include <linux/mtd/physmap.h> -#include <linux/mtd/concat.h> -#include <linux/io.h> - -#include <asm/outercache.h> - -#define MAX_RESOURCES 4 - -struct imx6x_weimnor_info { - struct mtd_info *mtd[MAX_RESOURCES]; - struct mtd_info *cmtd; - struct map_info map[MAX_RESOURCES]; - int nr_parts; - struct mtd_partition *parts; -}; - -static int imx6x_weimnor_remove(struct platform_device *dev) -{ - struct imx6x_weimnor_info *info; - int i; - - info = platform_get_drvdata(dev); - - if (info == NULL) - return 0; - - platform_set_drvdata(dev, NULL); - - if (info->cmtd) { - mtd_device_unregister(info->cmtd); - if (info->nr_parts) - kfree(info->parts); - if (info->cmtd != info->mtd[0]) - mtd_concat_destroy(info->cmtd); - } - - for (i = 0; i < MAX_RESOURCES; i++) { - if (info->mtd[i] != NULL) - map_destroy(info->mtd[i]); - if (info->map[i].cached) - iounmap(info->map[i].cached); - } - - kfree(info); - - return 0; -} - -static void imx6x_set_vpp(struct map_info *map, int state) -{ - struct platform_device *pdev; - struct physmap_flash_data *flash; - - pdev = (struct platform_device *)map->map_priv_1; - flash = pdev->dev.platform_data; - - if (flash->set_vpp) - flash->set_vpp(pdev, state); -} - -#define CACHELINESIZE 32 -static void imx6x_map_inval_cache(struct map_info *map, unsigned long from, -ssize_t len) -{ - unsigned long start; - unsigned long end; - unsigned long phys_start; - unsigned long phys_end; - - if (from > map->size) { - start = (unsigned long)map->cached + map->size; - phys_start = (unsigned long)map->phys + map->size; - } else { - start = (unsigned long)map->cached + from; - phys_start = (unsigned long)map->phys + from; - } - - if ((from + len) > map->size) { - end = start + map->size; - phys_end = phys_start + map->size; - } else { - end = start + len; - phys_end = phys_start + len; - } - - start &= ~(CACHELINESIZE - 1); - while (start < end) { - /* invalidate D cache line */ - asm volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)); - start += CACHELINESIZE; - } - outer_inv_range(phys_start, phys_end); -} - -static const char *rom_probe_types[] = { - "cfi_probe", - "jedec_probe", - "qinfo_probe", - "map_rom", - NULL}; - -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs", - NULL}; - -static int imx6x_weimnor_probe(struct platform_device *dev) -{ - struct physmap_flash_data *flash; - struct imx6x_weimnor_info *info; - const char **probe_type; - int err = 0; - int i; - int devices_found = 0; - - flash = dev->dev.platform_data; - if (flash == NULL) - return -ENODEV; - - info = devm_kzalloc(&dev->dev, sizeof(struct imx6x_weimnor_info), - GFP_KERNEL); - if (info == NULL) { - err = -ENOMEM; - goto err_out; - } - - if (flash->init) { - err = flash->init(dev); - if (err) - goto err_out; - } - - platform_set_drvdata(dev, info); - - for (i = 0; i < dev->num_resources; i++) { - printk(KERN_NOTICE - "imx6x-flash (physmap) platform " - "flash device: %.8llx at %.8llx\n", - (unsigned long long)resource_size(&dev->resource[i]), - (unsigned long long)dev->resource[i].start); - - if (!devm_request_mem_region(&dev->dev, - dev->resource[i].start, - resource_size(&dev->resource[i]), - dev_name(&dev->dev))) { - dev_err(&dev->dev, "Could not reserve memory region\n"); - err = -ENOMEM; - goto err_out; - } - - info->map[i].name = dev_name(&dev->dev); - info->map[i].phys = dev->resource[i].start; - info->map[i].size = resource_size(&dev->resource[i]); - info->map[i].bankwidth = flash->width; - info->map[i].set_vpp = imx6x_set_vpp; - info->map[i].pfow_base = 0; - info->map[i].map_priv_1 = (unsigned long)dev; - info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys, - info->map[i].size); - if (info->map[i].virt == NULL) { - dev_err(&dev->dev, "Failed to ioremap flash region\n"); - err = -EIO; - goto err_out; - } - - info->map[i].cached = - ioremap_cached(info->map[i].phys, info->map[i].size); - if (!info->map[i].cached) - printk(KERN_WARNING "Failed to ioremap cached %s\n", - info->map[i].name); - - info->map[i].inval_cache = imx6x_map_inval_cache; - - simple_map_init(&info->map[i]); - probe_type = rom_probe_types; - - for (; info->mtd[i] == NULL && *probe_type != NULL; - probe_type++) - info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); - - if (info->mtd[i] == NULL) { - dev_err(&dev->dev, "map_probe failed\n"); - err = -ENXIO; - goto err_out; - } else { - devices_found++; - } - info->mtd[i]->owner = THIS_MODULE; - info->mtd[i]->dev.parent = &dev->dev; - } - - if (devices_found == 1) { - info->cmtd = info->mtd[0]; - } else if (devices_found > 1) { - /* - * We detected multiple devices. Concatenate them together. - */ - info->cmtd = mtd_concat_create(info->mtd, devices_found, - dev_name(&dev->dev)); - if (info->cmtd == NULL) - err = -ENXIO; - } - if (err) - goto err_out; - - err = parse_mtd_partitions(info->cmtd, part_probe_types, - &info->parts, 0); - if (err > 0) { - mtd_device_register(info->cmtd, info->parts, err); - info->nr_parts = err; - return 0; - } - - if (flash->nr_parts) { - printk(KERN_NOTICE "Using physmap partition information\n"); - mtd_device_register(info->cmtd, flash->parts, - flash->nr_parts); - return 0; - } - - mtd_device_register(info->cmtd, NULL, 0); - - return 0; - -err_out: - imx6x_weimnor_remove(dev); - return err; -} - -#ifdef CONFIG_PM -static void imx6x_weimnor_shutdown(struct platform_device *dev) -{ - struct imx6x_weimnor_info *info = platform_get_drvdata(dev); - int i; - - for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) - if (info->mtd[i]->suspend && info->mtd[i]->resume) - if (info->mtd[i]->suspend(info->mtd[i]) == 0) - info->mtd[i]->resume(info->mtd[i]); -} -#else -#define imx6x_weimnor_shutdown NULL -#endif - -static struct platform_driver imx6x_weimnor_driver = { - .probe = imx6x_weimnor_probe, - .remove = __devexit_p(imx6x_weimnor_remove), - .shutdown = imx6x_weimnor_shutdown, - .driver = { - .name = "imx6x-weimnor", - .owner = THIS_MODULE, - }, -}; - -static int __init imx6x_init(void) -{ - int err; - err = platform_driver_register(&imx6x_weimnor_driver); - return err; -} - -static void __exit imx6x_exit(void) -{ - platform_driver_unregister(&imx6x_weimnor_driver); -} - -module_init(imx6x_init); -module_exit(imx6x_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Oliver Brown <oliver.brown@freescale.com>"); -MODULE_DESCRIPTION("MTD map driver for Freescale iMX"); - diff --git a/drivers/mxc/ipu/ipu_calc_stripes_sizes.c b/drivers/mxc/ipu/ipu_calc_stripes_sizes.c index b6230e819503..0700b941a387 100644 --- a/drivers/mxc/ipu/ipu_calc_stripes_sizes.c +++ b/drivers/mxc/ipu/ipu_calc_stripes_sizes.c @@ -1,5 +1,5 @@ /* - * Copyright 2009-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2009-2013 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -21,7 +21,7 @@ #include <linux/module.h> #include <linux/ipu.h> -#include <asm/div64.h> +#include <linux/math64.h> #define BPP_32 0 #define BPP_16 3 @@ -30,21 +30,13 @@ #define BPP_12 4 #define BPP_18 2 -static u64 _do_div(u64 a, u32 b) -{ - u64 div; - div = a; - do_div(div, b); - return div; -} - static u32 truncate(u32 up, /* 0: down; else: up */ u64 a, /* must be non-negative */ u32 b) { u32 d; u64 div; - div = _do_div(a, b); + div = div_u64(a, b); d = b * (div >> 32); if (up && (a > (((u64)d) << 32))) return d+b; @@ -227,9 +219,9 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, || (output_frame_width < 4)) return 1; - irr_opt = _do_div((((u64)(input_frame_width - 1)) << 32), + irr_opt = div_u64((((u64)(input_frame_width - 1)) << 32), (output_frame_width - 1)); - rr_opt = _do_div((((u64)(output_frame_width - 1)) << 32), + rr_opt = div_u64((((u64)(output_frame_width - 1)) << 32), (input_frame_width - 1)); if ((input_m == 0) || (output_m == 0) || (input_f == 0) || (output_f == 0) @@ -262,7 +254,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, left->output_width = right->output_width = right->output_column = output_frame_width >> 1; left->input_column = right->input_column = 0; - div = _do_div(((((u64)irr_steps) << 32) * + div = div_u64(((((u64)irr_steps) << 32) * (right->input_width - 1)), (right->output_width - 1)); left->irr = right->irr = truncate(0, div, 1); } else { /* with overlap */ @@ -272,7 +264,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* this is the maximal inw which allows the same resizing ratio */ /* in both stripes */ onw = truncate(1, (inw * rr_opt), output_f); - div = _do_div((((u64)(irr_steps * inw)) << + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = right->irr = truncate(0, div, 1); left->output_width = right->output_width = @@ -280,14 +272,14 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* These are valid assignments for output_width, */ /* assuming output_f is a multiple of output_m */ div = (((u64)(left->output_width-1) * (left->irr)) << 32); - div = (((u64)1) << 32) + _do_div(div, irr_steps); + div = (((u64)1) << 32) + div_u64(div, irr_steps); left->input_width = right->input_width = truncate(1, div, input_m); - div = _do_div((((u64)((right->output_width - 1) * right->irr)) << + div = div_u64((((u64)((right->output_width - 1) * right->irr)) << 32), irr_steps); difwr = (((u64)(input_frame_width - 1 - inw)) << 32) - div; - div = _do_div((difwr + (((u64)input_f) << 32)), 2); + div = div_u64((difwr + (((u64)input_f) << 32)), 2); left->input_column = truncate(0, div, input_f); @@ -312,13 +304,13 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* in both stripes */ onw = truncate(1, inw * rr_opt, output_f); do { - div = _do_div((((u64)(irr_steps * inw)) << 32), onw); + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = truncate(0, div, 1); - div = _do_div((((u64)(onw * left->irr)) << 32), + div = div_u64((((u64)(onw * left->irr)) << 32), irr_steps); dinw = (((u64)inw) << 32) - div; - div = _do_div((((u64)((output_frame_width - 1 - onw) * left->irr)) << + div = div_u64((((u64)((output_frame_width - 1 - onw) * left->irr)) << 32), irr_steps); difwl = (((u64)(input_frame_width - 1 - inw)) << 32) - div; @@ -338,7 +330,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, inw = inw_best; onw = truncate(1, inw * rr_opt, output_f); - div = _do_div((((u64)(irr_steps * inw)) << 32), onw); + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = truncate(0, div, 1); left->output_width = onw; @@ -349,18 +341,18 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, right->input_width = truncate(1, ((u64)(input_frame_width - inw)) << 32, input_m); - div = _do_div((((u64)(irr_steps * (input_frame_width - 1 - inw))) << + div = div_u64((((u64)(irr_steps * (input_frame_width - 1 - inw))) << 32), (right->output_width - 1)); right->irr = truncate(0, div, 1); temp = truncate(0, ((u64)left->irr) * ((((u64)1) << 32) + dirr), 1); if (temp < right->irr) right->irr = temp; - div = _do_div(((u64)((right->output_width - 1) * right->irr) << + div = div_u64(((u64)((right->output_width - 1) * right->irr) << 32), irr_steps); difwr = (u64)(input_frame_width - 1 - inw) - div; - div = _do_div((difwr + (((u64)input_f) << 32)), 2); + div = div_u64((difwr + (((u64)input_f) << 32)), 2); left->input_column = truncate(0, div, input_f); /* This splits the truncated input columns evenly */ diff --git a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c index 4cee1df5cbf8..3a27195bbc3d 100644 --- a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c +++ b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c @@ -1,5 +1,5 @@ /* - * Copyright 2009-2012 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2009-2013 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -21,7 +21,7 @@ #include <linux/module.h> #include <mach/ipu-v3.h> -#include <asm/div64.h> +#include <linux/math64.h> #define BPP_32 0 #define BPP_16 3 @@ -30,21 +30,13 @@ #define BPP_12 4 #define BPP_18 2 -static u64 _do_div(u64 a, u32 b) -{ - u64 div; - div = a; - do_div(div, b); - return div; -} - static u32 truncate(u32 up, /* 0: down; else: up */ u64 a, /* must be non-negative */ u32 b) { u32 d; u64 div; - div = _do_div(a, b); + div = div_u64(a, b); d = b * (div >> 32); if (up && (a > (((u64)d) << 32))) return d+b; @@ -229,9 +221,9 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, if ((input_frame_width < 4) || (output_frame_width < 4)) return 1; - irr_opt = _do_div((((u64)(input_frame_width - 1)) << 32), + irr_opt = div_u64((((u64)(input_frame_width - 1)) << 32), (output_frame_width - 1)); - rr_opt = _do_div((((u64)(output_frame_width - 1)) << 32), + rr_opt = div_u64((((u64)(output_frame_width - 1)) << 32), (input_frame_width - 1)); if ((input_m == 0) || (output_m == 0) || (input_f == 0) || (output_f == 0) @@ -265,7 +257,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, output_frame_width >> 1; left->input_column = 0; left->output_column = 0; - div = _do_div(((((u64)irr_steps) << 32) * + div = div_u64(((((u64)irr_steps) << 32) * (right->input_width - 1)), (right->output_width - 1)); left->irr = right->irr = truncate(0, div, 1); } else { /* with overlap */ @@ -275,7 +267,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* this is the maximal inw which allows the same resizing ratio */ /* in both stripes */ onw = truncate(1, (inw * rr_opt), output_f); - div = _do_div((((u64)(irr_steps * inw)) << + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = right->irr = truncate(0, div, 1); left->output_width = right->output_width = @@ -283,14 +275,14 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* These are valid assignments for output_width, */ /* assuming output_f is a multiple of output_m */ div = (((u64)(left->output_width-1) * (left->irr)) << 32); - div = (((u64)1) << 32) + _do_div(div, irr_steps); + div = (((u64)1) << 32) + div_u64(div, irr_steps); left->input_width = right->input_width = truncate(1, div, input_m); - div = _do_div((((u64)((right->output_width - 1) * right->irr)) << + div = div_u64((((u64)((right->output_width - 1) * right->irr)) << 32), irr_steps); difwr = (((u64)(input_frame_width - 1 - inw)) << 32) - div; - div = _do_div((difwr + (((u64)input_f) << 32)), 2); + div = div_u64((difwr + (((u64)input_f) << 32)), 2); left->input_column = truncate(0, div, input_f); @@ -315,13 +307,13 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, /* in both stripes */ onw = truncate(1, inw * rr_opt, output_f); do { - div = _do_div((((u64)(irr_steps * inw)) << 32), onw); + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = truncate(0, div, 1); - div = _do_div((((u64)(onw * left->irr)) << 32), + div = div_u64((((u64)(onw * left->irr)) << 32), irr_steps); dinw = (((u64)inw) << 32) - div; - div = _do_div((((u64)((output_frame_width - 1 - onw) * left->irr)) << + div = div_u64((((u64)((output_frame_width - 1 - onw) * left->irr)) << 32), irr_steps); difwl = (((u64)(input_frame_width - 1 - inw)) << 32) - div; @@ -341,7 +333,7 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, inw = inw_best; onw = truncate(1, inw * rr_opt, output_f); - div = _do_div((((u64)(irr_steps * inw)) << 32), onw); + div = div_u64((((u64)(irr_steps * inw)) << 32), onw); left->irr = truncate(0, div, 1); left->output_width = onw; @@ -352,18 +344,18 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width, right->input_width = truncate(1, ((u64)(input_frame_width - inw)) << 32, input_m); - div = _do_div((((u64)(irr_steps * (input_frame_width - 1 - inw))) << + div = div_u64((((u64)(irr_steps * (input_frame_width - 1 - inw))) << 32), (right->output_width - 1)); right->irr = truncate(0, div, 1); temp = truncate(0, ((u64)left->irr) * ((((u64)1) << 32) + dirr), 1); if (temp < right->irr) right->irr = temp; - div = _do_div(((u64)((right->output_width - 1) * right->irr) << + div = div_u64(((u64)((right->output_width - 1) * right->irr) << 32), irr_steps); difwr = (u64)(input_frame_width - 1 - inw) - div; - div = _do_div((difwr + (((u64)input_f) << 32)), 2); + div = div_u64((difwr + (((u64)input_f) << 32)), 2); left->input_column = truncate(0, div, input_f); /* This splits the truncated input columns evenly */ diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c index 0a92aaeaa3a7..563d5320cc9d 100644 --- a/drivers/mxc/ipu3/ipu_common.c +++ b/drivers/mxc/ipu3/ipu_common.c @@ -2192,7 +2192,8 @@ int32_t ipu_disable_channel(struct ipu_soc *ipu, ipu_channel_t channel, bool wai } } } - } else if (wait_for_stop && !_ipu_is_smfc_chan(out_dma)) { + } else if (wait_for_stop && !_ipu_is_smfc_chan(out_dma) && + channel != CSI_PRP_VF_MEM && channel != CSI_PRP_ENC_MEM) { while (idma_is_set(ipu, IDMAC_CHA_BUSY, in_dma) || idma_is_set(ipu, IDMAC_CHA_BUSY, out_dma) || (ipu->sec_chan_en[IPU_CHAN_ID(channel)] && |