media: qcom: camss: Amalgamate struct resource with struct resource_ispif
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 25 Sep 2023 15:46:51 +0000 (16:46 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 7 Oct 2023 08:55:43 +0000 (10:55 +0200)
There is no good reason to differentiate the two resource structures
here. As part of a general tidyup of the declaration and passing of
resources within in the CAMSS driver it will be advantageous to have
one unified resource structure.

The two structures are very similar anyway thus leading more credence
still to the argument there should be only one.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/qcom/camss/camss-ispif.c
drivers/media/platform/qcom/camss/camss-ispif.h
drivers/media/platform/qcom/camss/camss.c
drivers/media/platform/qcom/camss/camss.h

index 1c7e4b1b4940196051af66d812e4e50f1e1db1de..61765b874b9a25b8371ea4a67176ec3936a98381 100644 (file)
@@ -1095,7 +1095,7 @@ static int ispif_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
  * Return 0 on success or a negative error code otherwise
  */
 int msm_ispif_subdev_init(struct camss *camss,
-                         const struct resources_ispif *res)
+                         const struct resources *res)
 {
        struct device *dev = camss->dev;
        struct ispif_device *ispif = camss->ispif;
@@ -1152,7 +1152,7 @@ int msm_ispif_subdev_init(struct camss *camss,
 
        /* Interrupt */
 
-       ret = platform_get_irq_byname(pdev, res->interrupt);
+       ret = platform_get_irq_byname(pdev, res->interrupt[0]);
        if (ret < 0)
                return ret;
 
index fdf28e68cc7d87e79e6ea68c331cb58f4680f10c..c7c41f7afcaada7bfd519d7995b9a26709897392 100644 (file)
@@ -66,10 +66,10 @@ struct ispif_device {
        struct camss *camss;
 };
 
-struct resources_ispif;
+struct resources;
 
 int msm_ispif_subdev_init(struct camss *camss,
-                         const struct resources_ispif *res);
+                         const struct resources *res);
 
 int msm_ispif_register_entities(struct ispif_device *ispif,
                                struct v4l2_device *v4l2_dev);
index c6df862c79e39b9cb7f6efd8b88c5150e66c47d7..fa0eb30d77c26a1e51703113c14dcf2482d8c82a 100644 (file)
@@ -93,14 +93,14 @@ static const struct resources csid_res_8x16[] = {
        },
 };
 
-static const struct resources_ispif ispif_res_8x16 = {
+static const struct resources ispif_res_8x16 = {
        /* ISPIF */
        .clock = { "top_ahb", "ahb", "ispif_ahb",
                   "csi0", "csi0_pix", "csi0_rdi",
                   "csi1", "csi1_pix", "csi1_rdi" },
        .clock_for_reset = { "vfe0", "csi_vfe0" },
        .reg = { "ispif", "csi_clk_mux" },
-       .interrupt = "ispif"
+       .interrupt = { "ispif" }
 
 };
 
@@ -234,7 +234,7 @@ static const struct resources csid_res_8x96[] = {
        }
 };
 
-static const struct resources_ispif ispif_res_8x96 = {
+static const struct resources ispif_res_8x96 = {
        /* ISPIF */
        .clock = { "top_ahb", "ahb", "ispif_ahb",
                   "csi0", "csi0_pix", "csi0_rdi",
@@ -243,7 +243,7 @@ static const struct resources_ispif ispif_res_8x96 = {
                   "csi3", "csi3_pix", "csi3_rdi" },
        .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" },
        .reg = { "ispif", "csi_clk_mux" },
-       .interrupt = "ispif"
+       .interrupt = { "ispif" }
 };
 
 static const struct resources vfe_res_8x96[] = {
@@ -410,7 +410,7 @@ static const struct resources csid_res_660[] = {
        }
 };
 
-static const struct resources_ispif ispif_res_660 = {
+static const struct resources ispif_res_660 = {
        /* ISPIF */
        .clock = { "top_ahb", "ahb", "ispif_ahb",
                   "csi0", "csi0_pix", "csi0_rdi",
@@ -419,7 +419,7 @@ static const struct resources_ispif ispif_res_660 = {
                   "csi3", "csi3_pix", "csi3_rdi" },
        .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" },
        .reg = { "ispif", "csi_clk_mux" },
-       .interrupt = "ispif"
+       .interrupt = { "ispif" }
 };
 
 static const struct resources vfe_res_660[] = {
@@ -1122,7 +1122,7 @@ static int camss_init_subdevices(struct camss *camss)
 {
        const struct resources *csiphy_res;
        const struct resources *csid_res;
-       const struct resources_ispif *ispif_res;
+       const struct resources *ispif_res;
        const struct resources *vfe_res;
        unsigned int i;
        int ret;
index f6c326cb853b85ef6b5d557079844520a226a5c1..e95211cdb1fd6c27a0f0d51a37f0a34f11ac6670 100644 (file)
 struct resources {
        char *regulators[CAMSS_RES_MAX];
        char *clock[CAMSS_RES_MAX];
+       char *clock_for_reset[CAMSS_RES_MAX];
        u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX];
        char *reg[CAMSS_RES_MAX];
        char *interrupt[CAMSS_RES_MAX];
 };
 
-struct resources_ispif {
-       char *clock[CAMSS_RES_MAX];
-       char *clock_for_reset[CAMSS_RES_MAX];
-       char *reg[CAMSS_RES_MAX];
-       char *interrupt;
-};
-
 struct icc_bw_tbl {
        u32 avg;
        u32 peak;