Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: 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>

authored by

Ruqiang Ju and committed by
Mauro Carvalho Chehab
414e72c7 69ace6ee

+19 -12
+3 -3
Documentation/devicetree/bindings/media/hix5hd2-ir.txt
··· 8 8 the device. The interrupt specifier format depends on the interrupt 9 9 controller parent. 10 10 - clocks: clock phandle and specifier pair. 11 - - hisilicon,power-syscon: phandle of syscon used to control power. 12 11 13 12 Optional properties: 14 13 - linux,rc-map-name : Remote control map name. 14 + - hisilicon,power-syscon: DEPRECATED. Don't use this in new dts files. 15 + Provide correct clocks instead. 15 16 16 17 Example node: 17 18 ··· 20 19 compatible = "hisilicon,hix5hd2-ir"; 21 20 reg = <0xf8001000 0x1000>; 22 21 interrupts = <0 47 4>; 23 - clocks = <&clock HIX5HD2_FIXED_24M>; 24 - hisilicon,power-syscon = <&sysctrl>; 22 + clocks = <&clock HIX5HD2_IR_CLOCK>; 25 23 linux,rc-map-name = "rc-tivo"; 26 24 };
+16 -9
drivers/media/rc/ir-hix5hd2.c
··· 75 75 { 76 76 u32 val; 77 77 78 - regmap_read(dev->regmap, IR_CLK, &val); 79 - if (on) { 80 - val &= ~IR_CLK_RESET; 81 - val |= IR_CLK_ENABLE; 78 + if (dev->regmap) { 79 + regmap_read(dev->regmap, IR_CLK, &val); 80 + if (on) { 81 + val &= ~IR_CLK_RESET; 82 + val |= IR_CLK_ENABLE; 83 + } else { 84 + val &= ~IR_CLK_ENABLE; 85 + val |= IR_CLK_RESET; 86 + } 87 + regmap_write(dev->regmap, IR_CLK, val); 82 88 } else { 83 - val &= ~IR_CLK_ENABLE; 84 - val |= IR_CLK_RESET; 89 + if (on) 90 + clk_prepare_enable(dev->clock); 91 + else 92 + clk_disable_unprepare(dev->clock); 85 93 } 86 - regmap_write(dev->regmap, IR_CLK, val); 87 94 } 88 95 89 96 static int hix5hd2_ir_config(struct hix5hd2_ir_priv *priv) ··· 214 207 priv->regmap = syscon_regmap_lookup_by_phandle(node, 215 208 "hisilicon,power-syscon"); 216 209 if (IS_ERR(priv->regmap)) { 217 - dev_err(dev, "no power-reg\n"); 218 - return -EINVAL; 210 + dev_info(dev, "no power-reg\n"); 211 + priv->regmap = NULL; 219 212 } 220 213 221 214 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);