mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
media: qcom: camss: Add hooks to get CSID wrapper resources
New SoCs have CSID devices inside of a shared "wrapper" i.e. a set of regs which is responsible for manging the muxes of the CSID to various other blocks throughout CAMSS. Not every SoC has this top-level muxing layer so make it optional depending on whether its declared as a resource or not. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
4f45d65b78
commit
288db22ef9
@ -1780,6 +1780,7 @@ err_cleanup:
|
||||
*/
|
||||
static int camss_init_subdevices(struct camss *camss)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(camss->dev);
|
||||
const struct camss_resources *res = camss->res;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
@ -1806,6 +1807,17 @@ static int camss_init_subdevices(struct camss *camss)
|
||||
}
|
||||
}
|
||||
|
||||
/* Get optional CSID wrapper regs shared between CSID devices */
|
||||
if (res->csid_wrapper_res) {
|
||||
char *reg = res->csid_wrapper_res->reg;
|
||||
void __iomem *base;
|
||||
|
||||
base = devm_platform_ioremap_resource_byname(pdev, reg);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
camss->csid_wrapper_base = base;
|
||||
}
|
||||
|
||||
for (i = 0; i < camss->res->csid_num; i++) {
|
||||
ret = msm_csid_subdev_init(camss, &camss->csid[i],
|
||||
&res->csid_res[i], i);
|
||||
|
@ -66,6 +66,10 @@ struct resources_icc {
|
||||
struct icc_bw_tbl icc_bw_tbl;
|
||||
};
|
||||
|
||||
struct resources_wrapper {
|
||||
char *reg;
|
||||
};
|
||||
|
||||
enum pm_domain {
|
||||
PM_DOMAIN_VFE0 = 0,
|
||||
PM_DOMAIN_VFE1 = 1,
|
||||
@ -93,6 +97,7 @@ struct camss_resources {
|
||||
const struct camss_subdev_resources *csid_res;
|
||||
const struct camss_subdev_resources *ispif_res;
|
||||
const struct camss_subdev_resources *vfe_res;
|
||||
const struct resources_wrapper *csid_wrapper_res;
|
||||
const struct resources_icc *icc_res;
|
||||
const unsigned int icc_path_num;
|
||||
const unsigned int csiphy_num;
|
||||
@ -110,6 +115,7 @@ struct camss {
|
||||
struct csid_device *csid;
|
||||
struct ispif_device *ispif;
|
||||
struct vfe_device *vfe;
|
||||
void __iomem *csid_wrapper_base;
|
||||
atomic_t ref_count;
|
||||
int genpd_num;
|
||||
struct device *genpd;
|
||||
|
Loading…
Reference in New Issue
Block a user