All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: <dwmw2@infradead.org>
Cc: Huang Shijie <b32955@freescale.com>,
	computersforpeace@gmail.com, linux-mtd@lists.infradead.org
Subject: [PATCH v2 3/5] mtd: nand: add a helper to get the supported features for JEDEC
Date: Sat, 8 Feb 2014 14:03:59 +0800	[thread overview]
Message-ID: <1391839441-21006-4-git-send-email-b32955@freescale.com> (raw)
In-Reply-To: <1391839441-21006-1-git-send-email-b32955@freescale.com>

Add a helper to get the supported features for JEDEC compliant nand.
Also add a macro JEDEC_FEATURE_16_BIT_BUS.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 include/linux/mtd/nand.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9686390..84cca61 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -350,6 +350,9 @@ struct jedec_ecc_info {
 	u8 reserved[2];
 } __packed;
 
+/* JEDEC features */
+#define JEDEC_FEATURE_16_BIT_BUS	(1 << 0)
+
 struct nand_jedec_params {
 	/* rev info and features block */
 	/* 'J' 'E' 'S' 'D'  */
@@ -921,4 +924,10 @@ static inline int nand_opcode_8bits(unsigned int command)
 	return command == NAND_CMD_READID;
 }
 
+/* return the supported JEDEC features. */
+static inline int jedec_feature(struct nand_chip *chip)
+{
+	return chip->jedec_version ? le16_to_cpu(chip->jedec_params.features)
+		: 0;
+}
 #endif /* __LINUX_MTD_NAND_H */
-- 
1.7.2.rc3

  parent reply	other threads:[~2014-02-08  6:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08  6:03 [PATCH v2 0/5] mtd: nand: support the JEDEC compliant nand Huang Shijie
2014-02-08  6:03 ` [PATCH v2 1/5] mtd: nand: add the data structures for JEDEC parameter page Huang Shijie
2014-02-08  6:03 ` [PATCH v2 2/5] mtd: nand: add fields for JEDEC in nand_chip Huang Shijie
2014-02-11 20:36   ` Brian Norris
2014-02-08  6:03 ` Huang Shijie [this message]
2014-02-08  6:04 ` [PATCH v2 4/5] mtd: nand: parse out the JEDEC compliant nand Huang Shijie
2014-02-11 20:32   ` Brian Norris
2014-02-14  7:08     ` Huang Shijie
2014-02-20  8:00       ` Brian Norris
2014-02-08  6:04 ` [PATCH v2 5/5] mtd: nand: print out the right information for " Huang Shijie
2014-02-11 20:43 ` [PATCH v2 0/5] mtd: nand: support the " Brian Norris
2014-02-14  6:47   ` Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391839441-21006-4-git-send-email-b32955@freescale.com \
    --to=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.