From mboxrd@z Thu Jan 1 00:00:00 1970 From: Feng Tang Subject: Re: [PATCH 3/3] spi: dw_spi: refine the IRQ mode working flow Date: Wed, 20 Jan 2010 11:18:27 +0800 Message-ID: <20100120111827.6ebd4cc8@feng-desktop> References: <20100119112033.74a0f5be@feng-desktop> <4B55BFC5.506@octasic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-list , David Brownell To: Jean-Hugues Deschenes Return-path: In-Reply-To: <4B55BFC5.506-YGVykHU+fedBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Tue, 19 Jan 2010 22:20:53 +0800 Jean-Hugues Deschenes wrote: > Hi Feng, > > Feng Tang wrote: > > dws->num_cs = 4; > > dws->max_freq = 25000000; /* for Moorestwon */ > > dws->irq = pdev->irq; > > + dws->fifo_len = 40; /* FIFO has 40 words > > buffer */ > > > > ret = dw_spi_add_host(dws); > > > > > Since we'll be sharing some of our init code, as well as some of our > init values, would it be a good idea to move: > "dws->num_cs = 4;" and "dws->fifo_len = 40;" > > into dw_spi_add_host(), if no values were provided by the caller? For FIFO depth, it depends on each specific implementation based on DW core, and interface driver would better set it. If fifo_len is not set in IRQ mode, core driver will set 0 as the TX interrupt threshold, which will only trigger the TXE IRQ when the TX FIFO is fully empty. This is my design thought. For num_cs, I don't think it's a big deal to put its initialization in the interface driver :) Thanks, Feng ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev