Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1359291pxb; Sat, 30 Oct 2021 11:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytKAO7+vr5tevVPJQlMTHt+/RlcGzeFVRc1YZEWU6Dh6Jfs5s7vnGPlzLBcZdErLntFjsr X-Received: by 2002:a17:906:b29a:: with SMTP id q26mr3630430ejz.262.1635618793394; 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=GFCBKmkOmkIDp0daaukdJkzEddzXnipCaq6K4jTjm31nAPSPmOHhS/7hDiCznGkAne 2u8YdaC1/wiPxRzSHX+7Aj0xX4rs9zP7h5MR7QJ6e9lwgRaCxbZUXt1rHKO1RttcKFMJ 9vw6uxzGWvKQDn0qofgwWD9jh1lXXMdVH7x8kcPCUoSzmd8Tju78Cch3X0Am7tdy3oiK klmBpePhusJVGDwzOwi+u199tuCN/ZM6bMZIkDbsh2I9StN8VYfjwWB/IFZA+cnBO1EX C3eShaGDX8Ls/146neYCQq6k0ujjhOQjIZam3p55i2gXFmpEysOSue6lMesevm1Ll4Yx /moQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XfAWTpqD6xHOwrNh8jWCx0PvwaLrx5zHt5cmNcz+EB4=; b=JMYbhtDmAUa21kfv1PATpSV4teF4j9b45xPNIqHpUKAYjpIQtrGXUvdE+b6NiTRL9s t+VRrZKq8I01p6P6R1qLOX58K5FPQ56p9rNn5BsRPCxfApZl8GfsfgBxZegS4ONTJmDt u2UCg5dgwUHoG5H90jch9ZldbTJQY+xMXWP7x3jqt6NqU+f/PQZTxRvULgNaPuE8fB2C R9Gn0LvWXCM0wcbTbUuCD4T+TEKp0E3YjDzBoF9vCaaryqVJmFZSyIBS2zCuMrG7p+Tm d3+MDGzF36wQDZpBap61CRvrSwHwf/r6wsO9rJ3CD1wpa5qhaCXmE0O6DQKWwiJmKYQC vjJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MOUfiyAT; 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 f14si12120452edc.609.2021.10.30.11.32.20; 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=MOUfiyAT; 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 S231305AbhJ3SbI (ORCPT + 99 others); Sat, 30 Oct 2021 14:31:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24517 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbhJ3SbC (ORCPT ); Sat, 30 Oct 2021 14:31:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635618511; 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: in-reply-to:in-reply-to:references:references; bh=XfAWTpqD6xHOwrNh8jWCx0PvwaLrx5zHt5cmNcz+EB4=; b=MOUfiyATbn0SlljGOsHTxlBIL5GMxKxMbFSTabjNUHOKciqm+Z+zvtKKHlXceYCcjE2qni dU+yBJT1XBuIEapIVb8MTildPqS9JHR98q705dcRjTIVhk19d3I6w7s6iLiP6+scrdu62A i3pwGy8ct4hs8l5DC/F2sLfAvVBZCM0= 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-389-0DSIdl-dOsOrGj5SanVZcw-1; Sat, 30 Oct 2021 14:28:25 -0400 X-MC-Unique: 0DSIdl-dOsOrGj5SanVZcw-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 CD15210055BC; Sat, 30 Oct 2021 18:28:23 +0000 (UTC) Received: from x1.localdomain (unknown [10.39.192.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08E915F4E1; Sat, 30 Oct 2021 18:28:20 +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 02/13] platform/x86: dmi_device_properties: Add setup info for boards with a CHT Whiskey Cove PMIC Date: Sat, 30 Oct 2021 20:28:02 +0200 Message-Id: <20211030182813.116672-3-hdegoede@redhat.com> In-Reply-To: <20211030182813.116672-1-hdegoede@redhat.com> References: <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 Add a new "intel,cht-wc-setup" string property to the "INT34D3:00" i2c_client for the Whiskey Cove PMIC found on several Cherry Trail based devices. At least 3 setups are known: 1. The WC PMIC is connected to a TI BQ24292i charger, paired with a Maxim MAX17047 fuelgauge + a FUSB302 USB Type-C Controller + a PI3USB30532 USB switch, for a fully functional Type-C port 2. The WC PMIC is connected to a TI BQ25890 charger, paired with a TI BQ27520 fuelgauge, for a USB-2 only Type-C port without PD 3. The WC PMIC is connected to a TI BQ25890 charger, paired with a TI BQ27542 fuelgauge, for a micro-USB port Which setup is in use cannot be determined reliably from the ACPI tables and various drivers (extcon-intel-cht-wc.c, i2c-cht-wc.c, ...) need to know which setup they are dealing with. Signed-off-by: Hans de Goede --- drivers/platform/x86/dmi_device_properties.c | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/platform/x86/dmi_device_properties.c b/drivers/platform/x86/dmi_device_properties.c index 1bcd14a0bc78..bd973afbde5f 100644 --- a/drivers/platform/x86/dmi_device_properties.c +++ b/drivers/platform/x86/dmi_device_properties.c @@ -387,6 +387,16 @@ static const struct ts_dmi_data gp_electronic_t701_data = { .properties = gp_electronic_t701_props, }; +static const struct property_entry gpd_win_pocket_props[] = { + PROPERTY_ENTRY_STRING("intel,cht-wc-setup", "bq24292i,max17047,fusb302,pi3usb30532"), + { } +}; + +static const struct ts_dmi_data gpd_win_pocket_data = { + .acpi_name = "INT34D3:00", + .properties = gpd_win_pocket_props, +}; + static const struct property_entry irbis_tw90_props[] = { PROPERTY_ENTRY_U32("touchscreen-size-x", 1720), PROPERTY_ENTRY_U32("touchscreen-size-y", 1138), @@ -978,6 +988,16 @@ static const struct ts_dmi_data vinga_twizzle_j116_data = { .properties = vinga_twizzle_j116_props, }; +static const struct property_entry xiaomi_mi_pad2_props[] = { + PROPERTY_ENTRY_STRING("intel,cht-wc-setup", "bq25890,bq27520"), + { } +}; + +static const struct ts_dmi_data xiaomi_mi_pad2_data = { + .acpi_name = "INT34D3:00", + .properties = xiaomi_mi_pad2_props, +}; + /* NOTE: Please keep this table sorted alphabetically */ const struct dmi_system_id dmi_device_properties[] = { { @@ -1166,6 +1186,24 @@ const struct dmi_system_id dmi_device_properties[] = { DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"), }, }, + { + /* GPD win / GPD pocket mini laptops */ + .driver_data = (void *)&gpd_win_pocket_data, + /* + * Note this may not seem like a very unique match, but in the + * 24000+ DMI decode dumps from linux-hardware.org only 42 have + * a board_vendor value of "AMI Corporation" and of those 42 + * only 1 (the GPD win/pocket entry) has a board_name of + * "Default string". Also few devices have both board_ and + * product_name not set. + */ + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "Default string"), + DMI_MATCH(DMI_BOARD_SERIAL, "Default string"), + DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), + }, + }, { /* Irbis TW90 */ .driver_data = (void *)&irbis_tw90_data, @@ -1578,6 +1616,14 @@ const struct dmi_system_id dmi_device_properties[] = { DMI_MATCH(DMI_PRODUCT_NAME, "TW700") }, }, + { + /* Xiaomi Mi Pad 2 */ + .driver_data = (void *)&xiaomi_mi_pad2_data, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"), + DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"), + }, + }, { /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */ .driver_data = (void *)&chuwi_vi8_data, -- 2.31.1