diff options
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 15 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840-firmware.c | 13 |
2 files changed, 21 insertions, 7 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 0be51b65f098..1aeaf18a9bea 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -321,6 +321,15 @@ static void cx23885_initialize(struct i2c_client *client) | |||
321 | /* Select AFE clock pad output source */ | 321 | /* Select AFE clock pad output source */ |
322 | cx25840_write(client, 0x144, 0x05); | 322 | cx25840_write(client, 0x144, 0x05); |
323 | 323 | ||
324 | /* Drive GPIO2 direction and values for HVR1700 | ||
325 | * where an onboard mux selects the output of demodulator | ||
326 | * vs the 417. Failure to set this results in no DTV. | ||
327 | * It's safe to set this across all Hauppauge boards | ||
328 | * currently, regardless of the board type. | ||
329 | */ | ||
330 | cx25840_write(client, 0x160, 0x1d); | ||
331 | cx25840_write(client, 0x164, 0x00); | ||
332 | |||
324 | /* Do the firmware load in a work handler to prevent. | 333 | /* Do the firmware load in a work handler to prevent. |
325 | Otherwise the kernel is blocked waiting for the | 334 | Otherwise the kernel is blocked waiting for the |
326 | bit-banging i2c interface to finish uploading the | 335 | bit-banging i2c interface to finish uploading the |
@@ -1578,12 +1587,6 @@ static int cx25840_probe(struct i2c_client *client, | |||
1578 | state->id = id; | 1587 | state->id = id; |
1579 | state->rev = device_id; | 1588 | state->rev = device_id; |
1580 | 1589 | ||
1581 | if (state->is_cx23885) { | ||
1582 | /* Drive GPIO2 direction and values */ | ||
1583 | cx25840_write(client, 0x160, 0x1d); | ||
1584 | cx25840_write(client, 0x164, 0x00); | ||
1585 | } | ||
1586 | |||
1587 | return 0; | 1590 | return 0; |
1588 | } | 1591 | } |
1589 | 1592 | ||
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 | } |