Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp894759rdb; Fri, 20 Oct 2023 02:34:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnk5RBgiiT/nzb9m0uUeGwwXpis7Z9ohxSV11J/QjjJxkyu3JCoTZvsFMbdE9LiG/YafDA X-Received: by 2002:a17:90a:196:b0:27d:3d1e:1a98 with SMTP id 22-20020a17090a019600b0027d3d1e1a98mr1973323pjc.16.1697794479154; Fri, 20 Oct 2023 02:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697794479; cv=none; d=google.com; s=arc-20160816; b=JvbVkU8gGFHidFfjILyQx0hsyTXyaVJ+CpjKpq/STmXnS19yiGrS3u5dWhOp9OQG7F ay9i0PHhLr2WP9Yx9vkdqE7z78JOvdmKY9rK38UzZJ9VhqDZ3gp9f4HqJagGPBXd2bsy DWcU7U8hBaAwP4DchhyqMM1HtaczbxXfdpY0J068SAcEno0WRtxuOFcyBQUvk4N3QQYg HEE3r2BoN5SN1F4xdVROzn+zplWBaV6amMMbH8DHMG5itcmfk9Yet+InIfXJ2U8oZE+l /TjOEgRYXhQ3dME9l3cm+WvVolmsGstpGoWm6sqGQ/SYOryVNj0GNUGZ6K9/SJxd9r7l XWkA== 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=/B2a2ZXqLwls1Vsw3h8JmPF3a45COfQmKittozQNWE4=; fh=ghpUNpHqcNrQIocPjfnwe/5quPeBE+ramd9T7xbSKxs=; b=xgpbvVpLRNKZTPM1h6mUZBPVBYtkqf30A9sXEmom17ifsWDF1y1Iy73Ql//KR1JI/C xVnNgwijbZ6WSc76w9jO/XYH0XkuWMjat2CKtk33izaGjARzgLGwjGkpXAGv7cy3jaZB QpwWs7YO8WvXHRvoN1EclZ1mu5ow7kD2l2z2sHJcl7i3lSFelEWVhs6HRrUdj9sxTpnY +jXleyPfAndeSfahLEXbkfYI1ynFFmHJCL7Ok8rk9vloNSPOcjttKysRhxZeWH3wGqeL 3rZ+wLJ1w6uhyPH5Mxa0/1yL/F9l5lHbsfLAtA9omIClogXMx2Mk+sR1GuR3seEc7ahw /HCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=kvsXwxgb; 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 ls8-20020a17090b350800b002680f00f8f3si1691141pjb.17.2023.10.20.02.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:34:39 -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=kvsXwxgb; 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 2CCF0829576C; Fri, 20 Oct 2023 02:34:36 -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 S1376697AbjJTJeQ (ORCPT + 99 others); Fri, 20 Oct 2023 05:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376783AbjJTJdl (ORCPT ); Fri, 20 Oct 2023 05:33:41 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97745D55 for ; Fri, 20 Oct 2023 02:33:23 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5384975e34cso861672a12.0 for ; Fri, 20 Oct 2023 02:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1697794402; x=1698399202; 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=/B2a2ZXqLwls1Vsw3h8JmPF3a45COfQmKittozQNWE4=; b=kvsXwxgbbBHLrKSqKTT2LlGy7jtyy9VqQKk4e9XS5oHt79uosPExgdSzyY+wSI8Wcp gd+GRl9EADqF5z47SjLWcXBBM7N+AdB5z0JZy8fLzkTOXDo6ZLdWvLi2p09deVy0qWr5 lQidFsZzjsRJHGy7fnR7xYFOFLlMFhe+iCo6jZzx8tZHcryIKZ9M7YXmlrztqetyr6Tc U2BrSwV+yby/sxVS1JKklGCgYJtHVGchhlwWxIG6aj0Qzuz3CSvAtPubKF9ZOgvOKb7+ WmZbFyFhQXSuOcUWIq1GiR+IdFiMLvHNfMqSSvinAEIL3iySOEtvllMj0hK1vjM5AGOH EUew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697794402; x=1698399202; 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=/B2a2ZXqLwls1Vsw3h8JmPF3a45COfQmKittozQNWE4=; b=M6iMY0V8hTENfAUALlN7KdtsXPStNKuTSaR2L3ZI7ooS4TG9FbLJRtVfkgIKtuuNi9 X8QwJcZ9snZKdBMXvpJiiqAB8n2gmI5gn9BdT/j0cDN/h0e3d6rlbYHxGVtLy9mRFTOk Xy1+QLfQ0xzjucG9G/QU0+rz/wXZDR+OJMnT69TCffzDvrXBxwieLor46Y8ehSRu4eqG dJHisjPcYlAgtSFyHeeUcIYBvbRi5FfCHjSD++GMAZXZIyHOO+AsAnPO9kur5hdJdAjS 2PeqKYFx8TCrCASvU6KRjt72fCHsi1z6NIm/CCnCdsOEjbAdD+E4XTkKeqt0Z0dGgDLm oBuQ== X-Gm-Message-State: AOJu0YxRhCd5DuBQaVV84KSBnMXVkAAsh9gQOmLmAVxxR6TCak26ClDN 4VQlDK0G8LQ4x/LlnddvfcwD5Q== X-Received: by 2002:a17:907:7ea3:b0:9c6:10d4:d09f with SMTP id qb35-20020a1709077ea300b009c610d4d09fmr993488ejc.63.1697794401731; Fri, 20 Oct 2023 02:33:21 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (k10064.upc-k.chello.nl. [62.108.10.64]) by smtp.gmail.com with ESMTPSA id t15-20020a1709066bcf00b009a13fdc139fsm1102535ejs.183.2023.10.20.02.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:33:21 -0700 (PDT) From: Luca Weiss Subject: [PATCH v2 0/3] Handle reversed SBU orientation for FSA4480 Date: Fri, 20 Oct 2023 11:33:17 +0200 Message-Id: <20231020-fsa4480-swap-v2-0-9a7f9bb59873@fairphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAF1JMmUC/3XMSw7CIBSF4a00dyyGV6B15D5MB5SC3IHQgEFNw 97Fzh3+JznfDsVldAUuww7ZVSyYYg9+GsAGE++O4NobOOWCUSaIL0bKkZLyMhuZFuq1WrWwbIJ +2bLz+D6429w7YHmm/Dn0yn7rH6gyQskyau0Vp1JZe/UG8xZSdGebHjC31r4InkxlrAAAAA== 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, 20 Oct 2023 02:34:36 -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 --- Changes in v2: - Expand commit message for first dt-bindings patch incl. ASCII art - Use fwnode_* instead of_* APIs - Drop manual check for data-lanes property length, read_u32_array will already error on too short or too long property. - Drop dev_info for reversed data-lanes mapping - Link to v1: https://lore.kernel.org/r/20231013-fsa4480-swap-v1-0-b877f62046cc@fairphone.com --- 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 | 71 ++++++++++++++++++++++ 2 files changed, 111 insertions(+), 3 deletions(-) --- base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b change-id: 20231013-fsa4480-swap-9b0f76d73c19 Best regards, -- Luca Weiss