From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by ozlabs.org (Postfix) with ESMTP id A9B44DDDF9 for ; Wed, 4 Apr 2007 21:51:06 +1000 (EST) Received: by nz-out-0506.google.com with SMTP id l1so95731nzf for ; Wed, 04 Apr 2007 04:51:03 -0700 (PDT) Message-ID: Date: Wed, 4 Apr 2007 04:51:03 -0700 From: "Vitaly Wool" To: "Sascha Hauer" Subject: Re: SPI devices and OF In-Reply-To: <20070404110916.GA9910@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed References: <20070404110916.GA9910@localhost.localdomain> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 4/4/07, Sascha Hauer wrote: > Hi, > > I'm currently writing a driver for the mpc5200 spi controller (the > dedicated one, not the PSC ones). > The driver has the form of a of_platform_driver. My problem is that I > don't know how to define the spi devices on the spi bus. My current > approach is having something like this in the OF tree: > > > spi@f00 { > device_type = "spi"; > compatible = "mpc5200b-spi\0mpc5200-spi"; > reg = ; > interrupts = <2 d 0 2 e 0>; > interrupt-parent = <500>; > mmc@0 { > device_type = "mmc_spi"; > compatible = "mmc_spi"; > }; > }; > > I can then parse the children in my spi driver with > > while( (child = of_get_next_child(odev->node, child))) { > struct spi_board_info info; > > info.max_speed_hz = > info.bus_num = > info.chip_select = > ... > spi_register_board_info(&info, 1); > } > > I think it will work this way but I found no way getting the > platform_data for the spi devices. I think that it's worth extending the current SPI core with OF support. Maybe I'll manage to get to it :) If you have something ready, please email to spi-devel-general@lists.sourceforge.net. Thanks, Vitaly