Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1125043rdb; Tue, 30 Jan 2024 08:33:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/6qXDhS43jbWVnclYnTem+5VrfD6soIoI23ic11tAv+P6fjrfS0znKQft7s2oX2gjsC1j X-Received: by 2002:a05:6a20:7529:b0:19c:a7ae:d375 with SMTP id r41-20020a056a20752900b0019ca7aed375mr3613857pzd.7.1706632435581; Tue, 30 Jan 2024 08:33:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706632435; cv=pass; d=google.com; s=arc-20160816; b=BxP3gp+zDtB96UPZI0/MqucrWkbzCoP8qiSQHy8DpO6cD6QAVAhAVFbLGbHUIzdSqw e3a8kVVPE5Up1tH/ZJH/Vsgs6eDAfqxqJW7J1pouvsKtSZsvGihQ/m1bt6U3CAMi4IJt 7IKQlnH8F6vNd6PvJMti3+IWT6hYJEiJ238u9Inqx2PSZ+XcdZKOkI7KEKBGhvYDxQY2 IGNeUhP7j4ezJMxStzUdjVNIyV+gbbQS8K7LKyIE+Ix4FctFGDMq5IEoKX7Y8QmN97gE DvVc6l6zhCipexUR4CdkH3qgBOWBM1wCkYZdF2zoOt8Iynvx7uYaeXEG80tfaNH95jMS pfgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bycNLFVVPkFg+rgPX8u0j7Km8vshueoEwQ1p4ROc4C8=; fh=5VIS6Na+3HOOfjxesToX2IUJl89MpVx/egUsILtzeJw=; b=CC4rSaIXVmV8zUIYkK5vu+fBQbPYpzxu1Z3saLhOcSPz3ILPl4LuWsrwgSA1OpWIb6 2U0L8SdRW1vsQGhC35avZr2kXH5UYfiOTBQTVHbAL2DlnqFIO3XnA47Fz23uICl5/ZvR FBV1zuc9P7+0xc4VbPcpyqoqp6+zuUigyK21/QM0owIpi6KqLrbpChWim3TkVOD7LY26 fyskdIhMCjH1ZoSpfNUGUYDbizxiP4njrg6Olru8TRjP/pJBw6rg0Jx4I8Ht5Q1A1jzO CDhJ5hzRceSL/5xrgfQn+ZrGJzzreEnxia8nWn0U7CBSSB9s1/rF8yowu7iBI9k7t5IG 1KOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Cy/SV3Ri"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-44906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ms11-20020a17090b234b00b0029045eb77a0si9480068pjb.150.2024.01.30.08.33.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:33:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Cy/SV3Ri"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-44906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B5B28B28A57 for ; Tue, 30 Jan 2024 16:11:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D20BF86ACC; Tue, 30 Jan 2024 16:11:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Cy/SV3Ri" Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 349BE86AD8 for ; Tue, 30 Jan 2024 16:11:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706631092; cv=none; b=V4BYuoNld6ea9V2COrvHMcLztznQuW2bzyHyxolOEXt0C8QFMGmDTiWMlYdIttx8FoydnxDybj4Xyo7Ay3JZGuZt+MvDUTcK9G0yqUvEHosBwLmyUeygO53F93ofN3z/SEkjs+r3EhNvoGtu9noKoSGn0sqkXw6X+4R9w6HYRpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706631092; c=relaxed/simple; bh=sYWsCKIWnBM4AENxDQMd45ylfzFl6TepGmycJDjJUG4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B1iYZRl5qP52fmLVHD5CAbWyh1VQOA/foE6ngLtXI2qvWBAqPFhHwl1QIXtCHOFyGHZiLLyS0QYP2h4MfbAktYGlpui7dPJj5pCSGeQFYOBQAsyXVt9E+wi2irYnXb3MhYkmFYFX0p9BjDE6Syt6Zr0uL7Ly3kLGosOcvGTOfyw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Cy/SV3Ri; arc=none smtp.client-ip=209.85.166.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7c00128de31so56812339f.3 for ; Tue, 30 Jan 2024 08:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706631090; x=1707235890; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bycNLFVVPkFg+rgPX8u0j7Km8vshueoEwQ1p4ROc4C8=; b=Cy/SV3RiyoPPMsmVaZXxEHPO34JAkE/pIPClbSvwgwEMMpH2pD8NOiB6FzTJrGNlgO vf8DHoSLKJM7TOeTjXBdzaU7oKMfpXJCIh3K2xSvNaQWjIzCPdhtLUY3AYgxY0dx85VM hLc0O4O58mPqULm5omiC7o4MdwJ9xUcRl3YFk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706631090; x=1707235890; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bycNLFVVPkFg+rgPX8u0j7Km8vshueoEwQ1p4ROc4C8=; b=xUNLbKPqlvmovaEzmApH54UNM1PzRQANsWsRy2NNoxTVfgrIRA5fXiHcV1sIuFEyUr S+5BmN3j8QnwkTyrUYh1X6bbaaYCYjTjJ7UJCw9bmp2wiAqDd5pEsvi/MlUF1DSWJUCa HLIbKHKmIlhr8F0F65aSwutNh7NSm1c2GUJX6n1/ZIUeb8kivkQpXVBbq0FsaubXIK2t 2XkOIkCmfpmOri2trpxbabm52GArk32dK7qSRHccZGbcG6zERrBAiKrZzLQmwBk889jL oTz9ah0xAJovztVUaNe7AyRshfLvjo8qEvlwVwl4BkGjNmq5dIQfo2HvjYPCOqRnZr3t 5o2w== X-Gm-Message-State: AOJu0Yzwhf/+qHNngujG5YH6N3P+3qygvi8BQyCxNXJaYLQ3y4/KuYZ9 zaaV4U0LPP+F2SOmtGcm1OENQmt8F5fV5Ohi0kpsbulNOi8K/aoOhXIbAvKxCQ== X-Received: by 2002:a05:6602:2d89:b0:7bf:b56c:ac25 with SMTP id k9-20020a0566022d8900b007bfb56cac25mr15008085iow.0.1706631090289; Tue, 30 Jan 2024 08:11:30 -0800 (PST) Received: from localhost (110.41.72.34.bc.googleusercontent.com. [34.72.41.110]) by smtp.gmail.com with UTF8SMTPSA id p5-20020a02b385000000b0046ebddc03fbsm2312569jan.33.2024.01.30.08.11.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jan 2024 08:11:29 -0800 (PST) Date: Tue, 30 Jan 2024 16:11:29 +0000 From: Matthias Kaehlcke To: Javier Carrasco Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 2/2] usb: misc: onboard_hub: add support for XMOS XVF3500 Message-ID: References: <20240130-onboard_xvf3500-v1-0-51b5398406cb@wolfvision.net> <20240130-onboard_xvf3500-v1-2-51b5398406cb@wolfvision.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240130-onboard_xvf3500-v1-2-51b5398406cb@wolfvision.net> Hi Javier, I understand your motivation for using the onboard_usb_hub driver for powering up a non-hub device, it feels a bit hacky to use it as is though. Re-using the driver might be the right thing to do, but then it should probably be renamed to onboard_usb_dev (or similar) and do the hub specific bits as special case. Greg, do you have any thoughts on this? Also there is an implication that might not matter for the XVF3500, but could for other non-hub devices with wakeup support: by default the driver powers the hub/device down during suspend, unless (in case of a hub) wakeup capable devices are connected. This behavior can be changed through sysfs, but the default would still be unexpected. In hindsight I think the default should have been to keep the hub powered. Not sure if it's an option to change the default at this point, since folks might rely on it (I know systems that do, but those could be adapted). We could possibly change the behavior for non-hub devices and keep the device powered if wakeup is supported and enabled m. On Tue, Jan 30, 2024 at 01:26:57PM +0100, Javier Carrasco wrote: > The XMOS XVF3500 VocalFusion Voice Processor[1] is a low-latency, 32-bit > multicore controller for voice processing. > > This device requires a specific power sequence, which consists of > enabling the regulators that control the 3V3 and 1V0 device supplies, > and a reset de-assertion after a delay of at least 100ns. Such power > sequence is already supported by the onboard_hub driver, and it can be > reused for non-hub USB devices as well. > > Once in normal operation, the XVF3500 registers itself as a USB device, > and it does not require any device-specific operations in the driver. > > [1] https://www.xmos.com/xvf3500/ > > Signed-off-by: Javier Carrasco > --- > drivers/usb/misc/onboard_usb_hub.c | 2 ++ > drivers/usb/misc/onboard_usb_hub.h | 6 ++++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c > index 0dd2b032c90b..f16ea3053f84 100644 > --- a/drivers/usb/misc/onboard_usb_hub.c > +++ b/drivers/usb/misc/onboard_usb_hub.c > @@ -366,6 +366,7 @@ static struct platform_driver onboard_hub_driver = { > #define VENDOR_ID_REALTEK 0x0bda > #define VENDOR_ID_TI 0x0451 > #define VENDOR_ID_VIA 0x2109 > +#define VENDOR_ID_XMOS 0x20B1 > > /* > * Returns the onboard_hub platform device that is associated with the USB > @@ -458,6 +459,7 @@ static const struct usb_device_id onboard_hub_id_table[] = { > { USB_DEVICE(VENDOR_ID_TI, 0x8142) }, /* TI USB8041 2.0 */ > { USB_DEVICE(VENDOR_ID_VIA, 0x0817) }, /* VIA VL817 3.1 */ > { USB_DEVICE(VENDOR_ID_VIA, 0x2817) }, /* VIA VL817 2.0 */ > + { USB_DEVICE(VENDOR_ID_XMOS, 0x0013) }, /* XMOS XVF3500 */ > {} > }; > MODULE_DEVICE_TABLE(usb, onboard_hub_id_table); > diff --git a/drivers/usb/misc/onboard_usb_hub.h b/drivers/usb/misc/onboard_usb_hub.h > index f360d5cf8d8a..1809c0923b98 100644 > --- a/drivers/usb/misc/onboard_usb_hub.h > +++ b/drivers/usb/misc/onboard_usb_hub.h > @@ -56,6 +56,11 @@ static const struct onboard_hub_pdata vialab_vl817_data = { > .num_supplies = 1, > }; > > +static const struct onboard_hub_pdata xmos_xvf3500_data = { > + .reset_us = 1, > + .num_supplies = 2, > +}; > + > static const struct of_device_id onboard_hub_match[] = { > { .compatible = "usb424,2412", .data = µchip_usb424_data, }, > { .compatible = "usb424,2514", .data = µchip_usb424_data, }, > @@ -77,6 +82,7 @@ static const struct of_device_id onboard_hub_match[] = { > { .compatible = "usbbda,5414", .data = &realtek_rts5411_data, }, > { .compatible = "usb2109,817", .data = &vialab_vl817_data, }, > { .compatible = "usb2109,2817", .data = &vialab_vl817_data, }, > + { .compatible = "usb20b1,0013", .data = &xmos_xvf3500_data, }, > {} > }; > > > -- > 2.39.2 >