• Home
  • Raw
  • Download

Lines Matching refs:tc

46 	struct atmel_tc		*tc;  in atmel_tc_alloc()  local
50 list_for_each_entry(tc, &tc_list, node) { in atmel_tc_alloc()
51 if (tc->allocated) in atmel_tc_alloc()
54 if ((tc->pdev->dev.of_node && tc->id == block) || in atmel_tc_alloc()
55 (tc->pdev->id == block)) { in atmel_tc_alloc()
56 pdev = tc->pdev; in atmel_tc_alloc()
57 tc->allocated = true; in atmel_tc_alloc()
63 return pdev ? tc : NULL; in atmel_tc_alloc()
74 void atmel_tc_free(struct atmel_tc *tc) in atmel_tc_free() argument
77 if (tc->allocated) in atmel_tc_free()
78 tc->allocated = false; in atmel_tc_free()
109 struct atmel_tc *tc; in tc_probe() local
121 tc = devm_kzalloc(&pdev->dev, sizeof(struct atmel_tc), GFP_KERNEL); in tc_probe()
122 if (!tc) in tc_probe()
125 tc->pdev = pdev; in tc_probe()
131 tc->slow_clk = devm_clk_get(&pdev->dev, "slow_clk"); in tc_probe()
132 if (IS_ERR(tc->slow_clk)) in tc_probe()
133 return PTR_ERR(tc->slow_clk); in tc_probe()
135 tc->regs = devm_platform_ioremap_resource(pdev, 0); in tc_probe()
136 if (IS_ERR(tc->regs)) in tc_probe()
137 return PTR_ERR(tc->regs); in tc_probe()
144 tc->tcb_config = match->data; in tc_probe()
146 tc->id = of_alias_get_id(tc->pdev->dev.of_node, "tcb"); in tc_probe()
148 tc->id = pdev->id; in tc_probe()
151 tc->clk[0] = clk; in tc_probe()
152 tc->clk[1] = devm_clk_get(&pdev->dev, "t1_clk"); in tc_probe()
153 if (IS_ERR(tc->clk[1])) in tc_probe()
154 tc->clk[1] = clk; in tc_probe()
155 tc->clk[2] = devm_clk_get(&pdev->dev, "t2_clk"); in tc_probe()
156 if (IS_ERR(tc->clk[2])) in tc_probe()
157 tc->clk[2] = clk; in tc_probe()
159 tc->irq[0] = irq; in tc_probe()
160 tc->irq[1] = platform_get_irq(pdev, 1); in tc_probe()
161 if (tc->irq[1] < 0) in tc_probe()
162 tc->irq[1] = irq; in tc_probe()
163 tc->irq[2] = platform_get_irq(pdev, 2); in tc_probe()
164 if (tc->irq[2] < 0) in tc_probe()
165 tc->irq[2] = irq; in tc_probe()
168 writel(ATMEL_TC_ALL_IRQ, tc->regs + ATMEL_TC_REG(i, IDR)); in tc_probe()
171 list_add_tail(&tc->node, &tc_list); in tc_probe()
174 platform_set_drvdata(pdev, tc); in tc_probe()
182 struct atmel_tc *tc = platform_get_drvdata(pdev); in tc_shutdown() local
185 writel(ATMEL_TC_ALL_IRQ, tc->regs + ATMEL_TC_REG(i, IDR)); in tc_shutdown()