static int s3c_csis_probe(struct platform_device *pdev) { struct s3c_platform_csis *pdata; struct resource *res; s3c_csis_set_info(); s3c_csis->dev = &pdev->dev; s3c_csis->clockon = 0; pdata = to_csis_plat(&pdev->dev); if (pdata->cfg_gpio) pdata->cfg_gpio(); /* Get csis power domain regulator */ s3c_csis->regulator = regulator_get(&pdev->dev, "pd"); if (IS_ERR(s3c_csis->regulator)) { err("%s: failed to get regulator %s\n", __func__, pdev->name); return PTR_ERR(s3c_csis->regulator); } /* clock & power on */ s3c_csis_clk_on(pdev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { err("failed to get io memory region\n"); return -EINVAL; } res = request_mem_region(res->start, res->end - res->start + 1, pdev->name); if (!res) { err("failed to request io memory region\n"); return -EINVAL; } /* ioremap for register block */ s3c_csis->regs = ioremap(res->start, res->end - res->start + 1); if (!s3c_csis->regs) { err("failed to remap io region\n"); return -EINVAL; } /* irq */ s3c_csis->irq = platform_get_irq(pdev, 0); if (request_irq(s3c_csis->irq, s3c_csis_irq, IRQF_DISABLED, \ s3c_csis->name, s3c_csis)) err("request_irq failed\n"); pr_info("Samsung MIPI-CSI2 driver probed successfully\n"); s3c_csis_clk_off(pdev); return 0; }
void s3c_csis_stop(struct platform_device *pdev) { struct s3c_platform_csis *plat; s3c_csis_disable_interrupt(); s3c_csis_system_off(); s3c_csis_phy_off(); if(pdev) plat = to_csis_plat(&pdev->dev); else plat = to_csis_plat(s3c_csis->dev); if (plat->cfg_phy_global) plat->cfg_phy_global(pdev, 0); s3c_csis_clk_off(to_platform_device(s3c_csis->dev)); info("Samsung MIPI-CSI2 operation stoped\n"); }
/* sleep */ int s3c_csis_suspend(struct platform_device *pdev, pm_message_t state) { s3c_csis_clk_off(pdev); return 0; }