aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/au0828
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2013-08-19 17:25:16 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-28 13:21:31 -0500
commita06b429df49bb50ec1e671123a45147a1d1a6186 (patch)
tree2310280a9bf8bfcd41725c73b7586a6b7ec49058 /drivers/media/usb/au0828
parentb59de95bed526467f21c9978460cb15952b462e8 (diff)
[media] au0828: rework GPIO management for HVR-950q
Restructure the way we bring the various GPIOs out of reset. In particular: 1. we only need to setup the GPIOs as outputs once 2. there's no point in writing 0x40 to register 0x00 since that's the EEPROM write protect and already it's configured as an input 3. Separate out the act of enabling the power supply and bringing the tuner and demod out of reset. If you don't then the chip may not be properly enabled (as the power supply is still ramping up when the chip comes out of reset). This can result in probing failures. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/au0828')
-rw-r--r--drivers/media/usb/au0828/au0828-cards.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/usb/au0828/au0828-cards.c b/drivers/media/usb/au0828/au0828-cards.c
index dd32decb237d..00291ea8946e 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -270,18 +270,25 @@ void au0828_gpio_setup(struct au0828_dev *dev)
270 * 9 - XC5000 Tuner 270 * 9 - XC5000 Tuner
271 */ 271 */
272 272
273 /* Into reset */ 273 /* Set relevant GPIOs as outputs (leave the EEPROM W/P
274 as an input since we will never touch it and it has
275 a pullup) */
274 au0828_write(dev, REG_003, 0x02); 276 au0828_write(dev, REG_003, 0x02);
275 au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10); 277 au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10);
278
279 /* Into reset */
276 au0828_write(dev, REG_001, 0x0); 280 au0828_write(dev, REG_001, 0x0);
277 au0828_write(dev, REG_000, 0x0); 281 au0828_write(dev, REG_000, 0x0);
278 msleep(100); 282 msleep(50);
279 283
280 /* Out of reset (leave the cs5340 in reset until needed) */ 284 /* Bring power supply out of reset */
281 au0828_write(dev, REG_003, 0x02); 285 au0828_write(dev, REG_000, 0x80);
282 au0828_write(dev, REG_001, 0x02); 286 msleep(50);
283 au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10); 287
284 au0828_write(dev, REG_000, 0x80 | 0x40 | 0x20); 288 /* Bring xc5000 and au8522 out of reset (leave the
289 cs5340 in reset until needed) */
290 au0828_write(dev, REG_001, 0x02); /* xc5000 */
291 au0828_write(dev, REG_000, 0x80 | 0x20); /* PS + au8522 */
285 292
286 msleep(250); 293 msleep(250);
287 break; 294 break;