From patchwork Wed Sep 27 17:53:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdel Alkuor X-Patchwork-Id: 145579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2881758vqu; Wed, 27 Sep 2023 13:24:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUBWgLDQZm4KsB7hepBC/uWsrEw/P9GHnmD5rDMYo6ffBnQ/06JY6wdd2eKVWXLhg4JEmM X-Received: by 2002:a17:902:c412:b0:1c3:b0c7:38bf with SMTP id k18-20020a170902c41200b001c3b0c738bfmr12322842plk.12.1695846258050; Wed, 27 Sep 2023 13:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695846258; cv=none; d=google.com; s=arc-20160816; b=uIu35ImsQj+HgSP982jAbMhOTf/piuMA6+Q5CZoaME8T75CBZ86cXhFqLz+3S2vjEH lzQwkULEzEL1xm7MKB9FuoE0bXpujRhY0ndMwCY7iZJZ5Ja0LmZ9lqcqtpIwhU9B3krg AIB3hSog8J13+byoxZQFxV13bkJkYoh/fW3NGfh2bMoWHU5hd91Rc/4OjjQJbjWWwTpA nvDQiMWo/fPe5637BFKNdvlogPdCArsADGvNYIlFrptKdOs3sg0GzjHSYZEhcmejR9t/ T/HUY3+vnBk7Pv3ncf1gOnK0OcdLGnVnjEFAG49LXoc6Hc5u9Hn531hC7QQsdldWSfew 2CoQ== 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=JIF24z+W4xSOOiQxGgE0N6mbcOqb2K0f4VACmgBIH2A=; fh=NDkcCmflgZsGSiSjskszThji4SYIrQ1hJIxt3Zy9sPE=; b=uMiLlGB/vdPx1rdxLXgrUFKikIkzi9ijUntmc7/JLhMZFoqwCpNDf9reM+0irBhphv 1gXNULUGIEBS8NwkdOgGE/XmgVOY2N1qbBr+Vetyd5gt2fUpVe+UzXDvIuE1VGoU+7ft yNXXDUWEg2nsT4eUY0UA4VrVND0dU6VNEJoC5imZ6idwTu2zLKlbkpOA+4P7ujeK1mRE v6FD23/yIcvqLh+6DEfks4CFnJnkc6GLKbTQP0+mmqeXqpDnZKJP1eDjrW/MCvR6nsCm M5xowNdxop54UFZbdsJmAwRaj54pk9ChtEttVJX89+viWGKTQ/GjGTrRDiKgvvSltCpI ZBYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MY+7TXiG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x12-20020a170902ec8c00b001c43ff69d93si17944406plg.324.2023.09.27.13.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 13:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MY+7TXiG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 9F709801BC95; Wed, 27 Sep 2023 10:58:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229499AbjI0R6A (ORCPT + 20 others); Wed, 27 Sep 2023 13:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbjI0R5r (ORCPT ); Wed, 27 Sep 2023 13:57:47 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C4D110A; Wed, 27 Sep 2023 10:57:43 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-99c1c66876aso1501383566b.2; Wed, 27 Sep 2023 10:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695837462; x=1696442262; 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=JIF24z+W4xSOOiQxGgE0N6mbcOqb2K0f4VACmgBIH2A=; b=MY+7TXiGutqbrMEdSTizXRAzYD3SVcs5Ym61Bbszoqa4ClM9cQQ26CG1enRQauurGo UIlt85qCuJeAvkdsqSCM9u2mqF3Gj3/dek46VjOdRTTVf95dQIMzREwGwmI1/mEHpcXn 8o22Mcz5tfFnJoaX6/8NHHuh49pg3FuWaYXCKr5SS8p7VUbQk7AFyYxCZCIUcttorTZZ bFLkxvf4AqngexGgqz692kwIivARcf3fPcfsFTjjyvxomHS2wE9GbBMW38qbaHfVMYmr 5wfx38wn6i+Jr4IOUr8GPWLd9+CUghGxPtS9DEOfoPyAUB25OQWZUVK34t7ub/S+Aury cIGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695837462; x=1696442262; 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=JIF24z+W4xSOOiQxGgE0N6mbcOqb2K0f4VACmgBIH2A=; b=Xulmwa1KKYNe6NMCnbJjrHFFeBOvR44LKAn3eqkgQNl9JGmfyYxcQN5g45aeiQFN82 9R9/rtgLPGiZrilNHDsdyOvKdNXm/bkRYvh1vmnYu5WEJJ9/Mu1wwYnaz6Ols3VKz+1+ aGyTweifNvbIlKTg07do2yuTjv1slPodx5dOMMVfJC+nAa5nokoqC1GUHOtYYAleonyb Qm+HbpKYXQZli0dr9DyV/j8tqHf+yc4O4QXtlTVf8m3OJDQ1GbqxnBDA4R0mbwftAlxP rSl0WtHVUkzR0LrnzVfuC4NmMS5PFrYiZuCiSUBFIG9EZkah2L9ByTUcgIQ1sR0C9R9c p3+w== X-Gm-Message-State: AOJu0YyWO0BjClJGtgjw4nrxwOaqtN/IzuSBE7vlU1EoxJGVHdICGp4r NQtVdV5XaG4DArITmxwVn0g= X-Received: by 2002:a17:906:5c:b0:9ae:63bd:a7fe with SMTP id 28-20020a170906005c00b009ae63bda7femr2493309ejg.10.1695837461874; Wed, 27 Sep 2023 10:57:41 -0700 (PDT) Received: from primary.. ([212.34.12.50]) by smtp.gmail.com with ESMTPSA id d4-20020a170906370400b0099bd8c1f67esm9654593ejc.109.2023.09.27.10.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 10:57:41 -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 v7 07/14] USB: typec: tps6598x: Apply patch again after power resume Date: Wed, 27 Sep 2023 13:53:41 -0400 Message-Id: <20230927175348.18041-8-alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230927175348.18041-1-alkuor@gmail.com> References: <20230927175348.18041-1-alkuor@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 27 Sep 2023 10:58:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778223685931324640 X-GMAIL-MSGID: 1778223685931324640 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 v7: - Add driver name to commit subject 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 faeee2ffc99c..56ffffe225f2 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1204,6 +1204,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);