OSDN Git Service

media: camss: vfe: Rework vfe_hw_version_read() function definition
authorRobert Foss <robert.foss@linaro.org>
Mon, 26 Jul 2021 08:01:13 +0000 (10:01 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:37 +0000 (10:07 +0200)
Expose the VFE version by returning the value read from the HW_VERSION
register.

Secondly, change the name of this function to conform with the CSID
equivalent.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/camss/camss-vfe-170.c
drivers/media/platform/qcom/camss/camss-vfe-4-1.c
drivers/media/platform/qcom/camss/camss-vfe-4-7.c
drivers/media/platform/qcom/camss/camss-vfe-4-8.c
drivers/media/platform/qcom/camss/camss-vfe.c
drivers/media/platform/qcom/camss/camss-vfe.h

index 8ef4e80..5c083d7 100644 (file)
 #define VFE_BUS_WM_FRAME_INC(n)                        (0x2258 + (n) * 0x100)
 #define VFE_BUS_WM_BURST_LIMIT(n)              (0x225c + (n) * 0x100)
 
-static void vfe_hw_version_read(struct vfe_device *vfe)
+static u32 vfe_hw_version(struct vfe_device *vfe)
 {
        u32 hw_version = readl_relaxed(vfe->base + VFE_HW_VERSION);
 
@@ -187,6 +187,8 @@ static void vfe_hw_version_read(struct vfe_device *vfe)
 
        dev_dbg(vfe->camss->dev, "VFE HW Version = %u.%u.%u\n",
                gen, rev, step);
+
+       return hw_version;
 }
 
 static inline void vfe_reg_clr(struct vfe_device *vfe, u32 reg, u32 clr_bits)
@@ -772,7 +774,7 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
 
 const struct vfe_hw_ops vfe_ops_170 = {
        .global_reset = vfe_global_reset,
-       .hw_version_read = vfe_hw_version_read,
+       .hw_version = vfe_hw_version,
        .isr_read = vfe_isr_read,
        .isr = vfe_isr,
        .pm_domain_off = vfe_pm_domain_off,
index 614c266..7b7c9a0 100644 (file)
 #define MSM_VFE_VFE0_UB_SIZE 1023
 #define MSM_VFE_VFE0_UB_SIZE_RDI (MSM_VFE_VFE0_UB_SIZE / 3)
 
-static void vfe_hw_version_read(struct vfe_device *vfe)
+static u32 vfe_hw_version(struct vfe_device *vfe)
 {
        u32 hw_version = readl_relaxed(vfe->base + VFE_0_HW_VERSION);
 
        dev_dbg(vfe->camss->dev, "VFE HW Version = 0x%08x\n", hw_version);
+
+       return hw_version;
 }
 
 static u16 vfe_get_ub_size(u8 vfe_id)
@@ -1004,7 +1006,7 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
 
 const struct vfe_hw_ops vfe_ops_4_1 = {
        .global_reset = vfe_global_reset,
-       .hw_version_read = vfe_hw_version_read,
+       .hw_version = vfe_hw_version,
        .isr_read = vfe_isr_read,
        .isr = vfe_isr,
        .pm_domain_off = vfe_pm_domain_off,
index aa175e0..2836b12 100644 (file)
 #define MSM_VFE_VFE1_UB_SIZE 1535
 #define MSM_VFE_VFE1_UB_SIZE_RDI (MSM_VFE_VFE1_UB_SIZE / 3)
 
-static void vfe_hw_version_read(struct vfe_device *vfe)
+static u32 vfe_hw_version(struct vfe_device *vfe)
 {
        u32 hw_version = readl_relaxed(vfe->base + VFE_0_HW_VERSION);
 
        dev_dbg(vfe->camss->dev, "VFE HW Version = 0x%08x\n", hw_version);
+
+       return hw_version;
 }
 
 static u16 vfe_get_ub_size(u8 vfe_id)
@@ -1196,7 +1198,7 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
 
 const struct vfe_hw_ops vfe_ops_4_7 = {
        .global_reset = vfe_global_reset,
-       .hw_version_read = vfe_hw_version_read,
+       .hw_version = vfe_hw_version,
        .isr_read = vfe_isr_read,
        .isr = vfe_isr,
        .pm_domain_off = vfe_pm_domain_off,
index b897f51..1951923 100644 (file)
 #define MSM_VFE_VFE1_UB_SIZE 1535
 #define MSM_VFE_VFE1_UB_SIZE_RDI (MSM_VFE_VFE1_UB_SIZE / 3)
 
-static void vfe_hw_version_read(struct vfe_device *vfe)
+static u32 vfe_hw_version(struct vfe_device *vfe)
 {
        u32 hw_version = readl_relaxed(vfe->base + VFE_0_HW_VERSION);
 
        dev_dbg(vfe->camss->dev, "VFE HW Version = 0x%08x\n", hw_version);
+
+       return hw_version;
 }
 
 static inline void vfe_reg_clr(struct vfe_device *vfe, u32 reg, u32 clr_bits)
@@ -1180,7 +1182,7 @@ static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
 
 const struct vfe_hw_ops vfe_ops_4_8 = {
        .global_reset = vfe_global_reset,
-       .hw_version_read = vfe_hw_version_read,
+       .hw_version = vfe_hw_version,
        .isr_read = vfe_isr_read,
        .isr = vfe_isr,
        .pm_domain_off = vfe_pm_domain_off,
index 9b4f813..6b2f33f 100644 (file)
@@ -1299,7 +1299,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
                return -EINVAL;
        }
        vfe->ops->subdev_init(dev, vfe);
-       vfe->ops->hw_version_read(vfe);
+       vfe->ops->hw_version(vfe);
 
        /* Memory */
 
index cca2518..f166d17 100644 (file)
@@ -103,7 +103,7 @@ struct vfe_device;
 struct vfe_hw_ops {
        void (*enable_irq_common)(struct vfe_device *vfe);
        void (*global_reset)(struct vfe_device *vfe);
-       void (*hw_version_read)(struct vfe_device *vfe);
+       u32 (*hw_version)(struct vfe_device *vfe);
        irqreturn_t (*isr)(int irq, void *dev);
        void (*isr_read)(struct vfe_device *vfe, u32 *value0, u32 *value1);
        void (*pm_domain_off)(struct vfe_device *vfe);