void usb_host_phy_init(void) { #if defined(CONFIG_SAMSUNG_PHONE_SVNET) mc_control_pda_active(1); if (mc_is_modem_on() && !mc_is_host_wakeup()) { mc_control_slave_wakeup(1); } #endif /* Must be enable usbhost & usbotg clk */ usb_clk_get(USBHOST_CLK); usb_clk_get(USBOTG_CLK); if (__raw_readl(S5P_USBHOST_PHY_CONTROL) & (0x1<<0)) { printk(KERN_ERR"[usb_host_phy_init]Already power on PHY\n"); return; } #ifdef CONFIG_CPU_S5PV310_EVT1 /* // set XuhostOVERCUR to in-active by controlling ET6PUD[15:14] // 0x0 : pull-up/down disabled // 0x1 : pull-down enabled // 0x2 : reserved // 0x3 : pull-up enabled */ __raw_writel((__raw_readl(ETC6PUD) & ~(0x3 << 14)) | (0x3 << 14), ETC6PUD); //pull-up #else __raw_writel((__raw_readl(ETC6PUD) & ~(0x3 << 14)) | (0x1 << 14), ETC6PUD); // pull-down #endif __raw_writel(__raw_readl(S5P_USBHOST_PHY_CONTROL) |(0x1<<0), S5P_USBHOST_PHY_CONTROL); /* floating prevention logic : disable */ __raw_writel((__raw_readl(S3C_USBOTG_PHY1CON) | (0x1<<0)), S3C_USBOTG_PHY1CON); /* set hsic phy0,1 to normal */ __raw_writel((__raw_readl(S3C_USBOTG_PHYPWR) & ~(0xf<<9)), S3C_USBOTG_PHYPWR); /* phy-power on */ __raw_writel((__raw_readl(S3C_USBOTG_PHYPWR) & ~(0x7<<6)), S3C_USBOTG_PHYPWR); /* set clock source for PLL (24MHz) */ __raw_writel((__raw_readl(S3C_USBOTG_PHYCLK) | (0x1<<7) | (0x3<<0)), S3C_USBOTG_PHYCLK); /* reset all ports of both PHY and Link */ __raw_writel((__raw_readl(S3C_USBOTG_RSTCON) | (0x1<<6) | (0x7<<3)), S3C_USBOTG_RSTCON); udelay(10); __raw_writel((__raw_readl(S3C_USBOTG_RSTCON) & ~(0x1<<6) & ~(0x7<<3)), S3C_USBOTG_RSTCON); udelay(50); usb_clk_put(USBOTG_CLK); }
int mc_control_pda_active(int val) { if (!global_mc) return -EFAULT; if (mc_is_modem_on()) { gpio_set_value(global_mc->gpio_pda_active , val ? 1 : 0); dev_dbg(global_mc->dev, "PDA_ACTIVE:%d\n", val ? 1 : 0); } return 0; }
int mc_control_active_state(int val) { if (!global_mc) return -EFAULT; if (mc_is_modem_on()) { gpio_set_value(global_mc->gpio_host_active, val ? 1 : 0); printk("APtoLTE Active:%d\n", val ? 1 : 0); } return 0; }
int mc_control_active_state(int val) { if (!global_mc) return -EFAULT; if (mc_is_modem_on()) { gpio_set_value(global_mc->gpio_active_state, val ? 1 : 0); dev_dbg(global_mc->dev, "ACTIVE_STATE:%d\n", val ? 1 : 0); } return 0; }
static int modemctl_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct modemctl *mc = platform_get_drvdata(pdev); if (device_may_wakeup(dev) && mc_is_modem_on()) disable_irq_wake(mc->irq[1]); if (mc->ops && mc->ops->modem_resume) mc->ops->modem_resume(mc); return 0; }
int mc_control_active_state(int val) { if (!global_mc) return -EFAULT; #if defined(CONFIG_CHN_CMCC_SPI_SPRD) return 0; #endif if (mc_is_modem_on()) { gpio_set_value(global_mc->gpio_active_state, val ? 1 : 0); dev_dbg(global_mc->dev, "ACTIVE_STATE:%d\n", val ? 1 : 0); } return 0; }
static int modemctl_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct modemctl *mc = platform_get_drvdata(pdev); printk(KERN_INFO "%s IN\n", __func__); if (mc->ops && mc->ops->modem_suspend) mc->ops->modem_suspend(mc); if (device_may_wakeup(dev) && mc_is_modem_on()) enable_irq_wake(mc->irq[1]); return 0; }