Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp243214lqr; Wed, 5 Jun 2024 05:02:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3yKfQ47+lXv59Tn8U2cJXyx4ufWfVp2DBKlbNSXDm1ZxuVTnbCqBRifu8afksPm4xRv+F4iLkHG68do6W7BHCVSuTl2KJRKErxFrIGg== X-Google-Smtp-Source: AGHT+IGnMP7RhSnOSAslOvSQLEx8ozS39yW2s8rP34Tv7XrxOxQBzeF1CDRWl6cKE89Wnnm26Y/P X-Received: by 2002:a05:6a20:3d87:b0:1af:6fe9:5039 with SMTP id adf61e73a8af0-1b2b73ade2fmr2805985637.1.1717588973585; Wed, 05 Jun 2024 05:02:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717588973; cv=pass; d=google.com; s=arc-20160816; b=sSCIRlX+wGmM5mn/CPKyjCIc+HlDLLMpTSfnXgQzIh1PrZ0r/jSNwVBjmt0LoeiClU tEde+VzFQR3LXzxez9sf4Pyz9BqPCPm82ZF7SwPXFY3TrLV8VCwKDNcNL3ct/JnV7+wc /A1iuPiKCxe0PSs5RxWVToFkYi7wGTUjuhvaSlfn/2Ll/jgmrEysWz1wv0TeY1Fj+bKO 4q2My2mZBmusVkdJn1tKHg5RD3dwcXf0Kb+paFMx0gvhAEZP+cB7A0MlGzkrJNFYy6/D oLnqmExQ+dLMTH590mEODB8c3xNQWNKPKvWz1ZsSR5ZB8RDYMpgYFQISz9yVvLsv/0cM M04Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M3KHkOiRo15rPo/com6ahkDkzj/9OqGtBfPrYhCo9Lo=; fh=YsaaQG0UwYizZFgPP4yOhk/y5Ycem/GTeyI4CquDrxA=; b=sCztoyoilIK3KvBJ1vjOROyN+4ztX0XRfnMPzzBmGptJeu/a5KzcyZlL6udEMsQuyE 8cV/DyqLno+tgK4XJyYCQEhpa4WkpndYecusDWJYjRgafkiTCrnnUwzx///hnjemC5+N nJ6bu7RfYyHoJPsuN+ks9E2e8AM0aRzTy1uVJRiVtudwY68ta/LqKdd+a2MPbLmtFdnz /e+rKYvHVcVupF8xm/YdQwZrNjxoP0BcnwZCx+xod/VXTBdRuCdo4kzLzVrkR+rwvAAB GIIY9ZWoYppLkKRKJmkFyJM2LnhI/aW0hD9m6h07XAy5B26tmLh7MkgP061knufsc9bY 6ElQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKiItUdE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202334-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b40c879si238473a12.556.2024.06.05.05.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202334-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKiItUdE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202334-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3983C28B482 for ; Wed, 5 Jun 2024 11:58:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33EB819E7C3; Wed, 5 Jun 2024 11:51:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LKiItUdE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56AF2191462; Wed, 5 Jun 2024 11:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588268; cv=none; b=iFcflL+7tT7UfYeenxh2NXrh7X0i92Jr7FFA182Q2ywFfTxmzgVHvmpVPb9sQJjVlHVLKcyo8fyjXi1IRcSPN0mF+F+tIwL1g6hc6corzeR7tRfCEr9Mu1xJAm+WGrZLAsrwx3WUDzxW3t0zNO7lq5mnVayz/IOlYN2hzGgrRgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588268; c=relaxed/simple; bh=dfOEL015ORH+6IM7K8biVLVLo1OBKrxckpzA/YbrmQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S3gMpHM5nFrpbXsD4yM/NwPDSGKjiGAQ3MD2qHL6icqJfMjWqI1YKtXLfBLwmuoETRIky+ZcJaTO6qsiLnHTvfFSi6pfRYcqxB5a8Y9BCqXbyPv24UoX+w4w7oZUuRKvOP1WG+bJhK4Rkn8SWDSP88AtQsn/rl/ATQrGJggMh8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LKiItUdE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D65C32781; Wed, 5 Jun 2024 11:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588268; bh=dfOEL015ORH+6IM7K8biVLVLo1OBKrxckpzA/YbrmQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKiItUdEAY7h1eEgnv0ws+LqzhqqHteYN3YUj/OsFX9x8dTRGU/rF//GH97CoaaJG 2Rlf1CVC4hniTHJvhV53L+tjmy1szc1ftuDxwJ0CsTX714N/ba3r4G0A3CIBhgimTK oCBfZHBK2t5NJ8aoX1LHCnCm3QADiaBECb4UA2EuhqwhNo2WoJSV6h8ojDn2fewKQm tglrGedy9I7NC7Ju1JHGDLteRmRf9lbLXWOb8wWd9RCRqwRUCey9osDsGbYDCMPe7d H6g1nKhpRlFaRhcZ/SqRZJA0TmIvuTgGtUwB3RZLjMjS0Sc+nAIXJcdqQFeIa7/+qT J1optcrq4I6Wg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Baryshkov , Heikki Krogerus , Greg Kroah-Hartman , Sasha Levin , neil.armstrong@linaro.org, johan+linaro@kernel.org, robh@kernel.org, quic_kriskura@quicinc.com, linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 03/24] usb: typec: ucsi_glink: rework quirks implementation Date: Wed, 5 Jun 2024 07:50:13 -0400 Message-ID: <20240605115101.2962372-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115101.2962372-1-sashal@kernel.org> References: <20240605115101.2962372-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.12 Content-Transfer-Encoding: 8bit From: Dmitry Baryshkov [ Upstream commit 3f81cf54c1889eeecbb8d9188f5f2f597622170e ] 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 Link: https://lore.kernel.org/r/20240329-qcom-ucsi-fixes-v2-8-0f5d37ed04db@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 ce08eb33e5bec..0e6f837f6c31b 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -311,12 +311,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, }, {} }; @@ -354,7 +356,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); -- 2.43.0