From patchwork Sat Sep 23 07:39:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdel Alkuor X-Patchwork-Id: 143855 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp73626vqu; Sat, 23 Sep 2023 02:25:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPZ6b694oWOkvh4Hz/7uapcm+Vn5Y0or++uMdSPxsf2oU7NIvSJI2T3HAoSXYRnRxF0rIa X-Received: by 2002:a05:6a00:1990:b0:68f:bbc3:df44 with SMTP id d16-20020a056a00199000b0068fbbc3df44mr2198774pfl.0.1695461121127; Sat, 23 Sep 2023 02:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695461121; cv=none; d=google.com; s=arc-20160816; b=LLRpOenlz4aKV1+jHYJY6zrBi/Le0w97eB6vSqieArQxhcmraO1kQ8iymBpDjxVvvg tYfSMKjO7t2mk7ZUMN9Luo8YOyzYuzNjcAbdc4JlavrAzA82i46awR/MpfbtmaPsvAyC f0HqOzqLH/9FhQQ/GJKVGoB4DsawHZ7t/aJOyuGy3me4xPZ13jHlrfN84BwR7DPbKdch CRPuTBbIruQqXNkkII/rV1NkBJwIXPNued5sCHyJu/WTwVWOsJVe3w7OhXDd1lPxDxnV fDB2QuXkcT/FBc9MLUH0JhGtU/UQ4vv0VHU7SXhtK3B6Y8kc48XIUxwfrDQSx/V26peo fGtw== 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=fIRa+aj4f6v9xT4/WGZX0P0iihhQsW2AVKNBUDiG5uU=; fh=UDTK5wkdLkKA1RzU/KF6Y0FI+lzcfubocuuGO7tFl2w=; b=1KsjH2cJUaE/PBf1uPDUc+Cot3tibE22c8oEZNh1PA1WLfDmVwIcZwF6BmBu21mxDe hiXB3TRlEeaJ5QjRBQGsrA8NF1SLd99acQ1rNnDbbQFhNspEH8NaZ4jYyHV5ZpavdnJI CIqjKbLCsoPnAmaHweB37MG0Q+W3odWMsT2CWFwm3pvkhf4e/GZzdbb+/kQkj6xjwOJy VZFkD3GuvroRo10DogY7y8uFlkWdg0WsWuidvmrG6ImGac3nqfE0eseEbyMsgMloK2XO S6s9zVWaeQmlZrtc2tw/KzlGNBeJSqUNrPHMySGwA9ddQ8bMsOE89pfMxgy+7WSXeXgZ Zxbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MYYpMPRZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x3-20020a636303000000b0055fdd303745si5595660pgb.421.2023.09.23.02.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 02:25:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MYYpMPRZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 F1AC6822074F; Sat, 23 Sep 2023 00:41:13 -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 S230375AbjIWHlK (ORCPT + 29 others); Sat, 23 Sep 2023 03:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjIWHkz (ORCPT ); Sat, 23 Sep 2023 03:40:55 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3BF1B3; Sat, 23 Sep 2023 00:40:48 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50317080342so5595594e87.2; Sat, 23 Sep 2023 00:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695454847; x=1696059647; 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=fIRa+aj4f6v9xT4/WGZX0P0iihhQsW2AVKNBUDiG5uU=; b=MYYpMPRZiVoeBElScU4kKrpREl/FqOginl6g4pK6qKf7bfJuatcSp8MPBhGwFoP2V7 AgB0PQhMD5kxqq+z/eT/wIW2JrOFlOBsTXgolyKIdmixI2GaOjJo/6uBcb6K5fweT/ph 61H+zvszAZE2/u5gBDjC2jFVTKYLVPCeaCclMaPmpfEhgZcY5IDozNkDH4ZOKHn7+G8R HvIOtFWCltyBTHUBaoiYU2d+J+IDrG/pihzHF+oxVyXQlKWFnFiq8EasdIalsQHEOOat wAwF9MLxB7rmfKdDzihqRVyEP1nnQgSTIoYGy9spx1LaZu5jWKLsCstS254iUMjdemFN 7stQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695454847; x=1696059647; 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=fIRa+aj4f6v9xT4/WGZX0P0iihhQsW2AVKNBUDiG5uU=; b=F4kqxuW1Xqkd4nsfl7MuHzQcmVBlCVa0mRMEUrRBaooiqLIIf2G2Chfd7XV1+KVPVU EPOokPxnRz+YFOoCRYTfB41DYVANKgKxqZTL82uF13BpmwKmfaf3uiooeIF1nmbuWnTT 3Q4hBuQGy/5LO6G2riOXQkaoX1mdeeYuEcjd+e5mqfXBv/mepUHFKgF9kse66T72SJlQ Z3foPGT3a7G6Kf8K1Syi6mhD8xXhWw7E4rw0+LRkiJezHG7ldboGmsNMBbWVHQ/O7yzb A6Mo3WU8rUYV+LHwTKcg9I3P8l2XJGBpCAzNreQIFwAaTWuPrPO21UbrNsW6R1R2rXuJ BmMg== X-Gm-Message-State: AOJu0YzYxeHcAjGJF13nBIsZGZFoPSbNFbXVAKWxd7Wpi1/MaGHl0BFs eiRvU8y70dSdkmHJAKwX+Jo= X-Received: by 2002:a19:6506:0:b0:503:1bb0:a658 with SMTP id z6-20020a196506000000b005031bb0a658mr1092532lfb.32.1695454846430; Sat, 23 Sep 2023 00:40:46 -0700 (PDT) Received: from primary.. ([213.139.62.222]) by smtp.gmail.com with ESMTPSA id k6-20020adfe3c6000000b003196e992567sm6236955wrm.115.2023.09.23.00.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 00:40:46 -0700 (PDT) From: Abdel Alkuor To: heikki.krogerus@linux.intel.com, krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, conor+dt@kernel.org, ryan.eleceng@gmail.com, Abdel Alkuor Subject: [PATCH v6 07/14] USB: typec: Apply patch again after power resume Date: Sat, 23 Sep 2023 03:39:52 -0400 Message-Id: <20230923073959.86660-8-alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230923073959.86660-1-alkuor@gmail.com> References: <20230923073959.86660-1-alkuor@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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]); Sat, 23 Sep 2023 00:41:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777819840583050041 X-GMAIL-MSGID: 1777819840583050041 From: Abdel Alkuor TPS25750 PD controller might be powered off externally at power suspend, after resuming PD controller power back, apply the patch again. Signed-off-by: Abdel Alkuor --- Changes in v6: - Check tps25750 using is_compatiable device node Changes in v5: - Incorporating tps25750 into tps6598x driver drivers/usb/typec/tipd/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 148b237d0df5..d77481f78100 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1192,6 +1192,18 @@ static int __maybe_unused tps6598x_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct tps6598x *tps = i2c_get_clientdata(client); + struct device_node *np = client->dev.of_node; + int ret; + + ret = tps6598x_check_mode(tps); + if (ret < 0) + return ret; + + if (of_device_is_compatible(np, "ti,tps25750") && ret == TPS_MODE_PTCH) { + ret = tps25750_apply_patch(tps); + if (ret) + return ret; + } if (tps->wakeup) { disable_irq_wake(client->irq);