static int isp_xclk_init(struct isp_device *isp)
{
- struct isp_platform_data *pdata = isp->pdata;
struct device_node *np = isp->dev->of_node;
struct clk_init_data init;
unsigned int i;
xclk->clk = clk_register(NULL, &xclk->hw);
if (IS_ERR(xclk->clk))
return PTR_ERR(xclk->clk);
-
- /* When instantiated from DT we don't need to register clock
- * aliases.
- */
- if (np)
- continue;
-
- if (!pdata || (pdata->xclks[i].con_id == NULL &&
- pdata->xclks[i].dev_id == NULL))
- continue;
-
- xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
- if (xclk->lookup == NULL)
- return -ENOMEM;
-
- xclk->lookup->con_id = pdata->xclks[i].con_id;
- xclk->lookup->dev_id = pdata->xclks[i].dev_id;
- xclk->lookup->clk = xclk->clk;
-
- clkdev_add(xclk->lookup);
}
if (np)
if (!IS_ERR(xclk->clk))
clk_unregister(xclk->clk);
-
- if (xclk->lookup)
- clkdev_drop(xclk->lookup);
}
}
struct isp_bus_cfg *bus;
};
-struct isp_platform_xclk {
- const char *dev_id;
- const char *con_id;
-};
-
struct isp_platform_data {
- struct isp_platform_xclk xclks[2];
struct isp_platform_subdev *subdevs;
void (*set_constraints)(struct isp_device *isp, bool enable);
};