From patchwork Fri Sep 15 21:29:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 723214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2E2FCD37AA for ; Fri, 15 Sep 2023 21:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232662AbjIOVaP (ORCPT ); Fri, 15 Sep 2023 17:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237617AbjIOVaE (ORCPT ); Fri, 15 Sep 2023 17:30:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4B8AB8 for ; Fri, 15 Sep 2023 14:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694813352; 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=VtyMfYzD7xcby6o2/dzP0eRV0+P8SHlRHIxsw7xO7Vo=; b=dyZWzDY8+CYHJykmuChXLveq5pfONoiZIoooqtv/YgSCdEIfqmPW+gRyhk8Q3Wv/zCdeI2 u2JfJYr/DdxZDe07R6R5E+nLL/3t1YkZSzsYskV9KmuBLceyTCViHAo721H9DA+53pfzdv C+npa72Bk6E0r9GkLxW4N+KBeYMaMIU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-UQKuRmAHPniNH6oCrDMz4Q-1; Fri, 15 Sep 2023 17:29:08 -0400 X-MC-Unique: UQKuRmAHPniNH6oCrDMz4Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 56EC182A620; Fri, 15 Sep 2023 21:29:08 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id C01EE2026D4B; Fri, 15 Sep 2023 21:29:07 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 1/2] ACPI: video: Move Xiaomi Mi Pad 2 quirk to its own section Date: Fri, 15 Sep 2023 23:29:01 +0200 Message-ID: <20230915212902.59586-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The Xiaomi Mi Pad 2 is currently listed under the: "Models which should use the vendor backlight interface, because of broken ACPI video backlight control." section. But this is not 100% correct. The Xiaomi Mi Pad 2 is one of a set of x86 tablets which shipped with Android as factory OS. These tablets have a TI LP8557 backlight controller with its PWM input _not_ connected to the PMIC or chipset (LPSS) PWM output. Instead the backlight can be controlled by configuring the LP8557 for direct control through its brightness I2C register and then using the lp855x driver. This setup means that neither i915's native or acpi_video backlight control works, so a "vendor" quirk is added for these tablets to disable both the native and acpi_video backlight devices, but these devices do not use vendor control in the typical meaning of vendor specific SMBIOS or ACPI calls being used. This patch is a preparation patch for adding "vendor" quirks for a couple more such tablet models. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 442396f6ed1f..889902a4fdfe 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -229,14 +229,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"), }, }, - { - .callback = video_detect_force_vendor, - /* Xiaomi Mi Pad 2 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"), - DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"), - }, - }, /* * Models which should use the vendor backlight interface, @@ -799,6 +791,24 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 15 3535"), }, }, + + /* + * x86 android tablets which directly control the backlight through + * an external backlight controller, typically TI's LP8557. + * The backlight is directly controlled by the lp855x driver on these. + * This setup means that neither i915's native nor acpi_video backlight + * control works. Add a "vendor" quirk to disable both. Note these + * devices do not use vendor control in the typical meaning of + * vendor specific SMBIOS or ACPI calls being used. + */ + { + .callback = video_detect_force_vendor, + /* Xiaomi Mi Pad 2 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"), + DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"), + }, + }, { }, }; From patchwork Fri Sep 15 21:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 723993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C059FCD37AD for ; Fri, 15 Sep 2023 21:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236136AbjIOVaP (ORCPT ); Fri, 15 Sep 2023 17:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237661AbjIOVaF (ORCPT ); Fri, 15 Sep 2023 17:30:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 908D5D3 for ; Fri, 15 Sep 2023 14:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694813352; 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=ypC7TunqhPR9LA3kHH9j8UJiBD/IM4h7QMuAD//yM+k=; b=ephiOgu8YXuiz6kZmZeJw+qh2nON5N/6TASp9TTE/cugz0tNbJNOQmkpV/Q1L/NGQMnJqn aJsss1K39QXPIKddsIVVO9Zo0ZKuEYzwtpv/u/qq5hOLmRjI2ml8xZaEIWOoDDGEJ+4yfN C6h0zpY7HVoJMvpb3Ra/EqP3+SvtYog= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-689-OClMHuQFM9G1xGMfeyiyqg-1; Fri, 15 Sep 2023 17:29:09 -0400 X-MC-Unique: OClMHuQFM9G1xGMfeyiyqg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1D3C9811E7B; Fri, 15 Sep 2023 21:29:09 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 883982026D4B; Fri, 15 Sep 2023 21:29:08 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 2/2] ACPI: video: Add "vendor" quirks for 3 Lenovo x86 Android tablets Date: Fri, 15 Sep 2023 23:29:02 +0200 Message-ID: <20230915212902.59586-2-hdegoede@redhat.com> In-Reply-To: <20230915212902.59586-1-hdegoede@redhat.com> References: <20230915212902.59586-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Like the Xiaomi Mi Pad 2 these 3 Lenovo x86 Android tablet models also use a TI LP8557 backlight controller in direct I2C brightness register control mode. Add "vendor" quirks for these 3 models to disable the non-working native / acpi_video backlight devices. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 889902a4fdfe..67aa160c6b76 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -801,6 +801,38 @@ static const struct dmi_system_id video_detect_dmi_table[] = { * devices do not use vendor control in the typical meaning of * vendor specific SMBIOS or ACPI calls being used. */ + { + .callback = video_detect_force_vendor, + /* Lenovo Yoga Book X90F / X90L */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), + }, + }, + { + .callback = video_detect_force_vendor, + /* + * Lenovo Yoga Tablet 2 830F/L or 1050F/L (The 8" and 10" + * Lenovo Yoga Tablet 2 use the same mainboard) + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."), + DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"), + DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"), + /* Partial match on beginning of BIOS version */ + DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), + }, + }, + { + .callback = video_detect_force_vendor, + /* Lenovo Yoga Tab 3 Pro YT3-X90F */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), + }, + }, { .callback = video_detect_force_vendor, /* Xiaomi Mi Pad 2 */