From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCB3DC54EBE for ; Tue, 17 Jan 2023 02:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbjAQCoy (ORCPT ); Mon, 16 Jan 2023 21:44:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235794AbjAQCnl (ORCPT ); Mon, 16 Jan 2023 21:43:41 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 360F133442 for ; Mon, 16 Jan 2023 18:38:35 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id h16so29150087wrz.12 for ; Mon, 16 Jan 2023 18:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NN7ra9RM5RwWoUr/tsRU6zWH7d53cck2M9uCu21ulu0=; b=Oab9zK27rpgas0uCStmMiykRixxSbqgEkfw41hgaNMTL3tWA/9pi5puiL/ERXYkLpY 47CVxZnDTCYkPZYPSRRJtwc2YEPI2H8WG04kN/t0Yj7L8Y9VCdPsL0JbZgU4Y61r5BP7 aI2tvd6ObvUqLjXmHJrdE6l49kAt4Q9e4kyb2C7DgrtVXS8lZfhzp/PW/bK1eUHcMxKh X0b15FwntkLtmhjqK5URNhh/7EG/7EJfWfVq2reEB+dc65bjju+Ns4noGV1tO/jClh/p tuHzdKSruPdk1ivcgcMG6kVLQSGD4bxz/xcpDV89E7ryXofXsqkiV2n5G/F/L55GAkC9 EaqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NN7ra9RM5RwWoUr/tsRU6zWH7d53cck2M9uCu21ulu0=; b=c2HVX1QkYCjWEw2gozyZ1mZLFizVMDXCIhuyt/jz2hVKH2VC9hprugSmF15T+m88Ic 0SpCUyvPdA6TYz7LBAboCB3BOW1pHE7ONVDbW7yeWqEnCZQy/lfE0KbPvoXSvdJ6gxNJ pfkavc4qiYtPq/Dd7s/YWCNKs+cnL6Lf3TrS0S5UWNF+mK7zBSaD8NplBxxkNGy0Xlym UFptA8269CwDw0hul+vJL05OfEjHG259HCFTDhJZ3FEK+pD7rBwVlr8PVbHqXpGGYKXr nQGLWdefRMSBXVmrCV8+2BXy2EELrsZ5vhSleQYkhtoxfBjX0GBz4o3HbEX5+OSmJEni Ghew== X-Gm-Message-State: AFqh2kpXngwmKqOisqtXbuXboSR7aGovADgm3chPRv2CAiSJqj7Pz8pp 8ENjnTXqvi19ns81dIcCo9qL4Q== X-Google-Smtp-Source: AMrXdXt/uADrirudTtbLAThIF7D33RBC/uAACiFdsfTZOuuirWxs/Jfbl29q/QJSTS1dIZHczsAv2g== X-Received: by 2002:a5d:4e51:0:b0:2bd:f5df:2696 with SMTP id r17-20020a5d4e51000000b002bdf5df2696mr1122371wrt.67.1673923049035; Mon, 16 Jan 2023 18:37:29 -0800 (PST) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f2-20020adff982000000b002bde537721dsm9634581wrr.20.2023.01.16.18.37.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Jan 2023 18:37:28 -0800 (PST) Message-ID: Date: Tue, 17 Jan 2023 02:37:27 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2 0/4] soc: qcom: Introduce PMIC GLINK Content-Language: en-US To: Bjorn Andersson Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Sebastian Reichel , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Subbaraman Narayanamurthy , Johan Hovold , Neil Armstrong References: <20230113041132.4189268-1-quic_bjorande@quicinc.com> <9e831252-7198-7983-8a52-0e745688452d@linaro.org> <20230117023238.GB2350793@hu-bjorande-lv.qualcomm.com> From: Bryan O'Donoghue In-Reply-To: <20230117023238.GB2350793@hu-bjorande-lv.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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