Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp84083yba; Mon, 20 May 2019 05:25:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCXzHkmLJZGRaAE1GigwxQRLaTZGxpRHXuPR8FrgNGAYmZiMKqHX6ILhrV/JOBTkNtqcrk X-Received: by 2002:a63:d54f:: with SMTP id v15mr33653507pgi.107.1558355143579; Mon, 20 May 2019 05:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558355143; cv=none; d=google.com; s=arc-20160816; b=AGunojmUlt2bbp3PvdM79+W0op90q1+TtmyRTQ3QyyGJABm1rMcJuLWyhecn23oJ5Z f3TFPzV7P8YgRLAsjCM7eKoI+kgryYKHnq2F95x9GT/xDAncY0qYjugLldEtzGEt+3b5 jsfVpliPhV4bJMt40tJEmC7vaJBaqfJMnHBo0M0oJ6tBsiWq9zABtfygA5CqVv90STs8 U3O8GPF0FyAQ/juefJ41SCKbWyK+2RtVlq2Fiuq1G6/lULJ4p4MyAjsqQ4GdXY7eMcZ8 RbZOt0CV5tZeUGB1yYavXhKi3FJxVF337vkBWDFWTIorzw3a/Q6T1KIAv/UTHjRN6NbG 1HFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=zdsEtnXKiDAGXsvJfO4A3XPEkJe4f9+8jUTTMf9Jy9U=; b=MFMYnCXCFRmgBHnt1HNuvi9NOKp4GYABjy8EjNtxe3a+VSJc9r/PyTqQ2U/royfLjG N+5EjKRb8Ppjg++QvpthCnkkfdaeB1JPc/ihy95A3lx5NfcGg0DNY2XxurYgDED7ERCL sPMjFGtz19BtBGcfNMyd6jN9VwtGkV0w4zXG0tV0VyKVj6nJP07EkaJtcKRuVcydo/4+ GLNhGCscvX0zk0CXdlUSARwymvYGdotaRh7Q7HbjMt4XZg0RGIN2l+odj5/rkzxep1n9 cX6vQ0lJtINHcq/Q7lsAG/S0ZWVPLuYBB/I1Nz0zDfkOTtCiyH7oLeCHjkpF2FJ8Cc8V NxrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si18872565pla.380.2019.05.20.05.25.28; Mon, 20 May 2019 05:25:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388720AbfETMX4 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 20 May 2019 08:23:56 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:59241 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388680AbfETMXy (ORCPT ); Mon, 20 May 2019 08:23:54 -0400 X-Originating-IP: 90.88.22.185 Received: from xps13 (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 36B8EFF810; Mon, 20 May 2019 12:23:34 +0000 (UTC) Date: Mon, 20 May 2019 14:23:33 +0200 From: Miquel Raynal To: masonccyang@mxic.com.tw Cc: bbrezillon@kernel.org, broonie@kernel.org, christophe.kerello@st.com, computersforpeace@gmail.com, devicetree@vger.kernel.org, dwmw2@infradead.org, geert@linux-m68k.org, juliensu@mxic.com.tw, lee.jones@linaro.org, liang.yang@amlogic.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, marcel.ziswiler@toradex.com, marek.vasut@gmail.com, mark.rutland@arm.com, paul.burton@mips.com, richard@nod.at, robh+dt@kernel.org, stefan@agner.ch, zhengxunli@mxic.com.tw Subject: Re: [PATCH v3 2/4] mtd: rawnand: Add Macronix MX25F0A NAND controller Message-ID: <20190520142333.390091d5@xps13> In-Reply-To: References: <1555320234-15802-1-git-send-email-masonccyang@mxic.com.tw> <1555320234-15802-3-git-send-email-masonccyang@mxic.com.tw> <20190512151820.4f2dd9da@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mason, masonccyang@mxic.com.tw wrote on Fri, 17 May 2019 17:30:21 +0800: > Hi Miquel, > > > > + > > > +static void mxic_nand_select_chip(struct nand_chip *chip, int chipnr) > > > > _select_target() is preferred now > > Do you mean I implement mxic_nand_select_target() to control #CS ? > > If so, I need to call mxic_nand_select_target( ) to control #CS ON > and then #CS OFF in _exec_op() due to nand_select_target() > is still calling chip->legacy.select_chip ? You must forget about the ->select_chip() callback. Now it should be handled directly from the controller driver. Please have a look at the commit pointed against the marvell_nand.c driver. [...] > > > + if (!mxic) > > > + return -ENOMEM; > > > + > > > + nand_chip = &mxic->nand; > > > + mtd = nand_to_mtd(nand_chip); > > > + mtd->dev.parent = pdev->dev.parent; > > > + nand_chip->ecc.priv = NULL; > > > + nand_set_flash_node(nand_chip, pdev->dev.parent->of_node); > > > + nand_chip->priv = mxic; > > > + > > > + mxic->mfd = mfd; > > > + > > > + nand_chip->legacy.select_chip = mxic_nand_select_chip; > > > > Please don't implement legacy interfaces. You can check in > > marvell_nand.c how this is handled now: > > > > b25251414f6e mtd: rawnand: marvell: Stop implementing ->select_chip() > > > > Does it mean chip->legacy.select_chip() will phase-out ? Yes it will. Thanks, Miquèl