base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0092-mtd-add-a-helper-to-get-the-supported-features-for-O.patch
1 From aeeb6ea6eb18c46f5776dd068989686686cda359 Mon Sep 17 00:00:00 2001
2 From: Huang Shijie <shijie8@gmail.com>
3 Date: Fri, 17 May 2013 11:17:28 +0800
4 Subject: [PATCH 092/203] mtd: add a helper to get the supported features for
5  ONFI nand
6
7 add a helper to get the supported features for ONFI nand.
8 Also add the neccessary macros.
9
10 Signed-off-by: Huang Shijie <b32955@freescale.com>
11 Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
12 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
13 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 ---
15  include/linux/mtd/nand.h | 10 ++++++++++
16  1 file changed, 10 insertions(+)
17
18 --- a/include/linux/mtd/nand.h
19 +++ b/include/linux/mtd/nand.h
20 @@ -202,6 +202,10 @@ typedef enum {
21  /* Keep gcc happy */
22  struct nand_chip;
23  
24 +/* ONFI features */
25 +#define ONFI_FEATURE_16_BIT_BUS                (1 << 0)
26 +#define ONFI_FEATURE_EXT_PARAM_PAGE    (1 << 7)
27 +
28  /* ONFI timing mode, used in both asynchronous and synchronous mode */
29  #define ONFI_TIMING_MODE_0             (1 << 0)
30  #define ONFI_TIMING_MODE_1             (1 << 1)
31 @@ -754,6 +758,12 @@ struct platform_nand_chip *get_platform_
32         return chip->priv;
33  }
34  
35 +/* return the supported features. */
36 +static inline int onfi_feature(struct nand_chip *chip)
37 +{
38 +       return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0;
39 +}
40 +
41  /* return the supported asynchronous timing mode. */
42  static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
43  {