Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp892950rdg; Fri, 13 Oct 2023 04:39:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2v9LBwTUkBv3GlnfjK5Hd4cF6wbyLQfBvTwUkpFDJgWV4JsFJOBd2OSranshyvtfDfzH+ X-Received: by 2002:a05:6a20:7f86:b0:15e:a46f:fcfc with SMTP id d6-20020a056a207f8600b0015ea46ffcfcmr31127843pzj.21.1697197142600; Fri, 13 Oct 2023 04:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697197142; cv=none; d=google.com; s=arc-20160816; b=ztQoVp/MYGByFrGsdNDw9z//t7iHnnsVPeuEW2i3jaMZBvKlo5ID5Qy8WX+32lKf6O dZyQrORLmdrBtnyt05ltidCzoeG+ugfNYFON4WMBfKR3qZHjdjUocAvm3Od7xoNlxI28 i9O0x3Jm0iziQTB9z9EKWNdEzyYY7qiH5ATLBCTuOJgt0qiaXY1+C9+dhGWIPfj66ujA OpLJeCtTvbtxt7H9YVAwTI305gSvJTPtNkb4Yw/OGRMDLmNLpjXTj/VLmxgS6fdBqK2/ nlaVM32fQ8k5FQkrvHwdhvHyC7/RsYkcWlR+kkoKF6455lss7bySeZQRPtIoxuOjJzFn ytew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=aeuzswEtGNcv7PN7p/vCAjwlSADLyM73/cH0LYcA47I=; fh=ghpUNpHqcNrQIocPjfnwe/5quPeBE+ramd9T7xbSKxs=; b=dkyjUBO3Jb7QhlPoij8vsC0JLWhYGE3ddakAvFhBWzob2ZKWqVby2tC8U7IR8hCbyJ ZRfK2QuxFqOzToLqsdoFeMagEFj/LQ9pycj/Ts1/zxj7Rq0EtV5M6Yku+1IiR5//66qN Kpvvb1k8Kib8osWzOu8HLsxd88xbhfqYgkiuvnJmtBFar3pSIIykXtLODfTV0BfOVES8 vPGErfQWFiSPfW1TmHfKbA8N+OMwOJAcmOb4PrU1alETG5w99Gk1ci+S01Ak0dG6zt3u Y9UN9O6xuBJYXhrwJPuJS2tlY/I5lbB5RljSmsPI0W5+cPQfCALvwDt9FlcoHVGCaPXv WJFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZmG025V4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n11-20020a170902968b00b001c624237977si4007081plp.252.2023.10.13.04.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:39:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZmG025V4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C44A2826C614; Fri, 13 Oct 2023 04:38:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231419AbjJMLiU (ORCPT + 99 others); Fri, 13 Oct 2023 07:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjJMLiN (ORCPT ); Fri, 13 Oct 2023 07:38:13 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24A15E4 for ; Fri, 13 Oct 2023 04:38:10 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53e0d21a4easo2910266a12.1 for ; Fri, 13 Oct 2023 04:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1697197088; x=1697801888; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=aeuzswEtGNcv7PN7p/vCAjwlSADLyM73/cH0LYcA47I=; b=ZmG025V4vsuxTVnYWAODi8mvbnl85+h9aWrAZT1KH17ad2i25YNQ/lktE+zpZUdv6V dNsnqA3Cwuxbf2V7QlNpo3AyWsZmkWi6UiezX4AoQnT50DexT3xX2mVSQwJqM36spO/M t9c13ciJUwGCVPbEreHdBmLjdptx78xcLSzv1QAXRkNx5M/pt8jfApSZHoGRJ4EZo7jj 4Nbe3hUNqyXGMXWIH3PpkwqlNc7QtoD8qDPMNBhLC4lZHNNuwVf3g1P4fYIhZAk039aV LFxsPUHWx9o2lUip9BItNflyH20FX9/URpnrhyNUkDyRGkuKybguQoY6iYvRvT4DeJDX SUHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697197088; x=1697801888; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aeuzswEtGNcv7PN7p/vCAjwlSADLyM73/cH0LYcA47I=; b=JhRx77WZfczcEmgBneH0O1YddJhhQW5BDTOel+01Slqrgu2CKONSO+Xacq6mtMEucv oqExOIvWOtYiSNd89YElKDm8gGLFQ8+6FnFcnY2Sf+RkHDmJVHH7FwPcoHc/rDQzr5oa Xf0Q71/V9iblvNLgFbQNXLAEXqLqNjrhxmec2yMrHncOfTvxP67R00R/x756vVxO9k6o niQc3++X42gNqm86oQ4td+nq+CXQSTAFp4TDL+1vvy2GyWTFqCY2McXh7dQ0S1sm2Ud/ z1MKIp5axeEaQEvIkrVFTqf+u8zum6YYSbZwDcSW8juj+20W/wc6w9XGhJSQzMSfmj7V IKUA== X-Gm-Message-State: AOJu0YyrJylsV3Z2rMtOhINvp151k+tbtuCQMa/l2ZkYn4YE76QsukiQ 1H+gwLCt3oNIUcUr19dY6eiHIw== X-Received: by 2002:a05:6402:3605:b0:53d:be55:3ee8 with SMTP id el5-20020a056402360500b0053dbe553ee8mr6667395edb.12.1697197088595; Fri, 13 Oct 2023 04:38:08 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id v18-20020aa7d652000000b00533dad8a9c5sm11360772edr.38.2023.10.13.04.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:38:08 -0700 (PDT) From: Luca Weiss Subject: [PATCH 0/3] Handle reversed SBU orientation for FSA4480 Date: Fri, 13 Oct 2023 13:38:04 +0200 Message-Id: <20231013-fsa4480-swap-v1-0-b877f62046cc@fairphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABwsKWUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2NDA0Nj3bTiRBMTCwPd4vLEAl3LJIM0c7MUc+NkQ0sloJaCotS0zAqwcdG xtbUA2ylJb14AAAA= To: Heikki Krogerus , Greg Kroah-Hartman , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:39:00 -0700 (PDT) Short reason: Without swapping the SBU lanes, on QCM6490 Fairphone 5 the DisplayPort-over-USB-C doesn't work. The Orient-Chip OCP96011 used in this phone is generally compatible with FSA4480 but has a difference how AUX+/- should be connected to SBU1/2. Long explanation, with my current understanding: * FSA4480 block diagram shows AUX+ connected to SBU2 and AUX- to SBU1. * OCP96011 block diagram shows AUX+ connected to SBU1 and AUX- to SBU2 (it's not 100% clear though in the picture but makes sense with the observed behavior) * Fairphone 5 schematics have AUX+ connected to SBU2 and AUX- to SBU1, which would be correct for FSA4480 but since OCP96011 is used (which expects it to be the other way around) the Linux driver needs to reverse it. If AUX+ would be connected to SBU1 and AUX- to SBU2 as shown in the OCP96011 block diagram, then no driver/dts change would be needed. Not sure if I've implemented the best solution in this patch. Other solutions I could think of are: * Add some custom boolean property to the node, e.g. 'fsa,swap-sbu' * Reverse when ocs,ocp96011 compatible is used. This would be incorrect since when following the OCP96011 block diagram no reversing would be needed, as explained above. However I think the current solution with data-lanes in the endpoint is the best fit and is also already used for a similar purpose in another USB mux driver. Signed-off-by: Luca Weiss --- Luca Weiss (3): dt-bindings: usb: fsa4480: Add data-lanes property to endpoint usb: typec: fsa4480: Add support to swap SBU orientation dt-bindings: usb: fsa4480: Add compatible for OCP96011 .../devicetree/bindings/usb/fcs,fsa4480.yaml | 43 +++++++++++- drivers/usb/typec/mux/fsa4480.c | 81 ++++++++++++++++++++++ 2 files changed, 121 insertions(+), 3 deletions(-) --- base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b change-id: 20231013-fsa4480-swap-9b0f76d73c19 Best regards, -- Luca Weiss