Lines Matching refs:pdev

136 static	int ti_tscadc_probe(struct platform_device *pdev)  in ti_tscadc_probe()  argument
141 struct device_node *node = pdev->dev.of_node; in ti_tscadc_probe()
151 if (!pdev->dev.of_node) { in ti_tscadc_probe()
152 dev_err(&pdev->dev, "Could not find valid DT data.\n"); in ti_tscadc_probe()
156 node = of_get_child_by_name(pdev->dev.of_node, "tsc"); in ti_tscadc_probe()
160 node = of_get_child_by_name(pdev->dev.of_node, "adc"); in ti_tscadc_probe()
164 dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n", in ti_tscadc_probe()
171 dev_err(&pdev->dev, "Number of i/p channels more than 8\n"); in ti_tscadc_probe()
175 dev_err(&pdev->dev, "Need atleast one channel.\n"); in ti_tscadc_probe()
180 dev_err(&pdev->dev, "Too many step configurations requested\n"); in ti_tscadc_probe()
185 tscadc = devm_kzalloc(&pdev->dev, in ti_tscadc_probe()
188 dev_err(&pdev->dev, "failed to allocate memory.\n"); in ti_tscadc_probe()
191 tscadc->dev = &pdev->dev; in ti_tscadc_probe()
193 err = platform_get_irq(pdev, 0); in ti_tscadc_probe()
195 dev_err(&pdev->dev, "no irq ID is specified.\n"); in ti_tscadc_probe()
200 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in ti_tscadc_probe()
201 tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res); in ti_tscadc_probe()
205 tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev, in ti_tscadc_probe()
208 dev_err(&pdev->dev, "regmap init failed\n"); in ti_tscadc_probe()
216 pm_runtime_enable(&pdev->dev); in ti_tscadc_probe()
217 pm_runtime_get_sync(&pdev->dev); in ti_tscadc_probe()
227 clk = clk_get(&pdev->dev, "adc_tsc_fck"); in ti_tscadc_probe()
229 dev_err(&pdev->dev, "failed to get TSC fck\n"); in ti_tscadc_probe()
283 err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, in ti_tscadc_probe()
288 device_init_wakeup(&pdev->dev, true); in ti_tscadc_probe()
289 platform_set_drvdata(pdev, tscadc); in ti_tscadc_probe()
293 pm_runtime_put_sync(&pdev->dev); in ti_tscadc_probe()
294 pm_runtime_disable(&pdev->dev); in ti_tscadc_probe()
299 static int ti_tscadc_remove(struct platform_device *pdev) in ti_tscadc_remove() argument
301 struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev); in ti_tscadc_remove()
305 pm_runtime_put_sync(&pdev->dev); in ti_tscadc_remove()
306 pm_runtime_disable(&pdev->dev); in ti_tscadc_remove()