Skip to content

Commit

Permalink
V4L/DVB: tm6000: Replace all magic values by a register alias
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mauro Carvalho Chehab committed May 18, 2010
1 parent 77012fb commit 9afec49
Show file tree
Hide file tree
Showing 4 changed files with 796 additions and 796 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/tm6000/tm6000-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ static int _tm6000_start_audio_dma(struct snd_tm6000_card *chip)
int val;

/* Enables audio */
val = tm6000_get_reg(core, REQ_07_SET_GET_AVREG, 0xcc, 0x0);
val = tm6000_get_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0x0);
val |= 0x20;
tm6000_set_reg(core, REQ_07_SET_GET_AVREG, 0xcc, val);
tm6000_set_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);

tm6000_set_reg(core, REQ_08_SET_GET_AVREG_BIT, 0x01, 0x80);
tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0x80);

return 0;
}
Expand All @@ -119,11 +119,11 @@ static int _tm6000_stop_audio_dma(struct snd_tm6000_card *chip)
dprintk(1, "Stopping audio DMA\n");

/* Enables audio */
val = tm6000_get_reg(core, REQ_07_SET_GET_AVREG, 0xcc, 0x0);
val = tm6000_get_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0x0);
val &= ~0x20;
tm6000_set_reg(core, REQ_07_SET_GET_AVREG, 0xcc, val);
tm6000_set_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);

tm6000_set_reg(core, REQ_08_SET_GET_AVREG_BIT, 0x01, 0);
tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0);

return 0;
}
Expand Down
Loading

0 comments on commit 9afec49

Please sign in to comment.