Commit e1a7752c authored by Lee Jones's avatar Lee Jones Committed by Martin K. Petersen

scsi: ufs-qcom: Add support for platforms booting ACPI

New Qualcomm AArch64 based laptops are now available which use UFS as their
primary data storage medium.  These devices are supplied with ACPI support
out of the box.  This patch ensures the Qualcomm UFS driver will be bound
when the "QCOM24A5" H/W device is advertised as present.
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e58ed500
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* *
*/ */
#include <linux/acpi.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -170,6 +171,9 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host) ...@@ -170,6 +171,9 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host)
int err = 0; int err = 0;
struct device *dev = host->hba->dev; struct device *dev = host->hba->dev;
if (has_acpi_companion(dev))
return 0;
err = ufs_qcom_host_clk_get(dev, "rx_lane0_sync_clk", err = ufs_qcom_host_clk_get(dev, "rx_lane0_sync_clk",
&host->rx_l0_sync_clk, false); &host->rx_l0_sync_clk, false);
if (err) if (err)
...@@ -1136,9 +1140,13 @@ static int ufs_qcom_init(struct ufs_hba *hba) ...@@ -1136,9 +1140,13 @@ static int ufs_qcom_init(struct ufs_hba *hba)
__func__, err); __func__, err);
goto out_variant_clear; goto out_variant_clear;
} else if (IS_ERR(host->generic_phy)) { } else if (IS_ERR(host->generic_phy)) {
err = PTR_ERR(host->generic_phy); if (has_acpi_companion(dev)) {
dev_err(dev, "%s: PHY get failed %d\n", __func__, err); host->generic_phy = NULL;
goto out_variant_clear; } else {
err = PTR_ERR(host->generic_phy);
dev_err(dev, "%s: PHY get failed %d\n", __func__, err);
goto out_variant_clear;
}
} }
err = ufs_qcom_bus_register(host); err = ufs_qcom_bus_register(host);
...@@ -1608,6 +1616,14 @@ static const struct of_device_id ufs_qcom_of_match[] = { ...@@ -1608,6 +1616,14 @@ static const struct of_device_id ufs_qcom_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, ufs_qcom_of_match); MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id ufs_qcom_acpi_match[] = {
{ "QCOM24A5" },
{ },
};
MODULE_DEVICE_TABLE(acpi, ufs_qcom_acpi_match);
#endif
static const struct dev_pm_ops ufs_qcom_pm_ops = { static const struct dev_pm_ops ufs_qcom_pm_ops = {
.suspend = ufshcd_pltfrm_suspend, .suspend = ufshcd_pltfrm_suspend,
.resume = ufshcd_pltfrm_resume, .resume = ufshcd_pltfrm_resume,
...@@ -1624,6 +1640,7 @@ static struct platform_driver ufs_qcom_pltform = { ...@@ -1624,6 +1640,7 @@ static struct platform_driver ufs_qcom_pltform = {
.name = "ufshcd-qcom", .name = "ufshcd-qcom",
.pm = &ufs_qcom_pm_ops, .pm = &ufs_qcom_pm_ops,
.of_match_table = of_match_ptr(ufs_qcom_of_match), .of_match_table = of_match_ptr(ufs_qcom_of_match),
.acpi_match_table = ACPI_PTR(ufs_qcom_acpi_match),
}, },
}; };
module_platform_driver(ufs_qcom_pltform); module_platform_driver(ufs_qcom_pltform);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment