static void disable_controller(struct r8a66597 *r8a66597) { int port; /* disable interrupts */ r8a66597_write(r8a66597, 0, INTENB0); r8a66597_write(r8a66597, 0, INTENB1); r8a66597_write(r8a66597, 0, BRDYENB); r8a66597_write(r8a66597, 0, BEMPENB); r8a66597_write(r8a66597, 0, NRDYENB); /* clear status */ r8a66597_write(r8a66597, 0, BRDYSTS); r8a66597_write(r8a66597, 0, NRDYSTS); r8a66597_write(r8a66597, 0, BEMPSTS); for (port = 0; port < r8a66597->max_root_hub; port++) r8a66597_disable_port(r8a66597, port); r8a66597_clock_disable(r8a66597); }
static void disable_controller(struct r8a66597 *r8a66597) { int i; if (!(r8a66597_read(r8a66597, SYSCFG0) & USBE)) return; r8a66597_write(r8a66597, 0, INTENB0); r8a66597_write(r8a66597, 0, INTSTS0); r8a66597_write(r8a66597, 0, D0FIFOSEL); r8a66597_write(r8a66597, 0, D1FIFOSEL); r8a66597_write(r8a66597, 0, DCPCFG); r8a66597_write(r8a66597, 0x40, DCPMAXP); r8a66597_write(r8a66597, 0, DCPCTR); for (i = 0; i <= 10; i++) r8a66597_write(r8a66597, 0, get_devadd_addr(i)); for (i = 1; i <= 5; i++) { r8a66597_write(r8a66597, 0, get_pipetre_addr(i)); r8a66597_write(r8a66597, 0, get_pipetrn_addr(i)); } for (i = 1; i < R8A66597_MAX_NUM_PIPE; i++) { r8a66597_write(r8a66597, 0, get_pipectr_addr(i)); r8a66597_write(r8a66597, i, PIPESEL); r8a66597_write(r8a66597, 0, PIPECFG); r8a66597_write(r8a66597, 0, PIPEBUF); r8a66597_write(r8a66597, 0, PIPEMAXP); r8a66597_write(r8a66597, 0, PIPEPERI); } for (i = 0; i < R8A66597_MAX_ROOT_HUB; i++) r8a66597_disable_port(r8a66597, i); r8a66597_clock_disable(r8a66597); }