diff options
author | Xinyu Chen <xinyu.chen@freescale.com> | 2012-11-02 17:07:48 +0800 |
---|---|---|
committer | Xinyu Chen <xinyu.chen@freescale.com> | 2012-11-02 17:07:48 +0800 |
commit | 10c2cbc55e7d13de6ae438241e4b7c2142a0181f (patch) | |
tree | 3c8af8044abca25a627029f5d67cc2cfa48362d9 /drivers | |
parent | 7ed2e5b0fb3757f881ac7f0820b6b81bd3648fcb (diff) | |
parent | 1c8b759de7d82619ea5e54faedc788c8792f0bee (diff) |
Merge commit 'rel_imx_3.0.35_12.11.01_RC2' into imx_3.0.35_android_r13.4.y
Conflicts:
drivers/mxc/vpu/mxc_vpu.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/pxp/pxp_dma_v2.c | 42 | ||||
-rw-r--r-- | drivers/input/keyboard/Kconfig | 37 | ||||
-rw-r--r-- | drivers/input/keyboard/Makefile | 6 | ||||
-rw-r--r-- | drivers/input/keyboard/mpr121.c | 308 | ||||
-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/mfd/mxc-hdmi-core.c | 21 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 8 | ||||
-rw-r--r-- | drivers/mtd/cmdlinepart.c | 12 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 11 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_ic.c | 24 | ||||
-rw-r--r-- | drivers/mxc/ipu3/ipu_regs.h | 2 | ||||
-rw-r--r-- | drivers/regulator/pfuze-regulator.h | 24 | ||||
-rw-r--r-- | drivers/regulator/pfuze100-regulator.c | 122 | ||||
-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 | 2 | ||||
-rw-r--r-- | drivers/video/mxc/mxcfb_seiko_wvga.c | 5 |
20 files changed, 278 insertions, 407 deletions
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/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index b9474aa7f043..b4dee9d5a055 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -563,41 +563,4 @@ config KEYBOARD_W90P910 To compile this driver as a module, choose M here: the module will be called w90p910_keypad. -config KEYBOARD_MXC - tristate "MXC Keypad Driver" - depends on ARCH_MXC - help - This is the Keypad driver for the Freescale MXC application - processors. - -config KEYBOARD_MXS - tristate "MXS keyboard" - depends on ARCH_MXS - help - This is the Keypad driver for the Freescale mxs soc - - -config KEYBOARD_MC9S08DZ60 - tristate "mc9s08dz60 keyboard" - depends on MXC_PMIC_MC9S08DZ60 - help - -to be written- - -config KEYBOARD_MPR084 - tristate "Freescale MPR084 Touch Keypad Driver" - depends on ARCH_MX37 - help - This is the Keypad driver for the Freescale Proximity Capacitive - Touch Sensor controller chip. - -config KEYBOARD_MPR121 - tristate "Freescale MPR121 Touch Keypad Driver" - depends on I2C - help - Say Y here if you have the touchkey Freescale Proximity Capacitive - Touch Sensor controller chip in your system. - - If unsure, say N. - - To compile this driver as a module, choose M here endif diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 6791e8b45289..ddde0fd476f7 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile @@ -51,9 +51,3 @@ obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_W90P910) += w90p910_keypad.o -obj-$(CONFIG_KEYBOARD_MXC) += mxc_keyb.o -obj-$(CONFIG_KEYBOARD_MXC) += mxc_pwrkey.o -obj-$(CONFIG_KEYBOARD_MPR084) += mpr084.o -obj-$(CONFIG_KEYBOARD_MXS) += mxs-kbd.o -obj-$(CONFIG_KEYBOARD_MC9S08DZ60) += mc9s08dz60_keyb.o -obj-$(CONFIG_KEYBOARD_MPR121) += mpr121.o diff --git a/drivers/input/keyboard/mpr121.c b/drivers/input/keyboard/mpr121.c deleted file mode 100644 index 7aae302758c5..000000000000 --- a/drivers/input/keyboard/mpr121.c +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (C) 2010-2011 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. - */ - -/* - * mpr121.c - Touchkey driver for Freescale MPR121 Capacitive Touch - * Sensor Controllor - */ - -#include <linux/module.h> -#include <linux/init.h> -#include <linux/i2c.h> -#include <linux/i2c/mpr.h> -#include <linux/interrupt.h> -#include <linux/input.h> -#include <linux/irq.h> -#include <linux/slab.h> -#include <linux/delay.h> -#include <linux/bitops.h> - - -struct mpr121_touchkey_data { - struct i2c_client *client; - struct input_dev *input_dev; - unsigned int key_val; - int statusbits; - int keycount; - u16 keycodes[MPR121_MAX_KEY_COUNT]; -}; - -struct mpr121_init_register { - int addr; - u8 val; -}; - -static struct mpr121_init_register init_reg_table[] = { - {MHD_RISING_ADDR, 0x1}, - {NHD_RISING_ADDR, 0x1}, - {NCL_RISING_ADDR, 0x0}, - {FDL_RISING_ADDR, 0x0}, - {MHD_FALLING_ADDR, 0x1}, - {NHD_FALLING_ADDR, 0x1}, - {NCL_FALLING_ADDR, 0xff}, - {FDL_FALLING_ADDR, 0x02}, - {FILTER_CONF_ADDR, 0x04}, - {AFE_CONF_ADDR, 0x0b}, - {AUTO_CONFIG_CTRL_ADDR, 0x0b}, -}; - -static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id) -{ - struct mpr121_touchkey_data *data = dev_id; - struct i2c_client *client = data->client; - struct input_dev *input = data->input_dev; - unsigned int key_num, pressed; - int reg; - - reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR); - if (reg < 0) { - dev_err(&client->dev, "i2c read error [%d]\n", reg); - goto out; - } - - reg <<= 8; - reg |= i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_0_ADDR); - if (reg < 0) { - dev_err(&client->dev, "i2c read error [%d]\n", reg); - goto out; - } - - reg &= TOUCH_STATUS_MASK; - /* use old press bit to figure out which bit changed */ - key_num = ffs(reg ^ data->statusbits) - 1; - /* use the bit check the press status */ - pressed = (reg & (1 << (key_num))) >> key_num; - data->statusbits = reg; - data->key_val = data->keycodes[key_num]; - - input_event(input, EV_MSC, MSC_SCAN, data->key_val); - input_report_key(input, data->key_val, pressed); - input_sync(input); - - dev_dbg(&client->dev, "key %d %d %s\n", key_num, data->key_val, - pressed ? "pressed" : "released"); - -out: - return IRQ_HANDLED; -} - -static int mpr121_phys_init(struct mpr121_platform_data *pdata, - struct mpr121_touchkey_data *data, - struct i2c_client *client) -{ - struct mpr121_init_register *reg; - unsigned char usl, lsl, tl; - int i, t, vdd, ret; - - /* setup touch/release threshold for ele0-ele11 */ - for (i = 0; i <= MPR121_MAX_KEY_COUNT; i++) { - t = ELE0_TOUCH_THRESHOLD_ADDR + (i * 2); - ret = i2c_smbus_write_byte_data(client, t, TOUCH_THRESHOLD); - if (ret < 0) - goto err_i2c_write; - ret = i2c_smbus_write_byte_data(client, t + 1, - RELEASE_THRESHOLD); - if (ret < 0) - goto err_i2c_write; - } - /* setup init register */ - for (i = 0; i < ARRAY_SIZE(init_reg_table); i++) { - reg = &init_reg_table[i]; - ret = i2c_smbus_write_byte_data(client, reg->addr, reg->val); - if (ret < 0) - goto err_i2c_write; - } - /* setup auto-register by vdd,the formula please ref:AN3889 */ - vdd = pdata->vdd_uv / 1000; - usl = ((vdd - 700) * 256) / vdd; - lsl = (usl * 65) / 100; - tl = (usl * 90) / 100; - ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_USL_ADDR, usl); - if (ret < 0) - goto err_i2c_write; - ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl); - if (ret < 0) - goto err_i2c_write; - ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl); - if (ret < 0) - goto err_i2c_write; - ret = i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, - data->keycount); - if (ret < 0) - goto err_i2c_write; - - dev_info(&client->dev, "mpr121: config as enable %x of electrode.\n", - data->keycount); - - return 0; - -err_i2c_write: - dev_err(&client->dev, "i2c write error[%d]\n", ret); - return ret; -} - -static int __devinit mpr_touchkey_probe(struct i2c_client *client, - const struct i2c_device_id *id) -{ - struct mpr121_platform_data *pdata; - struct mpr121_touchkey_data *data; - struct input_dev *input_dev; - int error; - int i; - - pdata = client->dev.platform_data; - if (!pdata) { - dev_err(&client->dev, "no platform data defined\n"); - return -EINVAL; - } - - data = kzalloc(sizeof(struct mpr121_touchkey_data), GFP_KERNEL); - input_dev = input_allocate_device(); - if (!data || !input_dev) { - dev_err(&client->dev, "Falied to allocate memory\n"); - error = -ENOMEM; - goto err_free_mem; - } - - data->client = client; - data->input_dev = input_dev; - data->keycount = pdata->keycount; - - if (data->keycount > MPR121_MAX_KEY_COUNT) { - dev_err(&client->dev, "Too many key defined\n"); - error = -EINVAL; - goto err_free_mem; - } - - error = mpr121_phys_init(pdata, data, client); - if (error < 0) { - dev_err(&client->dev, "Failed to init register\n"); - goto err_free_mem; - } - - i2c_set_clientdata(client, data); - - input_dev->name = "FSL MPR121 Touchkey"; - input_dev->id.bustype = BUS_I2C; - input_dev->dev.parent = &client->dev; - input_dev->keycode = pdata->matrix; - input_dev->keycodesize = sizeof(pdata->matrix[0]); - input_dev->keycodemax = data->keycount; - - for (i = 0; i < input_dev->keycodemax; i++) { - __set_bit(pdata->matrix[i], input_dev->keybit); - data->keycodes[i] = pdata->matrix[i]; - } - - input_set_capability(input_dev, EV_MSC, MSC_SCAN); - input_set_drvdata(input_dev, data); - - error = request_threaded_irq(client->irq, NULL, - mpr_touchkey_interrupt, - IRQF_TRIGGER_FALLING, - client->dev.driver->name, data); - if (error) { - dev_err(&client->dev, "Failed to register interrupt\n"); - goto err_free_mem; - } - - error = input_register_device(input_dev); - if (error) - goto err_free_irq; - i2c_set_clientdata(client, data); - device_init_wakeup(&client->dev, pdata->wakeup); - dev_info(&client->dev, "Mpr121 touch keyboard init success.\n"); - return 0; - -err_free_irq: - free_irq(client->irq, data); -err_free_mem: - input_free_device(input_dev); - kfree(data); - return error; -} - -static int __devexit mpr_touchkey_remove(struct i2c_client *client) -{ - struct mpr121_touchkey_data *data = i2c_get_clientdata(client); - - free_irq(client->irq, data); - input_unregister_device(data->input_dev); - kfree(data); - - return 0; -} - -#ifdef CONFIG_PM -static int mpr_suspend(struct i2c_client *client, pm_message_t mesg) -{ - if (device_may_wakeup(&client->dev)) - enable_irq_wake(client->irq); - - i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, 0x00); - - return 0; -} - -static int mpr_resume(struct i2c_client *client) -{ - struct mpr121_touchkey_data *data = i2c_get_clientdata(client); - - if (device_may_wakeup(&client->dev)) - disable_irq_wake(client->irq); - - i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, data->keycount); - - return 0; -} -#else -static int mpr_suspend(struct i2c_client *client, pm_message_t mesg) {} -static int mpr_resume(struct i2c_client *client) {} -#endif - -static const struct i2c_device_id mpr121_id[] = { - {"mpr121_touchkey", 0}, - { } -}; - -static struct i2c_driver mpr_touchkey_driver = { - .driver = { - .name = "mpr121", - .owner = THIS_MODULE, - }, - .id_table = mpr121_id, - .probe = mpr_touchkey_probe, - .remove = __devexit_p(mpr_touchkey_remove), - .suspend = mpr_suspend, - .resume = mpr_resume, -}; - -static int __init mpr_touchkey_init(void) -{ - return i2c_add_driver(&mpr_touchkey_driver); -} - -static void __exit mpr_touchkey_exit(void) -{ - i2c_del_driver(&mpr_touchkey_driver); -} - -module_init(mpr_touchkey_init); -module_exit(mpr_touchkey_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Freescale Semiconductor, Inc."); -MODULE_DESCRIPTION("Touch Key driver for FSL MPR121 Chip"); diff --git a/drivers/input/touchscreen/elan_ts.c b/drivers/input/touchscreen/elan_ts.c index 7edd87d6cd1b..90272594d120 100644 --- a/drivers/input/touchscreen/elan_ts.c +++ b/drivers/input/touchscreen/elan_ts.c @@ -359,6 +359,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, @@ -366,6 +393,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/mfd/mxc-hdmi-core.c b/drivers/mfd/mxc-hdmi-core.c index e9322477ff6d..6cb36eedba19 100644 --- a/drivers/mfd/mxc-hdmi-core.c +++ b/drivers/mfd/mxc-hdmi-core.c @@ -79,6 +79,7 @@ unsigned int hdmi_set_cable_state(unsigned int state) return 0; } +EXPORT_SYMBOL(hdmi_set_cable_state); unsigned int hdmi_set_blank_state(unsigned int state) { @@ -90,6 +91,7 @@ unsigned int hdmi_set_blank_state(unsigned int state) return 0; } +EXPORT_SYMBOL(hdmi_set_blank_state); static void hdmi_audio_abort_stream(struct snd_pcm_substream *substream) { @@ -113,6 +115,7 @@ int mxc_hdmi_abort_stream(void) return 0; } +EXPORT_SYMBOL(mxc_hdmi_abort_stream); static int check_hdmi_state(void) { @@ -129,6 +132,7 @@ static int check_hdmi_state(void) return ret; } +EXPORT_SYMBOL(check_hdmi_state); int mxc_hdmi_register_audio(struct snd_pcm_substream *substream) { @@ -152,6 +156,7 @@ int mxc_hdmi_register_audio(struct snd_pcm_substream *substream) return ret; } +EXPORT_SYMBOL(mxc_hdmi_register_audio); void mxc_hdmi_unregister_audio(struct snd_pcm_substream *substream) { @@ -161,6 +166,7 @@ void mxc_hdmi_unregister_audio(struct snd_pcm_substream *substream) hdmi_audio_stream_playback = NULL; spin_unlock_irqrestore(&hdmi_audio_lock, flags); } +EXPORT_SYMBOL(mxc_hdmi_unregister_audio); u8 hdmi_readb(unsigned int reg) { @@ -172,6 +178,7 @@ u8 hdmi_readb(unsigned int reg) return value; } +EXPORT_SYMBOL(hdmi_readb); #ifdef DEBUG static bool overflow_lo; @@ -200,6 +207,7 @@ bool hdmi_check_overflow(void) return false; } #endif +EXPORT_SYMBOL(hdmi_check_overflow); void hdmi_writeb(u8 value, unsigned int reg) { @@ -208,6 +216,7 @@ void hdmi_writeb(u8 value, unsigned int reg) __raw_writeb(value, hdmi_base + reg); hdmi_check_overflow(); } +EXPORT_SYMBOL(hdmi_writeb); void hdmi_mask_writeb(u8 data, unsigned int reg, u8 shift, u8 mask) { @@ -215,6 +224,7 @@ void hdmi_mask_writeb(u8 data, unsigned int reg, u8 shift, u8 mask) value |= (data << shift) & mask; hdmi_writeb(value, reg); } +EXPORT_SYMBOL(hdmi_mask_writeb); unsigned int hdmi_read4(unsigned int reg) { @@ -224,6 +234,7 @@ unsigned int hdmi_read4(unsigned int reg) (hdmi_readb(reg + 1) << 8) | hdmi_readb(reg); } +EXPORT_SYMBOL(hdmi_read4); void hdmi_write4(unsigned int value, unsigned int reg) { @@ -233,6 +244,7 @@ void hdmi_write4(unsigned int value, unsigned int reg) hdmi_writeb((value >> 16) & 0xff, reg + 2); hdmi_writeb((value >> 24) & 0xff, reg + 3); } +EXPORT_SYMBOL(hdmi_write4); static void initialize_hdmi_ih_mutes(void) { @@ -501,6 +513,7 @@ unsigned int hdmi_SDMA_check(void) return (mx6q_revision() > IMX_CHIP_REVISION_1_1) || (mx6dl_revision() > IMX_CHIP_REVISION_1_0); } +EXPORT_SYMBOL(hdmi_SDMA_check); /* Need to run this before phy is enabled the first time to prevent * overflow condition in HDMI_IH_FC_STAT2 */ @@ -511,6 +524,7 @@ void hdmi_init_clk_regenerator(void) hdmi_set_clk_regenerator(); } } +EXPORT_SYMBOL(hdmi_init_clk_regenerator); void hdmi_clk_regenerator_update_pixel_clock(u32 pixclock) { @@ -519,17 +533,20 @@ void hdmi_clk_regenerator_update_pixel_clock(u32 pixclock) pixel_clk_rate = PICOS2KHZ(pixclock) * 1000UL; hdmi_set_clk_regenerator(); } +EXPORT_SYMBOL(hdmi_clk_regenerator_update_pixel_clock); void hdmi_set_dma_mode(unsigned int dma_running) { hdmi_dma_running = dma_running; hdmi_set_clk_regenerator(); } +EXPORT_SYMBOL(hdmi_set_dma_mode); void hdmi_set_sample_rate(unsigned int rate) { sample_rate = rate; } +EXPORT_SYMBOL(hdmi_set_sample_rate); void hdmi_set_edid_cfg(struct mxc_edid_cfg *cfg) { @@ -539,6 +556,7 @@ void hdmi_set_edid_cfg(struct mxc_edid_cfg *cfg) memcpy(&hdmi_core_edid_cfg, cfg, sizeof(struct mxc_edid_cfg)); spin_unlock_irqrestore(&edid_spinlock, flags); } +EXPORT_SYMBOL(hdmi_set_edid_cfg); void hdmi_get_edid_cfg(struct mxc_edid_cfg *cfg) { @@ -548,16 +566,19 @@ void hdmi_get_edid_cfg(struct mxc_edid_cfg *cfg) memcpy(cfg, &hdmi_core_edid_cfg, sizeof(struct mxc_edid_cfg)); spin_unlock_irqrestore(&edid_spinlock, flags); } +EXPORT_SYMBOL(hdmi_get_edid_cfg); void hdmi_set_registered(int registered) { hdmi_core_init = registered; } +EXPORT_SYMBOL(hdmi_set_registered); int hdmi_get_registered(void) { return hdmi_core_init; } +EXPORT_SYMBOL(hdmi_get_registered); static int mxc_hdmi_core_probe(struct platform_device *pdev) { 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/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index fe33da403ab9..27d9dcc578a8 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -56,8 +56,8 @@ /* special size referring to all the remaining space in a partition */ -#define SIZE_REMAINING UINT_MAX -#define OFFSET_CONTINUOUS UINT_MAX +#define SIZE_REMAINING ULLONG_MAX +#define OFFSET_CONTINUOUS ULLONG_MAX struct cmdline_mtd_partition { struct cmdline_mtd_partition *next; @@ -89,8 +89,8 @@ static struct mtd_partition * newpart(char *s, int extra_mem_size) { struct mtd_partition *parts; - unsigned long size; - unsigned long offset = OFFSET_CONTINUOUS; + unsigned long long size; + unsigned long long offset = OFFSET_CONTINUOUS; char *name; int name_len; unsigned char *extra_mem; @@ -108,7 +108,7 @@ static struct mtd_partition * newpart(char *s, size = memparse(s, &s); if (size < PAGE_SIZE) { - printk(KERN_ERR ERRP "partition size too small (%lx)\n", size); + printk(KERN_ERR ERRP "partition size too small (%llx)\n", size); return NULL; } } @@ -319,7 +319,7 @@ static int parse_cmdline_partitions(struct mtd_info *master, struct mtd_partition **pparts, struct mtd_part_parser_data *data) { - unsigned long offset; + unsigned long long offset; int i; struct cmdline_mtd_partition *part; const char *mtd_id = master->name; diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 6367eac4461b..d3b791f81dfd 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2855,7 +2855,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t len) * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise */ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, - int busw) + int *busw) { struct nand_onfi_params *p = &chip->onfi_params; int i; @@ -2909,10 +2909,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, mtd->writesize = le32_to_cpu(p->byte_per_page); mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page); - chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize; - busw = 0; + chip->chipsize = le32_to_cpu(p->blocks_per_lun); + chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count; + *busw = 0; if (le16_to_cpu(p->features) & 1) - busw = NAND_BUSWIDTH_16; + *busw = NAND_BUSWIDTH_16; chip->options &= ~NAND_CHIPOPTIONS_MSK; chip->options |= (NAND_NO_READRDY | @@ -2978,7 +2979,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, chip->onfi_version = 0; if (!type->name || !type->pagesize) { /* Check is chip is ONFI compliant */ - ret = nand_flash_detect_onfi(mtd, chip, busw); + ret = nand_flash_detect_onfi(mtd, chip, &busw); if (ret) goto ident_done; } diff --git a/drivers/mxc/ipu3/ipu_ic.c b/drivers/mxc/ipu3/ipu_ic.c index 84dcbb145f6f..b0b79add39a6 100644 --- a/drivers/mxc/ipu3/ipu_ic.c +++ b/drivers/mxc/ipu3/ipu_ic.c @@ -240,7 +240,9 @@ void _ipu_ic_init_prpvf(struct ipu_soc *ipu, ipu_channel_params_t *params, bool ipu_color_space_t in_fmt, out_fmt; /* Setup vertical resizing */ - if (!(params->mem_prp_vf_mem.outv_resize_ratio)) { + if (!(params->mem_prp_vf_mem.outv_resize_ratio) || + (params->mem_prp_vf_mem.outv_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_prp_vf_mem.in_height, params->mem_prp_vf_mem.out_height, &resizeCoeff, &downsizeCoeff); @@ -250,7 +252,9 @@ void _ipu_ic_init_prpvf(struct ipu_soc *ipu, ipu_channel_params_t *params, bool /* Setup horizontal resizing */ /* Upadeted for IC split case */ - if (!(params->mem_prp_vf_mem.outh_resize_ratio)) { + if (!(params->mem_prp_vf_mem.outh_resize_ratio) || + (params->mem_prp_vf_mem.outh_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_prp_vf_mem.in_width, params->mem_prp_vf_mem.out_width, &resizeCoeff, &downsizeCoeff); @@ -365,7 +369,9 @@ void _ipu_ic_init_prpenc(struct ipu_soc *ipu, ipu_channel_params_t *params, bool ipu_color_space_t in_fmt, out_fmt; /* Setup vertical resizing */ - if (!(params->mem_prp_enc_mem.outv_resize_ratio)) { + if (!(params->mem_prp_enc_mem.outv_resize_ratio) || + (params->mem_prp_enc_mem.outv_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_prp_enc_mem.in_height, params->mem_prp_enc_mem.out_height, &resizeCoeff, &downsizeCoeff); @@ -375,7 +381,9 @@ void _ipu_ic_init_prpenc(struct ipu_soc *ipu, ipu_channel_params_t *params, bool /* Setup horizontal resizing */ /* Upadeted for IC split case */ - if (!(params->mem_prp_enc_mem.outh_resize_ratio)) { + if (!(params->mem_prp_enc_mem.outh_resize_ratio) || + (params->mem_prp_enc_mem.outh_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_prp_enc_mem.in_width, params->mem_prp_enc_mem.out_width, &resizeCoeff, &downsizeCoeff); @@ -444,7 +452,9 @@ void _ipu_ic_init_pp(struct ipu_soc *ipu, ipu_channel_params_t *params) ipu_color_space_t in_fmt, out_fmt; /* Setup vertical resizing */ - if (!(params->mem_pp_mem.outv_resize_ratio)) { + if (!(params->mem_pp_mem.outv_resize_ratio) || + (params->mem_pp_mem.outv_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_pp_mem.in_height, params->mem_pp_mem.out_height, &resizeCoeff, &downsizeCoeff); @@ -455,7 +465,9 @@ void _ipu_ic_init_pp(struct ipu_soc *ipu, ipu_channel_params_t *params) /* Setup horizontal resizing */ /* Upadeted for IC split case */ - if (!(params->mem_pp_mem.outh_resize_ratio)) { + if (!(params->mem_pp_mem.outh_resize_ratio) || + (params->mem_pp_mem.outh_resize_ratio >= + IC_RSZ_MAX_RESIZE_RATIO)) { _calc_resize_coeffs(ipu, params->mem_pp_mem.in_width, params->mem_pp_mem.out_width, &resizeCoeff, &downsizeCoeff); diff --git a/drivers/mxc/ipu3/ipu_regs.h b/drivers/mxc/ipu3/ipu_regs.h index f6dff36210f5..458b0e09115d 100644 --- a/drivers/mxc/ipu3/ipu_regs.h +++ b/drivers/mxc/ipu3/ipu_regs.h @@ -459,6 +459,8 @@ enum { IC_CONF_RWS_EN = 0x40000000, IC_CONF_CSI_MEM_WR_EN = 0x80000000, + IC_RSZ_MAX_RESIZE_RATIO = 0x00004000, + IC_IDMAC_1_CB0_BURST_16 = 0x00000001, IC_IDMAC_1_CB1_BURST_16 = 0x00000002, IC_IDMAC_1_CB2_BURST_16 = 0x00000004, diff --git a/drivers/regulator/pfuze-regulator.h b/drivers/regulator/pfuze-regulator.h index 20d4766e91ea..113355ca250f 100644 --- a/drivers/regulator/pfuze-regulator.h +++ b/drivers/regulator/pfuze-regulator.h @@ -23,9 +23,13 @@ struct pfuze_regulator { struct regulator_desc desc; unsigned int reg; + unsigned int stby_reg; unsigned char enable_bit; + unsigned char stby_bit; unsigned char vsel_shift; unsigned char vsel_mask; + unsigned char stby_vsel_shift; + unsigned char stby_vsel_mask; int const *voltages; }; @@ -47,6 +51,7 @@ struct pfuze_regulator_priv { }, \ .reg = prefix ## _reg, \ .enable_bit = prefix ## _reg ## _ ## EN, \ + .stby_bit = prefix ## _reg ## _ ## STBY, \ .vsel_shift = prefix ## _reg ## _ ## VSEL,\ .vsel_mask = prefix ## _reg ## _ ## VSEL_M,\ .voltages = _voltages, \ @@ -64,6 +69,25 @@ struct pfuze_regulator_priv { .reg = prefix ## _reg, \ .vsel_shift = prefix ## _reg ## _ ## VSEL,\ .vsel_mask = prefix ## _reg ## _ ## VSEL_M,\ + .stby_reg = prefix ## _reg ## _ ## STBY, \ + .stby_vsel_shift = prefix ## _reg ## _ ## STBY_VSEL,\ + .stby_vsel_mask = prefix ## _reg ## _ ## STBY_VSEL_M,\ + .voltages = _voltages, \ + } + +#define PFUZE_SWBST_DEFINE(prefix, _name, _reg, _voltages, _ops) \ + [prefix ## _name] = { \ + .desc = { \ + .name = #prefix "_" #_name, \ + .n_voltages = ARRAY_SIZE(_voltages), \ + .ops = &_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = prefix ## _name, \ + .owner = THIS_MODULE, \ + }, \ + .reg = prefix ## _reg, \ + .vsel_shift = prefix ## _reg ## _ ## VSEL,\ + .vsel_mask = prefix ## _reg ## _ ## VSEL_M,\ .voltages = _voltages, \ } diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 34ca0fb45961..17a8da1e2099 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -159,6 +159,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; PFUZE_SW_DEFINE(PFUZE100_, name, reg, voltages, \ pfuze100_sw_regulator_ops) +#define PFUZE100_SWBST_DEFINE(name, reg, voltages) \ + PFUZE_SWBST_DEFINE(PFUZE100_, name, reg, voltages, \ + pfuze100_sw_regulator_ops) + #define PFUZE100_VGEN_DEFINE(name, reg, voltages) \ PFUZE_DEFINE(PFUZE100_, name, reg, voltages, \ pfuze100_ldo_regulator_ops) @@ -167,6 +171,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW1AVOL_VSEL 0 #define PFUZE100_SW1AVOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW1AVOL_STBY 33 +#define PFUZE100_SW1AVOL_STBY_VSEL 0 +#define PFUZE100_SW1AVOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW1AOFF 34 #define PFUZE100_SW1AOFF_OFF_VAL (0x0<<0) #define PFUZE100_SW1AOFF_OFF_M (0x3f<<0) @@ -192,6 +200,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW1BVOL_VSEL 0 #define PFUZE100_SW1BVOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW1BVOL_STBY 40 +#define PFUZE100_SW1BVOL_STBY_VSEL 0 +#define PFUZE100_SW1BVOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW1BOFF 41 #define PFUZE100_SW1BOFF_OFF_VAL 0x0 #define PFUZE100_SW1BOFF_OFF_M (0x3f<<0) @@ -217,6 +229,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW1CVOL_VSEL 0 #define PFUZE100_SW1CVOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW1CVOL_STBY 47 +#define PFUZE100_SW1CVOL_STBY_VSEL 0 +#define PFUZE100_SW1CVOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW1COFF 48 #define PFUZE100_SW1COFF_OFF_VAL 0x0 #define PFUZE100_SW1COFF_OFF_M (0x3f<<0) @@ -242,6 +258,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW2VOL_VSEL 0 #define PFUZE100_SW2VOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW2VOL_STBY 54 +#define PFUZE100_SW2VOL_STBY_VSEL 0 +#define PFUZE100_SW2VOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW2OFF 55 #define PFUZE100_SW2OFF_OFF_VAL 0x0 #define PFUZE100_SW2OFF_OFF_M (0x7f<<0) @@ -267,6 +287,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW3AVOL_VSEL 0 #define PFUZE100_SW3AVOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW3AVOL_STBY 61 +#define PFUZE100_SW3AVOL_STBY_VSEL 0 +#define PFUZE100_SW3AVOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW3AOFF 62 #define PFUZE100_SW3AOFF_OFF_VAL 0x0 #define PFUZE100_SW3AOFF_OFF_M (0x3f<<0) @@ -292,6 +316,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW3BVOL_VSEL 0 #define PFUZE100_SW3BVOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW3BVOL_STBY 68 +#define PFUZE100_SW3BVOL_STBY_VSEL 0 +#define PFUZE100_SW3BVOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW3BOFF 69 #define PFUZE100_SW3BOFF_OFF_VAL 0x0 #define PFUZE100_SW3BOFF_OFF_M (0x3f<<0) @@ -317,6 +345,10 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_SW4VOL_VSEL 0 #define PFUZE100_SW4VOL_VSEL_M (0x3f<<0) +#define PFUZE100_SW4VOL_STBY 75 +#define PFUZE100_SW4VOL_STBY_VSEL 0 +#define PFUZE100_SW4VOL_STBY_VSEL_M (0x3f<<0) + #define PFUZE100_SW4OFF 76 #define PFUZE100_SW4OFF_OFF_VAL 0x0 #define PFUZE100_SW4OFF_OFF_M (0x3f<<0) @@ -339,8 +371,6 @@ static struct regulator_ops pfuze100_sw_regulator_ops; /*SWBST*/ #define PFUZE100_SWBSTCON1 102 -#define PFUZE100_SWBSTCON1_STBY_VAL 0x0 -#define PFUZE100_SWBSTCON1_STBY_M (0x3<<5) #define PFUZE100_SWBSTCON1_SWBSTMOD_VAL (0x1<<2) #define PFUZE100_SWBSTCON1_SWBSTMOD_M (0x3<<2) #define PFUZE100_SWBSTCON1_VSEL 0 @@ -354,8 +384,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #define PFUZE100_VSNVSVOL_VSEL_M (0x3<<0) /*VGEN1*/ #define PFUZE100_VGEN1VOL 108 -#define PFUZE100_VGEN1VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN1VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN1VOL_STBY (0x1<<5) #define PFUZE100_VGEN1VOL_EN (0x1<<4) #define PFUZE100_VGEN1VOL_VSEL 0 #ifdef PFUZE100_FIRST_VERSION @@ -365,8 +394,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #endif /*VGEN2*/ #define PFUZE100_VGEN2VOL 109 -#define PFUZE100_VGEN2VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN2VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN2VOL_STBY (0x1<<5) #define PFUZE100_VGEN2VOL_EN (0x1<<4) #define PFUZE100_VGEN2VOL_VSEL 0 #ifdef PFUZE100_FIRST_VERSION @@ -376,29 +404,25 @@ static struct regulator_ops pfuze100_sw_regulator_ops; #endif /*VGEN3*/ #define PFUZE100_VGEN3VOL 110 -#define PFUZE100_VGEN3VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN3VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN3VOL_STBY (0x1<<5) #define PFUZE100_VGEN3VOL_EN (0x1<<4) #define PFUZE100_VGEN3VOL_VSEL 0 #define PFUZE100_VGEN3VOL_VSEL_M (0xf<<0) /*VGEN4*/ #define PFUZE100_VGEN4VOL 111 -#define PFUZE100_VGEN4VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN4VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN4VOL_STBY (0x1<<5) #define PFUZE100_VGEN4VOL_EN (0x1<<4) #define PFUZE100_VGEN4VOL_VSEL 0 #define PFUZE100_VGEN4VOL_VSEL_M (0xf<<0) /*VGEN5*/ #define PFUZE100_VGEN5VOL 112 -#define PFUZE100_VGEN5VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN5VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN5VOL_STBY (0x1<<5) #define PFUZE100_VGEN5VOL_EN (0x1<<4) #define PFUZE100_VGEN5VOL_VSEL 0 #define PFUZE100_VGEN5VOL_VSEL_M (0xf<<0) /*VGEN6*/ #define PFUZE100_VGEN6VOL 113 -#define PFUZE100_VGEN6VOL_STBY_VAL 0x0 -#define PFUZE100_VGEN6VOL_STBY_M (0x1<<5) +#define PFUZE100_VGEN6VOL_STBY (0x1<<5) #define PFUZE100_VGEN6VOL_EN (0x1<<4) #define PFUZE100_VGEN6VOL_VSEL 0 #define PFUZE100_VGEN6VOL_VSEL_M (0xf<<0) @@ -410,8 +434,8 @@ static struct pfuze_regulator pfuze100_regulators[] = { PFUZE100_SW_DEFINE(SW3A, SW3AVOL, pfuze100_sw3), PFUZE100_SW_DEFINE(SW3B, SW3BVOL, pfuze100_sw3), PFUZE100_SW_DEFINE(SW4, SW4VOL, pfuze100_sw4), - PFUZE100_SW_DEFINE(SWBST, SWBSTCON1, pfuze100_swbst), - PFUZE100_SW_DEFINE(VSNVS, VSNVSVOL, pfuze100_vsnvs), + PFUZE100_SWBST_DEFINE(SWBST, SWBSTCON1, pfuze100_swbst), + PFUZE100_SWBST_DEFINE(VSNVS, VSNVSVOL, pfuze100_vsnvs), PFUZE100_FIXED_VOL_DEFINE(VREFDDR, VREFDDRCON, pfuze100_vrefddr), PFUZE100_VGEN_DEFINE(VGEN1, VGEN1VOL, pfuze100_vgen12), PFUZE100_VGEN_DEFINE(VGEN2, VGEN2VOL, pfuze100_vgen12), @@ -545,6 +569,36 @@ static int pfuze100_regulator_get_voltage(struct regulator_dev *rdev) return pfuze100_regulators[id].voltages[val]; } +static int pfuze100_regulator_ldo_standby_enable(struct regulator_dev *rdev) +{ + struct pfuze_regulator_priv *priv = rdev_get_drvdata(rdev); + int id = rdev_get_id(rdev); + int ret; + + dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id); + pfuze_lock(priv->pfuze); + ret = pfuze_reg_rmw(priv->pfuze, pfuze100_regulators[id].reg, + pfuze100_regulators[id].stby_bit, + 0); + pfuze_unlock(priv->pfuze); + return ret; +} + +static int pfuze100_regulator_ldo_standby_disable(struct regulator_dev *rdev) +{ + struct pfuze_regulator_priv *priv = rdev_get_drvdata(rdev); + int id = rdev_get_id(rdev); + int ret; + + dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id); + pfuze_lock(priv->pfuze); + ret = pfuze_reg_rmw(priv->pfuze, pfuze100_regulators[id].reg, + pfuze100_regulators[id].stby_bit, + pfuze100_regulators[id].stby_bit); + pfuze_unlock(priv->pfuze); + return ret; +} + static struct regulator_ops pfuze100_ldo_regulator_ops = { .enable = pfuze100_regulator_enable, .disable = pfuze100_regulator_disable, @@ -552,6 +606,8 @@ static struct regulator_ops pfuze100_ldo_regulator_ops = { .list_voltage = pfuze100_regulator_list_voltage, .set_voltage = pfuze100_regulator_set_voltage, .get_voltage = pfuze100_regulator_get_voltage, + .set_suspend_enable = pfuze100_regulator_ldo_standby_enable, + .set_suspend_disable = pfuze100_regulator_ldo_standby_disable, }; static int pfuze100_fixed_regulator_set_voltage(struct regulator_dev *rdev, @@ -591,11 +647,45 @@ static int pfuze100_sw_regulator_is_enabled(struct regulator_dev *rdev) return 1; } +static int +pfuze100_regulator_sw_standby_voltage(struct regulator_dev *rdev, int uV) +{ + + struct pfuze_regulator_priv *priv = rdev_get_drvdata(rdev); + int value, id = rdev_get_id(rdev); + int ret; + + dev_dbg(rdev_get_dev(rdev), "%s id: %d set standby: %d\n", + __func__, id, uV); + /* Find the best index */ + value = pfuze100_get_best_voltage_index(rdev, uV, uV); + if (value < 0) + return value; + pfuze_lock(priv->pfuze); + ret = pfuze_reg_rmw(priv->pfuze, pfuze100_regulators[id].stby_reg, + pfuze100_regulators[id].stby_vsel_mask, + value << pfuze100_regulators[id].stby_vsel_shift); + pfuze_unlock(priv->pfuze); + return ret; + +} + +static int pfuze100_regulator_sw_standby_enable(struct regulator_dev *rdev) +{ + return 0; +} +static int pfuze100_regulator_sw_standby_disable(struct regulator_dev *rdev) +{ + return 0; +} static struct regulator_ops pfuze100_sw_regulator_ops = { .is_enabled = pfuze100_sw_regulator_is_enabled, .list_voltage = pfuze100_regulator_list_voltage, .set_voltage = pfuze100_regulator_set_voltage, .get_voltage = pfuze100_regulator_get_voltage, + .set_suspend_enable = pfuze100_regulator_sw_standby_enable, + .set_suspend_disable = pfuze100_regulator_sw_standby_disable, + .set_suspend_voltage = pfuze100_regulator_sw_standby_voltage, }; static int __devinit pfuze100_regulator_probe(struct platform_device *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 7eef316b1afe..0fd076537fb8 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 727c6ebc575c..2df44041e65c 100644 --- a/drivers/video/mxc/mxc_epdc_fb.c +++ b/drivers/video/mxc/mxc_epdc_fb.c @@ -1166,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; } 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)) { |