Skip to content

Commit

Permalink
[media] ir-hix5hd2: make hisilicon,power-syscon property deprecated
Browse files Browse the repository at this point in the history
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>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
  • Loading branch information
Ruqiang Ju authored and Mauro Carvalho Chehab committed Nov 22, 2016
1 parent 69ace6e commit 414e72c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Documentation/devicetree/bindings/media/hix5hd2-ir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ 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:

ir: ir@f8001000 {
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";
};
25 changes: 16 additions & 9 deletions drivers/media/rc/ir-hix5hd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 414e72c

Please sign in to comment.