From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B58B4DE089 for ; Thu, 22 May 2008 05:12:07 +1000 (EST) In-Reply-To: References: <20080516193054.28030.35126.stgit@trillian.secretlab.ca> <20080516193613.28030.13950.stgit@trillian.secretlab.ca> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <716a0f1b6c9a544b480c06a329072483@kernel.crashing.org> From: Segher Boessenkool Subject: Re: [PATCH 3/4] spi: Add OF binding support for SPI busses Date: Wed, 21 May 2008 21:11:42 +0200 To: Guennadi Liakhovetski Cc: fabrizio.garetto@gmail.com, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, dbrownell@users.sourceforge.net, spi-devel-general@lists.sourceforge.net List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > Ok, elegance apart:-) You can use the SPI-bridge construct to also > describe simple SPI-chipselect configurations. But is it really a good > idea? Wouldn't it be better to handle these two cases separately? It would be best to handle all these things that are specific to a certain SPI controller (like how CSs work) in the binding for that SPI controller, and not try to shoehorn all of this into some artificial generic framework. If you can have identical addresses on the SPI bus going to different devices based on which CS is asserted, you'll have to make the CS part of the "reg". Example: spi-controller { #address-cells = 2; #size-cells = 0; some-device@0,f000 { reg = < 0 f000 >; } // CS 0, SPI address f000 some-device@1,f000 { reg = < 1 f000 >; } // CS 1, SPI address f000 some-device@1,ff00 { reg = < 1 ff00 >; } // CS 1, SPI address ff00 } SPI-to-SPI bridges can (and should!) be handled the same way as anything-to-anything-else bridges are handled as well: either there is a nice simple one-to-one matching (and you can use "ranges") or you need a driver for that bridge that knows how to make it work (or both, "ranges" isn't always enough, the bridge might require some specific handling for some special situations -- error handling, suspend, whatever). Segher