Commit 1ad997e8 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: Drop MRFLD_PORT_NUM define

The info in the MRFLD_PORT_NUM define is duplicate with
the ATOMISP_CAMERA_NR_PORTS and N_MIPI_PORT_ID enum values.

Drop the MRFLD_PORT_NUM define and switch to N_MIPI_PORT_ID
since the [sensor_]lanes arrays are in enum mipi_port_id order.

Link: https://lore.kernel.org/r/20230518153733.195306-2-hdegoede@redhat.comReviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 1bb2a551
...@@ -112,7 +112,6 @@ ...@@ -112,7 +112,6 @@
/* MRFLD CSI lane configuration related */ /* MRFLD CSI lane configuration related */
#define MRFLD_PORT_CONFIG_NUM 8 #define MRFLD_PORT_CONFIG_NUM 8
#define MRFLD_PORT_NUM 3
#define MRFLD_PORT1_ENABLE_SHIFT 0 #define MRFLD_PORT1_ENABLE_SHIFT 0
#define MRFLD_PORT2_ENABLE_SHIFT 1 #define MRFLD_PORT2_ENABLE_SHIFT 1
#define MRFLD_PORT3_ENABLE_SHIFT 2 #define MRFLD_PORT3_ENABLE_SHIFT 2
......
...@@ -701,7 +701,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) ...@@ -701,7 +701,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp)
struct pci_dev *pdev = to_pci_dev(isp->dev); struct pci_dev *pdev = to_pci_dev(isp->dev);
static const struct { static const struct {
u8 code; u8 code;
u8 lanes[MRFLD_PORT_NUM]; u8 lanes[N_MIPI_PORT_ID];
} portconfigs[] = { } portconfigs[] = {
/* Tangier/Merrifield available lane configurations */ /* Tangier/Merrifield available lane configurations */
{ 0x00, { 4, 1, 0 } }, /* 00000 */ { 0x00, { 4, 1, 0 } }, /* 00000 */
...@@ -725,7 +725,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) ...@@ -725,7 +725,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp)
}; };
unsigned int i, j; unsigned int i, j;
u8 sensor_lanes[MRFLD_PORT_NUM] = { 0 }; u8 sensor_lanes[N_MIPI_PORT_ID] = { };
u32 csi_control; u32 csi_control;
int nportconfigs; int nportconfigs;
u32 port_config_mask; u32 port_config_mask;
...@@ -782,12 +782,12 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) ...@@ -782,12 +782,12 @@ int atomisp_csi_lane_config(struct atomisp_device *isp)
} }
for (i = 0; i < nportconfigs; i++) { for (i = 0; i < nportconfigs; i++) {
for (j = 0; j < MRFLD_PORT_NUM; j++) for (j = 0; j < N_MIPI_PORT_ID; j++)
if (sensor_lanes[j] && if (sensor_lanes[j] &&
sensor_lanes[j] != portconfigs[i].lanes[j]) sensor_lanes[j] != portconfigs[i].lanes[j])
break; break;
if (j == MRFLD_PORT_NUM) if (j == N_MIPI_PORT_ID)
break; /* Found matching setting */ break; /* Found matching setting */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment