From patchwork Fri Oct 13 11:38:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 15330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1825096vqb; Fri, 13 Oct 2023 04:38:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVZa9YhSXAGyW1xYPZzpZrUGpdRwo+TaC/CtfvCplANWoKn3pSfH5Carf3BobYNI96ZfLB X-Received: by 2002:a92:d1d0:0:b0:351:54db:c1bc with SMTP id u16-20020a92d1d0000000b0035154dbc1bcmr25005712ilg.0.1697197131907; Fri, 13 Oct 2023 04:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697197131; cv=none; d=google.com; s=arc-20160816; b=H7BwcJFckgSS8uDjRzWgbUkZrLB4j3Y1SxniCLFGHTEV+eorXLwyk0ylLCxQEhYj65 exPo+3wgwNBJ2WZxM1AVaFt8HK/CZLm1qfa61J5fvASPCB3ri9OnFhZGwCg2giQ6EcHl mM8qC0oMZRGJPrH1QUIvkiydCWa0raYrYvCdSyo1EhEndcOP5VS77oTYpUoOE1DBDo6u AUSWu02SlsqyoR3iMUMOeIbilemns4+yGoRgKzOtY4of7B7HuONc+02AVwSQkuJuYowl UxXr8vsmKuq23wJ3JWXFLKovSIPC2DbMX7ftx9bPFW03bHN1XIrxjfRY2G5+mQCU8ZSJ QxFA== 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 Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c10-20020a056a00248a00b0068ffda29587si17616767pfv.109.2023.10.13.04.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:38:51 -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 9FA61826C612; Fri, 13 Oct 2023 04:38:43 -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 S231432AbjJMLiV (ORCPT + 19 others); Fri, 13 Oct 2023 07:38:21 -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 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:38:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779640179965420559 X-GMAIL-MSGID: 1779640179965420559 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,