From patchwork Fri Sep 29 14:30:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdel Alkuor X-Patchwork-Id: 146856 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp161203vqb; Fri, 29 Sep 2023 19:42:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGboGQW32wDbxo6BarJgkcm/EC7zsg5m3gjAsERUd2oQAKL4k7I0lyqw1r2DGjmH40oydCY X-Received: by 2002:a17:90a:4ece:b0:25b:c454:a366 with SMTP id v14-20020a17090a4ece00b0025bc454a366mr5799693pjl.5.1696041776503; Fri, 29 Sep 2023 19:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696041776; cv=none; d=google.com; s=arc-20160816; b=iRyY9oaLkdeJa9LRmP66bG1QKmD0AnBpFtOo41mHDLyjhA1FAeSSp3Og1flcRCW0oD Mh4jFqSJxh1pqL40+kWYgrQNZiWUmaV6+bdie5ACpTNJzHkmg17gecju8TfLFvphIv9h w93SE0n0WQF+I4H3RnlT3S61XpmA/ti0BpJySw2t3QzvgprFBOnzOPsseV8d59w7dlCU osFoNRkFjKXWlcOFY1X94pDlmFgoozfv0UYZASvnUpDXDYlEPAbMQy+uLsAzMOUaPWoB 38vvUXZidiBMrYatC/vfsarWgteqF/od29pAWrtdHluj854T6HEM8qwFF8ut0L/8BnOi sCgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=En/oFUq/81cLOHvLKqdr065XPAN22won0/p2LOHNjFo=; fh=NDkcCmflgZsGSiSjskszThji4SYIrQ1hJIxt3Zy9sPE=; b=L9iZgMaO9MhzscEJ8xdCKDeb+iB+nFTMXR59effjsJBiHeRA62Myyc6vh18exzg138 OuWk2cmKj0UqJCrOlS0/JbwgW5JEAkI59HFSQ0ZfCxLhIr415vHTbI/VpYbOpuKet9XI 1Q4oefNnofDPJZXid3doui9bvmsaHRz8G57kPYaTNPVfb3xmvaua/HVnk9L1jgTT4wxT axPASK13FcNxttouHNNnv/nttn/VhA3NJtGjTRrbvdKFP7OgCuQ/yYu1GJtsH59EjP96 56oRQbzwe9DW++wKBr6uWDLZx3ghHFg+P0JvN7/98F+w4fL7ToqqyBzhqzAaV5hWRaw5 Wxbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="IgN4X2H/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c10-20020a17090a8d0a00b0027768e7a9aesi2557852pjo.120.2023.09.29.19.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 19:42:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="IgN4X2H/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 85CA282F9250; Fri, 29 Sep 2023 07:32:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233606AbjI2OcS (ORCPT + 20 others); Fri, 29 Sep 2023 10:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233525AbjI2OcI (ORCPT ); Fri, 29 Sep 2023 10:32:08 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 433F5CE7; Fri, 29 Sep 2023 07:32:02 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5335725cf84so16995615a12.2; Fri, 29 Sep 2023 07:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695997920; x=1696602720; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=En/oFUq/81cLOHvLKqdr065XPAN22won0/p2LOHNjFo=; b=IgN4X2H/oA7ny4yJRqfUCAtG7nqAjlAsDHlb9U7oqFDP/DCmaX/1ynjQI1hrAkGQHJ yWi4iAO0BNWozzViZo6ZC9Iyue9HRsZWeLIqlEy6SuuZx4ZD5ChiGhdEmGXHArltlf6M c7+A9BK+shntL7gHYaVxYP/hFpXTK/ZMe0NtGGs3mIj4A9FcTfaSQq1asGhmfLI8bBYG KPyz+WhrV/4/9ic/WXVnBnkQxG0FmyydgwYnM2HQdV1HbUww3lHuzzB2a3l8aLZJ3KEH i8dDgBqvsJNhBiwEWWN/UqhiyJojgBwgHuakn//D8DMNZp5qvSI3k/9j9pgOv5/xASpv aCgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695997920; x=1696602720; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=En/oFUq/81cLOHvLKqdr065XPAN22won0/p2LOHNjFo=; b=MKvdDj4ubZ8ZdB453TXsRe4fOMX1Nt6Jfts9IlB3Kfg0awsjB91fD4OwUM5EBfsdPP 5ZCS+s9jsKtcMRbpvEEk7P5ziqsu8O78EkYVreAlqLxYsCt6dPppcEKFrDvXAec1G2K+ 3eUjxmwW/0xSD0ZIX/bX9c88RFQfkkGZIynTwK6wfz4iMvyIRMrnZq8cN0HTwa8yiZ1w FeSxi513GPfxp4t7VQZIBsW0za0iqW2QZaEXgfuCA0k561XTxpafNFvlSRe1QnRVTVVQ 4EXGtFK9pyDT5a9QYjIkZ9rkZoG9J+h9Ogkcxi3xyePf9CnXCMFHiPV2DpVRXlYpCMXw e8Og== X-Gm-Message-State: AOJu0YxP9kV4Gas3IH3UyNcO9Et3Vk7AfL6ayoNa9TqqEWplbPy+ngdP ZipSfymozKb0vV+0PMYU5mk= X-Received: by 2002:a17:906:1bb2:b0:9ae:7204:3656 with SMTP id r18-20020a1709061bb200b009ae72043656mr4232051ejg.60.1695997920584; Fri, 29 Sep 2023 07:32:00 -0700 (PDT) Received: from primary.. ([212.34.12.50]) by smtp.gmail.com with ESMTPSA id a7-20020a170906670700b0099293cdbc98sm12660105ejp.145.2023.09.29.07.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 07:32:00 -0700 (PDT) From: Abdel Alkuor To: heikki.krogerus@linux.intel.com, krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, ryan.eleceng@gmail.com, robh+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, Abdel Alkuor Subject: [PATCH v8 03/14] USB: typec: tps6598x: Add patch mode to tps6598x Date: Fri, 29 Sep 2023 10:30:44 -0400 Message-Id: <20230929143055.31360-4-alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230929143055.31360-1-alkuor@gmail.com> References: <20230929143055.31360-1-alkuor@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 07:32:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778428701981972872 X-GMAIL-MSGID: 1778428701981972872 From: Abdel Alkuor TPS25750 has a patch mode indicating the device requires a configuration to get the device into operational mode Signed-off-by: Abdel Alkuor --- Changes in v8: - Revert mode check return Changes in v7: - Add driver name to commit subject Changes in v6: - Return current mode and check it directly Changes in v5: - Incorporating tps25750 into tps6598x driver drivers/usb/typec/tipd/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 32420c61660d..c5bbf03cb74a 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -68,6 +68,7 @@ enum { TPS_MODE_BOOT, TPS_MODE_BIST, TPS_MODE_DISC, + TPS_MODE_PTCH, }; static const char *const modes[] = { @@ -75,6 +76,7 @@ static const char *const modes[] = { [TPS_MODE_BOOT] = "BOOT", [TPS_MODE_BIST] = "BIST", [TPS_MODE_DISC] = "DISC", + [TPS_MODE_PTCH] = "PTCH", }; /* Unrecognized commands will be replaced with "!CMD" */ @@ -595,6 +597,7 @@ static int tps6598x_check_mode(struct tps6598x *tps) switch (match_string(modes, ARRAY_SIZE(modes), mode)) { case TPS_MODE_APP: + case TPS_MODE_PTCH: return 0; case TPS_MODE_BOOT: dev_warn(tps->dev, "dead-battery condition\n");