static irqreturn_t max3355_id_irq(int irq, void *dev_id)
{ struct max3355_data *data = dev_id; int id = gpiod_get_value_cansleep(data->id_gpiod);
if (id) { /* * ID = 1 means USB HOST cable detached. * As we don't have event for USB peripheral cable attached, * we simulate USB peripheral attach here.
*/
extcon_set_state_sync(data->edev, EXTCON_USB_HOST, false);
extcon_set_state_sync(data->edev, EXTCON_USB, true);
} else { /* * ID = 0 means USB HOST cable attached. * As we don't have event for USB peripheral cable detached, * we simulate USB peripheral detach here.
*/
extcon_set_state_sync(data->edev, EXTCON_USB, false);
extcon_set_state_sync(data->edev, EXTCON_USB_HOST, true);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.