Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp299938imp; Thu, 21 Feb 2019 01:34:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IYy0DYKb8+Tz2GhHXEAJrGWqrsPbmg1rlXiRGqE+VHYY4EclZysDl4qLOojstC2h8/96NKh X-Received: by 2002:a17:902:be15:: with SMTP id r21mr39000619pls.143.1550741691503; Thu, 21 Feb 2019 01:34:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550741691; cv=none; d=google.com; s=arc-20160816; b=fT7W1+ZAxIcJdZxzlW9sE08Y20y6DYF02uBG3ceB8P42qvPKs4HNElSirYOwM+FBqW uLDQq32GLpeRvDpDbnZhbWlUl31qlUrXars1gppSc3b7N6YgW2c/JsrjWEhPpiuybN05 BX6vtEqmeYoxIfYvwAwYemGLJ+uyurRdPdokcBPHo1T75IMN50ZpHZcwFpmBjOl/Feb5 dQVeKxA29YajPOkRIpO8qkU8lgNdVrq2zeMhz6kyUihz5BIi/eURZB34F++T5Sn9dKFC +0xtoS7RG17Y8VgYECkyof7CBGadScSJ/CyuNQydUPjrewglA2II/r2Ch5vp+jNrH5V6 0P8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=e/cRZFfRS1Ml1qaQW3ilHy5ozRayIu+7e4g7JUknFZ4=; b=uYfKeGlW9dy7p6cURqeGfc/fJP0EnzFcBDsGB9FMq4PBFHDPr3w7OFqTUOa739zro9 1K7/qRPeW5VmsGMYhA0PGHC7qV+h8I/kkGGxv3mMkaZyHCkO7Uq57QIZ3tKMsYL/Sjc3 fWhLBnR9Ap9bU7IM5vMCJwmovzj2rAtZ6pcf2+q2SSxbZWMDffDCFXvkQ3IcbE9Skv6M TQ9dSEPLXz2YDt+iCk8q69C0asEbOoKcmna4x4Ry5CO6pGdPCLlyjqT1+CPsUUns7Pnq WMZtN7RrfAxzWI4jCED+Sk3CwyI1scIoxLSKVCvyO9+E3vSX9kT/LtcrsZU2tuWu3kiJ cNVQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si19599744pgp.30.2019.02.21.01.34.35; Thu, 21 Feb 2019 01:34:51 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbfBUJdp (ORCPT + 99 others); Thu, 21 Feb 2019 04:33:45 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38954 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfBUJdp (ORCPT ); Thu, 21 Feb 2019 04:33:45 -0500 Received: by mail-ed1-f65.google.com with SMTP id p27so14937923edc.6 for ; Thu, 21 Feb 2019 01:33:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=e/cRZFfRS1Ml1qaQW3ilHy5ozRayIu+7e4g7JUknFZ4=; b=MOF9O9E+j3/ogRVz9ee96IurcEPxZTy85NhvN8dhLy7uCu2h1jkKG0FoWIDbVejTIC RhEJtpuAOD/4wD1NVoEHdoZcG1iR3CoeaKsCkf+/tjus9l1JfKUm4X+G1mFg74twnOR9 NCPjLRSA80e3WMVfPtM/m+pS+o550Z5WKSptDVacOve75/bZyWpshtG9sMYIAGCs43sZ iyfawNVxaQh8Ld1EHznEEL66i3vRIlhl4gEZuMVuzkQ346aeT4qRH1fcFNfabciO1xHH EpkWElQy1AlguJKH3LTEM68PSI25iuHricn9AssxsCKordF+Wblgp4dPDNX8n9miHA6R +qhg== X-Gm-Message-State: AHQUAuZ5ieBdrPIM9sxDNWUPHSCNw9GX4csWsBZgxcUL/5h0L19ae9iR hGf8kulryT6C9z203Yv1kXrwDTIGyCY= X-Received: by 2002:a50:aa68:: with SMTP id p37mr30015192edc.168.1550741623537; Thu, 21 Feb 2019 01:33:43 -0800 (PST) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id k26sm4836738ejv.63.2019.02.21.01.33.42 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 01:33:42 -0800 (PST) Subject: Re: [PATCH 2/2] extcon intel-cht-wc: Enable external charger To: Yauhen Kharuzhy Cc: linux-kernel@vger.kernel.org, MyungJoo Ham , Andy Shevchenko References: <20190210203649.21691-1-jekhor@gmail.com> <20190210203649.21691-3-jekhor@gmail.com> <1b2f04fc-05a0-4f09-c84e-dc7adc63ec63@redhat.com> <20190215063250.GB30250@jeknote.loshitsa1.net> <20190217215242.GA12656@jeknote.loshitsa1.net> <416a0e12-aa0e-e781-2ef2-f11b97ba77a0@redhat.com> <8e3d9949-4bd3-f229-ace4-196a5f08fad3@redhat.com> <20190219202005.GA3699@jeknote.loshitsa1.net> <6a7be360-8da3-f1e6-6ca7-f55b3b2c60df@redhat.com> <20190220202836.GA23567@jeknote.loshitsa1.net> From: Hans de Goede Message-ID: <01afde97-544b-423a-c18a-b39410b335ea@redhat.com> Date: Thu, 21 Feb 2019 10:33:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190220202836.GA23567@jeknote.loshitsa1.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 20-02-19 21:28, Yauhen Kharuzhy wrote: > On Wed, Feb 20, 2019 at 05:42:28PM +0100, Hans de Goede wrote: >>>> The input-current-limit only specifies how much current the charger may >>>> draw from the micro-usb for both supplying the laptop as well as for >>>> charging the battery combined. You can safely set this as high as >>>> the charger can handle (2A for a dedicated charger). >>>> >>>> The BQ25892 should have a *separate* setting for the max current to >>>> use while charging the battery (assuming that the input current allows >>>> drawing enough current in the first place). I would hope that those bits >>>> have some sane value set from the firmware... >>> >>> Yes, the charger has separate battery current limit but firmware doesn't >>> change its default value (2048 mA) while Lenovo's software driver does. >>> It set battery charging limit to 4 A and input limit to 2 A (it makes >>> sense because Lenovo adapter and BQ25892 both support voltage increasing >>> upto 12V). >> >> Hmm, I guess your device uses a separate power-barrel charging conector >> then? 12v over micro-usb requires special negotiation which the Whiskey Cove >> PMIC does not support AFAIK. > > The Yoga Book supports kind of quick charging by negotiate voltage with > 'current pulse protocol' supported by BQ25892 and Lenovo's wall cube. > I think that PMIC is not connected to VBUS directly. After charging > started, BQ25892 driver can ask power adapter to increase voltage > number of times upto 12V. See > https://github.com/jekhor/yogabook-linux-kernel/blob/master/drivers/power/supply/bq25890_charger.c#L918 > for example. > >> >> In either case if you want to increase the max battery current to 4A >> in the kernel, then this will have to be guarded by a DMI check. > > Yes. > >> >> I beieve the way to do this wuld be throuh a device-property on the >> charger which gets set from drivers/i2c/busses/i2c-cht-wc.c, but as >> said this needs to be behind a DMI check, e cannot just g and boost >> the max charge current to 4A everywhere. > > Yes, I use such method already in the my kernel: > https://github.com/jekhor/yogabook-linux-kernel/blob/master/drivers/i2c/busses/i2c-cht-wc.c#L247 > > Anyway, charger tweaking will be next iteration, now I want to complete > current extcon stuff/ Ok, sounds good. Regards, Hans