Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1286638

Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs

From Harvey Hunt <harvey.hunt@imgtec.com>
Newsgroups linux.kernel
Subject Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs
Date 2015-12-08 17:20 +0100
Message-ID <qDt9D-4CC-3@gated-at.bofh.it> (permalink)
References <qBARY-4KT-5@gated-at.bofh.it> <qBARZ-4KT-19@gated-at.bofh.it> <qDrhx-3r6-13@gated-at.bofh.it> <qDsZZ-4yl-41@gated-at.bofh.it> <qDt9D-4CC-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 08/12/15 16:12, Boris Brezillon wrote:
> On Tue, 8 Dec 2015 16:03:55 +0000
> Harvey Hunt <harvey.hunt@imgtec.com> wrote:
>
>>>
>>> static void jz4780_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
>>> 				 unsigned int ctrl)
>>> {
>>> 	struct jz4780_nand_chip *nand = to_jz4780_nand_chip(mtd);
>>> 	struct jz4780_nand_controller *nfc = to_jz4780_nand_controller(nand->chip.controller);
>>> 	struct jz4780_nand_cs *cs;
>>>
>>> 	if (WARN_ON(nfc->selected < 0))
>>> 		return;
>>>
>>> 	cs = &nfc->cs[nfc->selected];
>>>
>>> 	if (ctrl & NAND_CTRL_CHANGE) {
>>> 		if (cmd != NAND_CMD_NONE) {
>>> 			if (ctrl & NAND_ALE)
>>> 				writeb(cmd, cs->base + OFFSET_ADDR);
>>> 			else if (ctrl & NAND_CLE)
>>> 				writeb(cmd, cs->base + OFFSET_CMD);
>>> 		}
>>>
>>> 		jz4780_nemc_assert(nfc->dev, cs->bank, ctrl & NAND_NCE);
>>> 	}
>>> }
>>>
>>
>> Okay, I understand your point now. I would also have to implement the
>> read/write functions to replace the defaults, correct? If so, it feels
>> strange to add functions to reimplement the default ones.
>
> I don't think you have to re-implement the {read,write}_{byte,buf,word}
> functions, because you'll still assign the ->IO_ADDR_W and ->IO_ADDR_R
> fields to cs->base + OFFSET_DATA in jz4780_nand_init_chip(), but maybe
> I'm missing something.
>

You're right, I forgot about that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 0/3] mtd: nand: jz4780: Add NAND and BCH drivers Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-03 13:10 +0100
  [PATCH v9 1/3] dt-bindings: binding for jz4780-{nand,bch} Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-03 13:10 +0100
    Re: [PATCH v9 1/3] dt-bindings: binding for jz4780-{nand,bch} Rob Herring <robh@kernel.org> - 2015-12-03 22:40 +0100
      Re: [PATCH v9 1/3] dt-bindings: binding for jz4780-{nand,bch} Brian Norris <computersforpeace@gmail.com> - 2015-12-03 23:40 +0100
    Re: [PATCH v9 1/3] dt-bindings: binding for jz4780-{nand,bch} Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-08 15:20 +0100
  [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-03 13:10 +0100
    Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-08 15:20 +0100
      Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-08 17:10 +0100
        Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-08 17:20 +0100
        Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-08 17:20 +0100
        Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-08 17:30 +0100
          Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on  JZ4780 SoCs Harvey Hunt <harvey.hunt@imgtec.com> - 2015-12-08 17:40 +0100

csiph-web