usb: chipidea: Consolidate extcon notifiers

The two extcon notifiers are almost the same except for the
variable name for the cable structure and the id notifier inverts
the cable->state logic. Make it the same and replace two
functions with one to save some lines. This also makes it so that
the id cable state is true when the id pin is pulled low, so we
change the name of ->state to ->connected to properly reflect
that we're interested in the cable being connected.

Acked-by: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Šī revīzija ir iekļauta:
Stephen Boyd
2017-01-20 15:11:55 +08:00
revīziju iesūtīja Peter Chen
vecāks 7bb7e9b1a4
revīzija 5cc4926899
3 mainīti faili ar 18 papildinājumiem un 39 dzēšanām

Parādīt failu

@@ -44,7 +44,7 @@ u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask)
else
val &= ~OTGSC_BSVIS;
if (cable->state)
if (cable->connected)
val |= OTGSC_BSV;
else
val &= ~OTGSC_BSV;
@@ -62,10 +62,10 @@ u32 hw_read_otgsc(struct ci_hdrc *ci, u32 mask)
else
val &= ~OTGSC_IDIS;
if (cable->state)
val |= OTGSC_ID;
if (cable->connected)
val &= ~OTGSC_ID; /* host */
else
val &= ~OTGSC_ID;
val |= OTGSC_ID; /* device */
if (cable->enabled)
val |= OTGSC_IDIE;