diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-01-22 00:17:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:35:11 -0500 |
commit | 8d3643637e18e6590969436734c22151805d0350 (patch) | |
tree | f6e52e9c6a2fc2de43f6ac14967e08aee2b92ce8 /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 05ad390724d1f307111a322325df83282a1479e6 (diff) |
V4L/DVB (5169): Pvrusb2: Use macro names for FX2 commands
This is a maintainability cleanup; use nice names for all the FX2
commands instead of raw bytes. This way we can easily find where we
issue FX commands.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 2a350755bd30..ccd871ac4b60 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "pvrusb2-hdw-internal.h" | 36 | #include "pvrusb2-hdw-internal.h" |
37 | #include "pvrusb2-encoder.h" | 37 | #include "pvrusb2-encoder.h" |
38 | #include "pvrusb2-debug.h" | 38 | #include "pvrusb2-debug.h" |
39 | #include "pvrusb2-fx2-cmd.h" | ||
39 | 40 | ||
40 | #define TV_MIN_FREQ 55250000L | 41 | #define TV_MIN_FREQ 55250000L |
41 | #define TV_MAX_FREQ 850000000L | 42 | #define TV_MAX_FREQ 850000000L |
@@ -1647,7 +1648,7 @@ static int pvr2_hdw_check_firmware(struct pvr2_hdw *hdw) | |||
1647 | firmware needs be loaded. */ | 1648 | firmware needs be loaded. */ |
1648 | int result; | 1649 | int result; |
1649 | LOCK_TAKE(hdw->ctl_lock); do { | 1650 | LOCK_TAKE(hdw->ctl_lock); do { |
1650 | hdw->cmd_buffer[0] = 0xeb; | 1651 | hdw->cmd_buffer[0] = FX2CMD_GET_EEPROM_ADDR; |
1651 | result = pvr2_send_request_ex(hdw,HZ*1,!0, | 1652 | result = pvr2_send_request_ex(hdw,HZ*1,!0, |
1652 | hdw->cmd_buffer,1, | 1653 | hdw->cmd_buffer,1, |
1653 | hdw->cmd_buffer,1); | 1654 | hdw->cmd_buffer,1); |
@@ -2526,7 +2527,7 @@ int pvr2_hdw_is_hsm(struct pvr2_hdw *hdw) | |||
2526 | { | 2527 | { |
2527 | int result; | 2528 | int result; |
2528 | LOCK_TAKE(hdw->ctl_lock); do { | 2529 | LOCK_TAKE(hdw->ctl_lock); do { |
2529 | hdw->cmd_buffer[0] = 0x0b; | 2530 | hdw->cmd_buffer[0] = FX2CMD_GET_USB_SPEED; |
2530 | result = pvr2_send_request(hdw, | 2531 | result = pvr2_send_request(hdw, |
2531 | hdw->cmd_buffer,1, | 2532 | hdw->cmd_buffer,1, |
2532 | hdw->cmd_buffer,1); | 2533 | hdw->cmd_buffer,1); |
@@ -2976,7 +2977,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data) | |||
2976 | 2977 | ||
2977 | LOCK_TAKE(hdw->ctl_lock); | 2978 | LOCK_TAKE(hdw->ctl_lock); |
2978 | 2979 | ||
2979 | hdw->cmd_buffer[0] = 0x04; /* write register prefix */ | 2980 | hdw->cmd_buffer[0] = FX2CMD_REG_WRITE; /* write register prefix */ |
2980 | PVR2_DECOMPOSE_LE(hdw->cmd_buffer,1,data); | 2981 | PVR2_DECOMPOSE_LE(hdw->cmd_buffer,1,data); |
2981 | hdw->cmd_buffer[5] = 0; | 2982 | hdw->cmd_buffer[5] = 0; |
2982 | hdw->cmd_buffer[6] = (reg >> 8) & 0xff; | 2983 | hdw->cmd_buffer[6] = (reg >> 8) & 0xff; |
@@ -2997,7 +2998,7 @@ static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) | |||
2997 | 2998 | ||
2998 | LOCK_TAKE(hdw->ctl_lock); | 2999 | LOCK_TAKE(hdw->ctl_lock); |
2999 | 3000 | ||
3000 | hdw->cmd_buffer[0] = 0x05; /* read register prefix */ | 3001 | hdw->cmd_buffer[0] = FX2CMD_REG_READ; /* read register prefix */ |
3001 | hdw->cmd_buffer[1] = 0; | 3002 | hdw->cmd_buffer[1] = 0; |
3002 | hdw->cmd_buffer[2] = 0; | 3003 | hdw->cmd_buffer[2] = 0; |
3003 | hdw->cmd_buffer[3] = 0; | 3004 | hdw->cmd_buffer[3] = 0; |
@@ -3121,7 +3122,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) | |||
3121 | LOCK_TAKE(hdw->ctl_lock); do { | 3122 | LOCK_TAKE(hdw->ctl_lock); do { |
3122 | pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); | 3123 | pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); |
3123 | hdw->flag_ok = !0; | 3124 | hdw->flag_ok = !0; |
3124 | hdw->cmd_buffer[0] = 0xdd; | 3125 | hdw->cmd_buffer[0] = FX2CMD_DEEP_RESET; |
3125 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); | 3126 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
3126 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 3127 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
3127 | return status; | 3128 | return status; |
@@ -3133,7 +3134,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) | |||
3133 | int status; | 3134 | int status; |
3134 | LOCK_TAKE(hdw->ctl_lock); do { | 3135 | LOCK_TAKE(hdw->ctl_lock); do { |
3135 | pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); | 3136 | pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); |
3136 | hdw->cmd_buffer[0] = 0xde; | 3137 | hdw->cmd_buffer[0] = FX2CMD_POWER_ON; |
3137 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); | 3138 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
3138 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 3139 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
3139 | return status; | 3140 | return status; |
@@ -3166,7 +3167,8 @@ static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) | |||
3166 | { | 3167 | { |
3167 | int status; | 3168 | int status; |
3168 | LOCK_TAKE(hdw->ctl_lock); do { | 3169 | LOCK_TAKE(hdw->ctl_lock); do { |
3169 | hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); | 3170 | hdw->cmd_buffer[0] = |
3171 | (runFl ? FX2CMD_STREAMING_ON : FX2CMD_STREAMING_OFF); | ||
3170 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); | 3172 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
3171 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 3173 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
3172 | if (!status) { | 3174 | if (!status) { |
@@ -3265,7 +3267,7 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) | |||
3265 | { | 3267 | { |
3266 | int result; | 3268 | int result; |
3267 | LOCK_TAKE(hdw->ctl_lock); do { | 3269 | LOCK_TAKE(hdw->ctl_lock); do { |
3268 | hdw->cmd_buffer[0] = 0xeb; | 3270 | hdw->cmd_buffer[0] = FX2CMD_GET_EEPROM_ADDR; |
3269 | result = pvr2_send_request(hdw, | 3271 | result = pvr2_send_request(hdw, |
3270 | hdw->cmd_buffer,1, | 3272 | hdw->cmd_buffer,1, |
3271 | hdw->cmd_buffer,1); | 3273 | hdw->cmd_buffer,1); |