Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757038AbbLHQMv (ORCPT ); Tue, 8 Dec 2015 11:12:51 -0500 Received: from down.free-electrons.com ([37.187.137.238]:42838 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757020AbbLHQMt (ORCPT ); Tue, 8 Dec 2015 11:12:49 -0500 Date: Tue, 8 Dec 2015 17:12:47 +0100 From: Boris Brezillon To: Harvey Hunt Cc: , Zubair Lutfullah Kakakhel , , Alex Smith , Brian Norris , "David Woodhouse" Subject: Re: [PATCH v9 2/3] mtd: nand: jz4780: driver for NAND devices on JZ4780 SoCs Message-ID: <20151208171247.7cfdbc98@bbrezillon> In-Reply-To: <5666FF6B.5090309@imgtec.com> References: <1449144142-24004-1-git-send-email-harvey.hunt@imgtec.com> <1449144142-24004-3-git-send-email-harvey.hunt@imgtec.com> <20151208151436.11ce72f4@bbrezillon> <5666FF6B.5090309@imgtec.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1577 Lines: 48 On Tue, 8 Dec 2015 16:03:55 +0000 Harvey Hunt 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. -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- 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/