Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1883833imj; Sun, 10 Feb 2019 12:37:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ7VddOJ7pOsa92itDP5zKESSe2kZpExya9i/9CUmu3wFQviLWgORexygq6Cn73AXwbNbtN X-Received: by 2002:a62:1e45:: with SMTP id e66mr33240310pfe.152.1549831038901; Sun, 10 Feb 2019 12:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549831038; cv=none; d=google.com; s=arc-20160816; b=W4oADcYHM3XwZbnBKv0ZHdFzihIexabzpySDhiO1EJJfqRUN/cVtUmAjDD9Fd/o/xu al7B4Cm6rA3ojiVCxVt/S05+p3K5dh5Ymn6Djw3ndwfU31Q61qiD2DcdP7zUwu5f4TCT hPGYrnLEeQcr25S1DnG6fGGN1QHGnXEI175pEoReoeJM8P9sdWUn9aD6mh3LSuSAscYT tM/37tgUET+tBT2TG2ArE6+Vh6To1bKFcIYwCL7C1/PdWLz1fkuwV9UtTDplJ1AB+O0S sldqOtHnOM9zZ2a42sraGhZS5cZCXosrXmB0FAAg+jxJmrr5O541HyCwERIlR/UKkLMA iejg== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Pd53kY7Zn/KTDbNDHPYJSH/JLmIxxzkNhX+LN2ZGuB4=; b=r2TQSQwXII+p90rG+tm7Y2ILaPPz1E0CYxaGyd+0ZwRCgqZwj/+kZIlyi6nWeeIEs9 9DGiI+9XJ9XVGKd9kgc7ddWXMY6K4GpCE/TMGWT+O1sKW7vhRz+UrfIj9FFu4cDBHYDV E2JvHOfjX3GZ8o1fC3Nqdj+7BefdLN1w/Ka0WQNa/IssVLwCyv4ZSC2nuXlwb+nOYMuo AhNnC1f+1oIF5gkZo+WWBikOqqpPLQhk8axOkyLxaM60R24lpGYddpFa0BkR2WLkao3v 5tu08+zjFz9DSLFlWewZbKihyfGfRDodyZENmH3B9q2BB5lQF81tPqocsn4FtWwCiIQ9 8aVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaBrvaaB; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 44si8773862plc.110.2019.02.10.12.37.02; Sun, 10 Feb 2019 12:37: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OaBrvaaB; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726118AbfBJUg5 (ORCPT + 99 others); Sun, 10 Feb 2019 15:36:57 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36308 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbfBJUg5 (ORCPT ); Sun, 10 Feb 2019 15:36:57 -0500 Received: by mail-wm1-f65.google.com with SMTP id p6so13021355wmc.1 for ; Sun, 10 Feb 2019 12:36:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pd53kY7Zn/KTDbNDHPYJSH/JLmIxxzkNhX+LN2ZGuB4=; b=OaBrvaaBaeLmkrrymGt8X3rplynAIGwTyJaRUKDU1LXH6fWuTo/rWXBGiys7EoMtD7 plvy72nzLPfg9DCTb86kJ1pT2AC4CXjgFngoP7RfRVhHqG/XkXmhGXE8vhSnWoFiPiT4 SXZewpIBSj4wwybEsZ+qFxK1YQdDrQiKKGo4mjYv1yF2owTJlEMNCWCjUFNXd4cp+WkI NJ4EPjMUp/SFKvjAxaAO/adPKoKaOkPVOPUu36wg2PhNh8KdmpkD9XvlJsYFrIIWSQ2n kL3bI9UxqE/fw/iD+bNPp3PDSb/zQoj5cjqtFMSwYEFqm1+mz+onHDPfKajz7nPqkbaW qLlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pd53kY7Zn/KTDbNDHPYJSH/JLmIxxzkNhX+LN2ZGuB4=; b=f73KNgJXXU2sgN7ioVLus+zjipibTMf2PcNO2fcWfZhh/olmMkfDQXCk3WgiyhgMiS OoaNXQ2k/3LjNARowUgRNQiV6cuq3JKE0ms0fAJar+rlDSeKpiea7evE9Qu7NNeY+NrS ZwNXoj0mVyrrVJOznQV8SkchvQ1hVVbvuh2OViXwL/IJuDcWKC5tRgKfiqkNvOwchOO7 Uva7RXFMyBYyFF4V1FXa3iOErU830LyZ6+H/MWfzC3dD17xpwVQ0yhWU3I/1wcEFNXcr ee5oGA02f3mJIzLC56ZtiXdmE4M8d9HBI97WV2DouH2gRtxq/Z8NwdZtW8ce5cEwVyOp fkPg== X-Gm-Message-State: AHQUAuZdxFEIeVslVvQzc03wyHEDsne4q1S2UmJcjb+OLaSGrmjzCb38 lFJ9j7so0AIhsf2sWv3G8fFInBxR X-Received: by 2002:a1c:4c0c:: with SMTP id z12mr6374798wmf.17.1549831015206; Sun, 10 Feb 2019 12:36:55 -0800 (PST) Received: from localhost.localdomain ([46.216.193.115]) by smtp.gmail.com with ESMTPSA id u25sm15151903wml.31.2019.02.10.12.36.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 12:36:54 -0800 (PST) Received: from jek by localhost.localdomain with local (Exim 4.92-RC4) (envelope-from ) id 1gsvqO-0005ed-Pf; Sun, 10 Feb 2019 23:36:52 +0300 From: Yauhen Kharuzhy To: linux-kernel@vger.kernel.org Cc: MyungJoo Ham , Andy Shevchenko , Hans de Goede , Yauhen Kharuzhy Subject: [PATCH 0/2] extcon: Intel Cherry Trail Whiskey Cove PMIC and external charger tweaks Date: Sun, 10 Feb 2019 23:36:47 +0300 Message-Id: <20190210203649.21691-1-jekhor@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Yauhen Kharuzhy (2): extcon-intel-cht-wc: Make charger detection co-existed with OTG host mode extcon intel-cht-wc: Enable external charger drivers/extcon/extcon-intel-cht-wc.c | 71 +++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) -- 2.20.1