Skip to content
  • Mauro Carvalho Chehab's avatar
    [media] mb86a20s: Be sure that device is initialized before starting DVB · c736a5f2
    Mauro Carvalho Chehab authored
    
    
    Due to a hard to track bug between tda829x/tda18271/saa7134, tda829x
    wants to go to analog mode during DVB initialization, causing some
    I2C errors.
    
    The analog failure doesn't cause any harm, as the device were already
    properly initialized in analog mode. However, the failure at the digital
    mode causes the frontend mb86a20s to not initialize. Fortunately, at
    least on my tests, it was possible to detect that the device is a
    mb86a20s before the failure.
    
    What happens is that tda8290 is a very bad boy: during DVB setup, it
    keeps insisting to call tda18271 analog_set_params, that calls
    tune_agc code. The tune_agc code calls saa7134 driver, changing the
    value of GPIO 27, switching from digital to analog mode and disabling
    the access to mb86a20s, as, on Kworld SBTVD, the same GPIO used
    to switch the hardware AGC mode seems to be used to enable the I2C
    switch that allows access to the frontend (mb86a20s).
    
    So, a call to analog_set_params ultimately disables the access to
    the frontend, and causes a failure at the init frontend logic.
    
    This patch is a workaround for this issue: it simply checks if the
    frontend init had any failure. If so, it will init the frontend when
    some DTV application will try to set DVB mode.
    
    Even being a hack for Kworld SBTVD to work, and assumning that we could
    teach tda8290 to be a good boy, this is actually an improvement at the
    frontend driver, as it will be more reliable to initialization failures.
    
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    c736a5f2