From patchwork Mon Apr 1 03:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612482 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3AD5F7F; Mon, 1 Apr 2024 03:01:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940473; cv=none; b=B9vU0NNZ4Ktaar4PjnGlQf0wLMvckQbPZwjig+1TqDk6YDANmH7erCFIKTxc9qlumH8eA8NG+hqnSAu67Lo+NEO54ccZ88f6fOI4xZbnVrGmOWfG9vP9l+rukdS1QEsf/CJzng0BtWsVEHZZuf3iAgxxogXY1Y4EtjFhIK/+WhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940473; c=relaxed/simple; bh=e0C3uXZCQKhBltbJhXyTZt3YJk6LWIsw+HanZYDGaWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J9QJCttqfTTibji5H/IDV9khZ9ayz7QHQHmMi2FoTK9wRe0nsWV/F3yfHYyii1q4O04eMfkvXqCKOU7Hud94swGzod7KjMLOUP1TGP7W0RZ9UuzHt1EzSOAJJft/p7/EEt/hy3ywVF4gnYqo8ikn9cJGaeT2f/xRFkrjyDBAqSY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J3owk23/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J3owk23/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79472C433B1; Mon, 1 Apr 2024 03:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940472; bh=e0C3uXZCQKhBltbJhXyTZt3YJk6LWIsw+HanZYDGaWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J3owk23/gHwCL+OoZQzgtQa1QLuBX1IWSpzj2fExeV/B1UVRQop4CfmI8Tp0Ja2Mq 1ZUc/qzmhln3XaZTlWvsHBQpM9haeJQ4bcGBAWxh4toBozNlj9q9yTZO0/hopgCvP4 J9PqN/xIKTDqf5L6DCOzThqP/LjUBf1aUIUO/zBxMZ+55sjmi5t0wvHJu/RbjCmUd6 PapPAxG/nk7A9ug6bNrd+QODV2sdYQoOFVFHNpFLqJL/2sEgoF7CSEgxJefIGPchqy RAY45FqpgU6uWdAosVK7gwDDN5OKy2QA9CBsNHrCk3rn1a8vVlwnkTdS7R3bMr7LGX nSn6I8EPxlawg== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 1/6] media: platform: cros-ec: provide ID table for avoiding fallback match Date: Mon, 1 Apr 2024 11:00:47 +0800 Message-ID: <20240401030052.2887845-2-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tzung-Bi Shih --- Changes from v1: - No code changes. - Add R-b tags. drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c index 48ed2993d2f0..8fbbb4091455 100644 --- a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c +++ b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -573,6 +574,12 @@ static void cros_ec_cec_remove(struct platform_device *pdev) } } +static const struct platform_device_id cros_ec_cec_id[] = { + { DRV_NAME, 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, cros_ec_cec_id); + static struct platform_driver cros_ec_cec_driver = { .probe = cros_ec_cec_probe, .remove_new = cros_ec_cec_remove, @@ -580,6 +587,7 @@ static struct platform_driver cros_ec_cec_driver = { .name = DRV_NAME, .pm = &cros_ec_cec_pm_ops, }, + .id_table = cros_ec_cec_id, }; module_platform_driver(cros_ec_cec_driver); @@ -587,4 +595,3 @@ module_platform_driver(cros_ec_cec_driver); MODULE_DESCRIPTION("CEC driver for ChromeOS ECs"); MODULE_AUTHOR("Neil Armstrong "); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon Apr 1 03:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612483 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D85B69444; Mon, 1 Apr 2024 03:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940476; cv=none; b=m13c+oA67RbnDiT5cvqUs+6zgga7jqWbfjI6aqf7Oi047DTsOxqTjZXP25cznGJc0pdso29opQXjLink6DBLkjzBgWg1htrzq1vSYhR2zjOnrb+Loj+m6PJuiHRzLKWUEahqWgeOKplUYsm4pfASGOwE33j5JhxLs4YFPd0pPco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940476; c=relaxed/simple; bh=sIWuWcJLnkR80gZ4RYZ2oWSIHilGYeXqbxT24GsMd7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fJ1nKd7oSHNWLt9kRq+iHnrQWGoa2+M2ts92yKbVGLxuBC5CWhCsgU4UfUIYrLlk4Pz848g7AoZ/RXZPZe0gD/j834B4GmPnJ3V9W4hVcjeWkR0YwfHwfXMUaanBHQJe2maBfCnWUBeIjZOhks0ngIowtyH03CT/yZ0H3IZ5vxA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rjhUsO4J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rjhUsO4J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18265C43390; Mon, 1 Apr 2024 03:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940475; bh=sIWuWcJLnkR80gZ4RYZ2oWSIHilGYeXqbxT24GsMd7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rjhUsO4JCytAgyUS0TbNKqGQxTICFLVZM12SwBwR8hWvoYz+Dpg886bWhYGhWa5In JvBcpShd7UvFRAiphxrEUfyPCFafL1Edkxd1wd0X6aOfgKHFQyFSKK+kak9YHpPZbg yObEfECRmDFJ5NkgeYi+X9VJK40YFRmz7ICf/ir9IzPtJTn/ufI+w1b5aFGKOIotVn jejvF3a/GOM07Yv0y1OKtsZdef5/7gsxnDYYqih+BTRltoTJtRUcx5mPtYp/SPfUC9 c+pyPgJZNGKQdXUKVC0IZ6mdizN0lRJWGzz/fmhnDaJSp3duzttLpXDyrhe8ru1tOS FXNmKTNecGS1Q== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 2/6] gpio: cros-ec: provide ID table for avoiding fallback match Date: Mon, 1 Apr 2024 11:00:48 +0800 Message-ID: <20240401030052.2887845-3-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of using fallback driver name match, provide ID table[1] for the primary match. Also allow automatic module loading by adding MODULE_DEVICE_TABLE(). [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tzung-Bi Shih --- Changes from v1: - No code changes. - Add R-b tags. drivers/gpio/gpio-cros-ec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpio/gpio-cros-ec.c b/drivers/gpio/gpio-cros-ec.c index 842e1c060414..0c09bb54dc0c 100644 --- a/drivers/gpio/gpio-cros-ec.c +++ b/drivers/gpio/gpio-cros-ec.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -197,11 +198,18 @@ static int cros_ec_gpio_probe(struct platform_device *pdev) return devm_gpiochip_add_data(dev, gc, cros_ec); } +static const struct platform_device_id cros_ec_gpio_id[] = { + { "cros-ec-gpio", 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, cros_ec_gpio_id); + static struct platform_driver cros_ec_gpio_driver = { .probe = cros_ec_gpio_probe, .driver = { .name = "cros-ec-gpio", }, + .id_table = cros_ec_gpio_id, }; module_platform_driver(cros_ec_gpio_driver); From patchwork Mon Apr 1 03:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612484 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5A3A09479; Mon, 1 Apr 2024 03:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940478; cv=none; b=JouRWj3O+eSDTRCW5qoYfzgBLHxQklUhOHn1WF+pL55zCCZJu0EOLxGL4gMoh+oIOWnXwaSRAuyzRxLl/qOU5bl4BN9MZHgkyiJJwKZWx5MW1+WxnXVKZHy/yxAl5B91z15mpcP6EbyuI5U64wA8pYpILI+9hZgaoarxSz9oD/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940478; c=relaxed/simple; bh=4ygibtdsXHmh6yImp9+dJnz+FeRFzVHcQC/vXMVmzw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SWHcT4d/WK7ysymB/sWtaMulCMd/BNxrAwYbHQdjHZJfXbPvhuI/CWL+Gsp021XZcC7+5a/QOb/blwL1JGIfyZqOtOIr6Z5iWoe0oCZW8KcNqd0NXoIoD5GwlU82QBvIbLQdgW+54dt/eAq9GxEmUNmVyX2uiikUdSwAooqOF/o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mebPtSk0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mebPtSk0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9BADC433C7; Mon, 1 Apr 2024 03:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940477; bh=4ygibtdsXHmh6yImp9+dJnz+FeRFzVHcQC/vXMVmzw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mebPtSk0wpcjcPQXHOz8Y1t+WhXzZzXMH2Z9UOnJ1ZWIEOq1Fcu7UmFtglVIoriWe Uwq35FjC6fi2bX6dJi9OagYNPQ8egNJtvBgHbU6ZUqPBRz5+Y2a0Oq2yh+ZAuqqUfn noDu8tHmEUfQEN8yExP2o3ZE2JMRZSModdcQZlgp42MEco/p97kc3lHv/e4fpbBSg3 3xSzYaVID6wWiqmWe8gbMtit6G1s0fxcYCIhnTBae4BBIoBHyODelPMwXCjTXDgAPI B8HdK/54OvslIiX5uhzW6wsDdjlIOCMc5Ip4cky0OsXVYQ5aAA7nShBvDUl+T6Zowv Y1qRVabPWEhsA== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org, Krzysztof Kozlowski Subject: [PATCH v2 3/6] power: supply: cros_usbpd: provide ID table for avoiding fallback match Date: Mon, 1 Apr 2024 11:00:49 +0800 Message-ID: <20240401030052.2887845-4-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung Reviewed-by: Prashant Malani Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tzung-Bi Shih --- Changes from v1: - No code changes. - Add R-b tags. drivers/power/supply/cros_usbpd-charger.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c index b6c96376776a..8008e31c0c09 100644 --- a/drivers/power/supply/cros_usbpd-charger.c +++ b/drivers/power/supply/cros_usbpd-charger.c @@ -5,6 +5,7 @@ * Copyright (c) 2014 - 2018 Google, Inc */ +#include #include #include #include @@ -711,16 +712,22 @@ static int cros_usbpd_charger_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL, cros_usbpd_charger_resume); +static const struct platform_device_id cros_usbpd_charger_id[] = { + { DRV_NAME, 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id); + static struct platform_driver cros_usbpd_charger_driver = { .driver = { .name = DRV_NAME, .pm = &cros_usbpd_charger_pm_ops, }, - .probe = cros_usbpd_charger_probe + .probe = cros_usbpd_charger_probe, + .id_table = cros_usbpd_charger_id, }; module_platform_driver(cros_usbpd_charger_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("ChromeOS EC USBPD charger"); -MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon Apr 1 03:00:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612485 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8E1F9BA2B; Mon, 1 Apr 2024 03:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940480; cv=none; b=GmmSgQNieDcpEJgXXHT7EmCKab9p55xTo3dyxx1ELgGzcydXoG48WCc1q4pDcN0myhFx7KW2kCI4kJ+dNofDDTCMCGRoRRWc2lwQxxw6uyQlqw5gLOPvWRXNNwvWYZHJI8s6GFI0NwPZ3VX61s4kE/K0xXl64RFn35AeeToectQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940480; c=relaxed/simple; bh=II3WcklFT4vc71YiPvas+ZBSQTksCjF6+Z2zutxVTko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ogwhL3d339iyRToWyj9xUtKoVm92+0tZ0od7cfxXIwFaRwJ74dIJWS8IziPtBGRGUQUdelDBgO+YQc5iVjgjjaEQllbkW/p1MOWNTicEEDGav4ODnqaJexmAQHLEEuFro/rI8SVCDj49gnDsFqgo9Jzi5Z17TERZwW8qH6uM0IM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GF4fw1X3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GF4fw1X3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47446C433B1; Mon, 1 Apr 2024 03:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940480; bh=II3WcklFT4vc71YiPvas+ZBSQTksCjF6+Z2zutxVTko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GF4fw1X3ESSa7gfymTe/8l6qGIHFGrBnZH6rv5zv5QBZvKg+JlUqyfv1+kxKdv8O/ NQLls838EZSNwy0zqx1JZkrMJNlgkgNEyt35sRIAZ/9NKMn67L8jUntoMBo+YjA4km 9kgX8txtopFF0b8SM4+ywvcQtNMZ8m4ht8NgWI+T9BJJW4ISjSnBrUUB4avlMt0nl7 6FbvnxpK0ICJFibJ3jG4qRgR+7646Je16gOWKS8RENeUl08yLmYl4y2KsZsIXn9Fz5 cEQ51uIeJBu4O5xZNg30Kg72uaCP/OiO3bwA+3Rv/9vnAH6kYvxjH6AZJC/RxX8KfK D7dWqzg4x4WEw== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org Subject: [PATCH v2 4/6] power: supply: cros_pchg: provide ID table for avoiding fallback match Date: Mon, 1 Apr 2024 11:00:50 +0800 Message-ID: <20240401030052.2887845-5-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tzung-Bi Shih --- Changes from v1: - No code changes. - Add R-b tags. drivers/power/supply/cros_peripheral_charger.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/cros_peripheral_charger.c b/drivers/power/supply/cros_peripheral_charger.c index a204f2355be4..d406f2a78449 100644 --- a/drivers/power/supply/cros_peripheral_charger.c +++ b/drivers/power/supply/cros_peripheral_charger.c @@ -5,6 +5,7 @@ * Copyright 2020 Google LLC. */ +#include #include #include #include @@ -367,16 +368,22 @@ static int __maybe_unused cros_pchg_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(cros_pchg_pm_ops, NULL, cros_pchg_resume); +static const struct platform_device_id cros_pchg_id[] = { + { DRV_NAME, 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, cros_pchg_id); + static struct platform_driver cros_pchg_driver = { .driver = { .name = DRV_NAME, .pm = &cros_pchg_pm_ops, }, - .probe = cros_pchg_probe + .probe = cros_pchg_probe, + .id_table = cros_pchg_id, }; module_platform_driver(cros_pchg_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("ChromeOS EC peripheral device charger"); -MODULE_ALIAS("platform:" DRV_NAME); From patchwork Mon Apr 1 03:00:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612486 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 01E9C28FD; Mon, 1 Apr 2024 03:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940483; cv=none; b=fzF92WM8pst6KRF+o3aJXu+bCXHXJ0j4YmMLgVSBLfMF35WahK8UGPbOPdwKD3wT1md0D6dpIecazZtI7BHEF43Y+trpQgJNH4D/Wz6igTaKoWK6dLwRlqpg6ZwLZD6SnwW8ySX7D0zQs5aL02Xl6TmQ3u4z7FMPRrq+AXDSiK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940483; c=relaxed/simple; bh=U2QyvRi4B4O/vWCYyQuc0N4V9PTSI3JDLev+EAurHcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u4bVxROSN0C5hbMvxqYxqTjr677byKUrMwB54ZOq6IinIAbaXlgRugHx5gKK5ZnQ2GNQWWLx9mg7Omlm2V8Ddj8q+5KCiRRl/p3hk8EkjctN/a8j54PePf078xYjY0lwtdrxQXctoOxxTNnh+/qIepBLNlH3ZPBWcBOoyz3oInc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gurkVG5E; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gurkVG5E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBEB7C43141; Mon, 1 Apr 2024 03:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940482; bh=U2QyvRi4B4O/vWCYyQuc0N4V9PTSI3JDLev+EAurHcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gurkVG5E5VfHJui8kssoMJTVD7Q5C8e6ZcAoIM04tzEq/h2FwtduC3rA6RGoqze5n 4ivdegU3juNCUi3nJFGpZX+AloPaFgFIORb90k3wcwySuXeREByG5/ssRyU5rLyMXb iaQco4Y++BniFAdkYVjBwJSacHiSS7iAnBS5hO6kd/ZNrMefE/AyQVZ8u0kXosDz7o CtNilghSYgVRwIbdakSQ9Yy6OZXYv/geBUG1jR/gki700Q5vsBSsIq6qqJ+nlN/JdL SLKbXiYeK71y/IC3pilXTMb7Dc1e9nZCPL/S/b+Tu5U35v0+LsElkENvQwCCadaLHP +0BMOJqrulkyw== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org Subject: [PATCH v2 5/6] platform/chrome: cros_kbd_led_backlight: shrink the driver name Date: Mon, 1 Apr 2024 11:00:51 +0800 Message-ID: <20240401030052.2887845-6-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Prepare to provide platform_device_id table. Shrink the driver name for fitting to [1]. [1]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608 Reviewed-by: Benson Leung Signed-off-by: Tzung-Bi Shih --- Changes from v1 (https://patchwork.kernel.org/project/chrome-platform/patch/20240329075630.2069474-15-tzungbi@kernel.org/): - Split from "platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match". - Add R-b tags. drivers/platform/chrome/cros_kbd_led_backlight.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c index 793fd3f1015d..814846a66e95 100644 --- a/drivers/platform/chrome/cros_kbd_led_backlight.c +++ b/drivers/platform/chrome/cros_kbd_led_backlight.c @@ -249,7 +249,7 @@ MODULE_DEVICE_TABLE(of, keyboard_led_of_match); static struct platform_driver keyboard_led_driver = { .driver = { - .name = "chromeos-keyboard-leds", + .name = "cros-keyboard-leds", .acpi_match_table = ACPI_PTR(keyboard_led_acpi_match), .of_match_table = of_match_ptr(keyboard_led_of_match), }, @@ -260,4 +260,4 @@ module_platform_driver(keyboard_led_driver); MODULE_AUTHOR("Simon Que "); MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:chromeos-keyboard-leds"); +MODULE_ALIAS("platform:cros-keyboard-leds"); From patchwork Mon Apr 1 03:00:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 13612487 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BBEDE522E; Mon, 1 Apr 2024 03:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940485; cv=none; b=Ew/dDYgP1u658KvLkd2a8g9GT11A+sQHj1eE6rn9L0I0GUt30sp9Se2h70ONnX+eQxkxCaGfiUSs0tNoO58z9m7VEEJdbwVDd2v9uNNLc3BLpTPAkXFbz44e4/OFmse5Q1aRJfnSDZlaNtwlADqCSzcjkxBJK2aBXLVJ/DldxCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711940485; c=relaxed/simple; bh=A+qPC2CmbjWZ3WbNj/6Wuu/Fd+PX1XeYGNBZm8njWhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W8hiZyoGR9reJBddGZJynLcZvK7PdZNDPD1oBNTzvV5HmBTFbVzawcHWbXN1GyKtorKbkKyjHyOPMRYLdRF9Yyc3OuTKu6xbwXtrJdYVga80zqF6BseKwdQjNSb5+Xedm2YWjVmXIfF1+XLW7iNYcJYBLGii7GbGEq4INBnzxW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BaUjs4a2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BaUjs4a2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B07FC433A6; Mon, 1 Apr 2024 03:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711940485; bh=A+qPC2CmbjWZ3WbNj/6Wuu/Fd+PX1XeYGNBZm8njWhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaUjs4a2yxCB/+gsFIjoaChWfPRPIjedHabjlZvIjm17ePfktlRvz1lY7OTPRHopO BsKz8RnHcsDeb1vhCBK7A1OA25kLiWy5zxokzfhWfDub1EaNEnMQnA5Z56HE7eOeUG gO+ZIu9FexgO6CLqdE2qx4Oqgws9Y5ePQ9Z/UyRdkWJUZ5I1IvCGbJ+8YjALQSYw2m JtamcEKOuT18h3L/daQ4ODBu4X5U585uc+zqV6BLElUfwcsEp59ZJu/hHw9YWCP44j rCSkaDfvFutYKHOo6cE/cq5DRgCJrqR6nX7wU09aXWOXX7NuuomJ7KTkOxg5HcyHHK 4MDCe/BnTsfww== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org, linus.walleij@linaro.org, brgl@bgdev.pl, hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev, pmalani@chromium.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, linux-pm@vger.kernel.org, krzk@kernel.org Subject: [PATCH v2 6/6] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match Date: Mon, 1 Apr 2024 11:00:52 +0800 Message-ID: <20240401030052.2887845-7-tzungbi@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org> References: <20240401030052.2887845-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung Signed-off-by: Tzung-Bi Shih Reviewed-by: Krzysztof Kozlowski --- Changes from v1 (https://patchwork.kernel.org/project/chrome-platform/patch/20240329075630.2069474-15-tzungbi@kernel.org/): - Split from "platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match". - Add R-b tags. drivers/platform/chrome/cros_kbd_led_backlight.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c index 814846a66e95..b83e4f328620 100644 --- a/drivers/platform/chrome/cros_kbd_led_backlight.c +++ b/drivers/platform/chrome/cros_kbd_led_backlight.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -247,6 +248,12 @@ static const struct of_device_id keyboard_led_of_match[] = { MODULE_DEVICE_TABLE(of, keyboard_led_of_match); #endif +static const struct platform_device_id keyboard_led_id[] = { + { "cros-keyboard-leds", 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, keyboard_led_id); + static struct platform_driver keyboard_led_driver = { .driver = { .name = "cros-keyboard-leds", @@ -254,10 +261,10 @@ static struct platform_driver keyboard_led_driver = { .of_match_table = of_match_ptr(keyboard_led_of_match), }, .probe = keyboard_led_probe, + .id_table = keyboard_led_id, }; module_platform_driver(keyboard_led_driver); MODULE_AUTHOR("Simon Que "); MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:cros-keyboard-leds");