Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp186174rdb; Wed, 14 Feb 2024 17:52:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUE+DoBb9icgIwkesu5sbYRebthG+He51dyps0RUyXTJYdTLPw+6e6zSR5ko+QRnOy+f7pvH9tlnGapySH9YN4NSXCJJGhvZe3bYpNuuQ== X-Google-Smtp-Source: AGHT+IFpI1wOOR1icTPoK620zas92UVeZQv6A72dcOyIWyK3j8srmJMEcoQ5jnyzZutPvrgT2Kot X-Received: by 2002:a05:6214:5691:b0:68f:1427:787d with SMTP id qm17-20020a056214569100b0068f1427787dmr1225221qvb.21.1707961967038; Wed, 14 Feb 2024 17:52:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707961967; cv=pass; d=google.com; s=arc-20160816; b=terJ/ifSr3TQ68OnzSzAK+WqW/MY7o4BfGoxsslSHvWp4WZ+Csa29AxsYnMnZ1eIUd lzkilVhDvRIfsYMLD3yTIkcBtYbQ1FDiX4ghfjNR3kPJVMVv7V6ImFHrDIVz/qyyZAvC aHobne+DqxILD7DKHRdHiAK5OUcFcMFiqvD7R7ESMKlLqKhWYrSrWZsJmio4OT6Jb7xs /ikRO7WVnEKnPvetRRxXRrBd5L++0cYpVsOM1NFwZcpWqz2TM8e6ksk+0PxKxVRd3EmU yc+RbVihZzHUZVVTNZuFLmUS02gaCxdE0qEtlTBc8GF5U9IIqARxYkozMirqJxWBXNZJ b53g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=lUDhpSWaktAHgDMHaIrpDrRKHGUYByMrZIOMk1w7exc=; fh=3Knr+q92OUnu+73vfcDdT20HwZVZWBip2xUvkGvUc0g=; b=H535UZ+VixZ1qPoSGtiPoA9KLK0gd3cglQlYAlplgQSXZTdXifwiTabX7lw6xtJK3g GWHrSCspAdqS/VYoGLu/cGNqvJc0yg6QA4O7FI06Zzs7+QPSxPRrTGEXzvQO2ajYfKfT mxOPAsatCYjg49bXR8VOu912mSvvo57HI4x/L85n2s1CuZIzLGaX8KVlNbiQvjBXY5VV yy3yzrI54f+acxpAO4Vp8Wyki4lKmZu9V4tX8OEstUoFdWqkwzTN2Ku3glMdyoDjDTnx hb2euBfzwYvOt02+W/cu/EV232y7OzYoHJ5j7RbSCA59//vVbtyfC6S9OhsBHxWLvUGv 1JWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=knnoSljP; 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-66231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fn11-20020ad45d6b000000b0068ca70ec311si422842qvb.167.2024.02.14.17.52.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:52:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=knnoSljP; 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-66231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66231-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BA7C21C22B3D for ; Thu, 15 Feb 2024 01:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19D6D4409; Thu, 15 Feb 2024 01:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="knnoSljP" Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 75898184E for ; Thu, 15 Feb 2024 01:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707961959; cv=none; b=aul2esPkPsvTowi/Co2M+Vwgu4VLSNauSryDyOIGQTa9gbtYCSQW5d/WD8PiCl/kyIc7350iYbUxjHg1/D/fRMrZa+pU8ighWaM+GTV/ENafMwl8eck76Mh9y12GLDZeHmXUeAMjpffH7A/TP1r7eBKu9AroPPbk2smWxZBrBDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707961959; c=relaxed/simple; bh=WM4lIFwJI9aZm3EQ8zP4FUSooeEH5PxJSUNKg7XTZcc=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mTUs3XDHqnMKLbduRn9ohfdBGjK28ntI3e+Yvf6lXj78V/QFispX4J5mbEBG8wezeeWsCHnzZh1UIJQA9uJxqcoRiih9UQrqb+1cKqGKssPJ3Ght3o3ZonO0JqL7+5gZyQcvsvquCeQgJKs/Zo4rZDNICkeYhiZP4yhM0cI3Zsc= 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=knnoSljP; arc=none smtp.client-ip=209.85.167.43 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-lf1-f43.google.com with SMTP id 2adb3069b0e04-51171c9f4c0so440990e87.3 for ; Wed, 14 Feb 2024 17:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707961954; x=1708566754; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=lUDhpSWaktAHgDMHaIrpDrRKHGUYByMrZIOMk1w7exc=; b=knnoSljPUP+DM1q4EMtV2bDAAb6wIdB1rpq5jDDQp977DvZOKlJHbAOcoHZfTeY/hT VlMqL+2IXbDcD+Xyax7DAc0CZc6hV/UkpDgJLcPE0NDSZr/L1qbCUHcbRIfNyI18WnSV Eny5jKbXMoEjZaLIrpMF0G91ntEWWActU7VM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707961954; x=1708566754; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lUDhpSWaktAHgDMHaIrpDrRKHGUYByMrZIOMk1w7exc=; b=n6sUroGvsNb1W08jDI9E4oQjrUVnQZw1+LgHVaDB9BjpFiumqBhPuGoFDwygB1tVJ+ Mpm0CKN6NihAnD3n2E5gQexskFwajZhJ99dgDVCm3VfdZMgUJj55HPKhePVAqdVK26Mc Zpl1QW4HNtEwgPU+dfTywbtPewpXl21hYI3iheXErWLw2pSc6+lzSbZ2fAu/oXAuQB0x komvJWsFJlaZyBdVTiSO0qY7d2sCi2/Ge58mqwauIPYv1VSu8+KjGwC12nIajZihEzVB J3u1hcDDkWGzbf77zHiSLBZH6GQMO1HoF3C6L6lMj6KIvNJavSI8vgtLBqWd7sVIQqVV oo2w== X-Gm-Message-State: AOJu0YzMDH9E+iIO4/fWE0b0iModnBrZDTrG0y/25Gr6g6DlvSQPuyLV eJIaS+V6RMBoKWaeD+mGl4b6yx/6qCjKBDhewXE/T6EvV55HRK6AlonjAv4Thk2du9hZsx+0Qum eU/mlGwExWJfYp5PqhK/035Jcv7QnXZqPnT1w X-Received: by 2002:a05:6512:2c8f:b0:512:88a8:1520 with SMTP id dw15-20020a0565122c8f00b0051288a81520mr107848lfb.18.1707961954357; Wed, 14 Feb 2024 17:52:34 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 14 Feb 2024 17:52:33 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <46ac6ab8-b0a5-497d-91b6-1d2ced33184b@linaro.org> References: <20240210070934.2549994-1-swboyd@chromium.org> <20240210070934.2549994-14-swboyd@chromium.org> <46ac6ab8-b0a5-497d-91b6-1d2ced33184b@linaro.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Wed, 14 Feb 2024 17:52:33 -0800 Message-ID: Subject: Re: [PATCH 13/22] dt-bindings: chrome: Add google,cros-ec-typec-switch binding To: Krzysztof Kozlowski , chrome-platform@lists.linux.dev Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Douglas Anderson , Pin-yen Lin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Benson Leung , Guenter Roeck , Prashant Malani , Tzung-Bi Shih Content-Type: text/plain; charset="UTF-8" Quoting Krzysztof Kozlowski (2024-02-11 05:34:25) > On 10/02/2024 08:09, Stephen Boyd wrote: > > Add a binding for the USB type-c switch controls found on some ChromeOS > > Embedded Controllers (ECs). When this device is a mode switch, it takes > > one DisplayPort (DP) port as input and some number (possibly zero) of > > USB SuperSpeed ports (bundles of USB SS lanes) as input, and muxes those > > lanes into USB type-c SuperSpeed lanes suitable for the SSTRX1/2 pins on > > a usb-c-connector. When this device is an orientation switch, it > > redirects the DP lanes to the proper USB type-c SSTRX lanes. > > > > Cc: Rob Herring > > Cc: Krzysztof Kozlowski > > Cc: Conor Dooley > > Cc: Lee Jones > > Cc: Benson Leung > > Cc: Guenter Roeck > > Cc: Prashant Malani > > Cc: Tzung-Bi Shih > > Cc: > > Cc: > > Cc: Pin-yen Lin > > Signed-off-by: Stephen Boyd > > --- > > .../chrome/google,cros-ec-typec-switch.yaml | 365 ++++++++++++++++++ > > .../bindings/mfd/google,cros-ec.yaml | 5 + > > 2 files changed, 370 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/chrome/google,cros-ec-typec-switch.yaml > > > > diff --git a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec-switch.yaml b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec-switch.yaml > > new file mode 100644 > > index 000000000000..17a0ba928f5d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec-switch.yaml > > @@ -0,0 +1,365 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/chrome/google,cros-ec-typec-switch.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Google Chrome OS EC(Embedded Controller) USB Type C Switch > > + > > +maintainers: > > + - Benson Leung > > + - Prashant Malani > > + - Stephen Boyd > > + > > +description: > > + Chrome OS devices have an Embedded Controller(EC) which has access to USB > > + Type C switching. This node is intended to allow the OS to control Type C > > + signal muxing for USB-C orientation and alternate modes. The node for this > > + device should be under a cros-ec node like google,cros-ec-spi. > > + > > If this is USB Type C switch, then you miss reference to > usb-switch.yaml, but then ports look a bit different. Thanks for the pointer. I suspect that's in linux-next only? I'm going to move this to the cros-ec-typec.yaml file but I'll still need some sort of property like 'mode-switch' or 'orientation-switch' to describe what needs to be done in the kernel by changing lane assignments in the drm_bridge. One problem with those properties is that they're boolean for the whole device. If I have a google,cros-ec-typec node that has two input DP ports and two output USB-C ports then it may be that one port needs orientation switching and the other only needs to do mode switching. This needs to be expressed somehow and a top-level boolean property doesn't do that. It could be part of the DP endpoint node itself. Also I don't know how to indicate that mode switching can't be changed here directly. For example, on Trogdor the mode is switched by the EC, and the kernel can't change the mode. Changing DP lane assignments isn't going to change the situation either. The mode is still going to be something like DP+USB, or just DP, etc. Maybe there needs to be a different property, like 'dp-mode-lane-assignment = ', that indicates which DP ports need to do lane assignment or 'dp-orientation-lane-assignment = ' for orientation control. Either way, I'm saying that 'mode-switch' and 'orientation-switch' properties don't make any sense here. I was using them to wedge the code into the typec switch callbacks, but if I move this into the cros-ec-typec driver then I don't need them. > > > + > > + no-hpd: > > + description: Indicates this device doesn't signal HPD for DisplayPort > > + type: boolean > > + > > + ports: [...] > > + > > + endpoint@7: > > + $ref: /schemas/graph.yaml#/$defs/endpoint-base > > + description: USB-C data for EC's 7th type-c port > > + unevaluatedProperties: false > > + properties: > > + data-lanes: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + description: | > > + An array of physical USB-C data lane indexes. > > + - 0 is SSRX1 lane > > + - 1 is SSTX1 lane > > + - 2 is SSTX2 lane > > + - 3 is SSRX2 lane > > + minItems: 4 > > + maxItems: 4 > > + items: > > + maximum: 3 > > + > > + anyOf: > > + - required: > > + - endpoint@0 > > I don't get what you want to say here. This anyOf should have no effect. I'm trying to say that there should be at least one usb-c data lane output endpoint if there's a port@2 (usb-c output). > > > + - required: > > + - endpoint@1 > > + - required: > > + - endpoint@2 [...] > > > + > > +required: > > + - compatible > > + - ports > > + > > +allOf: > > + - if: > > + properties: > > + no-hpd: true > > I don't understand this either. What is it for? Where did you see such > syntax? This is saying that if the no-hpd property is present then the port@0 port (DP input port) is required. Otherwise no-hpd doesn't really make any sense because this device isn't muxing DP onto USB type-c connectors. I found this syntax by searching the schema website and reading this page[1]. The last yellow note about "country" not being a required property led me to this syntax. [1] https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse