]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agomtd: add ECC info for nand_flash_dev{}
Huang Shijie [Fri, 17 May 2013 03:17:31 +0000 (11:17 +0800)]
mtd: add ECC info for nand_flash_dev{}

Add an instance of an anonymous struct to store the ECC info for full id
nand chips.
@ecc.strength_ds: ECC correctability from the datasheet.
@ecc.step_ds: ECC size required by the @ecc.strength_ds,

These two fields are all from the datasheet.

Also add the necessary macros to make the code simple and clean.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: add a helper to get the supported features for ONFI nand
Huang Shijie [Fri, 17 May 2013 03:17:28 +0000 (11:17 +0800)]
mtd: add a helper to get the supported features for ONFI nand

add a helper to get the supported features for ONFI nand.
Also add the neccessary macros.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: add datasheet's ECC information to nand_chip{}
Huang Shijie [Fri, 17 May 2013 03:17:25 +0000 (11:17 +0800)]
mtd: add datasheet's ECC information to nand_chip{}

1.) Why add the ECC information to the nand_chip{} ?
   Each nand chip has its requirement for the ECC correctability, such as
   "4bit ECC for each 512Byte" or "40bit ECC for each 1024Byte".
   This ECC info is very important to the nand controller, such as gpmi.

   Take the Micron MT29F64G08CBABA for example, its geometry is
   8KiB page size, 744 bytes oob size and it requires 40bit ECC per 1KiB.
   If we do not provide the ECC info to the gpmi nand driver, it has to
   calculate the ECC correctability itself. The gpmi driver will gets the 56bit
   ECC for per 1KiB which is beyond its BCH's 40bit ecc capibility.
   The gpmi will quits in this case. But in actually, the gpmi can supports
   this nand chip if it can get the right ECC info.

2.) about the new fields.
   The @ecc_strength_ds stands for the ecc bits needed within the @ecc_step_ds.
   The two fields should be set from the nand chip's datasheets.

   For example:
"4bit ECC for each 512Byte" could be:
@ecc_strength_ds = 4, @ecc_step_ds = 512.
"40bit ECC for each 1024Byte" could be:
@ecc_strength_ds = 40, @ecc_step_ds = 1024.

3.) Why do not re-use the @strength and @size in the nand_ecc_ctrl{}?
   The @strength and @size in nand_ecc_ctrl{} is used by the nand controller
   driver, while the @ecc_strength_ds and @ecc_step_ds are get from the datasheet.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: increase max OOB size to 744
Huang Shijie [Wed, 15 May 2013 08:40:25 +0000 (16:40 +0800)]
mtd: increase max OOB size to 744

The oob size of Micron's MT29F64G08CBABAWP is 744 bytes.
So increase the NAND_MAX_OOBSIZE to 744.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: nand: reword nand_chip bad block interface comments
Brian Norris [Thu, 11 Apr 2013 08:34:59 +0000 (01:34 -0700)]
mtd: nand: reword nand_chip bad block interface comments

This remedies a few problems:

(1) The use of "the" vs. "a" is a little confusing, IMO.

(2) nand_chip.block_bad is used exclusively for checking the OOB bad
    block markers of a NAND. Any BBT functionality is handled in
    nand_bbt.c, so this description should differentiate itself from
    nand_bbt.c.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: add a helper to check the SLC/MLC nand chip
Huang Shijie [Wed, 25 Sep 2013 06:58:10 +0000 (14:58 +0800)]
mtd: nand: add a helper to check the SLC/MLC nand chip

Add a helper to check if a nand chip is SLC or MLC.
This helper makes the code more readable.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: denali: use NAND_CI_CELLTYPE_MSK instead of hardcoded constant
Akinobu Mita [Sat, 27 Jul 2013 14:09:53 +0000 (23:09 +0900)]
mtd: denali: use NAND_CI_CELLTYPE_MSK instead of hardcoded constant

Use NAND_CI_CELLTYPE_MSK to extract the cell type from nand_chip.cellinfo
instead of hardcoded constant.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: correct extemded param page error handling
Brian Norris [Tue, 17 Sep 2013 01:20:21 +0000 (18:20 -0700)]
mtd: nand: correct extemded param page error handling

If the ONFI extended parameter page gives codeword_size == 0, the
extended ECC information is corrupt and should not be used. Currently,
we (correctly) avoid using the information, but we don't report the
error to the caller, so the caller doesn't know that we didn't
initialize ecc_strength_ds and ecc_step_ds. Now the caller can warn the
user that it does not have sufficient information.

This also removes the false and useless "ONFI extended param page
detected" debug message (it was printed even on the aforementioned
corruption, and for the success case, we don't really want a print).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: cleanup ONFI printed errors, warnings
Brian Norris [Tue, 13 Aug 2013 17:51:55 +0000 (10:51 -0700)]
mtd: nand: cleanup ONFI printed errors, warnings

The ONFI detection routine is too verbose in some cases and not verbose
enough in others. This patch refactors it to print only when there are
significant warnings/errors.

Probing in 16-bit mode:
  It is unnecessary to print until after the READID (address 20h)
  command. READID *has* to work properly in whatever bus width
  configuration we are in, or else no identification mode works. So we
  can silence some useless warnings on systems which come up in 16-bit
  mode and do not even respond with an O-N-F-I string.

Valid parameter page:
  Nobody needs to see this. Do we inform the user every time other
  hardware responds properly? Instead, add an error message if *no*
  uncorrupted parameter pages are found.

ONFI ECC:
  Most drivers don't yet use the reported minimum ECC values, so it
  shouldn't yet be a fatal condition if the extended parameter page is
  incorrect. But we should at least give a warning for the corner cases
  that we don't expect.

ONFI flash detected:
  Nobody needs to see this. This is the expected case, that we detect
  ONFI properly, or else it wasn't ONFI-compliant and is detected by
  some other routine.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Huang Shijie <b32955@freescale.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: fix memory leak in ONFI extended parameter page
Brian Norris [Tue, 17 Sep 2013 00:59:20 +0000 (17:59 -0700)]
mtd: nand: fix memory leak in ONFI extended parameter page

This fixes a memory leak in the ONFI support code for detecting the
required ECC levels from this commit:

  commit 6dcbe0cdd83fb5f77be4f44c9e06c535281c375a
  Author: Huang Shijie <b32955@freescale.com>
  Date:   Wed May 22 10:28:27 2013 +0800

      mtd: get the ECC info from the Extended Parameter Page

In the success case, we never freed the 'ep' buffer.

Also, this fixes an oversight in the same commit where we (harmlessly)
freed the NULL pointer.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: fixup kerneldoc, rename parameter
Brian Norris [Fri, 9 Aug 2013 00:16:36 +0000 (17:16 -0700)]
mtd: nand: fixup kerneldoc, rename parameter

First, the function argument is 'offset' not 'column'.

Second, the 'data_buf' name is inconsistent with the rest of this file.
Just use 'buf'.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Gupta, Pekon <pekon@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: set ONFI nand's default hooks in nand_set_defaults()
Huang Shijie [Fri, 16 Aug 2013 02:10:07 +0000 (10:10 +0800)]
mtd: set ONFI nand's default hooks in nand_set_defaults()

We may do some ONFI get/set features operations before we call the
nand_scan_tail().

So move the default ONFI nand hooks into nand_set_defaults().

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: set the ecc step size for master/slave mtd_info
Huang Shijie [Fri, 16 Aug 2013 02:10:06 +0000 (10:10 +0800)]
mtd: set the ecc step size for master/slave mtd_info

Set the ecc step size for master/slave mtd_info{}.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: nand: silence some shift wrap warnings
Dan Carpenter [Fri, 9 Aug 2013 09:49:05 +0000 (12:49 +0300)]
mtd: nand: silence some shift wrap warnings

There are static checkers which complain when we declare variables as
64 bit bitfields but only use the lower 32 bits because of shift
wrapping.  In this case "len" is declared as u64 as opposed to unsigned
long or something which might be 32 bits.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: parse out the ECC info for the full-id nand chips
Huang Shijie [Fri, 17 May 2013 03:17:32 +0000 (11:17 +0800)]
mtd: parse out the ECC info for the full-id nand chips

Parse out the ECC information for the full-id nand chips.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: replace the hardcode with the onfi_feature()
Huang Shijie [Fri, 17 May 2013 03:17:30 +0000 (11:17 +0800)]
mtd: replace the hardcode with the onfi_feature()

The current code uses the hardcode to detect the 16-bit bus width.
Use the onfi_feature() to replace it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
[Brian: small fixup]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: get the ECC info from the Extended Parameter Page
Huang Shijie [Wed, 22 May 2013 02:28:27 +0000 (10:28 +0800)]
mtd: get the ECC info from the Extended Parameter Page

Since the ONFI 2.1, the onfi spec adds the Extended Parameter Page
to store the ECC info.

The onfi spec tells us that if the nand chip's recommended ECC codeword
size is not 512 bytes, then the @ecc_bits is 0xff. The host _SHOULD_ then
read the Extended ECC information that is part of the extended parameter
page to retrieve the ECC requirements for this device.

This patch implement the reading of the Extended Parameter Page, and parses
the sections for ECC type, and get the ECC info from the ECC section.

Tested this patch with Micron MT29F64G08CBABAWP.

Acked-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: get the ECC info from the parameter page for ONFI nand
Huang Shijie [Fri, 17 May 2013 03:17:26 +0000 (11:17 +0800)]
mtd: get the ECC info from the parameter page for ONFI nand

From the ONFI spec, we can just get the ECC info from the @ecc_bits field of
the parameter page.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: nand: detect OOB size for Toshiba 24nm raw SLC
Brian Norris [Tue, 25 Jun 2013 20:17:59 +0000 (13:17 -0700)]
mtd: nand: detect OOB size for Toshiba 24nm raw SLC

Toshiba NAND datasheets have not been very forthcoming on OOB size
information; they do not provide any bitfields in the ID string for
spare area. In their 24nm technology flash, however, Toshiba migrated
their NAND to have 32 bytes spare per 512 bytes of page area (up from
the traditional 16 bytes), as they now require 8-bit ECC or higher.

I have discussed this issue directly with Toshiba representatives, and
they acknowledge this problem. They recommend detecting these flash
based on their technology node as follows:

  For 24nm Toshiba SLC raw NAND (not BENAND -- Built-in Ecc NAND), there
  are 32 bytes of spare area for every 512 bytes of in-band data area.

We can implement this rule with the following snippet of a device ID
decode table, which applies to all their 43nm, 32nm, and 24nm SLC NAND
(this table is not fully in the NAND datasheets, but it was provided
directly by Toshiba representatives):

  - ID byte 5, bit[7]:
          1    -> BENAND
          0    -> raw SLC

  - ID byte 6, bits[2:0]:
          100b -> 43nm
          101b -> 32nm
          110b -> 24nm
          111b -> Reserved

I'm also working with Toshiba on including this bitfield description for
their 5th and 6th ID bytes in their public data sheets.

I will provide the 8-byte ID strings from the two 24nm Toshiba samples I
have; their first 6 bytes match the documentation I received from
Toshiba:

  24nm SLC 1Gbit TC58NVG0S3HTA00
  0x98 0xf1 0x80 0x15 0x72 0x16 0x08 0x00

  24nm SLC 2Gbit TC58NVG1S3HTA00
  0x98 0xda 0x90 0x15 0x76 0x16 0x08 0x00

I have also tested for regressions with:

  43nm SLC 4Gbit TC58NVG2S3ETA00
  0x98 0xdc 0x90 0x15 0x76 0x14 0x03 0x10

  32nm SLC 8Gbit TC58NVG3SOFA00
  0x98 0xd3 0x90 0x26 0x76 0x15 0x02 0x08

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand_base: Only use GET/SET FEATURES command on chips that support them.
David Mosberger [Wed, 29 May 2013 12:30:13 +0000 (15:30 +0300)]
mtd: nand_base: Only use GET/SET FEATURES command on chips that support them.

Spansion's S34MLx chips support ONFI but not the GET/SET FEATURES calls.

Signed-off-by: David Mosberger <dmosberger@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand_base: Use io{read, write}*_rep functions for transfer
Alexander Shiyan [Sat, 13 Apr 2013 05:32:13 +0000 (09:32 +0400)]
mtd: nand_base: Use io{read, write}*_rep functions for transfer

This patch replaces the usage of loops in the nand_base code with
io{read,write}{8,16}_rep calls instead.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: stop exporting nand_default_bbt
Brian Norris [Sat, 10 Aug 2013 08:09:49 +0000 (01:09 -0700)]
mtd: nand: stop exporting nand_default_bbt

I removed the last non-nand_base users of this, and we shouldn't have
any more modules that need to access it. It's only non-static to share
between nand_base and nand_bbt.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: remove NAND_BBT_SCANEMPTY
Brian Norris [Wed, 31 Jul 2013 00:53:00 +0000 (17:53 -0700)]
mtd: nand: remove NAND_BBT_SCANEMPTY

NAND_BBT_SCANEMPTY is a strange, badly-supported option with omap as its
single remaining user.

NAND_BBT_SCANEMPTY was likely used by accident in omap2[1]. And anyway,
omap2 doesn't scan the chip for bad blocks (courtesy of
NAND_SKIP_BBTSCAN), and so its use of this option is irrelevant.

This patch drops the NAND_BBT_SCANEMPTY option.

[1] http://lists.infradead.org/pipermail/linux-mtd/2012-July/042902.html

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Ivan Djelic <ivan.djelic@parrot.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: hide in-memory BBT implementation details
Brian Norris [Wed, 31 Jul 2013 00:52:59 +0000 (17:52 -0700)]
mtd: nand: hide in-memory BBT implementation details

nand_base.c shouldn't have to know the implementation details of
nand_bbt's in-memory BBT. Specifically, nand_base shouldn't perform the
bit masking and shifting to isolate a BBT entry.

Instead, just move some of the BBT code into a new nand_markbad_bbt()
interface. This interface allows external users (i.e., nand_base) to
mark a single block as bad in the BBT. Then nand_bbt will take care of
modifying the in-memory BBT and updating the flash-based BBT (if
applicable).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: eliminate cast
Brian Norris [Wed, 31 Jul 2013 00:52:57 +0000 (17:52 -0700)]
mtd: nand: eliminate cast

Just make 'res' an int.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: remove multiplied-by-2 block logic
Brian Norris [Wed, 31 Jul 2013 00:52:56 +0000 (17:52 -0700)]
mtd: nand: remove multiplied-by-2 block logic

The parent commit 771c568bcf915e708ae819ef9d07d862f7e2da86 ("mtd: nand: add
accessors, macros for in-memory BBT") makes the following comment obsolete:

/*
 * Note that numblocks is 2 * (real numblocks) here, see i+=2
 * below as it makes shifting and masking less painful
 */

I don't think it ever could have been "less painful" to have to shift an
extra bit (or 2, or 3) at various points in nand_bbt.c (and even
outside, since we leak our in-memory format). But now it is certainly
more painful, since we have nice macros and functions to retrieve the
relevant portions of the BBT.

This patch removes any points where the block number is
doubled/halved/otherwise-shifted, instead representing the block number
in its most natural form: as the actual block number.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: add accessors, macros for in-memory BBT
Brian Norris [Wed, 31 Jul 2013 00:52:55 +0000 (17:52 -0700)]
mtd: nand: add accessors, macros for in-memory BBT

There is an abundance of magic numbers and complicated shifting/masking
logic in the in-memory BBT code which makes the code unnecessary complex
and hard to read.

This patch adds macros to represent the 00b, 01b, 10b, and 11b
memory-BBT magic numbers, as well as two accessor functions for reading
and marking the memory-BBT bitfield for a given block.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi: imx6: fix the wrong method for checking ready/busy
Huang Shijie [Tue, 27 Aug 2013 09:29:07 +0000 (17:29 +0800)]
mtd: gpmi: imx6: fix the wrong method for checking ready/busy

In the imx6, all the ready/busy pins are binding togeter.
So we should always check the ready/busy pin of the chip 0.

In the other word, when the CS1 is enabled, we should also check the
ready/busy of chip 0; if we check the ready/busy of chip 1,
we will get the wrong result.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: decouple the chip select from the DMA channel
Huang Shijie [Tue, 27 Aug 2013 09:29:04 +0000 (17:29 +0800)]
mtd: gpmi: decouple the chip select from the DMA channel

Decouple the chip select from the DMA channel, we use the DMA channel 0
to accecc all the nand devices.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: scan two nand chips
Huang Shijie [Tue, 27 Aug 2013 09:29:06 +0000 (17:29 +0800)]
mtd: gpmi: scan two nand chips

Some nand chip has two DIEs in a single chip, such as Micron MT29F32G08QAA.
Each die has its own chip select pin, so this chip acts as two nand
chips.

If we only scan one chip, we may find that we only get 2G for this chip,
but in actually, this chip's size is 4G.

So scan two chips by default.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: use DMA channel 0 for all the nand chips
Huang Shijie [Tue, 27 Aug 2013 09:29:05 +0000 (17:29 +0800)]
mtd: gpmi: use DMA channel 0 for all the nand chips

We only have one DMA channel : the channel 0.
Use DMA channel 0 to access all the nand chips.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: rewrite the gpmi_ecc_write_oob() to support the jffs2
Huang Shijie [Wed, 25 Sep 2013 06:58:15 +0000 (14:58 +0800)]
mtd: gpmi: rewrite the gpmi_ecc_write_oob() to support the jffs2

When we use the ECC info which is get from the nand chip's datasheet,
we may have some freed oob area now.

This patch rewrites the gpmi_ecc_write_oob() to implement the ecc.write_oob().
We also update the comment for gpmi_hw_ecclayout.

Yes! We can support the JFFS2 for the SLC nand now.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: gpmi-nand: janitorial cleanup: (commas after last element of struct initia...
Lothar Waßmann [Wed, 7 Aug 2013 06:15:37 +0000 (08:15 +0200)]
mtd: nand: gpmi-nand: janitorial cleanup: (commas after last element of struct initializer)

Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi: fix ECC regression
David Woodhouse [Fri, 25 Oct 2013 14:03:59 +0000 (15:03 +0100)]
mtd: gpmi: fix ECC regression

The "legacy" ECC layout used until 3.12-rc1 uses all the OOB area by
computing the ECC strength and ECC step size ourselves.

Commit 2febcdf84b ("mtd: gpmi: set the BCHs geometry with the ecc info")
makes the driver use the ECC info (ECC strength and ECC step size)
provided by the MTD code, and creates a different NAND ECC layout
for the BCH, and use the new ECC layout. This causes a regression:

   We can not mount the ubifs which was created by the old NAND ECC layout.

This patch fixes this issue by reverting to the legacy ECC layout.

We will probably introduce a new device-tree property to indicate that
the new ECC layout can be used. For now though, for the imminent 3.12
release, we just unconditionally revert to the 3.11 behaviour.

This leaves a harmless cosmetic warning about an unused function. At
this point in the cycle I really don't care.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi: remove the nand_scan()
Huang Shijie [Fri, 16 Aug 2013 02:10:08 +0000 (10:10 +0800)]
mtd: gpmi: remove the nand_scan()

In order to make the nand_scan() work, the current code uses the hack code
to init the @nand_chip->ecc.size and the @nand_chip->ecc.strength. and
re-init some the ECC info in the gpmi_pre_bbt_scan().
This code is really a little ugly.

The patch does following changes:
  (1) Use the nand_scan_ident()/nand_scan_tail() to replace the nand_scan().

  (2) Init all the necessary values in the gpmi_init_last()
      before we call the nand_scan_tail().

  (3) remove the code setting the ECC info, let the mtd layer to do the
      real job.

  (4) remove the gpmi_scan_bbt(). we do not need this function any more.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: gpmi: set the BCH's geometry with the ecc info
Huang Shijie [Fri, 17 May 2013 03:17:34 +0000 (11:17 +0800)]
mtd: gpmi: set the BCH's geometry with the ecc info

If the nand chip provides us the ECC info, we can use it firstly.
The set_geometry_by_ecc_info() will use the ECC info, and
calculate the parameters we need.

Rename the old code to legacy_set_geometry() which will takes effect
when there is no ECC info from the nand chip or we fails in the ECC info case.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
10 years agomtd: nand: gpmi-nand: use more sensible error codes at various places
Lothar Waßmann [Wed, 7 Aug 2013 06:15:38 +0000 (08:15 +0200)]
mtd: nand: gpmi-nand: use more sensible error codes at various places

Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: refactor chip->block_markbad interface
Brian Norris [Wed, 31 Jul 2013 00:52:58 +0000 (17:52 -0700)]
mtd: nand: refactor chip->block_markbad interface

The chip->block_markbad pointer should really only be responsible for
writing a bad block marker for new bad blocks. It should not take care
of BBT-related functionality, nor should it handle bookkeeping of bad
block stats.

This patch refactors the 3 users of the block_markbad interface (plus
the default nand_base implementation) so that the common code is kept in
nand_block_markbad_lowlevel(). It removes some inconsistencies between
the various implementations and should allow for more centralized
improvements in the future.

Because gpmi-nand no longer needs the nand_update_bbt() function, let's
stop exporting it as well.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com> (for gpmi-nand parts)
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi-nand: don't use devm_pinctrl_get_select_default() in probe
Wolfram Sang [Wed, 10 Jul 2013 15:57:41 +0000 (16:57 +0100)]
mtd: gpmi-nand: don't use devm_pinctrl_get_select_default() in probe

Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for setting the default pins. Compile tested only.

Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: nand: gpmi-nand: remove unnecessary platform_set_drvdata()
Jingoo Han [Tue, 7 May 2013 06:37:16 +0000 (15:37 +0900)]
mtd: nand: gpmi-nand: 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: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agomtd: gpmi-nand: fix error return from gpmi_get_clks()
Michał Mirosław [Sat, 4 May 2013 13:19:35 +0000 (15:19 +0200)]
mtd: gpmi-nand: fix error return from gpmi_get_clks()

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00285441 mxc: mlb: Fix the receive issue of ISOC mode on Sabreauto
Luwei Zhou [Wed, 30 Oct 2013 06:24:34 +0000 (14:24 +0800)]
ENGR00285441 mxc: mlb: Fix the receive issue of ISOC mode on Sabreauto

This patch fixes the receive issue of MLB ISO mode on Sabreauto side.
During debug, it is found that the Sabreauto can only receive
1/5 packets of MITB sends.The MITB sends out 188 bytes per packet.
The Sabreauto receives 188*5 bytes. It seems that the packet length
on Sabreauto side is 5 times larger than MITB side. After changing
the defautl block number to 1, Sabreauto passes the test.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00286017: net:fec: fix clock enable/disable usecount mismatch
Fugang Duan [Mon, 4 Nov 2013 03:13:12 +0000 (11:13 +0800)]
ENGR00286017: net:fec: fix clock enable/disable usecount mismatch

Reproduce:
1. Boot up kernel with DHCP;
2. ifconfig eth0 down;
3. echo mem > /sys/power/state;

There have clock enable/disable usecount mismatch warning dump.

Fix this by checking device's netif_running state is up and then
enable/disable clock.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00285692 arm: imx: add necessary clock gates into clk tree
Anson Huang [Thu, 31 Oct 2013 19:27:19 +0000 (15:27 -0400)]
ENGR00285692 arm: imx: add necessary clock gates into clk tree

1. add epit1, epit2 and tzasc2 clock gate to clk tree so that
clk framework can manage these clock gates;

2. adjust ipu2_di1 clock gate registry code to follow hardware
register CG index sequence.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 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>
10 years agoENGR00274782 fixed gpu crash when baseAddress is not 0 or 2G
Xianzhong [Tue, 13 Aug 2013 15:16:24 +0000 (23:16 +0800)]
ENGR00274782 fixed gpu crash when baseAddress is not 0 or 2G

The baseAddress of contiguousVidMem is the actual physical address
which is not subtracted by gpu baseAddress, but the allocated physical address
has been subtracted by gpu baseAddress in gckVIDMEM_Lock,
so the invalid offset is produced and used to calculate the logical address.

Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Shawn Guo
10 years agoENGR00274478 fix gpu memory multi-lock failure
Xianzhong [Fri, 23 Aug 2013 12:36:45 +0000 (20:36 +0800)]
ENGR00274478 fix gpu memory multi-lock failure

this issue cause system boot with multi-user switch on JB4.3,

root cause is gpu memory cannot be multi-locked in same process,
gpu memory lock reference is added to allow multi-lock in kernel driver.

Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
10 years agoENGR00277045-1 fix system reboot with video playback
Xianzhong [Wed, 28 Aug 2013 17:33:39 +0000 (01:33 +0800)]
ENGR00277045-1 fix system reboot with video playback

gpu virtual memory cannot be allocated for external use

this issue occurs in ARD board with 2G above memory address

Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
10 years agoENGR00285646 enable usb peripheral mode for auto spi-nor and gpmi nand
Frank Li [Wed, 30 Oct 2013 21:08:24 +0000 (05:08 +0800)]
ENGR00285646 enable usb peripheral mode for auto spi-nor and gpmi nand

enable usb peripheral mode for sabreauto ecspi.dtb and gpmi-weim.dtb
because mfgtools need usb device support

Signed-off-by: Frank Li <Frank.Li@freescale.com>
10 years agoENGR00285273-3 IPU dev:Remove unnecessary memset before kfree
Liu Ying [Tue, 29 Oct 2013 04:31:36 +0000 (12:31 +0800)]
ENGR00285273-3 IPU dev:Remove unnecessary memset before kfree

This patch removes unnecessary memset() before kfree().
Also, it fixes a potential NULL pointer dereference(writing
to a freed block of memory).

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00285273-2 IPU dev:Remove an unnesessary check
Liu Ying [Tue, 29 Oct 2013 04:28:52 +0000 (12:28 +0800)]
ENGR00285273-2 IPU dev:Remove an unnesessary check

This patch removes an unnesessary check before setting
task ID to simplify the code.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00285273-1 IPU dev:Correct timeout setting from users
Liu Ying [Tue, 29 Oct 2013 03:26:40 +0000 (11:26 +0800)]
ENGR00285273-1 IPU dev:Correct timeout setting from users

This patch corrects the logic to set timeout value specified
by the users.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
10 years agoENGR00284981-2 arm: dts: imx6qdl: correct caam clock index
Anson Huang [Fri, 25 Oct 2013 20:45:00 +0000 (16:45 -0400)]
ENGR00284981-2 arm: dts: imx6qdl: correct caam clock index

Correct caam module clocks index according to clock tree.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00284981-1 arm: imx: add clock nodes for caam
Anson Huang [Fri, 25 Oct 2013 20:42:37 +0000 (16:42 -0400)]
ENGR00284981-1 arm: imx: add clock nodes for caam

Add caam clock gate nodes into clock tree, so that caam
driver can manage its clock gate to save power.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00284023 [iMX6DL/iMX6SL]Align VDDARM and VDDSOC voltages to latest datasheet
Ranjani Vaidyanathan [Wed, 16 Oct 2013 21:54:21 +0000 (16:54 -0500)]
ENGR00284023 [iMX6DL/iMX6SL]Align VDDARM and VDDSOC voltages to latest datasheet

Add 25mV PMIC tolerence to the voltages.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00284649 ARM: Documentation: Add MLB dts binding doc
Luwei Zhou [Wed, 23 Oct 2013 02:22:33 +0000 (10:22 +0800)]
ENGR00284649 ARM: Documentation: Add MLB dts binding doc

This patch add MLB devicetree binding doc.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00284648 mxc: mlb: clean up the MLB driver code.
Luwei Zhou [Tue, 22 Oct 2013 08:20:31 +0000 (16:20 +0800)]
ENGR00284648 mxc: mlb: clean up the MLB driver code.

This patch clean up the MLB driver code of i.MX6Q/DL AUTO.

* Reorder the head file alphabetically
* Fix code comments format
* Fix the lines over 80 characters
* Fix the return type to void for some private functions

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00283079-1 ASoC: fsl: Implement different DMA buffer sizes
Nicolin Chen [Thu, 17 Oct 2013 10:24:29 +0000 (18:24 +0800)]
ENGR00283079-1 ASoC: fsl: Implement different DMA buffer sizes

Each CPU DAI driver has its own defined DMA buffer size, so this patch just
drops the original one that uses a fixed size for all drivers and implements
a different DMA buffer size to each driver.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoALSA: Add SoC on-chip internal ram support for DMA buffer allocation
Nicolin Chen [Wed, 23 Oct 2013 03:47:43 +0000 (11:47 +0800)]
ALSA: Add SoC on-chip internal ram support for DMA buffer allocation

Now it's quite common that an SoC contains its on-chip internal RAM.
By using this RAM space for DMA buffer during audio playback/record,
we can shutdown the voltage for external RAM to save power.

So add new DEV type with iram malloc()/free() and accordingly modify
current default mmap() for the iram circumstance.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 years agodriver core: bus_type: add dev_groups
Greg Kroah-Hartman [Thu, 8 Aug 2013 22:22:55 +0000 (15:22 -0700)]
driver core: bus_type: add dev_groups

attribute groups are much more flexible than just a list of attributes,
due to their support for visibility of the attributes, and binary
attributes. Add dev_groups to struct bus_type which should be used
instead of dev_attrs.

dev_attrs will be removed from the structure soon.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agosysfs.h: add ATTRIBUTE_GROUPS() macro
Greg Kroah-Hartman [Sun, 14 Jul 2013 23:05:52 +0000 (16:05 -0700)]
sysfs.h: add ATTRIBUTE_GROUPS() macro

To make it easier for driver subsystems to work with attribute groups,
create the ATTRIBUTE_GROUPS macro to remove some of the repetitive
typing for the most common use for attribute groups.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agodriver core: device.h: add RW and RO attribute macros
Greg Kroah-Hartman [Sun, 14 Jul 2013 23:05:54 +0000 (16:05 -0700)]
driver core: device.h: add RW and RO attribute macros

Make it easier to create attributes without having to always audit the
mode settings.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: spi-imx: only enable the clocks when we start to transfer a message
Huang Shijie [Wed, 23 Oct 2013 08:05:42 +0000 (16:05 +0800)]
spi: spi-imx: only enable the clocks when we start to transfer a message

Current code keeps the clocks enabled all the time, it wastes the power
when there is no operaiton on the spi controller.

In order to save the power, this patch adds the two hooks:
   spi_imx_prepare_message: enable the clocks for this message
   spi_imx_unprepare_message: disable the clocks.

This patch also disables the clocks in the end of the probe.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
10 years agospi: Fix checkpatch issue
Jingoo Han [Mon, 14 Oct 2013 01:31:51 +0000 (10:31 +0900)]
spi: Fix checkpatch issue

Fix the following checkpatch error and warnings.

  ERROR: space required after that ',' (ctx:VxV)
  WARNING: quoted string split across lines
  WARNING: max() should probably be max_t(int, nb, master->num_chipselect)
  WARNING: sizeof *spi should be sizeof(*spi)
  WARNING: sizeof *master should be sizeof(*master)
  WARNING: sizeof x should be sizeof(x)

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Provide common spi_message processing loop
Mark Brown [Sat, 5 Oct 2013 10:50:40 +0000 (11:50 +0100)]
spi: Provide common spi_message processing loop

The loops which SPI controller drivers use to process the list of transfers
in a spi_message are typically very similar and have some error prone areas
such as the handling of /CS. Help simplify drivers by factoring this code
out into the core - if drivers provide a transfer_one() function instead
of a transfer_one_message() function the core will handle processing at the
message level.

/CS can be controlled by either setting cs_gpio or providing a set_cs
function. If this is not possible for hardware reasons then both can be
omitted and the driver should continue to implement manual /CS handling.

This is a first step in refactoring and it is expected that there will be
further enhancements, for example factoring out of the mapping of transfers
for DMA and the initiation and completion of interrupt driven transfers.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/trace: Trace length of SPI messages on completion
Mark Brown [Mon, 7 Oct 2013 22:36:56 +0000 (23:36 +0100)]
spi/trace: Trace length of SPI messages on completion

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Provide per-message prepare and unprepare operations
Mark Brown [Fri, 4 Oct 2013 23:23:12 +0000 (00:23 +0100)]
spi: Provide per-message prepare and unprepare operations

Many SPI drivers perform setup and tear down on every message, usually
doing things like DMA mapping the message. Provide hooks for them to use
to provide such operations.

This is of limited value for drivers that implement transfer_one_message()
but will be of much greater utility with future factoring out of standard
implementations of that function.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: attach/detach SPI device to the ACPI power domain
Mika Westerberg [Thu, 10 Oct 2013 10:28:48 +0000 (13:28 +0300)]
spi: attach/detach SPI device to the ACPI power domain

If the SPI device is enumerated from ACPI namespace (it has an ACPI handle)
it might have ACPI methods that needs to be called in order to transition
the device to different power states (such as _PSx).

We follow what has been done for platform and I2C buses here and attach the
SPI device to the ACPI power domain if the device has an ACPI handle. This
makes sure that the device is powered on when its ->probe() is called.

For non-ACPI devices this patch is a no-op.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Fix modalias for ACPI enumerated SPI devices
Jarkko Nikula [Thu, 10 Oct 2013 14:19:17 +0000 (17:19 +0300)]
spi: Fix modalias for ACPI enumerated SPI devices

There is a minor fault about ACPI enumerated SPI devices with their modalias
attribute. Now modalias is set by device instance not by hardware ID.
For example "spi:INTABCD:00", "spi:INTABCD:01" etc.

This means each device instance gets different modalias which does match
with generated modules.alias. Currently this is not problem as matching can
happen also with "acpi:INTABCD" modalias.

Fix this by using ACPI hardware ID.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: convert bus code to use dev_groups
Greg Kroah-Hartman [Tue, 8 Oct 2013 01:27:38 +0000 (18:27 -0700)]
spi: convert bus code to use dev_groups

The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the spi bus code to use the
correct field.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Provide trace points for message processing
Mark Brown [Mon, 7 Oct 2013 18:33:53 +0000 (19:33 +0100)]
spi: Provide trace points for message processing

Provide tracepoints for the lifecycle of a message from submission to
completion and for the active time for masters to help with performance
analysis of SPI I/O.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Use of_property_read_u32
Trent Piepho [Fri, 27 Sep 2013 12:37:25 +0000 (05:37 -0700)]
spi: Use of_property_read_u32

Instead of getting the raw property, checking the length, and doing
endian conversion each time, use the OF function
of_property_read_u32() that does all that.

Error messages are slightly improved with error codes from
of_property_read_u32() for different ways the property may be invalid
(missing, too short, etc.)

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: simplify call to request_module()
Mathias Krause [Sat, 31 Aug 2013 18:24:14 +0000 (20:24 +0200)]
spi: simplify call to request_module()

request_module() can handle format strings on its own, no need to create
the full module name ourself.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: core: Add devm_spi_register_master()
Mark Brown [Sat, 31 Aug 2013 17:50:52 +0000 (18:50 +0100)]
spi: core: Add devm_spi_register_master()

Help simplify the cleanup code for SPI master drivers by providing a
managed master registration function, ensuring that the master is
automatically unregistered whenever the device is unbound.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: quad: fix the name of DT property
wangyuhang [Sun, 1 Sep 2013 09:36:21 +0000 (17:36 +0800)]
spi: quad: fix the name of DT property

spi: quad: fix the name of DT property in patch

The previous property name spi-tx-nbits and spi-rx-nbits looks not
human-readable. To make it consistent with other devices, using property
name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
specify the number of data wires that spi controller will work in.
Add the specification in spi-bus.txt.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: core: Fix spi_register_master error handling
Axel Lin [Sat, 31 Aug 2013 12:25:52 +0000 (20:25 +0800)]
spi: core: Fix spi_register_master error handling

In the case spi_master_initialize_queue() fails, current code calls
device_unregister() before return error from spi_register_master().
However, all the drivers call spi_master_put() in the error path if
spi_register_master() fails. Thus we should call device_del() rather than
device_unregister() before return error from spi_register_master().

This also makes all the spi_register_master() error handling consistent,
because all other error paths of spi_register_master() expect drivers to
call spi_master_put() if spi_register_master() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: quad: Make DT properties optional
Mark Brown [Fri, 30 Aug 2013 22:19:40 +0000 (23:19 +0100)]
spi: quad: Make DT properties optional

The addition SPI quad support made the DT properties mandatory, breaking
compatibility with existing systems. Fix that by making them optional,
also improving the error messages while we're at it.

Signed-off-by: Mark Brown <broonie@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: quad: Fix missing return
wangyuhang [Fri, 30 Aug 2013 10:05:10 +0000 (18:05 +0800)]
spi: quad: Fix missing return

Delete a "return" when commit the patch to a new kernel version
 by mistake. So recover it.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Remove a redundant test for master->running in spi_queued_transfer
Axel Lin [Thu, 22 Aug 2013 15:41:34 +0000 (23:41 +0800)]
spi: Remove a redundant test for master->running in spi_queued_transfer

We have tested master->running immediately after grab the master->queue_lock.
The status of master->running won't be changed until we release the lock.
Thus remove a redundant test for master->running.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: conditional checking of mode and transfer bits.
Sourav Poddar [Thu, 22 Aug 2013 15:50:48 +0000 (21:20 +0530)]
spi: conditional checking of mode and transfer bits.

There is a bug in the following patch:
http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420

spi: DUAL and QUAD support

    fix the previous patch some mistake below:
    1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
       "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
       previous way to get the property in @of_register_spi_devices().
    2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
       SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
    3. Add the following check
       (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
          single, dual and quad.
       (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
          example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                   to QUAD(SPI_NBITS_QUAD)
       (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
          single(SPI_NBITS_SINGLE)

Checking of the tx/rx transfer bits and mode bits should be done conditionally
based on type of buffer filled else EINVAL condition will
always get hit either for rx or tx.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: DUAL and QUAD support
wangyuhang [Sun, 11 Aug 2013 10:15:17 +0000 (18:15 +0800)]
spi: DUAL and QUAD support

fix the previous patch some mistake below:
1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
   "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
   previous way to get the property in @of_register_spi_devices().
2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
   SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
3. Add the following check
   (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
      single, dual and quad.
   (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
      example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
               to QUAD(SPI_NBITS_QUAD)
   (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
      single(SPI_NBITS_SINGLE)

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: limit default transfer speed to controller's max speed
Gabor Juhos [Wed, 14 Aug 2013 08:25:28 +0000 (10:25 +0200)]
spi: limit default transfer speed to controller's max speed

Since the 'spi: Support transfer speed checking in the core'
change, the SPI core validates the desired speed of a given
transfer against the minimum and maximum speeds supported by
the controller.

If the speed of a transfer is not specified, the core uses
the maximum speed of the actual SPI device. However if the
maximum speed of the actual device is greater than the
maximum speed of the controller, the core will reject the
transfer due to the aforementioned change.

Change the code to use the maximum speed of the controller
by default if that is below the device's maximum speed.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: More sanity checks for transfers
Mark Brown [Wed, 10 Jul 2013 14:05:40 +0000 (15:05 +0100)]
spi: More sanity checks for transfers

Check that transfers are non-empty and that there is a completion for
them.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: fix SPI_BIT_MASK so it always fits into 32-bits
Stephen Warren [Thu, 1 Aug 2013 22:08:57 +0000 (16:08 -0600)]
spi: fix SPI_BIT_MASK so it always fits into 32-bits

On a 64-bit platform, ~0UL fills 64-bits, which causes SPI_BIT_MASK(32)
not to fit into 32 bits. This causes a warning when the result is assigned
to a 32-bit variable. Use ~0U instead to prevent this. This fixes:

drivers/spi/spi-gpio.c: In function 'spi_gpio_probe':
drivers/spi/spi-gpio.c:446:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Provide core support for runtime PM during transfers
Mark Brown [Sun, 28 Jul 2013 13:47:02 +0000 (14:47 +0100)]
spi: Provide core support for runtime PM during transfers

Most SPI drivers that implement runtime PM support use identical code to
do so: they acquire a runtime PM lock in prepare_transfer_hardware() and
then they release it in unprepare_transfer_hardware(). The variations in
this are mostly missing error checking and the choice to use autosuspend.

Since these runtime PM calls are normally the only thing in the prepare
and unprepare callbacks and the autosuspend API transparently does the
right thing on devices with autosuspend disabled factor all of this out
into the core with a flag to enable the behaviour.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agodriver: spi: Modify core to compute the message length
Sourav Poddar [Thu, 18 Jul 2013 10:01:25 +0000 (15:31 +0530)]
driver: spi: Modify core to compute the message length

Make spi core calculate the message length while
populating the other transfer parameters.

Usecase, driver can use it to populate framelength filed in their
controller.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: Support transfer speed checking in the core
Mark Brown [Wed, 10 Jul 2013 13:57:26 +0000 (14:57 +0100)]
spi: Support transfer speed checking in the core

Allow drivers to avoid implementing their own checks for simple rates by
specifying the limits in the master structure.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: fix incorrect handling of min param in SPI_BPW_RANGE_MASK
Stephen Warren [Thu, 30 May 2013 15:59:40 +0000 (09:59 -0600)]
spi: fix incorrect handling of min param in SPI_BPW_RANGE_MASK

SPI_BPW_RANGE_MASK is intended to work by calculating two masks; one
representing support for all bits up-to-and-including the "max" supported
value, and one representing support for all bits up-to-but-not-including
the "min" supported value, and then taking the difference between the
two, resulting in a mask representing support for all bits between
(inclusive) the min and max values.

However, the second mask ended up representing all bits up-to-and-
including rather up-to-but-not-including. Fix this bug.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: fix undefined behaviour in SPI_BPW_RANGE_MASK
Stephen Warren [Thu, 30 May 2013 15:59:39 +0000 (09:59 -0600)]
spi: fix undefined behaviour in SPI_BPW_RANGE_MASK

The parameters to SPI_BPW_RANGE_MASK() are in the range 1..32. If 32 is
used as a parameter, part of the expression is "1 << 32". Since 32 is >=
the size of the type in use, such a shift is undefined behaviour. Add
macro SPI_BIT_MASK to Implement a special case and thus avoid undefined
behaviour. Use this new macro rather than BIT() when implementing
SPI_BPW_RANGE_MASK().

This fixes build warnings such as:
drivers/spi/spi-gpio.c:446:2: warning: left shift count >= width of type [enabled by default]

SPI_BPW_MASK() already avoids this, since its parameter is also in range
1..32, yet it only shifts by up to one less than the input parameter.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: introduce macros to set bits_per_word_mask
Stephen Warren [Wed, 22 May 2013 02:36:34 +0000 (20:36 -0600)]
spi: introduce macros to set bits_per_word_mask

Introduce two macros to make setting up spi_master.bits_per_word_mask
easier, and avoid mistakes like writing BIT(n) instead of BIT(n - 1).

SPI_BPW_MASK is for a single supported value of bits_per_word_mask.

SPI_BPW_RANGE_MASK represents a contiguous set of bit lengths.

Signed-off-by: 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: bitbang: Fix checkpatch issue
Jingoo Han [Mon, 14 Oct 2013 01:33:38 +0000 (10:33 +0900)]
spi: bitbang: Fix checkpatch issue

Fix the following checkpatch warnings

  WARNING: sizeof *cs should be sizeof(*cs)
  WARNING: please, no space before tabs
  WARNING: space prohibited between function name and open parenthesis '('
  WARNING: line over 80 characters

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: bitbang: Let spi_bitbang_start() take a reference to master
Axel Lin [Tue, 10 Sep 2013 07:43:41 +0000 (15:43 +0800)]
spi: bitbang: Let spi_bitbang_start() take a reference to master

Many drivers that use bitbang library have a leak on probe error paths.
This is because once a spi_master_get() call succeeds, we need an additional
spi_master_put() call to free the memory.

Fix this issue by moving the code taking a reference to master to
spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
success. With this change, the caller is responsible for calling
spi_bitbang_stop() to decrement the reference and spi_master_put() as
counterpart of spi_alloc_master() to prevent a memory leak.

So now we have below patten for drivers using bitbang library:

probe:
spi_alloc_master        -> Init reference count to 1
spi_bitbang_start       -> Increment reference count
remove:
spi_bitbang_stop        -> Decrement reference count
spi_master_put          -> Decrement reference count (reference count reaches 0)

Fixup all users accordingly.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Suggested-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Acked-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi/bitbang: trivial: fix doubled word "use"
Uwe Kleine-König [Wed, 7 Aug 2013 19:22:20 +0000 (21:22 +0200)]
spi/bitbang: trivial: fix doubled word "use"

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agospi: bitbang: Remove unused tmp variable
Axel Lin [Thu, 15 Aug 2013 06:06:37 +0000 (14:06 +0800)]
spi: bitbang: Remove unused tmp variable

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
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>