All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ADC: Mediatek auxadc driver for mt7622
@ 2017-06-22  5:44 ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt, jic23, knaack.h, lars, pmeerw
  Cc: srv_heupstream, liguo.zhang, yingjoe.chen, sean.wang,
	matthias.bgg, s.hauer, devicetree, linux-kernel,
	linux-arm-kernel, linux-iio, linux-mediatek

These patches are first version of Mediatek auxadc driver for mt7622.
These patches include three patches.
The First patch adds mt7622 compatible node in binding document.
The second patch adds support for suspend/resume.
The last patch adds mt7622 compatible node in auxadc driver.

Zhiyong Tao (3):
  dt-bindings: adc: mt7622: add binding document
  iio: adc: mt7622: add support for suspend/resume.
  iio: adc: mt7622: Add compatible node for mt7622.

 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 drivers/iio/adc/mt6577_auxadc.c                    |   38 ++++++++++++++++++++
 2 files changed, 39 insertions(+)

--
1.7.9.5

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 0/3] ADC: Mediatek auxadc driver for mt7622
@ 2017-06-22  5:44 ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	knaack.h-Mmb7MZpHnFY, lars-Qo5EllUWu/uELgA04lAiVw,
	pmeerw-jW+XmwGofnusTnJN9+BGXg
  Cc: srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

These patches are first version of Mediatek auxadc driver for mt7622.
These patches include three patches.
The First patch adds mt7622 compatible node in binding document.
The second patch adds support for suspend/resume.
The last patch adds mt7622 compatible node in auxadc driver.

Zhiyong Tao (3):
  dt-bindings: adc: mt7622: add binding document
  iio: adc: mt7622: add support for suspend/resume.
  iio: adc: mt7622: Add compatible node for mt7622.

 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 drivers/iio/adc/mt6577_auxadc.c                    |   38 ++++++++++++++++++++
 2 files changed, 39 insertions(+)

--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 0/3] ADC: Mediatek auxadc driver for mt7622
@ 2017-06-22  5:44 ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: linux-arm-kernel

These patches are first version of Mediatek auxadc driver for mt7622.
These patches include three patches.
The First patch adds mt7622 compatible node in binding document.
The second patch adds support for suspend/resume.
The last patch adds mt7622 compatible node in auxadc driver.

Zhiyong Tao (3):
  dt-bindings: adc: mt7622: add binding document
  iio: adc: mt7622: add support for suspend/resume.
  iio: adc: mt7622: Add compatible node for mt7622.

 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 drivers/iio/adc/mt6577_auxadc.c                    |   38 ++++++++++++++++++++
 2 files changed, 39 insertions(+)

--
1.7.9.5

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt, jic23, knaack.h, lars, pmeerw
  Cc: srv_heupstream, liguo.zhang, yingjoe.chen, sean.wang,
	matthias.bgg, s.hauer, devicetree, linux-kernel,
	linux-arm-kernel, linux-iio, linux-mediatek, Zhiyong Tao

The commit adds mt7622 compatible node in binding document.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
index 68c45cb..e6aa30a 100644
--- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
@@ -13,6 +13,7 @@ Required properties:
   - compatible: Should be one of:
     - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
     - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
+    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
   - reg: Address range of the AUXADC unit.
   - clocks: Should contain a clock specifier for each entry in clock-names
   - clock-names: Should contain "main".
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	knaack.h-Mmb7MZpHnFY, lars-Qo5EllUWu/uELgA04lAiVw,
	pmeerw-jW+XmwGofnusTnJN9+BGXg
  Cc: srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Zhiyong Tao

The commit adds mt7622 compatible node in binding document.

Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
index 68c45cb..e6aa30a 100644
--- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
@@ -13,6 +13,7 @@ Required properties:
   - compatible: Should be one of:
     - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
     - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
+    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
   - reg: Address range of the AUXADC unit.
   - clocks: Should contain a clock specifier for each entry in clock-names
   - clock-names: Should contain "main".
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: linux-arm-kernel

The commit adds mt7622 compatible node in binding document.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
index 68c45cb..e6aa30a 100644
--- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
@@ -13,6 +13,7 @@ Required properties:
   - compatible: Should be one of:
     - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
     - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
+    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
   - reg: Address range of the AUXADC unit.
   - clocks: Should contain a clock specifier for each entry in clock-names
   - clock-names: Should contain "main".
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt, jic23, knaack.h, lars, pmeerw
  Cc: srv_heupstream, liguo.zhang, yingjoe.chen, sean.wang,
	matthias.bgg, s.hauer, devicetree, linux-kernel,
	linux-arm-kernel, linux-iio, linux-mediatek, Zhiyong Tao

This patch supports auxadc suspend/resume flow.
Disable auxadc clk and power in suspend function.
Enable axuadc clk and power in resume function.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2d104c8..2dd7c74 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
 	.read_raw = &mt6577_auxadc_read_raw,
 };
 
+static int mt6577_auxadc_resume(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+	int ret;
+
+	ret = clk_prepare_enable(adc_dev->adc_clk);
+	if (ret) {
+		pr_err("failed to enable auxadc clock\n");
+		return ret;
+	}
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      MT6577_AUXADC_PDN_EN, 0);
+	mdelay(MT6577_AUXADC_POWER_READY_MS);
+
+	return 0;
+}
+
+static int mt6577_auxadc_suspend(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      0, MT6577_AUXADC_PDN_EN);
+	clk_disable_unprepare(adc_dev->adc_clk);
+
+	return 0;
+}
+
 static int mt6577_auxadc_probe(struct platform_device *pdev)
 {
 	struct mt6577_auxadc_device *adc_dev;
@@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
+	.suspend = mt6577_auxadc_suspend,
+	.resume = mt6577_auxadc_resume,
+};
+
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
@@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	.driver = {
 		.name   = "mt6577-auxadc",
 		.of_match_table = mt6577_auxadc_of_match,
+		.pm = &mt6577_auxadc_pm_ops,
 	},
 	.probe	= mt6577_auxadc_probe,
 	.remove	= mt6577_auxadc_remove,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	knaack.h-Mmb7MZpHnFY, lars-Qo5EllUWu/uELgA04lAiVw,
	pmeerw-jW+XmwGofnusTnJN9+BGXg
  Cc: srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Zhiyong Tao

This patch supports auxadc suspend/resume flow.
Disable auxadc clk and power in suspend function.
Enable axuadc clk and power in resume function.

Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2d104c8..2dd7c74 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
 	.read_raw = &mt6577_auxadc_read_raw,
 };
 
+static int mt6577_auxadc_resume(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+	int ret;
+
+	ret = clk_prepare_enable(adc_dev->adc_clk);
+	if (ret) {
+		pr_err("failed to enable auxadc clock\n");
+		return ret;
+	}
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      MT6577_AUXADC_PDN_EN, 0);
+	mdelay(MT6577_AUXADC_POWER_READY_MS);
+
+	return 0;
+}
+
+static int mt6577_auxadc_suspend(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      0, MT6577_AUXADC_PDN_EN);
+	clk_disable_unprepare(adc_dev->adc_clk);
+
+	return 0;
+}
+
 static int mt6577_auxadc_probe(struct platform_device *pdev)
 {
 	struct mt6577_auxadc_device *adc_dev;
@@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
+	.suspend = mt6577_auxadc_suspend,
+	.resume = mt6577_auxadc_resume,
+};
+
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
@@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	.driver = {
 		.name   = "mt6577-auxadc",
 		.of_match_table = mt6577_auxadc_of_match,
+		.pm = &mt6577_auxadc_pm_ops,
 	},
 	.probe	= mt6577_auxadc_probe,
 	.remove	= mt6577_auxadc_remove,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch supports auxadc suspend/resume flow.
Disable auxadc clk and power in suspend function.
Enable axuadc clk and power in resume function.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2d104c8..2dd7c74 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
 	.read_raw = &mt6577_auxadc_read_raw,
 };
 
+static int mt6577_auxadc_resume(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+	int ret;
+
+	ret = clk_prepare_enable(adc_dev->adc_clk);
+	if (ret) {
+		pr_err("failed to enable auxadc clock\n");
+		return ret;
+	}
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      MT6577_AUXADC_PDN_EN, 0);
+	mdelay(MT6577_AUXADC_POWER_READY_MS);
+
+	return 0;
+}
+
+static int mt6577_auxadc_suspend(struct device *dev)
+{
+	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
+
+	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
+			      0, MT6577_AUXADC_PDN_EN);
+	clk_disable_unprepare(adc_dev->adc_clk);
+
+	return 0;
+}
+
 static int mt6577_auxadc_probe(struct platform_device *pdev)
 {
 	struct mt6577_auxadc_device *adc_dev;
@@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
+	.suspend = mt6577_auxadc_suspend,
+	.resume = mt6577_auxadc_resume,
+};
+
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
@@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 	.driver = {
 		.name   = "mt6577-auxadc",
 		.of_match_table = mt6577_auxadc_of_match,
+		.pm = &mt6577_auxadc_pm_ops,
 	},
 	.probe	= mt6577_auxadc_probe,
 	.remove	= mt6577_auxadc_remove,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
  2017-06-22  5:44 ` Zhiyong Tao
  (?)
@ 2017-06-22  5:44   ` Zhiyong Tao
  -1 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt, jic23, knaack.h, lars, pmeerw
  Cc: srv_heupstream, liguo.zhang, yingjoe.chen, sean.wang,
	matthias.bgg, s.hauer, devicetree, linux-kernel,
	linux-arm-kernel, linux-iio, linux-mediatek, Zhiyong Tao

This commit adds mt7622 compatible node.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/iio/adc/mt6577_auxadc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2dd7c74..4a2cd9e 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
+	{ .compatible = "mediatek,mt7622-auxadc", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: robh+dt, jic23, knaack.h, lars, pmeerw
  Cc: srv_heupstream, liguo.zhang, yingjoe.chen, sean.wang,
	matthias.bgg, s.hauer, devicetree, linux-kernel,
	linux-arm-kernel, linux-iio, linux-mediatek, Zhiyong Tao

This commit adds mt7622 compatible node.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/iio/adc/mt6577_auxadc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2dd7c74..4a2cd9e 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
+	{ .compatible = "mediatek,mt7622-auxadc", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-22  5:44   ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-22  5:44 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds mt7622 compatible node.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/iio/adc/mt6577_auxadc.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index 2dd7c74..4a2cd9e 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
 static const struct of_device_id mt6577_auxadc_of_match[] = {
 	{ .compatible = "mediatek,mt2701-auxadc", },
 	{ .compatible = "mediatek,mt8173-auxadc", },
+	{ .compatible = "mediatek,mt7622-auxadc", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-24 20:00     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:00 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Thu, 22 Jun 2017 13:44:33 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> This patch supports auxadc suspend/resume flow.
> Disable auxadc clk and power in suspend function.
> Enable axuadc clk and power in resume function.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Worth handling the cases where power management is not configured into the
kernel properly.

So a few minor suggestions.  Otherwise looks good to me.
> ---
>  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2d104c8..2dd7c74 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
>  	.read_raw = &mt6577_auxadc_read_raw,
>  };
>  
> +static int mt6577_auxadc_resume(struct device *dev)
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +	int ret;
> +
> +	ret = clk_prepare_enable(adc_dev->adc_clk);
> +	if (ret) {
> +		pr_err("failed to enable auxadc clock\n");
> +		return ret;
> +	}
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      MT6577_AUXADC_PDN_EN, 0);
> +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> +
> +	return 0;
> +}
> +
> +static int mt6577_auxadc_suspend(struct device *dev)
Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      0, MT6577_AUXADC_PDN_EN);
> +	clk_disable_unprepare(adc_dev->adc_clk);
> +
> +	return 0;
> +}
> +
>  static int mt6577_auxadc_probe(struct platform_device *pdev)
>  {
>  	struct mt6577_auxadc_device *adc_dev;
> @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> +	.suspend = mt6577_auxadc_suspend,
> +	.resume = mt6577_auxadc_resume,
> +};
> +
Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
if PM_CONFIG_SLEEP is not defined.
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name   = "mt6577-auxadc",
>  		.of_match_table = mt6577_auxadc_of_match,
> +		.pm = &mt6577_auxadc_pm_ops,
>  	},
>  	.probe	= mt6577_auxadc_probe,
>  	.remove	= mt6577_auxadc_remove,

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-24 20:00     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:00 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 22 Jun 2017 13:44:33 +0800
Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:

> This patch supports auxadc suspend/resume flow.
> Disable auxadc clk and power in suspend function.
> Enable axuadc clk and power in resume function.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Worth handling the cases where power management is not configured into the
kernel properly.

So a few minor suggestions.  Otherwise looks good to me.
> ---
>  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2d104c8..2dd7c74 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
>  	.read_raw = &mt6577_auxadc_read_raw,
>  };
>  
> +static int mt6577_auxadc_resume(struct device *dev)
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +	int ret;
> +
> +	ret = clk_prepare_enable(adc_dev->adc_clk);
> +	if (ret) {
> +		pr_err("failed to enable auxadc clock\n");
> +		return ret;
> +	}
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      MT6577_AUXADC_PDN_EN, 0);
> +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> +
> +	return 0;
> +}
> +
> +static int mt6577_auxadc_suspend(struct device *dev)
Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      0, MT6577_AUXADC_PDN_EN);
> +	clk_disable_unprepare(adc_dev->adc_clk);
> +
> +	return 0;
> +}
> +
>  static int mt6577_auxadc_probe(struct platform_device *pdev)
>  {
>  	struct mt6577_auxadc_device *adc_dev;
> @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> +	.suspend = mt6577_auxadc_suspend,
> +	.resume = mt6577_auxadc_resume,
> +};
> +
Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
if PM_CONFIG_SLEEP is not defined.
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name   = "mt6577-auxadc",
>  		.of_match_table = mt6577_auxadc_of_match,
> +		.pm = &mt6577_auxadc_pm_ops,
>  	},
>  	.probe	= mt6577_auxadc_probe,
>  	.remove	= mt6577_auxadc_remove,

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-24 20:00     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 22 Jun 2017 13:44:33 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> This patch supports auxadc suspend/resume flow.
> Disable auxadc clk and power in suspend function.
> Enable axuadc clk and power in resume function.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Worth handling the cases where power management is not configured into the
kernel properly.

So a few minor suggestions.  Otherwise looks good to me.
> ---
>  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2d104c8..2dd7c74 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
>  	.read_raw = &mt6577_auxadc_read_raw,
>  };
>  
> +static int mt6577_auxadc_resume(struct device *dev)
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +	int ret;
> +
> +	ret = clk_prepare_enable(adc_dev->adc_clk);
> +	if (ret) {
> +		pr_err("failed to enable auxadc clock\n");
> +		return ret;
> +	}
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      MT6577_AUXADC_PDN_EN, 0);
> +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> +
> +	return 0;
> +}
> +
> +static int mt6577_auxadc_suspend(struct device *dev)
Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.
> +{
> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> +
> +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> +			      0, MT6577_AUXADC_PDN_EN);
> +	clk_disable_unprepare(adc_dev->adc_clk);
> +
> +	return 0;
> +}
> +
>  static int mt6577_auxadc_probe(struct platform_device *pdev)
>  {
>  	struct mt6577_auxadc_device *adc_dev;
> @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> +	.suspend = mt6577_auxadc_suspend,
> +	.resume = mt6577_auxadc_resume,
> +};
> +
Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
if PM_CONFIG_SLEEP is not defined.
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name   = "mt6577-auxadc",
>  		.of_match_table = mt6577_auxadc_of_match,
> +		.pm = &mt6577_auxadc_pm_ops,
>  	},
>  	.probe	= mt6577_auxadc_probe,
>  	.remove	= mt6577_auxadc_remove,

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Thu, 22 Jun 2017 13:44:34 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> This commit adds mt7622 compatible node.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> ---
>  drivers/iio/adc/mt6577_auxadc.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2dd7c74..4a2cd9e 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> +	{ .compatible = "mediatek,mt7622-auxadc", },
Keep them in numeric order perhaps?

Might become a worthwhile step if this logic gets used for lot more parts in future!

Jonathan
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 22 Jun 2017 13:44:34 +0800
Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:

> This commit adds mt7622 compatible node.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/iio/adc/mt6577_auxadc.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2dd7c74..4a2cd9e 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> +	{ .compatible = "mediatek,mt7622-auxadc", },
Keep them in numeric order perhaps?

Might become a worthwhile step if this logic gets used for lot more parts in future!

Jonathan
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 22 Jun 2017 13:44:34 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> This commit adds mt7622 compatible node.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> ---
>  drivers/iio/adc/mt6577_auxadc.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> index 2dd7c74..4a2cd9e 100644
> --- a/drivers/iio/adc/mt6577_auxadc.c
> +++ b/drivers/iio/adc/mt6577_auxadc.c
> @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>  	{ .compatible = "mediatek,mt2701-auxadc", },
>  	{ .compatible = "mediatek,mt8173-auxadc", },
> +	{ .compatible = "mediatek,mt7622-auxadc", },
Keep them in numeric order perhaps?

Might become a worthwhile step if this logic gets used for lot more parts in future!

Jonathan
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Thu, 22 Jun 2017 13:44:32 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> The commit adds mt7622 compatible node in binding document.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> ---
>  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> index 68c45cb..e6aa30a 100644
> --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> @@ -13,6 +13,7 @@ Required properties:
>    - compatible: Should be one of:
>      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
>      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
numeric order?
>    - reg: Address range of the AUXADC unit.
>    - clocks: Should contain a clock specifier for each entry in clock-names
>    - clock-names: Should contain "main".

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: Zhiyong Tao
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 22 Jun 2017 13:44:32 +0800
Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:

> The commit adds mt7622 compatible node in binding document.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> index 68c45cb..e6aa30a 100644
> --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> @@ -13,6 +13,7 @@ Required properties:
>    - compatible: Should be one of:
>      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
>      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
numeric order?
>    - reg: Address range of the AUXADC unit.
>    - clocks: Should contain a clock specifier for each entry in clock-names
>    - clock-names: Should contain "main".

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-24 20:02     ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-24 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 22 Jun 2017 13:44:32 +0800
Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:

> The commit adds mt7622 compatible node in binding document.
> 
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> ---
>  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> index 68c45cb..e6aa30a 100644
> --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> @@ -13,6 +13,7 @@ Required properties:
>    - compatible: Should be one of:
>      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
>      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
numeric order?
>    - reg: Address range of the AUXADC unit.
>    - clocks: Should contain a clock specifier for each entry in clock-names
>    - clock-names: Should contain "main".

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-26  1:55       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  1:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:34 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > This commit adds mt7622 compatible node.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2dd7c74..4a2cd9e 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > +	{ .compatible = "mediatek,mt7622-auxadc", },
> Keep them in numeric order perhaps?
> 
> Might become a worthwhile step if this logic gets used for lot more parts in future!
> 
> Jonathan

==>Ok, we will change them in numeric order perhaps in v2.
Thanks.

> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-26  1:55       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  1:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:34 +0800
> Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
> 
> > This commit adds mt7622 compatible node.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2dd7c74..4a2cd9e 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > +	{ .compatible = "mediatek,mt7622-auxadc", },
> Keep them in numeric order perhaps?
> 
> Might become a worthwhile step if this logic gets used for lot more parts in future!
> 
> Jonathan

==>Ok, we will change them in numeric order perhaps in v2.
Thanks.

> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622.
@ 2017-06-26  1:55       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  1:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:34 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > This commit adds mt7622 compatible node.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2dd7c74..4a2cd9e 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -308,6 +308,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > +	{ .compatible = "mediatek,mt7622-auxadc", },
> Keep them in numeric order perhaps?
> 
> Might become a worthwhile step if this logic gets used for lot more parts in future!
> 
> Jonathan

==>Ok, we will change them in numeric order perhaps in v2.
Thanks.

> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, mt6577_auxadc_of_match);
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  2:54       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  2:54 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:33 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > This patch supports auxadc suspend/resume flow.
> > Disable auxadc clk and power in suspend function.
> > Enable axuadc clk and power in resume function.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> Worth handling the cases where power management is not configured into the
> kernel properly.
> 
> So a few minor suggestions.  Otherwise looks good to me.
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2d104c8..2dd7c74 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
> >  	.read_raw = &mt6577_auxadc_read_raw,
> >  };
> >  
> > +static int mt6577_auxadc_resume(struct device *dev)
> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +	int ret;
> > +
> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
> > +	if (ret) {
> > +		pr_err("failed to enable auxadc clock\n");
> > +		return ret;
> > +	}
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      MT6577_AUXADC_PDN_EN, 0);
> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> > +
> > +	return 0;
> > +}
> > +
> > +static int mt6577_auxadc_suspend(struct device *dev)
> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.

==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
thanks!

> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      0, MT6577_AUXADC_PDN_EN);
> > +	clk_disable_unprepare(adc_dev->adc_clk);
> > +
> > +	return 0;
> > +}
> > +
> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
> >  {
> >  	struct mt6577_auxadc_device *adc_dev;
> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> > +	.suspend = mt6577_auxadc_suspend,
> > +	.resume = mt6577_auxadc_resume,
> > +};
> > +
> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
> if PM_CONFIG_SLEEP is not defined.

==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	.driver = {
> >  		.name   = "mt6577-auxadc",
> >  		.of_match_table = mt6577_auxadc_of_match,
> > +		.pm = &mt6577_auxadc_pm_ops,
> >  	},
> >  	.probe	= mt6577_auxadc_probe,
> >  	.remove	= mt6577_auxadc_remove,
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  2:54       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  2:54 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:33 +0800
> Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
> 
> > This patch supports auxadc suspend/resume flow.
> > Disable auxadc clk and power in suspend function.
> > Enable axuadc clk and power in resume function.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Worth handling the cases where power management is not configured into the
> kernel properly.
> 
> So a few minor suggestions.  Otherwise looks good to me.
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2d104c8..2dd7c74 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
> >  	.read_raw = &mt6577_auxadc_read_raw,
> >  };
> >  
> > +static int mt6577_auxadc_resume(struct device *dev)
> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +	int ret;
> > +
> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
> > +	if (ret) {
> > +		pr_err("failed to enable auxadc clock\n");
> > +		return ret;
> > +	}
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      MT6577_AUXADC_PDN_EN, 0);
> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> > +
> > +	return 0;
> > +}
> > +
> > +static int mt6577_auxadc_suspend(struct device *dev)
> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.

==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
thanks!

> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      0, MT6577_AUXADC_PDN_EN);
> > +	clk_disable_unprepare(adc_dev->adc_clk);
> > +
> > +	return 0;
> > +}
> > +
> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
> >  {
> >  	struct mt6577_auxadc_device *adc_dev;
> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> > +	.suspend = mt6577_auxadc_suspend,
> > +	.resume = mt6577_auxadc_resume,
> > +};
> > +
> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
> if PM_CONFIG_SLEEP is not defined.

==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	.driver = {
> >  		.name   = "mt6577-auxadc",
> >  		.of_match_table = mt6577_auxadc_of_match,
> > +		.pm = &mt6577_auxadc_pm_ops,
> >  	},
> >  	.probe	= mt6577_auxadc_probe,
> >  	.remove	= mt6577_auxadc_remove,
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  2:54       ` zhiyong tao
  0 siblings, 0 replies; 34+ messages in thread
From: zhiyong tao @ 2017-06-26  2:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:33 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > This patch supports auxadc suspend/resume flow.
> > Disable auxadc clk and power in suspend function.
> > Enable axuadc clk and power in resume function.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> Worth handling the cases where power management is not configured into the
> kernel properly.
> 
> So a few minor suggestions.  Otherwise looks good to me.
> > ---
> >  drivers/iio/adc/mt6577_auxadc.c |   37 +++++++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
> > index 2d104c8..2dd7c74 100644
> > --- a/drivers/iio/adc/mt6577_auxadc.c
> > +++ b/drivers/iio/adc/mt6577_auxadc.c
> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev,
> >  	.read_raw = &mt6577_auxadc_read_raw,
> >  };
> >  
> > +static int mt6577_auxadc_resume(struct device *dev)
> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +	int ret;
> > +
> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
> > +	if (ret) {
> > +		pr_err("failed to enable auxadc clock\n");
> > +		return ret;
> > +	}
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      MT6577_AUXADC_PDN_EN, 0);
> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
> > +
> > +	return 0;
> > +}
> > +
> > +static int mt6577_auxadc_suspend(struct device *dev)
> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP case.

==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
thanks!

> > +{
> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
> > +
> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
> > +			      0, MT6577_AUXADC_PDN_EN);
> > +	clk_disable_unprepare(adc_dev->adc_clk);
> > +
> > +	return 0;
> > +}
> > +
> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
> >  {
> >  	struct mt6577_auxadc_device *adc_dev;
> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
> > +	.suspend = mt6577_auxadc_suspend,
> > +	.resume = mt6577_auxadc_resume,
> > +};
> > +
> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments magically go away
> if PM_CONFIG_SLEEP is not defined.

==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
> >  	{ .compatible = "mediatek,mt2701-auxadc", },
> >  	{ .compatible = "mediatek,mt8173-auxadc", },
> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
> >  	.driver = {
> >  		.name   = "mt6577-auxadc",
> >  		.of_match_table = mt6577_auxadc_of_match,
> > +		.pm = &mt6577_auxadc_pm_ops,
> >  	},
> >  	.probe	= mt6577_auxadc_probe,
> >  	.remove	= mt6577_auxadc_remove,
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
  2017-06-26  2:54       ` zhiyong tao
  (?)
  (?)
@ 2017-06-26  5:01         ` Jonathan Cameron
  -1 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-26  5:01 UTC (permalink / raw)
  To: zhiyong tao, Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek



On 26 June 2017 04:54:52 CEST, zhiyong tao <zhiyong.tao@mediatek.com> wrote:
>On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
>> On Thu, 22 Jun 2017 13:44:33 +0800
>> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
>> 
>> > This patch supports auxadc suspend/resume flow.
>> > Disable auxadc clk and power in suspend function.
>> > Enable axuadc clk and power in resume function.
>> > 
>> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
>> Worth handling the cases where power management is not configured
>into the
>> kernel properly.
>> 
>> So a few minor suggestions.  Otherwise looks good to me.
>> > ---
>> >  drivers/iio/adc/mt6577_auxadc.c |   37
>+++++++++++++++++++++++++++++++++++++
>> >  1 file changed, 37 insertions(+)
>> > 
>> > diff --git a/drivers/iio/adc/mt6577_auxadc.c
>b/drivers/iio/adc/mt6577_auxadc.c
>> > index 2d104c8..2dd7c74 100644
>> > --- a/drivers/iio/adc/mt6577_auxadc.c
>> > +++ b/drivers/iio/adc/mt6577_auxadc.c
>> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct
>iio_dev *indio_dev,
>> >  	.read_raw = &mt6577_auxadc_read_raw,
>> >  };
>> >  
>> > +static int mt6577_auxadc_resume(struct device *dev)
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +	int ret;
>> > +
>> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
>> > +	if (ret) {
>> > +		pr_err("failed to enable auxadc clock\n");
>> > +		return ret;
>> > +	}
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      MT6577_AUXADC_PDN_EN, 0);
>> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> > +static int mt6577_auxadc_suspend(struct device *dev)
>> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP
>case.
Preferred to mark __maybe_unused and use the macro mentioned below.
>
>==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
>thanks!
>
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      0, MT6577_AUXADC_PDN_EN);
>> > +	clk_disable_unprepare(adc_dev->adc_clk);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
>> >  {
>> >  	struct mt6577_auxadc_device *adc_dev;
>> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	return 0;
>> >  }
>> >  
>> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
>> > +	.suspend = mt6577_auxadc_suspend,
>> > +	.resume = mt6577_auxadc_resume,
>> > +};
>> > +
>> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments
>magically go away
>> if PM_CONFIG_SLEEP is not defined.
>
>==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>> >  	{ .compatible = "mediatek,mt2701-auxadc", },
>> >  	{ .compatible = "mediatek,mt8173-auxadc", },
>> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	.driver = {
>> >  		.name   = "mt6577-auxadc",
>> >  		.of_match_table = mt6577_auxadc_of_match,
>> > +		.pm = &mt6577_auxadc_pm_ops,
>> >  	},
>> >  	.probe	= mt6577_auxadc_probe,
>> >  	.remove	= mt6577_auxadc_remove,
>> 
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  5:01         ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-26  5:01 UTC (permalink / raw)
  To: zhiyong tao, Jonathan Cameron
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	liguo.zhang-NuS5LvNUpcJWk0Htik3J/w,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w,
	sean.wang-NuS5LvNUpcJWk0Htik3J/w,
	matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r



On 26 June 2017 04:54:52 CEST, zhiyong tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
>On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
>> On Thu, 22 Jun 2017 13:44:33 +0800
>> Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:
>> 
>> > This patch supports auxadc suspend/resume flow.
>> > Disable auxadc clk and power in suspend function.
>> > Enable axuadc clk and power in resume function.
>> > 
>> > Signed-off-by: Zhiyong Tao <zhiyong.tao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
>> Worth handling the cases where power management is not configured
>into the
>> kernel properly.
>> 
>> So a few minor suggestions.  Otherwise looks good to me.
>> > ---
>> >  drivers/iio/adc/mt6577_auxadc.c |   37
>+++++++++++++++++++++++++++++++++++++
>> >  1 file changed, 37 insertions(+)
>> > 
>> > diff --git a/drivers/iio/adc/mt6577_auxadc.c
>b/drivers/iio/adc/mt6577_auxadc.c
>> > index 2d104c8..2dd7c74 100644
>> > --- a/drivers/iio/adc/mt6577_auxadc.c
>> > +++ b/drivers/iio/adc/mt6577_auxadc.c
>> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct
>iio_dev *indio_dev,
>> >  	.read_raw = &mt6577_auxadc_read_raw,
>> >  };
>> >  
>> > +static int mt6577_auxadc_resume(struct device *dev)
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +	int ret;
>> > +
>> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
>> > +	if (ret) {
>> > +		pr_err("failed to enable auxadc clock\n");
>> > +		return ret;
>> > +	}
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      MT6577_AUXADC_PDN_EN, 0);
>> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> > +static int mt6577_auxadc_suspend(struct device *dev)
>> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP
>case.
Preferred to mark __maybe_unused and use the macro mentioned below.
>
>==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
>thanks!
>
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      0, MT6577_AUXADC_PDN_EN);
>> > +	clk_disable_unprepare(adc_dev->adc_clk);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
>> >  {
>> >  	struct mt6577_auxadc_device *adc_dev;
>> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	return 0;
>> >  }
>> >  
>> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
>> > +	.suspend = mt6577_auxadc_suspend,
>> > +	.resume = mt6577_auxadc_resume,
>> > +};
>> > +
>> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments
>magically go away
>> if PM_CONFIG_SLEEP is not defined.
>
>==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>> >  	{ .compatible = "mediatek,mt2701-auxadc", },
>> >  	{ .compatible = "mediatek,mt8173-auxadc", },
>> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	.driver = {
>> >  		.name   = "mt6577-auxadc",
>> >  		.of_match_table = mt6577_auxadc_of_match,
>> > +		.pm = &mt6577_auxadc_pm_ops,
>> >  	},
>> >  	.probe	= mt6577_auxadc_probe,
>> >  	.remove	= mt6577_auxadc_remove,
>> 
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  5:01         ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-26  5:01 UTC (permalink / raw)
  To: zhiyong tao, Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek



On 26 June 2017 04:54:52 CEST, zhiyong tao <zhiyong=2Etao@mediatek=2Ecom> =
wrote:
>On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
>> On Thu, 22 Jun 2017 13:44:33 +0800
>> Zhiyong Tao <zhiyong=2Etao@mediatek=2Ecom> wrote:
>>=20
>> > This patch supports auxadc suspend/resume flow=2E
>> > Disable auxadc clk and power in suspend function=2E
>> > Enable axuadc clk and power in resume function=2E
>> >=20
>> > Signed-off-by: Zhiyong Tao <zhiyong=2Etao@mediatek=2Ecom>
>> Worth handling the cases where power management is not configured
>into the
>> kernel properly=2E
>>=20
>> So a few minor suggestions=2E  Otherwise looks good to me=2E
>> > ---
>> >  drivers/iio/adc/mt6577_auxadc=2Ec |   37
>+++++++++++++++++++++++++++++++++++++
>> >  1 file changed, 37 insertions(+)
>> >=20
>> > diff --git a/drivers/iio/adc/mt6577_auxadc=2Ec
>b/drivers/iio/adc/mt6577_auxadc=2Ec
>> > index 2d104c8=2E=2E2dd7c74 100644
>> > --- a/drivers/iio/adc/mt6577_auxadc=2Ec
>> > +++ b/drivers/iio/adc/mt6577_auxadc=2Ec
>> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct
>iio_dev *indio_dev,
>> >  	=2Eread_raw =3D &mt6577_auxadc_read_raw,
>> >  };
>> > =20
>> > +static int mt6577_auxadc_resume(struct device *dev)
>> > +{
>> > +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev =3D iio_priv(indio_dev);
>> > +	int ret;
>> > +
>> > +	ret =3D clk_prepare_enable(adc_dev->adc_clk);
>> > +	if (ret) {
>> > +		pr_err("failed to enable auxadc clock\n");
>> > +		return ret;
>> > +	}
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      MT6577_AUXADC_PDN_EN, 0);
>> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> > +static int mt6577_auxadc_suspend(struct device *dev)
>> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP
>case=2E
Preferred to mark __maybe_unused and use the macro mentioned below=2E
>
>=3D=3D> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2=
=2E
>thanks!
>
>> > +{
>> > +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev =3D iio_priv(indio_dev);
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      0, MT6577_AUXADC_PDN_EN);
>> > +	clk_disable_unprepare(adc_dev->adc_clk);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
>> >  {
>> >  	struct mt6577_auxadc_device *adc_dev;
>> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	return 0;
>> >  }
>> > =20
>> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops =3D {
>> > +	=2Esuspend =3D mt6577_auxadc_suspend,
>> > +	=2Eresume =3D mt6577_auxadc_resume,
>> > +};
>> > +
>> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments
>magically go away
>> if PM_CONFIG_SLEEP is not defined=2E
>
>=3D=3D> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2=2E Tha=
nks=2E
>>>  static const struct of_device_id mt6577_auxadc_of_match[] =3D {
>> >  	{ =2Ecompatible =3D "mediatek,mt2701-auxadc", },
>> >  	{ =2Ecompatible =3D "mediatek,mt8173-auxadc", },
>> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	=2Edriver =3D {
>> >  		=2Ename   =3D "mt6577-auxadc",
>> >  		=2Eof_match_table =3D mt6577_auxadc_of_match,
>> > +		=2Epm =3D &mt6577_auxadc_pm_ops,
>> >  	},
>> >  	=2Eprobe	=3D mt6577_auxadc_probe,
>> >  	=2Eremove	=3D mt6577_auxadc_remove,
>>=20
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger=2Ekernel=2Eorg
>More majordomo info at  http://vger=2Ekernel=2Eorg/majordomo-info=2Ehtml

--=20
Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume.
@ 2017-06-26  5:01         ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-06-26  5:01 UTC (permalink / raw)
  To: linux-arm-kernel



On 26 June 2017 04:54:52 CEST, zhiyong tao <zhiyong.tao@mediatek.com> wrote:
>On Sat, 2017-06-24 at 21:00 +0100, Jonathan Cameron wrote:
>> On Thu, 22 Jun 2017 13:44:33 +0800
>> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
>> 
>> > This patch supports auxadc suspend/resume flow.
>> > Disable auxadc clk and power in suspend function.
>> > Enable axuadc clk and power in resume function.
>> > 
>> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
>> Worth handling the cases where power management is not configured
>into the
>> kernel properly.
>> 
>> So a few minor suggestions.  Otherwise looks good to me.
>> > ---
>> >  drivers/iio/adc/mt6577_auxadc.c |   37
>+++++++++++++++++++++++++++++++++++++
>> >  1 file changed, 37 insertions(+)
>> > 
>> > diff --git a/drivers/iio/adc/mt6577_auxadc.c
>b/drivers/iio/adc/mt6577_auxadc.c
>> > index 2d104c8..2dd7c74 100644
>> > --- a/drivers/iio/adc/mt6577_auxadc.c
>> > +++ b/drivers/iio/adc/mt6577_auxadc.c
>> > @@ -184,6 +184,37 @@ static int mt6577_auxadc_read_raw(struct
>iio_dev *indio_dev,
>> >  	.read_raw = &mt6577_auxadc_read_raw,
>> >  };
>> >  
>> > +static int mt6577_auxadc_resume(struct device *dev)
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +	int ret;
>> > +
>> > +	ret = clk_prepare_enable(adc_dev->adc_clk);
>> > +	if (ret) {
>> > +		pr_err("failed to enable auxadc clock\n");
>> > +		return ret;
>> > +	}
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      MT6577_AUXADC_PDN_EN, 0);
>> > +	mdelay(MT6577_AUXADC_POWER_READY_MS);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> > +static int mt6577_auxadc_suspend(struct device *dev)
>> Mark these __maybe_unused for the CONFIG_PM but not CONFIG_PM_SLEEP
>case.
Preferred to mark __maybe_unused and use the macro mentioned below.
>
>==> ok, We will add CONFIG_PM_SLEEP for the suspend/resume case in v2.
>thanks!
>
>> > +{
>> > +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> > +	struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
>> > +
>> > +	mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC,
>> > +			      0, MT6577_AUXADC_PDN_EN);
>> > +	clk_disable_unprepare(adc_dev->adc_clk);
>> > +
>> > +	return 0;
>> > +}
>> > +
>> >  static int mt6577_auxadc_probe(struct platform_device *pdev)
>> >  {
>> >  	struct mt6577_auxadc_device *adc_dev;
>> > @@ -269,6 +300,11 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	return 0;
>> >  }
>> >  
>> > +static const struct dev_pm_ops mt6577_auxadc_pm_ops = {
>> > +	.suspend = mt6577_auxadc_suspend,
>> > +	.resume = mt6577_auxadc_resume,
>> > +};
>> > +
>> Use the SIMPLE_SYSTEM_PM_OPS macro to make these assignments
>magically go away
>> if PM_CONFIG_SLEEP is not defined.
>
>==> ok, We will use SIMPLE_DEV_PM_OPS macro to change it in v2. Thanks.
>>>  static const struct of_device_id mt6577_auxadc_of_match[] = {
>> >  	{ .compatible = "mediatek,mt2701-auxadc", },
>> >  	{ .compatible = "mediatek,mt8173-auxadc", },
>> > @@ -280,6 +316,7 @@ static int mt6577_auxadc_remove(struct
>platform_device *pdev)
>> >  	.driver = {
>> >  		.name   = "mt6577-auxadc",
>> >  		.of_match_table = mt6577_auxadc_of_match,
>> > +		.pm = &mt6577_auxadc_pm_ops,
>> >  	},
>> >  	.probe	= mt6577_auxadc_probe,
>> >  	.remove	= mt6577_auxadc_remove,
>> 
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo at vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
  2017-06-24 20:02     ` Jonathan Cameron
  (?)
@ 2017-06-26 10:45       ` Zhiyong Tao
  -1 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-26 10:45 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:32 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > The commit adds mt7622 compatible node in binding document.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> > ---
> >  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > index 68c45cb..e6aa30a 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > @@ -13,6 +13,7 @@ Required properties:
> >    - compatible: Should be one of:
> >      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
> >      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> > +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
> numeric order?
==> yes, we have changed it as numeric order in v2. Thanks.
> >    - reg: Address range of the AUXADC unit.
> >    - clocks: Should contain a clock specifier for each entry in clock-names
> >    - clock-names: Should contain "main".
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-26 10:45       ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-26 10:45 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: robh+dt, knaack.h, lars, pmeerw, srv_heupstream, liguo.zhang,
	yingjoe.chen, sean.wang, matthias.bgg, s.hauer, devicetree,
	linux-kernel, linux-arm-kernel, linux-iio, linux-mediatek

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:32 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > The commit adds mt7622 compatible node in binding document.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> > ---
> >  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > index 68c45cb..e6aa30a 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > @@ -13,6 +13,7 @@ Required properties:
> >    - compatible: Should be one of:
> >      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
> >      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> > +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
> numeric order?
==> yes, we have changed it as numeric order in v2. Thanks.
> >    - reg: Address range of the AUXADC unit.
> >    - clocks: Should contain a clock specifier for each entry in clock-names
> >    - clock-names: Should contain "main".
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/3] dt-bindings: adc: mt7622: add binding document
@ 2017-06-26 10:45       ` Zhiyong Tao
  0 siblings, 0 replies; 34+ messages in thread
From: Zhiyong Tao @ 2017-06-26 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-06-24 at 21:02 +0100, Jonathan Cameron wrote:
> On Thu, 22 Jun 2017 13:44:32 +0800
> Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
> 
> > The commit adds mt7622 compatible node in binding document.
> > 
> > Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> > ---
> >  .../devicetree/bindings/iio/adc/mt6577_auxadc.txt  |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > index 68c45cb..e6aa30a 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > +++ b/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
> > @@ -13,6 +13,7 @@ Required properties:
> >    - compatible: Should be one of:
> >      - "mediatek,mt2701-auxadc": For MT2701 family of SoCs
> >      - "mediatek,mt8173-auxadc": For MT8173 family of SoCs
> > +    - "mediatek,mt7622-auxadc": For MT7622 family of SoCs
> numeric order?
==> yes, we have changed it as numeric order in v2. Thanks.
> >    - reg: Address range of the AUXADC unit.
> >    - clocks: Should contain a clock specifier for each entry in clock-names
> >    - clock-names: Should contain "main".
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2017-06-26 10:45 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22  5:44 [PATCH 0/3] ADC: Mediatek auxadc driver for mt7622 Zhiyong Tao
2017-06-22  5:44 ` Zhiyong Tao
2017-06-22  5:44 ` Zhiyong Tao
2017-06-22  5:44 ` [PATCH 1/3] dt-bindings: adc: mt7622: add binding document Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-24 20:02   ` Jonathan Cameron
2017-06-24 20:02     ` Jonathan Cameron
2017-06-24 20:02     ` Jonathan Cameron
2017-06-26 10:45     ` Zhiyong Tao
2017-06-26 10:45       ` Zhiyong Tao
2017-06-26 10:45       ` Zhiyong Tao
2017-06-22  5:44 ` [PATCH 2/3] iio: adc: mt7622: add support for suspend/resume Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-24 20:00   ` Jonathan Cameron
2017-06-24 20:00     ` Jonathan Cameron
2017-06-24 20:00     ` Jonathan Cameron
2017-06-26  2:54     ` zhiyong tao
2017-06-26  2:54       ` zhiyong tao
2017-06-26  2:54       ` zhiyong tao
2017-06-26  5:01       ` Jonathan Cameron
2017-06-26  5:01         ` Jonathan Cameron
2017-06-26  5:01         ` Jonathan Cameron
2017-06-26  5:01         ` Jonathan Cameron
2017-06-22  5:44 ` [PATCH 3/3] iio: adc: mt7622: Add compatible node for mt7622 Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-22  5:44   ` Zhiyong Tao
2017-06-24 20:02   ` Jonathan Cameron
2017-06-24 20:02     ` Jonathan Cameron
2017-06-24 20:02     ` Jonathan Cameron
2017-06-26  1:55     ` zhiyong tao
2017-06-26  1:55       ` zhiyong tao
2017-06-26  1:55       ` zhiyong tao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.