From patchwork Thu May 12 09:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Hui Lee X-Patchwork-Id: 1630049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=rclVhgaS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KzRjQ4kJXz9sGh for ; Thu, 12 May 2022 19:45:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1np5O4-0005Tt-4R; Thu, 12 May 2022 09:45:36 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1np5O2-0005Qu-8f for kernel-team@lists.ubuntu.com; Thu, 12 May 2022 09:45:34 +0000 Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (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 smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E3F993F21D for ; Thu, 12 May 2022 09:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652348733; bh=B7DrwQx0aXVcm8dIvdeNZfUPJvzL0Vj/Y5dJdBCTois=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rclVhgaSl+qZL5DMBEIcZm0l+p7PRwybbBl0jDsW4xVS/2f8Q+kdVuvGEkZlkcNC8 s1/u5Gt0k0T8b75almMAn8O7dt4+XFu8JRAjobq0dstul43Y8CSNudE0v5OAmUGekb GKXw6uyiH/3u3ZgotuDT8BNKA/H5ZoJr6Etfl2P2iDhyNeLLgEreo1r33J0hFvkvhK emNW5yh8PWZ3U+68vSIF/vBfrmDz7oy+e831r+InsEPBHiZEDqbQOmZIu6PjrNVr7Z qoBiMY/4QUPq4iSMOD5JwKfLI0UnpLASqPNym4Yr07w7PZWMLfdbn7qWnRj+hg3vPk mBwYLAMfY5mdw== Received: by mail-pj1-f69.google.com with SMTP id z24-20020a17090ab11800b001dd239fc177so2198207pjq.0 for ; Thu, 12 May 2022 02:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B7DrwQx0aXVcm8dIvdeNZfUPJvzL0Vj/Y5dJdBCTois=; b=NyWqIkWVEm7uKH3Z9JJKa+E6Ib03SpDBVnqUGd6k9lRJxcCzmcM8ani6GWTpiXVYEz we5GlE25zPmummmzA5QXcMJR12Hfh8whRYN4c34pSKhVsPs3kuckUhiSwphqc/2Nd8B2 cXZer5ilpFJQ2ms7aSGs/WuVlLvq2Wius9h8pjjU44kaMHD/b8Ne+RSfOJukkcwjKDtb WEIjSBeo9xAZ6pl8K/9qkaGBDi0Oa/MgNWOiCt5hpGV02A74BR9+M8YRxL99X2iegBOZ mAWnW+wwFWpTfvAHx6tDmHzK9wqqMMzpkG4LqGV+EhIOQqtEXHJ5FVGgsT/Qzb0KyN+G EZww== X-Gm-Message-State: AOAM532AJFD17B7C910ijKVVsD1kob9ZuoK39dh6kK2owtm84R125sjK 7BS75ysyp/2A0UQtsZwXihL80H9lpQfWTJsHEFl3J94co1FBwrBDRRWeSA7ffkNTgK+kKrm4eF8 aMj2LDqNSENmFN8ewat5BmPrM7Ryw2u2sIwxPbgISXg== X-Received: by 2002:a05:6a00:168a:b0:4f7:e161:83cd with SMTP id k10-20020a056a00168a00b004f7e16183cdmr29171723pfc.56.1652348732649; Thu, 12 May 2022 02:45:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMF+fIAeyVbaVKYf0dm5AugQSb2+23znFbQ8tXsvqR8EDp2eV89zpjbP2LER9+BxKL/7MdYw== X-Received: by 2002:a05:6a00:168a:b0:4f7:e161:83cd with SMTP id k10-20020a056a00168a00b004f7e16183cdmr29171694pfc.56.1652348732256; Thu, 12 May 2022 02:45:32 -0700 (PDT) Received: from localhost.localdomain (36-230-93-232.dynamic-ip.hinet.net. [36.230.93.232]) by smtp.gmail.com with ESMTPSA id 1-20020a630901000000b003c18e0768e3sm1458038pgj.78.2022.05.12.02.45.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 02:45:31 -0700 (PDT) From: Jian Hui Lee To: kernel-team@lists.ubuntu.com Subject: [SRU][Jammy:linux-intel-iotg][PATCH v2 05/10] iio: accel: adxl345: Add ACPI HID table Date: Thu, 12 May 2022 17:44:35 +0800 Message-Id: <20220512094440.15310-6-jianhui.lee@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512094440.15310-1-jianhui.lee@canonical.com> References: <20220512094440.15310-1-jianhui.lee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kai-Heng Feng BugLink: https://launchpad.net/bugs/1962674 x86 boards may use ACPI HID "ADS0345" for adxl345 device. Analog replied: "ADS034X is not a valid PNP ID. ADS0345 would be. I'm not aware that this ID is already taken. Feel free to submit a mainline Linux input mailing list patch." So add an ACPI match table for that accordingly. Since ACPI device may not match to any I2C ID, use the name and type directly from ACPI ID table in absence of I2C ID. Suggested-by: Andy Shevchenko Signed-off-by: Kai-Heng Feng Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220222090009.2060-5-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron (cherry picked from commit b9493d595226b598ed79b3769f7038fda1a5391b) Signed-off-by: Jian Hui Lee --- drivers/iio/accel/adxl345_i2c.c | 7 +++++++ drivers/iio/accel/adxl345_spi.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c index cfb6179d1152..90f471add84c 100644 --- a/drivers/iio/accel/adxl345_i2c.c +++ b/drivers/iio/accel/adxl345_i2c.c @@ -46,10 +46,17 @@ static const struct of_device_id adxl345_of_match[] = { MODULE_DEVICE_TABLE(of, adxl345_of_match); +static const struct acpi_device_id adxl345_acpi_match[] = { + { "ADS0345", ADXL345 }, + { } +}; +MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match); + static struct i2c_driver adxl345_i2c_driver = { .driver = { .name = "adxl345_i2c", .of_match_table = adxl345_of_match, + .acpi_match_table = adxl345_acpi_match, }, .remove = adxl345_i2c_remove, .probe_new = adxl345_i2c_probe, diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c index dbf0d538c1c1..3943c71db77a 100644 --- a/drivers/iio/accel/adxl345_spi.c +++ b/drivers/iio/accel/adxl345_spi.c @@ -52,10 +52,17 @@ static const struct of_device_id adxl345_of_match[] = { MODULE_DEVICE_TABLE(of, adxl345_of_match); +static const struct acpi_device_id adxl345_acpi_match[] = { + { "ADS0345", ADXL345 }, + { } +}; +MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match); + static struct spi_driver adxl345_spi_driver = { .driver = { .name = "adxl345_spi", .of_match_table = adxl345_of_match, + .acpi_match_table = adxl345_acpi_match, }, .probe = adxl345_spi_probe, .id_table = adxl345_spi_id,