From 06da5fc847faa1b27cb6b092039d9d08cd6e5152 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Thu, 23 Jul 2009 12:18:54 -0300 Subject: [PATCH] --- yaml --- r: 161482 b: refs/heads/master c: f3d6f63302bfcd7462d46bd1fe44146c971634d4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx25840/cx25840-core.c | 15 +++++++++------ .../media/video/cx25840/cx25840-firmware.c | 13 ++++++++++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 03286bfd7c5c..23c50006226e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 73c6f462d1d07f276e279467f311a96a2a43d9c5 +refs/heads/master: f3d6f63302bfcd7462d46bd1fe44146c971634d4 diff --git a/trunk/drivers/media/video/cx25840/cx25840-core.c b/trunk/drivers/media/video/cx25840/cx25840-core.c index 0be51b65f098..1aeaf18a9bea 100644 --- a/trunk/drivers/media/video/cx25840/cx25840-core.c +++ b/trunk/drivers/media/video/cx25840/cx25840-core.c @@ -321,6 +321,15 @@ static void cx23885_initialize(struct i2c_client *client) /* Select AFE clock pad output source */ cx25840_write(client, 0x144, 0x05); + /* Drive GPIO2 direction and values for HVR1700 + * where an onboard mux selects the output of demodulator + * vs the 417. Failure to set this results in no DTV. + * It's safe to set this across all Hauppauge boards + * currently, regardless of the board type. + */ + cx25840_write(client, 0x160, 0x1d); + cx25840_write(client, 0x164, 0x00); + /* Do the firmware load in a work handler to prevent. Otherwise the kernel is blocked waiting for the bit-banging i2c interface to finish uploading the @@ -1578,12 +1587,6 @@ static int cx25840_probe(struct i2c_client *client, state->id = id; state->rev = device_id; - if (state->is_cx23885) { - /* Drive GPIO2 direction and values */ - cx25840_write(client, 0x160, 0x1d); - cx25840_write(client, 0x164, 0x00); - } - return 0; } diff --git a/trunk/drivers/media/video/cx25840/cx25840-firmware.c b/trunk/drivers/media/video/cx25840/cx25840-firmware.c index 0df53b0d75d9..2a535d0403ed 100644 --- a/trunk/drivers/media/video/cx25840/cx25840-firmware.c +++ b/trunk/drivers/media/video/cx25840/cx25840-firmware.c @@ -98,9 +98,14 @@ int cx25840_loadfw(struct i2c_client *client) const u8 *ptr; int size, retval; int MAX_BUF_SIZE = FWSEND; + u32 gpio_oe = 0, gpio_da = 0; - if (state->is_cx23885) + if (state->is_cx23885) { firmware = FWFILE_CX23885; + /* Preserve the GPIO OE and output bits */ + gpio_oe = cx25840_read(client, 0x160); + gpio_da = cx25840_read(client, 0x164); + } else if (state->is_cx231xx) firmware = FWFILE_CX231XX; @@ -142,5 +147,11 @@ int cx25840_loadfw(struct i2c_client *client) size = fw->size; release_firmware(fw); + if (state->is_cx23885) { + /* Restore GPIO configuration after f/w load */ + cx25840_write(client, 0x160, gpio_oe); + cx25840_write(client, 0x164, gpio_da); + } + return check_fw_load(client, size); }