Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1777624rdb; Wed, 20 Sep 2023 21:42:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGit+SjNmY1yWkPMJQQqzEubTgAPXbxYcFahVLrwjcuYChj/DC53trx01Ytz11ydMvhVN11 X-Received: by 2002:a05:6a00:23d3:b0:690:42d5:3eea with SMTP id g19-20020a056a0023d300b0069042d53eeamr4748261pfc.30.1695271352049; Wed, 20 Sep 2023 21:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695271352; cv=none; d=google.com; s=arc-20160816; b=SjAuOsBBIuCq0Jft1DRvZjA0i4bYq2el6EVKABk9nkKnUkee+dFiMsr4RHucDdQrg/ HYSOyI0cfP7vlxDbRYQvefpWuwIMAdFrHqs86M4Bw5skvnTSH6J4NAZaBr1/Kq0bqphr Iu1GwsPwhiGgzPoSC2Cz8lbVwKRqB9BQaZ43rdZnBeOlIHuPkcCo8EWinTOYa3wPO+Io G+9vEn0Pxz78JJOU2lEnG64y3RDtE5PSr2BJTXP2Unfxk+kF/jnRAOSntzFpG71cfmml 7rPfjBSKm7YTiXwdfo+hUU0r0glx2A+nC8OjXhpHx/hYk00gglPYQmWdZLkQquL8+VDD lzDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D0MPgiZbxZbSzUsXqTDVKwoPGRFcJqc+1YPwRP9UNJI=; fh=GTVjYsILn35x6MNj0eB/LIPG9UExfhQyhRrkmcRVtec=; b=dyOPnUUKkDpgC+27bKczP7kKpY3Zv0cRqEdyPmKRSFLyBCme6yWNvGHRFM2O+0nIwJ 3Noi6YjASUWF64uUbIPcp0Q48WIpcKlKQJDa2lcKVISsudQmWv8jqauPnqfTNuu5mQPZ k6mSJ/O5lfqS3vK94+7hn1Ax0pnkqWsZm/smTKsu5dewuM51ZyDvz7TYtk0BPv2YgDmh TMmfZYoSNLXmoA5nu0b73gS7QfwKtHr3YhMM1ixK/dFZrXun4+NWY+5fXb1Dl8QNiPdV 8EY5yoVDoYopqZyuY4/UXZ7e02vlg4NJdvLuYQ2LXCgNOBIxpz09Y4ZX23E3Z5idqGpT YTZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hZgj0W6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u18-20020a656712000000b00578e2545db1si563341pgf.360.2023.09.20.21.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 21:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hZgj0W6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 BE117829F9BA; Wed, 20 Sep 2023 08:01: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 S235333AbjITPBR (ORCPT + 99 others); Wed, 20 Sep 2023 11:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235298AbjITPBP (ORCPT ); Wed, 20 Sep 2023 11:01:15 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ADF191; Wed, 20 Sep 2023 08:01:09 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-402d499580dso75008185e9.1; Wed, 20 Sep 2023 08:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695222068; x=1695826868; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=D0MPgiZbxZbSzUsXqTDVKwoPGRFcJqc+1YPwRP9UNJI=; b=hZgj0W6EFlCR2WlTMr4kM7OM6nYpWxXNPWDaopCx+kGFzO2E/6+QXLF/rVHqFt9Ac6 6vSn2vw06OREX0jBG14HpyYwLeRH01o+BuSqNx4PpC+wDwirKnJpXZdQIF3W2tbcKaep 7zVUikc9wQ8rQBWQfvxdk22W+pLRjfsWH40mRXIocMrKUcxdRunkBJZN/wN9vmLID3t3 wsiz6J1Cl0ID9KBfM+M7SbQRNgXnSLb/Z+U79nI8IfveyyyU20JJTw43Q/SnDV/5H7Bs 3xeypfEh4jmwp8V3QXG73qn8On6ZUlOF6F6Qbl5bqKseygHFf1JawvbzLJD+dcp2+Bal XznQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695222068; x=1695826868; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D0MPgiZbxZbSzUsXqTDVKwoPGRFcJqc+1YPwRP9UNJI=; b=olRrtFhdY2E7qidtFx2dMj/Lx3NEqn4LdPvkAqL3TbtNt2+NoE+cUdDR+gdIwY1HYK akbHl+PIOm5o2/+KYqVF/UOkmJA8VSy86SDJHq76NREytCS/Sm/vkMWb5Zup+sJyQSA1 XlUUHKlsyzKb/mHun6l0r5cwQgS2EyDzWOMeRQBlZtrGT5u+SwBLk6oCOQs+yiHR0L1+ dFXfP9w7gdilG3fmz7ddeWSjeAcbqdBUElc3TLedh0unQzoE/tJqRA/Yn5fADS10tW7W pryQIP0Vyrehek2fBLuWunBmGqLwdIoMJLFBFhBnFXMhZbpiQ0X+K+A6u1A73BKJ8rzp TFgg== X-Gm-Message-State: AOJu0Yx1GJtD5dMT+0SIBWSmrcK4wFU8cnBtGJvRRsaI/hG9l0efZ7YC oGnV4BJuTE/+GXodOYe5bkH+mfMhurRQGNs7fEc= X-Received: by 2002:a7b:c859:0:b0:402:95a0:b2ae with SMTP id c25-20020a7bc859000000b0040295a0b2aemr2444890wml.32.1695222067223; Wed, 20 Sep 2023 08:01:07 -0700 (PDT) Received: from primary ([212.34.23.120]) by smtp.gmail.com with ESMTPSA id a24-20020a05600c225800b00402d7105035sm2170550wmm.26.2023.09.20.08.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 08:01:06 -0700 (PDT) Date: Wed, 20 Sep 2023 10:47:38 -0400 From: Abdel Alkuor To: Heikki Krogerus Cc: krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, linux-kernel@vger.kernel.org, abdelalkuor@geotab.com Subject: Re: [PATCH v5 05/15] USB: typec: Check for EEPROM present Message-ID: References: <20230917152639.21443-1-alkuor@gmail.com> <20230917152639.21443-6-alkuor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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]); Wed, 20 Sep 2023 08:01:41 -0700 (PDT) On Mon, Sep 18, 2023 at 03:45:04PM +0300, Heikki Krogerus wrote: > On Sun, Sep 17, 2023 at 11:26:29AM -0400, Abdel Alkuor wrote: > > From: Abdel Alkuor > > > > When an EEPROM is present, tps25750 loads the binary configuration from > > EEPROM. Hence, all we need to do is wait for the device to switch to APP > > mode > > > > Signed-off-by: Abdel Alkuor > > --- > > drivers/usb/typec/tipd/core.c | 13 +++++++++++++ > > drivers/usb/typec/tipd/tps6598x.h | 3 +++ > > 2 files changed, 16 insertions(+) > > > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > > index fea139c72d6d..b3d4b2b5bf5f 100644 > > --- a/drivers/usb/typec/tipd/core.c > > +++ b/drivers/usb/typec/tipd/core.c > > @@ -37,6 +37,7 @@ > > #define TPS_REG_STATUS 0x1a > > #define TPS_REG_SYSTEM_CONF 0x28 > > #define TPS_REG_CTRL_CONF 0x29 > > +#define TPS_REG_BOOT_STATUS 0x2D > > #define TPS_REG_POWER_STATUS 0x3f > > #define TPS_REG_RX_IDENTITY_SOP 0x48 > > #define TPS_REG_DATA_STATUS 0x5f > > @@ -897,6 +898,17 @@ static int tps25750_apply_patch(struct tps6598x *tps) > > int ret; > > unsigned long timeout; > > u8 mode; > > + u64 status = 0; > > + > > + ret = tps6598x_block_read(tps, TPS_REG_BOOT_STATUS, &status, 5); > > + if (ret) > > + return ret; > > + /* > > + * Nothing to be done if the configuration > > + * is being loaded from EERPOM > > + */ > > + if (status & TPS25750_BOOT_STATUS_I2C_EEPROM_PRESENT) > > + goto wait_for_app; > > > > ret = tps25750_start_patch_burst_mode(tps); > > if (ret) { > > @@ -908,6 +920,7 @@ static int tps25750_apply_patch(struct tps6598x *tps) > > if (ret) > > return ret; > > > > +wait_for_app: > > timeout = jiffies + msecs_to_jiffies(1000); > > > > do { > > diff --git a/drivers/usb/typec/tipd/tps6598x.h b/drivers/usb/typec/tipd/tps6598x.h > > index 527857549d69..5e942c089c27 100644 > > --- a/drivers/usb/typec/tipd/tps6598x.h > > +++ b/drivers/usb/typec/tipd/tps6598x.h > > @@ -199,4 +199,7 @@ > > #define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_A BIT(2) > > #define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_B (BIT(2) | BIT(1)) > > > > +/* BOOT STATUS REG*/ > > +#define TPS25750_BOOT_STATUS_I2C_EEPROM_PRESENT BIT(3) > > That's not TPS25750 specific bit, so please rename that to > TPS_BOOT_STATUS_I2C_EEPROM_PRESENT > I will fix it in v6. > thanks, > > -- > heikki Thanks, Abdel