aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-09-26 22:47:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:17 -0500
commit2a03f03471d3232037e656570ccaf3ff2ffd01e8 (patch)
treeaeb169037d4323ec62b1d3362f784e5072242f5d /drivers/media/video/cx25840/cx25840-firmware.c
parentc7dd1ecdc0112b9700ed6ad20a6e4e07d125044b (diff)
V4L/DVB (13088): cx25840: Convert chip/core family checks to static inline functions
Change logic to check for various chip or core families to inline functions. Checks for specific chips should be made against the state->id field now. This is in preparation for chip/core specific code for setting up PLLs for the CX2388[578] family of cores, that all run with different crystal frequencies. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-firmware.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-firmware.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index 1f483c1d0dbe..8150200511da 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -67,9 +67,9 @@ static const char *get_fw_name(struct i2c_client *client)
67 67
68 if (firmware[0]) 68 if (firmware[0])
69 return firmware; 69 return firmware;
70 if (state->is_cx23885) 70 if (is_cx2388x(state))
71 return "v4l-cx23885-avcore-01.fw"; 71 return "v4l-cx23885-avcore-01.fw";
72 if (state->is_cx231xx) 72 if (is_cx231xx(state))
73 return "v4l-cx231xx-avcore-01.fw"; 73 return "v4l-cx231xx-avcore-01.fw";
74 return "v4l-cx25840.fw"; 74 return "v4l-cx25840.fw";
75} 75}
@@ -112,13 +112,13 @@ int cx25840_loadfw(struct i2c_client *client)
112 int MAX_BUF_SIZE = FWSEND; 112 int MAX_BUF_SIZE = FWSEND;
113 u32 gpio_oe = 0, gpio_da = 0; 113 u32 gpio_oe = 0, gpio_da = 0;
114 114
115 if (state->is_cx23885) { 115 if (is_cx2388x(state)) {
116 /* Preserve the GPIO OE and output bits */ 116 /* Preserve the GPIO OE and output bits */
117 gpio_oe = cx25840_read(client, 0x160); 117 gpio_oe = cx25840_read(client, 0x160);
118 gpio_da = cx25840_read(client, 0x164); 118 gpio_da = cx25840_read(client, 0x164);
119 } 119 }
120 120
121 if ((state->is_cx231xx) && MAX_BUF_SIZE > 16) { 121 if (is_cx231xx(state) && MAX_BUF_SIZE > 16) {
122 v4l_err(client, " Firmware download size changed to 16 bytes max length\n"); 122 v4l_err(client, " Firmware download size changed to 16 bytes max length\n");
123 MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */ 123 MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */
124 } 124 }
@@ -156,7 +156,7 @@ int cx25840_loadfw(struct i2c_client *client)
156 size = fw->size; 156 size = fw->size;
157 release_firmware(fw); 157 release_firmware(fw);
158 158
159 if (state->is_cx23885) { 159 if (is_cx2388x(state)) {
160 /* Restore GPIO configuration after f/w load */ 160 /* Restore GPIO configuration after f/w load */
161 cx25840_write(client, 0x160, gpio_oe); 161 cx25840_write(client, 0x160, gpio_oe);
162 cx25840_write(client, 0x164, gpio_da); 162 cx25840_write(client, 0x164, gpio_da);