]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoARM: imx: Add the secondary request into the structure for imx-sdma
Nicolin Chen [Tue, 29 Jul 2014 10:08:52 +0000 (18:08 +0800)]
ARM: imx: Add the secondary request into the structure for imx-sdma

SDMA supports device to device (per_2_per) scripts to handle DMA transfering
between two peripheral devices. The per_2_per script, however, needs two dma
requests from two sides while the current structure only defined one request.

So this patch just simply adds the secondary request so as to let SDMA and
its user to add its implementation later.

[ Both change in the SDMA driver and its users like Freescale ASRC ASoC driver
  should be taken along with this change in order to truly support per_2_per
  sciprts. However, we here make an expediency by adding this first so that
  we can add either side later since this patch won't break any function and
  meanwhile it can make merge window more smoothly: we don't need to apply the
  change inside dmaengine branch via ASoC tree any more. -- Nicolin ]

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 94b912e42829b25d97b6b1f2be66c6aa81ac125f)

9 years agodmaengine: imx-sdma: Add a new DMATYPE for Shared Peripheral ASRC
Nicolin Chen [Mon, 16 Jun 2014 03:31:05 +0000 (11:31 +0800)]
dmaengine: imx-sdma: Add a new DMATYPE for Shared Peripheral ASRC

Shared Peripheral ASRC, running on SPBA, needs to use shp sciprts for
DMA transfer. So this patch just adds a new DMATYPE for it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit f892afb07eeecf575179c4747952644a82a92a36)

9 years agoENGR00275483-1 ARM: imx6q: clk: add video 27m clock
Liu Ying [Fri, 16 Aug 2013 05:44:42 +0000 (13:44 +0800)]
ENGR00275483-1 ARM: imx6q: clk: add video 27m clock

This patch adds the fixed factor video 27m clock in
the imx6q clock driver. This clock's parent clock
is the pll3_pfd1_540m clock.

Conflicts:

Documentation/devicetree/bindings/clock/imx6q-clock.txt
arch/arm/mach-imx/clk-imx6q.c

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 922c6a032581cfe0aff45d7495fd7816b55c2f39)

9 years agoENGR00319487-2 ARM: dts: imx6dl: Add LDB support
Liu Ying [Fri, 20 Jun 2014 08:57:45 +0000 (16:57 +0800)]
ENGR00319487-2 ARM: dts: imx6dl: Add LDB support

It's a device tree source porting from imx_3.10.y regarding to LDB
support for i.MX6DL.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoENGR00319487-1 ARM: dts: imx6qdl: correct "ldb_di1" clk source for IPU1
Liu Ying [Fri, 20 Jun 2014 08:56:08 +0000 (16:56 +0800)]
ENGR00319487-1 ARM: dts: imx6qdl: correct "ldb_di1" clk source for IPU1

This patch fixes a typo to correct "ldb_di1" clk source for IPU1.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoENGR00319456-2 cpufreq: imx6: correct regulator API
Anson Huang [Fri, 20 Jun 2014 06:01:46 +0000 (14:01 +0800)]
ENGR00319456-2 cpufreq: imx6: correct regulator API

for PU regulator, if we do NOT want a dummy regulator
returned when there is no PU regulator available,
devm_regulator_get_optional should be used instead
of devm_regulator_get.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00319456-1 regulator: core: remove incorrect change of regulator_get
Anson Huang [Fri, 20 Jun 2014 05:59:55 +0000 (13:59 +0800)]
ENGR00319456-1 regulator: core: remove incorrect change of regulator_get

If user do NOT want a dummy regulator returned when
there is no matching regulator found, then they should use
regulator_get_optional instead of regulator_get. So remove
incorrect change.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00319243-1 ARM: imx: add DSM support for i.mx6sx
Anson Huang [Thu, 19 Jun 2014 06:07:26 +0000 (14:07 +0800)]
ENGR00319243-1 ARM: imx: add DSM support for i.mx6sx

Add DSM support for i.MX6SX.

To enter DSM, echo mem > /sys/power/state.
To exit DSM, using RTC alarm or enable debug UART wakeup.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years ago[media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call
Ma Haijun [Thu, 27 Mar 2014 11:07:06 +0000 (08:07 -0300)]
[media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call

The second argument should be physical address rather than virtual address.

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[shawn.guo: cherry-pick commit 29f1cdb0d0f2 from upstream]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00273974-2 ARM: dts: imx6qdl-sabresd: enable mxc vout
Liu Ying [Mon, 5 Aug 2013 07:48:11 +0000 (15:48 +0800)]
ENGR00273974-2 ARM: dts: imx6qdl-sabresd: enable mxc vout

Enable the mxc vout for imx6q{dl}-sabresd boards.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
[shawn.guo: cherry-pick commit d95a5ef6bbca from imx_3.10.y]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00318913-7 ARM: imx: add cpufreq support for i.mx6sx
Anson Huang [Thu, 19 Jun 2014 02:36:47 +0000 (10:36 +0800)]
ENGR00318913-7 ARM: imx: add cpufreq support for i.mx6sx

Enable cpufreq support for i.MX6SX, currently three setpoints
are supported, the freq/volt table are as below:

        VDDARM_CAP      VDDSOC_CAP
996M:   1.250V          1.175V
792M:   1.175V          1.175V
396M:   1.075V          1.175V

All upper voltages are 25mV higher then the minimum value defined
in datasheet, this 25mV is to cover board level IR drop.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-6 regulator: get_regulator should return fail if no device found
Anson Huang [Thu, 19 Jun 2014 02:34:31 +0000 (10:34 +0800)]
ENGR00318913-6 regulator: get_regulator should return fail if no device found

If there is no device matched, get_regulator should just return
fail instead of using a dummy regulator.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-5 cpufreq: imx6: remove pu regulator dependency
Anson Huang [Thu, 19 Jun 2014 01:01:58 +0000 (09:01 +0800)]
ENGR00318913-5 cpufreq: imx6: remove pu regulator dependency

PU regulator is not a necessary regulator for cpufreq, not all
i.MX6 SoCs have PU regulator, so remove the dependency to support
i.MX6SX which has NO PU regulator.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-4 thermal: imx: enable devfreq cooling
Anson Huang [Wed, 18 Jun 2014 08:59:39 +0000 (16:59 +0800)]
ENGR00318913-4 thermal: imx: enable devfreq cooling

Enable devfreq cooling to trigger GPU freq change when
hot trip is reached.

Make sure thermal driver loaded after cpufreq is loaded,
otherwise, cpu_cooling will not get valid cpufreq table,
hence cpu_cooling will be not working.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-3 thermal: imx: enable thermal support for i.mx6sx
Anson Huang [Wed, 18 Jun 2014 05:04:23 +0000 (13:04 +0800)]
ENGR00318913-3 thermal: imx: enable thermal support for i.mx6sx

i.MX6SX has some new feature of thermal interrupt function,
there is LOW, HIGH and PANIC irq for thermal sensor, so add
platform data to separate different thermal version;

The reset value of LOW ALARM is 0 which means the highest
temp, so the LOW ALARM will be triggered once irq is enabled,
so we need to set them to correct setting before enabling
thermal irq;

Enable PANIC ALARM as critical trip point, it will trigger
system reset via SRC module once PANIC IRQ is triggered.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-2 thermal: imx: make thermal trip temp changeable
Anson Huang [Wed, 18 Jun 2014 03:21:45 +0000 (11:21 +0800)]
ENGR00318913-2 thermal: imx: make thermal trip temp changeable

Make all thermal trips' temp changeable:

1. Different users may have different definitions about the
   trip temp;
2. For testing purpose, if we want to test cooling device's
   function, it is easy to change trip temp to cheat the cooling
   device to active, otherwise, need to test it using heating box
   which is very inconvenient

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-1 thermal: imx: update trip temp using default setting
Anson Huang [Wed, 18 Jun 2014 03:09:47 +0000 (11:09 +0800)]
ENGR00318913-1 thermal: imx: update trip temp using default setting

Previously, the critical and passive trip temp settings are from
calibration data of hot point, but the lastest chips are only
calibrated at 25C and use an universal formula to get real temp,
so there is no longer a hot point value in calibration data, need
to set the critical and passive trip temp manually instead of
getting them from calibration data.

Currently the default setting for passive trip temp is 85 C, and
critical trip temp is 20 C higher than passive trip temp, which
is 105 C.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318931-2 Enable VPU driver on kernel 3.14
Hongzhang Yang [Wed, 18 Jun 2014 05:50:40 +0000 (13:50 +0800)]
ENGR00318931-2 Enable VPU driver on kernel 3.14

- Add vpu node
- Add "power-domains" property instead of "pu-supply"

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
9 years agoENGR00318931-1 Enable VPU driver on kernel 3.14
Hongzhang Yang [Wed, 18 Jun 2014 05:40:44 +0000 (13:40 +0800)]
ENGR00318931-1 Enable VPU driver on kernel 3.14

Kernel 3.14 manages regulator using generic power domain which is covered by
pm_runtime API.

- Don't use PU regulator API
- Use pm_runtime API only

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
9 years agoENGR00318895-13 ARM: dts: imx6sx-sdb: enable the qspi2
Huang Shijie [Wed, 18 Jun 2014 01:57:26 +0000 (09:57 +0800)]
ENGR00318895-13 ARM: dts: imx6sx-sdb: enable the qspi2

By adding the pinctrl_qspi2_1 and the DT node "qspi2", this patch enables
the qspi2 for imx6sx-sdb board.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-12 mtd: spi-nor: add DDR quad read flag for s25fl128s
Huang Shijie [Wed, 18 Jun 2014 02:01:50 +0000 (10:01 +0800)]
ENGR00318895-12 mtd: spi-nor: add DDR quad read flag for s25fl128s

This patch adds the DDR quad read flag for s25fl128s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-11 mtd: fsl-quadspi: add DDR quad read support for Micron
Huang Shijie [Fri, 25 Apr 2014 05:51:15 +0000 (13:51 +0800)]
ENGR00318895-11 mtd: fsl-quadspi: add DDR quad read support for Micron

Add DDR quad read opcode and LUT sequence for Micron N25Q256A.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-10 mtd: spi-nor: add DDR quad read support for Micron
Huang Shijie [Fri, 25 Apr 2014 05:40:19 +0000 (13:40 +0800)]
ENGR00318895-10 mtd: spi-nor: add DDR quad read support for Micron

This patch adds the DDR(or DTR) quad read support for the Micron
SPI NOR flash.

Tested with n25q256a.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-9 mtd: spi-nor: add more read transfer flags for n25q256a
Huang Shijie [Fri, 25 Apr 2014 05:24:55 +0000 (13:24 +0800)]
ENGR00318895-9 mtd: spi-nor: add more read transfer flags for n25q256a

The NOR flash can supports dual/quad/ddr-quad read.
Add more flags for these read transfers.

From the datasheet, the chip support the 64K sector erase operation.
So remove the SECT_4K for the chip which makes the flash_erase faster.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-8 mtd: fsl-quadspi: add the DDR quad read support for Spansion NOR
Huang Shijie [Wed, 23 Apr 2014 02:20:35 +0000 (10:20 +0800)]
ENGR00318895-8 mtd: fsl-quadspi: add the DDR quad read support for Spansion NOR

Add the DDR quad read support for the fsl-quadspi driver.

Check the "spi-nor,ddr-quad-read-dummy" DT property, if the DT node is exit,
it means we could enable the DDR quad read.

 (1) Test this patch with imx6sx-sdb board (Spansion s25fl128s)
     The clock rate is 66MHz.

 (2) The information of NOR flash:
     -----------------------------------------------
     root@imx6qdlsolo:~# mtdinfo /dev/mtd0
     mtd0
     Name:                           21e4000.qspi
     Type:                           nor
     Eraseblock size:                65536 bytes, 64.0 KiB
     Amount of eraseblocks:          256 (16777216 bytes, 16.0 MiB)
     Minimum input/output unit size: 1 byte
     Sub-page size:                  1 byte
     Character device major/minor:   90:0
     Bad blocks are allowed:         false
     Device is writable:             true
     -----------------------------------------------

 (3) Test this patch set with UBIFS & bonnie++:
     -----------------------------------------------
ubiattach /dev/ubi_ctrl -m 0
ubimkvol /dev/ubi0 -N test -m
mount -t ubifs ubi0:test tmp
bonnie++ -d tmp -u 0 -s 10 -r 5
     -----------------------------------------------

 (4) Test this patch with mtd_speedtest.ko

     root@imx6qdlsolo:~# insmod mtd_speedtest.ko dev=0
     =================================================
     mtd_speedtest: MTD device: 0
     mtd_speedtest: not NAND flash, assume page size is 512 bytes.
     mtd_speedtest: MTD device size 16777216, eraseblock size 65536, page size 512,
                    count of eraseblocks 256, pages per eraseblock 128, OOB size 0
     mtd_speedtest: testing eraseblock write speed
     mtd_speedtest: eraseblock write speed is 665 KiB/s
     mtd_speedtest: testing eraseblock read speed
     mtd_speedtest: eraseblock read speed is 49799 KiB/s
     mtd_speedtest: testing page write speed
     mtd_speedtest: page write speed is 662 KiB/s
     mtd_speedtest: testing page read speed
     mtd_speedtest: page read speed is 24236 KiB/s
     mtd_speedtest: testing 2 page write speed
     mtd_speedtest: 2 page write speed is 657 KiB/s
     mtd_speedtest: testing 2 page read speed
     mtd_speedtest: 2 page read speed is 32637 KiB/s
     mtd_speedtest: Testing erase speed
     mtd_speedtest: erase speed is 518 KiB/s
     mtd_speedtest: Testing 2x multi-block erase speed
     mtd_speedtest: 2x multi-block erase speed is 506 KiB/s
     mtd_speedtest: Testing 4x multi-block erase speed
     mtd_speedtest: 4x multi-block erase speed is 503 KiB/s
     mtd_speedtest: Testing 8x multi-block erase speed
     mtd_speedtest: 8x multi-block erase speed is 501 KiB/s
     mtd_speedtest: Testing 16x multi-block erase speed
     mtd_speedtest: 16x multi-block erase speed is 498 KiB/s
     mtd_speedtest: Testing 32x multi-block erase speed
     mtd_speedtest: 32x multi-block erase speed is 496 KiB/s
     mtd_speedtest: Testing 64x multi-block erase speed
     mtd_speedtest: 64x multi-block erase speed is 495 KiB/s
     mtd_speedtest: finished
     =================================================

  (5) Conclusion:
     The DDR quad read could be 49799 KiB/s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-7 mtd: fsl-quadspi: use the information stored in spi-nor{}
Huang Shijie [Tue, 22 Apr 2014 09:47:14 +0000 (17:47 +0800)]
ENGR00318895-7 mtd: fsl-quadspi: use the information stored in spi-nor{}

We can get the read/write/erase opcode from the spi nor framework now.
What's more is that we can get the correct dummy cycles.

This patch uses the information stored in the spi_nor{} to remove the
hardcode in the fsl_qspi_init_lut().

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 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>
9 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>
9 years agoENGR00318895-4 mtd: spi-nor: add DDR quad read support
Huang Shijie [Tue, 22 Apr 2014 07:37:30 +0000 (15:37 +0800)]
ENGR00318895-4 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.

Test this patch for Spansion s25fl128s NOR flash.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-3 mtd: spi-nor: add a new field for spi_nor{}
Huang Shijie [Thu, 24 Apr 2014 09:53:52 +0000 (17:53 +0800)]
ENGR00318895-3 mtd: spi-nor: add a new field for spi_nor{}

We need the SPI NOR child node to store some specific features, such as the
dummy cycles for the DDR Quad read.

But now, we only have the @dev field in the spi_nor{}. The @dev may points to a
spi_device{} for m25p80, while it may points to a platform_deivice{} for the
SPI NOR controller, such as fsl_quadspi.c.

It is not convenient for us to get come information from the SPI NOR flash.

This patch adds a new field @np to spi_nor{}, it points to the child node for
the SPI NOR flash.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-2 mtd: spi-nor: fix the wrong dummy value
Huang Shijie [Wed, 16 Apr 2014 08:18:19 +0000 (16:18 +0800)]
ENGR00318895-2 mtd: spi-nor: fix the wrong dummy value

For the DDR Quad read, the dummy cycles maybe 3 or 6 which is less then 8.
The dummy cycles is actually 8 for SPI fast/dual/quad read.

This patch makes preparations for the DDR quad read, it fixes the wrong dummy
value for both the spi-nor.c and m25p80.c.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-1 mtd: spi-nor: read 6 bytes for the ID
Huang Shijie [Mon, 14 Apr 2014 10:09:34 +0000 (18:09 +0800)]
ENGR00318895-1 mtd: spi-nor: read 6 bytes for the ID

Currently, we read 5 bytes for ID, but s25fl128s has the same ext_id(0x4d01)
with s25fl129p1. The s25fl128s can support the DDR Quad read, while s25fl129p1
does not. So we have to distinguish the two NOR flashs.

This patch reads out 6 bytes for the ID, and use the 6 bytes ID to search the
right flash_info.

The detail of the patch is:
  [1] change the "ext_id" from u16 to u32.
      We can store two bytes or three bytes with the @ext_id now.

  [2] search the right flash_info with the 6byte ID and the new @ext_id.
      We use "matched" variable to track the legacy two bytes @ext_id.
      If the flash_info's @ext_id is three bytes, we will use the
      sixth byte of the ID to check it.

  [3] add the new item to spi_nor_ids for s25fl128s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()
Timur Tabi [Fri, 13 Jun 2014 12:42:40 +0000 (07:42 -0500)]
ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()

do_div() requires that the first parameter is a 64-bit integer,
which but clkrate was defined as an unsigned long.  This caused
the following warnings:

 CC      sound/soc/fsl/fsl_ssi.o
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':
sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer types lacks a cast
sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type
sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type
include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'long unsigned int *'

Signed-off-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit acf2c60a60b3d6d7080854b9483f37d99ded9b23)
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
9 years agoASoC: fsl_spdif: Add support for output sample rates 96kHz and 192kHz
Anssi Hannula [Sun, 15 Jun 2014 23:56:42 +0000 (02:56 +0300)]
ASoC: fsl_spdif: Add support for output sample rates 96kHz and 192kHz

Add support for the output sample rates 96kHz and 192kHz.

Tested with a Cubox-i imx6 system and an Onkyo TX-SR607 receiver.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c7dfeed10928f00f8c99ad3b58a4f4c5cfd7c581)

9 years agoASoC: fsl_spdif: Improve coding style
Nicolin Chen [Tue, 6 May 2014 08:42:25 +0000 (16:42 +0800)]
ASoC: fsl_spdif: Improve coding style

1) Apply better indentations
2) Drop braces for single statement.
3) Use simpler ternary to reduce code.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f3a30baa2876f910cbfb15b9a7442bacd8437e9d)

9 years agoENGR00303418 mtd: fsl-quadspi: set AHB transfer size to the maximum value
Allen Xu [Fri, 14 Mar 2014 15:48:21 +0000 (10:48 -0500)]
ENGR00303418 mtd: fsl-quadspi: set AHB transfer size to the maximum value

Set AHB transfer size to 1K which significantly improved the read
performance.

Add ahb_buf_size field in fsl_qspi_devtype_data to denote the size for
different SoC.

Before:

root@imx6qdlsolo:~# dd if=/dev/mtd1 of=/dev/null bs=1M count=16
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.472183 s, 35.5 MB/s

After:

root@imx6qdlsolo:~# dd if=/dev/mtd1 of=/dev/null bs=1M count=16
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 0.369439 s, 45.4 MB/s

Signed-off-by: Allen Xu <b45815@freescale.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00303533 mtd: fsl-quadspi: reset the module in the probe
Huang Shijie [Fri, 14 Mar 2014 07:13:36 +0000 (15:13 +0800)]
ENGR00303533 mtd: fsl-quadspi: reset the module in the probe

The uboot may run the QuadSpi controler with command:
    #sf probe

So we should reset the module in the probe.
This patch also clear the pending interrupts which arised by the uboot
code.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00285671 mmc: setup emmc boot partition configure methods
Richard Zhu [Sat, 12 Oct 2013 07:25:58 +0000 (15:25 +0800)]
ENGR00285671 mmc: setup emmc boot partition configure methods

- Configure boot partition
Expose the interfaces that used to enable the configurations
of the boot mode of the eMMC cards.
usage how-to and examples:
Enable the boot partition 1 boot enabled.
"echo 8 > /sys/devices/soc0/soc.1/2100000.aips-bus/
219c000.usdhc/mmc_host/mmc2/mmc2\:0001/boot_config"

In order to make sure that the re-read the ext-csd of card
can be completed successfully, add the method to wait for
the finish of the busy state.

- setup boot_info message output
Output bit means of important esd_csd register

Read esd_csd info each time when cat boot_info
becasue user may change config affect esd_csd
value.

- Boot partition access howto:
About the details, please refer to the guidance of
Documentation/mmc/mmc-dev-parts.txt

To enable write access to /dev/mmcblkXbootY, disable the forced
read-only access with:
echo 0 > /sys/block/mmcblkXbootY/force_ro

To re-enable read-only access:
echo 1 > /sys/block/mmcblkXbootY/force_ro

NOTE:
- The definitions of the EXT_CSD_PART_CONFIG and EXT_CSD_BOOT_BUS_WIDTH
+------------------------------------------------------------+
| Bit7 | Bit6     | Bit5 Bit4 Bit3        | Bit2 Bit1 Bit0   |
|------|----------|-----------------------|------------------|
| X    | BOOT_ACK | BOOT_PARTITION_ENABLE | PARTITION_ACCESS |
+------------------------------------------------------------+
Bit7: Reserved
Bit6: always set to vaule '1' when boot_part is enabled
Bit[5:3]:
0x0 : Device not boot enabled (default)
0x1 : Boot partition 1 enabled for boot
0x2 : Boot partition 2 enabled for boot
0x7 : User area enabled for boot
Bit[2:0]:
0x0 : No access to boot partition (default)
0x1 : R/W boot partition 1
0x2 : R/W boot partition 2

+--------------------------------------------------------------------+
| Bit7 Bit6 Bit5 | Bit4 Bit3 | Bit2                 | Bit1 Bit0      |
|----------------|----------------------------------|----------------|
| X              | BOOT_MODE | RESET_BOOT_BUS_WIDTH | BOOT_BUS_WIDTH |
+--------------------------------------------------------------------+
Bit [4:3] : BOOT_MODE (non-volatile)
0x0 : Use single data rate + backward compatible timings in boot
operation (default)
0x1 : Use single data rate + high speed timings in boot operation mode
0x2 : Use dual data rate in boot operation
0x3 : Reserved
Bit [2]: RESET_BOOT_BUS_WIDTH (non-volatile)
0x0 : Reset bus width to x1, single data rate and backward compatible
timings after boot operation (default)
0x1 : Retain boot bus width and boot mode after boot operation
Bit[1:0] : BOOT_BUS_WIDTH (non-volatile)
0x0 : x1 (sdr) or x4 (ddr) bus width in boot operation mode (default)
0x1 : x4 (sdr/ddr) bus width in boot operation mode
0x2 : x8 (sdr/ddr) bus width in boot operation mode
0x3 : Reserved

- example of the boot_info:
boot_info:0x07;
  ALT_BOOT_MODE:1 - Supports alternate boot method
  DDR_BOOT_MODE:1 - Supports alternate dual data rate during boot
  HS_BOOTMODE:1 - Supports high speed timing during boot
boot_size:2048KB
  boot_partition:0x48;
  BOOT_ACK:1 - Boot acknowledge sent during boot operation
  BOOT_PARTITION-ENABLE: 1 - Boot partition 1 enabled
  PARTITION_ACCESS:0 - No access to boot partition
boot_bus:0x00
  BOOT_MODE:0 - Use single data rate + backward compatible timings
  in boot operation
  RESET_BOOT_BUS_WIDTH:0 - Reset bus width to x1, single data rate
  and backwardcompatible timings after boot operation
  BOOT_BUS_WIDTH:0 - x1 (sdr) or x4 (ddr) bus width in boot
  operation mode

Signed-off-by: Richard Zhu <r65037@freescale.com>
9 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>
9 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.

Add missed line for ENGR00161643-3 UTP : bugfix

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 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>
9 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>
9 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 = ""

sleep_thread add new parameter

Signed-off-by: Lu Lin <b37454@freescale.com>
Signed-off-by: Frank Li<frank.li@freescale.com>
9 years agoASoC: fsl: Fix build problem
Guenter Roeck [Wed, 11 Jun 2014 07:13:52 +0000 (00:13 -0700)]
ASoC: fsl: Fix build problem

Commit 432481220 (ASoC: fsl-ssi: Use regmap) removed struct ccsr_ssi.
Unfortunately, the structure is still used. This causes
mpc85xx_smp_defconfig and mpc85xx_defconfig builds to fail with

sound/soc/fsl/fsl_dma.c:926:50:
  error: invalid use of undefined type 'struct ccsr_ssi'
  dma->ssi_stx_phys = res.start + offsetof(struct ccsr_ssi, stx0);
ound/soc/fsl/fsl_dma.c:927:50:
  error: invalid use of undefined type 'struct ccsr_ssi'
  dma->ssi_srx_phys = res.start + offsetof(struct ccsr_ssi, srx0);

Fix by using constants, similar to original commit.

Cc: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3d5f615f9fcba6df382bd9a204b5e9ad3080ac48)

9 years agoASoC: fsl_spdif: Fix integer overflow when calculating divisors
Anssi Hannula [Mon, 9 Jun 2014 16:16:43 +0000 (19:16 +0300)]
ASoC: fsl_spdif: Fix integer overflow when calculating divisors

The calculation code does
u64 = (u32 - u32) * 100000;

The 64 bits are of no help here as the type is casted only after the
multiplication, and therefore the result may overflow, possibly causing
inoptimal or wrong clock setup in an unfortunate case (the maximum
result value of the first substraction is currently 47999).

Fix the code to cast before multiplication.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c89c7e94bb7d89b39471c79034e3ba1b25d817f5)

9 years agoASoC: fsl_spdif: Fix incorrect usage of regmap_read()
Nicolin Chen [Tue, 6 May 2014 08:41:39 +0000 (16:41 +0800)]
ASoC: fsl_spdif: Fix incorrect usage of regmap_read()

We should not copy the return value into this val since it's supposed to
get the value of the register not the success result of regmap_read().
Thus fix it.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e9b383dc940f4cba6876887ecb47df3082ec925e)

9 years agoASoC: fsl-ssi: Use regmap
Markus Pargmann [Tue, 27 May 2014 08:24:25 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Use regmap

This patch replaces the ssi specific functions write_ssi, read_ssi and
write_ssi_mask by standard regmap function calls.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 432481220101166a0b33dc6f951b38a8af3d281c)

Conflicts:
sound/soc/fsl/Kconfig

9 years agoASoC: fsl-ssi: reorder and document fsl_ssi_private
Markus Pargmann [Tue, 27 May 2014 08:24:24 +0000 (10:24 +0200)]
ASoC: fsl-ssi: reorder and document fsl_ssi_private

Reorder all variables in struct fsl_ssi_private to have groups that make
sense together. The patch also updates the struct documentation.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 737a6b418a83d8de87e0170010dce9fc2399b4e8)

9 years agoASoC: fsl-ssi: Fix baudclock handling
Markus Pargmann [Tue, 27 May 2014 08:24:23 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Fix baudclock handling

The baudclock may be used and set by different streams.

Allow only the first stream to set the bitclock rate. Other streams have
to try to get to the correct rate without modifying the bitclock rate
using the SSI internal clock modifiers.

The variable baudclk_streams is introduced to keep track of the active
streams that are using the baudclock. This way we know if the baudclock
may be set and whether we may enable/disable the clock.

baudclock enable/disable is moved to hw_params()/hw_free(). This way we can
keep track of the baudclock in those two functions and avoid a running
clock while it is not used. As hw_params()/hw_free() may be called
multiple times for the same stream, we have to use baudclk_streams
variable to know whether we may enable/disable the clock.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d429d8e3324cae120784a1e194ef6ea62aeb327e)

9 years agoASoC: fsl-ssi: Set framerate divider correctly for i2s master mode
Sascha Hauer [Tue, 27 May 2014 08:24:22 +0000 (10:24 +0200)]
ASoC: fsl-ssi: Set framerate divider correctly for i2s master mode

In i2s master mode the fsl_ssi driver depends on someone calling
.set_tdm_slot correctly. In this mode though only a DC value of
2 is allowed, so set it in this case and no longer depend on
.set_tdm_slot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b5dd91b3dcf937ce42583711fe4d679cacdbd2d0)

9 years agoASoC: fsl-ssi: remove unnecessary spinlock
Sascha Hauer [Tue, 27 May 2014 08:24:21 +0000 (10:24 +0200)]
ASoC: fsl-ssi: remove unnecessary spinlock

The baudclock_locked variable is only used in functions which
are serialized anyway from the core. No need to have a lock
around the variable, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d8ced4793f3f114fa82fb423b71c2899caf8b7b0)

9 years agoASoC: fsl-ssi: set bitclock in master mode from hw_params
Sascha Hauer [Tue, 27 May 2014 08:24:20 +0000 (10:24 +0200)]
ASoC: fsl-ssi: set bitclock in master mode from hw_params

The fsl_ssi driver uses the .set_sysclk callback to configure the
bitclock for master mode. This is unnecessary since the bitclock
is known in hw_params. This patch configures the bitclock from .hw_params.
.set_dai_sysclk now sets a bitclock frequency which is preferred over
the default calculated bitclock frequency.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8dd51e23a1ef3b5f22eeff4827260b75bafba620)

9 years agoASoC: fsl-ssi: make fsl,mode property optional
Markus Pargmann [Tue, 27 May 2014 08:24:19 +0000 (10:24 +0200)]
ASoC: fsl-ssi: make fsl,mode property optional

The simple soundcard binding has its own way for specifying the dai
format. To be able to use this binding we have to make the fsl,mode
property optional. As the property is used in existing devicetrees
keep the option around for compatibility reasons.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 85e59af24056ca7ffaf617cf6201c519e31dc668)

9 years agoASoC: fsl-ssi: introduce SoC specific data
Sascha Hauer [Tue, 27 May 2014 08:24:18 +0000 (10:24 +0200)]
ASoC: fsl-ssi: introduce SoC specific data

Introduce a SoC data struct which contains the differences between
the different SoCs this driver supports. This makes it easy to support
more differences without having to introduce a new switch/case each
time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit fcdbadef378bc9cc64cb8cbfd96c23fc15812923)

9 years agoASoC: fsl_ssi: Add suspend/resume support
Fabio Estevam [Fri, 23 May 2014 05:38:56 +0000 (02:38 -0300)]
ASoC: fsl_ssi: Add suspend/resume support

Doing a suspend/resume sequence while playing an audio track in the backgroung
causes broken audio right after resume:

root@freescale /$ aplay clarinet.wav &

root@freescale /home$ Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian,
 Rate 44100 Hz, Mono

root@freescale /home$ echo mem > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.002 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 37.082 msecs
PM: suspend devices took 0.040 seconds
PM: late suspend of devices complete after 4.234 msecs
PM: noirq suspend of devices complete after 4.618 msecs
Disabling non-boot CPUs ...
PM: noirq resume of devices complete after 4.013 msecs
PM: early resume of devices complete after 4.000 msecs
PM: resume of devices complete after 68.907 msecs
PM: resume devices took 0.070 seconds
Restarting tasks ... Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
....

Add SNDRV_PCM_TRIGGER_RESUME/SUSPEND cases so that we can gracefully handle
system suspend/resume.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b20e53a826a7adc3bfd2772bd49a83b6f21b4cce)

9 years agoASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params
Sascha Hauer [Mon, 28 Apr 2014 10:54:52 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params

fsl_ssi_set_dai_sysclk will be called from fsl_ssi_hw_params in the
next patch. Move up to avoid forward declaration and to keep the next patch
more readable. No functional change.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ee9daad4953418ecf28a6b0b920f982fe0c24814)

9 years agoASoC: fsl-ssi: Transmit enable synchronization
Markus Pargmann [Mon, 28 Apr 2014 10:54:51 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Transmit enable synchronization

When the fsl-ssi unit is used in i2s slave mode, it is possible that the
SSI unit starts transmitting data on the wrong channel. This happens
because the SSI does not synchronize with the left-right-clock by
default.

This patch enables transmit enable synchronization.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 504894799fa122822f5c48be2968e04d3f1af8e8)

9 years agoASoC: fsl-ssi: Remove unnecessary variables from ssi_private
Markus Pargmann [Mon, 28 Apr 2014 10:54:48 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Remove unnecessary variables from ssi_private

There are some variables defined in struct fsl_ssi_private that describe
states that are also described by other variables.

This patch adds some helper functions that return exactly the same
information based on available variables. This helps to clean up struct
fsl_ssi_private and remove them from the probe function.

It also removes some not really used variables (new_binding, name).

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 171d683d2ac4ab6f220cc99de08ef9ec2c039966)

9 years agoASoC: fsl-ssi: Cleanup probe function
Markus Pargmann [Mon, 28 Apr 2014 10:54:47 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Cleanup probe function

Reorder the probe function to be able to move the second imx-specific
block to the seperate imx probe function. The patch also removes some
comments/variables/code that are not used anymore or could be simply
replaced by other variables.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4d9b7926f2ce271e0670cf0e7131a0e2a686690a)

9 years agoASoC: fsl-ssi: Remove useless DMA code
Markus Pargmann [Mon, 28 Apr 2014 10:54:46 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Remove useless DMA code

Simplify dma DT property handling. fsl,ssi-dma-events is not used
anymore. It passes invalid data to imx_pcm_dma_params_init_data() which
copies some data into an imx dma struct. This struct is never used in
imx-dma or imx-sdma because of generic OF DMA handling. The
"fsl,ssi-dma-events" is not used anywhere in dts files.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ed0f1604e93c686d8151c5a9bcbe36a2986caf40)

9 years agoASoC: fsl-ssi: Move imx-specific probe to seperate function
Markus Pargmann [Mon, 28 Apr 2014 10:54:45 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move imx-specific probe to seperate function

Move imx specific probe code to a seperate function. It reduces the
size of the probe() function and makes the code and error handling
easier to understand.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 49da09e26577702516e946ecd537f50b87533315)

9 years agoASoC: fsl-ssi: Use dev_name for DAI driver struct
Markus Pargmann [Mon, 28 Apr 2014 10:54:44 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Use dev_name for DAI driver struct

Instead of creating a name using string manipulation functions, we can
simply use the device name for the DAI driver struct.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2a1d102de40a799072309d4d84fa6f214c5ee999)

9 years agoASoC: fsl-ssi: Move debugging to seperate file
Markus Pargmann [Mon, 28 Apr 2014 10:54:43 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Move debugging to seperate file

Move all code that is only used for debugging to a seperate file. This
makes it easier to see what functions are used for debugging only.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f138e6212427d0ea6283e07b706823b657ddf14f)

9 years agoASoC: fsl-ssi: Fix register values when disabling
Markus Pargmann [Mon, 28 Apr 2014 10:54:42 +0000 (12:54 +0200)]
ASoC: fsl-ssi: Fix register values when disabling

The bits we have to clear when disabling are different when the other
stream is still active.

This patch fixes the calculation of new register values after disabling
one stream. It also adds a more detailed description of the new register
value calculation.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 65c961cc59345fa347173e5a1f5866bc866fd626)

9 years agoASoC: fsl_esai: Bypass divider settings if clock requirement is not changed
Nicolin Chen [Tue, 6 May 2014 08:56:01 +0000 (16:56 +0800)]
ASoC: fsl_esai: Bypass divider settings if clock requirement is not changed

We don't need to change those dividers if bclk and mclk remains the same
directions and values.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f975ca46f634660a52d8c815b465258ae9bce3b7)

9 years agoASoC: fsl_esai: Set PCRC and PRRC registers at the end of hw_params()
Nicolin Chen [Tue, 6 May 2014 08:56:02 +0000 (16:56 +0800)]
ASoC: fsl_esai: Set PCRC and PRRC registers at the end of hw_params()

According to Reference Manual -- ESAI Initialization chapter, as the
standard procedure of ESAI personal reset, the PCRC and PRRC registers
should be remained in its reset value and then configured after T/RCCR
and T/RCR configurations's done but before TE/RE's enabling.

So this patch moves PCRC and PRRC settings to the end of hw_params().

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4f8210f66e5a200c63770ea9445ff913a28a3be2)

9 years agoASoC: fsl_esai: Only bypass sck_div for EXTAL source
Nicolin Chen [Tue, 6 May 2014 08:56:00 +0000 (16:56 +0800)]
ASoC: fsl_esai: Only bypass sck_div for EXTAL source

ESAI can only output EXTAL clock source directly. But for FSYS clock source,
ESAI can not output it without getting through PSR PM dividers.

So this patch adds an extra check in the code.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 57ebbcafab0ce8cce4493c6a243ecdd7066e6ef1)

9 years agoASoC: fsl_esai: Fix incorrect condition within ratio range check for FP
Nicolin Chen [Tue, 6 May 2014 08:55:59 +0000 (16:55 +0800)]
ASoC: fsl_esai: Fix incorrect condition within ratio range check for FP

The range here from 1 to 16 is confined to FP divider only while the
sck_div indicates if the calculation contains PSR and PM dividers. So
for the case using PSR and PM since the sck_div is true, the range of
ratio would simply become bigger than 16.

So this patch fixes the condition here and adds one line comments to
make the purpose here clear.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 89e47f62cf3eea7ad5e3d7d72ea846be37d6e352)

9 years agoASoc: fsl_spdif: Add descriptions for fsl_spdif_priv
Nicolin Chen [Wed, 30 Apr 2014 10:54:09 +0000 (18:54 +0800)]
ASoc: fsl_spdif: Add descriptions for fsl_spdif_priv

Other people would clearly understand each member and improve if they want.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b8a832a0b667d48642c495af17b19443208dd09e)

9 years agoASoC: fsl_spdif: Print actual sample rate for debug
Nicolin Chen [Wed, 30 Apr 2014 10:54:08 +0000 (18:54 +0800)]
ASoC: fsl_spdif: Print actual sample rate for debug

People would simply know what the driver gets the best for the current
sample rate playback.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 527cda78eb601b0ad303dc4999811731eff5560e)

9 years agoASoC: fsl_spdif: Add sysclk df support to derive txclk from sysclk
Nicolin Chen [Wed, 30 Apr 2014 10:54:07 +0000 (18:54 +0800)]
ASoC: fsl_spdif: Add sysclk df support to derive txclk from sysclk

The sysclk is one the clock sources that could be selected to derive
tx clock. But the route for sysclk is a bit different that it does
not only contain txclk df divider but also have an extra sysclk df.

So this patch mainly adds syclk df configuration support so as to
let the driver be able to get clock from sysclk.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 27c647bff20c6883dd0b4e3fc24c3d414a9e192a)

9 years agoASoC: fsl_spdif: Rename all _div to _df
Nicolin Chen [Wed, 30 Apr 2014 10:54:06 +0000 (18:54 +0800)]
ASoC: fsl_spdif: Rename all _div to _df

We should have used _df by following the reference manual at the beginning.
So this patch just renames them.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e41a4a79af5cad172971af8681292af33496b119)

9 years agoASoC: fsl_spdif: Use clk_set_rate() for spdif root clock only
Nicolin Chen [Wed, 30 Apr 2014 10:54:05 +0000 (18:54 +0800)]
ASoC: fsl_spdif: Use clk_set_rate() for spdif root clock only

The clock mux for the Freescale S/PDIF controller has eight clock sources
while most of them are from other moudles and even system clocks that do
not allow a rate-changing operation.

So we here only allow the clk_set_rate() and clk_round_rate() happened to
spdif root clock, the private clock for S/PDIF controller.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9c6344b3fa547ce7ec78da95134d92d9f9309b31)

9 years agoASoC: fsl: select SND_SOC_IMX_PCM_DMA where needed
Arnd Bergmann [Tue, 29 Apr 2014 19:36:22 +0000 (21:36 +0200)]
ASoC: fsl: select SND_SOC_IMX_PCM_DMA where needed

Since commit 204dec93eaa "ASoC: fsl: Allow to select individual common
options", it is possible to enable SND_SOC_FSL_SSI and SND_SOC_FSL_SPDIF
manually, either as loadable modules or built-in. This unfortunately
leads to a link error if one or both of them are built-in, while
the imx-pcm-dma framework is a loadable module:

sound/built-in.o: In function `fsl_ssi_probe':
:(.text+0x51fb8): undefined reference to `imx_pcm_dma_init'
sound/built-in.o: In function `fsl_spdif_probe':
:(.text+0x52e20): undefined reference to `imx_pcm_dma_init'

This changes Kconfig to prevent this case by using 'select' to turn
on the imx-pcm-dma code from both drivers. For consistency, we also
turn on the imx-pcm-fiq code, which is an alternative to the dma
implementation.

Note that imx-pcm-fiq is platform dependent, so we must not enable
that unless we are building a kernel for i.MX. Note also the
"if SND_IMX_SOC != n" syntax as opposed to the normal "if SND_IMX_SOC".
This is needed to avoid turning on the options as 'm' if 'SND_IMX_SOC'
is a module.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 31ee2bfd724ab1fa2fba6472a071bca5e9132139)

9 years agoASoC: fsl: Allow to select ESAI device individually
Nicolin Chen [Mon, 16 Jun 2014 11:56:15 +0000 (19:56 +0800)]
ASoC: fsl: Allow to select ESAI device individually

This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 40e3b934be0e0e04da3b56093958389d5c325c18)

Conflicts:
sound/soc/fsl/Kconfig

9 years agoASoC: fsl: Allow to select SAI device individually
Xiubo Li [Wed, 30 Apr 2014 10:10:05 +0000 (18:10 +0800)]
ASoC: fsl: Allow to select SAI device individually

This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b71fc4e6c9eb1b5ce1c0861825835da273367104)

9 years agoASoC: fsl_spdif: Fix clock source for rxclk rate measurement
Nicolin Chen [Mon, 28 Apr 2014 15:07:51 +0000 (23:07 +0800)]
ASoC: fsl_spdif: Fix clock source for rxclk rate measurement

The rxclk rate actually uses sysclk, ipg clock for example, as its
reference clock to calculate it. But the driver currently doesn't
pass a correct clock source. So fix it.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 0b8643900a1bff32ad8bf17ef1f5d57b6d490502)

9 years agoASoC: fsl: Drop formats limitation for imx-pcm-dma.c
Nicolin Chen [Thu, 24 Apr 2014 11:33:07 +0000 (19:33 +0800)]
ASoC: fsl: Drop formats limitation for imx-pcm-dma.c

Now ASoC core is getting the intersection of supported formats not only
from CPU and CODEC dai's but also from DMA's. However, there should be
no specific width limitation from SDMA side.

So drop it. Otherwise, we would only support S16_LE format for all i.MX
platforms.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e9ffb5ba4de17f14ca592e06a397c85541a72c7d)

9 years agoASoC: fsl_spdif: Add core clock control for DMA access
Nicolin Chen [Thu, 24 Apr 2014 10:52:24 +0000 (18:52 +0800)]
ASoC: fsl_spdif: Add core clock control for DMA access

Regmap is able to enable/disable the core clock automatically each time
it's going to access the registers. But for DMA cases during playback or
recording, it's totally beyong control of regmap. So we have to open the
clock manually.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 08f7336e6404698158966d0c8a2937d3580e2693)

9 years agoASoC: imx-audmux: Fix section mismatch
Lars-Peter Clausen [Thu, 24 Apr 2014 06:25:56 +0000 (08:25 +0200)]
ASoC: imx-audmux: Fix section mismatch

audmux_debugfs_init() is marked as __init, but is called from imx_audmux_probe()
which is not marked as __init. This creates a section mismatch and a potential
runtime crash (if imx_audmux_probe() is called after the .init section was
dropped). This patch removes the __init annotation from audmux_debugfs_init(),
which fixes the following warning:
WARNING: sound/soc/built-in.o(.text+0x86960): Section mismatch in reference
from the function imx_audmux_probe() to the function
.init.text:audmux_debugfs_init()

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b8909783a22b4f169ade830e0aa6dafe313426f1)

9 years agoASoC: fsl_spdif: Fix wrong OFFSET of STC_SYSCLK_DIV
Nicolin Chen [Fri, 18 Apr 2014 09:32:08 +0000 (17:32 +0800)]
ASoC: fsl_spdif: Fix wrong OFFSET of STC_SYSCLK_DIV

It should use STC_SYSCLK_DIV_OFFSET. Thus fix it.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6ae6698276ca36f37afc2ad38054092021519ad4)

9 years agoASoC: fsl: Add explicit include of of.h
Mark Brown [Tue, 15 Apr 2014 11:02:02 +0000 (12:02 +0100)]
ASoC: fsl: Add explicit include of of.h

Hopefully fixing a build failure reported by Stephen Rothwell - though
quite why the other OF headers don't include this as well I'm not sure.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9c72a04ca78606bf10211efa93b3332c710afc65)

9 years agoASoC: fsl_sai: Use FSL_SAI_xXR() and regmap_update_bits() to simplify code
Nicolin Chen [Fri, 11 Apr 2014 10:30:09 +0000 (18:30 +0800)]
ASoC: fsl_sai: Use FSL_SAI_xXR() and regmap_update_bits() to simplify code

By doing this, the driver can drop around 50 lines and become neater.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2a266f8b2ae790454edb79cb8c707c9305e0307a)

9 years agoASoC: spdif: Add VF610+ compatibles support.
Xiubo Li [Fri, 4 Apr 2014 07:10:29 +0000 (15:10 +0800)]
ASoC: spdif: Add VF610+ compatibles support.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 1014fad0fca91181acc68396d84573e4ae301380)

9 years agoASoC: esai: Add VF610+ compatibles support.
Xiubo Li [Fri, 4 Apr 2014 07:10:28 +0000 (15:10 +0800)]
ASoC: esai: Add VF610+ compatibles support.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit b21cc2f5fdfe22429501cd7040db0b2b2a9b29de)

9 years agoASoC: spdif: Sort the header files alphabetically.
Xiubo Li [Fri, 4 Apr 2014 07:10:27 +0000 (15:10 +0800)]
ASoC: spdif: Sort the header files alphabetically.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit add180ed780e9031d65e7c94cad936e719401acf)

9 years agoASoC: esai: use the precise definition of 'ret'.
Xiubo Li [Fri, 4 Apr 2014 07:10:26 +0000 (15:10 +0800)]
ASoC: esai: use the precise definition of 'ret'.

Use the precise definition of 'ret', which will be used for
the error check.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3e185238a37d1f0a37a1d910344cdcff578bf333)

9 years agoASoC: fsl_sai: Fix incorrect condition check in trigger()
Nicolin Chen [Fri, 11 Apr 2014 14:10:00 +0000 (22:10 +0800)]
ASoC: fsl_sai: Fix incorrect condition check in trigger()

Patch ASoC: fsl_sai: Fix buggy configurations in trigger() doesn't entirely
fix the condition: FRDE of the current substream direction is being cleared
while the code is still using the non-updated one.

Thus this patch fixes this issue by checking the opposite one's FRDE alone
since the current one's is absolutely disabled.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f84526cfae46672308a361333c76b724384b61ee)

9 years agoASoC: fsl-ssi: Fix i2s_mode variable setup
Markus Pargmann [Sat, 15 Mar 2014 12:44:10 +0000 (13:44 +0100)]
ASoC: fsl-ssi: Fix i2s_mode variable setup

In fsl_ssi_hw_params() we update the I2S and NET bits using the i2s_mode
variable. The fsl_ssi_set_dai_fmt() function only writes the i2s-mode to
the i2s_mode variable and not the NET bit. This fixes it by adding that
bit to i2s_mode.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 07a28dbe7ad8e72868239450ff796c90e621d46f)

9 years agoASoC: fsl-ssi: Remove fsl_ssi_setup
Markus Pargmann [Sat, 15 Mar 2014 12:44:09 +0000 (13:44 +0100)]
ASoC: fsl-ssi: Remove fsl_ssi_setup

fsl_ssi_set_dai_fmt() manages most of the register setup routines now.
fsl_ssi_setup() makes the same as fsl_ssi_set_dai_fmt() but it relies on
DT properties.

In most cases the settings of fsl_ssi_setup() are already overwritten by
fsl_ssi_set_dai_fmt() when it is called by the soc-core when a sound
card is added. As these settings depend on the combination of codec and
cpu DAI, this should really be done by sound cards.

This patch removes fsl_ssi_setup() and adds the missing register setups
to fsl_ssi_set_dai_fmt(). It also removes all calls to fsl_ssi_setup().

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2b0db996ba2d9b833c2bd2d73cbf301abe11c60e)

9 years agoASoC: fsl_sai: Add clock controls for SAI
Nicolin Chen [Thu, 10 Apr 2014 15:26:15 +0000 (23:26 +0800)]
ASoC: fsl_sai: Add clock controls for SAI

The SAI mainly has the following clocks:
  bus clock
    control and configure registers and to generate synchronous
    interrupts and DMA requests.

  mclk1, mclk2, mclk3
    to generate the bit clock when the receiver or transmitter is
    configured for an internally generated bit clock.

So this patch adds these clocks and their clock controls to the driver.

[ To concern the old DTB cases, I've added a bit of extra code to make
  the driver compatible with them. And by marking clock NULL if failed
  to get, the clk_prepare() or clk_get_rate() would easily return 0
  so no further path should be broken. -- by Nicolin ]

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ca3e35c7a37cb59b12a1839d03c621cf8fa9a3d9)

9 years agoASoC: fsl_sai: Add imx6sx platform support
Nicolin Chen [Tue, 1 Apr 2014 11:34:09 +0000 (19:34 +0800)]
ASoC: fsl_sai: Add imx6sx platform support

The next coming i.MX6 Solo X SoC also contains SAI module while we use
imp_pcm_init() for i.MX platform.

So this patch adds one compatible route for imx6sx and updates the DT
doc accordingly.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c754064453e0d48043bd6a111f5c1f8ef1b75f7e)

9 years agoASoC: fsl_sai: Separately enable interrupts for Tx and Rx streams
Nicolin Chen [Tue, 1 Apr 2014 03:17:07 +0000 (11:17 +0800)]
ASoC: fsl_sai: Separately enable interrupts for Tx and Rx streams

We only enable one side interrupt for each stream since over/underrun
on the opposite stream would be resulted from what we previously did,
enabling TERE but remaining FRDE disabled, even though the xrun on the
opposite direction will not break the current stream.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8abba5d64835c636d97ac0009ab7430ed832cb93)

9 years agoASoC: fsl_sai: Fix buggy configurations in trigger()
Nicolin Chen [Tue, 1 Apr 2014 03:17:06 +0000 (11:17 +0800)]
ASoC: fsl_sai: Fix buggy configurations in trigger()

The current trigger() has two crucial problems:
1) The DMA request enabling operations (FSL_SAI_CSR_FRDE) for Tx and Rx are
   now totally exclusive: It would fail to run simultaneous Tx-Rx cases.
2) The TERE disabling operation depends on an incorrect condition -- active
   reference count that only gets increased in snd_pcm_open() and decreased
   in snd_pcm_close(): The TERE would never get cleared.

So this patch overwrites the trigger function by following these rules:
A) We continue to support tx-async-while-rx-sync-to-tx case alone, which's
   originally limited by this fsl_sai driver, but we make the code easy to
   modify for the further support of the opposite case.
B) We enable both TE and RE for PLAYBACK stream or CAPTURE stream but only
   enabling the DMA request bit (FSL_SAI_CSR_FRDE) of the current direction
   due to the requirement of SAI -- For tx-async-while-rx-sync-to-tx case,
   the receiver is enabled only when both the transmitter and receiver are
   enabled.

Tested cases:
a) aplay test.wav -d5
b) arecord -r44100 -c2 -fS16_LE test.wav -d5
c) arecord -r44100 -c2 -fS16_LE -d5 | aplay
d) (aplay test2.wav &); sleep 1; arecord -r44100 -c2 -fS16_LE test.wav -d1
e) (arecord -r44100 -c2 -fS16_LE test.wav -d5 &); sleep 1; aplay test.wav -d1

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e6b398465821fb8e08d208bd4ef2b5b73ce87b58)

9 years agoASoC: fsl_sai: Improve fsl_sai_isr()
Nicolin Chen [Fri, 28 Mar 2014 11:39:25 +0000 (19:39 +0800)]
ASoC: fsl_sai: Improve fsl_sai_isr()

This patch improves fsl_sai_isr() in these ways:
1, Add comment for mask fetching code.
2, Return IRQ_NONE if the IRQ is not for the device.
3, Use regmap_write() instead of regmap_update_bits().

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 413312aa17ceefe7003ad690778ab72f023128f0)

9 years agoASoC: fsl: Allow to select individual common options
Alexander Shiyan [Sun, 16 Mar 2014 04:21:35 +0000 (08:21 +0400)]
ASoC: fsl: Allow to select individual common options

This patch allow to select individual common sound options and
as a result allow using sound cards/codecs based on DT description.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 204dec93eaaba3a7afdc09aa3c3f6d08c773a367)

9 years agoASoC: fsl: Separation of the main audio options and boards
Alexander Shiyan [Sun, 16 Mar 2014 04:21:34 +0000 (08:21 +0400)]
ASoC: fsl: Separation of the main audio options and boards

This patch provide separation of the main audio options and boards.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit eba9e06f0ceb2ea3342e72577b244d8b02645396)

9 years agoASoC: fsl_sai: Fix Bit Clock Polarity configurations
Nicolin Chen [Fri, 4 Apr 2014 07:09:47 +0000 (15:09 +0800)]
ASoC: fsl_sai: Fix Bit Clock Polarity configurations

The BCP bit in TCR4/RCR4 register rules as followings:
  0 Bit clock is active high with drive outputs on rising edge
    and sample inputs on falling edge.
  1 Bit clock is active low with drive outputs on falling edge
    and sample inputs on rising edge.

For all formats currently supported in the fsl_sai driver, they're exactly
sending data on the falling edge and sampling on the rising edge.

However, the driver clears this BCP bit for all of them which results click
noise when working with SGTL5000 and big noise with WM8962.

Thus this patch corrects the BCP settings for all the formats here to fix
the nosie issue.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ef33bc3217c7aa9868f497c4f797cc50ad3ce357)

9 years agoASoC: fsl_sai: Add isr to deal with error flag
Nicolin Chen [Thu, 27 Mar 2014 11:06:59 +0000 (19:06 +0800)]
ASoC: fsl_sai: Add isr to deal with error flag

It's quite cricial to clear error flags because SAI might hang if getting
FIFO underrun during playback (I haven't confirmed the same issue on Rx
overflow though).

So this patch enables those irq and adds isr() to clear the flags so as to
keep playback entirely safe.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e2681a1bf5ae053426a6c5c1daaed17b2f95efe6)

9 years agoASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.
Xiubo Li [Thu, 27 Feb 2014 00:45:01 +0000 (08:45 +0800)]
ASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.

o Add SND_SOC_DAIFMT_DSP_A support.
o Add SND_SOC_DAIFMT_DSP_B support.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a3f7dcc9cc0392528bff75b17adfcd74fb8a0ecd)