Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1522421 > unrolled thread

[PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated

Started byJiancheng Xue <xuejiancheng@hisilicon.com>
First post2016-11-15 09:00 +0100
Last post2016-11-16 14:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-11-15 09:00 +0100
    Re: [PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property  deprecated Rob Herring <robh@kernel.org> - 2016-11-16 14:40 +0100

#1522421 — [PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated

FromJiancheng Xue <xuejiancheng@hisilicon.com>
Date2016-11-15 09:00 +0100
Subject[PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated
Message-ID<sDGOS-22f-31@gated-at.bofh.it>
From: Ruqiang Ju <juruqiang@huawei.com>

The clock of IR can be provided by the clock provider and controlled
by common clock framework APIs.

Signed-off-by: Ruqiang Ju <juruqiang@huawei.com>
Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
---
 .../devicetree/bindings/media/hix5hd2-ir.txt       |  6 +++---
 drivers/media/rc/ir-hix5hd2.c                      | 25 ++++++++++++++--------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt b/Documentation/devicetree/bindings/media/hix5hd2-ir.txt
index fb5e760..54e1bed 100644
--- a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt
+++ b/Documentation/devicetree/bindings/media/hix5hd2-ir.txt
@@ -8,10 +8,11 @@ Required properties:
 	  the device. The interrupt specifier format depends on the interrupt
 	  controller parent.
 	- clocks: clock phandle and specifier pair.
-	- hisilicon,power-syscon: phandle of syscon used to control power.

 Optional properties:
 	- linux,rc-map-name : Remote control map name.
+	- hisilicon,power-syscon: DEPRECATED. Don't use this in new dts files.
+		Provide correct clocks instead.

 Example node:

@@ -19,7 +20,6 @@ Example node:
 		compatible = "hisilicon,hix5hd2-ir";
 		reg = <0xf8001000 0x1000>;
 		interrupts = <0 47 4>;
-		clocks = <&clock HIX5HD2_FIXED_24M>;
-		hisilicon,power-syscon = <&sysctrl>;
+		clocks = <&clock HIX5HD2_IR_CLOCK>;
 		linux,rc-map-name = "rc-tivo";
 	};
diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c
index d0549fb..d26907e 100644
--- a/drivers/media/rc/ir-hix5hd2.c
+++ b/drivers/media/rc/ir-hix5hd2.c
@@ -75,15 +75,22 @@ static void hix5hd2_ir_enable(struct hix5hd2_ir_priv *dev, bool on)
 {
 	u32 val;

-	regmap_read(dev->regmap, IR_CLK, &val);
-	if (on) {
-		val &= ~IR_CLK_RESET;
-		val |= IR_CLK_ENABLE;
+	if (dev->regmap) {
+		regmap_read(dev->regmap, IR_CLK, &val);
+		if (on) {
+			val &= ~IR_CLK_RESET;
+			val |= IR_CLK_ENABLE;
+		} else {
+			val &= ~IR_CLK_ENABLE;
+			val |= IR_CLK_RESET;
+		}
+		regmap_write(dev->regmap, IR_CLK, val);
 	} else {
-		val &= ~IR_CLK_ENABLE;
-		val |= IR_CLK_RESET;
+		if (on)
+			clk_prepare_enable(dev->clock);
+		else
+			clk_disable_unprepare(dev->clock);
 	}
-	regmap_write(dev->regmap, IR_CLK, val);
 }

 static int hix5hd2_ir_config(struct hix5hd2_ir_priv *priv)
@@ -207,8 +214,8 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
 	priv->regmap = syscon_regmap_lookup_by_phandle(node,
 						       "hisilicon,power-syscon");
 	if (IS_ERR(priv->regmap)) {
-		dev_err(dev, "no power-reg\n");
-		return -EINVAL;
+		dev_info(dev, "no power-reg\n");
+		priv->regmap = NULL;
 	}

 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--
1.9.1

[toc] | [next] | [standalone]


#1523466 — Re: [PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated

FromRob Herring <robh@kernel.org>
Date2016-11-16 14:40 +0100
SubjectRe: [PATCH] [media] ir-hix5hd2: make hisilicon,power-syscon property deprecated
Message-ID<sE8Br-3rj-1@gated-at.bofh.it>
In reply to#1522421
On Tue, Nov 15, 2016 at 03:31:32PM +0800, Jiancheng Xue wrote:
> From: Ruqiang Ju <juruqiang@huawei.com>
> 
> The clock of IR can be provided by the clock provider and controlled
> by common clock framework APIs.
> 
> Signed-off-by: Ruqiang Ju <juruqiang@huawei.com>
> Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
> ---
>  .../devicetree/bindings/media/hix5hd2-ir.txt       |  6 +++---

Acked-by: Rob Herring <robh@kernel.org>

>  drivers/media/rc/ir-hix5hd2.c                      | 25 ++++++++++++++--------
>  2 files changed, 19 insertions(+), 12 deletions(-)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web