Lines Matching refs:tsadc
29 struct mx25_tsadc *tsadc = irq_desc_get_handler_data(desc); in mx25_tsadc_irq_handler() local
35 regmap_read(tsadc->regs, MX25_TSC_TGSR, &status); in mx25_tsadc_irq_handler()
38 generic_handle_domain_irq(tsadc->domain, 1); in mx25_tsadc_irq_handler()
41 generic_handle_domain_irq(tsadc->domain, 0); in mx25_tsadc_irq_handler()
49 struct mx25_tsadc *tsadc = d->host_data; in mx25_tsadc_domain_map() local
51 irq_set_chip_data(irq, tsadc); in mx25_tsadc_domain_map()
65 struct mx25_tsadc *tsadc) in mx25_tsadc_setup_irq() argument
75 tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops, in mx25_tsadc_setup_irq()
76 tsadc); in mx25_tsadc_setup_irq()
77 if (!tsadc->domain) { in mx25_tsadc_setup_irq()
82 irq_set_chained_handler_and_data(irq, mx25_tsadc_irq_handler, tsadc); in mx25_tsadc_setup_irq()
89 struct mx25_tsadc *tsadc = platform_get_drvdata(pdev); in mx25_tsadc_unset_irq() local
94 irq_domain_remove(tsadc->domain); in mx25_tsadc_unset_irq()
101 struct mx25_tsadc *tsadc) in mx25_tsadc_setup_clk() argument
113 clk_get_rate(tsadc->clk)); in mx25_tsadc_setup_clk()
115 clk_div = DIV_ROUND_UP(clk_get_rate(tsadc->clk), 1750000); in mx25_tsadc_setup_clk()
129 clk_get_rate(tsadc->clk) / (2 * clk_div + 2)); in mx25_tsadc_setup_clk()
131 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, in mx25_tsadc_setup_clk()
139 struct mx25_tsadc *tsadc; in mx25_tsadc_probe() local
143 tsadc = devm_kzalloc(dev, sizeof(*tsadc), GFP_KERNEL); in mx25_tsadc_probe()
144 if (!tsadc) in mx25_tsadc_probe()
151 tsadc->regs = devm_regmap_init_mmio(dev, iomem, in mx25_tsadc_probe()
153 if (IS_ERR(tsadc->regs)) { in mx25_tsadc_probe()
155 return PTR_ERR(tsadc->regs); in mx25_tsadc_probe()
158 tsadc->clk = devm_clk_get(dev, "ipg"); in mx25_tsadc_probe()
159 if (IS_ERR(tsadc->clk)) { in mx25_tsadc_probe()
161 return PTR_ERR(tsadc->clk); in mx25_tsadc_probe()
165 mx25_tsadc_setup_clk(pdev, tsadc); in mx25_tsadc_probe()
168 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_CLK_EN, in mx25_tsadc_probe()
170 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_TSC_RST, in mx25_tsadc_probe()
174 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_POWERMODE_MASK, in mx25_tsadc_probe()
176 regmap_update_bits(tsadc->regs, MX25_TSC_TGCR, MX25_TGCR_INTREFEN, in mx25_tsadc_probe()
179 ret = mx25_tsadc_setup_irq(pdev, tsadc); in mx25_tsadc_probe()
183 platform_set_drvdata(pdev, tsadc); in mx25_tsadc_probe()