]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agospi/bitbang: don't error out if there is no setup callback provided
Uwe Kleine-König [Thu, 8 Aug 2013 14:09:49 +0000 (16:09 +0200)]
spi/bitbang: don't error out if there is no setup callback provided

It's perfectly valid not to have a setup callback when the probe routine
does all the needed things. So don't even check for this case and trust
the caller.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-bitbang: Fix conversion of spi_bitbang_transfer_one()
Fabio Estevam [Wed, 17 Jul 2013 18:49:54 +0000 (15:49 -0300)]
spi: spi-bitbang: Fix conversion of spi_bitbang_transfer_one()

Since commit 2025172e3 (spi/bitbang: Use core message pump), the following
kernel crash is seen:

Unable to handle kernel NULL pointer dereference at virtual address 0000000d
pgd = 80004000
[0000000d] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 1 PID: 48 Comm: spi32766 Not tainted 3.11.0-rc1+ #4
task: bfa3e580 ti: bfb90000 task.ti: bfb90000
PC is at spi_bitbang_transfer_one+0x50/0x248
LR is at spi_bitbang_transfer_one+0x20/0x248
...

,and also the following build warning:

drivers/spi/spi-bitbang.c: In function 'spi_bitbang_start':
drivers/spi/spi-bitbang.c:436:31: warning: assignment from incompatible pointer type [enabled by default]

In order to fix it, we need to change the first parameter of
spi_bitbang_transfer_one() to 'struct spi_master *master'.

Tested on a mx6qsabrelite by succesfully probing a SPI NOR flash.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/bitbang: Use core message pump
Mark Brown [Fri, 5 Jul 2013 19:07:27 +0000 (20:07 +0100)]
spi/bitbang: Use core message pump

Convert drivers using bitbang to use the core mesasge pump infrastructure,
saving some code and meaning that these drivers get to take advantage of
work done on improving the core implementation.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/bitbang: Factor out message transfer from message pump loop
Mark Brown [Fri, 5 Jul 2013 11:06:44 +0000 (12:06 +0100)]
spi/bitbang: Factor out message transfer from message pump loop

In order to make it easier to convert to transfer_one_message() lift the
code that does the actual message transfer out of the work function that
implements the message pump. This should have no functional impact, it's
just a simple code motion patch.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/bitbang: Unexport spi_bitbang_transfer()
Mark Brown [Fri, 5 Jul 2013 10:44:49 +0000 (11:44 +0100)]
spi/bitbang: Unexport spi_bitbang_transfer()

Currently no drivers use the ability to override spi_bitbang_transfer()
and if any started this would make it harder to convert the bitbang code
to use transfer_one_message() so remove the export in order to prevent
anyone starting.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/imx: expose module alias for loading from device-tree
Niels de Vos [Mon, 29 Jul 2013 07:38:05 +0000 (09:38 +0200)]
spi/imx: expose module alias for loading from device-tree

Enable auto loading by udev when spi-imx is compiled as a module.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-imx: Check the return value from clk_prepare_enable()
Fabio Estevam [Thu, 11 Jul 2013 04:26:49 +0000 (01:26 -0300)]
spi: spi-imx: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

While at it, fix the order of clk_disable_unprepare calls: clk_ipg should be
disabled first, followed by clk_per.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-imx: Use devm functions
Fabio Estevam [Thu, 11 Jul 2013 04:26:48 +0000 (01:26 -0300)]
spi: spi-imx: Use devm functions

Using devm functions can make the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-imx: Fix compilation error
Sachin Kamat [Thu, 30 May 2013 08:08:09 +0000 (13:38 +0530)]
spi: spi-imx: Fix compilation error

Fix compilation error due to a typo introduced by commit 24778be20f
("spi: convert drivers to use bits_per_word_mask"). Without this patch
we get the following build errors:

drivers/spi/spi-imx.c: In function ‘spi_imx_setupxfer’:
drivers/spi/spi-imx.c:703:2: warning: no return statement in function returning non-void [-Wreturn-type]
drivers/spi/spi-imx.c: At top level:
drivers/spi/spi-imx.c:705:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token
drivers/spi/spi-imx.c:707:2: error: expected identifier or ‘(’ before ‘return’
drivers/spi/spi-imx.c:708:1: error: expected identifier or ‘(’ before ‘}’ token

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: convert drivers to use bits_per_word_mask
Stephen Warren [Wed, 22 May 2013 02:36:35 +0000 (20:36 -0600)]
spi: convert drivers to use bits_per_word_mask

Fill in the recently added spi_master.bits_per_word_mask field in as
many drivers as possible. Make related cleanups, such as removing any
redundant error-checking, or empty setup callbacks.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-imx: Let device core handle pinctrl
Fabio Estevam [Mon, 6 May 2013 18:05:55 +0000 (15:05 -0300)]
spi: spi-imx: Let device core handle pinctrl

Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for handling pinctrl.

So remove devm_pinctrl_get_select_default() from the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: remove unnecessary platform_set_drvdata()
Jingoo Han [Fri, 3 May 2013 07:27:12 +0000 (16:27 +0900)]
spi: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00284019: [iMX6SL] Add low power mode optimizations
Ranjani Vaidyanathan [Wed, 16 Oct 2013 19:06:50 +0000 (14:06 -0500)]
ENGR00284019: [iMX6SL] Add low power mode optimizations

Add optimizations so that the low power IDLE mode numbers match
between the 3.10.9 and 3.0.35 kernel.
Optimizations include:
1. Disable unused PLLs and PFDs in clock init
2. Some of the drivers call clk_prepare in probe and enable much
later. clk_pllv3_prepare locks the PLL disallowing some of the low
power optimizations. For iMX6SL ensure that clk_pllv3_prepare does
not lock the PLL.
3. Ensure that MMDC_CH0_LPM_HS is set when WAIT mode is entered.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agommc: sdhci: remove unneeded call when have preset value quirk
Dong Aisheng [Fri, 18 Oct 2013 11:48:50 +0000 (19:48 +0800)]
mmc: sdhci: remove unneeded call when have preset value quirk

Remove unneeded call of call sdhci_enable_preset_value when having
SDHCI_QUIRK2_PRESET_VALUE_BROKEN.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add preset value quirk for mx6
Dong Aisheng [Mon, 21 Oct 2013 08:57:07 +0000 (16:57 +0800)]
mmc: sdhci-esdhc-imx: add preset value quirk for mx6

The i.MX6 does not support preset value feature.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: enable SDR50 tuning for imx6q/dl
Dong Aisheng [Fri, 18 Oct 2013 11:48:48 +0000 (19:48 +0800)]
mmc: sdhci-esdhc-imx: enable SDR50 tuning for imx6q/dl

The imx6q/dl supports SDR50 tunning, enable it for a better timing
on SDR50 mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add delay line setting support
Dong Aisheng [Mon, 21 Oct 2013 08:54:40 +0000 (16:54 +0800)]
mmc: sdhci-esdhc-imx: add delay line setting support

The DLL(Delay Line) is newly added to assist in sampling read data.
The DLL provides the ability to programmatically select a quantized
delay (in fractions of the clock period) regardless of on-chip variations
such as process, voltage and temperature (PVT).

This patch adds a user interface to set slave delay line via device tree.
It's usually used in high speed mode like mmc DDR mode when the signal
quality is not good caused by board design, e.g. the signal path is too
long.  User can manually set delay line to find a suitable data sampling
window for card to work properly.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add DDR mode support for mx6
Dong Aisheng [Mon, 21 Oct 2013 07:27:40 +0000 (15:27 +0800)]
mmc: sdhci-esdhc-imx: add DDR mode support for mx6

When DDR mode is enabled, the initial pre_div should be 2.
And the pre_div value should be changed accordingly
from
...
02h) Base clock divided by 4
01h) Base clock divided by 2
00h) Base clock divided by 1
to
..
02h) Base clock divided by 8
01h) Base clock divided by 4
00h) Base clock divided by 2

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci: report error once the maximum tuning loops exhausted or timeout
Dong Aisheng [Fri, 18 Oct 2013 11:48:45 +0000 (19:48 +0800)]
mmc: sdhci: report error once the maximum tuning loops exhausted or timeout

The original code missed to report an error when the maximum tuning
loops exhausted or timeout, it will cause the upper layer to wrongly
think the tuning process is passed.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: fix reading cap_1 register value for mx6sl
Dong Aisheng [Fri, 18 Oct 2013 11:48:44 +0000 (19:48 +0800)]
mmc: sdhci-esdhc-imx: fix reading cap_1 register value for mx6sl

When reading CAP_1 register for mx6sl, ignore bit[0-15] as it stores
CAP_2 register value which is new introduced in mx6sl.

Without this fix, the max clock for mx6sl may not be correct since
it's wrongly calculated by reading CAP_1 register.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add std tuning support for mx6sl
Dong Aisheng [Mon, 21 Oct 2013 07:25:45 +0000 (15:25 +0800)]
mmc: sdhci-esdhc-imx: add std tuning support for mx6sl

The mx6sl supports standard sdhci tuning, then esdhc_executing_tuning
is only needed for mx6q/dl. We introduce is_imx6_usdhc() and
is_imx6sl_usdhc() to handle the difference.

The standard tuning is enabled by setting ESDHC_TUNE_CTRL_STD_TUNING_EN bit
in new register ESDHC_TUNE_CTRL and operates with new tuning bits
defined in SDHCI_ACMD12_ERR register.

Note: mx6sl can also work on the old manually tuning mode as mx6q/dl if
not enable standard tuning mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: create struct esdhc_soc_data
Shawn Guo [Thu, 17 Oct 2013 07:19:47 +0000 (15:19 +0800)]
mmc: sdhci-esdhc-imx: create struct esdhc_soc_data

Create a struct esdhc_soc_data with moving 'flags' field from
pltfm_imx_data into it, and pass the pointer of this SoC specific data
structure through of_device_id.data directly, so that the translation
from enum imx_esdhc_type to flags can be saved.

With the change, enum imx_esdhc_type can be eliminated, since we can
implement the is_imx*_esdhc() by checking the esdhc_soc_data pointer.
The unused is_imx35_esdhc() and is_imx51_esdhc() are also removed, and the
others are kept there as we will need to use them to handle some small
register differences later, where use of new flags might be a little
overkilled.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: pdev->id_entry should be immutable
Shawn Guo [Thu, 17 Oct 2013 07:19:46 +0000 (15:19 +0800)]
mmc: sdhci-esdhc-imx: pdev->id_entry should be immutable

As a good practice, device driver should not modify pdev->id_entry but
keep it immutable.  Let's assign of_device_id.data with imx_esdhc_type
constants directly, so that we do not have to manipulate pdev->id_entry
in .probe().

As the result, sdhci-esdhc-imx53 and sdhci-usdhc-imx6q can be removed
from platform_device_id table now, since they will only probe from
device tree.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add flag ESDHC_FLAG_USDHC
Dong Aisheng [Mon, 21 Oct 2013 07:23:31 +0000 (15:23 +0800)]
mmc: sdhci-esdhc-imx: add flag ESDHC_FLAG_USDHC

Add flag ESDHC_FLAG_USDHC to tell that the ESDHC is actually an USDHC
block, and replace the is_imx6q_usdhc() occurrences with inline function
esdhc_is_usdhc() which checks the flag.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agommc: sdhci-esdhc-imx: add flag ESDHC_FLAG_ENGCM07207
Shawn Guo [Thu, 17 Oct 2013 07:19:44 +0000 (15:19 +0800)]
mmc: sdhci-esdhc-imx: add flag ESDHC_FLAG_ENGCM07207

Just like the use of the flag ESDHC_FLAG_MULTIBLK_NO_INT, let's add
another flag ESDHC_FLAG_ENGCM07207 to enable the workaround for errata
ENGcm07207 and set the flag for i.MX25 and i.MX35 ESDHC.

While at it, let's use BIT() macro for ESDHC_FLAG_MULTIBLK_NO_INT as
well.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Chris Ball <chris@printf.net>
10 years agoARM: dts: imx6sl: add pinctrl uhs states for usdhc
Dong Aisheng [Tue, 17 Sep 2013 08:25:44 +0000 (16:25 +0800)]
ARM: dts: imx6sl: add pinctrl uhs states for usdhc

This is needed for SD3.0 cards working on UHS mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoENGR00284180-2 ARM: dts: imx6sl-evk: enable the SPI NOR
Huang Shijie [Thu, 17 Oct 2013 08:57:10 +0000 (16:57 +0800)]
ENGR00284180-2 ARM: dts: imx6sl-evk: enable the SPI NOR

enable the spi nor for imx6sl-evk boards.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00284180-1 ARM: dts: imx6sl: add a pinctrl for ECSPI1
Huang Shijie [Thu, 17 Oct 2013 08:51:49 +0000 (16:51 +0800)]
ENGR00284180-1 ARM: dts: imx6sl: add a pinctrl for ECSPI1

add a pinctrl for ECSPI1. This pinctrl can be used in the imx6sl-evk board.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00283508-6 arm: dts: imx6sl: support hog pins sleep mode
Anson Huang [Mon, 14 Oct 2013 19:33:58 +0000 (15:33 -0400)]
ENGR00283508-6 arm: dts: imx6sl: support hog pins sleep mode

As i.MX6SL EVK board is very sensitive to DSM power, so we
need to lower IO power of hog pins:

MX6SL_PAD_KEY_ROW5__GPIO4_IO03
MX6SL_PAD_KEY_COL6__GPIO4_IO04
MX6SL_PAD_LCD_RESET__GPIO2_IO19

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283508-5 pinctrl: imx: support pin sleep mode in suspend
Anson Huang [Mon, 14 Oct 2013 19:32:48 +0000 (15:32 -0400)]
ENGR00283508-5 pinctrl: imx: support pin sleep mode in suspend

When system suspend, need to switch pwm pin to sleep mode,
this is to save IO power. Using pinctrl mode switch framework
to make it happen.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283508-4 arm: dts: imx6sl: support kpp pin sleep mode
Anson Huang [Mon, 14 Oct 2013 19:20:52 +0000 (15:20 -0400)]
ENGR00283508-4 arm: dts: imx6sl: support kpp pin sleep mode

Improve those kpp pins pad setting with no_pad_ctrl defined,
actually they are using default pad setting, to support pin
mode switch, we need to set them manually.

As i.MX6SL EVK board is very sensitive to DSM power, so we
need to lower IO power of KPP pins:

MX6SL_PAD_KEY_ROW0__KEY_ROW0
MX6SL_PAD_KEY_ROW1__KEY_ROW1
MX6SL_PAD_KEY_ROW2__KEY_ROW2
MX6SL_PAD_KEY_COL0__KEY_COL0
MX6SL_PAD_KEY_COL1__KEY_COL1
MX6SL_PAD_KEY_COL2__KEY_COL2

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283508-3 keyboard: imx: support pin sleep mode in suspend
Anson Huang [Mon, 14 Oct 2013 19:19:20 +0000 (15:19 -0400)]
ENGR00283508-3 keyboard: imx: support pin sleep mode in suspend

When system suspend, need to switch keyboard pins to sleep mode,
this is to save IO power. Using pinctrl mode switch framework
to make it happen.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283508-2 arm: dts: imx6sl: support pwm pin sleep mode
Anson Huang [Mon, 14 Oct 2013 19:07:51 +0000 (15:07 -0400)]
ENGR00283508-2 arm: dts: imx6sl: support pwm pin sleep mode

As i.MX6SL EVK board is very sensitive to DSM power, so we
need to lower IO power of PWM pin:

MX6SL_PAD_PWM1__GPIO3_IO23

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283508-1 pwm: imx: support pin sleep mode in suspend
Anson Huang [Mon, 14 Oct 2013 19:06:15 +0000 (15:06 -0400)]
ENGR00283508-1 pwm: imx: support pin sleep mode in suspend

When system suspend, need to switch pwm pin to sleep mode,
this is to save IO power. Using pinctrl mode switch framework
to make it happen.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoserial: imx: optimization: remove the workqueues for DMA
gregkh@linuxfoundation.org [Thu, 17 Oct 2013 20:16:04 +0000 (13:16 -0700)]
serial: imx: optimization: remove the workqueues for DMA

I worried that the delay of the sdma_run_channel0() maybe too long for
interrupt context, so I added the workqueues for RX/TX DMA.

But tested with bluetooth device, I find that the delay of sdma_run_channel0()
is about 8us (tested in imx6dl sabreauto board). I think the delay
is acceptable.

This patch removes the RX/TX workqueues for DMA, it makes the
code more clear.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoENGR00283496 ARM: clk: imx6sl: update epdc pixel clock tree
Robby Cai [Mon, 14 Oct 2013 03:32:25 +0000 (11:32 +0800)]
ENGR00283496 ARM: clk: imx6sl: update epdc pixel clock tree

Add CLK_SET_RATE_PARENT flag for epdc pixel clock to allow the rate change
operation to propagate up to the clock's parent in order to get desired rate.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoserial: imx: use the dmaengine_tx_status
Huang Shijie [Fri, 11 Oct 2013 02:12:12 +0000 (10:12 +0800)]
serial: imx: use the dmaengine_tx_status

Use the dmaengine_tx_status to simplify the code, do not change any logic.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: imx: fix the wrong number of scatterlist entries when xmit->head is 0
Huang Shijie [Fri, 11 Oct 2013 07:39:07 +0000 (15:39 +0800)]
serial: imx: fix the wrong number of scatterlist entries when xmit->head is 0

When the (xmit->tail > xmit->head) is true and the xmit->head is 0,
we only need one DMA scatterlist in actually. Current code uses two DMA
scatterlists in this case, this is obviously wrong.

This patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: imx: check the DMA for imx_tx_empty
Huang Shijie [Thu, 10 Oct 2013 07:05:16 +0000 (15:05 +0800)]
serial: imx: check the DMA for imx_tx_empty

Assume the following situation:

  If the DMA is enabled, and the a TX DMA operation is working,
But we have not issued the TX DMA operation (or we have issued the
TX DMA operation with dma_async_issue_pending(), but the DMA has not
started to move the data from the memory to the TXFIFO).

At this time, we may get the wrong status of the transmitter when we
call the imx_tx_empty. In such situation, only check the USR2_TXDC
does not enough for us.

This patch checks the DMA's situation, and return 0 when the TX DMA is
working.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: imx: implement the flush_buffer hook
Huang Shijie [Wed, 9 Oct 2013 07:13:23 +0000 (15:13 +0800)]
serial: imx: implement the flush_buffer hook

The current driver does not implement the flush_buffer hook for
uart_ops. When we enable the DMA for the driver, and test it with Bluetooth,
we may meet the following bug for TX:

    [1] User application may call the flush operation at any time.
        The uart_flush_buffer() calls the uart_circ_clear() to set
        the xmit->head and xmit->tail with 0.

    [2] The TX DMA callback can be called at any time too.
        The dma_tx_call() will update the xmit->tail.

    If [2] occurs just after the [1], we will get the wrong xmit->tail.

This patch implements the flush_buffer hook to fix this issue.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoENGR00281769 [iMX6SL] Allow uart to be sourced from 24MHz XTAL
Ranjani Vaidyanathan [Tue, 15 Oct 2013 17:36:42 +0000 (12:36 -0500)]
ENGR00281769 [iMX6SL] Allow uart to be sourced from 24MHz XTAL

In order to optmize low power IDLE numbers all PLLs should be in bypass.
On imx6sl, UART can be sourced directly from the 24MHz XTAL. Its frequency
is limited to 4MHz due to an internal divide by 6 divider.
For customer who don't require higher uart speeds add "uart_at_4M"
to the kernel command line.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoahci: imx: setup power saving methods
Richard Zhu [Tue, 15 Oct 2013 02:44:54 +0000 (10:44 +0800)]
ahci: imx: setup power saving methods

In order to save power consumption as much as possible.

* Disable sata phy internal pll reference clock when sysetem enter
  into suspend mode, enable it after resume.

* Setup module parameter used to enable imx ahci test power down
  mode(PDDQ) or not, when there is no device detected on the port

* minor modifications:
  - The format of the copyright is changed, because that the original
    one can't pass fsl internal patch reivew without the character
    '(c)'.
  - Exports ahci_platform_ops and ahci_error_handler().

NOTE:
* The hot-plug can't be supported when PDDQ mode is ever enabled.

* module parameter usage how-to:
  - default: enable PDDQ mode when no device detected.
  - add "ahci-imx.hotplug=1" into kernel command line if your don't
    want to enable PDDQ mode when no device detected on the port.

tj: Slightly updated description and comments.

Signed-off-by: Richard Zhu <r65037@freescale.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
10 years agoENGR00283480 imx_v7_defconfig: enable MLB150 module
Luwei Zhou [Sat, 12 Oct 2013 07:53:48 +0000 (15:53 +0800)]
ENGR00283480 imx_v7_defconfig: enable MLB150 module

Add MLB150 module support in imx_v7_defconfig

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00283475 mxc: mlb : add MLB150 driver support.
Luwei Zhou [Sat, 12 Oct 2013 05:59:59 +0000 (13:59 +0800)]
ENGR00283475 mxc: mlb : add MLB150 driver support.

This patch add MLB150 driver support.Copy files from 3.0.35 kernel.

* Using of_xxx API to get resource from dts
* Using devm_xxx API to simply the code
* Change clk_enable()/clk_disable() to clk_prepare_enable()/
  clk_disable_unprepare()
* Fix some warning when compiling
* Fix issue when handling errors in mxc_mlb150_probe()
* Remove declaration of gpio_mlb_active(), gpio_mlb_inactive()
  out of mxc_mlb.h, because the functions are not invoked.
* Add UAPI support.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00283470 ARM: dts: imxqdl-sabreauto: add dts support for MLB150
Luwei Zhou [Sat, 12 Oct 2013 05:48:13 +0000 (13:48 +0800)]
ENGR00283470 ARM: dts: imxqdl-sabreauto: add dts support for MLB150

This patch add MLB150 dts support on SabreAuto.The PAD setting
is aligned to 3.0.35 kernel.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00283540-02: net: fec: use pinctrl PM helpers
Fugang Duan [Mon, 14 Oct 2013 08:52:32 +0000 (16:52 +0800)]
ENGR00283540-02: net: fec: use pinctrl PM helpers

when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00283540-01 dts:imx6sl: add fec sleep pinctrl for pin PM state
Anson Huang [Sat, 12 Oct 2013 17:35:12 +0000 (13:35 -0400)]
ENGR00283540-01 dts:imx6sl: add fec sleep pinctrl for pin PM state

when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agodrivers: pinctrl sleep and idle states in the core
Linus Walleij [Wed, 5 Jun 2013 13:30:33 +0000 (15:30 +0200)]
drivers: pinctrl sleep and idle states in the core

If a device have sleep and idle states in addition to the
default state, look up these in the core and stash them in
the pinctrl state container.

Add accessor functions for pinctrl consumers to put the pins
into "default", "sleep" and "idle" states passing nothing but
the struct device * affected.

Solution suggested by Kevin Hilman, Mark Brown and Dmitry
Torokhov in response to a patch series from Hebbar
Gururaja.

Cc: Hebbar Gururaja <gururaja.hebbar@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoENGR00283216 media: imx6sl: add runtime pm support for busfreq
Robby Cai [Tue, 8 Oct 2013 07:25:38 +0000 (15:25 +0800)]
ENGR00283216 media: imx6sl: add runtime pm support for busfreq

add runtime pm implementation for eLCDIF/EPDC/PxP

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00281186 dmaengine: pxp: not fetch data from AS buffer if it's not used
Robby Cai [Wed, 25 Sep 2013 05:35:46 +0000 (13:35 +0800)]
ENGR00281186 dmaengine: pxp: not fetch data from AS buffer if it's not used

There's no explicit BIT in PxP register to disable AS buffer.
The right way to disable AS is to set ULC to a higher value than the LRC.
It has been done once in probe time, but not in run time.
This could cause one potential problem because even when ULC, LRC
and buffer address is set to 0 PxP will still fetch one pixel data from addr 0.
This patch fixes it by set ULC higher than LRC for AS if it's not used (i.e.,
no alpha-blending) at run time.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00277792 video: mxsfb: Enable pan display function
Sandor Yu [Fri, 27 Sep 2013 07:36:10 +0000 (15:36 +0800)]
ENGR00277792 video: mxsfb: Enable pan display function

- Add interrupt handle thread for vsync and frame done irq.
- Support MXCFB_WAIT_FOR_VSYNC call to get vsync signal
  in fb_ioctl function.
- Add flip_sem semaphore to check last frame done interrupt
  in pan display function.
- Add cur_blank variable to record current blank state.
- Move register_framebuffer function after lcdif controller
 enabled, struct of fb_info and lcdif controller should ready
 to work before register_framebuffer.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00265935 net: fec: add pm_qos to avoid cpu enter to wait mode
Fugang Duan [Fri, 11 Oct 2013 08:36:48 +0000 (16:36 +0800)]
ENGR00265935 net: fec: add pm_qos to avoid cpu enter to wait mode

Since imx6q/dl enet cannot wake up wait mode, which cause performance
drops. Add pm_qos to request low cpu latency to avoid enter to wait mode.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00283192 Avoid vpu rmmod failure and modprobe warning
Hongzhang Yang [Thu, 10 Oct 2013 03:12:06 +0000 (11:12 +0800)]
ENGR00283192 Avoid vpu rmmod failure and modprobe warning

- Avoid vpu rmmod failure caused by regulator free failure
  Do not call regulator_put because regulators returned from
  devm_regulator_get are automatically regulator_put() on
  driver detach

- Avoid vpu modprobe warning caused by unbalanced pm_runtime_enable
  Add missing call to pm_runtime_disable

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
10 years agoENGR00283037 [gpu]Avoid gpu rmmod failure caused by regulator free failure
Loren HUANG [Wed, 9 Oct 2013 08:33:39 +0000 (16:33 +0800)]
ENGR00283037 [gpu]Avoid gpu rmmod failure caused by regulator free failure

The failure is caused by duplicate regulator resource free.
New devm_xxx API will free the resource automatically after remove()
is called.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Shawn Guo
10 years agoserial: imx: Change cast to handle 64-bit resource_size_t
Olof Johansson [Thu, 12 Sep 2013 04:27:53 +0000 (21:27 -0700)]
serial: imx: Change cast to handle 64-bit resource_size_t

This resolves a warning where resource_size_t is larger than void *:

  drivers/tty/serial/imx.c:1542:6: warning: cast to pointer from integer
   of different size [-Wint-to-pointer-cast]

Since iomem_base is a void *, casting to unsigned long is safe.

It's unclear to me that this comparison is truly needed, but it's there
on several other drivers as well.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoserial: imx: Use NULL as the last argument of add_preferred_console()
Fabio Estevam [Mon, 2 Sep 2013 01:24:35 +0000 (22:24 -0300)]
serial: imx: Use NULL as the last argument of add_preferred_console()

Commit f7d2c0bbd (serial: i.MX: evaluate linux,stdout-path property) introduced
the following sparse warning:

drivers/tty/serial/imx.c:1916:77: warning: Using plain integer as NULL pointer

Pass NULL as the last argument of add_preferred_console() instead of zero.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00161643-3 UTP : bugfix
Huang Shijie [Tue, 8 Nov 2011 09:39:35 +0000 (17:39 +0800)]
ENGR00161643-3 UTP : bugfix

The origin code lossed one line.
fix it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00160834 UTP : replace kzalloc() with vmalloc()
Huang Shijie [Wed, 26 Oct 2011 09:31:25 +0000 (17:31 +0800)]
ENGR00160834 UTP : replace kzalloc() with vmalloc()

When allocating large memory, such as 128K,
vmalloc() uses single page for the allocation process,
while kzalloc() has to consume a continuous pages for the allocation.

In low memory case, the kzalloc() may fails.
So use the vmalloc() instead.

Also add some sanity check for the NULL pointer.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00140950 mfg: fix the bug that ubiformat utility breaks utp protocol
Peter Chen [Tue, 22 Mar 2011 09:27:17 +0000 (17:27 +0800)]
ENGR00140950 mfg: fix the bug that ubiformat utility breaks utp protocol

ubiformat includes command, data, command periods,
it breaks utp protocol for PUT commands. So we add two operations to fix it.
One is sending busy to host before the data periods begins.
The second is adding a new command to waiting ubiformat's command period.

Signed-off-by: Li Xingyu <b02754@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00217717 mfgtool firmware will crash during mfgtool running
Tony LIU [Fri, 20 Jul 2012 02:11:06 +0000 (10:11 +0800)]
ENGR00217717 mfgtool firmware will crash during mfgtool running

- the root cause of this issue is there is no protection for
  the resource which will be accessed by multiple thread

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
10 years agoENGR00280494-2 Add config for mfgtools
Frank Li [Thu, 3 Oct 2013 19:51:58 +0000 (14:51 -0500)]
ENGR00280494-2 Add config for mfgtools

Build in USB Mass storage
Enable CONFIG_FSL_UTP

Must list all gadgets in config file
otherwise CONFIG_USB_MASS_STORAGE becomes to m

+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_ETH is not set
+# CONFIG_USB_G_NCM is not set
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FUNCTIONFS is not set
+CONFIG_USB_MASS_STORAGE=y
+CONFIG_FSL_UTP=y
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+# CONFIG_USB_G_ACM_MS is not set
+# CONFIG_USB_G_MULTI is not set
+# CONFIG_USB_G_HID is not set
+# CONFIG_USB_G_DBGP is not set
+# CONFIG_USB_G_WEBCAM is not set

Signed-off-by: Frank Li <Frank.li@freescale.com>
10 years agoENGR00280494-1 make the kernel image for mfgtool
Frank Li [Wed, 28 Aug 2013 21:02:06 +0000 (16:02 -0500)]
ENGR00280494-1 make the kernel image for mfgtool

uboot needs pass down below parameters
removable = 1
stall = 0
idVendor = 0x066F
idProduct = 0x37FF
iSerialNumber = ""

Signed-off-by: Lu Lin <b37454@freescale.com>
Signed-off-by: Frank Li<frank.li@freescale.com>
10 years agoASoC: fsl_spdif: Remove redundant semicolon
Sachin Kamat [Fri, 13 Sep 2013 10:22:42 +0000 (15:52 +0530)]
ASoC: fsl_spdif: Remove redundant semicolon

Redundant semicolon at the end of brace is removed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoASoC: fsl_spdif: Select regmap-mmio
Mark Brown [Sun, 8 Sep 2013 16:20:37 +0000 (17:20 +0100)]
ASoC: fsl_spdif: Select regmap-mmio

The S/PDIF driver needs regmap so select it to make sure it gets
included in the build.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00281859-3 ASoC: fsl: Prepare dmaengine before submit it
Nicolin Chen [Tue, 8 Oct 2013 08:39:39 +0000 (16:39 +0800)]
ENGR00281859-3 ASoC: fsl: Prepare dmaengine before submit it

ASRC and HDMI audio might meet unexpected stop, 'ctrl+z' for example,
and then disable its sdma channel. But after 'fg' resume, because sdma
channel's status has already been set into DMA_ERROR, we need to prepare
dmaengine again to clear its error state, otherwise sdma driver would
bypass its channel enabling and 'Input/Output error' would happen to
ALSA lib.
The combined prepare and submit are also being used in soc-dmaengine,
the common ASoC dmaengine driver.

And since we already use a proper way to handle sdma channel status,
there's no need to make an exception for HDMI any more, so drop it.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00281859-2 ASoC: fsl: Use priv instead of params for imx-hdmi-dma
Nicolin Chen [Tue, 8 Oct 2013 07:41:21 +0000 (15:41 +0800)]
ENGR00281859-2 ASoC: fsl: Use priv instead of params for imx-hdmi-dma

'params' might be confused with snd_pcm_hw_params, so use 'priv' instead.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00281859-1 mxc: asrc: Add debug message for asrc_isr()
Nicolin Chen [Tue, 8 Oct 2013 04:41:08 +0000 (12:41 +0800)]
ENGR00281859-1 mxc: asrc: Add debug message for asrc_isr()

asrc_isr() is mainly used to detect and record overload error,
so we add some print massage to make it easy to debug.

Also fixed an incorrect function name -- dev_debug() by using
the correct one -- dev_dbg() in dump_regs().

Signed-off-by: Nicolin Chen <B42378@freescale.com>
10 years agoENGR00281017 [MX6SL]Low power IDLE mode optimizations
Ranjani Vaidyanathan [Fri, 20 Sep 2013 15:36:00 +0000 (10:36 -0500)]
ENGR00281017 [MX6SL]Low power IDLE mode optimizations

Added a new bus freq mode - ultra_low_bus_freq_mode.
In this mode the ARM is the only bus master that is active and
the system is already in low power idle mode.
And when ARM executes WFI in this mode, we do some aggressive
power savings techinques like:
1. Drop DDR freq to 1MHz
2. Drop AHB freq to 3MHz
3. Float the DDR IO pads
4. If all PLLs are in bypass (which should be the case), do
some analog power saving options like reducing the OSC-bias current,
turning off the regular bandgap, disabling the regular 2P5, enabling
the weak 2p5 etc.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00281804 ARM: imx6: init enet MAC address
Fugang Duan [Sun, 29 Sep 2013 09:40:31 +0000 (17:40 +0800)]
ENGR00281804 ARM: imx6: init enet MAC address

Enet get MAC address order:
From module parameters or kernel command line -> device tree ->
pfuse -> mac registers set by bootloader -> random mac address.

When there have no "fec.macaddr" parameters set in kernel command
line, enet driver get MAC address from device tree. And then if
the MAC address set in device tree and is valid, enet driver get
MAC address from device tree. Otherwise,enet get MAC address from
pfuse. So, in the condition, update the MAC address (read from pfuse)
to device tree.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00279948 net: fec: add clock control to save power
Fugang Duan [Sun, 29 Sep 2013 06:56:16 +0000 (14:56 +0800)]
ENGR00279948 net: fec: add clock control to save power

- After probe, disable all clocks incluing ipg, ahb, enet_out, ptp clock.
- Open ethx interface enable necessary clocks.
  Close ethx interface disable all clocks.
- Correct the MDIO clock source.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00281789-02 ARM: dts: imx6sl: correct the enet ipg clock
Fugang Duan [Sun, 29 Sep 2013 06:52:43 +0000 (14:52 +0800)]
ENGR00281789-02 ARM: dts: imx6sl: correct the enet ipg clock

Current imx6sl dts define enet_ref clock as ipg clock, which is not
right. The ipg clock is "IMX6SL_CLK_ENET" defined at imx6sl-clock.h.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00281789-01 imx6sl: add missing enet clock for imx6sl
Fugang Duan [Sun, 29 Sep 2013 06:48:06 +0000 (14:48 +0800)]
ENGR00281789-01 imx6sl: add missing enet clock for imx6sl

There's a enet clock gate missing in clock tree, thus add it.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00280852 ASoC: fsl: Use generic function dmaengine_prep_dma_cyclic()
Nicolin Chen [Fri, 27 Sep 2013 09:04:53 +0000 (17:04 +0800)]
ENGR00280852 ASoC: fsl: Use generic function dmaengine_prep_dma_cyclic()

Use generic dmaengine_prep_dma_cyclic() in imx-hdmi-dma.c and fsl-asrc.c

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-9 mxc: asrc: Use threshold to clear dma request
Nicolin Chen [Thu, 26 Sep 2013 10:22:00 +0000 (18:22 +0800)]
ENGR00280852-9 mxc: asrc: Use threshold to clear dma request

Previously, we used sdma's event pending to forcibly re-schedule sdma
for work round, because sdma channel for ASRC input task would fail to
be opened due to its dma request always keeping high after ASRC opens
the pair, which cause sdma miss the trigger point of dma request.

Now, instead of using event pending, we clear the dma request on ASRC
driver side by setting its thresholds to an impossible trigger area
during its stall state. Since ASRC would stall its process when input
fifo is near empty or output fifo is near full, during the stall state,
the specific thresholds, 0 for input fifo and 63 for output fifo, would
never let asrc meet this condition. So dma request can be cleared and
raised again after we restore the true required thresholds.

Accordingly, since we don't need event pending any more, we dropped the
code from the sdma driver.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-8 mxc: asrc: Add polling mode working without dma for debugging
Nicolin Chen [Wed, 25 Sep 2013 11:10:58 +0000 (19:10 +0800)]
ENGR00280852-8 mxc: asrc: Add polling mode working without dma for debugging

Add polling mode for data transmitting without dma support for debugging when
sdma may have issue.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-7 mxc: asrc: Only set ASRC to STALL level in start_conv()
Nicolin Chen [Wed, 25 Sep 2013 10:22:33 +0000 (18:22 +0800)]
ENGR00280852-7 mxc: asrc: Only set ASRC to STALL level in start_conv()

We don't need to set ASRC to STALL level everytime, instead we only need
to do that at the beginning. If we insert null data into input fifo during
the sequence of valid datas, there would be a noise occur to it.

By doing this, we can assure ASRC would keep each period's perturbation of
output dma task within 8 sample sizes, which is the default value for last
period number. Thus we don't need to expand the last period number any more.

This patch also dropped some unused functions since the driver no long needs
them and replaced wrapped function for channel number configuration with direct
regmap_update_bits() to make the driver clean.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-6 mxc: asrc: Use devtype instead of specific DT properties
Nicolin Chen [Wed, 25 Sep 2013 07:16:44 +0000 (15:16 +0800)]
ENGR00280852-6 mxc: asrc: Use devtype instead of specific DT properties

We can determine the IP version from DT compatible name to decide which
clock map and channel bits should be used.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-5 mxc: asrc: Simplify code
Nicolin Chen [Tue, 24 Sep 2013 11:41:35 +0000 (19:41 +0800)]
ENGR00280852-5 mxc: asrc: Simplify code

* Dropped unused header files.
* Use pair-explicit error massage.
* Fixed some coding style issue.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-4 mxc: asrc: Use completion instead of counter
Nicolin Chen [Tue, 24 Sep 2013 10:27:34 +0000 (18:27 +0800)]
ENGR00280852-4 mxc: asrc: Use completion instead of counter

Use completion instead of counter to make driver clean and drop
implicit mdelay by using wait_for_completion().

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-3 mxc: asrc: Use regmap to control register accessing
Nicolin Chen [Tue, 24 Sep 2013 10:13:41 +0000 (18:13 +0800)]
ENGR00280852-3 mxc: asrc: Use regmap to control register accessing

Dropped the legency readl/writel() and use regmap instead. Also removed
core clock's clk_prepare() and spin_lock()/unlock() outside regmap due to
regmap already has these features.

This patch also added a missing writable register to the regmap in order
to assure the regsiter updating success.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-2 arm: dtsi: imx6qdl: Set sdma priority of ASRC to medium
Nicolin Chen [Tue, 24 Sep 2013 03:05:50 +0000 (11:05 +0800)]
ENGR00280852-2 arm: dtsi: imx6qdl: Set sdma priority of ASRC to medium

Set the priority as what kernel 3.0.35 does to keep it safe.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00280852-1 mxc: asrc: Add spba clock control for sdma shp script
Nicolin Chen [Tue, 24 Sep 2013 03:01:37 +0000 (11:01 +0800)]
ENGR00280852-1 mxc: asrc: Add spba clock control for sdma shp script

ASRC is using shp_2_mcu and mcu_2_shp sdma scripts that use spba bus to
transfer data, while the driver hasn't include the control code of spba
clock.

This would cause multiple pair conversion failed in most of time. Thus
we need to add its support.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoregmap: Make regmap-mmio usable from atomic contexts
Lars-Peter Clausen [Fri, 24 May 2013 08:29:22 +0000 (10:29 +0200)]
regmap: Make regmap-mmio usable from atomic contexts

regmap-mmio uses a spinlock with spin_lock() and spin_unlock() for locking.
To be able to use the regmap API from different contexts (atomic vs non-atomic),
without the risk of race conditions, we need to use spin_lock_irqsave() and
spin_lock_irqrestore() instead. A new field, the spinlock_flags field, is added
to regmap struct to store the flags between regmap_{,un}lock_spinlock(). The
spinlock_flags field itself is also protected by the spinlock.

Thanks to Stephen Warren for the suggestion of this particular solution.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00281613 imx_v7_defconfig: enable net VLAN 802.1Q
Fugang Duan [Fri, 27 Sep 2013 07:33:36 +0000 (15:33 +0800)]
ENGR00281613 imx_v7_defconfig: enable net VLAN 802.1Q

Enable net VLAN 8021Q in imx_v7_defconfig.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00281611 i2c: imx: update i2c clock divider for each transaction
Fugang Duan [Fri, 27 Sep 2013 07:13:19 +0000 (15:13 +0800)]
ENGR00281611 i2c: imx: update i2c clock divider for each transaction

i.MX6 I2C clk is from IPG_PERCLK which is sourced from IPG_CLK.
Under normal operation, IPG_CLK is 66MHz, ipg_perclk is at 22MHz.
In low bus freq mode, IPG_CLK is at 12MHz and IPG_PERCLK is down
to 4MHz. So the I2C driver must update the divider register for
each transaction when the current IPG_PERCLK is not equal to the
clock of previous transaction.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00281446 ARM: dts: imx6: correct the power supply node name for epdc
Robby Cai [Thu, 26 Sep 2013 09:57:18 +0000 (17:57 +0800)]
ENGR00281446 ARM: dts: imx6: correct the power supply node name for epdc

The naming convention for power supply node in DTS is "%s-supply".
With this patch regulator_get() will process in the DT way rather than
traditional way. This patch has no functional impact.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00279204-2 mxc vout: reconfig overlay fb correctly
Liu Ying [Thu, 26 Sep 2013 06:11:08 +0000 (14:11 +0800)]
ENGR00279204-2 mxc vout: reconfig overlay fb correctly

The overlay framebuffer's position and resolution are
set with two different APIs. They depend on each other to
make sure the overlay framebuffer window will not go out
of the background framebuffer window. Potentially, this
causes the overlay framebuffer's position or resolution
of the current video pipeline be impacted by the settings
of the last time. To setup the overlay fb from scratch
correctly, this patch takes the following steps:
- blank framebuffer
- set framebuffer position to the starting point
- reconfigure framebuffer
- set framebuffer position to a specific point
- unblank framebuffer
This procedure applies to non-overlay framebuffers as well.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00279204-1 mxc vout: reconfig fb when necessary
Liu Ying [Thu, 26 Sep 2013 05:41:17 +0000 (13:41 +0800)]
ENGR00279204-1 mxc vout: reconfig fb when necessary

Users may call VIDIOC_S_CTRL or VIDIOC_S_CROP ioctrls
to update streaming parameters on-the-fly after video
has been streamed on, such as for rotation/output
resolution/overlay output position change. Any
unnecessary frame buffer reconfiguration would cause
a pair of frame buffer blank/unblank events happen and
even makes the background framebuffer show up for a
short period of time if the video is rendered on an
overlay framebuffer. This patch compares the last time
video output pipe line settings with the current ones
to determine whether frame buffer reconfiguration is
necessary or not.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00279946 dts: imx6qdl-sabreauto: add baseboard sd card slot support
Dong Aisheng [Wed, 25 Sep 2013 12:04:43 +0000 (20:04 +0800)]
ENGR00279946 dts: imx6qdl-sabreauto: add baseboard sd card slot support

NOTE since SD Card in main board takes a long route hence with
Drive Speed High 80 OHMS causing error on high speed cards.
Per suggestion DSE 40 OHMS is used.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00280140 pxp/v4l2: restore the display content after video playback finishes
Robby Cai [Sun, 22 Sep 2013 09:31:06 +0000 (17:31 +0800)]
ENGR00280140 pxp/v4l2: restore the display content after video playback finishes

After finish video playback, the last frame remains on the display.
It's because the UI display start address (smem_start) has been changed when
do video playback but not changed back again after the playback finishes.
From the function call point of view,

 pxp_set_fbinfo()         // pxp->fb.base tracks right addr for UI framebuffer
 pxp_show_buf(toshow)     // smem_start changed to v4l2 display addr
 pxp_set_fbinfo()         // pxp->fb.base changed to v4l2 display addr
 pxp_show_buf(not toshow) // smem_start still equal to v4l2 display addr
                          // for pan_display

This patch fixes it by calling pxp_set_fbinfo once in open function.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00281036: [MX6SL]Align LPDDR2 freq change code to 8-byte boundary
Ranjani Vaidyanathan [Tue, 24 Sep 2013 21:06:34 +0000 (16:06 -0500)]
ENGR00281036: [MX6SL]Align LPDDR2 freq change code to 8-byte boundary

This patch fixes 4 issues:
1. Add the .align 8 directive to the LPDDR2 freq change code,
else the fncpy() function fails and the kernel does not boot.
2. Loads the correct L2_BASE_ADDR into register in lpddr2 freq change code
3. Fix the warning in clk_imx6sl.c
4. Change dev_WARN to dev_info in busfreq-imx6.c.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00280689-02 i.MX6 HDMI: Remove HDCP register define from driver
Sandor Yu [Mon, 23 Sep 2013 06:21:23 +0000 (14:21 +0800)]
ENGR00280689-02 i.MX6 HDMI: Remove HDCP register define from driver

Remove HDCP register define from HDMI kernel driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00280689-01 i.MX6 HDMI: Remove HDCP register access from driver
Sandor Yu [Mon, 23 Sep 2013 06:20:11 +0000 (14:20 +0800)]
ENGR00280689-01 i.MX6 HDMI: Remove HDCP register access from driver

Remove HDCP register access from HDMI driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00280000 ARM: dts: imx6qdl-sabreauto: add dts files for ECSPI support
Huang Shijie [Mon, 23 Sep 2013 08:45:48 +0000 (16:45 +0800)]
ENGR00280000 ARM: dts: imx6qdl-sabreauto: add dts files for ECSPI support

The ecspi1 has pin conflict with the i2c3.
This patch adds two dts files for the ECSPI support.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00280663-3 mxc vout: handle downsize ratio overflow
Liu Ying [Sun, 22 Sep 2013 04:45:29 +0000 (12:45 +0800)]
ENGR00280663-3 mxc vout: handle downsize ratio overflow

This patch handles downsize ratio overflow error by doing
input cropping with 8 pixel step.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00280663-2 IPUv3 device: check downsize ratio overflow
Liu Ying [Sun, 22 Sep 2013 04:37:39 +0000 (12:37 +0800)]
ENGR00280663-2 IPUv3 device: check downsize ratio overflow

IPUv3 IC task downsize scaling ratio cannot exceed or be
equal to 8:1. This patch makes the code return error code
if the ratio overflows.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00280663-1 IPUv3: improve IC scale check logic
Liu Ying [Sun, 22 Sep 2013 02:34:24 +0000 (10:34 +0800)]
ENGR00280663-1 IPUv3: improve IC scale check logic

This patch improves IPU IC task scale check logic
so that we may return with error code if the calculation
for scale coefficients fails.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00280101-3 [iMX6x] Add support for bypass mode rates
Ranjani Vaidyanathan [Tue, 17 Sep 2013 22:14:05 +0000 (17:14 -0500)]
ENGR00280101-3 [iMX6x] Add support for bypass mode rates

Fix the code to report correct PFD and PLL clock rates when
the PLL is in bypass state.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00280101-2 [iMX6SL/iMX6DL] Add busfreq support
Ranjani Vaidyanathan [Tue, 17 Sep 2013 22:13:05 +0000 (17:13 -0500)]
ENGR00280101-2 [iMX6SL/iMX6DL] Add busfreq support

Change dtsi files to enable busfreq support.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00280101-1 [iMX6SL] Add busfreq support
Ranjani Vaidyanathan [Tue, 17 Sep 2013 22:09:48 +0000 (17:09 -0500)]
ENGR00280101-1 [iMX6SL] Add busfreq support

Add support to scale the DDR frequency between 400MHz and 24MHz.
Add support to scale AHB between 132MHz and 24MHz.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>