Received: by 10.192.165.148 with SMTP id m20csp2534646imm; Sun, 22 Apr 2018 09:02:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx481UlOL+5bCncPYbMeidkCzUOsaH0OhvnvxFoK+EGLiFzKjig/LdmGPBxg6ZCEdaWoMzphq X-Received: by 10.98.70.8 with SMTP id t8mr17018860pfa.185.1524412975934; Sun, 22 Apr 2018 09:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412975; cv=none; d=google.com; s=arc-20160816; b=TG6gAImQbYqnkl+hovINQ0vCyTFfxiCujOwpGoLS/reQ7JnIPbMXTrJjSm8roBFVok JeVj4ASoyaRE3bY9A2tMWyxS+poRq0KGb2gjNWbrHIVBaOHfRtsfojpmBITT6D0+FRRk YCoYbfyQBmKx/USX4V0/jkG/g51gS4zvFdgN4mkFXeoMzEjEM2924n8+Z+cCuWi5+Lvp +mVB0OAjKt3KUe7bziytVKu/Q7TDpW8JMYW+dokjb2ZeYN8oEbU6Wj4K53aLGNwJU7Os zrrGGnCD4sELc+9ChT/F2mt/6oTqhMkxFhSbTRjcmDNx2fr3Lo2BDX4avdRSXIuNsCP2 K5AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PDNC4RHLay3No1OguLdlcclWKFdwtNHz5KwKgLa1ESs=; b=UCSQzmGWu39KBrbUP2liNseHvFyMcLQhnIgcifn61WqZj7WvpBlywcuV9/+jxECF99 cwtmx6SpkEBiBnbmQ7TIE2QhQlNFkPRAdESjZ2va8lKoObGEOB3jDn8Lza8+0iLrqkBU RjXv3ulp9dWmIJmL4grxxwE/0L0oPii1LTrqteasuI8Ujs6i1vTNvYb/+Z6JtSlCT4Dv Mr4KLoEaKCtY7jVotgLuMPMR2LgQQWL+W0PEKMEtIYaRLBbzvB7RPDyXZxK/pGUX1dZd PeB4ikrVz7+blisKKHKgcjt0ykvO6FIAI/zNNeObXmwRX0CDGEtht3tg82sdPiUGut9/ v4nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si8373089pgs.516.2018.04.22.09.02.41; Sun, 22 Apr 2018 09:02:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157AbeDVN6Z (ORCPT + 99 others); Sun, 22 Apr 2018 09:58:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46186 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104AbeDVN6U (ORCPT ); Sun, 22 Apr 2018 09:58:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7C750CD5; Sun, 22 Apr 2018 13:58:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Hans de Goede , Chanwoo Choi Subject: [PATCH 4.16 082/196] extcon: intel-cht-wc: Set direction and drv flags for V5 boost GPIO Date: Sun, 22 Apr 2018 15:51:42 +0200 Message-Id: <20180422135108.549449503@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit ad49aee401dd1997ec71360df6e51a91ad3cf516 upstream. Sometimes (firmware bug?) the V5 boost GPIO is not configured as output by the BIOS, leading to the 5V boost convertor being permanently on, Explicitly set the direction and drv flags rather then inheriting them from the firmware to fix this. Fixes: 585cb239f4de ("extcon: intel-cht-wc: Disable external 5v boost ...") Cc: stable@vger.kernel.org Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi Signed-off-by: Greg Kroah-Hartman --- drivers/extcon/extcon-intel-cht-wc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/extcon/extcon-intel-cht-wc.c +++ b/drivers/extcon/extcon-intel-cht-wc.c @@ -66,6 +66,8 @@ #define CHT_WC_VBUS_GPIO_CTLO 0x6e2d #define CHT_WC_VBUS_GPIO_CTLO_OUTPUT BIT(0) +#define CHT_WC_VBUS_GPIO_CTLO_DRV_OD BIT(4) +#define CHT_WC_VBUS_GPIO_CTLO_DIR_OUT BIT(5) enum cht_wc_usb_id { USB_ID_OTG, @@ -183,14 +185,15 @@ static void cht_wc_extcon_set_5v_boost(s { int ret, val; - val = enable ? CHT_WC_VBUS_GPIO_CTLO_OUTPUT : 0; - /* * The 5V boost converter is enabled through a gpio on the PMIC, since * there currently is no gpio driver we access the gpio reg directly. */ - ret = regmap_update_bits(ext->regmap, CHT_WC_VBUS_GPIO_CTLO, - CHT_WC_VBUS_GPIO_CTLO_OUTPUT, val); + val = CHT_WC_VBUS_GPIO_CTLO_DRV_OD | CHT_WC_VBUS_GPIO_CTLO_DIR_OUT; + if (enable) + val |= CHT_WC_VBUS_GPIO_CTLO_OUTPUT; + + ret = regmap_write(ext->regmap, CHT_WC_VBUS_GPIO_CTLO, val); if (ret) dev_err(ext->dev, "Error writing Vbus GPIO CTLO: %d\n", ret); }