From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757583AbZE1DFy (ORCPT ); Wed, 27 May 2009 23:05:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753726AbZE1DFp (ORCPT ); Wed, 27 May 2009 23:05:45 -0400 Received: from bilbo.ozlabs.org ([203.10.76.25]:39476 "EHLO bilbo.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbZE1DFp (ORCPT ); Wed, 27 May 2009 23:05:45 -0400 Date: Thu, 28 May 2009 13:04:30 +1000 From: David Gibson To: Grant Likely Cc: Jean-Christophe PLAGNIOL-VILLARD , devicetree-discuss , Russell King - ARM Linux , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk, Jon Smirl , Scott Wood , Janboe Ye , Timur Tabi Subject: Re: [RFC] [PATCH] Device Tree on ARM platform Message-ID: <20090528030430.GE1464@yookeroo.seuss> Mail-Followup-To: Grant Likely , Jean-Christophe PLAGNIOL-VILLARD , devicetree-discuss , Russell King - ARM Linux , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk, Jon Smirl , Scott Wood , Janboe Ye , Timur Tabi References: <87vdnm8sec.fsf@macbook.be.48ers.dk> <4A1D6901.2090508@freescale.com> <20090527175609.GB31861@flint.arm.linux.org.uk> <4A1D8FBA.6040802@freescale.com> <9e4733910905271213k7f4b93e7i7e6f2af24d85f@mail.gmail.com> <20090527192116.GA31110@n2100.arm.linux.org.uk> <20090527193927.GD30039@game.jcrosoft.org> <20090527201951.GF30039@game.jcrosoft.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2009 at 02:54:10PM -0600, Grant Likely wrote: > On Wed, May 27, 2009 at 2:19 PM, Jean-Christophe PLAGNIOL-VILLARD > wrote: > >> One option that has been suggested (more than once) is to make the > >> adapter code an of_platform_driver which translates the device tree > >> data and then registers the appropriate platform_devices.  This neatly > >> solves the problem, but I don't like the overhead involved in > >> registering 2 struct devices with the kernel for every device node in > >> the device tree. > > but simplify the dev and maintaining is also an important goal. > > > > Have to duplicated ressource handling via ifdef in every drivers is also an > > overhead which need to be avoided > > agreed. I don't have a best of both worlds answer here. I do. As intimated other places in this thread, I think the right approach is to register constructor functions that will be used during boot to traverse the OF devtree and instantiate platform devices (or other device types in some cases, e.g. i2c). The driver will then bind to the platform device this created. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [RFC] [PATCH] Device Tree on ARM platform Date: Thu, 28 May 2009 13:04:30 +1000 Message-ID: <20090528030430.GE1464@yookeroo.seuss> References: <87vdnm8sec.fsf@macbook.be.48ers.dk> <4A1D6901.2090508@freescale.com> <20090527175609.GB31861@flint.arm.linux.org.uk> <4A1D8FBA.6040802@freescale.com> <9e4733910905271213k7f4b93e7i7e6f2af24d85f@mail.gmail.com> <20090527192116.GA31110@n2100.arm.linux.org.uk> <20090527193927.GD30039@game.jcrosoft.org> <20090527201951.GF30039@game.jcrosoft.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: Grant Likely Cc: devicetree-discuss , Russell King - ARM Linux , Janboe Ye , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Timur Tabi , Jon Smirl , Scott Wood , linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org List-Id: devicetree@vger.kernel.org On Wed, May 27, 2009 at 02:54:10PM -0600, Grant Likely wrote: > On Wed, May 27, 2009 at 2:19 PM, Jean-Christophe PLAGNIOL-VILLARD > wrote: > >> One option that has been suggested (more than once) is to make the > >> adapter code an of_platform_driver which translates the device tree > >> data and then registers the appropriate platform_devices. =A0This neat= ly > >> solves the problem, but I don't like the overhead involved in > >> registering 2 struct devices with the kernel for every device node in > >> the device tree. > > but simplify the dev and maintaining is also an important goal. > > > > Have to duplicated ressource handling via ifdef in every drivers is als= o an > > overhead which need to be avoided > = > agreed. I don't have a best of both worlds answer here. I do. As intimated other places in this thread, I think the right approach is to register constructor functions that will be used during boot to traverse the OF devtree and instantiate platform devices (or other device types in some cases, e.g. i2c). The driver will then bind to the platform device this created. -- = David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson