diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-03-11 10:26:46 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-18 00:47:09 -0300 |
commit | 9afec493e2fe1a477305a09f933267d805fe4c8c (patch) | |
tree | 5d302db5d1fe8d8cc7ad5428b58cf5a5b04478bc /drivers/staging/tm6000/tm6000-video.c | |
parent | 77012fb9954ebe355ce4ecfdaf9a0d5b88cb665b (diff) | |
download | op-kernel-dev-9afec493e2fe1a477305a09f933267d805fe4c8c.zip op-kernel-dev-9afec493e2fe1a477305a09f933267d805fe4c8c.tar.gz |
V4L/DVB: tm6000: Replace all magic values by a register alias
Instead of using magic pairs of req/reg, replace them by the defined
values.
This patch were generated by the following script:
cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\,
0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf
"s/REQ_${req}_SET_GET_AVREG[_BIT]*, 0x[0]*$3,/$1,/\n" }' >a; for i in
tm*.c; do sed -f a $i >b && mv b $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/tm6000/tm6000-video.c')
-rw-r--r-- | drivers/staging/tm6000/tm6000-video.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index 0bee7df..67f4d29 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -1186,16 +1186,16 @@ static int vidioc_g_ctrl (struct file *file, void *priv, /* FIXME: Probably, those won't work! Maybe we need shadow regs */ switch (ctrl->id) { case V4L2_CID_CONTRAST: - val=tm6000_get_reg (dev, REQ_07_SET_GET_AVREG, 0x08, 0); + val = tm6000_get_reg(dev, TM6010_REQ07_R08_LUMA_CONTRAST_ADJ, 0); break; case V4L2_CID_BRIGHTNESS: - val=tm6000_get_reg (dev, REQ_07_SET_GET_AVREG, 0x09, 0); + val = tm6000_get_reg(dev, TM6010_REQ07_R09_LUMA_BRIGHTNESS_ADJ, 0); return 0; case V4L2_CID_SATURATION: - val=tm6000_get_reg (dev, REQ_07_SET_GET_AVREG, 0x0a, 0); + val = tm6000_get_reg(dev, TM6010_REQ07_R0A_CHROMA_SATURATION_ADJ, 0); return 0; case V4L2_CID_HUE: - val=tm6000_get_reg (dev, REQ_07_SET_GET_AVREG, 0x0b, 0); + val = tm6000_get_reg(dev, TM6010_REQ07_R0B_CHROMA_HUE_PHASE_ADJ, 0); return 0; default: return -EINVAL; @@ -1217,16 +1217,16 @@ static int vidioc_s_ctrl (struct file *file, void *priv, switch (ctrl->id) { case V4L2_CID_CONTRAST: - tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x08, val); + tm6000_set_reg(dev, TM6010_REQ07_R08_LUMA_CONTRAST_ADJ, val); return 0; case V4L2_CID_BRIGHTNESS: - tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x09, val); + tm6000_set_reg(dev, TM6010_REQ07_R09_LUMA_BRIGHTNESS_ADJ, val); return 0; case V4L2_CID_SATURATION: - tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x0a, val); + tm6000_set_reg(dev, TM6010_REQ07_R0A_CHROMA_SATURATION_ADJ, val); return 0; case V4L2_CID_HUE: - tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x0b, val); + tm6000_set_reg(dev, TM6010_REQ07_R0B_CHROMA_HUE_PHASE_ADJ, val); return 0; } return -EINVAL; |