aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-08-19 03:14:15 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-09-18 02:25:00 -0400
commit90de63324f0abc84f8c1ba56b2848c338cfda1cd (patch)
tree7550a95be7864ba86027cb147aa45dfd1236088d
parent5282a3acbfa5295f331696e603a9fd6be3bd4094 (diff)
mtd: bcm47xxnflash: add cmd_ctrl handler
This won't be used by NAND subsystem as we implement cmdfunc on our own, but will allow us to write a bit cleaner code. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
index 1ea5e77facd7..30df67a914b2 100644
--- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
+++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c
@@ -167,6 +167,26 @@ static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd,
167 * NAND chip ops 167 * NAND chip ops
168 **************************************************/ 168 **************************************************/
169 169
170static void bcm47xxnflash_ops_bcm4706_cmd_ctrl(struct mtd_info *mtd, int cmd,
171 unsigned int ctrl)
172{
173 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv;
174 struct bcm47xxnflash *b47n = (struct bcm47xxnflash *)nand_chip->priv;
175 u32 code = 0;
176
177 if (cmd == NAND_CMD_NONE)
178 return;
179
180 if (cmd & NAND_CTRL_CLE)
181 code = cmd | NCTL_CMD0;
182
183 /* nCS is not needed for reset command */
184 if (cmd != NAND_CMD_RESET)
185 code |= NCTL_CSA;
186
187 bcm47xxnflash_ops_bcm4706_ctl_cmd(b47n->cc, code);
188}
189
170/* Default nand_select_chip calls cmd_ctrl, which is not used in BCM4706 */ 190/* Default nand_select_chip calls cmd_ctrl, which is not used in BCM4706 */
171static void bcm47xxnflash_ops_bcm4706_select_chip(struct mtd_info *mtd, 191static void bcm47xxnflash_ops_bcm4706_select_chip(struct mtd_info *mtd,
172 int chip) 192 int chip)
@@ -360,6 +380,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
360 u32 val; 380 u32 val;
361 381
362 b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; 382 b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip;
383 nand_chip->cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl;
363 nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; 384 nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready;
364 b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; 385 b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc;
365 b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; 386 b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte;