* [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI
@ 2019-06-17 11:54 Lee Jones
2019-06-18 16:46 ` Ard Biesheuvel
2019-06-19 2:57 ` Martin K. Petersen
0 siblings, 2 replies; 4+ messages in thread
From: Lee Jones @ 2019-06-17 11:54 UTC (permalink / raw)
To: agross, david.brown, alim.akhtar, avri.altman, pedrom.sousa,
jejb, martin.petersen, linux-arm-msm, linux-scsi
Cc: linux-arm-kernel, linux-kernel, ard.biesheuvel, jlhugo,
bjorn.andersson, Lee Jones
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: Lee Jones <lee.jones@linaro.org>
---
drivers/scsi/ufs/ufs-qcom.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 3aeadb14aae1..364af6a63e35 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -12,6 +12,7 @@
*
*/
+#include <linux/acpi.h>
#include <linux/time.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -164,6 +165,9 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host)
int err = 0;
struct device *dev = host->hba->dev;
+ if (has_acpi_companion(dev))
+ return 0;
+
err = ufs_qcom_host_clk_get(dev, "rx_lane0_sync_clk",
&host->rx_l0_sync_clk, false);
if (err)
@@ -1208,9 +1212,13 @@ static int ufs_qcom_init(struct ufs_hba *hba)
__func__, err);
goto out_variant_clear;
} else if (IS_ERR(host->generic_phy)) {
- err = PTR_ERR(host->generic_phy);
- dev_err(dev, "%s: PHY get failed %d\n", __func__, err);
- goto out_variant_clear;
+ if (has_acpi_companion(dev)) {
+ host->generic_phy = NULL;
+ } 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);
@@ -1680,6 +1688,14 @@ static const struct of_device_id 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 = {
.suspend = ufshcd_pltfrm_suspend,
.resume = ufshcd_pltfrm_resume,
@@ -1696,6 +1712,7 @@ static struct platform_driver ufs_qcom_pltform = {
.name = "ufshcd-qcom",
.pm = &ufs_qcom_pm_ops,
.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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI
2019-06-17 11:54 [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI Lee Jones
@ 2019-06-18 16:46 ` Ard Biesheuvel
2019-06-19 2:57 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2019-06-18 16:46 UTC (permalink / raw)
To: Lee Jones
Cc: agross, David Brown, alim.akhtar, avri.altman, pedrom.sousa,
jejb, Martin K. Petersen, linux-arm-msm, linux-scsi,
linux-arm-kernel, Linux Kernel Mailing List, Jeffrey Hugo,
Bjorn Andersson
On Mon, 17 Jun 2019 at 13:55, Lee Jones <lee.jones@linaro.org> wrote:
>
> 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: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 3aeadb14aae1..364af6a63e35 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -12,6 +12,7 @@
> *
> */
>
> +#include <linux/acpi.h>
> #include <linux/time.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> @@ -164,6 +165,9 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host)
> int err = 0;
> struct device *dev = host->hba->dev;
>
> + if (has_acpi_companion(dev))
> + return 0;
> +
> err = ufs_qcom_host_clk_get(dev, "rx_lane0_sync_clk",
> &host->rx_l0_sync_clk, false);
> if (err)
> @@ -1208,9 +1212,13 @@ static int ufs_qcom_init(struct ufs_hba *hba)
> __func__, err);
> goto out_variant_clear;
> } else if (IS_ERR(host->generic_phy)) {
> - err = PTR_ERR(host->generic_phy);
> - dev_err(dev, "%s: PHY get failed %d\n", __func__, err);
> - goto out_variant_clear;
> + if (has_acpi_companion(dev)) {
> + host->generic_phy = NULL;
> + } 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);
> @@ -1680,6 +1688,14 @@ static const struct of_device_id 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 = {
> .suspend = ufshcd_pltfrm_suspend,
> .resume = ufshcd_pltfrm_resume,
> @@ -1696,6 +1712,7 @@ static struct platform_driver ufs_qcom_pltform = {
> .name = "ufshcd-qcom",
> .pm = &ufs_qcom_pm_ops,
> .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);
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI
2019-06-17 11:54 [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI Lee Jones
2019-06-18 16:46 ` Ard Biesheuvel
@ 2019-06-19 2:57 ` Martin K. Petersen
2019-06-19 5:42 ` Lee Jones
1 sibling, 1 reply; 4+ messages in thread
From: Martin K. Petersen @ 2019-06-19 2:57 UTC (permalink / raw)
To: Lee Jones
Cc: agross, david.brown, alim.akhtar, avri.altman, pedrom.sousa,
jejb, martin.petersen, linux-arm-msm, linux-scsi,
linux-arm-kernel, linux-kernel, ard.biesheuvel, jlhugo,
bjorn.andersson
Lee,
> 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.
Applied to 5.3/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI
2019-06-19 2:57 ` Martin K. Petersen
@ 2019-06-19 5:42 ` Lee Jones
0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2019-06-19 5:42 UTC (permalink / raw)
To: Martin K. Petersen
Cc: agross, david.brown, alim.akhtar, avri.altman, pedrom.sousa,
jejb, linux-arm-msm, linux-scsi, linux-arm-kernel, linux-kernel,
ard.biesheuvel, jlhugo, bjorn.andersson
Ard, Martin,
On Tue, 18 Jun 2019, Martin K. Petersen wrote:
> > 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.
>
> Applied to 5.3/scsi-queue. Thanks!
Ideal. Thanks for your help.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-19 5:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 11:54 [PATCH 1/1] scsi: ufs-qcom: Add support for platforms booting ACPI Lee Jones
2019-06-18 16:46 ` Ard Biesheuvel
2019-06-19 2:57 ` Martin K. Petersen
2019-06-19 5:42 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).