media: mgb4: Unify register names in inputs/outputs

Unify the names of HW hsync/vsync registers between the inputs and outputs.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
Martin Tůma
2024-11-20 15:48:45 +01:00
committed by Hans Verkuil
parent 8f242f8466
commit 771c477072
3 changed files with 18 additions and 18 deletions

View File

@@ -333,7 +333,7 @@ static ssize_t hsync_width_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal);
vindev->config->regs.hsync);
return sprintf(buf, "%u\n", (sig & 0x00FF0000) >> 16);
}
@@ -344,7 +344,7 @@ static ssize_t vsync_width_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal2);
vindev->config->regs.vsync);
return sprintf(buf, "%u\n", (sig & 0x00FF0000) >> 16);
}
@@ -355,7 +355,7 @@ static ssize_t hback_porch_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal);
vindev->config->regs.hsync);
return sprintf(buf, "%u\n", (sig & 0x0000FF00) >> 8);
}
@@ -366,7 +366,7 @@ static ssize_t hfront_porch_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal);
vindev->config->regs.hsync);
return sprintf(buf, "%u\n", (sig & 0x000000FF));
}
@@ -377,7 +377,7 @@ static ssize_t vback_porch_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal2);
vindev->config->regs.vsync);
return sprintf(buf, "%u\n", (sig & 0x0000FF00) >> 8);
}
@@ -388,7 +388,7 @@ static ssize_t vfront_porch_show(struct device *dev,
struct video_device *vdev = to_video_device(dev);
struct mgb4_vin_dev *vindev = video_get_drvdata(vdev);
u32 sig = mgb4_read_reg(&vindev->mgbdev->video,
vindev->config->regs.signal2);
vindev->config->regs.vsync);
return sprintf(buf, "%u\n", (sig & 0x000000FF));
}

View File

@@ -143,8 +143,8 @@ static int get_timings(struct mgb4_vin_dev *vindev,
u32 status = mgb4_read_reg(video, regs->status);
u32 pclk = mgb4_read_reg(video, regs->pclk);
u32 signal = mgb4_read_reg(video, regs->signal);
u32 signal2 = mgb4_read_reg(video, regs->signal2);
u32 hsync = mgb4_read_reg(video, regs->hsync);
u32 vsync = mgb4_read_reg(video, regs->vsync);
u32 resolution = mgb4_read_reg(video, regs->resolution);
if (!(status & (1U << 2)))
@@ -161,12 +161,12 @@ static int get_timings(struct mgb4_vin_dev *vindev,
if (status & (1U << 13))
timings->bt.polarities |= V4L2_DV_VSYNC_POS_POL;
timings->bt.pixelclock = pclk * 1000;
timings->bt.hsync = (signal & 0x00FF0000) >> 16;
timings->bt.vsync = (signal2 & 0x00FF0000) >> 16;
timings->bt.hbackporch = (signal & 0x0000FF00) >> 8;
timings->bt.hfrontporch = signal & 0x000000FF;
timings->bt.vbackporch = (signal2 & 0x0000FF00) >> 8;
timings->bt.vfrontporch = signal2 & 0x000000FF;
timings->bt.hsync = (hsync & 0x00FF0000) >> 16;
timings->bt.vsync = (vsync & 0x00FF0000) >> 16;
timings->bt.hbackporch = (hsync & 0x0000FF00) >> 8;
timings->bt.hfrontporch = hsync & 0x000000FF;
timings->bt.vbackporch = (vsync & 0x0000FF00) >> 8;
timings->bt.vfrontporch = vsync & 0x000000FF;
return 0;
}
@@ -864,9 +864,9 @@ static void create_debugfs(struct mgb4_vin_dev *vindev)
vindev->regs[5].name = "PCLK_FREQUENCY";
vindev->regs[5].offset = vindev->config->regs.pclk;
vindev->regs[6].name = "VIDEO_PARAMS_1";
vindev->regs[6].offset = vindev->config->regs.signal;
vindev->regs[6].offset = vindev->config->regs.hsync;
vindev->regs[7].name = "VIDEO_PARAMS_2";
vindev->regs[7].offset = vindev->config->regs.signal2;
vindev->regs[7].offset = vindev->config->regs.vsync;
vindev->regs[8].name = "PADDING_PIXELS";
vindev->regs[8].offset = vindev->config->regs.padding;
if (has_timeperframe(video)) {

View File

@@ -22,8 +22,8 @@ struct mgb4_vin_regs {
u32 frame_period;
u32 sync;
u32 pclk;
u32 signal;
u32 signal2;
u32 hsync;
u32 vsync;
u32 padding;
u32 timer;
};