From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935006AbdKPQMv (ORCPT ); Thu, 16 Nov 2017 11:12:51 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:56455 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759025AbdKPQMo (ORCPT ); Thu, 16 Nov 2017 11:12:44 -0500 X-Google-Smtp-Source: AGs4zMZ1xWejOzWmkEFeEV/sYr3p24U1QZqnxmFa046xUFFAeCCdO8/tcAdiOfz+Gkjc3Vy6VVrKQQ== Date: Thu, 16 Nov 2017 17:12:49 +0100 From: Johan Hovold To: Rob Herring Cc: Johan Hovold , Greg Kroah-Hartman , Mark Rutland , Arnd Bergmann , Alan Stern , Peter Chen , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Florian Fainelli Subject: Re: [PATCH 0/8] USB: add device-tree support for interfaces Message-ID: <20171116161249.GJ11226@localhost> References: <20171109170723.10960-1-johan@kernel.org> <20171116144321.hlp6em77t56e5nly@rob-hp-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171116144321.hlp6em77t56e5nly@rob-hp-laptop> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 16, 2017 at 08:43:21AM -0600, Rob Herring wrote: > On Thu, Nov 09, 2017 at 06:07:15PM +0100, Johan Hovold wrote: > > This series adds support for representing USB interfaces in device tree > > by implementing support for "interface nodes" and "combined nodes" from > > the OF specification. > > > > This is needed to be able to describe non-discoverable properties of > > permanently attached USB devices and their interfaces such as any > > i2c-clients connected to a USB-i2c bridge (e.g. the dln2 mfd) or, > > eventually, devices connected to usb-serial converters (to be used with > > serdev). > > In the original OF binding, the firmware dynamically generated the tree > for the active configuration AIUI. That doesn't really fit for the > (mostly) static FDT usage and why we stopped at the device level. So how > do we handle multiple configs? Or can we assume that if say the I2C bus > is used, then there's only one config and interface that can use it? Multiple configuration can be used to implement different sets of functionality. A hypothetical device could have one i2c controller in one configuration and two in another. Most devices will only have one configuration though. A USB interface implements some functionality of the device (and this is what Linux USB drivers bind to). So even for single-configuration devices, you need to be able to say which i2c controller (bus) you are describing. [ And as a simplification, the combined nodes can be used for most cases were we only have one configuration with a single interface. ] Note that a new set of interfaces (in the kernel device model) is created when a new USB device configuration is selected. These new interfaces will be associated with any matching device-tree interface nodes and that these would be distinct from any nodes that matches another configuration. So I don't think there's any problem with dealing with the rare cases of multi-configuration devices. Johan