aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-firmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-firmware.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-firmware.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index 0df53b0d75d9..2a535d0403ed 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -98,9 +98,14 @@ int cx25840_loadfw(struct i2c_client *client)
98 const u8 *ptr; 98 const u8 *ptr;
99 int size, retval; 99 int size, retval;
100 int MAX_BUF_SIZE = FWSEND; 100 int MAX_BUF_SIZE = FWSEND;
101 u32 gpio_oe = 0, gpio_da = 0;
101 102
102 if (state->is_cx23885) 103 if (state->is_cx23885) {
103 firmware = FWFILE_CX23885; 104 firmware = FWFILE_CX23885;
105 /* Preserve the GPIO OE and output bits */
106 gpio_oe = cx25840_read(client, 0x160);
107 gpio_da = cx25840_read(client, 0x164);
108 }
104 else if (state->is_cx231xx) 109 else if (state->is_cx231xx)
105 firmware = FWFILE_CX231XX; 110 firmware = FWFILE_CX231XX;
106 111
@@ -142,5 +147,11 @@ int cx25840_loadfw(struct i2c_client *client)
142 size = fw->size; 147 size = fw->size;
143 release_firmware(fw); 148 release_firmware(fw);
144 149
150 if (state->is_cx23885) {
151 /* Restore GPIO configuration after f/w load */
152 cx25840_write(client, 0x160, gpio_oe);
153 cx25840_write(client, 0x164, gpio_da);
154 }
155
145 return check_fw_load(client, size); 156 return check_fw_load(client, size);
146} 157}