Lines Matching full:ir
15 #define DRIVER_NAME "tango-ir"
55 static void tango_ir_handle_nec(struct tango_ir *ir) in tango_ir_handle_nec() argument
60 v = readl_relaxed(ir->rc5_base + IR_NEC_DATA); in tango_ir_handle_nec()
62 rc_repeat(ir->rc); in tango_ir_handle_nec()
67 rc_keydown(ir->rc, proto, code, 0); in tango_ir_handle_nec()
70 static void tango_ir_handle_rc5(struct tango_ir *ir) in tango_ir_handle_rc5() argument
74 data = readl_relaxed(ir->rc5_base + IR_RC5_DATA); in tango_ir_handle_rc5()
84 rc_keydown(ir->rc, RC_PROTO_RC5, code, toggle); in tango_ir_handle_rc5()
87 static void tango_ir_handle_rc6(struct tango_ir *ir) in tango_ir_handle_rc6() argument
91 data0 = readl_relaxed(ir->rc6_base + RC6_DATA0); in tango_ir_handle_rc6()
92 data1 = readl_relaxed(ir->rc6_base + RC6_DATA1); in tango_ir_handle_rc6()
103 rc_keydown(ir->rc, RC_PROTO_RC6_0, code, toggle); in tango_ir_handle_rc6()
108 struct tango_ir *ir = dev_id; in tango_ir_irq() local
112 rc5_stat = readl_relaxed(ir->rc5_base + IR_INT); in tango_ir_irq()
113 writel_relaxed(rc5_stat, ir->rc5_base + IR_INT); in tango_ir_irq()
115 rc6_stat = readl_relaxed(ir->rc6_base + RC6_CTRL); in tango_ir_irq()
116 writel_relaxed(rc6_stat, ir->rc6_base + RC6_CTRL); in tango_ir_irq()
122 tango_ir_handle_rc5(ir); in tango_ir_irq()
125 tango_ir_handle_nec(ir); in tango_ir_irq()
128 tango_ir_handle_rc6(ir); in tango_ir_irq()
135 struct tango_ir *ir = dev->priv; in tango_change_protocol() local
148 writel_relaxed(rc5_ctrl, ir->rc5_base + IR_CTRL); in tango_change_protocol()
149 writel_relaxed(rc6_ctrl, ir->rc6_base + RC6_CTRL); in tango_change_protocol()
159 struct tango_ir *ir; in tango_ir_probe() local
168 ir = devm_kzalloc(dev, sizeof(*ir), GFP_KERNEL); in tango_ir_probe()
169 if (!ir) in tango_ir_probe()
172 ir->rc5_base = devm_platform_ioremap_resource(pdev, 0); in tango_ir_probe()
173 if (IS_ERR(ir->rc5_base)) in tango_ir_probe()
174 return PTR_ERR(ir->rc5_base); in tango_ir_probe()
176 ir->rc6_base = devm_platform_ioremap_resource(pdev, 1); in tango_ir_probe()
177 if (IS_ERR(ir->rc6_base)) in tango_ir_probe()
178 return PTR_ERR(ir->rc6_base); in tango_ir_probe()
180 ir->clk = devm_clk_get(dev, NULL); in tango_ir_probe()
181 if (IS_ERR(ir->clk)) in tango_ir_probe()
182 return PTR_ERR(ir->clk); in tango_ir_probe()
196 rc->priv = ir; in tango_ir_probe()
197 ir->rc = rc; in tango_ir_probe()
199 err = clk_prepare_enable(ir->clk); in tango_ir_probe()
203 clkrate = clk_get_rate(ir->clk); in tango_ir_probe()
209 writel_relaxed(val, ir->rc5_base + IR_NEC_CTRL); in tango_ir_probe()
214 writel_relaxed(DISABLE_NEC, ir->rc5_base + IR_CTRL); in tango_ir_probe()
215 writel_relaxed(clkdiv, ir->rc5_base + IR_RC5_CLK_DIV); in tango_ir_probe()
216 writel_relaxed(ACK_IR_INT, ir->rc5_base + IR_INT); in tango_ir_probe()
221 writel_relaxed(ACK_RC6_INT, ir->rc6_base + RC6_CTRL); in tango_ir_probe()
222 writel_relaxed((clkdiv >> 2) << 18 | clkdiv, ir->rc6_base + RC6_CLKDIV); in tango_ir_probe()
225 dev_name(dev), ir); in tango_ir_probe()
233 platform_set_drvdata(pdev, ir); in tango_ir_probe()
237 clk_disable_unprepare(ir->clk); in tango_ir_probe()
243 struct tango_ir *ir = platform_get_drvdata(pdev); in tango_ir_remove() local
245 clk_disable_unprepare(ir->clk); in tango_ir_remove()
250 { .compatible = "sigma,smp8642-ir" },
265 MODULE_DESCRIPTION("SMP86xx IR decoder driver");