Commit 414e72c7 authored by Ruqiang Ju's avatar Ruqiang Ju Committed by Mauro Carvalho Chehab

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

The clock of IR can be provided by the clock provider and controlled
by common clock framework APIs.
Signed-off-by: default avatarRuqiang Ju <juruqiang@huawei.com>
Signed-off-by: default avatarJiancheng Xue <xuejiancheng@hisilicon.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 69ace6ee
...@@ -8,10 +8,11 @@ Required properties: ...@@ -8,10 +8,11 @@ Required properties:
the device. The interrupt specifier format depends on the interrupt the device. The interrupt specifier format depends on the interrupt
controller parent. controller parent.
- clocks: clock phandle and specifier pair. - clocks: clock phandle and specifier pair.
- hisilicon,power-syscon: phandle of syscon used to control power.
Optional properties: Optional properties:
- linux,rc-map-name : Remote control map name. - 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: Example node:
...@@ -19,7 +20,6 @@ Example node: ...@@ -19,7 +20,6 @@ Example node:
compatible = "hisilicon,hix5hd2-ir"; compatible = "hisilicon,hix5hd2-ir";
reg = <0xf8001000 0x1000>; reg = <0xf8001000 0x1000>;
interrupts = <0 47 4>; interrupts = <0 47 4>;
clocks = <&clock HIX5HD2_FIXED_24M>; clocks = <&clock HIX5HD2_IR_CLOCK>;
hisilicon,power-syscon = <&sysctrl>;
linux,rc-map-name = "rc-tivo"; linux,rc-map-name = "rc-tivo";
}; };
...@@ -75,6 +75,7 @@ static void hix5hd2_ir_enable(struct hix5hd2_ir_priv *dev, bool on) ...@@ -75,6 +75,7 @@ static void hix5hd2_ir_enable(struct hix5hd2_ir_priv *dev, bool on)
{ {
u32 val; u32 val;
if (dev->regmap) {
regmap_read(dev->regmap, IR_CLK, &val); regmap_read(dev->regmap, IR_CLK, &val);
if (on) { if (on) {
val &= ~IR_CLK_RESET; val &= ~IR_CLK_RESET;
...@@ -84,6 +85,12 @@ static void hix5hd2_ir_enable(struct hix5hd2_ir_priv *dev, bool on) ...@@ -84,6 +85,12 @@ static void hix5hd2_ir_enable(struct hix5hd2_ir_priv *dev, bool on)
val |= IR_CLK_RESET; val |= IR_CLK_RESET;
} }
regmap_write(dev->regmap, IR_CLK, val); regmap_write(dev->regmap, IR_CLK, val);
} else {
if (on)
clk_prepare_enable(dev->clock);
else
clk_disable_unprepare(dev->clock);
}
} }
static int hix5hd2_ir_config(struct hix5hd2_ir_priv *priv) static int hix5hd2_ir_config(struct hix5hd2_ir_priv *priv)
...@@ -207,8 +214,8 @@ static int hix5hd2_ir_probe(struct platform_device *pdev) ...@@ -207,8 +214,8 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
priv->regmap = syscon_regmap_lookup_by_phandle(node, priv->regmap = syscon_regmap_lookup_by_phandle(node,
"hisilicon,power-syscon"); "hisilicon,power-syscon");
if (IS_ERR(priv->regmap)) { if (IS_ERR(priv->regmap)) {
dev_err(dev, "no power-reg\n"); dev_info(dev, "no power-reg\n");
return -EINVAL; priv->regmap = NULL;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment