From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F40F8C433F5 for ; Mon, 8 Nov 2021 15:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7E8161359 for ; Mon, 8 Nov 2021 15:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241045AbhKHPq6 (ORCPT ); Mon, 8 Nov 2021 10:46:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30227 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241059AbhKHPq5 (ORCPT ); Mon, 8 Nov 2021 10:46:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636386252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2RyU8qhSeZit5hKsiu2hQbRUAvUK+e+McPaAjHTnw30=; b=HS6x5FyGQQVlFuQGME6P34WvESt32V2oisiWSOpoMV/PAyCf+0SqzxF9nTz0hteXflCb1c mGXG9s4JQcm/Lf9krUchKvOOswr41RRqe/Mf9oPHrvikOZUV7y/AqI8Wkmw8bS+arxBM4T EmjPUDugHiNcrflsXVgZ+8/T1J4VXqM= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-mYJBPnGcMcG2pH4ERjFamw-1; Mon, 08 Nov 2021 10:44:11 -0500 X-MC-Unique: mYJBPnGcMcG2pH4ERjFamw-1 Received: by mail-ed1-f72.google.com with SMTP id w26-20020a056402071a00b003e28a389d04so15201679edx.4 for ; Mon, 08 Nov 2021 07:44:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2RyU8qhSeZit5hKsiu2hQbRUAvUK+e+McPaAjHTnw30=; b=xlG8w95QnjxYRLnbH4gowfZ7t+eHZgiQwpg7LB/2lLMo0xKFgT+4u5eGtxe5Q2ECYJ btMDwehlXnsxVROWBiw5uMIKrPCdtf555/n2o1mRsVHoyAHa32tJmutUxXMS4CTWF8tC oZbkVhZ21eSH+QMcatdkSQR9oJrKxSk+TYwOTduJPiwjub2DnhXsaEDJJyj3ar4n97rf udOVRPJlFGKfeCaea80rXzURWP4k84dOk/pW1Xgr3osio+UBa/2VG9KC+b0jNrFj9BxE NY8ZoX3F4ynaJtxOaxsx4LLP5/tRon5wgT4bR51pOOygDONf/bDAaVZif7bfa0oaS010 RsRA== X-Gm-Message-State: AOAM532E9eZigoT+Fwe+DmwFqWWe731+e4WnP3wdnHhIAmRaOsOlDRq3 OVodLqP3tfIHLeKu8FeM965fRtsA0r5zKv8muY566dG3bBezoEj8ikEpEpVJTiQBmVbNiGokb3E EbxhCg+3cW2ILN0UyooRnn6Bg067UHgJSvA== X-Received: by 2002:a17:906:2c16:: with SMTP id e22mr215012ejh.501.1636386250057; Mon, 08 Nov 2021 07:44:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlq0HQMHgB4Zj6dSwUyUqA2pyHOS5wXAZQanD1ylnLhmhVrP+t0k2sXvtMwqypw3DeXs0uyg== X-Received: by 2002:a17:906:2c16:: with SMTP id e22mr214996ejh.501.1636386249907; Mon, 08 Nov 2021 07:44:09 -0800 (PST) Received: from [10.40.1.223] ([81.30.35.201]) by smtp.gmail.com with ESMTPSA id sd28sm9076804ejc.37.2021.11.08.07.44.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 07:44:09 -0800 (PST) Message-ID: <0b27cd90-3174-01f5-359c-be0c2e094fc8@redhat.com> Date: Mon, 8 Nov 2021 16:44:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 13/13] extcon: intel-cht-wc: Add support for devices with an USB-micro-B connector Content-Language: en-US To: Andy Shevchenko Cc: Mark Gross , Andy Shevchenko , Wolfram Sang , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel , Yauhen Kharuzhy , Tsuchiya Yuto , Platform Driver , linux-i2c , Linux PM , Linux Kernel Mailing List , linux-efi References: <20211030182813.116672-1-hdegoede@redhat.com> <20211030182813.116672-14-hdegoede@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Hi, On 10/31/21 13:52, Andy Shevchenko wrote: > On Sat, Oct 30, 2021 at 9:29 PM Hans de Goede wrote: >> >> So far the extcon-intel-cht-wc code has only been tested on devices with >> a Type-C connector with USB-PD, USB3 (superspeed) and DP-altmode support >> through a FUSB302 Type-C controller. >> >> Some devices with the intel-cht-wc PMIC however come with an USB-micro-B >> connector, or an USB-2 only Type-C connector without USB-PD. >> >> These device are identified by "intel,cht-wc-setup" = "bq25890,bq27520", >> since there is no Type-C controller on these devices the extcon code must >> control the Vbus 5V boost converter and the USB role switch depending on >> the detected cable-type. > > ... > >> + if (ext->vbus_boost && ext->vbus_boost_enabled != enable) { >> + if (enable) >> + ret = regulator_enable(ext->vbus_boost); >> + else >> + ret = regulator_disable(ext->vbus_boost); > >> + if (ret == 0) >> + ext->vbus_boost_enabled = enable; >> + else >> + dev_err(ext->dev, "Error updating Vbus boost regulator: %d\n", ret); > > if (ret) > dev_err() > else > ... > > ? When doing if-else branches around an error code I always put the success handling in the if branch and have the else branch deal with the error to me that feels as the most natural way to do it the error is the exception and thus the "else" > >> + } > > ... > > >> + /* >> + * Classic micro USB-B setup, this requires controling > > controlling Fixed for the next version. Thanks & Regards, Hans > >> + * the role-sw and vbus based on the id-pin. >> + */ >