From patchwork Fri Mar 29 06:15:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610151 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9E533FB35 for ; Fri, 29 Mar 2024 06:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692946; cv=none; b=He7qQIHypgIRdieAx/dQcD2T1/p9wb99vEjr9e/R6WzX7NvjDb6EHusTxiQ+XaJ0zdUuFFN5txvjFuyO2fIGc0QHBQc3+erloSMMi+Fs8FVL2AEGnoFDossNz+IKkr18yQAZ3G+dFW4eQXG5vlljtiPdsrFDG/YLYcuLSCyo25Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692946; c=relaxed/simple; bh=MnPxRahrYakDmeCXkc8qs7yorS+UWF9e6ViW9LzxCxE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LT5uCKCc6eYF0MqpsrvSse2684bR2ZOMruouG3+5C6yw910r6QZhZFpQWW7TXCR79uVDKWV0W9noABWwkW5AM239xvjYBFf0tJ/G3vJGlvqvR5S8a3QIgQnSk7b2eHVrOQu5anC88iO9fIPit+/byXhKcIW7dpZnSQNMpccURbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rs2TP8Fj; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rs2TP8Fj" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d476d7972aso25492011fa.1 for ; Thu, 28 Mar 2024 23:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692943; x=1712297743; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VxdOEDIk+f0fVU9fpmARr44O3Tv96RmIzUOndubq/IA=; b=rs2TP8FjIIpLYe6UE7rI9+TxlvjAXdDnZKE465lIMdAQYSxSNchOTo/tLmQP64l1SX xGju6wd84WEB0/0OPbtxFOowYd5+1UvUF4rMElA59wt22z7tOei+sJ0JWgXywkLiAkB5 f8zyR/WOQM0co3zCGCTrq3Qkj3cg09lHiNJuUlD5iS40XtVS4p0F8zCEoTVTZoQnNbgD BkUc6QthUXOJ40sIqUkcjui9hLIkq5NvFH9JfAvX/SbwjZht0AYpGejtBYZYaptDRgGx QiajVDYYrkOPYSdUstcL9YTrY4j/FN7z2B/B5vPZ+pg+duw7eSp4mb6AhLeaCSLz4cyQ zKMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692943; x=1712297743; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VxdOEDIk+f0fVU9fpmARr44O3Tv96RmIzUOndubq/IA=; b=FkDYa/Nu8BRyCmuZ+0kCOVvHX8UQ4Vg2Ua3LZ7AaOIhdBi1BHHEpXssTX6LpVWBTrF kxatuD0P3le1YFbTZX78bOQ5TozSt4FX1qcew9wcNvq3WUpM/7jaNnneYygFpYE0ddH1 0jSpLfYzWZAWuq7+pkYEIauzqutDd4fzzktYtaYEwh1Up3c15LafRaHx9wFGa63MXBoy sPjGvOG9/V9F6GA8QKuRbOgkuRw4W1rckeVT8nBk4wxRlzTYON/tsLpJlg8OuddlUk2k HBmg5PisUVWlJmAeFdZv6DKwCXZd1NpJIzHE1S8JA8XWO8mxuozUKndiLgQacd0u3mwx PJjA== X-Forwarded-Encrypted: i=1; AJvYcCX5vRY1NlGuGxdA3lxyJUIRVr0QseW6Rt+o16k5eZm7jX0tRmtXlmG2JvYU8pEppIFA4/jHeNYlCn+6MEureMgwwVi6ULa2tHv+TTStTg== X-Gm-Message-State: AOJu0YxLrI56hBzkE/SBo47GzYKGEridMfkG3HP7s4TL8WwuxzCN/VBe fOGmjCV2GLsPREY7H1Q/EDNl58BdlzNi+1y+acnk2Ay1a7WaWb6g+0/GltP9AC0= X-Google-Smtp-Source: AGHT+IG6kUoJg0fosVUswnRTrw1QNG7p3z+GEZ2K/cmJL7ZtyaI/XV5kO9iw7SCrbSRPGkzsDvgFKQ== X-Received: by 2002:a2e:300a:0:b0:2d6:c252:27fa with SMTP id w10-20020a2e300a000000b002d6c25227famr850883ljw.37.1711692943139; Thu, 28 Mar 2024 23:15:43 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:42 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:33 +0200 Subject: [PATCH v2 01/11] usb: typec: ucsi: allow non-partner GET_PDOS for Qualcomm devices Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-1-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1061; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=MnPxRahrYakDmeCXkc8qs7yorS+UWF9e6ViW9LzxCxE=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxpbTHdGUNa+Y4XH4nKiwz8EzYvcaJU2e8cSu2dbv91JO fTSN/5fJ6MxCwMjF4OsmCKLT0HL1JhNyWEfdkythxnEygQyhYGLUwAm8lmT/Q+H34Ltfc2rp5W9 3XloknJ8eJ/lHE6DrWzBKcmiW+PP/079m8lduGbd5pSksxfaG3X/11dz5GSusZjRdoMlROpmu0t 4UbmR0yE7pkWOoY79aZ2S+5k2h9+5dnFxSqRrMfe3gGMLE1g+vbPI6e6d5yNV0j9tX13Nh4uPc9 LbHtbsbcow/L9nbYSXWley3uxOXdUPf806bmml+x1d9TsyO20Z96bHzfd5eXKiam3SagPnpslnh c/5INJvZ8WjGcnuqSMmq8vT+9Ph9NuN2vw+xfr3+dPKjR3PZqwqlY15/fd6TZ4F9xGLoNpn3/6f PXvwaFYMx+rEqUrOHXOU3JsXt9qJPbny68DKD1r2yoEA X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The name and description of the USB_NO_PARTNER_PDOS quirk specifies that only retrieving PDOS of the attached device is crashing. Retrieving PDOS of the UCSI device works. Fix the condition to limit the workaround only to is_partner cases. Fixes: 1d103d6af241 ("usb: typec: ucsi: fix UCSI on buggy Qualcomm devices") Reviewed-by: Heikki Krogerus Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 48f093a1dc09..42cc1c0e2f73 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -619,7 +619,8 @@ static int ucsi_read_pdos(struct ucsi_connector *con, u64 command; int ret; - if (ucsi->quirks & UCSI_NO_PARTNER_PDOS) + if (is_partner && + ucsi->quirks & UCSI_NO_PARTNER_PDOS) return 0; command = UCSI_COMMAND(UCSI_GET_PDOS) | UCSI_CONNECTOR_NUMBER(con->num); From patchwork Fri Mar 29 06:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610152 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEDA044C7A for ; Fri, 29 Mar 2024 06:15:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692947; cv=none; b=JWz1mfzy28IIjBGfDOJS4q8ZeFxbAR8h0TpIh2QeoOX+vXOcGidYVGJ9UbUzJUQcev0ExQQyRYAmRDAKTlblupT+hRwWocQb1SkVF2BjB+IX1Ak2r7PptfKExI12pAxwM0ibi7plIZrG0JnU6WfUaigEeBnVqr1fo2o/lW4gUwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692947; c=relaxed/simple; bh=1YXtXW57tTxFBEzDGmlGAr9GqbQ7HEPJ3F4/AfgmRvI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g9hBxAo3eB3xxyiQcd49bnjcuyNC5BCIOonF1ucflN2qz6Hk+Ah35qN29lo0s748O/X+JrWekx/8YAZEf3jYcdalJhzAGOahHVmkIm2D7v+IrDUR37IVy2jd35RRBUpydBMdcRpkjqik+iZzKbYtzCEYcDsudC+/csZIA3v5RDM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RF5D6jNJ; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RF5D6jNJ" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d094bc2244so18334921fa.1 for ; Thu, 28 Mar 2024 23:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692944; x=1712297744; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Xc5E/NYDZLjfNoXG7DGNM4m70S/ss7sBgBQIDH4LAuE=; b=RF5D6jNJYgCe+TdD83WIPjyaxHd6YerkAb3h2psiY0nr9WrvN6r0OHArN7xh755QFB 8lGSuw6YxGn+89SyVNgGHaEKGlyMm2ptvDnv9V2ndan+QpCXBQXG2pYerSGEzh6KdcJZ zt+XeGSlJaIn4K9XeGlcGhpNWbCno5AICEFg4FGcIjJZwXHtI5Qx1SmpaOH86mKcD6DK eLKwOa+ZxrqCwwwW8dKKiULlmMs1AG/DuvJn25K6zg0cwTe6QTXFnGrhMaFqVQ531Efe kAXVZFe0iNL2ah+dpRVvsxiQmoIMWtnhhRHGlOKgOB3+15rphJ/b2RK8zGFE3I9x1D9x H1IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692944; x=1712297744; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xc5E/NYDZLjfNoXG7DGNM4m70S/ss7sBgBQIDH4LAuE=; b=DjxNL1/c3fj4A3qNWVThaAhVO1kQ7YR+HrhU66aAiUcwJ+d4Rg5FA53C82ziQOxgF7 QKFsOpIjlaPz2zDhZ0fjoxUMcCdnSt+TJw5tYuo6C3SvTtXrQYgk0Yj5/8Iu3Zo2a2nd 0eHdHrWqBk9Q9SC0ZDmBrOLmqPeMxaEIJd7zK837kjfkuk91B0ZLHjFxxdteczXRSX/V TexkM2NKrk52I7Slct6HdjL3wU7R8NnYP2sIxJMae5mWNkQ09cxyS9l0dXRr9p4dPVJL 0I4CRh9oCnqvDpNXnLevoo1EXgWF6sOuVjRILE53Wq/hPitLV/TQlwxSQ9G/oSKROVdC NzZw== X-Forwarded-Encrypted: i=1; AJvYcCXj5XKUDmO+vKHZfwbcpPraxL0m40nW9NwaYKD+e3RfKikT7hqpNd391LlyEtEbNtwUAndkYDO2Wd96NwkOsKNCe59qftJ4KG0KhKEmQw== X-Gm-Message-State: AOJu0Ywp1eD4i5hBp9DB5HGGrzh+IC8Zl73rFhWKnd6UI+SLvxhL+pm9 aCUgNLJLxbd7ycNWq9WUWCbyeJqqxkqTu9cpL8pcYQhLTmsVptaP9yddq+TCmBOVFWxv0svzn4o r X-Google-Smtp-Source: AGHT+IEePaz2SnD+UFN6/qc+sV/+qt4MnAgsQx6Bz3mfnwBq/eCIcdwQF4nRgtzAAAODjIon94073A== X-Received: by 2002:a2e:9151:0:b0:2d2:4108:72a with SMTP id q17-20020a2e9151000000b002d24108072amr701748ljg.12.1711692944006; Thu, 28 Mar 2024 23:15:44 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:43 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:34 +0200 Subject: [PATCH v2 02/11] usb: typec: ucsi: limit the UCSI_NO_PARTNER_PDOS even further Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-2-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1000; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=1YXtXW57tTxFBEzDGmlGAr9GqbQ7HEPJ3F4/AfgmRvI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyLlz+21OUfH25DMiB9TiVLwHkYmQEer7Cs9 JeVTaNTXkmJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZciwAKCRCLPIo+Aiko 1R7vB/4s3KyFor76g7wvPJMF8SzMLnr0c+3iKrJ2/dnyAVVtjZHza0uXd3JAfyM7xkQ64qlyX/d eKvoDtkT/kpgG1HzWkqzKnLmtNDcLAto0XgBFQkgpyrHaryro2FlkhjFmvyKdrClY6jdx7hs5PH zyeYcEVDMJEbXNkkQWKb0z+LPL8WqTzy8uW6RMNk9PxB2i15VHpnsmLyMofXq3cUnCZZPCh9bji cTvHbHLWHVyHJSNBYQIFFWt96LxHFE/+oxvMjBASU3L+cV1pNpjunhQpbjkjFDYMs16iI+Qy0oQ LUa5ESLcRppKHSgyy9p69SJvhHiCvvcn38fxT8J8gAb42Ub2 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Reading Partner Source PDOs for the consumer Connectors appears to be working. Permit getting PDOs in this case in order to populate capabilities of the connected power supply in the sysfs. Reviewed-by: Heikki Krogerus Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/ucsi/ucsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 42cc1c0e2f73..92886b3b0167 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -620,7 +620,9 @@ static int ucsi_read_pdos(struct ucsi_connector *con, int ret; if (is_partner && - ucsi->quirks & UCSI_NO_PARTNER_PDOS) + ucsi->quirks & UCSI_NO_PARTNER_PDOS && + ((con->status.flags & UCSI_CONSTAT_PWR_DIR) || + !is_source(role))) return 0; command = UCSI_COMMAND(UCSI_GET_PDOS) | UCSI_CONNECTOR_NUMBER(con->num); From patchwork Fri Mar 29 06:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610153 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F01644C92 for ; Fri, 29 Mar 2024 06:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692948; cv=none; b=VWvAzHCg+iaxxl09iNGot1y5wvHrW5S7S3Yqra2ojDwu8l0U0trgoVzwGBC1i1jfcdjoJn1wHPQ7JnmgtiaEV8oyGo2xxhNo6H2BqZArkZEhzuaBstr6/LoeTvB2QInoWM9XSAg1ROymxJ1kEJ7eKo/9CiwA5L5S+lw92P4gFwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692948; c=relaxed/simple; bh=mv/0FMb4uejFpK/85rtje4ZTRBtEhEbil7GSiWyR4Ns=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HnArQuzujsXEC44lXEPlLMiP/KCmWLu1/kZs3Ee/yOGzFxdg5MHOQBo8d/XR0INwkAaa50HLIidcZE6y9Sl0YBsYnBv7jJCp+q3WznMvaC0Uz6OHsWrOthFTPCQqDcDTJEnjvtWQbM6Vc+bOnKhYCBLWjCzk2fWanvtFZYX0XJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MYXYCZDA; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MYXYCZDA" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d6a1ad08b8so16785401fa.1 for ; Thu, 28 Mar 2024 23:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692944; x=1712297744; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=U360Lb4JkccxQYaLDcFFBG6Tk2HssdE/Asbl4utQkOM=; b=MYXYCZDA30EFHdSFfx9K/sxYAPpvncZrCb81cbxXyX8DLvljKtaHKuOxqhBTK6nOG3 WsT25CoE+gOWle+mln5aBNvK84H4znpvNAzjOLlA1fnTVCHJzWkp7cBXGNZb1o4cqpd2 9uJ7dK2b/7k3+bDm1NxSz1/5RqXS438fxL1Q44RuXLGVuAmQ1OvIUyUFGU9w6vSiQTdP bTKLZatdgOD3UTmn0gLQvl7CTeMCWTRjwfAYwdw5hPQ+KIpbvf1Y2TSVC+IZ7whAgfp1 J/jhxuG+XaDz2vvndFSM/VDXqL8RPuJas4pQs+qEFHt1Oh3Xq2dYYFJgUhB1A9Kjd14Q ozmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692944; x=1712297744; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U360Lb4JkccxQYaLDcFFBG6Tk2HssdE/Asbl4utQkOM=; b=K43Ap8FdEEY8uVzfD/GHRXVO8CB1Swo6YjEQQ5X+EYy3iLjRJRUU8JL9pAMZQ7htWL 9GDtTzBAPL0Wc7vPP8loRyMEWwCxcPE5mkudTn323XpL2xCjW5tlvChwOwLspNsa/vrx 30hCCFKOHAmKTwA2OXVaK8B5PStxKMb1H1UoI0nw8YPWAOCiqoGE/z0jlW8qi4Drv4r8 HitEzoJGf86Hhe7OTxjn1eOO0E0Gt9fFG7TfNf6pQ4e4evTiWkO8W7+RXqbpskborG5O Bf4pqoosVRqsprQsASeGqLKQBHwJJWJlTcWeOpVFrCFcTZYvmdYQygzg24e5wruqrvSx OM3A== X-Forwarded-Encrypted: i=1; AJvYcCWjiC1aJcHM+SDVCLlYzypF91k23z2sMQwiRfxCEKFSPX4+6Zi9ydM54U7oGwAKQ9oSM5cpeReLYsRxPBovf3QbItk7uOvZL0M4gdP45g== X-Gm-Message-State: AOJu0Yw/kaInmnTAEmQjks6cnU+aPBJBPgOJ3bCqBO+DFzq+v5G8pqTP IGoJ2Y3h+zehUGtJG14coQLfS4+llQNulDZ43XmgK9EcGBKIyi5qqoEkAnjipfG8s9eG5oFLlnt 7 X-Google-Smtp-Source: AGHT+IH6ZcGTfzbNFfmBE+ZuNEBmN5fcom1ICOQrycQSnuBBttDo3ENTpApw80rBoRKsokLikgH17g== X-Received: by 2002:a2e:9f0e:0:b0:2d6:dba1:6d37 with SMTP id u14-20020a2e9f0e000000b002d6dba16d37mr759556ljk.11.1711692944622; Thu, 28 Mar 2024 23:15:44 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:44 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:35 +0200 Subject: [PATCH v2 03/11] usb: typec: ucsi: properly register partner's PD device Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-3-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=938; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=mv/0FMb4uejFpK/85rtje4ZTRBtEhEbil7GSiWyR4Ns=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyLlXmkrNkyBOSKD/CH4GoO9UuJxuuZPjrh1 AnTZt+6EN+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZciwAKCRCLPIo+Aiko 1dt4B/0fpEWcV0L4JUnCnaosYjxvSCPjnmrEG7cBeHUZokEO3F6kw/cXPsTt2RCxFaIMRvSNG/T sN+Mu47P0XAPk8UUI4m5tBpc56EJW6UqHQs5kiRgHfQhpuMIdTnWQUcfqy8xtBBAWHnqH2E87/7 q9XmE24K4OP6fvbpRsPxSWdh8Xy4dHoYiHiMADy8tQQkT9ZR0G3rfwm46ZlcZzQk7cUIeXfDj5p kLk0SfZQcnlp9/99QD7CMMtDUhEoCadnnnQdpRExokEUP34Z+Ou9ablM3Wy14LOduSYMTbhkHuF jv28/AhUllZQr7jAaJ/kk6KYBwhVfMFeaLrB2tL66fI84hEp X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Use typec_partner_usb_power_delivery_register() to register PD device for Type-C partner so that the PD device is nested under the partner's device in sysfs. Reviewed-by: Heikki Krogerus Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/ucsi/ucsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 92886b3b0167..7666142d8bbb 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -811,7 +811,7 @@ static int ucsi_register_partner_pdos(struct ucsi_connector *con) if (con->partner_pd) return 0; - con->partner_pd = usb_power_delivery_register(NULL, &desc); + con->partner_pd = typec_partner_usb_power_delivery_register(con->partner, &desc); if (IS_ERR(con->partner_pd)) return PTR_ERR(con->partner_pd); From patchwork Fri Mar 29 06:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610154 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A7A47F6A for ; Fri, 29 Mar 2024 06:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; cv=none; b=qIaX1YPtIil01CofNiQ9MYn9QbVpVzATUO8ejOwZzWjOYCmXtKWX3Rxv8z6N6+yCUn23Bx7qu8SASyUuAHamlPkX9k1vKu87V4qm93+VgsRdUdQIZFUnjjZd68hc+4nkgdIIxiMCuor3G5ALxiFoBUJQDTnx4FQdNn34yQJC6e8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; c=relaxed/simple; bh=kmMve1a3CmfaOFv3SDIzmvJNqeQvsNyV9CV0U+g19u8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XOktUMUR5BRBU3NBCyI5v1KLoUoRIJIcRu9YbF259KSL5H3CXgx75UjFwrbi7bvUMuCQoltlXeu8XGBDrpH8CTe0dB/eBl5Ortpd9/e5OtQK9VKf4RXnUI/whnbkOc2lZpDhCwafWHwjDy9RDuffXs09gPvYJ5DAk0f1Px2pw/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UueKZhN+; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UueKZhN+" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-515b43b39fdso1486458e87.1 for ; Thu, 28 Mar 2024 23:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692945; x=1712297745; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=p9WARr5PJTGR4nF8MM4y5LncWxqcV+RaZxFc0nIkpX4=; b=UueKZhN+Zm6IDnhirvWzykv9kbKko0oCJ3fnc3qS4EPKx8+dSlNt7JTh2RS2zosL9p d4rC02v0W2cUW/U2D+qWZJQKxKqz5+CfxqNnwzwZVJM4Au6bc5f499rXhf+l+sxpq58C ncrPoWJK9OYWuGc6sAL6haGbK3UsVu4GfbvLFc2D049EzQIn/USY52Crm9CqeUduPRqc oC14eqhxIzO1wsaihJav6djdYyHWlCm6faGrSwuBDe+aZ9wQuua5iupt/BqrN8xFkqwq lZopyyzQzkJhepf/HXXYHbR537WyHmaD5r8y6i8Okpa2nG7KTG2/KqYlpIXo7VgZgH0h c/WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692945; x=1712297745; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p9WARr5PJTGR4nF8MM4y5LncWxqcV+RaZxFc0nIkpX4=; b=OBYDs52la4RnN7QXwCqsNw4ymI2/X+xZIrgO6xCQwHwWTnZT47Iuu0RrTJRnrXxKB2 pMThIN1BYP/Zbgx7zrFjHvVF5e8lWf7a++qBv3oB++3CxIvuw2DEqpmvGSYlDbi2wi+q ArOoaMq7cca6FIVmOk1N3Jwcz//qi6mnlPPmIpHKQok+zRDBVpiprTpomRSHn6YXOobe WgGKH0iOwsUg2HZiTfZ1J27fT2jbWjGnE1Nq6rDoK9sjNf8Rxs2z0oWREqzeQYHQtwp3 4uclcEA3MAzxMVRtz3xbyFRuha5mBdD1RTsmByLNbl4IBdAZ0MpThR0dbrRay7+gH9uu 64RQ== X-Forwarded-Encrypted: i=1; AJvYcCXsryl6KhBV6n4TyIYV/Lgovfet/qK/O0nXr2kdLBpyhJfntEaLommxE9J79u7PA4eMwHI+RJ78Prw+Te4Ry+QvR5DpvNiO7ZJqD9/vCA== X-Gm-Message-State: AOJu0YyLX9y3yH1wryEAEi2klUcSzchPFyQcqlvssAcLuzuULu7GLv+e 4dANUPSt0W5uFQ0wCJ0NR+O2xNsz99jW7GEWa0deiSb/dL5if5HF5JyM6bQKw5c= X-Google-Smtp-Source: AGHT+IGvQ8f9YXAn2iBrH5LnwrMLoOtI6yPr6IJfNELlL4AzDEj4+oxrhpSjjNxTw9KzBJL0mbX5TA== X-Received: by 2002:a19:7719:0:b0:513:df5f:38cd with SMTP id s25-20020a197719000000b00513df5f38cdmr1477031lfc.4.1711692945235; Thu, 28 Mar 2024 23:15:45 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:44 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:36 +0200 Subject: [PATCH v2 04/11] usb: typec: ucsi: always register a link to USB PD device Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-4-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1376; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=kmMve1a3CmfaOFv3SDIzmvJNqeQvsNyV9CV0U+g19u8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyMKc1GZtj7L3z/cE0m+6ByGZsSzcBpBZtgr dDygFKIaDCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjAAKCRCLPIo+Aiko 1W7jCACoXQgcUo0h2r1jBpKnUQNK/A4bS6/1KLnS1l5qFNRmfXfn3pdUZH8TxWPZVKywadqhBim YSgAYFjTrh4ogqyEjgyny/ISk9UJSNVOkuo9YurQB7x7GumwY7Yz+otgZS59c82SB9DslApB3DZ lZGXv4pWOg1s89eWyHeeb0nlFL9Vn3r30dtF7Vyue2KNWS3VGMjeKqjHFqFL36C0L/55kNp2/TE HyJK8s47d+8MhlCzNM2QPf4i/hYFxdipkFXGnkvxrU4rKH5RPbKqCZvmvh8MsYyebkPnXhlzFWd H55Zy7oK1oEjEwFr66esnVWt4U2tH7HaZXCvAu6uwrYYGMIB X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A UCSI driver will attempt to set a USB PD device only if it was able to read PDOs from the firmware. This results in suboptimal behaviour, since the PD device will be created anyway. Move calls to typec_port_set_usb_power_delivery() out of conditional code and call it after reading capabilities. Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities") Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 7666142d8bbb..d1a45ce7f660 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1569,7 +1569,6 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) } con->port_source_caps = pd_cap; - typec_port_set_usb_power_delivery(con->port, con->pd); } memset(&pd_caps, 0, sizeof(pd_caps)); @@ -1586,9 +1585,10 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) } con->port_sink_caps = pd_cap; - typec_port_set_usb_power_delivery(con->port, con->pd); } + typec_port_set_usb_power_delivery(con->port, con->pd); + /* Alternate modes */ ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_CON); if (ret) { From patchwork Fri Mar 29 06:15:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610155 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F58447F72 for ; Fri, 29 Mar 2024 06:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; cv=none; b=CnL933zUJEpSey73LWlavdCI7V+2PIhPlaIl3QdL9ablwMaaRTGE9aS72NpkTJtCb4kjEaYUTN3DlYAfm10ZgMu4UAPrIAqQd9mTO5gQ4V6+/hb9nxTKqgFO3SYxxEioAFzX5BLvlhjtbsHgoJNd5NQP58NMQf9AdUlp2nrZX4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; c=relaxed/simple; bh=YxeqS9+AEKt92fJPZZCdKrmg0ZW698/Ca7k90saHM74=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MbRgV/+CX7gmSCQRQIZ/zkKSyiPGdajU0Tc/VLP+0VGbH255AaGj/CJGDVovfrRjxygFOMqYcmkDCfjJICStElwbWhifcPGog34Um3n63D7CGMPdAhIQARn5t2emKbrL4Mko0W/1o/bd+4uVQ/Mcgo3LnX6bSDaFJHQiYY57OqE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XSjPZg3x; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XSjPZg3x" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d718ee7344so2674701fa.2 for ; Thu, 28 Mar 2024 23:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692946; x=1712297746; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wBbPByPot+es2m/svxnMW+kEyaRct2JNWCRNRMHPaxk=; b=XSjPZg3xoQgpcJUmLIrTGKnhI3wRhlxmT6WLYfMPf2LO1EsVpuG1yfKjFGacP+HYaJ oDYHdGLr83iIWJL82xDMavNbkPghxPppIN8d+2smFPh4auShQwsxUlXRtV7nM7VpVZrm Ejn92mqluRNnELciAyRNom18nIjwu7fXfQRxkVL40LOJce0gLc5KjFUF/cfxhlCplWLE bBvjTFn4wy3l2IKhoF7BCNHw8ZTdInReVJc3FkG2C1XsJ88yKLoq3anmhwm0n7dSDNEl Ef5RL6cG28FY3WCUTReO4k2At8JtLHpOwhl96/0i7Qp4hfEHhlv5e9V/P0QBtsbM/9NC f9Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692946; x=1712297746; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wBbPByPot+es2m/svxnMW+kEyaRct2JNWCRNRMHPaxk=; b=AKzCe3I5pqyKj3RPbPPgNwgiuWUito2QcMWEw19r46Xq5puFw7yTT2VK+YNngiOxeD JXyhhw8rJaf6+groLthbVNqj3B2apD02pCEU/+VSyJOY3QghMNuofhWQZZHYi59BE8Un ewolsscIJzvsDOSLpR0Ddo1L71GF6erdBUOaPwgRcWL+McR6+q8qiFXMdrAL9oJrgt2+ PJoBPxnYBQgfqI4hFFuxduvpfz0VZ2eH0bCsXU+pgIXS5y4wxxvkDsXBm3+6JvpklE7k nscvuU/aPMJ0kEoEBsGc87wA6yA9EDRg9I5AzjTFJs+EqlVT7dPESpYitjqhwJ1jK17+ V3Sg== X-Forwarded-Encrypted: i=1; AJvYcCV/VX02W9AbPr4iCqUj9zqYhLmNxarYeb+/3Wo0Q5wNLg/QPh6jQkcGtPYIVPSpfDddOgx16NxmnViqXjByz+PO/lxxcANdfuqACkkvpw== X-Gm-Message-State: AOJu0YyRsPXzV8SEMMOfu+08Wlt2w5hcykZjZBaAH++F+rip1jKFjRFC q/+grKh11VXdrPvxLafhVD/eWkHVOL2xO551rSkKEZ1+C6/DX6A8kFbbUmmNuy0= X-Google-Smtp-Source: AGHT+IEPRQ9eWd4qptN07z8gS0eJNHOjSCyMldcVnalm+I6vKhSLVJfC/bSy+HJ5vt9TdPwVznv1YQ== X-Received: by 2002:a05:651c:2d0:b0:2d5:6b1c:b180 with SMTP id f16-20020a05651c02d000b002d56b1cb180mr705437ljo.8.1711692946084; Thu, 28 Mar 2024 23:15:46 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:45 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:37 +0200 Subject: [PATCH v2 05/11] usb: typec: ucsi: simplify partner's PD caps registration Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-5-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1711; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=YxeqS9+AEKt92fJPZZCdKrmg0ZW698/Ca7k90saHM74=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyMV0bTuwZx+D2SMO9pQ+XDYOMhJOfUz/7xa RNXDKlDJteJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjAAKCRCLPIo+Aiko 1ZDFB/9HExwMtBzgRUjHqXIUx0di+43lhFI+s9kC7ti/gtDev/iUP+vWLRGMVRzVR1ZdDzWqO1R h1RdeGsKcC8Igl2PhxQwD/fENbaTS1e9y5XhB9JkvFeBHDaLLHSlp4sCMHe49jokgud19ytIgPj mnmgh7/1kIh94acoGWrSD6yOP34NOjvdonWkAzWcqjz8EDT8n1KEC06dvjjxg52XgVS196NqpAj Jh5d8Uy91MY3Ilbe4rAUJBTXc8padNuDmHJywy5Ugn5GwvpuQEnaJ4CA81DYS+nRngn55GLKjht TSPr/GmYBN1hbwWpNOSCXOju1pKg2bVH+98hwBlX30VTe02T X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A In a way similar to the previous commit, move typec_partner_set_usb_power_delivery() to be called after reading the PD caps. This also removes calls to usb_power_delivery_unregister_capabilities() from the error path. Keep all capabilities registered until they are cleared by ucsi_unregister_partner_pdos(). Fixes: b04e1747fbcc ("usb: typec: ucsi: Register USB Power Delivery Capabilities") Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index d1a45ce7f660..35366b1a3d78 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -826,12 +826,6 @@ static int ucsi_register_partner_pdos(struct ucsi_connector *con) return PTR_ERR(cap); con->partner_source_caps = cap; - - ret = typec_partner_set_usb_power_delivery(con->partner, con->partner_pd); - if (ret) { - usb_power_delivery_unregister_capabilities(con->partner_source_caps); - return ret; - } } ret = ucsi_get_pdos(con, TYPEC_SINK, 1, caps.pdo); @@ -846,15 +840,9 @@ static int ucsi_register_partner_pdos(struct ucsi_connector *con) return PTR_ERR(cap); con->partner_sink_caps = cap; - - ret = typec_partner_set_usb_power_delivery(con->partner, con->partner_pd); - if (ret) { - usb_power_delivery_unregister_capabilities(con->partner_sink_caps); - return ret; - } } - return 0; + return typec_partner_set_usb_power_delivery(con->partner, con->partner_pd); } static void ucsi_unregister_partner_pdos(struct ucsi_connector *con) From patchwork Fri Mar 29 06:15:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610161 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D22B44368 for ; Fri, 29 Mar 2024 06:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; cv=none; b=hePDYYPzLq0UMsM131Ma++5bkEPgWtuYpxUNzc+5CjLhF6eJTtSXIw85HiIjN9udRYqUZnEo3W6DIGctJVEKIGHljDZEIlpT9k5XAeujgn2x/9MJ44mcO6VHeS+ITO2Pu20odCPEi5GWVS/dcP74iKyQl/AYV+2R4SsScQif4X0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; c=relaxed/simple; bh=12roAABSvS8s66vFOhz0Ej3vS+YDb5JJUkjxncPVUtk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qRqQ77T53LSg0a0S4R1H6dvU86oQuvY3Lduk4UBSWnt4hYwq7WqvgBQo5XOFjcjfLjv0ns4oNbKgTCErlblTFCEs08VGCM33eZy7uLoU1ehtsnaKlNR9eldfvLmMaStKX5luLsIaK0Fcs3gofpj8KaUMOmhnGPPqk8DvfoJxf7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JSXqQ24X; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JSXqQ24X" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d475b6609eso18396521fa.2 for ; Thu, 28 Mar 2024 23:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692946; x=1712297746; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TPxSwLNRU7JirYCxsYGkY7fYD3aOS0RR78s/czBwCEA=; b=JSXqQ24XaG2Ji9YeVx4z7MV3fJDTYsF/P/aYejw0oiaU1qAejI4HAFX0L6x+7Ga5qv hGknRbyLDpwagkhfeVOt2gHH682NUiuxfVEWhPZVSFo2EpgJKmbUulXZU8/sHjw8/B1N mLQ+qdtsE1gf2DVoBfvx/bG0onwCCRUwJgCubXAJfU5FNXbKZGMRdtB11AoGVbxulQCk 0kuM6aCTVIRTziA35Pzm9FHS/loe7EAFK5tleAF0qGS6+UX+3cjEegRMmslkFIn27q8/ t/AYlKkIl3PtRNmAS4CBzwRsv+uni6oqsxAobLd0rDvQ29Zp1H0GzKlXTPdNoLUI/Kes v5yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692946; x=1712297746; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TPxSwLNRU7JirYCxsYGkY7fYD3aOS0RR78s/czBwCEA=; b=Z6aPzDXkGU2b2j7z+qY1JL2asOewXSyxa22xvPX4kzA8JWWvNNq/mO8CVeHmhDmoc+ 9RDw3ccNTgWoZ6XjcvnB5UkIngbscJdwU2riWIPNmW8HtZoDSnAHLkJACUwF5nBh0IY6 a5SWxW9kkmcYjHrzTobJYl1Yc/wLiAoOBzHTz+DW4skMvkPKAkQL4PYFoZPtbesmNZ6R tnmGa1QVOHqpWEzR12MTObZQk6tdsRTbrE3Hr+J7GPzGD9pzZjxTRyYB/uMUl2eMStxW u8PvGr7U9jh+y1Ll1q2MWoj4DoNN78v72Xg48tlS8QSrEOXkl1Hq/XnCla8ElNCV7rjB 0vGw== X-Forwarded-Encrypted: i=1; AJvYcCV/ZJ7IMtke10+KtRf7vThDUfWuixHqYheUruh7aNS4S4DZb1EcXMrMZGMuapGWnLg6k7XrdnQ/xj0oa+gqvv3Z0Rdcde+4oOEsz2thSg== X-Gm-Message-State: AOJu0YzeJ6E52+guGYpHBUxzhhrGWIu7QSJ8x7OTHrtSkdJNGJQxFqkT 6AYIONsW+Pgkze+ChNdBCD2anWJbfjEH3EUAXJBZkrUdiJ3398dd2vbeHYkEdyw= X-Google-Smtp-Source: AGHT+IEXB5SP5P1OQb1Z7VzjonGu9gyMhxfCaMv7EwCqe/+Y7XsRC/sg3Uxu90+kT6l38IW8QQnebw== X-Received: by 2002:a2e:90d8:0:b0:2d6:c726:ee64 with SMTP id o24-20020a2e90d8000000b002d6c726ee64mr766701ljg.13.1711692946687; Thu, 28 Mar 2024 23:15:46 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:46 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:38 +0200 Subject: [PATCH v2 06/11] usb: typec: ucsi: extract code to read PD caps Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-6-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4416; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=12roAABSvS8s66vFOhz0Ej3vS+YDb5JJUkjxncPVUtk=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyMCTEX4esjwYXF6xy3MXFnaqP9PR8AxRq7f Sqd2b4H6WWJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjAAKCRCLPIo+Aiko 1Y8XCACz3+D1KczS0/wOVXGt+djxZULmmnPWVPBJrOPvEBGUAlSMvS48T9ReTU26YvL9Xg6RSHN p9LrA+8/yEmqG3Ejl6hJeq5yQK9hTJdy2SY5s/TFH9NNxu+zlgBm565gf8A3gn/2ZGo/cgRitx9 Mk7phfeFu+iKND4lFJ8Fz8B1AATopKsL2u78Hd+qVrgGk5nmCKVbko9xtbwjqm3qEhKUhL+u3I4 4DAW6pFzXPuYcSHeQ+FoLmxSy4yg1u+5vGvS7ZNmPDXPDyvct4vBT/ZacJ4j+acLLyujQ1x25vr gOm7r6sTPX12IhPHXl3BsLta7xNMGVJzwNw6ToKXtwzbucHe X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Extract function to read PDOs from the port and set PD capabilities accordingly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 85 ++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 53 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 35366b1a3d78..18b2e4ffc57e 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -677,6 +677,26 @@ static int ucsi_get_src_pdos(struct ucsi_connector *con) return ret; } +static struct usb_power_delivery_capabilities *ucsi_get_pd_caps(struct ucsi_connector *con, + enum typec_role role, + bool is_partner) +{ + struct usb_power_delivery_capabilities_desc pd_caps; + int ret; + + ret = ucsi_get_pdos(con, role, is_partner, pd_caps.pdo); + if (ret <= 0) + return ERR_PTR(ret); + + if (ret < PDO_MAX_OBJECTS) + pd_caps.pdo[ret] = 0; + + pd_caps.role = role; + + return usb_power_delivery_register_capabilities(is_partner ? con->partner_pd : con->pd, + &pd_caps); +} + static int ucsi_read_identity(struct ucsi_connector *con, u8 recipient, u8 offset, u8 bytes, void *resp) { @@ -804,9 +824,7 @@ static int ucsi_check_altmodes(struct ucsi_connector *con) static int ucsi_register_partner_pdos(struct ucsi_connector *con) { struct usb_power_delivery_desc desc = { con->ucsi->cap.pd_version }; - struct usb_power_delivery_capabilities_desc caps; struct usb_power_delivery_capabilities *cap; - int ret; if (con->partner_pd) return 0; @@ -815,32 +833,17 @@ static int ucsi_register_partner_pdos(struct ucsi_connector *con) if (IS_ERR(con->partner_pd)) return PTR_ERR(con->partner_pd); - ret = ucsi_get_pdos(con, TYPEC_SOURCE, 1, caps.pdo); - if (ret > 0) { - if (ret < PDO_MAX_OBJECTS) - caps.pdo[ret] = 0; - - caps.role = TYPEC_SOURCE; - cap = usb_power_delivery_register_capabilities(con->partner_pd, &caps); - if (IS_ERR(cap)) - return PTR_ERR(cap); - - con->partner_source_caps = cap; - } - - ret = ucsi_get_pdos(con, TYPEC_SINK, 1, caps.pdo); - if (ret > 0) { - if (ret < PDO_MAX_OBJECTS) - caps.pdo[ret] = 0; + cap = ucsi_get_pd_caps(con, TYPEC_SOURCE, true); + if (IS_ERR(cap)) + return PTR_ERR(cap); - caps.role = TYPEC_SINK; + con->partner_source_caps = cap; - cap = usb_power_delivery_register_capabilities(con->partner_pd, &caps); - if (IS_ERR(cap)) - return PTR_ERR(cap); + cap = ucsi_get_pd_caps(con, TYPEC_SINK, true); + if (IS_ERR(cap)) + return PTR_ERR(cap); - con->partner_sink_caps = cap; - } + con->partner_sink_caps = cap; return typec_partner_set_usb_power_delivery(con->partner, con->partner_pd); } @@ -1463,7 +1466,6 @@ static struct fwnode_handle *ucsi_find_fwnode(struct ucsi_connector *con) static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) { struct usb_power_delivery_desc desc = { ucsi->cap.pd_version}; - struct usb_power_delivery_capabilities_desc pd_caps; struct usb_power_delivery_capabilities *pd_cap; struct typec_capability *cap = &con->typec_cap; enum typec_accessory *accessory = cap->accessory; @@ -1544,36 +1546,13 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) con->pd = usb_power_delivery_register(ucsi->dev, &desc); - ret = ucsi_get_pdos(con, TYPEC_SOURCE, 0, pd_caps.pdo); - if (ret > 0) { - if (ret < PDO_MAX_OBJECTS) - pd_caps.pdo[ret] = 0; - - pd_caps.role = TYPEC_SOURCE; - pd_cap = usb_power_delivery_register_capabilities(con->pd, &pd_caps); - if (IS_ERR(pd_cap)) { - ret = PTR_ERR(pd_cap); - goto out; - } - + pd_cap = ucsi_get_pd_caps(con, TYPEC_SOURCE, false); + if (!IS_ERR(pd_cap)) con->port_source_caps = pd_cap; - } - - memset(&pd_caps, 0, sizeof(pd_caps)); - ret = ucsi_get_pdos(con, TYPEC_SINK, 0, pd_caps.pdo); - if (ret > 0) { - if (ret < PDO_MAX_OBJECTS) - pd_caps.pdo[ret] = 0; - - pd_caps.role = TYPEC_SINK; - pd_cap = usb_power_delivery_register_capabilities(con->pd, &pd_caps); - if (IS_ERR(pd_cap)) { - ret = PTR_ERR(pd_cap); - goto out; - } + pd_cap = ucsi_get_pd_caps(con, TYPEC_SINK, false); + if (!IS_ERR(pd_cap)) con->port_sink_caps = pd_cap; - } typec_port_set_usb_power_delivery(con->port, con->pd); From patchwork Fri Mar 29 06:15:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610156 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04C613FB86 for ; Fri, 29 Mar 2024 06:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; cv=none; b=k7w+amqQltaqjxu1F+ujgicN4+w54RziAhwLCU+OebSyG16umxcR/ynm+z2niOscf7J509h5EvDqM5dQ9Bfo5GfkNUatEPc7L3mpbNZ4+qjGwvqUS8T9I2pBBlPBZP2jPa5p9ie89vCKdJB+2PdFFvYLnQiP63bx8l4bUHjBVZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; c=relaxed/simple; bh=YD/wggfHpA60Ni/iCzWPJjqKvxw25S4GmQbPPpQ7gio=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FtqOg86xPfOZdjRNc++eBm054LJmaWx7DW02bjk1skr0SU3W+YPgJz9NKgHVvQHQmvKYaIAsFMlQdjfgHdX8/vJcfT75uU/sOl3sOlJ2BQmQxYDohxxV2HhixB7M5oINiBXjO/mu5kQ7/ozJ/1Oc1wMmozZl9rongkq1/sZKAYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uMlhrKx1; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uMlhrKx1" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d718efedb2so2723081fa.0 for ; Thu, 28 Mar 2024 23:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692947; x=1712297747; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AquvWTI2GaVy0mYZa1ujIRfyg1V3AJj3Raax6DJtlpQ=; b=uMlhrKx1e7wprPkZZDH3cf5fZ91Wkk/xrerLPdEbNhiu4Wl5vQ/9avq6Uq+gXzouDk zEKhgJYXbiwAHuTZgYhMsDaNalh8MV3O1FY1nD48Q59EJRVx+ioG7GWf+kuWrjWudAtn 0EkUwua4R5QgAgV2b9BVcs/1XdWnYMRQuYw6t+kfXmb5Bqz8T5mRBBRF+Ufykrj7N0uh ZFklElI17sgWkUfMQKA4UGALBoDS6fqBifaHLGH9sgONdopczwAMPotEzCOEsXQ3lmMj MI71MQuSwbjsH73dTLhP7az5l0BFAK/RYiZ2Erg3XB+VmiOdGCnn3MmX5uwMH0w+PyqQ SGHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692947; x=1712297747; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AquvWTI2GaVy0mYZa1ujIRfyg1V3AJj3Raax6DJtlpQ=; b=MIHFIc3TxwhrkdDWDH8BOOqNBvAg8qou+0S+yg3thruEhQD2kslZv8iLMUg7YoO4sc GSalqdI/ldgNzA0jku438ZOlhnXbqv2moS4EmMQC6OD4xve4mzu8ZAJiLtCo9IfjlLs3 2xHUeGt038pF9YafkVwA+Lai06A+3di/8UzK24iTU/DSdvMmdNZEZQq6WmZ+WllXI7Y1 7Wn6CN6vxtNXGjTvrirDGbqpSj/slYuYjuE3AvrYg7uLQYSnzitUVWcG+5utBzfnisKg L1RJ1FYK2coqhtQJ1Z/yShJZWjoAV2cMHwZKxJgaxYkAY5yKcDa3SCLjbQwFetr6XQL+ Vr3w== X-Forwarded-Encrypted: i=1; AJvYcCU2mFfiXPbMbJ6REQ7qRyJIzv8tqL0uSkpcDc7fx3RlYw3xHBCpO1YsMejYCM7zKUBBHGmPRUcXNKm6eKjbg0ZVIqjoR55N+Q7q1bKC0A== X-Gm-Message-State: AOJu0YxTtLQ4Rf2lGEaA2fyfd17ajVEVXW2lKlNYz4tmrwoL3GscwIDr c/gGuUDVAc3HO1is4ZS0qPtw0JEBbmfpAK3z0F3DEz3FyjsU0e+NE2pcrjNqmBs= X-Google-Smtp-Source: AGHT+IHPyLucbnjVjjDJhkt02Gb92ctRYO/oltddM+q7aiXklJVRDPj1a+N7m6UnSHSJEg/7wdp/1A== X-Received: by 2002:a05:651c:2ca:b0:2d7:b:da33 with SMTP id f10-20020a05651c02ca00b002d7000bda33mr829794ljo.4.1711692947298; Thu, 28 Mar 2024 23:15:47 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:46 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:39 +0200 Subject: [PATCH v2 07/11] usb: typec: ucsi: support delaying GET_PDOS for device Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-7-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3874; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=YD/wggfHpA60Ni/iCzWPJjqKvxw25S4GmQbPPpQ7gio=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQxpbTI/Rv2+6Cfe6pd+nHo2SP8h6/gmLzV47n+WrDO/OS jlRtLa/k9GYhYGRi0FWTJHFp6Blasym5LAPO6bWwwxiZQKZwsDFKQATud7E/pvV519E2XXrSeod cy3itrYZJhY3zZXu4bXl21/Ev9HomJV/p2Er858/ij91eOKK8gK+hc8RjW++ovtVhmv6788Jbre qdmrzT2Vi+T07Ijg//1+tRNdS73/RHRMfXPqny8c+x/y7XdwP1V87XYUkNC3ZnD73WlQyXhF6EB lZmrT7aOKdiFcbjX8xvPb4npvMFBcxyypJpfqP/rHDbClmG3TSl1/z4NAx2FUsvcbBrd0rtvRkf /26S6fPMweLGYf73K+WurfDy/EAy7TL32WWWk422hnpFZx+bH1cx+r9c6tdpTw2eETnXj5lkXR2 qeFmVg3O206lqqfOiq7smvtIL1Re7uAKMW0rpZg5k5QB X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Qualcomm firmware doesn't return sane information for device's PDOs unless the partner is also using a PD mode. On SC8280XP this even results in the Error bit being set in the UCSI response (with 0 error status). Add a quirk to delay reading USB PD capabilities for a device until we detect a partner in PD mode. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 41 ++++++++++++++++++++++++++++------------- drivers/usb/typec/ucsi/ucsi.h | 1 + 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 18b2e4ffc57e..f5ec776b84d6 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -821,6 +821,28 @@ static int ucsi_check_altmodes(struct ucsi_connector *con) return ret; } +static void ucsi_register_device_pdos(struct ucsi_connector *con) +{ + struct ucsi *ucsi = con->ucsi; + struct usb_power_delivery_desc desc = { ucsi->cap.pd_version }; + struct usb_power_delivery_capabilities *pd_cap; + + if (con->pd) + return; + + con->pd = usb_power_delivery_register(ucsi->dev, &desc); + + pd_cap = ucsi_get_pd_caps(con, TYPEC_SOURCE, false); + if (!IS_ERR(pd_cap)) + con->port_source_caps = pd_cap; + + pd_cap = ucsi_get_pd_caps(con, TYPEC_SINK, false); + if (!IS_ERR(pd_cap)) + con->port_sink_caps = pd_cap; + + typec_port_set_usb_power_delivery(con->port, con->pd); +} + static int ucsi_register_partner_pdos(struct ucsi_connector *con) { struct usb_power_delivery_desc desc = { con->ucsi->cap.pd_version }; @@ -981,6 +1003,9 @@ static int ucsi_register_partner(struct ucsi_connector *con) break; } + if (pwr_opmode == UCSI_CONSTAT_PWR_OPMODE_PD) + ucsi_register_device_pdos(con); + desc.identity = &con->partner_identity; desc.usb_pd = pwr_opmode == UCSI_CONSTAT_PWR_OPMODE_PD; desc.pd_revision = UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD(con->cap.flags); @@ -1465,8 +1490,6 @@ static struct fwnode_handle *ucsi_find_fwnode(struct ucsi_connector *con) static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) { - struct usb_power_delivery_desc desc = { ucsi->cap.pd_version}; - struct usb_power_delivery_capabilities *pd_cap; struct typec_capability *cap = &con->typec_cap; enum typec_accessory *accessory = cap->accessory; enum usb_role u_role = USB_ROLE_NONE; @@ -1544,17 +1567,8 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) goto out; } - con->pd = usb_power_delivery_register(ucsi->dev, &desc); - - pd_cap = ucsi_get_pd_caps(con, TYPEC_SOURCE, false); - if (!IS_ERR(pd_cap)) - con->port_source_caps = pd_cap; - - pd_cap = ucsi_get_pd_caps(con, TYPEC_SINK, false); - if (!IS_ERR(pd_cap)) - con->port_sink_caps = pd_cap; - - typec_port_set_usb_power_delivery(con->port, con->pd); + if (!(ucsi->quirks & UCSI_DELAY_DEVICE_PDOS)) + ucsi_register_device_pdos(con); /* Alternate modes */ ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_CON); @@ -1617,6 +1631,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) if (con->partner && UCSI_CONSTAT_PWR_OPMODE(con->status.flags) == UCSI_CONSTAT_PWR_OPMODE_PD) { + ucsi_register_device_pdos(con); ucsi_get_src_pdos(con); ucsi_check_altmodes(con); } diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index 591f734d457b..2caf2969668c 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -406,6 +406,7 @@ struct ucsi { unsigned long quirks; #define UCSI_NO_PARTNER_PDOS BIT(0) /* Don't read partner's PDOs */ +#define UCSI_DELAY_DEVICE_PDOS BIT(1) /* Reading PDOs fails until the parter is in PD mode */ }; #define UCSI_MAX_SVID 5 From patchwork Fri Mar 29 06:15:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610157 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6AF747F7D for ; Fri, 29 Mar 2024 06:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692951; cv=none; b=hTVquRbQ3wNzM2fdUcbIcEbb9RELXLSFiYr22vtSf0q+e6G3q3PDq/A/4qqQKLNfi4E3i2+FW9Zubuj3NFUHUZfvKA87jMlSkntdvRPiKTAZQd0KZ2GQ0Kuozk1dap90anu1gkUOiBr/qlWr/Djkg9foVSnKswGbIZY6VT25B8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692951; c=relaxed/simple; bh=0M5IsEA87/M+6H7Q4T52Tgd9zM79dBLWPhn+7+zmvE4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l0H9e9qXqZnBn7ztaluoioFk0QrdoXKpqHbLUSVcmU5iDK6feEhmDW1Azs6IMYlMvQ8xNeULHnVS7vn/HYSyKQh+Z7YOiO8+nlZ1oB4bViBpEhAwTPAxF04i8qKPak4v1FyKYQOgQmcHA/StnOcb2ab65rSaoUzP7Tl073rUYuY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dZDaci52; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dZDaci52" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d715638540so5079811fa.3 for ; Thu, 28 Mar 2024 23:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692948; x=1712297748; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ArcwRWLp0xjA/Ge6AhRm6xs4hW1aHT2VtS2adOBVGyw=; b=dZDaci52aRHKtVphaNFWASFBeNPrhALvjW56w6Ztrm4p9KfiVI9nMT7VkxQCbkq6cu qby6i/7ZIrakdxZb041csazzj5OHgF74mV91i3BegQDd40hLQ8mjCnXE3NKGjFNGHOCe deoQjLnxnHeG6AlbNjk7pecHCWJCkcJgKNHUhT/1ZC8QysngRayYPyJ5S7SRmMtdHocz C7eVli/TJj6LjiQDGH+JE1Y/9oDcny+XgNE861LhFAxNUMjQek+ddCdNSNGZiZ1dHHcl uYzBnS2uBJ5WioNZ+BnD/GGkpm7VOI8Rc4zBIZFDqhLH3EcyVoVuZNAaOmFrrLpBRU7/ N5Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692948; x=1712297748; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ArcwRWLp0xjA/Ge6AhRm6xs4hW1aHT2VtS2adOBVGyw=; b=eHPxtNmi4lDliNKhFWtm+xxlw3k0K25IL82EnPULfl7LssVo5jQxx75oNPLsKuYQJB QPYJqv3Em4arzcJcExC1e8SqfeL3Yxz9yezFiliDD6LvJJh/VdKW3wfKzskt1sYHdW8e +JOr//3U+KgLNXDAHI+kKvCp21ztF1M5QMzlpAtcRbQXbHCh724w+fcOhM4YjZSSud9z 12Ul90PwJf8aKs5vMGwJqTDJLtqWko/NwrgZOAwzZAstq/JkpAA3tbEIraiBFxBheo6M 3XgCpmDkvLz4JOEo1r8gZ5hStjwWOjNjmSwR/4wihjuYjZ8JcOsOUf58LbbvCwMxAiq/ 1LcA== X-Forwarded-Encrypted: i=1; AJvYcCX+itXT7KcR4Q2+cliKXrNINcgWqcIqtyTAXc0BaKUIAvAMcTvmTIV/oAmHgloRX8l7dU6vU3XehcrsfvBW1LCsvRfgRu3IEcTWfntPCw== X-Gm-Message-State: AOJu0YyPJ/ExhHFDQqQ+4DxMR74K8fy3Zrkh3FPriDwd/R0bEf0MC/Tu k0FkU/VtMXzEm+iu2SWFFk4x1CPt1KH0QImVdJHSy8Ego0xNEEUGWUO3y9iCXjQ= X-Google-Smtp-Source: AGHT+IFPxMhVDRin9KsPmfVGnbcfLzgCRad8RiNdRq94mejOH/EXlp7OaSE4Mxj+/h8uRN1FvFmCvw== X-Received: by 2002:a2e:9a9a:0:b0:2d4:4b13:3413 with SMTP id p26-20020a2e9a9a000000b002d44b133413mr636015lji.22.1711692948046; Thu, 28 Mar 2024 23:15:48 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:47 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:40 +0200 Subject: [PATCH v2 08/11] usb: typec: ucsi_glink: rework quirks implementation Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-8-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1972; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=0M5IsEA87/M+6H7Q4T52Tgd9zM79dBLWPhn+7+zmvE4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyMw2Ot5elyAlJ5xQxuw2YguhLBmQHchEdVZ FSKyycBCPOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjAAKCRCLPIo+Aiko 1SH3B/wJ2N0HbhoiUHHI3yxn/WSPtr+jJ0Iuu3dCx+mRQ5FMxLkBtQXOYey/IIVnAuUuo53Myde w5gT8ysJTvHIDxI4cPeQsiacAz0wounCHEI890BqOD3yxMW3UWmYb5hljC6LhgnMivLfGsLljib vADpk4RJKlLGvGAE1QcRzR9L3oVb5ytdAcsAvhhR8/rXz8vjvS9w5o5vy+wr4Aj7DenWJgtGJar NtyZRxTPvukrx9OQAoPI5C5ViEILcEuQ1DB6aTGUCOZMpyB8PL95d6/1cyz5pXzGfv7M+Lei3Q8 IBpn5AOhAUf0I4GpNjd92gGWzIDXI+p9cXvS8KjQH46+bQJH X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A In preparation to adding more quirks, extract quirks to the static variables and reference them through match->data. Otherwise adding more quirks will add the table really cumbersome. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 932e7bf69447..d7a18950faab 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -297,12 +297,14 @@ static void pmic_glink_ucsi_destroy(void *data) mutex_unlock(&ucsi->lock); } +static unsigned long quirk_sc8180x = UCSI_NO_PARTNER_PDOS; + static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { - { .compatible = "qcom,qcm6490-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, }, - { .compatible = "qcom,sc8180x-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, }, - { .compatible = "qcom,sc8280xp-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, }, - { .compatible = "qcom,sm8350-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, }, - { .compatible = "qcom,sm8550-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, }, + { .compatible = "qcom,qcm6490-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sc8180x-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sc8280xp-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sm8350-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sc8180x, }, {} }; @@ -340,7 +342,7 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev, match = of_match_device(pmic_glink_ucsi_of_quirks, dev->parent); if (match) - ucsi->ucsi->quirks = (unsigned long)match->data; + ucsi->ucsi->quirks = *(unsigned long *)match->data; ucsi_set_drvdata(ucsi->ucsi, ucsi); From patchwork Fri Mar 29 06:15:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610158 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 824644AEFE for ; Fri, 29 Mar 2024 06:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692952; cv=none; b=hmA9rAmlllhA5htIClc/wV0gGe4e2c4gzGMou9yRPIzl9wpCEn2tXKxg4HOd4G3HXu0zA+PUJekSeAvHvI2F6SsdDktJZTDwbMvYTc7jsQUHcuLU9CBIC7Ohbdh+s5tMDl1AhjsIQ4wZN5qjnZZ/0Fr4cpMJ2+uXC0XLMlEmcXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692952; c=relaxed/simple; bh=PIpCaKz646kYps9WO7oi+imJxxIB2fUbNCrT9mXhSWI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XEt3yaEdu1rFq99AKZdoQcJyVeYwJM0t9jpz2mI+rAbYNlKN0w8dOhyqRnwn0xUpVQm3wIuoXpANKUQUPnNDdXtMbrOk19Z8dQcAB+H+Ap/5xpQhM2XQZVcnXWONi2bBJJvjq0Yvs++KJ2DlKuChMfqjV9m3eIVwRT4tDSimu8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=U7iQNn8S; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U7iQNn8S" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-514ba4e5640so2723281e87.1 for ; Thu, 28 Mar 2024 23:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692948; x=1712297748; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dl25DokgNVTYbVKPM8M20YH/KVy/slLgz9YOOtJtXcU=; b=U7iQNn8SryoWQON/K3QhlUswYPVj4fUE4JjJjx9cXnXu+/S1t1dKExyLliOpIMzvFi Os6w+opV6L3XDTSflvcxlb7XPqmeZxX5xegjGpF94NYI46tAEfq50kuO0T78+X2yxZk5 7sb9Lc+jEc7UwNLCs7pO8VnHy/UI/elodOgAKAafTFFCcRDuvplxN6u6k/fBKxCXA8Z0 oQaKcQqRiJBQ0KJtlQYa/mkO4FrZf5BaE8UNP3zxxPdA4UGU4N4RDmeHH6NCz0zLdSkr Mf7L7UIIXMBrFHcy+ywKNSi8UJJ6Yfpcez/q89c/W2TDctcuYx009NxzDAz2WIThsmzU DgXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692948; x=1712297748; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dl25DokgNVTYbVKPM8M20YH/KVy/slLgz9YOOtJtXcU=; b=r7mh1ZupLhEhVWibO9dR/R45fa8uSPh5UCHoNd0Kptc2uqEzpaYsl6NMXO9qeXEWEv jLyaHDiR27PNfYFXz7GAHefOlsDZkwdX/KE4dqutn//26lTAee9FtI1cE7ZfiKPfF0Tn OaTz1GZ9Pzlkb17aaijmWGrwLCzFcyRUZL2r9sD4h8yYY3cWB2gped8YpSQaiQ69fCFQ uZ0SQ6yvs7M0W4kNfEQd9y3OvMWpAvDG7sGACwtfAc9oc5ANxE7ykI/devu/697HLG98 t7NsCN4i+L1L51Wu2dX1wLqYq+Oci64Ovo5Ynu2BmOWZgU9z8STOe5Cx5ZQ2pSkZwJBA gudQ== X-Forwarded-Encrypted: i=1; AJvYcCUXax3tWwqM5N7iVyMhNQl9C7gjT5xDGXBg2tEhLbJgjMrXnfCbmmqlAao1R4tRyGqWJ9d6KAhDRlR7VgHncK7PwOcq+fdtortVCqSepg== X-Gm-Message-State: AOJu0Yw+EIHeyL+NK5IQuV5ShFZFd/0iXTduhiwZX2SBiNm4Y6kTqjkm fx+awgXeQojzXcy4+KR+n+YZ7YJyl7vqP+Eg76jsI/o7sxmnZ+HsTjpWQWSGgx8= X-Google-Smtp-Source: AGHT+IGhL1McFwjL5PEzzP3t8HVBwUYFSjxZG4tgE8H9ubN7PvPYahZXnCEbdZggroVmo+yA+xgOQg== X-Received: by 2002:a19:641c:0:b0:513:dbcd:7b8e with SMTP id y28-20020a19641c000000b00513dbcd7b8emr1584308lfb.24.1711692948717; Thu, 28 Mar 2024 23:15:48 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:48 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:41 +0200 Subject: [PATCH v2 09/11] usb: typec: ucsi_glink: enable the UCSI_DELAY_DEVICE_PDOS quirk Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-9-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1434; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=PIpCaKz646kYps9WO7oi+imJxxIB2fUbNCrT9mXhSWI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyMGvKaZxzfltl87OzQ0Ia7nmC/reuVwNOYk MQPWauJ+M6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjAAKCRCLPIo+Aiko 1Qp2B/9ts/dQ2RTSr+K2Hf1YAd8TtYXEsL9cZC4b/xta7NvE/N3yGQbFWh18E8UP/dF0MfeIeTB mdPSr1TRgtEF6T1U8Ga8fRjgRy8wILqxC8cvEpurB7Cc2/1fOxXCVfogRyu/Gq/kIN+OcfCSgEN fr8s1O3kl/E1u0XKfIrcKgCrSijq7jvACIcSazpO/mTjJ7qi1KCTSfxShm0C4ktOqoUWJReJjib Cr7UMleJ3ZM7vY0gXV1sBmz/E6B6i8G3+fWRcNvdvbbCxUtG+fO+h9VDsOMSoMvHCYmtkj8g0ET iu+XhV2o99TCIkKV+EM2dZdsMjErbs8KWJIP8jjVYdb9f/HP X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Enable the UCSI_DELAY_DEVICE_PDOS quirk on anything past sc8180x / sm8350. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_glink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index d7a18950faab..bd5ad1898a4a 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -298,13 +298,16 @@ static void pmic_glink_ucsi_destroy(void *data) } static unsigned long quirk_sc8180x = UCSI_NO_PARTNER_PDOS; +static unsigned long quirk_sc8280xp = UCSI_NO_PARTNER_PDOS | UCSI_DELAY_DEVICE_PDOS; +static unsigned long quirk_sm8450 = UCSI_DELAY_DEVICE_PDOS; static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { { .compatible = "qcom,qcm6490-pmic-glink", .data = &quirk_sc8180x, }, { .compatible = "qcom,sc8180x-pmic-glink", .data = &quirk_sc8180x, }, - { .compatible = "qcom,sc8280xp-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sc8280xp-pmic-glink", .data = &quirk_sc8280xp, }, { .compatible = "qcom,sm8350-pmic-glink", .data = &quirk_sc8180x, }, - { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sc8180x, }, + { .compatible = "qcom,sm8450-pmic-glink", .data = &quirk_sm8450, }, + { .compatible = "qcom,sm8550-pmic-glink", .data = &quirk_sc8280xp, }, {} }; From patchwork Fri Mar 29 06:15:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610159 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13BE437714 for ; Fri, 29 Mar 2024 06:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; cv=none; b=KFgK7byAC87XIGbJ0Y1E6mlXCtxleLkCUNEbg2dSfF6CYtnSlTv6s/4kV1vrzH57D+/Svr8irMLz/yR6qUZAIiXcpi9VUogfldtPaJmQBRxbW9d6Sb/HAGkzWJT64Pps6cRXhdp+Mwug0MUBLmoNm63eyHgKaiiqmgVudo7tQCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; c=relaxed/simple; bh=vcAN8k/qAhd5AWrkE59lTd3x26sbLY85MvdZDgX2n5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uYat85xaCK0doKNTpGfViYk8i+rQPi3WZsSAykJLWSuRPudMepPvxV5ujJJXrSGLUEFFMuQtZUzxCccYE3Ny0vvcZ5EKHGqIYtAdpRj1mpzoX1IR9eOC1gLOVMrMxTirJWnR2lmu3iUQXUEWypmghDissCyxqXxVL3dPXbWYf4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jXsr+PT6; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jXsr+PT6" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d485886545so27423471fa.2 for ; Thu, 28 Mar 2024 23:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692949; x=1712297749; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ic98WBfAimS8nmcOgz85H93UKGeZiY2SCA6nsjQm3Ik=; b=jXsr+PT6yJJwKjqzAVaPewFEHqMUloFH6kaUHfVYZU2SY8+/iXhTkmXtEj7eHXuKCl CtAuu10+cwXr12zpRNF1Nya6PUbU2NmW+lnEIfQRpvarpAHtgWxJQvJ8Y9MK1X+wPkC7 Un9R09gl8rk7m6hqmpntmWSwKfHEmKJkutj4CEkRM325Ticnabb0mAWW6o108nfKkf8u UarKhhaPWKMj/HUIWFA3x3xbpn2kQWGx5N7ow/2O76Ulguaz/3FbsXJF7NjpwRTH6uwX qNWhp28o0O2JKXQrGwm66KbMQ1GRI5hinH4x7nl+vcYSB4ofyQcjnqttbwUQUs+vTNQN VV7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692949; x=1712297749; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ic98WBfAimS8nmcOgz85H93UKGeZiY2SCA6nsjQm3Ik=; b=EqDJp5WE2r6kMWff1BNGRNtAlUC9SIvwHMhZsxZZpKEaVKCWbcbCycktCgMp0xPO8P FVK9iXEYNRAmQtHOrMJDhK9s0MZ7CsTwxRgowEB+517ApeNTOe7Bqa6ua7OTgnjW2HMA reoa5jxMtgBglu4/mB4WyZyx4DdQFLOPAOM/FceZCktDWCcZxKD/Uxp196h+cdhfMtCA RO9ezi2YVbe3lsJLagRYXlPmQshOjD6U6EaxZzBkdr2K8u0t64ocvi7bbcHm6QDOsO8k TGVYKrG0wqYAH98vm2gYW+25b0TwFnUEQEsJg176WPOAw0eXmKn0H/4sujJQhEfH3B1s aXzg== X-Forwarded-Encrypted: i=1; AJvYcCVR4rLtZEiyhB8xUA/viECYVtRQXAYCpiowFShhifnwCAImK3SP7Eel6UJvoBLRJ50Uf2DvxoQQ2DD+VukIqzZyU7Ffmpo4kkAwAdm8dQ== X-Gm-Message-State: AOJu0YxCz6TN3YXkxEmrgWF5CMvE4mak6ezi5TDm2R2+ejiT2HTNiIwY FabaAstDmkLJ9eZXpEIeJ2QcO3Tdu4rzNyA2jQtzywZh9CVsGmeuM77PKiRaGNs= X-Google-Smtp-Source: AGHT+IEFYkb4xSCTNgPAqVSPz+PbQkpovAkPslV+zAyYbPg+7kdK5UTIJTQpBnjSZ5o9T3cZPbmXhg== X-Received: by 2002:a2e:b904:0:b0:2d4:132b:9f21 with SMTP id b4-20020a2eb904000000b002d4132b9f21mr814571ljb.6.1711692949338; Thu, 28 Mar 2024 23:15:49 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:48 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:42 +0200 Subject: [PATCH v2 10/11] soc: qcom: pmic_glink: reenable UCSI on sc8280xp Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-10-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=949; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=vcAN8k/qAhd5AWrkE59lTd3x26sbLY85MvdZDgX2n5U=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyNiO9Qu1rh3SLEC8ik2TgVba7ZgDE8JXX5a Zu2Zy/bkPKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjQAKCRCLPIo+Aiko 1V4KCACTpq4/5OhmOM7xLV8GT0LEzymqnCMbTAga9RdLB71GxbIr9PnkzJnio8TdmXzk4rI4Ckd oOgkHcXSRxRhiQWMNqQDZVAKLDjiCt0chIB4r8X3NRKjhuSjwYa+WGqDENIDphakc+5eZ2X7iMC /LiiMVd7An0FJiI1sZgVgCqi9zGZSvzsWfdEQEOsi7bBWwuvHdF/D1SjHjhA3iuX6e6N8akNpPK t3L39Tu4HUxgTDxOxHBc1yD21aTzjJMQG7O/g21wUvL0PcVaWBmIWRrCc/TiLc9Boc3c5g8kOSr rcqjbNcc7sh+mvq9qS5AfReVKhM0+E249WTNd6Qenhn0D8tL X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Now as all UCSI issues have been fixed, reenable UCSI subdevice on the Qualcomm SC8280XP platform. Reviewed-by: Heikki Krogerus Signed-off-by: Dmitry Baryshkov --- drivers/soc/qcom/pmic_glink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index f913e9bd57ed..e5a591733a0f 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -343,7 +343,6 @@ static const unsigned long pmic_glink_sm8450_client_mask = BIT(PMIC_GLINK_CLIENT static const struct of_device_id pmic_glink_of_match[] = { { .compatible = "qcom,sc8180x-pmic-glink", .data = &pmic_glink_sc8180x_client_mask }, - { .compatible = "qcom,sc8280xp-pmic-glink", .data = &pmic_glink_sc8180x_client_mask }, { .compatible = "qcom,pmic-glink", .data = &pmic_glink_sm8450_client_mask }, {} }; From patchwork Fri Mar 29 06:15:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13610160 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 991D84E1DC for ; Fri, 29 Mar 2024 06:15:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; cv=none; b=RIWJNm3FK2t+9pC2QSKRgzlyjx+Koht2XoIULU3YWCPZkgukNa0Ye4vkoGsGRoFHmIzf0k2NSGK1MNY/co+LCFkwkuPX78KE+pPc38ip3G8PsiX01trHHdwBpycRFSV7b5AKcvA3p+X97OXKcVPW8XzEEhrjly1bfirKpHlZpqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692953; c=relaxed/simple; bh=FNeZFewSvhBuxQ3csqXQFOnbclapSSlOktRlQsrIAHc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y+6gVLzMiBlPFHJP3V2c12GkwVWxC1kRKwBlo24Ku+D0u6LfRR66U1swbOigoMvxry5ORwvpSpzWUoc/xywSnhCXpXjK3Mj184GSUBXp6EUsF2ldVrCgzQ6gWM/iZbd525qWlp7tTvJSmzab9GrkJtYPEZN56FKn/RkXABsOd44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xjzz6fHQ; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xjzz6fHQ" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d52e65d4a8so22887471fa.0 for ; Thu, 28 Mar 2024 23:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711692950; x=1712297750; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YEJihiEeWvLfK57ti4sg0AX62I32E+gTiiYv2sVj33U=; b=xjzz6fHQCuh/dAoUt+DbxL68pbi+rg6CErP/r0xPzEVdT9z5lmpxoVxqCt03nBK0cy CvjmP1rNQkrl1hVM+lZLg1aWoKrdImH+Xmtfl+j+NrPhJ2ssIkq/uYJ/leYGGjXWm70X VKutAwK21xyw/AbXq7sGpLB4mATEvwI8pj7C34yoUiYBVJMUV2p66WN13/h5QFczV/Az oMFFW/c0RMlPoKVcQLZcmlWD+nRbkWR4Nc0KdwzLnnHFniymVlAQv18o/gfM6fOvuOla X7ntd35FGpKH6VXxCRHKtFGNQeXi8xFK56tmjjyvpyCz755Z+3Twy9gjscS9JDhsI8ot TF0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711692950; x=1712297750; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YEJihiEeWvLfK57ti4sg0AX62I32E+gTiiYv2sVj33U=; b=LsIhc94kEIFly+zJ64j7vL/T00LeZWWs1SxmR72rLso2n1tN4ONldiTWPwNwqXNM91 tzViJOgulccqHTYReaUruSxPIr4zTIWOvQlpHZkx3VmSyjS0HwZNf3ODHmfhXwiHH5z2 4ZUgq96wVSD8ryGKtR7S4N0Vq4G1Tq5mi+3ftF9FW7joqE+VGvJCsu4+m4A3TLjmKl78 yHiT4p6bikXJLVzakGsggc1IiA6aizML9VNgDjVT7Uz344iq2E8TktSrlFtzyOFGhlhr OnRBtFPvFK3EZPS1w8DecSKSiu3PY4f+qSzZGKNWhKPFxlnT0RfMZjl0MRg8itx2SQ9/ b1HQ== X-Forwarded-Encrypted: i=1; AJvYcCUm8forsUHIHJvfMwVh3IF/7QmsG7S6t5gaHwdcj+cK3kRFa57v+8dXMqQOpavnAO215vHQBtJals10AdWFR2EX/4TW8ioWpDhbsMSxMg== X-Gm-Message-State: AOJu0YzpPGdiBwPo9WfOAyGq8mrOC0oahjIxrcgxNZV97sdDYAicPE+m pwBCLMx/8t/ukX6nma3Vpze5Xr5pOF6ggpMqtiwPPNtIUaorRs/9GJvwjR1qp2o= X-Google-Smtp-Source: AGHT+IGGHKJDbeJ+KDR74ze9xUn1QQ2t9J+gNQvHakqGHDuXL08XBt38JlXNIIW1R3H4pdpMsPIKYg== X-Received: by 2002:a2e:800a:0:b0:2d6:c0d5:b96e with SMTP id j10-20020a2e800a000000b002d6c0d5b96emr653911ljg.24.1711692949955; Thu, 28 Mar 2024 23:15:49 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a05651c0a1100b002d6cdee339csm494539ljq.103.2024.03.28.23.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 23:15:49 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 29 Mar 2024 08:15:43 +0200 Subject: [PATCH v2 11/11] soc: qcom: pmic_glink: enable UCSI on sc8180x Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240329-qcom-ucsi-fixes-v2-11-0f5d37ed04db@linaro.org> References: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> In-Reply-To: <20240329-qcom-ucsi-fixes-v2-0-0f5d37ed04db@linaro.org> To: Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck , Bjorn Andersson , Neil Armstrong , Konrad Dybcio Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1138; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=FNeZFewSvhBuxQ3csqXQFOnbclapSSlOktRlQsrIAHc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmBlyNmGIBuVhU4gfN28LpZjdh7YgctgnqxE1E0 KsohJsxZoKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgZcjQAKCRCLPIo+Aiko 1SOwCACbroRYofwqqtJBc4WH7gWH+m6z605qzhkOa3DeXh9HM2Y7QoayQt36RhIldcY9tA+yjYW ZyYh4rtfY6YqQzm1G8Wcyo8SMOIwNs0uUTxM0Npyrvyi9+omUIWt/K8Lt4lYvwzVVQpix7u8VfT tcwhZxzRJ5Ez6ITnLte5q1ADP7F2rwmzD1CxKa5HrNklEUsHa8E3iTBAqsgG2mpJTy7OFQLvbR6 hMSb2WpbFeWWJqGrAkyKp8fjEE6suhFaurGdtWNm1bOLcs25NA07dopiX6mGXRcECzf/v1O/MVp lS9ErAZLf3lDayifUsYiE/CJ+su1Nop6pNqgv2WHwf2c1uBR X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Now as all UCSI issues have been fixed, enable UCSI subdevice on the Qualcomm SC8180X platform. Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus --- drivers/soc/qcom/pmic_glink.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index e5a591733a0f..c2f71d393bbb 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -334,15 +334,11 @@ static void pmic_glink_remove(struct platform_device *pdev) mutex_unlock(&__pmic_glink_lock); } -static const unsigned long pmic_glink_sc8180x_client_mask = BIT(PMIC_GLINK_CLIENT_BATT) | - BIT(PMIC_GLINK_CLIENT_ALTMODE); - static const unsigned long pmic_glink_sm8450_client_mask = BIT(PMIC_GLINK_CLIENT_BATT) | BIT(PMIC_GLINK_CLIENT_ALTMODE) | BIT(PMIC_GLINK_CLIENT_UCSI); static const struct of_device_id pmic_glink_of_match[] = { - { .compatible = "qcom,sc8180x-pmic-glink", .data = &pmic_glink_sc8180x_client_mask }, { .compatible = "qcom,pmic-glink", .data = &pmic_glink_sm8450_client_mask }, {} };