if (vfe->id >= camss->res->vfe_num)
return;
- device_link_del(camss->genpd_link[vfe->id]);
+ device_link_del(vfe->genpd_link);
}
/*
static int vfe_pm_domain_on(struct vfe_device *vfe)
{
struct camss *camss = vfe->camss;
- enum vfe_line_id id = vfe->id;
- if (id >= camss->res->vfe_num)
+ if (vfe->id >= camss->res->vfe_num)
return 0;
- camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
- DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME |
- DL_FLAG_RPM_ACTIVE);
- if (!camss->genpd_link[id])
+ vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
+ DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME |
+ DL_FLAG_RPM_ACTIVE);
+ if (!vfe->genpd_link)
return -EINVAL;
return 0;
*/
static void vfe_pm_domain_off(struct vfe_device *vfe)
{
- struct camss *camss;
-
if (!vfe)
return;
- camss = vfe->camss;
-
- device_link_del(camss->genpd_link[vfe->id]);
+ device_link_del(vfe->genpd_link);
}
/*
static int vfe_pm_domain_on(struct vfe_device *vfe)
{
struct camss *camss = vfe->camss;
- enum vfe_line_id id = vfe->id;
- camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
+ vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
- if (!camss->genpd_link[id]) {
- dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
+ if (!vfe->genpd_link) {
+ dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", vfe->id);
return -EINVAL;
}
*/
static void vfe_pm_domain_off(struct vfe_device *vfe)
{
- struct camss *camss = vfe->camss;
-
- device_link_del(camss->genpd_link[vfe->id]);
+ device_link_del(vfe->genpd_link);
}
/*
static int vfe_pm_domain_on(struct vfe_device *vfe)
{
struct camss *camss = vfe->camss;
- enum vfe_line_id id = vfe->id;
- camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
+ vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
- if (!camss->genpd_link[id]) {
- dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
+ if (!vfe->genpd_link) {
+ dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", vfe->id);
return -EINVAL;
}
if (vfe->id >= camss->res->vfe_num)
return;
- device_link_del(camss->genpd_link[vfe->id]);
+ device_link_del(vfe->genpd_link);
}
/*
static int vfe_pm_domain_on(struct vfe_device *vfe)
{
struct camss *camss = vfe->camss;
- enum vfe_line_id id = vfe->id;
- if (id >= camss->res->vfe_num)
+ if (vfe->id >= camss->res->vfe_num)
return 0;
- camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
- DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME |
- DL_FLAG_RPM_ACTIVE);
- if (!camss->genpd_link[id])
+ vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
+ DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME |
+ DL_FLAG_RPM_ACTIVE);
+ if (!vfe->genpd_link)
return -EINVAL;
return 0;
if (!res->line_num)
return -EINVAL;
+ if (res->has_pd)
+ vfe->genpd = camss->genpd[id];
+
vfe->line_num = res->line_num;
vfe->ops->subdev_init(dev, vfe);
const struct vfe_hw_ops_gen1 *ops_gen1;
struct vfe_isr_ops isr_ops;
struct camss_video_ops video_ops;
+ struct device *genpd;
+ struct device_link *genpd_link;
};
struct camss_subdev_resources;