From patchwork Sat Apr 6 13:56:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13619834 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB99F34CD8 for ; Sat, 6 Apr 2024 13:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712411928; cv=none; b=OGLjeqKumpcdrj0T8FZ9iQdDvAETK651h87+HyyCk3XIjbe4t+OhBvw5PUrs6eFf9EpcsxzaxvlLrrMJE7sD9vrLZgvX/EDNiEQ02MNEO9smHaxk4erulUi3sGrOkCAKIxgRVoBTLTCZbus+pay5hvI/sWZELHj6likG3tERaFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712411928; c=relaxed/simple; bh=HiYlmnV1JxvSmus2kMoCceHatoMsYMccco3jmZPU9mU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nc7iFjKfwt+JLLJY0d99y3EGP+j4h+Z9Bh/pNb/Y4nEH83FTt1QNveb+gzBRUsH2jVgn98GRlVCR5VNZeyjWjizC9F4/qhypQEbs2/5G7lMW3kyL0+4obwEt4fqR6KlAQ0Kow/KNsZOS5X43CWYWGYjOuydq2U3RwgFPYmVQztE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=NbBZ6lx7; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NbBZ6lx7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712411925; 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=tCV++6cziM8hD67Ei5JbV2ZY6ibWidsrdMVvhhP3Y0k=; b=NbBZ6lx7tNTZiye5SRFC+kP7Cpgy+g40mRk5oyQ+olBUeqmOLn3M/n2R3+Y3a/x3hpn/UX lJ2/VFB+V3RKAqd2B9DopNWNkzMpt6LaHp7kTz80eJkrNxO0JQfHJ/Mg2Rc8/U+oSr2J6P tNiLucOb4H8K6Fn4ZyAqdAKR+/QlZZw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-wopHcyHHM3CN8SeSxZk0IQ-1; Sat, 06 Apr 2024 09:58:39 -0400 X-MC-Unique: wopHcyHHM3CN8SeSxZk0IQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4823685A588; Sat, 6 Apr 2024 13:58:39 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id B30972166B33; Sat, 6 Apr 2024 13:58:38 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 1/2] ACPI: x86: utils: Mark SMO8810 accel on Dell XPS 15 9550 as always present Date: Sat, 6 Apr 2024 15:56:24 +0200 Message-ID: <20240406135625.17118-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 The Dell XPS 15 9550 has a SMO8110 accelerometer / HDD freefall sensor which is wrongly marked as not present. Mark this as always present so that the dell-smo8800 driver can bind to it. Signed-off-by: Hans de Goede --- drivers/acpi/x86/utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 90c3d2eab9e9..c7af2d2986fd 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -100,6 +100,15 @@ static const struct override_status_id override_status_ids[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7139"), }), + /* + * The Dell XPS 15 9550 has a SMO8110 accelerometer / + * HDD freefall sensor which is wrongly marked as not present. + */ + PRESENT_ENTRY_HID("SMO8810", "1", SKYLAKE, { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "XPS 15 9550"), + }), + /* * The GPD win BIOS dated 20170221 has disabled the accelerometer, the * drivers sometimes cause crashes under Windows and this is how the From patchwork Sat Apr 6 13:56:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13619835 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66EF1374CB for ; Sat, 6 Apr 2024 13:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712411929; cv=none; b=T3UHRm+zbduw41mFZIoLBrv9yec7v8OxSWFVWOPcNdOfynVjR1fxEh7LZCdo4vEuPJwnYowXJjKt5czx5oA7daNBuRoN2xtCJtlQaIuOD/U1MkHIYr3Ivor7UeS++hPlUleS8zl8CniPlYFlFnct8DNqWZ8jrz1E5Tw1rVfyf4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712411929; c=relaxed/simple; bh=VSv5gj1fpasA6OAH42v+ZLQWRflyN1cDesP19TN1+2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bgm4JPEvN5SIaLJp0hUfzZ98buO6HcK6GkWfLQCM0Ia5p5XaP5tb9AYtvLerqrPs0Kj8DftbDvN8ZMUnlqcoD8SVDr3kZwsUrHAUwH2YX1DnARVnPRgzxxun6e0OUnPp0ut+KF7G3sp07rPDGUr+r8Xaa7ezXLiq7Osp42aZN84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OR4fMOOZ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OR4fMOOZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712411926; 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=4KO9X/hL2SBHkMpPGYgWLQ96QHWUrA4BtG8ntWAhueQ=; b=OR4fMOOZvVHWPHTfQpApDzrcLi3kFOCXqsKaUf8DBpuVkEjERY/ngTrjTuKVl7NLpTBMgn HIw5Q9Ph/XFneGP8hV7oK+tddsfs9YDDDh5mCz7yskjmHHOtQqLGvaZ+K8yAN986HVdaYp TEpTFbXVZj6tSMFq3oWTgZo1eBP+puE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-NJ461txNNMGf2JvaDqV95g-1; Sat, 06 Apr 2024 09:58:40 -0400 X-MC-Unique: NJ461txNNMGf2JvaDqV95g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09A0C8007A1; Sat, 6 Apr 2024 13:58:40 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78F482166B35; Sat, 6 Apr 2024 13:58:39 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 2/2] ACPI: x86: Add PNP_UART1_SKIP quirk for Lenovo Blade2 tablets Date: Sat, 6 Apr 2024 15:56:25 +0200 Message-ID: <20240406135625.17118-2-hdegoede@redhat.com> In-Reply-To: <20240406135625.17118-1-hdegoede@redhat.com> References: <20240406135625.17118-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 The x86 Android tablets on which quirks to skip looking for a matching UartSerialBus resource and instead unconditionally create a serial bus device (serdev) are necessary there are 2 sorts of serialports: ACPI enumerated highspeed designware UARTs, these are the ones which typcially need to be skipped since they need a serdev for the attached BT HCI. A PNP enumerated UART which is part of the PCU. So far the existing quirks have ignored this. But on the Lenovo Yoga Tablet 2 Pro 1380 models this is used for a custom fastcharging protocol. There is a Micro USB switch which can switch the USB data lines to this uart and then a 600 baud protocol is used to configure the charger for a voltage higher then 5V. Add a new ACPI_QUIRK_PNP_UART1_SKIP quirk type and set this for the existing entry for the Lenovo Yoga Tablet 2 830 / 1050 models. Note this will lead to unnecessarily also creating a serdev for the PCU UART on the 830 / 1050 which don't need this, but the UART is not used otherwise there so that is not a problem. Signed-off-by: Hans de Goede --- drivers/acpi/x86/utils.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index c7af2d2986fd..7dca73417e2b 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -269,9 +269,10 @@ bool force_storage_d3(void) #define ACPI_QUIRK_SKIP_I2C_CLIENTS BIT(0) #define ACPI_QUIRK_UART1_SKIP BIT(1) #define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(2) -#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(3) -#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(4) -#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(5) +#define ACPI_QUIRK_PNP_UART1_SKIP BIT(3) +#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(4) +#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(5) +#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(6) static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { /* @@ -351,6 +352,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), }, .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | + ACPI_QUIRK_PNP_UART1_SKIP | ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), }, { @@ -449,14 +451,18 @@ static int acpi_dmi_skip_serdev_enumeration(struct device *controller_parent, bo if (ret) return 0; - /* to not match on PNP enumerated debug UARTs */ - if (!dev_is_platform(controller_parent)) - return 0; - dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids); if (dmi_id) quirks = (unsigned long)dmi_id->driver_data; + if (!dev_is_platform(controller_parent)) { + /* PNP enumerated UARTs */ + if ((quirks & ACPI_QUIRK_PNP_UART1_SKIP) && uid == 1) + *skip = true; + + return 0; + } + if ((quirks & ACPI_QUIRK_UART1_SKIP) && uid == 1) *skip = true;