Skip to contentSkip to conversation

spi: fsl-lpspi: fix indentation error

PATCH In review Gao Pan 2 participants 7 messages Jan 4, 2017 – Jan 18, 2017 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Gao Pan

author
#0 lore raw

PATCH 1/2 spi: fsl-lpspi: fix indentation error

This patch fixes the indentation error in spi-fsl-lpspi.c.

---
 drivers/spi/spi-fsl-lpspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-fsl-lpspi.c +3 -3
index 52551f6..8ec8f55 100644
@@ -512,9 +512,9 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
 
 static struct platform_driver fsl_lpspi_driver = {
 	.driver = {
-		   .name = DRIVER_NAME,
-		   .of_match_table = fsl_lpspi_dt_ids,
-		   },
+		.name = DRIVER_NAME,
+		.of_match_table = fsl_lpspi_dt_ids,
+	},
 	.probe = fsl_lpspi_probe,
 	.remove = fsl_lpspi_remove,
 };
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw

PATCH 2/2 spi: fsl-lpspi: add VLLS mode support

In reply to a message not in the archive

When system enters VLLS mode, module power is turned off. As a result, all registers are reset to HW default value. After exiting VLLS mode, registers are still in default mode. As a result, the pinctrl settings are incorrect, which will affect the module function.

The patch recovers the pinctrl setting when exit VLLS mode.

---
 drivers/spi/spi-fsl-lpspi.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/spi/spi-fsl-lpspi.c +22 -0
index 8ec8f55..8557728 100644
@@ -510,10 +510,32 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int fsl_lpspi_suspend(struct device *dev)
+{
+	pinctrl_pm_select_sleep_state(dev);
+
+	return 0;
+}
+
+static int fsl_lpspi_resume(struct device *dev)
+{
+	pinctrl_pm_select_default_state(dev);
+
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(imx_lpspi_pm, fsl_lpspi_suspend, fsl_lpspi_resume);
+#define IMX_LPSPI_PM    (&imx_lpspi_pm)
+#else
+#define IMX_LPSPI_PM    NULL
+#endif
+
 static struct platform_driver fsl_lpspi_driver = {
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = fsl_lpspi_dt_ids,
+		.pm = IMX_LPSPI_PM,
 	},
 	.probe = fsl_lpspi_probe,
 	.remove = fsl_lpspi_remove,
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

Re: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

In reply to a message not in the archive
Quoted 6 lines · Gao Pan

When system enters VLLS mode, module power is turned off. As a result, all registers are reset to HW default value. After exiting VLLS mode, registers are still in default mode. As a result, the pinctrl settings are incorrect, which will affect the module function.

The patch recovers the pinctrl setting when exit VLLS mode.

Why is this a change here and not in the pinctrl driver? It sounds like it's the pinctrl driver that's forgetting the settings and should be restoring them on resume but perhaps I'm missing something here.

#11 lore raw

Applied "spi: fsl-lpspi: fix indentation error" to the spi tree

In reply to a message not in the archive

The patch

spi: fsl-lpspi: fix indentation error

has been applied to the spi tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 102ecc471b9d2f41f10c586f077a0d8e853335f8 Mon Sep 17 00:00:00 2001

From: Gao Pan <[email protected]>
Date: Wed, 4 Jan 2017 17:38:16 +0800
Subject: [PATCH] spi: fsl-lpspi: fix indentation error

This patch fixes the indentation error in spi-fsl-lpspi.c.

---
 drivers/spi/spi-fsl-lpspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-fsl-lpspi.c +3 -3
index 2b93bc605b91..cb3c73007ca1 100644
@@ -512,9 +512,9 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
 
 static struct platform_driver fsl_lpspi_driver = {
 	.driver = {
-		   .name = DRIVER_NAME,
-		   .of_match_table = fsl_lpspi_dt_ids,
-		   },
+		.name = DRIVER_NAME,
+		.of_match_table = fsl_lpspi_dt_ids,
+	},
 	.probe = fsl_lpspi_probe,
 	.remove = fsl_lpspi_remove,
 };
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#6 lore raw

RE: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

In reply to a message not in the archive

From: Mark Brown <mailto:[email protected]> Sent: Tuesday, January 10, 2017 3:34 AM

Quoted 11 lines

To: Pandy Gao <[email protected]>
Cc: [email protected]
Subject: Re: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

Quoted 1 line · Gao Pan

When system enters VLLS mode, module power is turned off. As a

result,

Quoted 4 lines

all registers are reset to HW default value. After exiting VLLS mode, registers are still in default mode. As a result, the pinctrl settings are incorrect, which will affect the module function.

Quoted 5 lines
Quoted 1 line

The patch recovers the pinctrl setting when exit VLLS mode.

Why is this a change here and not in the pinctrl driver? It sounds like it's the pinctrl driver that's forgetting the settings and should be restoring them on resume but perhaps I'm missing something here.

If the pinctrl driver restores the setting on resume, then all device node should be scanned, which is irregular.

Even though the pinctrl driver can handle all the child node of iomuxc, it's still difficult for the pinctrl driver to know which device node is disabled and which device node is okay. Moreover, there may be some pin conflicts among the child node of iomuxc.

So it's better to do the restore in spi driver other than the pinctrl driver.

Best Regards
Gao Pan
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Re: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

In reply to a message not in the archive
Quoted 8 lines · Pandy Gao
Quoted 5 lines
Quoted 1 line

The patch recovers the pinctrl setting when exit VLLS mode.

Why is this a change here and not in the pinctrl driver? It sounds like it's the pinctrl driver that's forgetting the settings and should be restoring them on resume but perhaps I'm missing something here.

If the pinctrl driver restores the setting on resume, then all device node should be scanned, which is irregular.

What would restoring the configuration have to do with scanning the device tree? The changelog says this is just reapplying the same settings we started out with so it's just a case of restoring the state of the device after a runtime resume which is a perfectly normal thing for a driver to do.

author
#10 lore raw

RE: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

In reply to a message not in the archive

From: Mark Brown <mailto:[email protected]> Sent: Wednesday, January 18, 2017 3:04 AM

Quoted 13 lines

To: Pandy Gao <[email protected]>
Cc: [email protected]
Subject: Re: [Patch V1 2/2] spi: fsl-lpspi: add VLLS mode support

Quoted 5 lines · Pandy Gao
Quoted 5 lines
Quoted 1 line

The patch recovers the pinctrl setting when exit VLLS mode.

Why is this a change here and not in the pinctrl driver? It sounds like it's the pinctrl driver that's forgetting the settings and should be restoring them on resume but perhaps I'm missing

something here.

Quoted 8 lines
Quoted 2 lines

If the pinctrl driver restores the setting on resume, then all device node should be scanned, which is irregular.

What would restoring the configuration have to do with scanning the device tree? The changelog says this is just reapplying the same settings we started out with so it's just a case of restoring the state of the device after a runtime resume which is a perfectly normal thing for a driver to do.

We can reapply the initial settings as the configurations defined in device node iomuxc in pinctrl driver. However, I think there are some limitations. For example, conflicts may exist between enet1grp and ecspi3grp, which is not easy for the pinctrl driver to find out.

&iomuxc {
	pinctrl_ecspi3: ecspi3grp 
	{
		...
	};

            	pinctrl_enet1: enet1grp
	 {
		...
	};
}

Best Regards
Gao Pan
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html