From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Hugues Deschenes Subject: Re: [PATCH] spi/dw_spi: add a FIFO depth detection Date: Thu, 21 Jan 2010 08:07:35 -0500 Message-ID: <4B585197.10507@octasic.com> References: <20100121105139.3d0fbd42@feng-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-list , David Brownell To: Feng Tang Return-path: In-Reply-To: <20100121105139.3d0fbd42@feng-desktop> 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 Feng Tang wrote: > + > + /* > + * Try to detect the FIFO depth if not set by interface driver, > + * the depth could be from 2 to 256 from HW spec > + */ > + if (!dws->fifo_len) { > + u32 fifo; > + for (fifo = 2; fifo <= 257; fifo++) { > + dw_writew(dws, txfltr, fifo); > + if (fifo != dw_readw(dws, txfltr)) > + break; > + } > + > + dws->fifo_len = (fifo == 257) ? 0 : fifo; > + dw_writew(dws, txfltr, 0); > + } > } > > int __devinit dw_spi_add_host(struct dw_spi *dws) > Just what I was looking for; thanks! Acked-by: Jean-Hugues Deschenes ------------------------------------------------------------------------------ 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