Message ID | 20230113041132.4189268-1-quic_bjorande@quicinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp73387wrt; Thu, 12 Jan 2023 20:14:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXu/gxbXqcpFCkbg6y04J5AsUwnk+2ZltDJu8GsaobS9Fn5bUZ/789jxxJ7rTYuYr8uufIIf X-Received: by 2002:a17:90a:6398:b0:223:de00:f5ab with SMTP id f24-20020a17090a639800b00223de00f5abmr80294939pjj.28.1673583276417; Thu, 12 Jan 2023 20:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673583276; cv=none; d=google.com; s=arc-20160816; b=PAxQ4rqyh/cVeJ/UB3GgYJrKIjKrkpHz7jG37NKnEt5DmbTwAVHLKPcn3onH0ejz8g QoXS8UKVuap1f0oA7w+JvJLoLA7ainIK5PfSqyosCQw2YE/UPejwBBaufPo4bYDbW/hp tr6DACg4rC1MTgajfb4nr0RICBDuf9hWE8xlPOU/O24gxQpzTOm7Sh8SyoF8dRm7WsTO 3Zf7n6wwz1lj3Yc9TMOWrk3Co/qpYHJBelsDxvsnhAHy/Nv+Spa3o/4+4+rr/wwlCJ+t e7ppWpRjCdWTjFoZ0y5thXu3InN68H/YhkoCJnWIRVXcbsGObdPfAjLjZ3hX/ue4OxfZ DfAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FgrnE3uDR31VvIPVFnTjM4rDKI7sAez5H4TTb8LGUUA=; b=DlziSPM2S+8QTXapiwD5SotBzxiv+raYUhBo2ivGYAMVt1W3II9UEIgXCKgA+CkrxO TsFyQgmjLa+UCXJjrqQlQKGwV4fVagpBbtWI8yRdjrDVgPtunBvY8baVxu0VtxPhL8vv Ov8bzfZj6HLCCYrPruYTzMA1RpUDgMVboxFdPZFFyrcyTZi3xQZm4ejinNFwlCjb5buS saAv/pYNTC/jxGu1ohWY6bmFOl1gDK/915ZJ/tTLhhTaFiAmn/SUNd6CUGljNvczVptc Pcu7SRUiC9g7ZIkV7+r2odUUa1heK7VRb/Mu5bCuaAoWJnuA776dXvUocj3kPKZES65f 6MCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EYQ5akbv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi4-20020a17090b1e4400b00223770a1235si20263813pjb.138.2023.01.12.20.14.24; Thu, 12 Jan 2023 20:14:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EYQ5akbv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbjAMEMz (ORCPT <rfc822;zhuangel570@gmail.com> + 99 others); Thu, 12 Jan 2023 23:12:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234634AbjAMELz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Jan 2023 23:11:55 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1123761313; Thu, 12 Jan 2023 20:11:41 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30D3TBG3007409; Fri, 13 Jan 2023 04:11:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=FgrnE3uDR31VvIPVFnTjM4rDKI7sAez5H4TTb8LGUUA=; b=EYQ5akbvOuIzRQ98P+kKsFO3lz8Wgk9pDfnsoUKbTMjLgRBRFjbNt0jDNus4rquDGAw1 j6sV5CNBv0uhWbmLm2ASrf+j2YAvxHBjTqNUFCotnI6Y2UbbRrxBF4uCWSNK/8E5lwwE 1BtdEIDhRiu5+0EgLdgtMMnMbcGtE0XMU7MUhj0JcxjlirPbOyHScoFkcL8ojXGiuiOF p92A/ynJdhZmCpJ2sNd9A/TnVhQ0BhkhS1BuD871iG8RU3yWxq2EWY/y3GFIG4qCM4W9 a4bIhIRYOdXWZnGCkFj7sslm50r+tHT6i7gXTQoYlxkn1o/W3Fn4Xt0i3cOZspMsvxyd zQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n2jghsnev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Jan 2023 04:11:38 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30D4Bbc3031173 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Jan 2023 04:11:37 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 12 Jan 2023 20:11:37 -0800 From: Bjorn Andersson <quic_bjorande@quicinc.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Sebastian Reichel <sre@kernel.org> CC: <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>, "Subbaraman Narayanamurthy" <quic_subbaram@quicinc.com>, Johan Hovold <johan@kernel.org>, Neil Armstrong <neil.armstrong@linaro.org> Subject: [PATCH v2 0/4] soc: qcom: Introduce PMIC GLINK Date: Thu, 12 Jan 2023 20:11:28 -0800 Message-ID: <20230113041132.4189268-1-quic_bjorande@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: oP24DT4V-EEved4HU8fi3a0WIQXF36Nh X-Proofpoint-ORIG-GUID: oP24DT4V-EEved4HU8fi3a0WIQXF36Nh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_14,2023-01-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 priorityscore=1501 phishscore=0 clxscore=1011 bulkscore=0 impostorscore=0 mlxlogscore=852 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301130026 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754879257384703908?= X-GMAIL-MSGID: =?utf-8?q?1754879257384703908?= |
Series | soc: qcom: Introduce PMIC GLINK | |
Message
Bjorn Andersson
Jan. 13, 2023, 4:11 a.m. UTC
This implements the base PMIC GLINK driver, a power_supply driver and a driver for the USB Type-C altmode protocol. This has been tested and shown to provide battery information, USB Type-C switch and mux requests and DisplayPort notifications on SC8180X, SC8280XP and SM8350. Bjorn Andersson (4): dt-bindings: soc: qcom: Introduce PMIC GLINK binding soc: qcom: pmic_glink: Introduce base PMIC GLINK driver soc: qcom: pmic_glink: Introduce altmode support power: supply: Introduce Qualcomm PMIC GLINK power supply .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ drivers/power/supply/Kconfig | 9 + drivers/power/supply/Makefile | 1 + drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ drivers/soc/qcom/Kconfig | 15 + drivers/soc/qcom/Makefile | 2 + drivers/soc/qcom/pmic_glink.c | 336 ++++ drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ include/linux/soc/qcom/pmic_glink.h | 32 + 9 files changed, 2395 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml create mode 100644 drivers/power/supply/qcom_battmgr.c create mode 100644 drivers/soc/qcom/pmic_glink.c create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c create mode 100644 include/linux/soc/qcom/pmic_glink.h
Comments
On 13.01.2023 05:11, Bjorn Andersson wrote: > This implements the base PMIC GLINK driver, a power_supply driver and a > driver for the USB Type-C altmode protocol. This has been tested and > shown to provide battery information, USB Type-C switch and mux requests > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > For the series: Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> # SM8350 PDX215 Thanks a lot for working on this! One thing, /sys/class/power_supply/qcom-battmgr-usb/input_current_limit is stuck at zero and so is the current_now as a result (the voltage readout is 5V + some noise, so that looks good), but I don't see any SET paths for it in the driver, so I suppose that's what the firmware default is? Konrad > Bjorn Andersson (4): > dt-bindings: soc: qcom: Introduce PMIC GLINK binding > soc: qcom: pmic_glink: Introduce base PMIC GLINK driver > soc: qcom: pmic_glink: Introduce altmode support > power: supply: Introduce Qualcomm PMIC GLINK power supply > > .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ > drivers/power/supply/Kconfig | 9 + > drivers/power/supply/Makefile | 1 + > drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ > drivers/soc/qcom/Kconfig | 15 + > drivers/soc/qcom/Makefile | 2 + > drivers/soc/qcom/pmic_glink.c | 336 ++++ > drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ > include/linux/soc/qcom/pmic_glink.h | 32 + > 9 files changed, 2395 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml > create mode 100644 drivers/power/supply/qcom_battmgr.c > create mode 100644 drivers/soc/qcom/pmic_glink.c > create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c > create mode 100644 include/linux/soc/qcom/pmic_glink.h >
On 13/01/2023 04:11, Bjorn Andersson wrote: > This implements the base PMIC GLINK driver, a power_supply driver and a > driver for the USB Type-C altmode protocol. This has been tested and > shown to provide battery information, USB Type-C switch and mux requests > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > > Bjorn Andersson (4): > dt-bindings: soc: qcom: Introduce PMIC GLINK binding > soc: qcom: pmic_glink: Introduce base PMIC GLINK driver > soc: qcom: pmic_glink: Introduce altmode support > power: supply: Introduce Qualcomm PMIC GLINK power supply > > .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ > drivers/power/supply/Kconfig | 9 + > drivers/power/supply/Makefile | 1 + > drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ > drivers/soc/qcom/Kconfig | 15 + > drivers/soc/qcom/Makefile | 2 + > drivers/soc/qcom/pmic_glink.c | 336 ++++ > drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ > include/linux/soc/qcom/pmic_glink.h | 32 + > 9 files changed, 2395 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml > create mode 100644 drivers/power/supply/qcom_battmgr.c > create mode 100644 drivers/soc/qcom/pmic_glink.c > create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c > create mode 100644 include/linux/soc/qcom/pmic_glink.h > How does the USB PHY and a USB redriver fit into this ? Is the host supposed to manage both/neither ? Is the DSP responsible for configuring the PHY lanes and the turnaround on orientation switch ? --- bod
On Fri, Jan 13, 2023 at 03:56:59PM +0100, Konrad Dybcio wrote: > > > On 13.01.2023 05:11, Bjorn Andersson wrote: > > This implements the base PMIC GLINK driver, a power_supply driver and a > > driver for the USB Type-C altmode protocol. This has been tested and > > shown to provide battery information, USB Type-C switch and mux requests > > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > > > For the series: > > Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> # SM8350 PDX215 > > Thanks a lot for working on this! > Thank you for testing it :) > One thing, /sys/class/power_supply/qcom-battmgr-usb/input_current_limit > is stuck at zero and so is the current_now as a result (the voltage > readout is 5V + some noise, so that looks good), but I don't see any > SET paths for it in the driver, so I suppose that's what the firmware > default is? > I have not experimented with adjusting any configuration in this initial set, but there are a few knobs that could/should be introduced on top of this. That said, I believe input_current_limit should somehow come from the USB stack, rather than user space? Regards, Bjorn
On Fri, Jan 13, 2023 at 05:10:17PM +0000, Bryan O'Donoghue wrote: > On 13/01/2023 04:11, Bjorn Andersson wrote: > > This implements the base PMIC GLINK driver, a power_supply driver and a > > driver for the USB Type-C altmode protocol. This has been tested and > > shown to provide battery information, USB Type-C switch and mux requests > > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > > > > Bjorn Andersson (4): > > dt-bindings: soc: qcom: Introduce PMIC GLINK binding > > soc: qcom: pmic_glink: Introduce base PMIC GLINK driver > > soc: qcom: pmic_glink: Introduce altmode support > > power: supply: Introduce Qualcomm PMIC GLINK power supply > > > > .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ > > drivers/power/supply/Kconfig | 9 + > > drivers/power/supply/Makefile | 1 + > > drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ > > drivers/soc/qcom/Kconfig | 15 + > > drivers/soc/qcom/Makefile | 2 + > > drivers/soc/qcom/pmic_glink.c | 336 ++++ > > drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ > > include/linux/soc/qcom/pmic_glink.h | 32 + > > 9 files changed, 2395 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml > > create mode 100644 drivers/power/supply/qcom_battmgr.c > > create mode 100644 drivers/soc/qcom/pmic_glink.c > > create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c > > create mode 100644 include/linux/soc/qcom/pmic_glink.h > > > > How does the USB PHY and a USB redriver fit into this ? > > Is the host supposed to manage both/neither ? Is the DSP responsible for > configuring the PHY lanes and the turnaround on orientation switch ? > As indicated above, the firmware deals with battery management and USB Type-C handling. The battery/power management is handled by the battmgr implementation, exposing the various properties through a set of power_supply objects. The USB Type-C handling comes in two forms. The "altmode" protocol handles DisplayPort notifications - plug detect, orientation and mode switches. The other part of the USB implementation exposes UCSI. The altmode implementation provides two things: - A drm_bridge, per connector, which can be tied (of_graph) to a DisplayPort instance, and will invoke HPD notifications on the drm_bridge, based on notification messages thereof. - Acquire typec_switch and typec_mux handles through the of_graph and signal the remotes when notifications of state changes occur. Linking this to the FSA4480, is sufficient to get USB/DP combo (2+2 lanes) working on e.g. SM8350 HDK. Work in progress patches also exists for teaching QMP about orientation switching of the SS lines, but it seems this needs to be rebased onto the refactored QMP driver. I also have patches for QMP to make it switch USB/DP combo -> 4-lane DP, which allow 4k support without DSC, unfortunately switch back to USB has not been fully reliable, so this requires some more work (downstream involves DWC3 here as well, to reprogram the PHY). I have been experimenting with UCSI in the past, but my goal for this series was to support external displays on my desktop (laptop...), but through some experiments I've wired the connectors to dwc3 in order to get usb_role_switch working. Neil has been looking at this in more detail lately though. Regards, Bjorn
On 17/01/2023 02:32, Bjorn Andersson wrote: > On Fri, Jan 13, 2023 at 05:10:17PM +0000, Bryan O'Donoghue wrote: >> On 13/01/2023 04:11, Bjorn Andersson wrote: >>> This implements the base PMIC GLINK driver, a power_supply driver and a >>> driver for the USB Type-C altmode protocol. This has been tested and >>> shown to provide battery information, USB Type-C switch and mux requests >>> and DisplayPort notifications on SC8180X, SC8280XP and SM8350. >>> >>> Bjorn Andersson (4): >>> dt-bindings: soc: qcom: Introduce PMIC GLINK binding >>> soc: qcom: pmic_glink: Introduce base PMIC GLINK driver >>> soc: qcom: pmic_glink: Introduce altmode support >>> power: supply: Introduce Qualcomm PMIC GLINK power supply >>> >>> .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ >>> drivers/power/supply/Kconfig | 9 + >>> drivers/power/supply/Makefile | 1 + >>> drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ >>> drivers/soc/qcom/Kconfig | 15 + >>> drivers/soc/qcom/Makefile | 2 + >>> drivers/soc/qcom/pmic_glink.c | 336 ++++ >>> drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ >>> include/linux/soc/qcom/pmic_glink.h | 32 + >>> 9 files changed, 2395 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml >>> create mode 100644 drivers/power/supply/qcom_battmgr.c >>> create mode 100644 drivers/soc/qcom/pmic_glink.c >>> create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c >>> create mode 100644 include/linux/soc/qcom/pmic_glink.h >>> >> >> How does the USB PHY and a USB redriver fit into this ? >> >> Is the host supposed to manage both/neither ? Is the DSP responsible for >> configuring the PHY lanes and the turnaround on orientation switch ? >> > > As indicated above, the firmware deals with battery management and USB > Type-C handling. > > The battery/power management is handled by the battmgr implementation, > exposing the various properties through a set of power_supply objects. > > The USB Type-C handling comes in two forms. The "altmode" protocol > handles DisplayPort notifications - plug detect, orientation and mode > switches. The other part of the USB implementation exposes UCSI. > > The altmode implementation provides two things: > - A drm_bridge, per connector, which can be tied (of_graph) to a > DisplayPort instance, and will invoke HPD notifications on the > drm_bridge, based on notification messages thereof. > > - Acquire typec_switch and typec_mux handles through the of_graph and > signal the remotes when notifications of state changes occur. Linking > this to the FSA4480, is sufficient to get USB/DP combo (2+2 lanes) > working on e.g. SM8350 HDK. > Work in progress patches also exists for teaching QMP about > orientation switching of the SS lines, but it seems this needs to be > rebased onto the refactored QMP driver. > I also have patches for QMP to make it switch USB/DP combo -> 4-lane > DP, which allow 4k support without DSC, unfortunately switch back to > USB has not been fully reliable, so this requires some more work > (downstream involves DWC3 here as well, to reprogram the PHY). Oki doki that makes sense and is pretty much in-line with what I thought. We still have a bunch of typec-mux and phy work to do even with adsp/glink doing the TCPM. Thanks for the explanation. --- bod
On Tue, Jan 17, 2023 at 02:37:27AM +0000, Bryan O'Donoghue wrote: > On 17/01/2023 02:32, Bjorn Andersson wrote: > > On Fri, Jan 13, 2023 at 05:10:17PM +0000, Bryan O'Donoghue wrote: > > > On 13/01/2023 04:11, Bjorn Andersson wrote: > > > > This implements the base PMIC GLINK driver, a power_supply driver and a > > > > driver for the USB Type-C altmode protocol. This has been tested and > > > > shown to provide battery information, USB Type-C switch and mux requests > > > > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > > > > > > > > Bjorn Andersson (4): > > > > dt-bindings: soc: qcom: Introduce PMIC GLINK binding > > > > soc: qcom: pmic_glink: Introduce base PMIC GLINK driver > > > > soc: qcom: pmic_glink: Introduce altmode support > > > > power: supply: Introduce Qualcomm PMIC GLINK power supply > > > > > > > > .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ > > > > drivers/power/supply/Kconfig | 9 + > > > > drivers/power/supply/Makefile | 1 + > > > > drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ > > > > drivers/soc/qcom/Kconfig | 15 + > > > > drivers/soc/qcom/Makefile | 2 + > > > > drivers/soc/qcom/pmic_glink.c | 336 ++++ > > > > drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ > > > > include/linux/soc/qcom/pmic_glink.h | 32 + > > > > 9 files changed, 2395 insertions(+) > > > > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml > > > > create mode 100644 drivers/power/supply/qcom_battmgr.c > > > > create mode 100644 drivers/soc/qcom/pmic_glink.c > > > > create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c > > > > create mode 100644 include/linux/soc/qcom/pmic_glink.h > > > > > > > > > > How does the USB PHY and a USB redriver fit into this ? > > > > > > Is the host supposed to manage both/neither ? Is the DSP responsible for > > > configuring the PHY lanes and the turnaround on orientation switch ? > > > > > > > As indicated above, the firmware deals with battery management and USB > > Type-C handling. > > > > The battery/power management is handled by the battmgr implementation, > > exposing the various properties through a set of power_supply objects. > > > > The USB Type-C handling comes in two forms. The "altmode" protocol > > handles DisplayPort notifications - plug detect, orientation and mode > > switches. The other part of the USB implementation exposes UCSI. > > > > The altmode implementation provides two things: > > - A drm_bridge, per connector, which can be tied (of_graph) to a > > DisplayPort instance, and will invoke HPD notifications on the > > drm_bridge, based on notification messages thereof. > > > > - Acquire typec_switch and typec_mux handles through the of_graph and > > signal the remotes when notifications of state changes occur. Linking > > this to the FSA4480, is sufficient to get USB/DP combo (2+2 lanes) > > working on e.g. SM8350 HDK. > > Work in progress patches also exists for teaching QMP about > > orientation switching of the SS lines, but it seems this needs to be > > rebased onto the refactored QMP driver. > > I also have patches for QMP to make it switch USB/DP combo -> 4-lane > > DP, which allow 4k support without DSC, unfortunately switch back to > > USB has not been fully reliable, so this requires some more work > > (downstream involves DWC3 here as well, to reprogram the PHY). > > Oki doki that makes sense and is pretty much in-line with what I thought. > > We still have a bunch of typec-mux and phy work to do even with adsp/glink > doing the TCPM. > Correct, the registration of QMP as a typec_switch and typec_mux and handling of respective notification remains open and should (by design) be independent of the TCPM implementation. In particular the orientation switching is an itch worth scratching at this time. But when the DPU becomes capable of producing 4k@60 output it would obviously be nice to have the whole shebang :) Regards, Bjorn > Thanks for the explanation. > > --- > bod >
On 17/01/2023 04:58, Bjorn Andersson wrote: > On Tue, Jan 17, 2023 at 02:37:27AM +0000, Bryan O'Donoghue wrote: >> On 17/01/2023 02:32, Bjorn Andersson wrote: >>> On Fri, Jan 13, 2023 at 05:10:17PM +0000, Bryan O'Donoghue wrote: >>>> On 13/01/2023 04:11, Bjorn Andersson wrote: >>>>> This implements the base PMIC GLINK driver, a power_supply driver and a >>>>> driver for the USB Type-C altmode protocol. This has been tested and >>>>> shown to provide battery information, USB Type-C switch and mux requests >>>>> and DisplayPort notifications on SC8180X, SC8280XP and SM8350. >>>>> >>>>> Bjorn Andersson (4): >>>>> dt-bindings: soc: qcom: Introduce PMIC GLINK binding >>>>> soc: qcom: pmic_glink: Introduce base PMIC GLINK driver >>>>> soc: qcom: pmic_glink: Introduce altmode support >>>>> power: supply: Introduce Qualcomm PMIC GLINK power supply >>>>> >>>>> .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ >>>>> drivers/power/supply/Kconfig | 9 + >>>>> drivers/power/supply/Makefile | 1 + >>>>> drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ >>>>> drivers/soc/qcom/Kconfig | 15 + >>>>> drivers/soc/qcom/Makefile | 2 + >>>>> drivers/soc/qcom/pmic_glink.c | 336 ++++ >>>>> drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ >>>>> include/linux/soc/qcom/pmic_glink.h | 32 + >>>>> 9 files changed, 2395 insertions(+) >>>>> create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml >>>>> create mode 100644 drivers/power/supply/qcom_battmgr.c >>>>> create mode 100644 drivers/soc/qcom/pmic_glink.c >>>>> create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c >>>>> create mode 100644 include/linux/soc/qcom/pmic_glink.h >>>>> >>>> >>>> How does the USB PHY and a USB redriver fit into this ? >>>> >>>> Is the host supposed to manage both/neither ? Is the DSP responsible for >>>> configuring the PHY lanes and the turnaround on orientation switch ? >>>> >>> >>> As indicated above, the firmware deals with battery management and USB >>> Type-C handling. >>> >>> The battery/power management is handled by the battmgr implementation, >>> exposing the various properties through a set of power_supply objects. >>> >>> The USB Type-C handling comes in two forms. The "altmode" protocol >>> handles DisplayPort notifications - plug detect, orientation and mode >>> switches. The other part of the USB implementation exposes UCSI. >>> >>> The altmode implementation provides two things: >>> - A drm_bridge, per connector, which can be tied (of_graph) to a >>> DisplayPort instance, and will invoke HPD notifications on the >>> drm_bridge, based on notification messages thereof. >>> >>> - Acquire typec_switch and typec_mux handles through the of_graph and >>> signal the remotes when notifications of state changes occur. Linking >>> this to the FSA4480, is sufficient to get USB/DP combo (2+2 lanes) >>> working on e.g. SM8350 HDK. >>> Work in progress patches also exists for teaching QMP about >>> orientation switching of the SS lines, but it seems this needs to be >>> rebased onto the refactored QMP driver. >>> I also have patches for QMP to make it switch USB/DP combo -> 4-lane >>> DP, which allow 4k support without DSC, unfortunately switch back to >>> USB has not been fully reliable, so this requires some more work >>> (downstream involves DWC3 here as well, to reprogram the PHY). >> >> Oki doki that makes sense and is pretty much in-line with what I thought. >> >> We still have a bunch of typec-mux and phy work to do even with adsp/glink >> doing the TCPM. >> > > Correct, the registration of QMP as a typec_switch and typec_mux and > handling of respective notification remains open and should (by design) > be independent of the TCPM implementation. > > In particular the orientation switching is an itch worth scratching at > this time. But when the DPU becomes capable of producing 4k@60 output it > would obviously be nice to have the whole shebang :) Did you try it with the wide planes patchset at [1]? I was able to get stable 4k@30 on RB3 (being limited only by the DSI-HDMI bridge). [1] https://lore.kernel.org/linux-arm-msm/20221229191856.3508092-1-dmitry.baryshkov@linaro.org/
On Tue, Jan 17, 2023 at 11:26:58AM +0200, Dmitry Baryshkov wrote: > On 17/01/2023 04:58, Bjorn Andersson wrote: > > On Tue, Jan 17, 2023 at 02:37:27AM +0000, Bryan O'Donoghue wrote: > > > On 17/01/2023 02:32, Bjorn Andersson wrote: > > > > On Fri, Jan 13, 2023 at 05:10:17PM +0000, Bryan O'Donoghue wrote: > > > > > On 13/01/2023 04:11, Bjorn Andersson wrote: > > > > > > This implements the base PMIC GLINK driver, a power_supply driver and a > > > > > > driver for the USB Type-C altmode protocol. This has been tested and > > > > > > shown to provide battery information, USB Type-C switch and mux requests > > > > > > and DisplayPort notifications on SC8180X, SC8280XP and SM8350. > > > > > > > > > > > > Bjorn Andersson (4): > > > > > > dt-bindings: soc: qcom: Introduce PMIC GLINK binding > > > > > > soc: qcom: pmic_glink: Introduce base PMIC GLINK driver > > > > > > soc: qcom: pmic_glink: Introduce altmode support > > > > > > power: supply: Introduce Qualcomm PMIC GLINK power supply > > > > > > > > > > > > .../bindings/soc/qcom/qcom,pmic-glink.yaml | 102 ++ > > > > > > drivers/power/supply/Kconfig | 9 + > > > > > > drivers/power/supply/Makefile | 1 + > > > > > > drivers/power/supply/qcom_battmgr.c | 1421 +++++++++++++++++ > > > > > > drivers/soc/qcom/Kconfig | 15 + > > > > > > drivers/soc/qcom/Makefile | 2 + > > > > > > drivers/soc/qcom/pmic_glink.c | 336 ++++ > > > > > > drivers/soc/qcom/pmic_glink_altmode.c | 477 ++++++ > > > > > > include/linux/soc/qcom/pmic_glink.h | 32 + > > > > > > 9 files changed, 2395 insertions(+) > > > > > > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml > > > > > > create mode 100644 drivers/power/supply/qcom_battmgr.c > > > > > > create mode 100644 drivers/soc/qcom/pmic_glink.c > > > > > > create mode 100644 drivers/soc/qcom/pmic_glink_altmode.c > > > > > > create mode 100644 include/linux/soc/qcom/pmic_glink.h > > > > > > > > > > > > > > > > How does the USB PHY and a USB redriver fit into this ? > > > > > > > > > > Is the host supposed to manage both/neither ? Is the DSP responsible for > > > > > configuring the PHY lanes and the turnaround on orientation switch ? > > > > > > > > > > > > > As indicated above, the firmware deals with battery management and USB > > > > Type-C handling. > > > > > > > > The battery/power management is handled by the battmgr implementation, > > > > exposing the various properties through a set of power_supply objects. > > > > > > > > The USB Type-C handling comes in two forms. The "altmode" protocol > > > > handles DisplayPort notifications - plug detect, orientation and mode > > > > switches. The other part of the USB implementation exposes UCSI. > > > > > > > > The altmode implementation provides two things: > > > > - A drm_bridge, per connector, which can be tied (of_graph) to a > > > > DisplayPort instance, and will invoke HPD notifications on the > > > > drm_bridge, based on notification messages thereof. > > > > > > > > - Acquire typec_switch and typec_mux handles through the of_graph and > > > > signal the remotes when notifications of state changes occur. Linking > > > > this to the FSA4480, is sufficient to get USB/DP combo (2+2 lanes) > > > > working on e.g. SM8350 HDK. > > > > Work in progress patches also exists for teaching QMP about > > > > orientation switching of the SS lines, but it seems this needs to be > > > > rebased onto the refactored QMP driver. > > > > I also have patches for QMP to make it switch USB/DP combo -> 4-lane > > > > DP, which allow 4k support without DSC, unfortunately switch back to > > > > USB has not been fully reliable, so this requires some more work > > > > (downstream involves DWC3 here as well, to reprogram the PHY). > > > > > > Oki doki that makes sense and is pretty much in-line with what I thought. > > > > > > We still have a bunch of typec-mux and phy work to do even with adsp/glink > > > doing the TCPM. > > > > > > > Correct, the registration of QMP as a typec_switch and typec_mux and > > handling of respective notification remains open and should (by design) > > be independent of the TCPM implementation. > > > > In particular the orientation switching is an itch worth scratching at > > this time. But when the DPU becomes capable of producing 4k@60 output it > > would obviously be nice to have the whole shebang :) > > Did you try it with the wide planes patchset at [1]? I was able to get > stable 4k@30 on RB3 (being limited only by the DSI-HDMI bridge). > > [1] https://lore.kernel.org/linux-arm-msm/20221229191856.3508092-1-dmitry.baryshkov@linaro.org/ > I have not done so, as the patches I had for switching to 4-lane DP output needs to be rewritten since the refactoring. I had no problem doing 4k@30 prior to your efforts, so I'm interested in validating the changes you've made. Thanks, Bjorn > -- > With best wishes > Dmitry >