Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938836AbcJRQoa (ORCPT ); Tue, 18 Oct 2016 12:44:30 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35517 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754743AbcJRQoZ (ORCPT ); Tue, 18 Oct 2016 12:44:25 -0400 Date: Tue, 18 Oct 2016 11:44:23 -0500 From: Rob Herring To: Stephen Boyd Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman , Heikki Krogerus , devicetree@vger.kernel.org Subject: Re: [PATCH v5 03/23] usb: ulpi: Support device discovery via DT Message-ID: <20161018164423.tex3norsrdnvc5oz@rob-hp-laptop> References: <20161018015636.11701-1-stephen.boyd@linaro.org> <20161018015636.11701-4-stephen.boyd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161018015636.11701-4-stephen.boyd@linaro.org> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2102 Lines: 42 On Mon, Oct 17, 2016 at 06:56:16PM -0700, Stephen Boyd wrote: > The qcom HSIC ULPI phy doesn't have any bits set in the vendor or > product ID registers. This makes it impossible to make a ULPI > driver match against the ID registers. Add support to discover > the ULPI phys via DT help alleviate this problem. In the DT case, > we'll look for a ULPI bus node underneath the device registering > the ULPI viewport (or the parent of that device to support > chipidea's device layout) and then match up the phy node > underneath that with the ULPI device that's created. > > The side benefit of this is that we can use standard properties > in the phy node like clks, regulators, gpios, etc. because we > don't have firmware like ACPI to turn these things on for us. And > we can use the DT phy binding to point our phy consumer to the > phy provider. > > The ULPI bus code supports native enumeration by reading the > vendor ID and product ID registers at device creation time, but > we can't be certain that those register reads will succeed if the > phy is not powered up. To avoid any problems with reading the ID > registers before the phy is powered we fallback to DT matching > when the ID reads fail. > > If the ULPI spec had some generic power sequencing for these > registers we could put that into the ULPI bus layer and power up > the device before reading the ID registers. Unfortunately this > doesn't exist and the power sequence is usually device specific. > By having the device matched up with DT we can avoid this > problem. > > Cc: Greg Kroah-Hartman > Cc: Heikki Krogerus > Cc: > Cc: Rob Herring > Signed-off-by: Stephen Boyd > --- > Documentation/devicetree/bindings/usb/ulpi.txt | 20 +++++++ > drivers/usb/common/ulpi.c | 79 ++++++++++++++++++++++++-- > 2 files changed, 93 insertions(+), 6 deletions(-) > create mode 100644 Documentation/devicetree/bindings/usb/ulpi.txt Acked-by: Rob Herring