Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1132326imj; Thu, 14 Feb 2019 01:39:18 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib8sDb6lNd2k8XOGrCJTa1jsk4SMeG5W4eBjomv6SEsoOL04kh3grVIQza4op4qTXr84y8d X-Received: by 2002:a17:902:2c83:: with SMTP id n3mr3224185plb.104.1550137158637; Thu, 14 Feb 2019 01:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550137158; cv=none; d=google.com; s=arc-20160816; b=rT9lLrKH6l/cHY3lteiTEksYpjpckF//rV9htoZEGnCLmrvoRDRHR45VeuoMEI7EZk 0kntwL8F3hEtumH1watVcEHNyhyRQz8Yg/J82co30moEurDdb9TUpZNrA98kw0nUCIrh 2qvNDyaAp/RBRK4bCiEoWGQE1GBYG/lbZeohDpIuz7qD5Yf4+sXe3DQHrcl+8KkqcbKf QTwEGDOOBmcSVuj2ZddJnwfUnA58lw/Z2D7xRwDACy00OA/ZMAqU3kKetNMo1BEhRs95 FG2w2IA3Yfcp7nev97G+DN7v4jHwK3Rz+vG1IVlBRDXVDW2WHN9o9dNOCylDdHly9q9K rP2g== 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=F0TpCTxv+/m3TwzY+OUc/JTp4f+jIrWjrGOkYJDiRXw=; b=dQ0RisS6oNR1eE6sOYCwH+MpFo+nJvRqP8rvYJ9k1npXpDSGWEjyzsiEo2dsoOkRjN lhh9TbINgm25qUNslXTj7GAf0XnJYVZURh82MIDGclxS+DfCM6Pue/KNgG2i7yVxuqle 16aLlqUodZ1NdGDKQN4437arFJqwFawr4IjT7ivlo1bwpl7yQrKN4Lsb1W1yYt67WdDj Avr6VTkLO/K3iQ3Bl8RyiGIUKpD4KSe1tWF9wlubJ5ephKHM2TV7ZvxF/ukOjZ7l5NnH 5YzvoLoOsH2N6pckjgGsB/Ctk9uXKCYbgC4er6kYpqT1ZCKW3A6oK+M2LAMZx1ZpBOsW HbOg== 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 o3si1924604pgq.139.2019.02.14.01.39.02; Thu, 14 Feb 2019 01:39:18 -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 S2391625AbfBMXAr (ORCPT + 99 others); Wed, 13 Feb 2019 18:00:47 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33678 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfBMXAr (ORCPT ); Wed, 13 Feb 2019 18:00:47 -0500 Received: by mail-ed1-f66.google.com with SMTP id a2so3465101edi.0 for ; Wed, 13 Feb 2019 15:00:46 -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=F0TpCTxv+/m3TwzY+OUc/JTp4f+jIrWjrGOkYJDiRXw=; b=A1L21KJCXIW+udJxrbsVoa3lreJLye957pSEozvx1Ff03wuwSjKPhicnKxthbQj0Mh BWMQVWcdCUXIa2ld8LRRyGdRcwBXzjSWu7R5W7Qxj92lykREno9nWaWsg0yLo8sql4L0 hKprhcJiRWJ+yQxKfX7TIAmeHIE8k4PozKh3+UcoPpaEX83Fw4MDokraLMJYihersW/h Ajsfb2RGYZPTyq6wGEtDaZ6uwxCFADIYg0QatG8qNwiDm6nfoiIF5gKA4ct1o6SiNwt4 TCRceCU19u3JQHL/bbtjzbPCkPy9iGQWx2cpRG7dqb+ppdJUQ+w4RO0VwY4NQnTvBD33 8YlA== X-Gm-Message-State: AHQUAuYiGuPk7rgQf+LQXVZYYBoXHmd6vA4b28k+gmwsHanW1pvS42oP SOlcdSqiwEY++F2V4sHgnCgR2Q== X-Received: by 2002:a50:a8c3:: with SMTP id k61mr381881edc.296.1550098845847; Wed, 13 Feb 2019 15:00:45 -0800 (PST) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id b11sm136905eje.27.2019.02.13.15.00.44 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 15:00:45 -0800 (PST) Subject: Re: [PATCH 0/2] extcon: Intel Cherry Trail Whiskey Cove PMIC and external charger tweaks To: Yauhen Kharuzhy , linux-kernel@vger.kernel.org Cc: MyungJoo Ham , Andy Shevchenko References: <20190210203649.21691-1-jekhor@gmail.com> From: Hans de Goede Message-ID: <7d226dcc-9b9c-941c-7915-53ca123fa3a5@redhat.com> Date: Thu, 14 Feb 2019 00:00:44 +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: <20190210203649.21691-1-jekhor@gmail.com> 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 10-02-19 21:36, Yauhen Kharuzhy wrote: > At implementation of charging support for Lenovo Yoga Book (Intel Cherry Trail > based with Whiskey Cove PMIC), two pitfalls were found: > > - for detection of charger type by PMIC, bit 6 in the CHGRCTRL1 register > should be set in 0 (and set to 1 for Host mode). Pick up its definition > and logic from from Intel code drop[1]; > > - "#CHARGE ENABLE" signal of external charger (bq25892) in Yoga Book is > connected to one of PMIC outputs controlled by CHGDISCTRL register. > Enable charging at driver initialization. Pick up this from Lenovo's code > drop[2,3]. > > Please keep in mind that I have no docs for Whiskey Cove PMIC, so this patches > are based on some kind of reverse engineering and suppositions, correct me if > this semantic is wrong for common case. > > [1]. https://github.com/01org/ProductionKernelQuilts/uefi/cht-m1stable/patches/0001-power_supply-intel-pmic-ccsm-driver.patch > [2]. https://github.com/jekhor/yogabook-linux-android-kernel/blob/b7aa015ab794b516da7b6cb76e5e2d427e3b8b0c/drivers/power/bq2589x_charger.c#L2257 > [3]. https://github.com/01org/ProductionKernelQuilts/uefi/cht-m1stable/patches/EM-Charger-Disable-battery-charging-in-S3-and-enable.patch Thank you for these patches, besides your Lenovo Yoga Book I'm aware of only 2 other device models using the CHT Whiskey Cove PMIC, the GPD win and GPD pocket devices. These both work fine without the changes your patches introduce. I need to check if your changes do not cause regressions on these 2 devices, which are used with Linux by quite a few people. I will try to make some time for testing this sometime next week. A kind request to the platform-x86 driver maintainers (hi Andy): Please do not apply these patches until I've been able to test they don't cause issues elsewhere. Regards, Hans