linux.git
7 years agoENGR00318895-6 Documentation: fsl-quadspi: update the document
Huang Shijie [Wed, 23 Apr 2014 03:59:26 +0000 (11:59 +0800)]
ENGR00318895-6 Documentation: fsl-quadspi: update the document

The patch updates the document by adding more information to describe the
DT proporties used by the Freescale Quadspi driver and the childs nodes.

For the child node for SPI NOR flash, we add the required property
("spi-max-frequency"), and refer to spi-nor-flash.txt for the optional
properties.

Signed-off-by: Huang Shijie <b32955@freescale.com>
(cherry picked from commit d7b296f51eb077b0c77580ad63ffd69ce722bf6c)

7 years agoENGR00318895-5 Documentation: mtd: add a new document for SPI NOR flash
Huang Shijie [Wed, 23 Apr 2014 05:54:40 +0000 (13:54 +0800)]
ENGR00318895-5 Documentation: mtd: add a new document for SPI NOR flash

We need a DT property to store the dummy cycles for DDR Quad read.
This is a common feature for the SPI NOR flash, such as Spansion and Micron
chips.

Add this file to describe this specific SPI NOR flash features which will
be referred by the SPI NOR flash drivers.

Signed-off-by: Huang Shijie <b32955@freescale.com>
(cherry picked from commit dfbe3eb5c7c2c3967c0f1bf32c0279136da7bfce)

7 years agoMLK-11941: mtd: spi-nor: add DDR quad read support
Han Xu [Tue, 3 Nov 2015 22:52:25 +0000 (16:52 -0600)]
MLK-11941: mtd: spi-nor: add DDR quad read support

This patch adds the DDR quad read support by the following:

[1] add SPI_NOR_DDR_QUAD read mode.

[2] add DDR Quad read opcodes:
    SPINOR_OP_READ_1_4_4_D / SPINOR_OP_READ4_1_4_4_D

[3] add set_ddr_quad_mode() to initialize for the DDR quad read.
    Currently it only works for Spansion NOR.

[3] about the dummy cycles.
    We set the dummy with 8 for DDR quad read by default.
    The m25p80.c can not support the DDR quad read, but the SPI NOR controller
    can set the dummy value in its child DT node, and the SPI NOR framework
    can parse it out.

Signed-off-by: Han Xu <b45815@freescale.com>
7 years agoMLK-11751: mtd: gpmi: add empty sentinel entry at the end of of_device_id table
Han Xu [Fri, 23 Oct 2015 03:22:58 +0000 (22:22 -0500)]
MLK-11751: mtd: gpmi: add empty sentinel entry at the end of of_device_id table

add an empty sentinel entry to avoid the struct of_device_id is not
terminated with a NULL entry issue.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 2b1ce5ec442dde8801b6b2d059d22f5dce7c9c76)

7 years agoMLK-11747: mtd: gpmi: save bch geometry setting only in initial stage
Han Xu [Wed, 21 Oct 2015 16:43:55 +0000 (11:43 -0500)]
MLK-11747: mtd: gpmi: save bch geometry setting only in initial stage

fix the bch setting issue when system suspend/resume, the bch geometry
only need to be saved to debugfs in driver initial stage

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 3b4f7178854e428fb5ef08d554b13abe4f27c533)

7 years agoMLK-11720: mtd: gpmi: change the erase threshold for mx6qp,mx6ul and mx7d
Han Xu [Fri, 9 Oct 2015 16:19:01 +0000 (11:19 -0500)]
MLK-11720: mtd: gpmi: change the erase threshold for mx6qp,mx6ul and mx7d

The erase threshold should be set to ecc_strength for these platforms.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit f46d113a02f5375c38fc9aba88c587fd672a30c4)

7 years agoMLK-11719-4: mtd: gpmi: change the BCH layout setting for large oob NAND
Han Xu [Thu, 30 Apr 2015 21:50:34 +0000 (16:50 -0500)]
MLK-11719-4: mtd: gpmi: change the BCH layout setting for large oob NAND

The cod change updated the NAND driver BCH ECC layout algorithm to
support large oob size NAND chips(oob > 1024 bytes) and proposed a new
way to set ECC layout.

Current implementation requires each chunk size larger than oob size so
the bad block marker (BBM) can be guaranteed located in data chunk. The
ECC layout always using the unbalanced layout(Ecc for both meta and
Data0 chunk), but for the NAND chips with oob larger than 1k, the driver
cannot support because BCH doesn’t support GF 15 for 2K chunk.

The change keeps the data chunk no larger than 1k and adjust the ECC
strength or ECC layout to locate the BBM in data chunk. General idea for
large oob NAND chips is

1.Try all ECC strength from the minimum value required by NAND spec to
the maximum one that works, any ECC makes the BBM locate in data chunk
can be chosen.

2.If none of them works, using separate ECC for meta, which will add one
extra ecc with the same ECC strength as other data chunks. This extra
ECC can guarantee BBM located in data chunk, of course, we need to check
if oob can afford it.

Previous code has two methods for ECC layout setting, the
legacy_set_geometry and set_geometry_by_ecc_info, the difference
between these two methods is, legacy_set_geometry set the chunk size
larger chan oob size and then set the maximum ECC strength that oob can
afford. While the set_geometry_by_ecc_info set chunk size and ECC
strength according to NAND spec. It has been proved that the first
method cannot provide safe ECC strength for some modern NAND chips, so
in current code,

1. Driver read NAND parameters first and then chose the proper ECC
layout setting method.

2. If the oob is large or NAND required data chunk larger than oob size,
chose set_geometry_for_large_oob, otherwise use set_geometry_by_ecc_info

3. legacy_set_geometry only used for some NAND chips does not contains
necessary information. So this is only a backup plan, it is NOT
recommended to use these NAND chips.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 78e8beff734adb72185405ae2cb55e0097eb96cb)

7 years agoMLK-11719-2: mtd: gpmi: save the bch layout setting in debugfs
Han Xu [Fri, 9 Oct 2015 15:18:20 +0000 (10:18 -0500)]
MLK-11719-2: mtd: gpmi: save the bch layout setting in debugfs

save the bch layout setting in debugfs for the upper layer applications,
such as kobs-ng.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 8a373e796c21f4e9b714039e5f0b7d9388ef5a32)

7 years agoMLK-11555: mtd: nand: i.MX6UL supports bitflip detection
Han Xu [Tue, 15 Sep 2015 20:50:18 +0000 (15:50 -0500)]
MLK-11555: mtd: nand: i.MX6UL supports bitflip detection

i.MX6UL also has the DEBUG1 register which can be used for bitflip
detection for erased page.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 8df8d10edc8909e19e60f0cc1dd65c1fe706ab67)

7 years agoMLK-11921-3 mxc IPUv3: regs: Fix the macro WROD definition
Liu Ying [Mon, 30 Nov 2015 09:11:10 +0000 (17:11 +0800)]
MLK-11921-3 mxc IPUv3: regs: Fix the macro WROD definition

This patch adds missing parentheses around the argument of the macro
WROD to avoid any potential macro expansion issue.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11921-2 mxc IPUv3: param mem: Fix several potential macro expansion issues
Liu Ying [Mon, 30 Nov 2015 09:07:37 +0000 (17:07 +0800)]
MLK-11921-2 mxc IPUv3: param mem: Fix several potential macro expansion issues

This patch adds missing parentheses around the arguments of the macro
ipu_ch_param_addr/ipu_ch_param_set_field(_io)/ipu_ch_param_mod_field(_io)/
ipu_ch_param_read_field(_io) to avoid any potential macro expansion issue.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11921-1 mxc IPUv3: common: Fix the macro idma_is_valid/idma_mask definitions
Liu Ying [Mon, 30 Nov 2015 09:01:49 +0000 (17:01 +0800)]
MLK-11921-1 mxc IPUv3: common: Fix the macro idma_is_valid/idma_mask definitions

This patch adds missing parentheses around the argument of the macro
idma_is_valid and idma_mask to avoid any potential macro expansion issue.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11932 video: fbdev: mxc: ldb: Do not touch fbi->modelist in ldb_init()
Liu Ying [Tue, 1 Dec 2015 06:42:41 +0000 (14:42 +0800)]
MLK-11932 video: fbdev: mxc: ldb: Do not touch fbi->modelist in ldb_init()

We don't have to touch fbi->modelist in ldb_init(), because mxcfb_register()
may initialize the list and add a video mode to the list for us.

This patch fixes the following issue reported by Coverity:
INIT_LIST_HEAD(&fbi->modelist);
Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value fb_vm. Field fb_vm.name is
uninitialized when calling fb_add_videomode.
fb_add_videomode(&fb_vm, &fbi->modelist);
fb_videomode_to_var(&fbi->var, &fb_vm);

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11918-4 video: mxc ipuv3 fb: Fix dangling pointer dereference in check_var
Liu Ying [Mon, 30 Nov 2015 03:46:00 +0000 (11:46 +0800)]
MLK-11918-4 video: mxc ipuv3 fb: Fix dangling pointer dereference in check_var

The function fbi_to_pixfmt() could access the pointer fbi->device provided
by it's input parameter fbi, so let's make sure the pointer isn't dangling.

This patch fixes the following issue reported by Coverity:
Uninitialized pointer read (UNINIT)
uninit_use_in_call: Using uninitialized value tmp_fbi.device when calling
fbi_to_pixfmt.
switch (fbi_to_pixfmt(&tmp_fbi, true)) {
case IPU_PIX_FMT_YUV420P2:
case IPU_PIX_FMT_YVU420P:

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11918-3 video: mxc ipuv3 fb: Fix bailout path for ioctrl FBIO_ALLOC
Liu Ying [Mon, 30 Nov 2015 03:01:07 +0000 (11:01 +0800)]
MLK-11918-3 video: mxc ipuv3 fb: Fix bailout path for ioctrl FBIO_ALLOC

Resources(kmem and DMA) should be freed correctly in the bailout path of
ioctrl FBIO_ALLOC.  We should also delete mem->list from fb_alloc_list
in the bailout path if necessary.

The kmem leakage issue is reported by Coverity:
if (get_user(size, argp))
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable mem going out of scope leaks the storage it points to.
return -EFAULT;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11918-2 video: mxc ipuv3 fb: Return err in ->fb_check_var if fbi_tmp is NULL
Liu Ying [Mon, 30 Nov 2015 02:55:12 +0000 (10:55 +0800)]
MLK-11918-2 video: mxc ipuv3 fb: Return err in ->fb_check_var if fbi_tmp is NULL

It has to be successful to find a relevant background framebuffer for a
foreground framebuffer.  So, we should return error code if it happens
to fail.

This patch fixes the following issue reported by Coverity:
Dereference after null check (FORWARD_NULL)
var_deref_op: Dereferencing null pointer fbi_tmp.
if (fbi_tmp->var.vmode & FB_VMODE_INTERLACED)
var->vmode |= FB_VMODE_INTERLACED;
else
var->vmode &= ~FB_VMODE_INTERLACED;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11918-1 video: fbdev: mxc ipuv3 fb: Remove fbi NULL pointer check in ->remove()
Liu Ying [Mon, 30 Nov 2015 02:18:58 +0000 (10:18 +0800)]
MLK-11918-1 video: fbdev: mxc ipuv3 fb: Remove fbi NULL pointer check in ->remove()

The driver takes the pointer fbi as the driver data, so fbi cannot be a NULL
pointer in ->remove().  Let's remove the unnecessary NULL pointer check on
fbi.

This patch fixes the following issue reported by Coverity:
deref_ptr: Directly dereferencing pointer fbi.
struct mxcfb_info *mxc_fbi = fbi->par;

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking fbi suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
if (!fbi)
return 0;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11915-12 ASoC: fsl_asrc_m2m: fix null check issue for variable m2m and pair
Zidan Wang [Fri, 27 Nov 2015 05:50:12 +0000 (13:50 +0800)]
MLK-11915-12 ASoC: fsl_asrc_m2m: fix null check issue for variable m2m and pair

After allocating memory for m2m, we should null check for m2m instead of pair.

In fsl_asrc_close(), null-checking pair suggests that it may be null, but it
has already been dereferenced before the null check. pair will be alloceted
in fsl_asrc_open(), pair is null means that open dev file failed, and
close should not be called in user space. So remove null check for pair.

buf_len should not greater than ASRC_DMA_BUFFER_SIZE, otherwith dma buffer will
be overrun.

Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit b0dc15375b12b6c1bf46b9071b92267b827d8ce0)

7 years agoMLK-11915-11 ASoC: fsl_asrc_dma: check the return value for snd_pcm_hw_constraint_int...
Zidan Wang [Fri, 27 Nov 2015 05:45:09 +0000 (13:45 +0800)]
MLK-11915-11 ASoC: fsl_asrc_dma: check the return value for snd_pcm_hw_constraint_integer()

check the return value for snd_pcm_hw_constraint_integer().
Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 26f8fea617fcebd8835f660534a988c58b9f0517)

7 years agoMLK-11915-10 ASoC: imx_mqs: fix mqs_priv->name overrun issue
Zidan Wang [Fri, 27 Nov 2015 05:42:41 +0000 (13:42 +0800)]
MLK-11915-10 ASoC: imx_mqs: fix mqs_priv->name overrun issue

fix mqs_priv->name overrun issue. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit ef1c59f93981b15412a0207d5517a26901bb2ecd)

7 years agoMLK-11915-09 ASoC: cs42xx8: remove the no effect comparison
Zidan Wang [Fri, 27 Nov 2015 03:22:32 +0000 (11:22 +0800)]
MLK-11915-09 ASoC: cs42xx8: remove the no effect comparison

rate_tx and rate_rx are always greater than or equal to 0, so remove the
no effect comparison. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit d5957250784a27cf6f6f421d8a6e0ba45b4bbc18)

7 years agoMLK-11915-08 ASoC: imx-si476x: init fm_np to avoid wild pointer
Zidan Wang [Fri, 27 Nov 2015 06:44:51 +0000 (14:44 +0800)]
MLK-11915-08 ASoC: imx-si476x: init fm_np to avoid wild pointer

init fm_np to avoid wild pointer. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit dea49f320f33e1f723301a0bfa18573c0f7b5fb1)

7 years agoMLK-11915-07 ASoC: imx-audmux: fix missing break in switch
Zidan Wang [Fri, 27 Nov 2015 03:20:49 +0000 (11:20 +0800)]
MLK-11915-07 ASoC: imx-audmux: fix missing break in switch

fix missing break in switch. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 302516a1dfca5758a34cbed939c9976679febb0c)

7 years agoMLK-11915-06 ASoC: fsl_esai: fix missing break in switch
Zidan Wang [Fri, 27 Nov 2015 03:15:38 +0000 (11:15 +0800)]
MLK-11915-06 ASoC: fsl_esai: fix missing break in switch

fix missing break in switch. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit ec9d74d9258e3320ec68a1f977932cb20ace4ca2)

7 years agoMLK-11915-05 ASoC: imx-wm8958: init codec_np to avoid wild pointer
Zidan Wang [Fri, 27 Nov 2015 03:14:36 +0000 (11:14 +0800)]
MLK-11915-05 ASoC: imx-wm8958: init codec_np to avoid wild pointer

init codec_np to avoid wild pointer. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 76665930654867cf38a86ba747a9f8a5bf2665e2)

7 years agoMLK-11915-04 ASoC: imx-cs42888: init asrc_np to avoid wild pointer and check return...
Zidan Wang [Fri, 27 Nov 2015 03:12:30 +0000 (11:12 +0800)]
MLK-11915-04 ASoC: imx-cs42888: init asrc_np to avoid wild pointer and check return value of set_fmt()

init asrc_np to avoid wild pointer and check return value of
set_fmt(). Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 4ccc87a93e180e09b6494fd6c6d81b07dc054e9b)

7 years agoMLK-11915-03 ASoC: imx-sii902x: init sii902x_np to avoid wild pointer
Zidan Wang [Fri, 27 Nov 2015 03:10:53 +0000 (11:10 +0800)]
MLK-11915-03 ASoC: imx-sii902x: init sii902x_np to avoid wild pointer

init sii902x_np to avoid wild pointer. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 780e27683c38f785ea7f7e07e83b00ffd3c22d78)

7 years agoMLK-11915-02 ASoC: imx-wm8962: init codec_np to avoid wild pointer
Zidan Wang [Fri, 27 Nov 2015 03:08:20 +0000 (11:08 +0800)]
MLK-11915-02 ASoC: imx-wm8962: init codec_np to avoid wild pointer

init codec_np to avoid wild pointer. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 8e27b90c9adf5033038a40e0b61a7ffe4c971290)

7 years agoMLK-11915-01 ASoC: imx-wm8960: check return value and init codec_np to avoid wild...
Zidan Wang [Fri, 27 Nov 2015 02:53:09 +0000 (10:53 +0800)]
MLK-11915-01 ASoC: imx-wm8960: check return value and init codec_np to avoid wild pointer

check return value for set_fmt and set_sysclk function, and init
codec_np to avoid wild pointer. Reported by coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 68021ab9ada4a7f3037993a3887453e12271d4ed)

7 years agoMLK-11911-1 mxc IPUv3: capture: Define div_ratio as type of int32_t
Liu Ying [Thu, 26 Nov 2015 07:28:36 +0000 (15:28 +0800)]
MLK-11911-1 mxc IPUv3: capture: Define div_ratio as type of int32_t

The local variable div_ratio could be less than zero, so let's define
it as type of int32_t instead of uint32_t.

This issue is reported by Coverity:
Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned value
is never true. div_ratio < 0U.
if (div_ratio > 0xFF || div_ratio < 0) {
dev_dbg(ipu->dev, "value of pixel_clk extends normal range\n");
return -EINVAL;
}

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-7 mxc IPUv3: common: Convert macro tri_cur_buf_mask/shift to function
Liu Ying [Fri, 27 Nov 2015 06:29:53 +0000 (14:29 +0800)]
MLK-11911-7 mxc IPUv3: common: Convert macro tri_cur_buf_mask/shift to function

This patch converts macro tri_cur_buf_mask/shift to function to address the
following issue reported by Coverity:
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: dma_chan * 2 != 63 is always true regardless of
the values of its operands. This occurs as the logical first operand of '?:'.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-6 mxc IPUv3: Minor improvement for _ipu_is_smfc_chan()
Liu Ying [Thu, 26 Nov 2015 08:33:58 +0000 (16:33 +0800)]
MLK-11911-6 mxc IPUv3: Minor improvement for _ipu_is_smfc_chan()

A minor improvement for _ipu_is_smfc_chan() to address the following
issue reported by Coverity:
Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. dma_chan >= 0U.
return ((dma_chan >= 0) && (dma_chan <= 3));

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-5 mxc IPUv3: pixel clk: Free gate clk memory if clk_regiser fails
Liu Ying [Thu, 26 Nov 2015 08:30:25 +0000 (16:30 +0800)]
MLK-11911-5 mxc IPUv3: pixel clk: Free gate clk memory if clk_regiser fails

This patch fixes the following issue reported by Coverity:
if (IS_ERR(clk))
freed_arg: kfree frees clk. [Note: The source code implementation of the
function has been overridden by a builtin model.]
kfree(clk);

Use after free (USE_AFTER_FREE)
use_after_free: Using freed pointer clk.
return clk;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-4 mxc IPUv3: pixel clk: Free di_div clk memory if clk_regiser fails
Liu Ying [Thu, 26 Nov 2015 08:30:08 +0000 (16:30 +0800)]
MLK-11911-4 mxc IPUv3: pixel clk: Free di_div clk memory if clk_regiser fails

This patch fixes the following issue reported by Coverity:
if (IS_ERR(clk))
freed_arg: kfree frees clk. [Note: The source code implementation of the
function has been overridden by a builtin model.]
kfree(clk);

Use after free (USE_AFTER_FREE)
use_after_free: Using freed pointer clk.
return clk;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-3 mxc IPUv3: disp: Correct display ID check in ipu_uninit_sync_panel()
Liu Ying [Thu, 26 Nov 2015 08:11:17 +0000 (16:11 +0800)]
MLK-11911-3 mxc IPUv3: disp: Correct display ID check in ipu_uninit_sync_panel()

This patch fixes the following issue reported by Coverity:
Constant expression result (CONSTANT_EXPRESSION_RESULT)
always_true_or: The "or" condition disp != 0 || disp != 1 will always be true
because disp cannot be equal to two different values at the same time, so it
must be not equal to at least one of them.
if ((disp != 0) || (disp != 1))
return;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11911-2 mxc IPUv3: device: Correct bailout path for the ioctrl IPU_ALLOC
Liu Ying [Thu, 26 Nov 2015 07:51:44 +0000 (15:51 +0800)]
MLK-11911-2 mxc IPUv3: device: Correct bailout path for the ioctrl IPU_ALLOC

We should do the bailout dance correctly for the ioctrl IPU_ALLOC:
- Free the mem pointer.
- Free the DMA.
- Delete the mem->list from the ipu_alloc_list.

The potential memory leakage issue on the mem pointer is reported by Coverity:
if (get_user(size, argp))
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable mem going out of scope leaks the storage it points to.
return -EFAULT;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11917-2 media: output: pxp_v4l2: correct comparing unsigned to 0
Fancy Fang [Mon, 30 Nov 2015 02:32:37 +0000 (10:32 +0800)]
MLK-11917-2 media: output: pxp_v4l2: correct comparing unsigned to 0

Comparing unsigned integer with 0 is meaningless. So
remove this kind of integer comparing.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11917-1 media: output: pxp_v4l2: remove some duplicate dead code
Fancy Fang [Mon, 30 Nov 2015 02:19:35 +0000 (10:19 +0800)]
MLK-11917-1 media: output: pxp_v4l2: remove some duplicate dead code

The code slice in the 'v4l2_fmt_to_pxp_fmt()' function:
"
        else if (v4l2_pix_fmt == V4L2_PIX_FMT_RGB555)
                pxp_fmt = PXP_PIX_FMT_RGB555;
"
appears twice continuously. And the second code slice
will become dead code which is never executed. So
remove the second one.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11912 cpufreq: imx: fix dereference null return value issue
Bai Ping [Thu, 26 Nov 2015 10:22:20 +0000 (18:22 +0800)]
MLK-11912 cpufreq: imx: fix dereference null return value issue

After coverity code check, it reports dereference NULL return value
complain, so fix it.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11896-3 usb: chipidea: imx: add NULL check for usbmisc_data
Li Jun [Thu, 26 Nov 2015 09:35:13 +0000 (17:35 +0800)]
MLK-11896-3 usb: chipidea: imx: add NULL check for usbmisc_data

Check if data->usbmisc_data is NULL before dereference it in probe.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11914-2 video: mipi_dsi: add the missing error code check
Fancy Fang [Fri, 27 Nov 2015 07:09:30 +0000 (15:09 +0800)]
MLK-11914-2 video: mipi_dsi: add the missing error code check

Add the missing error code check just as the others which
have the check.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11914-1 video: mipi_dsi: correct wrong buf index usage
Fancy Fang [Fri, 27 Nov 2015 07:04:06 +0000 (15:04 +0800)]
MLK-11914-1 video: mipi_dsi: correct wrong buf index usage

The 'buf' index loop is obviously wrong. So correct
it.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11913 dma: pxp-v3: remove some duplicate dead code
Fancy Fang [Fri, 27 Nov 2015 02:21:27 +0000 (10:21 +0800)]
MLK-11913 dma: pxp-v3: remove some duplicate dead code

The code slice in the pxp_probe() function:
"
       if (!res || irq < 0) {
               err = -ENODEV;
               goto exit;
       }
"
appears twice closely. And the second code slice will become
dead code which is never executed. So remove the second one.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11907 dma: pxp-dev: allocate the 'sg' buffer dynamically.
Fancy Fang [Thu, 26 Nov 2015 08:47:07 +0000 (16:47 +0800)]
MLK-11907 dma: pxp-dev: allocate the 'sg' buffer dynamically.

The 'sg' buffer should be allocated dynamically, since its
size is dependent on the 'sg_len' which is calculated
according to the functions required.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit 57f08c108fc4f4721449b4b94be9820c7443978a)

7 years agoMLK-11896-2 usb: chipidea: imx: derefence pointer after NULL check
Li Jun [Thu, 26 Nov 2015 09:34:18 +0000 (17:34 +0800)]
MLK-11896-2 usb: chipidea: imx: derefence pointer after NULL check

Dereference data pointer after its NULL check.

Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11896-1 usb: chipidea: imx: add break for switch case
Li Jun [Thu, 26 Nov 2015 02:48:05 +0000 (10:48 +0800)]
MLK-11896-1 usb: chipidea: imx: add break for switch case

Fix the coverity check complains although there is no function issue
with current code.

Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoASoC: fsl-sai: set xCR4/xCR5/xMR for SAI master mode
Zidan Wang [Mon, 9 Nov 2015 11:03:13 +0000 (19:03 +0800)]
ASoC: fsl-sai: set xCR4/xCR5/xMR for SAI master mode

For SAI master mode, when Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will
generate bclk and frame clock for Tx(Rx), we should set RCR4(TCR4),
RCR5(TCR5) and RMR(TMR) for playback(capture), or there will be sync
error sometimes.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 51659ca069ce5bdf20675a7967a39ef8419e87f2)

7 years agoMGS-1276 ENGR00306443-2 dts:Add QoS description in imx6sx dts
Shawn Xiao [Mon, 2 Feb 2015 07:39:51 +0000 (15:39 +0800)]
MGS-1276 ENGR00306443-2 dts:Add QoS description in imx6sx dts

(cherry-pick from f9759787e60ad3422d2119f9f25ac320ca58f5df)

confilict: arch/arm/boot/dts/imx6sx.dtsi
The dts file arch has changed in 3.14. Add QoS description in
imx6sx dts manually and solve the conflict.

Date Feb 2, 2015

Signed-off-by: Shawn Xiao <b49994@freescale.com>
7 years agoMLK-11881 video: fbdev: mxc ipuv3 fb: Correct ->prefetch in ioctrl SET_PREFETCH
Liu Ying [Fri, 20 Nov 2015 05:50:20 +0000 (13:50 +0800)]
MLK-11881 video: fbdev: mxc ipuv3 fb: Correct ->prefetch in ioctrl SET_PREFETCH

When a framebuffer is blanked, the user may call the MXCFB_SET_PREFETCH ioctrl
to enable or disable the prefetch engine.  After sanity check, the cached
->prefetch should reflect the user's intention for next unblank operation
any way instead of checking ->cur_prefetch first.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11870 usb: chipidea: otg: disable term select override for B device
Li Jun [Wed, 18 Nov 2015 08:31:00 +0000 (16:31 +0800)]
MLK-11870 usb: chipidea: otg: disable term select override for B device

In MLK-11272, we introduce a workaround to resolve data pulse detection
IC issue in i.MX7D, but did not disable the term select override after
the A device becomes B device in some cases: a_idle --> enable term
select override --> b_idle, which cause the B device cannot be enumerated
in b_peripheral mode. This patch is to fix it by disable the term select
and data pulse when A device becomes B device.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 2df52fcaded838a572c2ee8f93d6cc827a2ebc60)

7 years agoMLK-11857 mxc IPUv3: PRE: Use spinlock to protect pre_list instead of mutex
Liu Ying [Fri, 13 Nov 2015 06:55:55 +0000 (14:55 +0800)]
MLK-11857 mxc IPUv3: PRE: Use spinlock to protect pre_list instead of mutex

The pre_list can be accessed in an irq context.  To avoid potential hang up
issue, use spinlock to protect pre_list instead of mutex.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11874 media: platform: mxc v4l2 capture: Correct suspend/resume for capture
Liu Ying [Thu, 19 Nov 2015 05:43:58 +0000 (13:43 +0800)]
MLK-11874 media: platform: mxc v4l2 capture: Correct suspend/resume for capture

The capture channel should be correctly disabled in ->suspend() and
enabled in ->resume() with ->enc_disable()/->enc_disable_csi() and
->enc_enable()/->enc_enable_csi() respectively.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-11876 dma: imx-sdma: fix 'section mismatch'
Robin Gong [Thu, 19 Nov 2015 03:07:50 +0000 (11:07 +0800)]
MLK-11876 dma: imx-sdma: fix 'section mismatch'

The commit '39c6663 MLK-11848-2 dma: imx-sdma: add __init for probe()' is
not correct, fix it totally.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11832: MIPI CSI: Adjust mipi csi sensor power up process
Sandor Yu [Wed, 18 Nov 2015 03:43:59 +0000 (11:43 +0800)]
MLK-11832: MIPI CSI: Adjust mipi csi sensor power up process

Add s_stream interface for MIPI CSI and ov5647/ov5640 drivers.
Enable MIPI CSI sensor after MIPI CSI DPHY CLK enable
in case MIPI DPHY miss MIPI CSI sensor signal.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit 26d81b416be6e3af203d1254a3116dbcf39a5605)

7 years agoMLK-11859: dts: Fix imx7D mipi csi reset bit error
Sandor Yu [Tue, 17 Nov 2015 09:20:51 +0000 (17:20 +0800)]
MLK-11859: dts: Fix imx7D mipi csi reset bit error

There is a error in i.MX7D RM RevB.
Actually the register of SRC_MIPIPHY_RCR(src offset 0x28)
bit 1 for MIPI PHY Master Reset
bit 2 for MIPI PHY Slave Reset.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit 4f3128a79c023319c9e21690be866dc46a9d6816)

7 years agoMLK-11813 change the clock type of 'pre_periph_sel' on imx6sl
Bai Ping [Tue, 3 Nov 2015 16:51:34 +0000 (00:51 +0800)]
MLK-11813 change the clock type of 'pre_periph_sel' on imx6sl

The 'pre_periph2_sel' and 'pre_periph_clk' and other two clks
should have the ability to change its parent clk without disabling
itself first, so change the clk type of these clocks to make the
parent can be swithed without disabling the clock.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11803 pci: imx: imx6qp pcie ep self-test failed
Richard Zhu [Mon, 2 Nov 2015 03:41:02 +0000 (11:41 +0800)]
MLK-11803 pci: imx: imx6qp pcie ep self-test failed

imx pcie used the wrab mode to do the cached access
methods on axi bus. There is 64bytes address mis-aligned
problem.
Disable the cached operations.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 85db70336ab66136481926bcd7f5abe599e2aa4f)

7 years agoMLK-11765 video: mxsfb: change the fb buffer managment
Fancy Fang [Wed, 28 Oct 2015 09:16:01 +0000 (17:16 +0800)]
MLK-11765 video: mxsfb: change the fb buffer managment

The previous fb buffer management has two problems:

1. After reallocate a bigger buffer and free the old buffer,
   user space app doesn't know this and may continue accessing
   the old buffer.
2. The freed buffer contents will be lost.

So, this patch allocates a big enough fb buffer(32MB) from the
beginning and never reallocates it.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit c76a37e342369675aa9ef2efde6373d288c2f013)

Conflicts:
drivers/video/mxsfb.c

7 years agoMLK-11849: ARM: dts: fix the iomux issue in sai dts
Han Xu [Tue, 10 Nov 2015 20:19:53 +0000 (14:19 -0600)]
MLK-11849: ARM: dts: fix the iomux issue in sai dts

some issue was involved when merging the commit to kernel 4.1

Signed-off-by: Han Xu <b45815@freescale.com>
7 years agoMLK-11848-2 dma: imx-sdma: add __init for probe()
Robin Gong [Tue, 10 Nov 2015 10:29:01 +0000 (18:29 +0800)]
MLK-11848-2 dma: imx-sdma: add __init for probe()

Fix buiding error with GCC 4.6.2:

WARNING: drivers/dma/built-in.o(.text+0xefac): Section mismatch in reference from the function sdma_probe() to the function .init.text:sdma_event_remap.isra.21()
The function sdma_probe() references
the function __init sdma_event_remap.isra.21().
This is often because sdma_probe lacks a __init
annotation or the annotation of sdma_event_remap.isra.21 is wrong.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11848-1 spi: spi: Revert "spi: check tx_buf and rx_buf in spi_unmap_msg"
Robin Gong [Tue, 10 Nov 2015 10:06:53 +0000 (18:06 +0800)]
MLK-11848-1 spi: spi: Revert "spi: check tx_buf and rx_buf in spi_unmap_msg"

This commit 06634f8a25f4c5e4ff0c0ef5368a48eb394db63b cherry-picked wrong,
and that cause SPI DMA mode never works. Actually, no need this patch since
this patch has already been upsteaminged as below:

commit f8bb820da4ae863c676156627973a950129559fb
Author: Robin Gong <b38343@freescale.com>
Date:   Thu Apr 16 10:54:18 2015 +0800

    spi: check tx_buf and rx_buf in spi_unmap_msg

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11844-2 ARM: dts: imx7d: reserve DDR space for M4 use case
Anson Huang [Tue, 10 Nov 2015 11:12:55 +0000 (19:12 +0800)]
MLK-11844-2 ARM: dts: imx7d: reserve DDR space for M4 use case

FreeRTOS/M4 has DDR use case, M4 can only execute on DDR
space lower than 0xa0000000, Linux kernel will reserve 1M
(0x9ff00000 - 0x9fffffff) for it, below are the DDR usage:

0x80000000 - 0x9fefffff: Linux kernel;
0x9ff00000 - 0x9fffffff: FreeRTOS;
0xa0000000 - 0xbfefffff: Linux kernel;
0xbff00000 - 0xbfffffff: RPMSG shared memory;
0xc0000000 - 0xffffffff: Linux kernel if boards has 2GB DDR.

Also, remove 'reg' property which is unused.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-11844-1 ARM: dts: imx6sx: reserve DDR space for M4 use case
Anson Huang [Tue, 10 Nov 2015 11:05:02 +0000 (19:05 +0800)]
MLK-11844-1 ARM: dts: imx6sx: reserve DDR space for M4 use case

FreeRTOS/M4 has DDR use case, M4 can only execute on DDR
space lower than 0xa0000000, Linux kernel will reserve 1M
(0x9ff00000 - 0x9fffffff) for it, below are the DDR usage:

0x80000000 - 0x9fefffff: Linux kernel;
0x9ff00000 - 0x9fffffff: FreeRTOS;
0xa0000000 - 0xbfefffff: Linux kernel;
0xbff00000 - 0xbfffffff: RPMSG shared memory;
0xc0000000 - 0xffffffff: Linux kernel if boards has 2GB DDR.

Also, remove 'reg' property which is unused.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-11828-2 ARM: dts: reserve OCRAM space for M4
Anson Huang [Fri, 6 Nov 2015 10:46:35 +0000 (18:46 +0800)]
MLK-11828-2 ARM: dts: reserve OCRAM space for M4

FreeRTOS has use case of running on OCRAM, reserve the
bottom half of OCRAM spase(0x910000 - 0x91efff) for M4,
the last 4K is for shared memory power management.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-11828-1 ARM: dts: reserve OCRAM space for M4
Anson Huang [Fri, 6 Nov 2015 10:41:59 +0000 (18:41 +0800)]
MLK-11828-1 ARM: dts: reserve OCRAM space for M4

FreeRTOS has use case of running on OCRAM, reserve the
bottom half of OCRAM spase(0x910000 - 0x91ffff) for M4.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-11284 ARM: ERRATA: Add ARM/MP: 814220 SW workaround
Jason Liu [Fri, 24 Jul 2015 09:06:11 +0000 (17:06 +0800)]
MLK-11284 ARM: ERRATA: Add ARM/MP: 814220 SW workaround

ARM/MP: 814220—B-Cache maintenance by set/way operations can execute out of order.

Description:
The v7 ARM states that all cache and branch predictor maintenance operations
that do not specify an address execute, relative to each other, in program
order. However, because of this erratum, an L2 set/way cache maintenance
operation can overtake an L1 set/way cache maintenance operation, this would
cause the data corruption.

This ERRATA affected the Cortex-A7 and present in r0p2, r0p3, r0p4, r0p5.

This patch is the SW workaround by adding a DSB before changing cache levels as
the ARM ERRATA: ARM/MP: 814220 told in the ARM ERRATA documentation.

Signed-off-by: Jason Liu <r64343@freescale.com>
(cherry picked from commit 0e9a87bbd4f7d1c48e42c65aa94939a7283599dd)

Conflicts:
arch/arm/mach-imx/Kconfig

7 years agoMLK-11842 video: epdc: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'
Fancy Fang [Mon, 9 Nov 2015 08:23:28 +0000 (16:23 +0800)]
MLK-11842 video: epdc: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'

The 'CONFIG_PM_RUNTIME' has been eliminated and all the users
should use 'CONFIG_PM' directly. So do this change for epdc and
epdc-v2.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11841 dma: pxp: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'
Fancy Fang [Mon, 9 Nov 2015 08:19:15 +0000 (16:19 +0800)]
MLK-11841 dma: pxp: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'

The 'CONFIG_PM_RUNTIME' has been eliminated and all the users
should use 'CONFIG_PM' directly. So do this change for pxp-v2
and pxp-v3.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11840 video: mxsfb: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'
Fancy Fang [Mon, 9 Nov 2015 08:11:53 +0000 (16:11 +0800)]
MLK-11840 video: mxsfb: change 'CONFIG_PM_RUNTIME' to 'CONFIG_PM'

The 'CONFIG_PM_RUNTIME' has been eliminated and all the users
should use 'CONFIG_PM' directly. So do this change for mxsfb.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11838 ARM: dts: imx6sx: fix suspend/resume failed on i.mx6sx-sdb-reva board
Robin Gong [Mon, 9 Nov 2015 03:28:16 +0000 (11:28 +0800)]
MLK-11838 ARM: dts: imx6sx: fix suspend/resume failed on i.mx6sx-sdb-reva board

There is one ROM bug on i.mx6sx TO1.1 that default ROM code use the old
ocram space 0x900000, but it should be 0x8f8000. So SW workaround need to
be added, unfortunately, the 'romcp' device node not added in i.mx6sx dtsi
on v4.1, thus i.mx6sx-sdb-reva board will be failed to resume back, add them
back.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11831-2 usb: chipidea: imx: add request{release}_bus_freq
Peter Chen [Fri, 6 Nov 2015 07:33:17 +0000 (15:33 +0800)]
MLK-11831-2 usb: chipidea: imx: add request{release}_bus_freq

When the usb in idle, it calls release_bus_req.
When the usb is going to use, it calls request_bus_req.
This is a rework patch of ENGR00286459 and ENGR00286926.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11831-1 usb: chipidea: imx: Add dummy LDO2p5 regulator for VBUS wakeup
Ranjani Vaidyanathan [Fri, 6 Nov 2015 07:21:25 +0000 (15:21 +0800)]
MLK-11831-1 usb: chipidea: imx: Add dummy LDO2p5 regulator for VBUS wakeup

LDO2p5 cannot be disabled in low power idle mode when the USB driver
enables VBUS wakeup. To identify when LDO2p5 can be disabled add a dummy
regulator that the USB driver will enable when VBUS wakeup is required.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11829-3 ARM: dts: imx6qdl-sabresd: add egalax touch screen support
Haibo Chen [Fri, 6 Nov 2015 07:12:49 +0000 (15:12 +0800)]
MLK-11829-3 ARM: dts: imx6qdl-sabresd: add egalax touch screen support

Add egalax touch screen support for imx6qdl-sabresd board.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-11829-2 ARM: dts: imx6sx-sabreauto: add egalax touch screen support
Haibo Chen [Fri, 6 Nov 2015 06:00:16 +0000 (14:00 +0800)]
MLK-11829-2 ARM: dts: imx6sx-sabreauto: add egalax touch screen support

Add egalax touch screen support on i2c2 bus.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-11829-1 ARM: dts: imx6sx-sdb: add egalax touch screen support
Haibo Chen [Fri, 6 Nov 2015 05:47:39 +0000 (13:47 +0800)]
MLK-11829-1 ARM: dts: imx6sx-sdb: add egalax touch screen support

Add i2c2 bus and add egalax touch screen support on imx6sx-sdb board.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-11700 video: mxsfb: correct the fb pan display ret value
Fancy Fang [Wed, 14 Oct 2015 03:26:27 +0000 (11:26 +0800)]
MLK-11700 video: mxsfb: correct the fb pan display ret value

The fb_pan_display() return value should be corrected
according to the wait_for_completion_timeout() return
value.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit 459d01cbda39e51029c55e583909ef645037b7f3)

Conflicts:
drivers/video/mxsfb.c

7 years agoMLK-9817 spi: imx: convert all clk_enable to clk_prepare_enable
Bai Ping [Sat, 8 Nov 2014 13:35:26 +0000 (21:35 +0800)]
MLK-9817 spi: imx: convert all clk_enable to clk_prepare_enable

This is done in preperation for low power mode. Convert all clk_enable
to clk_prepare_enable and clk_disable to clk_disable_unprepare. Make sure
PLL3 power down when entering low power mode.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 1808b31fdae576e775159a05cde9b45e404bb6e2)

7 years agoMLK-11802-3 ARM: imx6ul-14x14-evk: Enable dual switch function for USB
Peter Chen [Fri, 30 Oct 2015 09:25:28 +0000 (17:25 +0800)]
MLK-11802-3 ARM: imx6ul-14x14-evk: Enable dual switch function for USB

Since we have supported control vbus through ID pin, we can
support dual switch function for otg port, but fully otg can't
be supported at this port.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
7 years agoMLK-11252-02 cpufreq: imx: add dc regulator in cpufreq driver
Bai Ping [Thu, 16 Jul 2015 11:08:28 +0000 (19:08 +0800)]
MLK-11252-02 cpufreq: imx: add dc regulator in cpufreq driver

In some i.MX6 board (i.MX6UL EVK), it will have a additional
GPIO controlled DC-DC regulator. we need to change this regulator's
voltage According the maximum frequency that CPU can run at.

At present, we only need to set the voltage to minimum one, we need
to set the voltage to the maximum before suspend, resume back to the
minimum voltage after suspend.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 31f0773ee7d6ba5715486a221857f2ceccb434b4)

7 years agoMLK-11252-01 ARM: imx: dts: add gpio regulator to control the dc-dc voltage on imx6ul...
Bai Ping [Thu, 16 Jul 2015 10:48:48 +0000 (18:48 +0800)]
MLK-11252-01 ARM: imx: dts: add gpio regulator to control the dc-dc voltage on imx6ul evk board

For the i.MX6UL EVK board, according to the latest schematic, use a GPIO pin along with
the 'PMIC_STBY_REQ' pin to control the DC-DC voltage output. the possible voltage output
as below:

PMIC_STBY_REQ = 0, GPIO_DVFS = 0, output is 1.4V (1.375V + 25mV) <Default>
PMIC_STBY_REQ = 0, GPIO_DVFS = 1, output is 1.3V (1.275V + 25mV)
PMIC_STBY_REQ = 1, GPIO_DVFS = 0, output is 0.925V (0.9V + 25mV)

In normal run mode, the voltage output should be changed using the 'GPIO_DVFS' pin,
so add gpio regulator to control it.

Signed-off-by: Bai Ping <b51503@freescale.com>
(cherry picked from commit 4517cf404b4e0cfb805a9d0c412b2f2839400d9b)

7 years agoMLK-11268-2 ARM: imx: disconnect vddhigh and vddsnvs in dsm for imx6ul
Anson Huang [Tue, 21 Jul 2015 16:40:00 +0000 (00:40 +0800)]
MLK-11268-2 ARM: imx: disconnect vddhigh and vddsnvs in dsm for imx6ul

Same as i.MX6SX, need to disconnect vddhigh and vddsnvs
in DSM on i.MX6UL, they have same design.

Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit f0c63b894a60512318481cb8a7b0777cdb7c46ab)

7 years agoMLK-11268-1 ARM: imx: disconnect vddhigh and vddsnvs in dsm for imx6sx
Anson Huang [Tue, 21 Jul 2015 16:36:38 +0000 (00:36 +0800)]
MLK-11268-1 ARM: imx: disconnect vddhigh and vddsnvs in dsm for imx6sx

per design team's recommendation, in DSM mode,
need to disconnect vddhigh and vddsnvs, add it for i.MX6SX.

i.MX6SX has different bit definition than i.MX6SL about this
bit in PMU_MISC0 register.

Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit ec42012c66961c357a1ed4c31d27f83a1db86611)

7 years agoMLK-11465-2: ARM: dts: imx7d/imx6ul: update SW1A for PFUZE3000
Robin Gong [Tue, 1 Sep 2015 01:58:02 +0000 (09:58 +0800)]
MLK-11465-2: ARM: dts: imx7d/imx6ul: update SW1A for PFUZE3000

Update max voltage of SW1A to 3.3V on PF3000, see below datasheet:
http://cache.freescale.com/files/analog/doc/data_sheet/PF3000.pdf?fsrch=1&sr=1&pageNum=1

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 5cd7d3c5933b052b899183a45fa4be8cdb2a0c69)

7 years agoMLK-11465-1: regulator: pfuze100: update voltage setting for SW1A of PF3000
Robin Gong [Tue, 1 Sep 2015 01:21:58 +0000 (09:21 +0800)]
MLK-11465-1: regulator: pfuze100: update voltage setting for SW1A of PF3000

Regards to the pfuze3000 doc update, regulator driver need to be updated too.
Otherwise the voltage information show wrongly.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit ac1992e3eab0d31195781bb7d1c4ff7ccea1c86a)

7 years agoMGS-1211 gpu: add GPU for 6sl,6sx,6dl
Shawn Xiao [Wed, 28 Oct 2015 06:38:58 +0000 (14:38 +0800)]
MGS-1211 gpu: add GPU for 6sl,6sx,6dl

Add the GPU configuration in the dtsi files for the above three SOCs.

date Oct 28, 2015

Signed-off-by: Shawn Xiao <b49994@freescale.com>
7 years agoMGS-1087 gpu: Move the GPU reserved memory to DTS file
Shawn Xiao [Mon, 19 Oct 2015 03:54:21 +0000 (11:54 +0800)]
MGS-1087 gpu: Move the GPU reserved memory to DTS file

Currently 128M reserved for GPU in all the i.MX6 boards that is
requiring kernel to allocate CMA 320M. For the low end devices like 6SX
and 6SL, the 320M is huge. Sometimes customer board may have very less
RAM.

With Kernel 4.1, there is a new feature CMA can be calculated at DTS
level based on the amount queried from different module drivers.So
moving the GPU memory to DTS is valid and can be configured for each
board.

And at the same time, also keep the option for user to configure the
parameters "contiguousBase and contiguousSize" in u-boot.

Signed-off-by: Shawn Xiao <b49994@freescale.com>
7 years agoMLK-11786 ARM: dts: imx6qp: correct vddcore regulator input
Anson Huang [Thu, 29 Oct 2015 14:03:32 +0000 (22:03 +0800)]
MLK-11786 ARM: dts: imx6qp: correct vddcore regulator input

On i.MX6QP SabreSD board, VDDCORE is from PFuze's SW2, this
is different from i.MX6QDL SabreSD board, which is from SW1A/B.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-10183 ASoC: wm8962: separate ALC Coefficients to four reigsters
Zidan Wang [Thu, 29 Oct 2015 09:26:14 +0000 (17:26 +0800)]
MLK-10183 ASoC: wm8962: separate ALC Coefficients to four reigsters

Attempt to read volatile register when cache_only is set will return
EBUSY. After playback/record, wm8962_runtime_suspend function will set
cache_only flag, so the volitale register ALC2 can't be read from cache.

Separate ALC Coefficients to four reigsters, the volatile register ALC2
will be read from hardware instead of cache.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 5ec8878be12530517b4c8ae307441a0ac16071a3)

7 years agoMLK-11779 sim: imx: set gpio active high
Gao Pan [Mon, 26 Oct 2015 04:58:25 +0000 (12:58 +0800)]
MLK-11779 sim: imx: set gpio active high

Sim card CVCC is determined by the gpio value from sim controller.
How the CVCC is controlled on both post card boards is decribed below.

NCN8025:Vcc=ACTIVE_HIGH?5V:3V
TDA8035:Vcc=ACTIVE_HIGH?5V:1.8V

Different sim cards have different CVCC range. To support all cards
with same dts, this patch set gpio active high.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11778 sim: imx: change pad settings to improve signal quality
Gao Pan [Wed, 21 Oct 2015 09:43:32 +0000 (17:43 +0800)]
MLK-11778 sim: imx: change pad settings to improve signal quality

Change pad settings to improve signal quality.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11777 sim: imx: remove useless code
Gao Pan [Thu, 22 Oct 2015 08:28:13 +0000 (16:28 +0800)]
MLK-11777 sim: imx: remove useless code

sim_activate() process is contained in the cold reset.
Thus, it is redundant and should be removed.

This patch also adds comments to cold reset process.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11789 mmc: sdhci: Add 1ms delay in eMMC tuning procedure
Haibo Chen [Thu, 29 Oct 2015 09:21:37 +0000 (17:21 +0800)]
MLK-11789 mmc: sdhci: Add 1ms delay in eMMC tuning procedure

On 4.1 kernel, some eMMC on i.MX7D-SDB board can't pass HS400 tuning,
the same eMMC can pass HS400 tuning on 3.14 kernel. The difference
is that 4.1 kernel does not have 1ms delay for eMMC during the
tuning procedure. The root cause still not find, add back the
1ms delay first.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-11781-2 dts: imx6ul-9x9-evk: fix uSDHC1 CD GPIO polarity
Dong Aisheng [Wed, 28 Oct 2015 08:33:17 +0000 (16:33 +0800)]
MLK-11781-2 dts: imx6ul-9x9-evk: fix uSDHC1 CD GPIO polarity

The default gpio flag is 0 which actually means ACTIVE_HIGH.
However, it should be ACTIVE_LOW.
Change it using correct macro directly.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-11781-1 dts: imx6ul-evk: add non-removable property for TF card
Dong Aisheng [Wed, 28 Oct 2015 08:24:59 +0000 (16:24 +0800)]
MLK-11781-1 dts: imx6ul-evk: add non-removable property for TF card

The TF card slot on uSDHC2 does not support CD function,
so add non-removable property.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-10629-4 mmc: sdhci: remove MMC_CAP_NEEDS_POLL
Dong Aisheng [Thu, 9 Apr 2015 08:23:24 +0000 (16:23 +0800)]
MLK-10629-4 mmc: sdhci: remove MMC_CAP_NEEDS_POLL

This will cause meaningless CPU overhead by polling the card at backgroud
if the CD is broken.
Most board does not intend to use this function, so remove it.
Platform driver could add it for test if needed.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Conflicts:
drivers/mmc/host/sdhci.c

7 years agoMGS-577 ARM: Export the cache management symbols when !MULTI_CACHE
Shawn Xiao [Fri, 17 Apr 2015 02:48:09 +0000 (10:48 +0800)]
MGS-577 ARM: Export the cache management symbols when !MULTI_CACHE

When compiling a GPU module without CONFIG_MULTI_CACHE enabled, the
compiler prompt warning which says symbol v7_dma_map_area and
v7_dma_flush_area not exported. And when insmod GPU module, it also
warns the above two symbols not found, which cause insmod module failed.

This patch export these dma access functions and fix these issues.

Signed-off-by: Shawn Xiao <b49994@freescale.com>
7 years agoMLK-11763-2 imx_v7_defconfig: add Broadcom bcmdhd driver support
Dong Aisheng [Thu, 12 Mar 2015 09:26:19 +0000 (17:26 +0800)]
MLK-11763-2 imx_v7_defconfig: add Broadcom bcmdhd driver support

Add Broadcom bcmdhd driver support.
BTW, the in kernel upstream brcmfmac driver is removed to avoid confusion.
And Atheros driver is also removed which is not supported anymore.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-11763-1 bcmdhd: make the driver work for 4.1 kernel
Dong Aisheng [Mon, 26 Oct 2015 10:42:43 +0000 (18:42 +0800)]
MLK-11763-1 bcmdhd: make the driver work for 4.1 kernel

Fixing a lot of compiling issues due to kernel upgrade and then
make it work on 4.1 kernel.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-11403: I2C: imx: restore pin setting for i2c
Gao Pan [Tue, 25 Aug 2015 06:00:32 +0000 (14:00 +0800)]
MLK-11403: I2C: imx: restore pin setting for i2c

restore pin setting for i2c in suspend/resume

Signed-off-by: Gao Pan <gaopan@freescale.com>
7 years agoMLK-11550-1: regulator: pfuze100: restore some registers after LPSR for pfuze3000
Robin Gong [Tue, 15 Sep 2015 04:46:39 +0000 (12:46 +0800)]
MLK-11550-1: regulator: pfuze100: restore some registers after LPSR for pfuze3000

Some registers on pfuze3000 will lost after exit from LPSR, need restore them,
otherwise system may reboot with below command after system enter LPSR one time:

root@imx7d_all:~# echo enabled > /sys/class/tty/ttymxc0/power/wakeup
root@imx7d_all:~# echo mem > /sys/power/state

because LDOGCTL not recover as 1. Add 'fsl,lpsr-mode' property to this case,
please add this property if your board support LPSR mode as imx7d-12x12-lpddr3-arm2
board.

Signed-off-by: Robin Gong <b38343@freescale.com>