summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-20 13:42:52 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 13:32:16 +0300
commit268ff5bf6b2b4b560fb65a9527f14098de87b3a5 (patch)
treeecc06f630d86581f862e37d2374bccfc83d6f2ad
parentea419fdae5eb2edce2cdb790e1faa1b91d224f22 (diff)
downloadlinux-268ff5bf6b2b4b560fb65a9527f14098de87b3a5.tar.xz
media: atomisp: atomisp_dfs_tables.h: don't depend on ISP version
There's a dependency on this header for the ISP model. While this sounds really weird (as just one resolution needs it), as we don't know what's the right value, let's just keep it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h14
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c10
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
index e3acf7881627..f5e16e968cd3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_dfs_tables.h
@@ -128,7 +128,7 @@ static const struct atomisp_dfs_config dfs_config_merr_1179 = {
.dfs_table_size = ARRAY_SIZE(dfs_rules_merr_1179),
};
-static const struct atomisp_freq_scaling_rule dfs_rules_merr_117a[] = {
+static struct atomisp_freq_scaling_rule dfs_rules_merr_117a[] = {
{
.width = 1920,
.height = 1080,
@@ -140,11 +140,11 @@ static const struct atomisp_freq_scaling_rule dfs_rules_merr_117a[] = {
.width = 1080,
.height = 1920,
.fps = 30,
-#ifndef ISP2401
- .isp_freq = ISP_FREQ_266MHZ,
-#else
- .isp_freq = ISP_FREQ_400MHZ,
-#endif
+ /*
+ * FIXME: this is weird, but .isp_freq depends on
+ * the chip being ISP2400 or ISP2401. So, this should be
+ * initialized on runtime.
+ */
.run_mode = ATOMISP_RUN_MODE_VIDEO,
},
{
@@ -205,7 +205,7 @@ static const struct atomisp_freq_scaling_rule dfs_rules_merr_117a[] = {
},
};
-static const struct atomisp_dfs_config dfs_config_merr_117a = {
+static struct atomisp_dfs_config dfs_config_merr_117a = {
.lowest_freq = ISP_FREQ_200MHZ,
.max_freq_at_vmin = ISP_FREQ_200MHZ,
.highest_freq = ISP_FREQ_400MHZ,
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 8e3d2df74eaa..55bb513b933a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -1246,7 +1246,17 @@ static int atomisp_pci_probe(struct pci_dev *dev,
isp->dfs = &dfs_config_merr_1179;
break;
case ATOMISP_PCI_DEVICE_SOC_MRFLD_117A:
+ /*
+ * FIXME: This should likely be uneeded. Either one
+ * value is likely the correct one for this resolution
+ */
+ if (!atomisp_hw_is_isp2401)
+ dfs_rules_merr_117a[1].isp_freq = ISP_FREQ_266MHZ;
+ else
+ dfs_rules_merr_117a[1].isp_freq = ISP_FREQ_400MHZ;
+
isp->dfs = &dfs_config_merr_117a;
+
break;
default:
isp->dfs = &dfs_config_merr;