usb: chipidea: operate on otgsc register in a general way
Use a more general way to read and write otgsc register. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
d03cccff9c
commit
0c33bf781a
@@ -1843,21 +1843,22 @@ void ci_hdrc_gadget_destroy(struct ci_hdrc *ci)
|
||||
|
||||
static int udc_id_switch_for_device(struct ci_hdrc *ci)
|
||||
{
|
||||
if (ci->is_otg) {
|
||||
ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
|
||||
ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
|
||||
}
|
||||
if (ci->is_otg)
|
||||
/* Clear and enable BSV irq */
|
||||
hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE,
|
||||
OTGSC_BSVIS | OTGSC_BSVIE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void udc_id_switch_for_host(struct ci_hdrc *ci)
|
||||
{
|
||||
if (ci->is_otg) {
|
||||
/* host doesn't care B_SESSION_VALID event */
|
||||
ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
|
||||
ci_disable_otg_interrupt(ci, OTGSC_BSVIE);
|
||||
}
|
||||
/*
|
||||
* host doesn't care B_SESSION_VALID event
|
||||
* so clear and disbale BSV irq
|
||||
*/
|
||||
if (ci->is_otg)
|
||||
hw_write_otgsc(ci, OTGSC_BSVIE | OTGSC_BSVIS, OTGSC_BSVIS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user