Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp700737rwl; Thu, 5 Jan 2023 03:25:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXtU1YzxEYws7Rqq62uH7WJ4fK6MKnQeREYMeYnhIg+CjGC6oirGu6zsXKM9KLbHiTojOUHs X-Received: by 2002:aa7:c395:0:b0:48a:cae7:71db with SMTP id k21-20020aa7c395000000b0048acae771dbmr20515435edq.21.1672917908551; Thu, 05 Jan 2023 03:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672917908; cv=none; d=google.com; s=arc-20160816; b=f+rQQr+hevmiNAyLo1KXEO6+GdJPhsDophoQy1xqaLXKwoMmXtlEArUvAyd+DHQGwp 9in3DM8fTWWDkgRjOSdBHra6BUNpdZI8cZuqtvR/p22SnjlnjUx2De0EnKUa4BBi86Tg DSam8OtjVVNiuZg4Kc4ve4P6cyyre0XBXTP4gkLQoz421XbfKBcT9ExS5fsFVJGnf34B 4WQ1tFMm+PCULgqq3GBTG0/tQrJSJPtTPVXHq7og1f76JiDHQbz3u+SI6ThhbgsnZU3A M26kfEhhz0TKvfG8eIZfeJy2rpRsFoK4zdLIQxAHGMtdcNlbADF2uKmmR0M1XHvKb0V3 +RIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ad2eMKfo4aVouTchNTqrNM57SYFi0G9ncYilM9MgLJY=; b=zLIXxfh3jDNhb+vpXQOBzqbRFpPZgXv50T2KxfNmSSVe41VjueVRwNPN9TDxpUTFWY ln57tDlEotGGAx8JSGeJ92+zE7MIJPagptdrDxchpcQuW2/3cAaTPOLGdO2d4ZxbJgg/ T7QSmCrdcdJfveu0UdRP+qBn0055UmStaBkmhMdI4Xg6xfL+yoE29Akat3fFeU93kklf +T5zWorcHm5pK5ox3y1OsCk0xI2CfIBZ3OxvDqRA08xcHOByHRkB1sSD4786IJNtOKvf oXDU9MkZn+YB7hF05/RgMkS2hcTuYrtdyHybLyTWa9vmLoFjqEIZZBkbOsplcet6mlRk MBNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ox9+7F1o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020aa7c257000000b004877ebcc3b6si19866181edo.310.2023.01.05.03.24.55; Thu, 05 Jan 2023 03:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ox9+7F1o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbjAELGF (ORCPT + 55 others); Thu, 5 Jan 2023 06:06:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232799AbjAELFn (ORCPT ); Thu, 5 Jan 2023 06:05:43 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B77F568B3 for ; Thu, 5 Jan 2023 03:05:41 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id m7so1300468wrn.10 for ; Thu, 05 Jan 2023 03:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ad2eMKfo4aVouTchNTqrNM57SYFi0G9ncYilM9MgLJY=; b=ox9+7F1oaH+SXA9okqyI6rucJ/fhgMQUB9DokB5LD3YrzNcbDBRtJI+ENeiwGKUyl0 dtmIXsyODgk9x5/VJ5w/OWyDiiAbBg21hga43hv6rUMP0MHvW+X9jGK37p86zt5CmGsG hetdyzRfBnIUGlcD073uBrLkxUeenYC+AmGU8pbn+XZ9Aya0fUDx7QA9PVz73QTJLd2S stZvTUOmLJsdAn2v+cpNlDcz5TQt9IJJ8RAV26ax63axzbYpfJpxElgriMTUtWj1H81o wYMS7mKKPbLrH1eNzCUHM4eg+CJlJOMnr2PB6siipiRty11baterJYWE/0DPqDowTDKe 7QmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ad2eMKfo4aVouTchNTqrNM57SYFi0G9ncYilM9MgLJY=; b=2j+vFlBm7U0sT3/FVeyrOufE6h9S//3JU3Zlia0uC6sIxDw6Oi9BpECIzTRw0TjPei /GT4z36GKo4bNPqdcfGJJjJvRQ+kEsHbKzaiMGU9oPRlqCot/4ueY8T9iJWOIcm4G4AW 68s5URmb30HbOtw/XQkQQmpprDS1Ma+PfDXVh/H9kwMJyD8K5wDr6n0Z44nI9MWyz8/t YB6DAUEMVtL1Dfc8sv4qvMSb5tivPNNyBIwSfvfTv33Tf1mPnk2RnxQw/cnkdgq9/3Jr pm1tr1doqzF+Ckf1Q5BealrdKd8Hg0uW+K61gMP4y+wd7wLjTYWOr3wLRLWiVp1XQ4fa UKwA== X-Gm-Message-State: AFqh2kqWHKZCaGUP82HID76LYsoo2SXcf/CYuA406H8rJr/ZyERs7Jvo mzv2x4J5v/FV8Y2jbntRFFh8Q28aFIgWhSNXC3k= X-Received: by 2002:adf:eed0:0:b0:2b5:47ab:6fa0 with SMTP id a16-20020adfeed0000000b002b547ab6fa0mr653421wrp.38.1672916739969; Thu, 05 Jan 2023 03:05:39 -0800 (PST) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o2-20020adfcf02000000b00241d21d4652sm36401243wrj.21.2023.01.05.03.05.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 03:05:39 -0800 (PST) Message-ID: Date: Thu, 5 Jan 2023 11:05:38 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 2/2] usb: typec: tipd: Support wakeup Content-Language: en-US To: Jun Nie , heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org Cc: sven@svenpeter.dev, shawn.guo@linaro.org References: <20230105075058.924680-1-jun.nie@linaro.org> <20230105075058.924680-2-jun.nie@linaro.org> From: Bryan O'Donoghue In-Reply-To: <20230105075058.924680-2-jun.nie@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2023 07:50, Jun Nie wrote: > Enable wakeup when pluging or unpluging USB cable. It is up to other > components to hold system in active mode, such as display, so that > user can receive the notification. > > Signed-off-by: Jun Nie > --- > drivers/usb/typec/tipd/core.c | 38 +++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 46a4d8b128f0..485b90c13078 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -95,6 +95,7 @@ struct tps6598x { > struct power_supply_desc psy_desc; > enum power_supply_usb_type usb_type; > > + int wakeup; > u16 pwr_status; > }; > > @@ -846,6 +847,12 @@ static int tps6598x_probe(struct i2c_client *client) > i2c_set_clientdata(client, tps); > fwnode_handle_put(fwnode); > > + tps->wakeup = device_property_read_bool(tps->dev, "wakeup-source"); > + if (tps->wakeup) { > + device_init_wakeup(&client->dev, true); > + enable_irq_wake(client->irq); > + } Does the ordering of device_init_wakeup() and enable_irq_wake() matter ? The sequence in drivers/usb/typec/tcpm/tcpci_maxim.c is enable_irq_wake() and then device_init_wakeup() ? Reviewed-by: Bryan O'Donoghue