diff options
author | Jack Lee <jack.lee@freescale.com> | 2012-10-30 12:32:50 +0800 |
---|---|---|
committer | Jack Lee <jack.lee@freescale.com> | 2012-10-30 12:32:50 +0800 |
commit | aaf9d00bf48472e7c21705665beb48169947e6a9 (patch) | |
tree | 2283f5ac774264df2b21539d984197dcfa16d763 /drivers | |
parent | 6ece2da0d75746fad5ddf93efd6d323ab3c4414c (diff) | |
parent | 94689e1fed43ece131451a90f1716893a418cba0 (diff) |
Merge commit 'rel_imx_3.0.35_12.10.02_RC2' into imx_3.0.35_android_r13.5-ga
Conflicts:
arch/arm/mach-mx6/pm.c
Signed-off-by: Jack Lee <jack.lee@freescale.com>
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/char/fsl_otp.c | 3 | ||||
-rw-r--r-- | drivers/dma/pxp/pxp_dma_v2.c | 42 | ||||
-rw-r--r-- | drivers/input/touchscreen/elan_ts.c | 30 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/csi_v4l2_capture.c | 7 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/fsl_csi.c | 10 | ||||
-rw-r--r-- | drivers/media/video/mxc/output/mxc_pxp_v4l2.c | 11 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 8 | ||||
-rwxr-xr-x | drivers/mmc/host/sdhci.c | 2 | ||||
-rw-r--r-- | drivers/tty/serial/imx.c | 5 | ||||
-rwxr-xr-x | drivers/usb/gadget/arcotg_udc.c | 7 | ||||
-rwxr-xr-x | drivers/usb/host/ehci-arc.c | 3 | ||||
-rw-r--r-- | drivers/video/mxc/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_elcdif_fb.c | 1 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_epdc_fb.c | 24 | ||||
-rw-r--r-- | drivers/video/mxc/mxcfb_seiko_wvga.c | 5 |
15 files changed, 128 insertions, 32 deletions
diff --git a/drivers/char/fsl_otp.c b/drivers/char/fsl_otp.c index 05ad55e9d6a9..7021c42c4bfd 100755 --- a/drivers/char/fsl_otp.c +++ b/drivers/char/fsl_otp.c @@ -1,7 +1,7 @@ /* * Freescale On-Chip OTP driver * - * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2010-2012 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 @@ -153,6 +153,7 @@ static int __init alloc_otp_attr(struct mxc_otp_platform_data *pdata) goto error_out; for (i = 0; i < otp_data->fuse_num; i++) { + sysfs_attr_init(&kattr[i].attr); kattr[i].attr.name = pdata->fuse_name[i]; kattr[i].attr.mode = 0600; kattr[i].show = otp_show; diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index b74f62cac032..c6098774ecf2 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -436,22 +436,27 @@ static void pxp_set_olparam(int layer_no, struct pxps *pxp) static void pxp_set_s0param(struct pxps *pxp) { struct pxp_config_data *pxp_conf = &pxp->pxp_conf_state; - struct pxp_layer_param *s0params_data = &pxp_conf->s0_param; struct pxp_proc_data *proc_data = &pxp_conf->proc_data; u32 s0param; - s0param = BF_PXP_OUT_PS_ULC_X(proc_data->srect.left); - s0param |= BF_PXP_OUT_PS_ULC_Y(proc_data->srect.top); + /* contains the coordinate for the PS in the OUTPUT buffer. */ + s0param = BF_PXP_OUT_PS_ULC_X(proc_data->drect.left); + s0param |= BF_PXP_OUT_PS_ULC_Y(proc_data->drect.top); __raw_writel(s0param, pxp->base + HW_PXP_OUT_PS_ULC); - s0param = BF_PXP_OUT_PS_LRC_X(s0params_data->width); - s0param |= BF_PXP_OUT_PS_LRC_Y(s0params_data->height); + s0param = BF_PXP_OUT_PS_LRC_X(proc_data->drect.left + + proc_data->drect.width - 1); + s0param |= BF_PXP_OUT_PS_LRC_Y(proc_data->drect.top + + proc_data->drect.height - 1); __raw_writel(s0param, pxp->base + HW_PXP_OUT_PS_LRC); - } -/* TODO: crop behavior is re-designed in h/w. */ +/* crop behavior is re-designed in h/w. */ static void pxp_set_s0crop(struct pxps *pxp) { + /* + * place-holder, it's implemented in other functions in this driver. + * Refer to "Clipping source images" section in RM for detail. + */ } static int pxp_set_scaling(struct pxps *pxp) @@ -706,19 +711,36 @@ static void pxp_set_s0buf(struct pxps *pxp) { struct pxp_config_data *pxp_conf = &pxp->pxp_conf_state; struct pxp_layer_param *s0_params = &pxp_conf->s0_param; + struct pxp_proc_data *proc_data = &pxp_conf->proc_data; dma_addr_t Y, U, V; + dma_addr_t Y1, U1, V1; + u32 offset, bpp = 1; Y = s0_params->paddr; - __raw_writel(Y, pxp->base + HW_PXP_PS_BUF); + + if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB565) + bpp = 2; + else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB24) + bpp = 4; + offset = (proc_data->srect.top * s0_params->width + + proc_data->srect.left) * bpp; + /* clipping or cropping */ + Y1 = Y + offset; + __raw_writel(Y1, pxp->base + HW_PXP_PS_BUF); if ((s0_params->pixel_fmt == PXP_PIX_FMT_YUV420P) || (s0_params->pixel_fmt == PXP_PIX_FMT_YVU420P) || (s0_params->pixel_fmt == PXP_PIX_FMT_GREY)) { /* Set to 1 if YUV format is 4:2:2 rather than 4:2:0 */ int s = 2; + + offset = proc_data->srect.top * s0_params->width / 4 + + proc_data->srect.left / 2; U = Y + (s0_params->width * s0_params->height); + U1 = U + offset; V = U + ((s0_params->width * s0_params->height) >> s); - __raw_writel(U, pxp->base + HW_PXP_PS_UBUF); - __raw_writel(V, pxp->base + HW_PXP_PS_VBUF); + V1 = V + offset; + __raw_writel(U1, pxp->base + HW_PXP_PS_UBUF); + __raw_writel(V1, pxp->base + HW_PXP_PS_VBUF); } /* TODO: only support RGB565, Y8, Y4, YUV420 */ diff --git a/drivers/input/touchscreen/elan_ts.c b/drivers/input/touchscreen/elan_ts.c index fd85c1b33b7c..9f200ebcbf7e 100644 --- a/drivers/input/touchscreen/elan_ts.c +++ b/drivers/input/touchscreen/elan_ts.c @@ -406,6 +406,33 @@ static const struct i2c_device_id elan_touch_id[] = { {} }; +static int elan_suspend(struct device *dev) +{ + return 0; +} + +static int elan_resume(struct device *dev) +{ + uint8_t buf[IDX_PACKET_SIZE] = { 0 }; + + if (0 == elan_touch_detect_int_level()) { + dev_dbg(dev, "Got touch during suspend period.\n"); + /* + * if touch screen during suspend, recv and drop the + * data, then touch interrupt pin will return high after + * receving data. + */ + elan_touch_recv_data(elan_touch_data.client, buf); + } + + return 0; +} + +static const struct dev_pm_ops elan_dev_pm_ops = { + .suspend = elan_suspend, + .resume = elan_resume, +}; + static struct i2c_driver elan_touch_driver = { .probe = elan_touch_probe, .remove = elan_touch_remove, @@ -413,6 +440,9 @@ static struct i2c_driver elan_touch_driver = { .driver = { .name = "elan-touch", .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &elan_dev_pm_ops, +#endif }, }; diff --git a/drivers/media/video/mxc/capture/csi_v4l2_capture.c b/drivers/media/video/mxc/capture/csi_v4l2_capture.c index a0887b930ea4..3756b00a844d 100644 --- a/drivers/media/video/mxc/capture/csi_v4l2_capture.c +++ b/drivers/media/video/mxc/capture/csi_v4l2_capture.c @@ -1142,6 +1142,7 @@ static long csi_v4l_do_ioctl(struct file *file, strcpy(cap->driver, "csi_v4l2"); cap->version = KERNEL_VERSION(0, 1, 11); cap->capabilities = V4L2_CAP_VIDEO_OVERLAY | + V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT_OVERLAY | V4L2_CAP_READWRITE; cap->card[0] = '\0'; cap->bus_info[0] = '\0'; @@ -1536,7 +1537,8 @@ static int csi_v4l2_suspend(struct platform_device *pdev, pm_message_t state) if (cam->overlay_on == true) stop_preview(cam); - camera_power(cam, false); + if (cam->capture_on == true || cam->overlay_on == true) + camera_power(cam, false); return 0; } @@ -1561,7 +1563,8 @@ static int csi_v4l2_resume(struct platform_device *pdev) cam->low_power = false; wake_up_interruptible(&cam->power_queue); - camera_power(cam, true); + if (cam->capture_on == true || cam->overlay_on == true) + camera_power(cam, true); if (cam->overlay_on == true) start_preview(cam); diff --git a/drivers/media/video/mxc/capture/fsl_csi.c b/drivers/media/video/mxc/capture/fsl_csi.c index 33a82242e95e..f5677e473e87 100644 --- a/drivers/media/video/mxc/capture/fsl_csi.c +++ b/drivers/media/video/mxc/capture/fsl_csi.c @@ -250,12 +250,14 @@ static void csi_mclk_recalc(struct clk *clk) void csi_mclk_enable(void) { + clk_enable(&csi_mclk); __raw_writel(__raw_readl(CSI_CSICR1) | BIT_MCLKEN, CSI_CSICR1); } void csi_mclk_disable(void) { __raw_writel(__raw_readl(CSI_CSICR1) & ~BIT_MCLKEN, CSI_CSICR1); + clk_disable(&csi_mclk); } static int __devinit csi_probe(struct platform_device *pdev) @@ -293,8 +295,13 @@ static int __devinit csi_probe(struct platform_device *pdev) return PTR_ERR(per_clk); clk_put(per_clk); + /* + * On mx6sl, there's no divider in CSI module(BIT_MCLKDIV in CSI_CSICR1 + * is marked as reserved). We use CSI clock in CCM. + * However, the value read from BIT_MCLKDIV bits are 0, which is + * equivalent to "divider=1". The code works for mx6sl without change. + */ csi_mclk.parent = per_clk; - clk_enable(per_clk); csi_mclk_recalc(&csi_mclk); err: @@ -303,7 +310,6 @@ err: static int __devexit csi_remove(struct platform_device *pdev) { - clk_disable(&csi_mclk); iounmap(csi_regbase); return 0; diff --git a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c index a3a8294efb8e..08d16b9f75d3 100644 --- a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c @@ -54,6 +54,7 @@ #define V4L2_OUTPUT_TYPE_INTERNAL 4 +static int video_nr = -1; /* -1 ==> auto assign */ static struct pxp_data_format pxp_s0_formats[] = { { .name = "24-bit RGB", @@ -395,7 +396,12 @@ static int pxp_s_output(struct file *file, void *fh, bpp = 2; pxp->outb_size = fmt->width * fmt->height * bpp; - pxp->outb = kmalloc(fmt->width * fmt->height * bpp, GFP_KERNEL); + pxp->outb = kmalloc(fmt->width * fmt->height * bpp, + GFP_KERNEL | GFP_DMA); + if (pxp->outb == NULL) { + dev_err(&pxp->pdev->dev, "No enough memory!\n"); + return -ENOMEM; + } pxp->outb_phys = virt_to_phys(pxp->outb); dma_map_single(NULL, pxp->outb, fmt->width * fmt->height * bpp, DMA_TO_DEVICE); @@ -1175,7 +1181,7 @@ static int pxp_probe(struct platform_device *pdev) memcpy(pxp->vdev, &pxp_template, sizeof(pxp_template)); video_set_drvdata(pxp->vdev, pxp); - err = video_register_device(pxp->vdev, VFL_TYPE_GRABBER, 0); + err = video_register_device(pxp->vdev, VFL_TYPE_GRABBER, video_nr); if (err) { dev_err(&pdev->dev, "failed to register video device\n"); goto freevdev; @@ -1235,6 +1241,7 @@ static void __exit pxp_exit(void) module_init(pxp_init); module_exit(pxp_exit); +module_param(video_nr, int, 0444); MODULE_DESCRIPTION("MXC PxP V4L2 driver"); MODULE_AUTHOR("Freescale Semiconductor, Inc."); MODULE_LICENSE("GPL"); diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 3dea9b5b29ff..062a6c319695 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -841,12 +841,18 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd MMC_VDD_32_33 | MMC_VDD_33_34; host->ocr_avail_mmc = MMC_VDD_29_30 | MMC_VDD_30_31 | \ MMC_VDD_32_33 | MMC_VDD_33_34; + host->ocr_avail_sdio = MMC_VDD_29_30 | MMC_VDD_30_31 | \ + MMC_VDD_32_33 | MMC_VDD_33_34; if (cpu_is_mx6q() || cpu_is_mx6dl()) sdhci_esdhc_ops.platform_execute_tuning = esdhc_execute_tuning; - if (boarddata->support_18v) + if (boarddata->support_18v) { host->ocr_avail_sd |= MMC_VDD_165_195; + host->ocr_avail_mmc |= MMC_VDD_165_195; + host->ocr_avail_sdio |= MMC_VDD_165_195; + } + if (boarddata->support_8bit) host->mmc->caps |= MMC_CAP_8_BIT_DATA; if (boarddata->keep_power_at_suspend) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2c32faad3b4b..ba625b3ca376 100755 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -30,7 +30,7 @@ #include "sdhci.h" #define DRIVER_NAME "sdhci" -#define CLK_TIMEOUT (10 * HZ) +#define CLK_TIMEOUT (1 * HZ) #define DBG(f, x...) \ pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 8a66f3eeb992..5e9594d744d9 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1742,6 +1742,8 @@ static int serial_imx_resume(struct platform_device *dev) return 0; } +extern int uart_at_24; + static int serial_imx_probe(struct platform_device *pdev) { struct imx_port *sport; @@ -1788,6 +1790,9 @@ static int serial_imx_probe(struct platform_device *pdev) ret = PTR_ERR(sport->clk); goto unmap; } + if (uart_at_24) + clk_set_parent(sport->clk, clk_get(NULL, "osc")); + clk_enable(sport->clk); sport->port.uartclk = clk_get_rate(sport->clk); diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c index b91cf9f82543..08118b3ba61e 100755 --- a/drivers/usb/gadget/arcotg_udc.c +++ b/drivers/usb/gadget/arcotg_udc.c @@ -1695,6 +1695,10 @@ static void setup_received_irq(struct fsl_udc *udc, else if (setup->bRequest == USB_DEVICE_A_ALT_HNP_SUPPORT) udc->gadget.a_alt_hnp_support = 1; + else + break; + } else { + break; } rc = 0; } else @@ -3065,6 +3069,8 @@ static int __devinit fsl_udc_probe(struct platform_device *pdev) goto err2a; } + spin_lock_init(&pdata->lock); + /* Due to mx35/mx25's phy's bug */ reset_phy(); @@ -3210,7 +3216,6 @@ static int __devinit fsl_udc_probe(struct platform_device *pdev) udc_controller->charger.enable = false; #endif - spin_lock_init(&pdata->lock); return 0; err4: diff --git a/drivers/usb/host/ehci-arc.c b/drivers/usb/host/ehci-arc.c index e09f4dfd05d9..35815869bb8d 100755 --- a/drivers/usb/host/ehci-arc.c +++ b/drivers/usb/host/ehci-arc.c @@ -260,6 +260,8 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, goto err4; } + spin_lock_init(&pdata->lock); + fsl_platform_set_host_mode(hcd); hcd->power_budget = pdata->power_budget; ehci = hcd_to_ehci(hcd); @@ -308,7 +310,6 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, ehci = hcd_to_ehci(hcd); pdata->pm_command = ehci->command; - spin_lock_init(&pdata->lock); return retval; err6: free_irq(irq, (void *)pdev); diff --git a/drivers/video/mxc/Kconfig b/drivers/video/mxc/Kconfig index 8a4a0792724f..83b094267760 100644 --- a/drivers/video/mxc/Kconfig +++ b/drivers/video/mxc/Kconfig @@ -61,7 +61,7 @@ config FB_MXC_SII902X tristate "Si Image SII9022 DVI/HDMI Interface Chip" config FB_MXC_SII902X_ELCDIF - depends on FB_MXC_SYNC_PANEL && I2C + depends on FB_MXC_ELCDIF_FB && FB_MXC_SYNC_PANEL && I2C tristate "Si Image SII9022 DVI/HDMI Interface Chip for ELCDIF FB" config FB_MXC_CH7026 diff --git a/drivers/video/mxc/mxc_elcdif_fb.c b/drivers/video/mxc/mxc_elcdif_fb.c index 7475bfbd2c9e..e98245dc3709 100644 --- a/drivers/video/mxc/mxc_elcdif_fb.c +++ b/drivers/video/mxc/mxc_elcdif_fb.c @@ -586,6 +586,7 @@ void mxcfb_elcdif_register_mode(const struct fb_videomode *modedb, return; } +EXPORT_SYMBOL(mxcfb_elcdif_register_mode); int mxc_elcdif_frame_addr_setup(dma_addr_t phys) { diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c index b702788ae823..2df44041e65c 100644 --- a/drivers/video/mxc/mxc_epdc_fb.c +++ b/drivers/video/mxc/mxc_epdc_fb.c @@ -735,18 +735,24 @@ static int epdc_choose_next_lut(int rev, int *next_lut) { u64 luts_status, unprocessed_luts; bool next_lut_found = false; + /* Available LUTs are reduced to 16 in 5-bit waveform mode */ + u32 format_p5n = __raw_readl(EPDC_FORMAT) & + EPDC_FORMAT_BUF_PIXEL_FORMAT_P5N; luts_status = __raw_readl(EPDC_STATUS_LUTS); - if (rev < 20) + if ((rev < 20) || format_p5n) luts_status &= 0xFFFF; else luts_status |= ((u64)__raw_readl(EPDC_STATUS_LUTS2) << 32); - if (rev < 20) + if (rev < 20) { unprocessed_luts = __raw_readl(EPDC_IRQ) & 0xFFFF; - else + } else { unprocessed_luts = __raw_readl(EPDC_IRQ1) | ((u64)__raw_readl(EPDC_IRQ2) << 32); + if (format_p5n) + unprocessed_luts &= 0xFFFF; + } while (!next_lut_found) { /* @@ -762,7 +768,7 @@ static int epdc_choose_next_lut(int rev, int *next_lut) */ *next_lut = fls64(luts_status); - if (rev < 20) { + if ((rev < 20) || format_p5n) { if (*next_lut > 15) *next_lut = ffz(luts_status); } else { @@ -1160,6 +1166,8 @@ static void epdc_init_sequence(struct mxc_epdc_fb_data *fb_data) fb_data->in_init = true; epdc_powerup(fb_data); draw_mode0(fb_data); + /* Force power down event */ + fb_data->powering_down = true; epdc_powerdown(fb_data); fb_data->updates_active = false; } @@ -3694,7 +3702,13 @@ static void epdc_intr_work_func(struct work_struct *work) next_marker->update_marker); complete(&next_marker->update_completion); } - } else if (epdc_lut_cancelled) { + } else if (epdc_lut_cancelled && !epdc_collision) { + /* + * Note: The update may be cancelled (void) if all + * pixels collided. In that case we handle it as a + * collision, not a cancel. + */ + /* Clear LUT status (might be set if no AUTOWV used) */ /* diff --git a/drivers/video/mxc/mxcfb_seiko_wvga.c b/drivers/video/mxc/mxcfb_seiko_wvga.c index c96238d80cb2..6e9abaf8566b 100644 --- a/drivers/video/mxc/mxcfb_seiko_wvga.c +++ b/drivers/video/mxc/mxcfb_seiko_wvga.c @@ -89,11 +89,6 @@ static int lcd_fb_event(struct notifier_block *nb, unsigned long val, void *v) return 0; switch (val) { - case FB_EVENT_FB_REGISTERED: - lcd_init_fb(event->info); - fb_show_logo(event->info, 0); - lcd_poweron(); - break; case FB_EVENT_BLANK: if ((event->info->var.xres != 800) || (event->info->var.yres != 480)) { |