View Single Post
Old 07-30-2016, 02:14 PM   #13
lucida
Enthusiast
lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.lucida 's ceiling is 100% spider-free.
 
Posts: 30
Karma: 118906
Join Date: Jul 2016
Device: PW3
Quote:
Originally Posted by knc1 View Post
Hard coding the result of the kernel's USB hardware enumeration process is not the answer.
It is a dynamic process for very good reasons.
hmm...you're right set it to 1 might mess up the gadget mode since it should be 0 then.

It's only used in otg_enum_fn() and we got "otg_enum_fn not enumerated, catcha!" message when OTG cable is plugged in without usb audio card.


Spoiler:

Code:
static void otg_enum_fn(struct work_struct *work)
{
  int reset_delay = (usbmode_is_host == 0 ? 0 : RESET_DELAY);
#ifdef CONFIG_POWER_SODA
  if(!audio_enumerated && soda_charger_docked() && max77696_uic_is_otg_connected() ) {
    printk(KERN_ERR "with soda: %s not enumerated, catcha!", __func__);

    asession_enable__(false);
    soda_otg_vbus_output(0, 0);
    msleep(reset_delay);
    soda_otg_vbus_output(1, 0);
    asession_enable__(true);
    max77696_charger_set_icl();
  }else {
    //printk(KERN_ERR "okay, either otg is not connected, or connected and enumerated successfully. ");
    printk(KERN_ERR "is_otg_connected() %d audio_enumerated %d, soda_charger_docked %d", max77696_uic_is_otg_connected(), audio_enumerated, soda_charger_docked());
  }
#else
  if(!audio_enumerated && max77696_uic_is_otg_connected() ) {
    printk(KERN_ERR " %s not enumerated, catcha!", __func__);
    asession_enable__(false);
    max77696_charger_set_otg(0);
    msleep(reset_delay);
    max77696_charger_set_otg(1);
    asession_enable__(true);
    /* Turn OFF amber led - manual mode */
    max77696_led_ctrl(MAX77696_LED_AMBER, MAX77696_LED_OFF);
    /* Turn OFF green led - manual mode */
    max77696_led_ctrl(MAX77696_LED_GREEN, MAX77696_LED_OFF);
  }else {
    //printk(KERN_ERR "okay, either otg is not connected, or connected and enumerated successfully. ");
    printk(KERN_ERR "is_otg_connected() %d audio_enumerated %d", max77696_uic_is_otg_connected(), audio_enumerated);
  }

#endif
}

Last edited by lucida; 07-30-2016 at 02:19 PM.
lucida is offline   Reply With Quote