diff options
author | Corentin Labbe <clabbe@baylibre.com> | 2020-09-25 21:30:34 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-10-01 10:42:11 +0300 |
commit | 7b1f41e037844a097a156e1a0d1d651b800f5221 (patch) | |
tree | adeccfbc183248bb42bdc705bb7d5ffc543220bd /drivers | |
parent | 886986804ad45618b58b160e6ab003d5473f5838 (diff) | |
download | linux-7b1f41e037844a097a156e1a0d1d651b800f5221.tar.xz |
media: zoran: use ZR_NORM
Instead of using hardcoded numbers, let's use some define for ZR NORM.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/zoran/zoran.h | 4 | ||||
-rw-r--r-- | drivers/staging/media/zoran/zoran_card.c | 8 | ||||
-rw-r--r-- | drivers/staging/media/zoran/zoran_driver.c | 6 |
3 files changed, 11 insertions, 7 deletions
diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h index 8f3faa4eb60f..87ca324f6ec2 100644 --- a/drivers/staging/media/zoran/zoran.h +++ b/drivers/staging/media/zoran/zoran.h @@ -22,6 +22,10 @@ #include <media/v4l2-ctrls.h> #include <media/v4l2-fh.h> +#define ZR_NORM_PAL 0 +#define ZR_NORM_NTSC 1 +#define ZR_NORM_SECAM 2 + struct zoran_sync { unsigned long frame; /* number of buffer that has been free'd */ unsigned long length; /* number of code bytes in buffer (capture only) */ diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c index 9fe2bc2b036a..8be7f8f0a020 100644 --- a/drivers/staging/media/zoran/zoran_card.c +++ b/drivers/staging/media/zoran/zoran_card.c @@ -911,18 +911,18 @@ static int zr36057_init(struct zoran *zr) default_norm = 0; if (default_norm == 0) { zr->norm = V4L2_STD_PAL; - zr->timing = zr->card.tvn[0]; + zr->timing = zr->card.tvn[ZR_NORM_PAL]; } else if (default_norm == 1) { zr->norm = V4L2_STD_NTSC; - zr->timing = zr->card.tvn[1]; + zr->timing = zr->card.tvn[ZR_NORM_NTSC]; } else { zr->norm = V4L2_STD_SECAM; - zr->timing = zr->card.tvn[2]; + zr->timing = zr->card.tvn[ZR_NORM_SECAM]; } if (!zr->timing) { pci_warn(zr->pci_dev, "%s - default TV standard not supported by hardware. PAL will be used.\n", __func__); zr->norm = V4L2_STD_PAL; - zr->timing = zr->card.tvn[0]; + zr->timing = zr->card.tvn[ZR_NORM_PAL]; } if (default_input > zr->card.inputs - 1) { diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c index b910ad136b84..858e0910884c 100644 --- a/drivers/staging/media/zoran/zoran_driver.c +++ b/drivers/staging/media/zoran/zoran_driver.c @@ -1033,11 +1033,11 @@ static int zoran_set_norm(struct zoran *zr, v4l2_std_id norm) } if (norm & V4L2_STD_SECAM) - zr->timing = zr->card.tvn[2]; + zr->timing = zr->card.tvn[ZR_NORM_SECAM]; else if (norm & V4L2_STD_NTSC) - zr->timing = zr->card.tvn[1]; + zr->timing = zr->card.tvn[ZR_NORM_NTSC]; else - zr->timing = zr->card.tvn[0]; + zr->timing = zr->card.tvn[ZR_NORM_PAL]; decoder_call(zr, video, s_std, norm); encoder_call(zr, video, s_std_output, norm); |