Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542Ab1CWFp2 (ORCPT ); Wed, 23 Mar 2011 01:45:28 -0400 Received: from gate.crashing.org ([63.228.1.57]:55148 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752543Ab1CWFp0 (ORCPT ); Wed, 23 Mar 2011 01:45:26 -0400 Subject: Re: RFC: Platform data for onboard USB assets From: Benjamin Herrenschmidt To: Nicolas Pitre Cc: andy.green@linaro.org, Jaswinder Singh , Linux USB list , lkml , arnd@arndb.de, broonie@opensource.wolfsonmicro.com, roger.quadros@nokia.com, greg@kroah.com, grant.likely@secretlab.ca In-Reply-To: References: <4D79F068.2080009@linaro.org> <1300828125.2402.300.camel@pasglop> <4D8924B6.8040403@linaro.org> <1300842219.2402.309.camel@pasglop> <1300850595.2402.320.camel@pasglop> Content-Type: text/plain; charset="UTF-8" Date: Wed, 23 Mar 2011 16:44:55 +1100 Message-ID: <1300859095.2402.339.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 35 On Wed, 2011-03-23 at 00:21 -0400, Nicolas Pitre wrote: > > I wholeheartedly agree with that idea. One thing that bothers me about DT > is its tendency to show up deep into the guts of kernel code all over > the place. If a generic abstraction can be put in place, such as this > get_device_attribute() example, then it is far more convenient to use > DT, or _eventually_ use DT, or even _not_ use it in some cases but > something else, without battling over the actual interface I've always tried to take the approach on powerpc when designing an important feature such as the virtual IRQ remapping, to make the device-tree use a "useful add-on" without making it entirely necessary. To continue on that example, the low level irq_domain (irq_host but being renamed) only carries the OF pointer as a "token" (I think at some point I even had it a void *), and the low level APIs for establishing the mapping between a domain/hw_irq and virq don't rely on any device-tree bits at all. However, helpers built on top of that (along with one "translation" callback in the irq domain itself) provide the device-tree integration which makes the whole thing a lot easier to use. But we still use the low level bits in some areas, old machines with broken DT, hard wired interrupt numbers coming from firmware, etc... Cheers, Ben. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/