struct resource *res;
struct platform_device *pdev;
struct regmap_field *fields[F_MAX_FIELDS];
+
+ struct cal_dev *cal;
+ unsigned int instance;
};
struct cal_dev {
}
static int cal_camerarx_regmap_init(struct cal_dev *cal,
- struct cal_camerarx *phy,
- unsigned int idx)
+ struct cal_camerarx *phy)
{
const struct cal_camerarx_data *phy_data;
unsigned int i;
if (!cal->data)
return -EINVAL;
- phy_data = &cal->data->camerarx[idx];
+ phy_data = &cal->data->camerarx[phy->instance];
for (i = 0; i < F_MAX_FIELDS; i++) {
struct reg_field field = {
/*
* Camera Instance access block
*/
-static struct cal_camerarx *cc_create(struct cal_dev *cal, unsigned int core)
+static struct cal_camerarx *cc_create(struct cal_dev *cal,
+ unsigned int instance)
{
struct platform_device *pdev = cal->pdev;
struct cal_camerarx *phy;
if (!phy)
return ERR_PTR(-ENOMEM);
+ phy->cal = cal;
+ phy->instance = instance;
+
phy->res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
- (core == 0) ?
+ (instance == 0) ?
"cal_rx_core0" :
"cal_rx_core1");
phy->base = devm_ioremap_resource(&pdev->dev, phy->res);
cal_dbg(1, cal, "ioresource %s at %pa - %pa\n",
phy->res->name, &phy->res->start, &phy->res->end);
- ret = cal_camerarx_regmap_init(cal, phy, core);
+ ret = cal_camerarx_regmap_init(cal, phy);
if (ret)
return ERR_PTR(ret);