Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp703906pxb; Thu, 2 Sep 2021 13:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj0Y26HdHBRCIQYbQN0brKMHhfpovMEcT+d27QE6keQtXgGx5DFjMmHMWwzdVEunRiD+kJ X-Received: by 2002:a05:6402:28a9:: with SMTP id eg41mr74468edb.87.1630613067231; Thu, 02 Sep 2021 13:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630613067; cv=none; d=google.com; s=arc-20160816; b=owi3PPSomZalMc4pXCq5WNnSLmOH1Hx7Lc/T9LRGKW/50JIOPRjcL26th689QlXFnq SdXsOwdoripvBtneuTeenC5VEvxmsSxep9nGTwzzcbmAHjtwPEX8PrL6n9RfeY+adRHG mBMCAQHXyMWD1smslCsyxseLZj+u+2Jx1qIq+Y9Eapn2dCH+VtQGGJiUmgMfJLdxoEoA uK4L3eRbds6zxaq5uWWm2xNLrlzRnn68em3EC7ze3GUlWWqiY+/UwWzgkrwctKNygRcj kD1tZ3FqOXvyyMtOU1aY6QZ9MTnQomyqy5SzqSpfwh4qlXwHXu4SknGEw8f75h7LJj63 BiCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WLGA2W6ylaRD9EFHtR/JzULWpysSlVFiHurPGxUeWPw=; b=zuzK7Qqvvsa5YjHWijq1751o44z0270CSCLiq7qm8ocWRB4dAD5A7xze+SZprYk96M XJN5vEvjPusGs/GMmpp8MR6DF/3AsAI8AGL85ebvAZ1uZXcPGSRxyzCjHDwXY2giGa/O SJTw/cy3g5pZFEY1EJMockz4R6LK89g1808BqAFbQkXKCRPMiacUqcUcw8IQYhXufnFq yy+u0euPYEPc8E3VeouuMt3bbBImlAnJtsbSw6FurjGNt14K0XIWnkA5jJ07Y7EnAUdO ThQsC5lm0toxEGYROA6AGar+6iiG5KBhVE1IVyXSreeC1LnAOQvQvbth8eedktgTvPRe mUnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fh2KY5je; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx15si2798449edb.90.2021.09.02.13.04.03; Thu, 02 Sep 2021 13:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fh2KY5je; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345613AbhIBOge (ORCPT + 99 others); Thu, 2 Sep 2021 10:36:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:42960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345521AbhIBOgc (ORCPT ); Thu, 2 Sep 2021 10:36:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C93E61054; Thu, 2 Sep 2021 14:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630593334; bh=rDULfIG9M/DWzjLWEHNfJHpWjGpsncVKy7EEzUhYiHw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Fh2KY5jeJU4xZJFiIn6CdVtagIP75GFsTmluW6be+ANQwNyr8wrsPrILDxPyShuq2 03AKaUV/npeD2y2XEyJ8TM7BuSXWsiBFjgYiM7s1+r60jUz+FaLOOjahBFxRY/3rX0 Clzp5AuFPkwJctYg8zeV5g5J5LWeqkkE++mLYlpQUoDlQRmVZBBU6IT5jps0J/iIxS pNtTJwlMOx9W3rMSupzwP2K8QvZsc/sPuOG3WpaKCBueJkhJD6Sg0Z1Q/GX+KUDxkd FClPOPA+u0GCpEM0T2uU7JPm0odzcCu1dPWUK2uYXS9roi4xnzCQ+iA7NACTZ/ZF3Q 7zS2hQf4FdlqA== Date: Thu, 2 Sep 2021 16:35:29 +0200 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman Cc: Rob Herring , linuxarm@huawei.com, mauro.chehab@huawei.com, John Stultz , Arnd Bergmann , linux-kernel@vger.kernel.org, Matthias Kaehlcke Subject: Re: [PATCH v3 2/4] misc: hisi_hikey_usb: change the DT schema Message-ID: <20210902163529.734b8e0e@coco.lan> In-Reply-To: References: <20210902151053.7ddfbe3a@coco.lan> <20210902153820.5624b57f@coco.lan> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 2 Sep 2021 15:56:36 +0200 Greg Kroah-Hartman escreveu: > On Thu, Sep 02, 2021 at 03:38:20PM +0200, Mauro Carvalho Chehab wrote: > > Em Thu, 2 Sep 2021 15:10:53 +0200 > > Mauro Carvalho Chehab escreveu: > > > > > Em Thu, 2 Sep 2021 13:40:28 +0200 > > > Greg Kroah-Hartman escreveu: > > > > > > > On Thu, Sep 02, 2021 at 01:28:35PM +0200, Mauro Carvalho Chehab wrote: > > > > > As there's no upstream DT bindings for this driver, let's > > > > > update its DT schema, while it is not too late. > > > > > > > > So this is for 5.15-final? > > > > > > It can either be for 5.15 or 5.16, as there aren't any compatible > > > under arch/ which uses the DT schema there. All patches adding > > > such compatible are on this series. So, whatever version this > > > is applied should be OK. > > > > On a separate note, despite having "hisi_" on this driver's name, there's > > nothing there that is really HiSilicon specific. What this driver does is > > to control an USB HUB integrated inside a DT-based board, doing those > > functions: > > > > - Power on/off the chip; > > - reset the HUB; > > - control its OTG switch; > > - control power on/off for an USB type-C connector; > > - set USB role as host or device. > > > > This is used on both HiKey 960 and HiKey 970 with the following > > topology: > > > > +-----+ +--------+ +---------+ > > | SoC | ---> | USB PHY| ---> | USB HUB | ---> USB 3.0 > > +-----+ +--------+ +---------+ and type-C ports > > > > Both Kirin 960 and 970 SoCs have a Synapsys IP (DWC 3). > > > > Both HiKey 960 and 970 cards use Richtek RT1711H Type-C Chip Driver > > as part of the USB PHY logic, but they use different USB HUBs: > > > > - HiKey 960 use a Microchip USB5734 HUB > > - HiKey 970 use a TI TUSB8041 HUB > > > > While I'm not sure how generic this driver can be, I'm thinking that > > maybe a future patch could rename it to 'generic-usb-hub' or > > something similar - finding a good name is always the hardest > > part :-) > > Try looking at: > https://lore.kernel.org/r/20210813195228.2003500-1-mka@chromium.org > for another example of this. (C/C Matthias here). Interesting to know that someone else is also needing to add support for USB chips. Yet, the approach took there won't work with HiKey 960/970, as it needs to control not only the regulator, but it should also work as as usb-role-switch. So, besides controlling the regulator, which seems to be basically what the onboard_usb_hub_driver does, but it should also be able to: - (optionally) reset the HUB; - control its OTG switch; - control power on/off for an USB type-C connector; - set USB role as host or device. Perhaps it would be possible to merge both approaches by modifying hisi_hikey_usb in order to add the extra bits required by the boards that Matthias is currently working, and requiring the GPIOs for OTG and type-C connectors only if DT contains usb-role-switch. Thanks, Mauro