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: 13610163 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 C9E7C3FB3C for ; Fri, 29 Mar 2024 06:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692946; cv=none; b=VznnV+4zCvj+ga4lniXyatPORQZ7oB8OIWGh9XASPVOHaJtK7bxB/vBzIgbgDpAUdNEQOFqrr/M4m4qELmvQkKYvtr88pYwbNK533lGSISfytiDvWoRX9lwl5fkG4ia0n0not5VcifSNLSHtrhtHT2eU7o4agkitz1BfxgbllNg= 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.182 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-f182.google.com with SMTP id 38308e7fff4ca-2d68c6a4630so17920401fa.3 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=jin+QUgkl4lbfyCi+ZK7eBQP8fuN4Zf1f4JwxZgEEeylzCJgWgdAKdiIAEqkHjjgN1 oCaum+6Edl0rLt97F5MHtnrzbiAjWQ52SbcFrl0wvM3DwFO/WfYLQK4OBNwpvwmx169y iSLqnA8j+cKUkePd3/Sbvfxef52hhvsaOjycIGB8mzSy7a0tB07onKBsXtbGT6dCC/1t uvP/l59K3RyMs3IlQHqilj/zmRfGvgeGgMcEvHBnd0yhOZ31j3oHoJGCUs2vltW5Fyhq fXTLfpwUdZJuELkWCRmotaMhYLpKre5edys/w8dVmCpHC+2lgYxtnjK/MnlEOoy/c1UN 2S8A== X-Forwarded-Encrypted: i=1; AJvYcCUzzLq1GGjuoXrTxNSNidGb52zx7Ik9pSoTbZKMRVKR0IXjzXryD07lTxCJ4kacsEZJ7w+4xgRi8I17vvY3rnluQySprWVIFvPf X-Gm-Message-State: AOJu0YwpZZnW6C5iEtDngE01EM2uXqbK5I0U5IIzhgBLW05eFyQmiidY qHv8O/HhD2tlw30BmX3DOEHRExBL/6S79g3GhhgVnMcHClNaoD1XbChf9kj+94g= 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-usb@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: 13610165 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 CD8E844C71 for ; Fri, 29 Mar 2024 06:15:45 +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=1711692948; cv=none; b=EhfjbeId6WPWPq6R+h2y0gfHTraggfphj4iLGh4EjFS07OHf/hoIzf9pJ+XD7KQpNcG75gH3zvpDLlI6EWLpKb1iVL2hpSsUPc7ItcFI2hRbNl3SJW0a67hmLPlJ9UHFAWUq0EYN0oLudDbJf91D77gOv3pF4kcbR8uaIJ2DdRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692948; c=relaxed/simple; bh=1YXtXW57tTxFBEzDGmlGAr9GqbQ7HEPJ3F4/AfgmRvI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=piWBsyfXfQGdnzpCAFElim1vZTcg5QWWTcjwPGd9KZZkS/sSbHvIVSNk3kpvQ63+Z3RgOTFWbca9Qwa4G7DJaMb6YlIPupbb9wROwnplQHH/cfsoUAPP7vjOrnu7SR25MDifbJluJWueMTmzCCzalCh9eVqg7KSj4OB6RSJgR+Q= 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.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="RF5D6jNJ" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d4360ab3daso20581401fa.3 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=DpmJL1Q669vSCCRNMsmZZdvwTRpg3/I5r5WZhPHj8OQD2lt+TSfVqtZ6JRG6gVPvQq WJ3DwyvJFjHmuD+gv8DnQmR9tzqwcLGFts3aUjX0QFwr6bqMkFNY+rGiROHcIT2lueew oJUzFlq163FqLvh647ujEumM8R3j1rSA0uFrIbjE24vzXOnwUeKiahpH4iHG2Ka/0//e +VgN/7HG/NlWk5zK0bRd3cBtMnDGkU3kJcCiGLmFeSK8HuT3DAOiqoe0uvr50ahs8Krz cHcmq1J9/eL0jjQfp0bvtmTIRAyG/UVz1OXw0WvjS32glUlwJqhYaAY0bZqhWluU56rO sTbw== X-Forwarded-Encrypted: i=1; AJvYcCWtfE3/rxoekA7pSl8vi5qtBAciad112EMXTmZBO+V8Uf3d1OpbmvtY8nXWpGKJgrJvPYpPUUTX/IST4TMh3MLruYUE45NZBqG2 X-Gm-Message-State: AOJu0YyQpsjxrCl2duH4bGteUslnGsR3ZSNv1Ix3tHEfVlBH9NmY/+Ni CfwSAmYDQTd6WYjf86RJnJw0HoRAVTT/EKaP/tGtGMrYQjAWdWqh3Xi2CdvHeeo= 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-usb@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: 13610164 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 6D2EB44C9D for ; Fri, 29 Mar 2024 06:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692948; cv=none; b=oZqJrqvnuKA8XDMeNN07yzFOuv1TpwmImPcLVTqDUKO+MpeIwki4ZM6e7Ki6GXiFfO6XYOum4VVS3+aSfhxik+iNYMWkRi8v7jOV7FK3KwhbUBJ3EiE84AwiAB93d3oM/KXbrD1tPamBkjWioshdRlfY5S6uNGZV0rPp7jG1220= 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.180 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-f180.google.com with SMTP id 38308e7fff4ca-2d109e82bd0so21520881fa.3 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=gXTo/IulRcIDLlLhSTcscQJchzifPSVW/qbxELJFq4AgQVGvcEy1qlMfR3k95EzOvl 3Tg6kskzWy+v1jVwj3FYcTK6aqva7d7B8k34sw58rPYivHJgikWfOkUhdDokN2yGZbYa bIzTmhMlgvvwkF5nHUPjKka3IMvWYG7cMuaZzZ6eSUCcKjEDgU7W5NJtqSd0X2Dn5pg1 OV/FHUhl1+eL00B47ZiSeMwK9XJb9zZMixiU1dvJVhdwXFpHR2RHerBoLRMTQ3tNBget jLsjOU4oH0uhs/kDCuUncN2zzPZuccK9ReEw7YmW/RlvKh7h1GqIWPGU4CYBKujSSa3z X/JA== X-Forwarded-Encrypted: i=1; AJvYcCU+K1StZG855fw8KCVqAVspI97WGR/HbAIcoiO2jBIOIXh3MEVwI0sd2AuaVSIzdZ/SVJyW0KuzlTkmozElgCeqYcqWOEkioqBu X-Gm-Message-State: AOJu0YwPPsYfmsZK5hE18d32g4MjWmPeZnUQqFzTuK+GYNtQt237rUIj PPBXWUXFnWa4W4fr4eMi6imk6MO3i7zzrcVm26rU+wVPYfveFvVfPTPvwp2x2Ys= 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-usb@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: 13610166 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 5026647F48 for ; Fri, 29 Mar 2024 06:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692949; cv=none; b=QTMTnHTjr3iCbuDPJ+zhJl9wilAY3qbycDHKq1vOvUv5XE8pzqRNWOJxnkPY8ED3hnW7S+P6q2m+hEp6Whu6h9/iohoCvsoPiQ5InpsJ1+Hx/ZVvXaM32MV4s7zQOZuYwFSwCZEzgpx3WklK4KqMODOKpqlkPQlc9eWgG1ue3Pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692949; c=relaxed/simple; bh=kmMve1a3CmfaOFv3SDIzmvJNqeQvsNyV9CV0U+g19u8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bwDC93bMFhLWeqVyBDFws7wzGBzfUgAP0S3V2ErD2hZn4xsRd3Nbl9kXIRa0Wxpi9bBpVb2BaGbKiMfdfEzw1WXd6WzczC5bRjWMYRl8KH0wcm0LORwbIRrNllsozclgeHFEuBxD35FpjGaz/5HMxgrUziUHzF10WZlzgbFRBcA= 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.41 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-f41.google.com with SMTP id 2adb3069b0e04-515b43b39fdso1486456e87.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=GL6FyvMrWsl7NauJceZcIF9yQ7q5RrAzwHsPqUFq4HzrnvOY6O3EEulzQEPl5VmKBw VoNUNMDkbM6FcWQGCFVSS2cFXLY14mp/IK/Tr9aCGhGO3Sdj9Kba6VtfQnPCOPYtnopn bvsqYjka3qNV63OznAf0WAG6yjQ5VHTtJmjaWW3XdWhWlmusNYnetPQIZk/nZouMLI0B OngVTNml14rGSsjmHhHAD1cqF06b54YyKa9CP98PPB0R9lej+Xl3TFD8l3NRKpOF+2hQ dyltoCu8fsXzqmH2dfczvDifvGldi5YLj8zhCd3sBTsirdl2AFjV/o4Q/bxryscFnLji 8vrw== X-Forwarded-Encrypted: i=1; AJvYcCWo/r180wLuXhR7ZkTPLKtAkikJZEkwa8i70ICeiTpVnEZc5WLPiBwgpZnL7d0Wqiz3aIq2b+KESyClHjzUqAfzx/uXyhC/0PYH X-Gm-Message-State: AOJu0YzmzNr9WG30Xlgdm53wINYsrhtfrXoDiJVe8YwLv2v9L9E73nzu padV0Hr+2o1n9dou81CAHCH2SDwd/H2OOF5SpNb50+LTSI3RqPP77Anjfs8TVmEHzd+A/yzHIex C 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-usb@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: 13610167 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 094B3481A7 for ; Fri, 29 Mar 2024 06:15:47 +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=1711692950; cv=none; b=nXe73010FbwyN2t8LPbyZcUBmfaZlim/dw2XckC2BwiT3PDmpIJ/GXYsROKvIrhwOZjB0iE50hOXTXNRqmaE/8TfDa0UC+A4GGuINBDn+o9Qmb36oC5+yoDYe+hwSZaOx+DJKxVIA/8pO3S1QETEJbnZSTVeonT0aRYbP2kEAM4= 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.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="XSjPZg3x" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d23114b19dso23042411fa.3 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=U2jrGlnVNofwg3lMlw5ThG/wPjw0MygONW7qOWhpc4QJlTT069RjWeiYTry+0shtsd zpOXO5u5GCoPoWfJqBfefNdc6xnd492nNf8bZb9oNqWydzwwm97il/rD9+h74H//EGWW rEXA4gsbVv4BaDJ0md9TuQHRd9+r/wtZH+56s63OYYO+yOy1BY6pjaJg2zg9TmNjfCVB XSkegR9t2IiH4ANRJbpCQPgVfxNzv0wHwYHm+a08MXlQg7KSMQa5985xx6S+C+iuGovw lkzsi+N5Z2UAiSMDp8oMyZ1YhsXKQL61UtILCDzXD+mrNEArN/lwxk6ikRxI+/ikbyfX H+yQ== X-Forwarded-Encrypted: i=1; AJvYcCVJj9nT5ovgKPVNWGd5VeG7AA0asXUwC0QOxil+BNe2/yMb2W4xegKK3EO02q5+gsizp+MCs9sj4Q3hpP76qL0ua1M6UC1CUxF+ X-Gm-Message-State: AOJu0YxqwPnjinVjgp/0vltn7sVpl2Gqsg7nCbLpP4ILzm9mp1Y5T1xI /CLa5P0kZ7e/VQI5q4EvlUTkslwjCoY+u6pCOnUGoHQ6/NS2BDgiTkhbaTZlwGQ= 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-usb@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: 13610168 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 80E1944C7A for ; Fri, 29 Mar 2024 06:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; cv=none; b=r1qKIPCJCwt2SzuQxjgA8g9DPpkJJ+RH0+e57YEir7XmaIwFxxeHzuLH7t7Lavp93bnITbh7mxe6kUH5c3YpkO00xucz19wfwf347qPbWMhEW0KUAeZGFE6FFx7Oe7jVeiloIByqVSTuYs99FjJN5Q3cKfAKLHnbxz3hIcwh4t4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692950; c=relaxed/simple; bh=12roAABSvS8s66vFOhz0Ej3vS+YDb5JJUkjxncPVUtk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LXjZd7g3BhkaRDwzmD4BDyN8yWA6xDZnb0y/SAJFw8pOyyyHiPPshPt7EAntmoxb7V/n308PPAb+zIQJwgyWIN6Yk+9GcJCgyEoilc8Res769UWiX9YY06qL0NOPPdXBC8JnTgVeH8S6Gve8PErHZdzaRgV6SrpEg2vW7bvsfow= 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.182 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-f182.google.com with SMTP id 38308e7fff4ca-2d68c6a4630so17920761fa.3 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=rN5z/W3thc0n2Kk+flWXHbiL7M+hdQwFI6IRxE16ZmQIqs4DTTP53dHbhgLbvyOCu+ tcW6AS2OuYjKrZxn+ti7CTVJyz+OJsHtevT7EsTJ9D5WbbfWtaYq5m/gjLbel/0dn0Sz r6k0jhphmfFjfrKpaNa5xuyGPBE1dflHo1mV3rc0ux3LGiRDLfa3/oe/vupxYBmtpA7W zAF6ng1yM5dIk2rI20GdBIJIz8rddVIf2h8rf4H46gIHszb7ItiHcmUbXbY07FJ8VDPf llgbzRd1YQB5sv745EwPZyP+iHOPb2Tifiy1iWwnHRCldQND58zML9NGWkDb8Zxv2sk2 h5UA== X-Forwarded-Encrypted: i=1; AJvYcCWtQ+9035nrBFSOlh78ZN0tYtO/jjobfmarTz5BUiqW2Tl2g3F1pKFVKF/c+JIpTL/Rqf1HwAPG3Y3j19D358A6YZgqaOLVdKQC X-Gm-Message-State: AOJu0Yz98sR634y4uVe+XfUKT9AteWupfKgo5H0bPJVcDnEKMIchvfUQ e2CesR8+9Rp8q5IgDGRLmcWMOr+Y/VAWaM9VfV4Pff1Wf7yO/FFHPILOyAu/1Tw= 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-usb@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: 13610169 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 0A218482E5 for ; Fri, 29 Mar 2024 06:15:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692951; cv=none; b=CdfY9OKjwhbHn5Q9kfc9AMt43s6hIF4iuuCKOHtaWJ4vODFmdB4QvpwpFTZxHSlD4lXqTzJP0SPurljjUFqCAANY7WbLiRT5LWPhU56RkAiSK2Kjc/rMwNWSYncIfYOtquUwwbvlhMUmoHJq9tmIr1G/weLj9G/ozKPERxrjo5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692951; c=relaxed/simple; bh=YD/wggfHpA60Ni/iCzWPJjqKvxw25S4GmQbPPpQ7gio=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X37DJeLVPawty9jBrvpDxqHLMwbzXd7EOl8JsT9CgcOEH4eQvpapzHk4EIGG1v7OeZUaqCJv/ItxLkRVUS/icwOmnPl7gYHsf9agCuedar2MlryjZVdKFxx0bVkjIV8m7H7w5TDFaYL8XUAFZwg/tgyzj7i4XxW05bIY9a66jKE= 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.167.48 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-lf1-f48.google.com with SMTP id 2adb3069b0e04-515a81928a1so2654072e87.3 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=u5uu85hlhd7ZEqtB69yrxihYZIXkKtETsAMfIXny02ZycJYHbSP/1t/T2JPd580xhf XpXf98vcHBsqgMFSnIl3l4aspg475nsHUa2NPKFz4x9GcLjD1RCThRQ6FLq0qOwbuRtE O1plvdx/bL10n7eDlPAXxrW6Z3YwZu1WiQt3SRBNql4UnrkKDymZPRh1fw2JKlif+ZML Q1/UfKa081jegsT4ZTpN6yx5CfgZhZTveBeY+wq7Foxi49ThaPe0t8JOAaU3nU3V1ke/ MhaZmqLyERY0wJ0oU6aD2ST83p4qTMMyUi5ZSwPQpgD5HdnOoAvmIBOmLkiZFN4Z/H2C EkVA== X-Forwarded-Encrypted: i=1; AJvYcCUWhL59zYXqv3/dAIwc9jUOZOGuz0WfhtuR/b8E4u1Iwaa6gwnj3bS1anFF2y5nXJoJUrVd2oEA4h1x9cWGxxijIkoNE0/dPxsO X-Gm-Message-State: AOJu0Yzd1U1wFVYgC5xkKfqP90Bdkk3m8f6BL5yX4F2oPOaTUb2q3C0B RXcVt3iNQ+vubzEC8jiZfdIY7SB3tgx3DeW5EeAgC79rQdLIBqUy3LsDUvMDnSg= 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-usb@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: 13610170 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 BE3E14A9B0 for ; Fri, 29 Mar 2024 06:15:49 +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=1711692951; cv=none; b=f66x+DT8gDso18HDCRwuZ4LrjQ0GisE96ukUzUSflF8Bg4/Un1H+wW76eECOKNpytEk+cbBu5BmJ3ODwY9EE/ixlPDuHa/vFXTvN4f2cv/YyJzvE3po9s+eUqpWD1nLUkNeLuYh+AXXWmXtDM4M4lskONRtAfsIqz6x1qmgg79c= 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.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="dZDaci52" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d68651e253so24747631fa.0 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=Ot7Sc7Y9vw1764sObS7omyIx6S8xBcnUSzQOhCPldP02CrER6kpKsKqpK3fSw+Hork K+c3pGin0k/HrBB6LRBafxzoat54mbNZS4Pwy8BUzpPhj2GdWUAPNqKhbfTiVGLr+/hT cBNeWnbDjr80fEWIdA6ZLbYD+5KQvbjVfDqIEcwwm1CrtOUNRjAyruwlHQ2wHUjYYPa4 cB/WQZxpuAdHtsWixmGizhd7pwS4VjKIgjex0bZLUE9BazQxr9ukIxLvR0hIjoayI5Kv e1L2tP56H+tNQuvc3UgHihNSROYs9NYVqzwio47gpkNrLqe8KpCHhK8w3PM8QWtj2RYE Cv9g== X-Forwarded-Encrypted: i=1; AJvYcCWaQFfd638QJkm3CPv3+J1ESaYHFoulaEwHVhT+H1zU2senmhJdvXoQw2R/7pg2nCOA9wXD+VrB5W1T1zCUCsGxBSbS2wKg8ayX X-Gm-Message-State: AOJu0YxWkOGYJTf8RC6fVV3aFNSgPQzjsHzHrISP844YGnXQPf2nwXCW HF6aiA1u1BSRTLa85WgkDfH6pFrXcHtxzNGVOj06Cf2iJp80skwdzmNXdsmd37Y= 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-usb@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: 13610171 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 868784B5DA for ; Fri, 29 Mar 2024 06:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692952; cv=none; b=Linvq+BNt5j6vTrqgdkiHi/i0ERrfZWqhPk3JGje3B+/z2oxrovw6oZlgzSwhXTJoWbz1TkES3lR7Sm/2qajOjrIPKk8AcanA+H2F2MBe/szZH7hctX53m35eWfzo0iY5XhypC80hssXuwIp9cT3WsjDAjqF/ED3m60lMKxuQZU= 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.43 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-f43.google.com with SMTP id 2adb3069b0e04-513d247e3c4so1653218e87.0 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=YA7IADoesz1qEI7StaCCpj6PYPxlmZxD4sbx0C8kykUneXc+VGwtPJsJ+3N8iEYDG9 /WNibC+kHOm11iGIAMuY9UjV/0blLZXZuYyoCD63fKf569iu/buoMsgx9TzeBmc+fST0 tfE9VC01ccNvZsQZFvo1aR3ooDyrsp4Bta/mhBWuldlKBPcqADRYn8Cc7MDpzJGSkZ99 uL4I3A5lhPoTjcerjjOKfENkUvVRuQoMI/wmWv6GMiSPznrb6DYMhRULWlc7KjM5Zokx ZqV99XtFsNY0szd4k9QtNCT/uUeWpo1+najUZHymE5/LOivtqZTlw+j+Ynmr1ghWbvzG S7iQ== X-Forwarded-Encrypted: i=1; AJvYcCWh2eMiI2De8Wpm6HZtpSTjZ4td5jOsYXF6TxIMy4V4H6cl2WKLLZiBDYM+OICaC6xKEXMrIaA7eBLlEovX3xfJ5P2tRo/eRnya X-Gm-Message-State: AOJu0Yy14Wlx9pX22ezR3BlRjUNA7EOIq+hQdz/8GFUXy/fYeCvfHfnk nyU65m9ibk+hZu3gMa764R9nFnS8DNrAxjFrFaKTE36pnJ+WhDBFz/4zIPt1w8c= 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-usb@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: 13610173 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 13C1E481C4 for ; Fri, 29 Mar 2024 06:15:50 +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=1711692954; cv=none; b=MvnEeW+B5FiKZgAS+m8kRcsot19vl/h/DgeRPZUsYKD4NNEizSuxmtA0lcSyrUABLa/yvX3jWRdHA85Yvh6WbniafjFzzkukFy/Hy5x0EuaD37BXsgunLb4NIe+CkAZDktrvYcI6v5L7AnnMbUsCHqojYiWSlQgE4ASWPh6xRHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711692954; c=relaxed/simple; bh=vcAN8k/qAhd5AWrkE59lTd3x26sbLY85MvdZDgX2n5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PDa76nGdkVCoYzL/wLMugaBGiAGwY5SHQwBKDi8GVPu0EkZ5NyGe9L7USoe+ikhIfGdeni9luDbwkgzAsKAcSu+yLCaaUjoO1MTPwT8Qv1UyOitXVwJdg/eAb1RNU/x2Em2JRzuPncRJJdMETwLT6WwAD1MZsGCw9OVMjYfjqUc= 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.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="jXsr+PT6" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d718efedb2so2723441fa.0 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=cPSyxwZ0mWKAeGw0HLiEAEksD9iUlo6xFVCUKlCvcq9bVvRAxEqXsS75V7U+sphlJB DHl3WW89Y2cegxbHVnrsyEDurBAd6Hn2xTcu/MtoFVYDLprw9CKeu3FUnD6K6u5ljWYx Ak4e+4h1bI1s66uCCfcN2dAyCCTdDhNsugeGOZAJg8NH18UqnflD7nNcIEFOaKYGcXz6 eH73M9qnQgrDsFzCBcWWU+TyeifvQr6OwLZR1S0cYpSi5pUOH2EBG/KalzfrxalqhSXf yCQX90f33BkXV8ZEd/9xwJILXV0LS4HGn/PD+nAxy3k0P2YJQiZJxqwMbtNML8RmWyCC Xs2Q== X-Forwarded-Encrypted: i=1; AJvYcCWkwrve2Zqx/ibrlJ1VBMyFC4YE+LRfojJ1L4xtfo299OsS9bBp1Cjw1C/6Wnyw10NEKrnlc2+eZSLlZR4kAZCfZ3fsxgemfcc6 X-Gm-Message-State: AOJu0YwI5+cQUVxBVzq3VAitLpN/se73mjyDE1rOryNByDwV7JTi2HaF 7DPJTd/FnLf6nKGUJ6rB9+qrRw31+a8kkaXaV0ofal5YJmTxLJnaCvEnQNB71DE= 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-usb@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: 13610172 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 B4DF94F1FE for ; Fri, 29 Mar 2024 06:15:51 +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=1711692953; cv=none; b=gFzxsVOCs3BGIXNNzti1TfUqzEk/8ecYXbChOboinfPjY/sxrV7vb4a+PGi0W5l6udwJrfvJfPYuv1SgUuSGzMoyvsXknJLBJU8pPp5YfDTfUh9+iOguqB2pPtjhhohUOi/VcU5BexCcCNOHlqODJQaiLUatEKmPFWtUEoztr0s= 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.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="xjzz6fHQ" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d094bc2244so18335671fa.1 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=YJ/fPMZKACaaNnq1eQ1sQ5k8c9RXZ4cPDv3qjikZ1aVMmbfUdp+SC626x536XTOpwX i0qxhbjMxA9u3LWy0MOEL3RLiq2yegci7zNxI9HDQkSf0kzYlpfyVY+aOGsutxQnKYyD 4SDt4Re8ZfLIaEDuwMC7qMTUSpJv2QdH61Jrnv6JQ3BJjyxha+GBbx5+L9BV3pB9M8ON faqtzGBdhK3gz4zC48h8DTXIHIbg7Wj5yaNadLAFA/Gt/ulu4ssDiMtpUft7lmpAc0Wm nYgfoJvmFsQNtwDHrFgUOkq143moFlUXyLJPeCfUNdBeRj/IntRarYYHV491gGXaw5T+ mClg== X-Forwarded-Encrypted: i=1; AJvYcCXi2wTZjXODecKwLCwVr4lVoWcECLRj0YkhKqCk4jBkioOowizy+ND8TEJ02hTcHiXL2Hcpk7pVS8I6oZELSIHgUX8YrqZ4GPju X-Gm-Message-State: AOJu0YxwfB4HE0Z/+m0dQnSpFGPAa+ntKJMjSeMtRm7L6wHlDhsKO2gk uJfghbIPaQXmqiRpAPukJVjUHOg8yLEarCeIXnoGsYeSpdHB8EXaTJwOgTqFiYk= 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-usb@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 }, {} };