From patchwork Sun Oct 1 08:11:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdel Alkuor X-Patchwork-Id: 147146 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1014838vqb; Sun, 1 Oct 2023 12:05:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEr4WSE9SIKD4BemK4ZLvL9vEBLfkM/ILQAvq+U75m+X7pj98Qhqgb+znVZS9uV6FYXwUki X-Received: by 2002:a05:6358:7e0f:b0:143:7a89:a8d1 with SMTP id o15-20020a0563587e0f00b001437a89a8d1mr9462359rwm.0.1696187150117; Sun, 01 Oct 2023 12:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696187150; cv=none; d=google.com; s=arc-20160816; b=rf9RqtCP+0JSHcapj7GgPGq8ovNSnTIbxxvRWooycIUtwfOB7yhRSt4fCtcVVw+2aW jnw6YJfuX5u6GhQCuwtmLqjaJB0e+oo31Sw7QY2Llyx5JKXpJxGdxsDpMWe1+MAJDbdT 4txLvwEQM4fJbaqPvLUPhkx9c0EaLS1Tev3BWHSumby90A6Ugywu0W2RDtVS9R7enk7b FC16H0E73ZVbDTFyd9Vv8PeyOl6rACBndB8pVtS5BO5qxLTqnDWr4CU/dEAv2QFWxRl2 IU53tWXVAEl/EVHoW5pt9Yko9X/+81FhWOnphevJ0nNmN7+gmgNzSPxwEDUQGD8mLkLc tmBg== 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=mihHJZYDvrxcQ5UWKrmIwqyKIitG/AHmGkKzI/r7wpg=; fh=NDkcCmflgZsGSiSjskszThji4SYIrQ1hJIxt3Zy9sPE=; b=RQUmpsYOwLegxIkQIppMXMZeIhTZLvNu5iQoqsmZbk3t0pIkvcwWL0cHal4w9zvTcu K3PMnqhN6UOERXbTucIo7oJ1nRgJqW8VV4RGJsQG36ifLooPbf5gZcwv3TTbcB7kXrmc xm/yQDRPQ+7dwWWqU1nrgfHznUt5Dj98H9My0bY9OKh7umK+JrqcSyxDgif+/bVnH+5R Zcly6RvxOK7eYWDx5DCQJq/MK99BmLa1GnY6/VXu+AzcwcKFGUvVwUFT2mJCgQgF83KH s+LPYdyuW4xCxheQHzZdMnuTafijq/A2eljLKNHBlqX6Jlizk8NooD1Sfsa/bQnz2vzO Zt4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bnYj5FEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bu3-20020a056a00410300b0068e35d412c9si25093948pfb.323.2023.10.01.12.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 12:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bnYj5FEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 9B6248022682; Sun, 1 Oct 2023 01:16:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234510AbjJAIPa (ORCPT + 19 others); Sun, 1 Oct 2023 04:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234481AbjJAIPZ (ORCPT ); Sun, 1 Oct 2023 04:15:25 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A80DDD9; Sun, 1 Oct 2023 01:15:23 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-533cbbd0153so17263171a12.0; Sun, 01 Oct 2023 01:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696148122; x=1696752922; 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=mihHJZYDvrxcQ5UWKrmIwqyKIitG/AHmGkKzI/r7wpg=; b=bnYj5FEgAmk1BgeiWFBgWzz/0pCHiLEN7QBq6AqkCzvWNxzGewutXHk+b6mIFZLfTr LGZz44xWDnvhwXw+DKacCopDhKyWrZIfGd7IsVvVIF95mAnWJ+87ZS05BCjkNdrewkBp mVbXCYUuo8dqtPBEH13X+jGGGeOg1VVleWAQac5MtnzUymJI7KlykcfHRREiUXBcPknv QYK/88BtI+SINbRra+IWKdxo4BL4kCPR9aZs7m1IQfbyQq/aqhK3WI0LMlKgF7VDbU47 X40zHS+q+S6SME07b/bDSSRFVLeNYQcuZ1xubxeMaoswa7jSMHA9RAOBrYbWT70yc3J0 rD6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696148122; x=1696752922; 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=mihHJZYDvrxcQ5UWKrmIwqyKIitG/AHmGkKzI/r7wpg=; b=R5UzYvvJhJtA1JUAGn4SraUAB11J+obDwQwJr2ZcBoXCNv8pF/uSd6jQ6oko0lYi22 Kve0a8W3DHz2H8hDH8uriFXbYmK74/RlfvmbfkESvaA10Y0nairLfCGW9OxDkapGYTzb Tq5BO9nKaXQaghMPH0bDz1KX+Qm8tykBl7EJ/JXwAYIUMu870dgWk+AmvociYs9siKeL fvo3AKzodVB6MmJvHyUqIwHbOmBe1ohyQy2rLUrX/013xX+iTq+wkFiU1p7y7YGreMHZ +m11kqdJm9dAs8IfzWEpeaMzHO+Vk0t1JakWtlcWhO8tlCACtYKDIx8KFf+xtq8frsha JqOQ== X-Gm-Message-State: AOJu0YyOXI4a1PigIAUhminUQbTEA6NASun+AjyyYNBgQr2mT7T9Ibj3 Y8aCLTb2wPvFL3PUHloh4f4= X-Received: by 2002:a17:906:76d1:b0:9ae:729c:f651 with SMTP id q17-20020a17090676d100b009ae729cf651mr7386783ejn.17.1696148121928; Sun, 01 Oct 2023 01:15:21 -0700 (PDT) Received: from primary.. ([213.139.52.198]) by smtp.gmail.com with ESMTPSA id e8-20020a170906374800b0099cf840527csm15121841ejc.153.2023.10.01.01.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 01:15:21 -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 v9 03/14] USB: typec: tps6598x: Add patch mode to tps6598x Date: Sun, 1 Oct 2023 04:11:23 -0400 Message-Id: <20231001081134.37101-4-alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231001081134.37101-1-alkuor@gmail.com> References: <20231001081134.37101-1-alkuor@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Sun, 01 Oct 2023 01:16:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778581137115261893 X-GMAIL-MSGID: 1778581137115261893 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 Reviewed-by: Heikki Krogerus --- Changes in v9: - No changes 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");