Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1359281pxb; Sat, 30 Oct 2021 11:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL8d/Uec25DZvuc+EYUb+zOFIStzG+/PX6hZuK+iFU1t4KJTCX0Nya+kFakSS066RBbHZW X-Received: by 2002:a50:bf48:: with SMTP id g8mr26417604edk.10.1635618793241; Sat, 30 Oct 2021 11:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635618793; cv=none; d=google.com; s=arc-20160816; b=meZgQugNdSXW/0jC1+etNVmh71PFpsvvNLvHjO0bCLerS8zW0bPrtJR6NSI1L+DWFI dGGuNa5NLi6JstEHDY3zKnrW5AaRU4llH2JbLChBZ3NgF84eV6zrQX2He7PcpK58P6hY FSk8VLHHuUE3aYbcHiE4XUjqZocO3Uux5yEHaRxfVEgifnl8j8jizBbf6iBjM7cZcxeX XqJMai8RYxwcMqjTh0sy+gBeIh612wGAPt2sMhKF3UDNT0QCjjjGRda3zNZfv7IIwX+R QdhZd904Kza7UfrJql17y/4qZqZ8NDd4TbYbRtuJm9ujrs25OcHV3jyPkAmQs+ztja5C c72g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tVvWAEyocSYIBR9AcGsLALyZb02ytJh04fxwsOMZ8rM=; b=Ol4YRmzLPRCd98iBAs8Upl+K7rrydlSdakNuPnDf5QfsLNmeJfrxg0/ckD+eJl/loU r58rT45m2fXnxKw/KxQKX9Y5qR+ICdQ/xSCCN8WU6yIJb5a29OrYLRe+BpW0009DdivO eNOfwYTEVpDbuOmCugUl/MAfPE0UKB6czNIBlYvp/l1WDN6TW2cClzssoIGxaZBzj2NE ugCd3LKDH8yt2fv4LEuXkycozK3n4HS3k9cKwPXPuzU3Y5M64JvbeziJKTo42gJ154WK T/1VtSdgMyYJEOgONFWCQWI1xDpUKjB1Qx086jGVQMgufEOYhLTrtiQjcFqR49zImbRa rG0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S1Ld+2Ih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si5437145edt.109.2021.10.30.11.32.19; Sat, 30 Oct 2021 11:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S1Ld+2Ih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230507AbhJ3SbE (ORCPT + 99 others); Sat, 30 Oct 2021 14:31:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26640 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbhJ3SbA (ORCPT ); Sat, 30 Oct 2021 14:31:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635618510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tVvWAEyocSYIBR9AcGsLALyZb02ytJh04fxwsOMZ8rM=; b=S1Ld+2IhrqWtHmeFEHkBGBKS5ovuA3bU9p5QzJtraKuw70n6AM4SVIRGad7CQyOkNh5bMU 2jQkO5pIlYyBseXgeeMOFA4aBFzKxe5hSqj8JdoKheN51BE77GskkCLZAtYuoI0+68LjH+ lg0oVbrMh4lrC9UblX+5nlyj40qjTEY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-549-bnSJrRByMw68x3MMRsWsFw-1; Sat, 30 Oct 2021 14:28:19 -0400 X-MC-Unique: bnSJrRByMw68x3MMRsWsFw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1DCD1808319; Sat, 30 Oct 2021 18:28:17 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id D26425F4E9; Sat, 30 Oct 2021 18:28:14 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Wolfram Sang , Sebastian Reichel , MyungJoo Ham , Chanwoo Choi , Ard Biesheuvel Cc: Hans de Goede , Yauhen Kharuzhy , Tsuchiya Yuto , platform-driver-x86@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 00/13] power-suppy/i2c/extcon: Add support for cht-wc PMIC without USB-PD support Date: Sat, 30 Oct 2021 20:28:00 +0200 Message-Id: <20211030182813.116672-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On many X86 devices with a Cherry Trail SoC the PMIC / battery charger support is not fully handled by ACPI. Instead we need to load native drivers for the PMIC and various chips surrounding the PMIC like the charger IC. So far we mostly support the AXP288 PMIC this way, as well as the Intel Whiskey Cove PMIC with a FUSB302 Type-C controller + other ICs for a USB-PD, USB-3 (superspeed) and DP-altmode capable Type-C connector, as found on the GPD win and GPD pocket mini laptops. On the Xiaomi Mi Pad 2 tablet the Whiskey Cove PMIC is used in a different setup then on the GPD devices, supporting only USB-2 with BC1.2 spec charger detection on its USB connector. This series adds support for the charger IC in this setup and for having the extcon-intel-cht-wc code control the 5V Vbus boost converter and the USB role-switch, which is done by the FUSB302 Type-C controller driver in the GPD case. This fixes the tablet not charging under Linux, host-mode only working when booted in host-mode, as well as device-mode not working. Note device-mode still does not work when plugged into a CDP port. I have identified the cause for this and I plan to submit a fix later. This series consists of the following parts: Patch 1 + 2: Add a "intel,cht-wc-setup" device property to the Whiskey Cove i2c-client so that various WC drivers can use this to identify which setup they are dealing with. Patch 3 + 4: bq25890 psy driver bug-fixes Patch 5 - 8: bq25890 psy support for non-devicetree devices Patch 9 + 10: bq25890 psy support for registering the builtin Vbus boost converter as a regulator Patch 11: Add support to the i2c-cht-wc I2C-controller driver to instantiate an i2c-client for the attached bq25890 charger Patch 12 + 13: extcon-intel-cht-wc add support for the USB-2 only with BC1.2 charger detection setup Assuming everybody is ok with this series, we need to talk about how to merge this. Patch 1 makes some very small changes (just a rename) to drivers/firmware/efi code, I would like to merging this + patch 2 through the pdx86 tree (where the real changes are). Ard, can I have your ack for this please ? Patch 11 depends on a header file added by patch 10, since the i2c-cht-wc.c code otherwise sees very little changes I believe it makes sense for patch 11 to be merged into linux-power-supply.git/for-next together with patches 3-10. Wolfram can we have you ack for this? Patch 12 + 13 can be merged through the extcon tree, these have no (compile time) dependencies on the other patches. This is all 5.17 material, and I will make sure the pdx86 patches adding the new property will land in 5.17-rc1, hopefully the rest will land then too, but if other bits land later that is fine too, as long as the new property is there behavior won't change on the GPD win/pocket and we won't get any regressions. Regards, Hans p.s. Patch 3 and 4 are pure bq25890 bugfixes and should probably be picked up right away independent of the rest of the series. Hans de Goede (13): platform/x86: Rename touchscreen_dmi to dmi_device_properties platform/x86: dmi_device_properties: Add setup info for boards with a CHT Whiskey Cove PMIC power: supply: bq25890: Fix race causing oops at boot power: supply: bq25890: Fix initial setting of the F_CONV_RATE field power: supply: bq25890: Add a bq25890_rw_init_data() helper power: supply: bq25890: Add support for skipping initialization power: supply: bq25890: Enable charging on boards where we skip reset power: supply: bq25890: Drop dev->platform_data == NULL check power: supply: bq25890: Add bq25890_set_otg_cfg() helper power: supply: bq25890: Add support for registering the Vbus boost converter as a regulator i2c: cht-wc: Add support for devices using a bq25890 charger extcon: intel-cht-wc: Check new "intel,cht-wc-setup" device-property extcon: intel-cht-wc: Add support for devices with an USB-micro-B connector MAINTAINERS | 2 +- drivers/extcon/extcon-intel-cht-wc.c | 119 ++++++++-- drivers/firmware/efi/embedded-firmware.c | 4 +- drivers/i2c/busses/i2c-cht-wc.c | 77 ++++-- drivers/platform/x86/Kconfig | 20 +- drivers/platform/x86/Makefile | 2 +- ...chscreen_dmi.c => dmi_device_properties.c} | 54 ++++- drivers/power/supply/bq25890_charger.c | 223 ++++++++++++------ include/linux/efi_embedded_fw.h | 2 +- include/linux/power/bq25890_charger.h | 15 ++ 10 files changed, 400 insertions(+), 118 deletions(-) rename drivers/platform/x86/{touchscreen_dmi.c => dmi_device_properties.c} (96%) create mode 100644 include/linux/power/bq25890_charger.h -- 2.31.1