Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1517767rdb; Wed, 20 Sep 2023 11:15:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjHBcs7YyLF3QyfgHDxt6s2MUiisa2QM1w/WEu2ZDFQJcEAd1TQWijjY42DEGEo+K1aCQG X-Received: by 2002:a17:90a:bf90:b0:273:4944:2eba with SMTP id d16-20020a17090abf9000b0027349442ebamr3098237pjs.40.1695233735721; Wed, 20 Sep 2023 11:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695233735; cv=none; d=google.com; s=arc-20160816; b=0SnxHvXKnnG2A2YKPxyGOMHbL9tLU4rm1dh4idFJZVnLL2lb7Z9QZZjy5idc6oEXu1 KRm0kE2W82DErO7DfQIwiR5ANxpKewBcqk35s09eB9aJzlQ6ap9qMHEdWNStP5F32RpV jop/B7S8iwvDZDnMjz1Bsu/wJDz1VIoR5ITYQ+JlIdDj5SLmKNT6NyoZrZSGTvgdewfH Z4QX1e20eNW0sjir12hjw6rzB9kJnNCvyYCuy9xwXNpTO7uuMB0DpjzlWv49A0JVmRsY UozFtFN9An5ypyxY3gocpJCk+UO2loVnkpT6aZlKged4aYRJXhJjSFCuZtLcbMlD5JI4 viVg== 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=vS/ZehT2TTq4OUBvmWF2X4je+TwLLsMe5wfLtKOCYts=; fh=GTVjYsILn35x6MNj0eB/LIPG9UExfhQyhRrkmcRVtec=; b=vKWk3tSYFhUC4+FNpE5AWqciTdDkcS5sBBGEFruLKlxVixzldysyQehpaOfg9uIb9t TRy6DUBImXEJqvlZgS/CVxI9lsC07TQpZVO9OxvUNv+NJ9yrp8cEW8Pvqta2tL3x0NXt r/VPLP+khltHf3oFJFCEMmGWRajQgaJYzcRWm48dVpInTjP9tH48fPF4FJhPEIsc79Ix 5RmRcPHqLGQroQscOrVLXuAfZ7pdNVLg7jsw503Ner9drPCbY3jg9HflKVTAWE+Z35gD a1V3zB68ZJp7UVEUyLKfwwL86t+IkMZ57J1hrA5TpL1KrhZjG/Lxveojhm9LuNKJT31o UGcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VN+PUHZl; 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 o8-20020a17090ac70800b0026d01e90c10si1908131pjt.65.2023.09.20.11.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 11:15:35 -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=VN+PUHZl; 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 17BBA819CC30; Wed, 20 Sep 2023 08:11:12 -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 S235006AbjITPLL (ORCPT + 99 others); Wed, 20 Sep 2023 11:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234610AbjITPLK (ORCPT ); Wed, 20 Sep 2023 11:11:10 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B887FAD; Wed, 20 Sep 2023 08:11:04 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso6252974f8f.0; Wed, 20 Sep 2023 08:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695222663; x=1695827463; 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=vS/ZehT2TTq4OUBvmWF2X4je+TwLLsMe5wfLtKOCYts=; b=VN+PUHZl34w9xLh60lhTPIhqwSiAbW95rNu+t++URLfOv0msRHxyvWqxeVWqq6h4fh ZDs1MYUnSqE2NOUmaCimcKoUMY2iWZ742nEpVHA6giwDTFHhiq7g83ZWv0LdURkxoiLS j9qq62YS7TGviqb+vGsK+ASS2c6Z6R28yAGLQ2ex9avUUsbUsqJVABaXRHrr/B7pFfQt fZvdVplYoUd9z4M3UGlwScisp5BE45NPPfJgw0UPfbVhZAoPa1LJbgQlejumDr17hJaK +BBdmxIo46vTPTl05ZSkGemSU/aHR5qIyan+RU8T/O2PjT5WZlHH0h26N74l29tEhUl0 QaEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695222663; x=1695827463; 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=vS/ZehT2TTq4OUBvmWF2X4je+TwLLsMe5wfLtKOCYts=; b=iMInKcOL6igCM25y9XINrBf/LwVhHeJ4pfTmOa3o2vJkVLl4eZz5YcdKJ3t0+rmOTp qwpF7k4mQIovoZEE3Wpvl0NiSkC7j9q7QCeZ2hw1ra+P5wxytHpLdwusiq9/grIEGJNr KxJTuI70rAhbDQ3OBEiVKCn6jKC7MxWbDVSEF/87lW0H9hXUEvslo+LY2HzvMs2Aj21g gqTQzXarBGRUJG1wBpO7wfcYD4ZgWS05epml7C3lDQ7KfG+v8hNfteE7mOS8JReZb0ER m3iwDxnphJHqlB8boRenMBtNeoYo/5r/yV9vqt6a68fpH1GLys5LJKdgBDch+UMfWYlU 5gag== X-Gm-Message-State: AOJu0YxQywAi37QjwGn2StNBNB7GcVER/QAGT6h0RRI8MPRQZgNLe4Jb D7A91W0K4GE+aq0kUag0JP4= X-Received: by 2002:a5d:4292:0:b0:31f:f753:5897 with SMTP id k18-20020a5d4292000000b0031ff7535897mr2462917wrq.59.1695222662854; Wed, 20 Sep 2023 08:11:02 -0700 (PDT) Received: from primary ([212.34.23.120]) by smtp.gmail.com with ESMTPSA id l16-20020adffe90000000b0031aef72a021sm4213234wrr.86.2023.09.20.08.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 08:11:02 -0700 (PDT) Date: Wed, 20 Sep 2023 11:10:58 -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 15/15] USB: typec: Do not check VID for tps25750 Message-ID: References: <20230917152639.21443-1-alkuor@gmail.com> <20230917152639.21443-16-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:11:12 -0700 (PDT) On Mon, Sep 18, 2023 at 04:29:43PM +0300, Heikki Krogerus wrote: > Hi, > > On Sun, Sep 17, 2023 at 11:26:39AM -0400, Abdel Alkuor wrote: > > From: Abdel Alkuor > > > > tps25750 doesn't have VID register, check VID for PD controllers > > other than tps25750 > > > > Signed-off-by: Abdel Alkuor > > --- > > drivers/usb/typec/tipd/core.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > > index 326c23bfa8e6..c1399e12a170 100644 > > --- a/drivers/usb/typec/tipd/core.c > > +++ b/drivers/usb/typec/tipd/core.c > > @@ -1142,10 +1142,6 @@ static int tps6598x_probe(struct i2c_client *client) > > if (IS_ERR(tps->regmap)) > > return PTR_ERR(tps->regmap); > > > > - ret = tps6598x_read32(tps, TPS_REG_VID, &vid); > > - if (ret < 0 || !vid) > > - return -ENODEV; > > - > > /* > > * Checking can the adapter handle SMBus protocol. If it can not, the > > * driver needs to take care of block reads separately. > > @@ -1176,6 +1172,12 @@ static int tps6598x_probe(struct i2c_client *client) > > > > tps->irq_handler = irq_handler; > > > > + if (!tps->is_tps25750) { > > + ret = tps6598x_read32(tps, TPS_REG_VID, &vid); > > + if (ret < 0 || !vid) > > + return -ENODEV; > > + } > > You need to do this at the same time you enable tps25750, so I'm > guessing in patch 4. > > You are also changing the execution order just because of that > is_tps25750. Instead you need to make sure you have that flag set as > soon as possible in the first place, so right after "tps" is > allocated: > Good point. I will move the check in patch 4 and check it after allocating tps. > mutex_init(&tps->lock); > tps->dev = &client->dev; > + tps->is_tps25750 = of_device_is_compatible(np, "ti,tps25750"); > > tps->regmap = devm_regmap_init_i2c(client, &tps6598x_regmap_config); > if (IS_ERR(tps->regmap)) > > > thanks, > > -- > heikki Thanks, Abdel