[media] au0828: rework GPIO management for HVR-950q
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Mon, 19 Aug 2013 21:25:16 +0000 (18:25 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 28 Feb 2014 18:21:31 +0000 (15:21 -0300)
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>
drivers/media/usb/au0828/au0828-cards.c

index dd32decb237d3d5979c36a0a72fd478b57f1855c..00291ea8946eabdfab5e10bcb295df04888332bd 100644 (file)
@@ -270,18 +270,25 @@ void au0828_gpio_setup(struct au0828_dev *dev)
                 * 9 - XC5000 Tuner
                 */
 
-               /* Into reset */
+               /* Set relevant GPIOs as outputs (leave the EEPROM W/P
+                  as an input since we will never touch it and it has
+                  a pullup) */
                au0828_write(dev, REG_003, 0x02);
                au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10);
+
+               /* Into reset */
                au0828_write(dev, REG_001, 0x0);
                au0828_write(dev, REG_000, 0x0);
-               msleep(100);
+               msleep(50);
 
-               /* Out of reset (leave the cs5340 in reset until needed) */
-               au0828_write(dev, REG_003, 0x02);
-               au0828_write(dev, REG_001, 0x02);
-               au0828_write(dev, REG_002, 0x80 | 0x20 | 0x10);
-               au0828_write(dev, REG_000, 0x80 | 0x40 | 0x20);
+               /* Bring power supply out of reset */
+               au0828_write(dev, REG_000, 0x80);
+               msleep(50);
+
+               /* Bring xc5000 and au8522 out of reset (leave the
+                  cs5340 in reset until needed) */
+               au0828_write(dev, REG_001, 0x02); /* xc5000 */
+               au0828_write(dev, REG_000, 0x80 | 0x20); /* PS + au8522 */
 
                msleep(250);
                break;
This page took 0.03927 seconds and 5 git commands to generate.