From: Minkyu Kang Date: Fri, 26 Feb 2010 05:26:35 +0000 (+0900) Subject: s5pc1xx: usb: combine two functions to s5p_usb_soft_disconnect X-Git-Tag: JB18_20100226~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30007d63c54bcf5bee3ae674a1d3417e4ea68821;p=kernel%2Fu-boot.git s5pc1xx: usb: combine two functions to s5p_usb_soft_disconnect Signed-off-by: Minkyu Kang --- diff --git a/cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.c b/cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.c index e0b28ee..88eb0bb 100644 --- a/cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.c +++ b/cpu/arm_cortexa8/s5pc1xx/usb-hs-otg.c @@ -414,21 +414,15 @@ void s5p_usb_check_current_mode(u8 *pucMode) *pucMode = tmp & 0x1; } -void s5p_usb_set_soft_disconnect(void) +void s5p_usb_soft_disconnect(int set) { u32 tmp; tmp = s5pc1xx_otg_read_reg(OTG_DCTL); - tmp |= SOFT_DISCONNECT; - s5pc1xx_otg_write_reg(tmp, OTG_DCTL); -} - -void s5p_usb_clear_soft_disconnect(void) -{ - u32 tmp; - - tmp = s5pc1xx_otg_read_reg(OTG_DCTL); - tmp &= ~SOFT_DISCONNECT; + if (set) + tmp |= SOFT_DISCONNECT; + else + tmp &= ~SOFT_DISCONNECT; s5pc1xx_otg_write_reg(tmp, OTG_DCTL); } @@ -470,9 +464,9 @@ int s5p_usbctl_init(void) s5p_usb_check_current_mode(&ucMode); if (ucMode == INT_DEV_MODE) { - s5p_usb_set_soft_disconnect(); + s5p_usb_soft_disconnect(1); udelay(10); - s5p_usb_clear_soft_disconnect(); + s5p_usb_soft_disconnect(0); s5p_usb_init_device(); return 0; } else {