[PATCH] usb: dwc3: ep0: remove unnecessary break after return
Fix the following checkpatch warning. WARNING: break is not useful after a goto or return Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/ep0.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 711b230..1d91c93 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -441,7 +441,6 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, case USB_DEVICE_LTM_ENABLE: return -EINVAL; - break; case USB_DEVICE_TEST_MODE: if ((wIndex 0xff) != 0) @@ -550,7 +549,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) switch (state) { case USB_STATE_DEFAULT: return -EINVAL; - break; case USB_STATE_ADDRESS: ret = dwc3_ep0_delegate_req(dwc, ctrl); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc3: exynos: remove non-DT support for Exynos Specific Glue layer
DWC3 Exynos Specific Glue layer can be used only for Exynos SoCs. In addition, non-DT for EXYNOS SoCs is not supported from v3.11; thus, there is no need to support non-DT for DWC3 Exynos Specific Glue layer. The 'linux/platform_data/dwc3-exynos.h' file has been used for non-DT support. Thus, the 'dwc3-exynos.h' file is removed, because it is not used anymore. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/Kconfig |2 +- drivers/usb/dwc3/dwc3-exynos.c|5 + include/linux/platform_data/dwc3-exynos.h | 24 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 include/linux/platform_data/dwc3-exynos.h diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index f4e5cc6..58b5b2c 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -55,7 +55,7 @@ config USB_DWC3_OMAP config USB_DWC3_EXYNOS tristate Samsung Exynos Platform - depends on ARCH_EXYNOS || COMPILE_TEST + depends on ARCH_EXYNOS OF || COMPILE_TEST default USB_DWC3 help Recent Exynos5 SoCs ship with one DesignWare Core USB3 IP inside, diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 3951a65..4369c66 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -20,7 +20,6 @@ #include linux/kernel.h #include linux/slab.h #include linux/platform_device.h -#include linux/platform_data/dwc3-exynos.h #include linux/dma-mapping.h #include linux/clk.h #include linux/usb/otg.h @@ -205,13 +204,11 @@ static int dwc3_exynos_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_OF static const struct of_device_id exynos_dwc3_match[] = { { .compatible = samsung,exynos5250-dwusb3 }, {}, }; MODULE_DEVICE_TABLE(of, exynos_dwc3_match); -#endif #ifdef CONFIG_PM_SLEEP static int dwc3_exynos_suspend(struct device *dev) @@ -266,7 +263,7 @@ static struct platform_driver dwc3_exynos_driver = { .remove = dwc3_exynos_remove, .driver = { .name = exynos-dwc3, - .of_match_table = of_match_ptr(exynos_dwc3_match), + .of_match_table = exynos_dwc3_match, .pm = DEV_PM_OPS, }, }; diff --git a/include/linux/platform_data/dwc3-exynos.h b/include/linux/platform_data/dwc3-exynos.h deleted file mode 100644 index 5eb7da9..000 --- a/include/linux/platform_data/dwc3-exynos.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * dwc3-exynos.h - Samsung EXYNOS DWC3 Specific Glue layer, header. - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. - * http://www.samsung.com - * - * Author: Anton Tikhomirov av.tikhomi...@samsung.com - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef _DWC3_EXYNOS_H_ -#define _DWC3_EXYNOS_H_ - -struct dwc3_exynos_data { - int phy_type; - int (*phy_init)(struct platform_device *pdev, int type); - int (*phy_exit)(struct platform_device *pdev, int type); -}; - -#endif /* _DWC3_EXYNOS_H_ */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: dwc2: allow dwc2 to get built when USB_GADGET=m
On Wednesday, October 22, 2014 5:32 AM, Dinh Nguyen wrote: From: Dinh Nguyen dingu...@opensource.altera.com This patch allows the gadget portion of the DWC2 driver to get built when (!USB USB_GADGET) condition is encountered. Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/dwc2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index f93807b..4d02718 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -1,6 +1,6 @@ config USB_DWC2 bool DesignWare USB2 DRD Core Support - depends on USB + depends on USB || USB_GADGET help Say Y here if your system has a Dual Role Hi-Speed USB controller based on the DesignWare HSOTG IP Core. -- 2.0.3 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] USB: imx21-hcd: use %pad for dma_addr_t
Use %pad for dma_addr_t, because a dma_addr_t type can vary based on build options. So, it prevents the following build warnings in printks. drivers/usb/host/imx21-hcd.c:1175:2: warning: format '%X' expects argument of type 'unsigned int', but argument 8 has type 'dma_addr_t' [-Wformat] drivers/usb/host/imx21-hcd.c:1175:2: warning: format '%X' expects argument of type 'unsigned int', but argument 10 has type 'dma_addr_t' [-Wformat] Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/imx21-hcd.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index 207bad9..eb4efba 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c @@ -1174,11 +1174,11 @@ static int imx21_hc_urb_enqueue(struct usb_hcd *hcd, dev_vdbg(imx21-dev, enqueue urb=%p ep=%p len=%d - buffer=%p dma=%08X setupBuf=%p setupDma=%08X\n, + buffer=%p dma=%pad setupBuf=%p setupDma=%pad\n, urb, ep, urb-transfer_buffer_length, - urb-transfer_buffer, urb-transfer_dma, - urb-setup_packet, urb-setup_dma); + urb-transfer_buffer, urb-transfer_dma, + urb-setup_packet, urb-setup_dma); if (usb_pipeisoc(urb-pipe)) return imx21_hc_urb_enqueue_isoc(hcd, ep, urb, mem_flags); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: Remove references to non-existent PLAT_S5P symbol
On Tuesday, October 07, 2014 12:47 AM, Sylwester Nawrocki wrote: The PLAT_S5P Kconfig symbol was removed in commit d78c16ccde96 (ARM: SAMSUNG: Remove remaining legacy code). There are still some references left, fix that by replacing them with ARCH_S5PV210. Reported-by: Paul Bolle pebo...@tiscali.nl Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/Kconfig |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 82800a7..6f1d48e 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -220,7 +220,7 @@ config USB_EHCI_SH config USB_EHCI_EXYNOS tristate EHCI support for Samsung S5P/EXYNOS SoC Series - depends on PLAT_S5P || ARCH_EXYNOS + depends on ARCH_S5PV210 || ARCH_EXYNOS help Enable support for the Samsung Exynos SOC's on-chip EHCI controller. @@ -527,7 +527,7 @@ config USB_OHCI_SH config USB_OHCI_EXYNOS tristate OHCI support for Samsung S5P/EXYNOS SoC Series - depends on PLAT_S5P || ARCH_EXYNOS + depends on ARCH_S5PV210 || ARCH_EXYNOS help Enable support for the Samsung Exynos SOC's on-chip OHCI controller. -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] phy: exynos5-drd: Fix PHYPARAM1_PCS_TXDEEMPH definition
On Monday, September 22, 2014 10:37 AM, Anton Tikhomirov wrote: According to user manual, pcs_tx_deemph_3p5db field in PHYPARAM1 register is 6bits wide, so mask value should be 0x3f instead of 0x1f. Additionally, this patch renames the macro to correctly reflect the field name which we see in SoC documentation. Signed-off-by: Anton Tikhomirov av.tikhomi...@samsung.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/phy/phy-exynos5-usbdrd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5- usbdrd.c index 392101c..216bbf8 100644 --- a/drivers/phy/phy-exynos5-usbdrd.c +++ b/drivers/phy/phy-exynos5-usbdrd.c @@ -99,8 +99,8 @@ #define EXYNOS5_DRD_PHYPARAM10x20 -#define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f 0) -#define PHYPARAM1_PCS_TXDEEMPH (0x1c) +#define PHYPARAM1_PCS_TXDEEMPH_3P5DB_MASK(0x3f 0) +#define PHYPARAM1_PCS_TXDEEMPH_3P5DB (0x1c) #define EXYNOS5_DRD_PHYTERM 0x24 @@ -309,8 +309,8 @@ static void exynos5_usbdrd_pipe3_init(struct exynos5_usbdrd_phy *phy_drd) reg = readl(phy_drd-reg_phy + EXYNOS5_DRD_PHYPARAM1); /* Set Tx De-Emphasis level */ - reg = ~PHYPARAM1_PCS_TXDEEMPH_MASK; - reg |= PHYPARAM1_PCS_TXDEEMPH; + reg = ~PHYPARAM1_PCS_TXDEEMPH_3P5DB_MASK; + reg |= PHYPARAM1_PCS_TXDEEMPH_3P5DB; writel(reg, phy_drd-reg_phy + EXYNOS5_DRD_PHYPARAM1); reg = readl(phy_drd-reg_phy + EXYNOS5_DRD_PHYTEST); @@ -330,8 +330,8 @@ static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) reg = readl(phy_drd-reg_phy + EXYNOS5_DRD_PHYPARAM1); /* Set Tx De-Emphasis level */ - reg = ~PHYPARAM1_PCS_TXDEEMPH_MASK; - reg |= PHYPARAM1_PCS_TXDEEMPH; + reg = ~PHYPARAM1_PCS_TXDEEMPH_3P5DB_MASK; + reg |= PHYPARAM1_PCS_TXDEEMPH_3P5DB; writel(reg, phy_drd-reg_phy + EXYNOS5_DRD_PHYPARAM1); /* UTMI Power Control */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] phy: exynos5-drd: Fix PCS_TXDEEMPH mask
On Friday, September 19, 2014 4:36 PM, Anton Tikhomirov wrote: According to user manual, pcs_tx_deemph_3p5db field in PHYPARAM1 register is 6bits wide, so mask value should be 0x3f instead of 0x1f. Signed-off-by: Anton Tikhomirov av.tikhomi...@samsung.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/phy/phy-exynos5-usbdrd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5- usbdrd.c index 392101c..f421d16 100644 --- a/drivers/phy/phy-exynos5-usbdrd.c +++ b/drivers/phy/phy-exynos5-usbdrd.c @@ -99,7 +99,7 @@ #define EXYNOS5_DRD_PHYPARAM10x20 -#define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f 0) +#define PHYPARAM1_PCS_TXDEEMPH_MASK (0x3f 0) #define PHYPARAM1_PCS_TXDEEMPH (0x1c) #define EXYNOS5_DRD_PHYTERM 0x24 -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 1/2] usb: host: ehci-exynos: Remove unnecessary usb-phy support
On Wednesday, September 17, 2014 8:18 PM, Vivek Gautam wrote: Now that we have completely moved from older USB-PHY drivers to newer GENERIC-PHY drivers for PHYs available with USB controllers on Exynos series of SoCs, we can remove the support for the same in our host drivers too. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/ehci-exynos.c | 81 1 file changed, 23 insertions(+), 58 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 2eed9a4..99c5f5f 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -21,11 +21,8 @@ #include linux/of_gpio.h #include linux/phy/phy.h #include linux/platform_device.h -#include linux/usb/phy.h -#include linux/usb/samsung_usb_phy.h #include linux/usb.h #include linux/usb/hcd.h -#include linux/usb/otg.h #include ehci.h @@ -47,9 +44,7 @@ static struct hc_driver __read_mostly exynos_ehci_hc_driver; struct exynos_ehci_hcd { struct clk *clk; - struct usb_phy *phy; - struct usb_otg *otg; - struct phy *phy_g[PHY_NUMBER]; + struct phy *phy[PHY_NUMBER]; }; #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)-priv) @@ -59,49 +54,39 @@ static int exynos_ehci_get_phy(struct device *dev, { struct device_node *child; struct phy *phy; - int phy_number; - int ret = 0; + int phy_num; + int ret; for_each_available_child_of_node(dev-of_node, child) { - ret = of_property_read_u32(child, reg, phy_number); + ret = of_property_read_u32(child, reg, phy_num); if (ret) { dev_err(dev, Failed to parse device tree\n); of_node_put(child); return ret; } - if (phy_number = PHY_NUMBER) { + if (phy_num = PHY_NUMBER) { dev_err(dev, Invalid number of PHYs\n); of_node_put(child); return -EINVAL; } - phy = devm_of_phy_get(dev, child, NULL); + exynos_ehci-phy[phy_num] = devm_of_phy_get(dev, child, NULL); + phy = exynos_ehci-phy[phy_num]; of_node_put(child); - if (IS_ERR(phy)) - /* Lets fallback to older USB-PHYs */ - goto usb_phy_old; - exynos_ehci-phy_g[phy_number] = phy; - /* Make the older PHYs unavailable */ - exynos_ehci-phy = ERR_PTR(-ENXIO); - } - - return 0; - -usb_phy_old: - exynos_ehci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); - if (IS_ERR(exynos_ehci-phy)) { - ret = PTR_ERR(exynos_ehci-phy); - if (ret != -ENXIO ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; + if (IS_ERR(phy)) { + ret = PTR_ERR(phy); + if (ret == -EPROBE_DEFER) { + return ret; + } else if (ret != -ENOSYS ret != -ENODEV) { + dev_err(dev, + Error retrieving usb2 phy: %d\n, ret); + return PTR_ERR(phy); + } } - dev_dbg(dev, Failed to get usb2 phy\n); - } else { - exynos_ehci-otg = exynos_ehci-phy-otg; } - return ret; + return 0; } static int exynos_ehci_phy_enable(struct device *dev) @@ -111,16 +96,13 @@ static int exynos_ehci_phy_enable(struct device *dev) int i; int ret = 0; - if (!IS_ERR(exynos_ehci-phy)) - return usb_phy_init(exynos_ehci-phy); - for (i = 0; ret == 0 i PHY_NUMBER; i++) - if (!IS_ERR(exynos_ehci-phy_g[i])) - ret = phy_power_on(exynos_ehci-phy_g[i]); + if (!IS_ERR(exynos_ehci-phy[i])) + ret = phy_power_on(exynos_ehci-phy[i]); if (ret) for (i--; i = 0; i--) - if (!IS_ERR(exynos_ehci-phy_g[i])) - phy_power_off(exynos_ehci-phy_g[i]); + if (!IS_ERR(exynos_ehci-phy[i])) + phy_power_off(exynos_ehci-phy[i]); return ret; } @@ -131,14 +113,9 @@ static void exynos_ehci_phy_disable(struct device *dev) struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); int i; - if (!IS_ERR(exynos_ehci-phy)) { - usb_phy_shutdown(exynos_ehci-phy); - return; - } - for (i = 0; i PHY_NUMBER; i++) - if (!IS_ERR(exynos_ehci-phy_g[i])) - phy_power_off(exynos_ehci-phy_g[i
Re: [PATCH v3 2/2] usb: host: ohci-exynos: Remove unnecessary usb-phy support
On Wednesday, September 17, 2014 8:18 PM, Vivek Gautam wrote: Now that we have completely moved from older USB-PHY drivers to newer GENERIC-PHY drivers for PHYs available with USB controllers on Exynos series of SoCs, we can remove the support for the same in our host drivers too. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/ohci-exynos.c | 89 +++- 1 file changed, 24 insertions(+), 65 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 7c48e3f..992b28d 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -19,11 +19,8 @@ #include linux/of.h #include linux/platform_device.h #include linux/phy/phy.h -#include linux/usb/phy.h -#include linux/usb/samsung_usb_phy.h #include linux/usb.h #include linux/usb/hcd.h -#include linux/usb/otg.h #include ohci.h @@ -38,9 +35,7 @@ static struct hc_driver __read_mostly exynos_ohci_hc_driver; struct exynos_ohci_hcd { struct clk *clk; - struct usb_phy *phy; - struct usb_otg *otg; - struct phy *phy_g[PHY_NUMBER]; + struct phy *phy[PHY_NUMBER]; }; static int exynos_ohci_get_phy(struct device *dev, @@ -48,56 +43,40 @@ static int exynos_ohci_get_phy(struct device *dev, { struct device_node *child; struct phy *phy; - int phy_number; - int ret = 0; + int phy_num; + int ret; - /* - * Getting generic phy: - * We are keeping both types of phys as a part of transiting OHCI - * to generic phy framework, so as to maintain backward compatibilty - * with old DTB too. - * We fallback to older USB-PHYs when we fail to get generic PHYs. - */ + /* Get the generic phys */ for_each_available_child_of_node(dev-of_node, child) { - ret = of_property_read_u32(child, reg, phy_number); + ret = of_property_read_u32(child, reg, phy_num); if (ret) { dev_err(dev, Failed to parse device tree\n); of_node_put(child); return ret; } - if (phy_number = PHY_NUMBER) { + if (phy_num = PHY_NUMBER) { dev_err(dev, Invalid number of PHYs\n); of_node_put(child); return -EINVAL; } - phy = devm_of_phy_get(dev, child, NULL); + exynos_ohci-phy[phy_num] = devm_of_phy_get(dev, child, NULL); + phy = exynos_ohci-phy[phy_num]; of_node_put(child); - if (IS_ERR(phy)) - /* Lets fallback to older USB-PHYs */ - goto usb_phy_old; - exynos_ohci-phy_g[phy_number] = phy; - /* Make the older PHYs unavailable */ - exynos_ohci-phy = ERR_PTR(-ENXIO); - } - - return 0; - -usb_phy_old: - exynos_ohci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); - if (IS_ERR(exynos_ohci-phy)) { - ret = PTR_ERR(exynos_ohci-phy); - if (ret != -ENXIO ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; + if (IS_ERR(phy)) { + ret = PTR_ERR(phy); + if (ret == -EPROBE_DEFER) { + return ret; + } else if (ret != -ENOSYS ret != -ENODEV) { + dev_err(dev, + Error retrieving usb2 phy: %d\n, ret); + return PTR_ERR(phy); + } } - dev_dbg(dev, Failed to get usb2 phy\n); - } else { - exynos_ohci-otg = exynos_ohci-phy-otg; } - return ret; + return 0; } static int exynos_ohci_phy_enable(struct device *dev) @@ -107,16 +86,13 @@ static int exynos_ohci_phy_enable(struct device *dev) int i; int ret = 0; - if (!IS_ERR(exynos_ohci-phy)) - return usb_phy_init(exynos_ohci-phy); - for (i = 0; ret == 0 i PHY_NUMBER; i++) - if (!IS_ERR(exynos_ohci-phy_g[i])) - ret = phy_power_on(exynos_ohci-phy_g[i]); + if (!IS_ERR(exynos_ohci-phy[i])) + ret = phy_power_on(exynos_ohci-phy[i]); if (ret) for (i--; i = 0; i--) - if (!IS_ERR(exynos_ohci-phy_g[i])) - phy_power_off(exynos_ohci-phy_g[i]); + if (!IS_ERR(exynos_ohci-phy[i])) + phy_power_off(exynos_ohci-phy[i]); return ret; } @@ -127,14 +103,9 @@ static void exynos_ohci_phy_disable(struct device *dev) struct exynos_ohci_hcd *exynos_ohci
Re: [PATCH] usb: dwc3: exynos: remove usb_phy_generic support
On Wednesday, August 27, 2014 4:53 PM, Bartlomiej Zolnierkiewicz wrote: dwc3 driver is using the new Exynos5 SoC series USB DRD PHY driver (PHY_EXYNOS5_USBDRD which selects GENERIC_PHY) as can be seen by looking at the following commits: 7a4cf0fde054 (ARM: dts: Update DWC3 usb controller to use new phy driver for exynos5250) f070267b5fc1 (ARM: dts: Enable support for DWC3 controller for exynos5420) Thus remove unused usb_phy_generic support from dwc3 Exynos glue layer. [ The code that is being removed is harmful in the context of multi_v7_defconfig and enabling EHCI support for Samsung S5P/EXYNOS SoC Series (USB_EHCI_EXYNOS) + OHCI support for Samsung S5P/EXYNOS SoC Series (USB_OHCI_EXYNOS) because EHCI support for OMAP3 and later chips (USB_EHCI_HCD_OMAP) selects NOP USB Transceiver Driver (NOP_USB_XCEIV). NOP USB driver attaches itself to usb_phy_generic platform devices created by dwc3 Exynos glue layer and later causes Exynos EHCI driver to fail probe and Exynos OHCI driver to hang on probe (as observed on Exynos5250 Arndale board). ] I also agree with this patch, because dwc3 IPs of all Exynos SoCs do not use NOP USB Transceiver Driver. So, usb_phy_generic can be removed from Exynos dwc3 driver. Is there any reason to support 'usb_phy_generic' for Exynos dwc3? If so, please let me know. Thank you. Best regards, Jingoo Han Cc: Olof Johansson o...@lixom.net Cc: Kukjin Kim kgene@samsung.com Cc: Vivek Gautam gautam.vi...@samsung.com Acked-by: Kyungmin Park kyungmin.p...@samsung.com Signed-off-by: Bartlomiej Zolnierkiewicz b.zolnier...@samsung.com --- drivers/usb/dwc3/dwc3-exynos.c | 68 - 1 file changed, 1 insertion(+), 67 deletions(-) Index: b/drivers/usb/dwc3/dwc3-exynos.c === --- a/drivers/usb/dwc3/dwc3-exynos.c 2014-08-25 14:57:04.991781925 +0200 +++ b/drivers/usb/dwc3/dwc3-exynos.c 2014-08-27 09:16:38.312617727 +0200 @@ -23,15 +23,12 @@ #include linux/platform_data/dwc3-exynos.h #include linux/dma-mapping.h #include linux/clk.h -#include linux/usb/otg.h -#include linux/usb/usb_phy_generic.h +#include linux/pm_runtime.h #include linux/of.h #include linux/of_platform.h #include linux/regulator/consumer.h struct dwc3_exynos { - struct platform_device *usb2_phy; - struct platform_device *usb3_phy; struct device *dev; struct clk *clk; @@ -39,61 +36,6 @@ struct dwc3_exynos { struct regulator*vdd10; }; -static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) -{ - struct usb_phy_generic_platform_data pdata; - struct platform_device *pdev; - int ret; - - memset(pdata, 0x00, sizeof(pdata)); - - pdev = platform_device_alloc(usb_phy_generic, PLATFORM_DEVID_AUTO); - if (!pdev) - return -ENOMEM; - - exynos-usb2_phy = pdev; - pdata.type = USB_PHY_TYPE_USB2; - pdata.gpio_reset = -1; - - ret = platform_device_add_data(exynos-usb2_phy, pdata, sizeof(pdata)); - if (ret) - goto err1; - - pdev = platform_device_alloc(usb_phy_generic, PLATFORM_DEVID_AUTO); - if (!pdev) { - ret = -ENOMEM; - goto err1; - } - - exynos-usb3_phy = pdev; - pdata.type = USB_PHY_TYPE_USB3; - - ret = platform_device_add_data(exynos-usb3_phy, pdata, sizeof(pdata)); - if (ret) - goto err2; - - ret = platform_device_add(exynos-usb2_phy); - if (ret) - goto err2; - - ret = platform_device_add(exynos-usb3_phy); - if (ret) - goto err3; - - return 0; - -err3: - platform_device_del(exynos-usb2_phy); - -err2: - platform_device_put(exynos-usb3_phy); - -err1: - platform_device_put(exynos-usb2_phy); - - return ret; -} - static int dwc3_exynos_remove_child(struct device *dev, void *unused) { struct platform_device *pdev = to_platform_device(dev); @@ -127,12 +69,6 @@ static int dwc3_exynos_probe(struct plat platform_set_drvdata(pdev, exynos); - ret = dwc3_exynos_register_phys(exynos); - if (ret) { - dev_err(dev, couldn't register PHYs\n); - return ret; - } - clk = devm_clk_get(dev, usbdrd30); if (IS_ERR(clk)) { dev_err(dev, couldn't get clock\n); @@ -194,8 +130,6 @@ static int dwc3_exynos_remove(struct pla struct dwc3_exynos *exynos = platform_get_drvdata(pdev); device_for_each_child(pdev-dev, NULL, dwc3_exynos_remove_child); - platform_device_unregister(exynos-usb2_phy); - platform_device_unregister(exynos-usb3_phy); clk_disable_unprepare(exynos-clk); -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org
Re: [PATCH v5 4/4] phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800
)) + break; + + udelay(1); + } while (usec-- 0); + + if (!usec) + dev_err(phy_drd-dev, + CRPORT handshake timeout2 (0x%08x)\n, val); +} + +static void crport_ctrl_write(struct exynos5_usbdrd_phy *phy_drd, + u32 addr, u32 data) +{ + /* Write Address */ + crport_handshake(phy_drd, EXYNOS5_DRD_PHYREG0_CR_DATA_IN(addr), + EXYNOS5_DRD_PHYREG0_CR_CAP_ADDR); According to the guidance from H/W team, before calling crport_handshake(), write access for EXYNOS5_DRD_PHYREG0 register is necessary. Please, add the write access as follows. + /* Write Address */ + writel(EXYNOS5_DRD_PHYREG0_CR_DATA_IN(addr), + phy_drd-reg_phy + EXYNOS5_DRD_PHYREG0); + crport_handshake(phy_drd, EXYNOS5_DRD_PHYREG0_CR_DATA_IN(addr), +EXYNOS5_DRD_PHYREG0_CR_CAP_ADDR); Best regards, Jingoo Han + + /* Write Data */ + crport_handshake(phy_drd, EXYNOS5_DRD_PHYREG0_CR_DATA_IN(data), + EXYNOS5_DRD_PHYREG0_CR_CAP_DATA); + crport_handshake(phy_drd, EXYNOS5_DRD_PHYREG0_CR_DATA_IN(data), + EXYNOS5_DRD_PHYREG0_CR_WRITE); +} + +/* + * Override PHY paramaeters using CR_PORT register to calibrate settings + * to meet meet SuperSpeed requirements, on Exynos5420 and Exynos5800 systems, + * which have 28nm USB 3.0 DRD PHY. + */ +static void exynos5420_usbdrd_phy_calibrate(struct exynos5_usbdrd_phy *phy_drd) +{ + u32 temp; + + /* + * Change los_bias to (0x5) for 28nm PHY from a + * default value (0x0); los_level is set as default + * (0x9) as also reflected in los_level[30:26] bits + * of PHYPARAM0 register. + */ + temp = LOSLEVEL_OVRD_IN_LOS_BIAS_5420 | + LOSLEVEL_OVRD_IN_EN | + LOSLEVEL_OVRD_IN_LOS_LEVEL_DEFAULT; + crport_ctrl_write(phy_drd, + EXYNOS5_DRD_PHYSS_LOSLEVEL_OVRD_IN, + temp); + + /* + * Set tx_vboost_lvl to (0x5) for 28nm PHY Tuning, + * to raise Tx signal level from its default value of (0x4) + */ + temp = TX_VBOOSTLEVEL_OVRD_IN_VBOOST_5420; + crport_ctrl_write(phy_drd, + EXYNOS5_DRD_PHYSS_TX_VBOOSTLEVEL_OVRD_IN, + temp); + + /* + * Set proper time to wait for RxDetect measurement, for + * desired reference clock of PHY, by tuning the CRPORT + * register LANE0.TX_DEBUG which is internal to PHY. + * This fixes issue with few USB 3.0 devices, which are + * not detected (not even generate interrupts on the bus + * on insertion) without this change. + * e.g. Samsung SUM-TSB16S 3.0 USB drive. + */ + switch (phy_drd-extrefclk) { + case EXYNOS5_FSEL_50MHZ: + temp = LANE0_TX_DEBUG_RXDET_MEAS_TIME_48M_50M_52M; + break; + case EXYNOS5_FSEL_20MHZ: + case EXYNOS5_FSEL_19MHZ2: + temp = LANE0_TX_DEBUG_RXDET_MEAS_TIME_19M2_20M; + break; + case EXYNOS5_FSEL_24MHZ: + default: + temp = LANE0_TX_DEBUG_RXDET_MEAS_TIME_24M; + break; + } + + crport_ctrl_write(phy_drd, + EXYNOS5_DRD_PHYSS_LANE0_TX_DEBUG, + temp); +} + +/* Calibrate PIPE3 PHY settings, if any */ +static int exynos5_usbdrd_pipe3_calibrate(struct phy_usb_instance *inst) +{ + struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); + + /* Call respective phy_calibrate given by certain platform */ + if (phy_drd-drv_data-calibrate) + phy_drd-drv_data-calibrate(phy_drd); + + return 0; +} + +static int exynos5_usbdrd_phy_calibrate(struct phy *phy) +{ + struct phy_usb_instance *inst = phy_get_drvdata(phy); + + if (inst-phy_cfg-phy_calibrate) + inst-phy_cfg-phy_calibrate(inst); + + return 0; +} + static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev, struct of_phandle_args *args) { @@ -503,6 +669,7 @@ static struct phy_ops exynos5_usbdrd_phy_ops = { .exit = exynos5_usbdrd_phy_exit, .power_on = exynos5_usbdrd_phy_power_on, .power_off = exynos5_usbdrd_phy_power_off, + .calibrate = exynos5_usbdrd_phy_calibrate, .owner = THIS_MODULE, }; @@ -518,6 +685,7 @@ static const struct exynos5_usbdrd_phy_config phy_cfg_exynos5[] = { .phy_isol = exynos5_usbdrd_phy_isol, .phy_init = exynos5_usbdrd_pipe3_init, .set_refclk = exynos5_usbdrd_pipe3_set_refclk, + .phy_calibrate = exynos5_usbdrd_pipe3_calibrate, }, }; @@ -525,6 +693,7 @@ static const struct exynos5_usbdrd_phy_drvdata exynos5420_usbdrd_phy = { .phy_cfg
Re: [PATCH 3/5] usb: phy: samsung: remove old USB 2.0 PHY driver
On Thursday, August 21, 2014 1:31 PM, Vivek Gautam wrote: On Mon, Aug 18, 2014 at 4:52 PM, Tomasz Figa tomasz.f...@gmail.com wrote: On 18.08.2014 13:02, Bartlomiej Zolnierkiewicz wrote: On Thursday, August 14, 2014 08:07:40 PM Vivek Gautam wrote: On Thursday, August 14, 2014 7:55 PM, Bartlomiej Zolnierkiewicz b.zolnier...@samsung.com wrote There's one thing that I would want to comment here, since we don't have any new usb-phy driver for S3C64XX, so we can't simply remove this entire driver. I have posted my patch-series [1], which does cleanup while keeping the support for S3C64XX. AFAIK S3C64XX code from drivers/usb/phy/phy-samsung-usb2.c has never been used as this platform still uses its own code from arch/arm/mach-s3c64xx/setup-usb-phy.c (there are no users in the kernel tree of either s3c64xx-usb2phy platform device or samsung,s3c64xx-usb2phy DT compatible) . Therefore I think that the entire drivers/usb/phy/phy-samsung-usb2.c driver should be removed (somebody with the hardware can as well add S3C64XX support to the new drivers/phy/phy-samsung-usb2.c driver and port the platform to use it). I agree with removal of this driver. As Bart said, it is not used for S3C64xx at all. The platform was supposed to be moved to this driver, but that never happened. Yes, right. As far as I know, you're right. In fact, I already have a patch adding support for S3C64xx to the new driver. Good! Cool then, lets remove this driver completely and use the new generic PHY based driver once that comes (from Tomasz). I agree with this opinion. I shall drop the patches for cleaning up the usb-phy drivers from my series. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/5] usb: phy: samsung: remove old USB PHY code
On Thursday, August 21, 2014 1:34 PM, Vivek Gautam wrote: On Thu, Aug 14, 2014 at 7:55 PM, Bartlomiej Zolnierkiewicz b.zolnier...@samsung.com wrote: Hi, This patch series removes the old Samsung USB PHY drivers that got replaced by the new ones using the generic PHY layer. Depends on: - next-20140813 branch of linux-next kernel Best regards, -- Bartlomiej Zolnierkiewicz Samsung RD Institute Poland Samsung Electronics Bartlomiej Zolnierkiewicz (5): ARM: dts: remove old USB2 PHY node hook for Arndale ARM: dts: remove old USB2 PHY node for Exynos5250 usb: phy: samsung: remove old USB 2.0 PHY driver usb: phy: samsung: remove old USB 3.0 PHY driver usb: phy: samsung: remove old common USB PHY code Reviewed-by: Vivek Gautam gautam.vi...@samsung.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: dwc2: gadget: fix below build warning
On Tuesday, August 19, 2014 8:08 AM, Paul Zimmerman wrote: From: Paul Zimmerman Sent: Monday, August 18, 2014 11:03 AM From: Jingoo Han [mailto:jg1@samsung.com] Sent: Monday, August 18, 2014 2:17 AM On Monday, August 18, 2014 5:32 PM, Peter Chen wrote: linux-2.6/drivers/usb/dwc2/gadget.c: In function 's3c_hsotg_irq_enumdone': linux-2.6/drivers/usb/dwc2/gadget.c:1904: warning: 'ep_mps' may be used uninitialized in this function (+cc Dinh Nguyen) I think that this warning is false. Because, 'ep_mps' cannot be used uninitialized in s3c_hsotg_irq_enumdone(). static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg) { int ep0_mps = 0, ep_mps; case DSTS_ENUMSPD_FS: case DSTS_ENUMSPD_FS48: ep0_mps = EP0_MPS_LIMIT; ep_mps = 1023; break; case DSTS_ENUMSPD_HS: ep0_mps = EP0_MPS_LIMIT; ep_mps = 1024; break; In the case of DSTS_ENUMSPD_FS, DSTS_ENUMSPD_FS48, and DSTS_ENUMSPD_HS, both 'ep0_mps' and 'ep_mps' are initialized. case DSTS_ENUMSPD_LS: hsotg-gadget.speed = USB_SPEED_LOW; break; In the case of DSTS_ENUMSPD_LS, 'ep_mps' is uninitialized. But, 'ep0_mps' is also '0'. . if (ep0_mps) { int i; s3c_hsotg_set_ep_maxpacket(hsotg, 0, ep0_mps); for (i = 1; i hsotg-num_of_eps; i++) s3c_hsotg_set_ep_maxpacket(hsotg, i, ep_mps); } If 'ep0_mps' is '0', 'ep_mps' will not be used. So, uninitialized 'ep_mps' cannot be used. However, in the future, it is not sure that the current scheme will not be modified. Thus, in order to make sure the code safety, this patch may be necessary. But 0 is not a valid default value for an endpoint mps. So I think the patch serves no purpose other than to shut up the compiler. That's OK with me, but I think the usual kernel practice is not to add unnecessary initializations just to silence a compiler warning. Sorry, I lost the context of the original patch because Jingoo didn't quote it. Please don't blame me. It is unrelated with me. In addition, I did not said that 'ep_mps' is 0. I see the patch sets the default mps to 1024, not 0. However, 1024 is not a valid mps in the case of full-speed. If you change the value to 1023, you can add my acked-by. No, low-speed should be considered. In the case of full-speed, 'ep_mps' is set as 1023. However, in the case of full-speed, 'ep_mps' is not set. The maximum data payload size allowed for low-speed devices is 8 bytes. So, this patch should set the default mps as '8' for the low-speed. Best regards, Jingoo Han -- Paul -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/3] usb: dwc2: gadget: fix below build warning
On Tuesday, August 19, 2014 9:56 AM, Peter Chen wrote: linux-2.6/drivers/usb/dwc2/gadget.c: In function 's3c_hsotg_irq_enumdone': linux-2.6/drivers/usb/dwc2/gadget.c:1904: warning: 'ep_mps' may be used uninitialized in this function Acked-by: Paul Zimmerman paul.zimmer...@synopsys.com Signed-off-by: Peter Chen peter.c...@freescale.com --- Changes for v2: - Add Paul's suggestion and ack drivers/usb/dwc2/gadget.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 2421eaa..6bcc644 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1901,7 +1901,7 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg) { u32 dsts = readl(hsotg-regs + DSTS); - int ep0_mps = 0, ep_mps; + int ep0_mps = 0, ep_mps = 1023; (+cc Dinh Nguyen) static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg) { u32 dsts = readl(hsotg-regs + DSTS); int ep0_mps = 0, ep_mps; . case DSTS_ENUMSPD_FS: case DSTS_ENUMSPD_FS48: ep0_mps = EP0_MPS_LIMIT; ep_mps = 1023; break; case DSTS_ENUMSPD_HS: ep0_mps = EP0_MPS_LIMIT; ep_mps = 1024; break; case DSTS_ENUMSPD_LS: hsotg-gadget.speed = USB_SPEED_LOW; break; Only low-speed does NOT set 'ep_mps'. Thus, the default value of 'ep_mps' should be considered for the case of low-speed. According to the USB2.0 spec, the maximum data payload size allowed for low-speed devices is 8 bytes. So, this patch should set the 'ep_mps' as '8' for the low-speed. What I mean is as follows: - int ep0_mps = 0, ep_mps; + int ep0_mps = 0, ep_mps = 8; Best regards, Jingoo Han /* * This should signal the finish of the enumeration phase -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc2: gadget: Set the default EP max packet value as 8 bytes
Set the default EP max packet value as 8 bytes, because in the case of low-speed, 'ep_mps' is not set. Thus, the default value of 'ep_mps' should be considered for the case of low-speed. Signed-off-by: Jingoo Han jg1@samsung.com --- - Based on the latest 'usb-linus' branch. drivers/usb/dwc2/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 2a6f76b0075e..7c9618e916e2 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1901,7 +1901,7 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg) { u32 dsts = readl(hsotg-regs + DSTS); - int ep0_mps = 0, ep_mps = 1023; + int ep0_mps = 0, ep_mps = 8; /* * This should signal the finish of the enumeration phase -- 2.0.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/7] usb-phy: samsung-usb3: Remove older phy-samsung-usb3 driver
On Thursday, August 14, 2014 11:24 PM, Vivek Gautam wrote: Removing this older USB 3.0 DRD controller PHY driver, since a new driver based on generic phy framework is now available. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/phy/Kconfig|8 - drivers/usb/phy/Makefile |1 - drivers/usb/phy/phy-samsung-usb.h | 80 - drivers/usb/phy/phy-samsung-usb3.c | 350 4 files changed, 439 deletions(-) delete mode 100644 drivers/usb/phy/phy-samsung-usb3.c -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC 6/7] usb: host: ehci-exynos: Remove unnecessary usb-phy support
On Thursday, August 14, 2014 11:24 PM, Vivek Gautam wrote: Now that we have completely moved from older USB-PHY drivers to newer GENERIC-PHY drivers for PHYs available with USB controllers on Exynos series of SoCs, we can remove the support for the same in our host drivers too. This should fix the issue on ehci-exynos, wherein in the absence of SAMSUNG_USB2PHY config symbol, we ended up getting the NOP_USB_XCEIV phy when the same is enabled. And thus the PHYs are not configured properly. Reported-by: Sachin Kamat sachin.ka...@samsung.com Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/ehci-exynos.c | 53 ++-- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index cda0a2f..54944cc 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -21,11 +21,8 @@ #include linux/of_gpio.h #include linux/phy/phy.h #include linux/platform_device.h -#include linux/usb/phy.h -#include linux/usb/samsung_usb_phy.h #include linux/usb.h #include linux/usb/hcd.h -#include linux/usb/otg.h #include ehci.h @@ -47,9 +44,7 @@ static struct hc_driver __read_mostly exynos_ehci_hc_driver; struct exynos_ehci_hcd { struct clk *clk; - struct usb_phy *phy; - struct usb_otg *otg; - struct phy *phy_g[PHY_NUMBER]; + struct phy *phy[PHY_NUMBER]; }; #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)-priv) @@ -62,18 +57,6 @@ static int exynos_ehci_get_phy(struct device *dev, int phy_number; int ret = 0; - exynos_ehci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); - if (IS_ERR(exynos_ehci-phy)) { - ret = PTR_ERR(exynos_ehci-phy); - if (ret != -ENXIO ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; - } - dev_dbg(dev, Failed to get usb2 phy\n); - } else { - exynos_ehci-otg = exynos_ehci-phy-otg; - } - for_each_available_child_of_node(dev-of_node, child) { ret = of_property_read_u32(child, reg, phy_number); if (ret) { @@ -98,7 +81,7 @@ static int exynos_ehci_get_phy(struct device *dev, } dev_dbg(dev, Failed to get usb2 phy\n); } - exynos_ehci-phy_g[phy_number] = phy; + exynos_ehci-phy[phy_number] = phy; } return ret; @@ -111,16 +94,13 @@ static int exynos_ehci_phy_enable(struct device *dev) int i; int ret = 0; - if (!IS_ERR(exynos_ehci-phy)) - return usb_phy_init(exynos_ehci-phy); - for (i = 0; ret == 0 i PHY_NUMBER; i++) - if (!IS_ERR(exynos_ehci-phy_g[i])) - ret = phy_power_on(exynos_ehci-phy_g[i]); + if (!IS_ERR(exynos_ehci-phy[i])) + ret = phy_power_on(exynos_ehci-phy[i]); if (ret) for (i--; i = 0; i--) - if (!IS_ERR(exynos_ehci-phy_g[i])) - phy_power_off(exynos_ehci-phy_g[i]); + if (!IS_ERR(exynos_ehci-phy[i])) + phy_power_off(exynos_ehci-phy[i]); return ret; } @@ -131,14 +111,9 @@ static void exynos_ehci_phy_disable(struct device *dev) struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); int i; - if (!IS_ERR(exynos_ehci-phy)) { - usb_phy_shutdown(exynos_ehci-phy); - return; - } - for (i = 0; i PHY_NUMBER; i++) - if (!IS_ERR(exynos_ehci-phy_g[i])) - phy_power_off(exynos_ehci-phy_g[i]); + if (!IS_ERR(exynos_ehci-phy[i])) + phy_power_off(exynos_ehci-phy[i]); } static void exynos_setup_vbus_gpio(struct device *dev) @@ -231,9 +206,6 @@ skip_phy: goto fail_io; } - if (exynos_ehci-otg) - exynos_ehci-otg-set_host(exynos_ehci-otg, hcd-self); - err = exynos_ehci_phy_enable(pdev-dev); if (err) { dev_err(pdev-dev, Failed to enable USB phy\n); @@ -273,9 +245,6 @@ static int exynos_ehci_remove(struct platform_device *pdev) usb_remove_hcd(hcd); - if (exynos_ehci-otg) - exynos_ehci-otg-set_host(exynos_ehci-otg, hcd-self); - exynos_ehci_phy_disable(pdev-dev); clk_disable_unprepare(exynos_ehci-clk); @@ -298,9 +267,6 @@ static int exynos_ehci_suspend(struct device *dev) if (rc) return rc; - if (exynos_ehci-otg) - exynos_ehci-otg-set_host(exynos_ehci-otg, hcd-self); - exynos_ehci_phy_disable(dev); clk_disable_unprepare(exynos_ehci-clk); @@ -316,9 +282,6
Re: [PATCH] usb: phy: drop kfree of devm_kzalloc's data
On Monday, August 11, 2014 5:00 AM, Himangi Saraogi wrote: Using kfree to free data allocated with devm_kzalloc causes double frees. The Coccinelle semantic patch that fixes this problem is as follows: // smpl @@ expression x; @@ x = devm_kzalloc(...) ... ?-kfree(x); // /smpl Signed-off-by: Himangi Saraogi himangi...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/phy/phy-gpio-vbus-usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index ea9e705..f4b14bd 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c @@ -260,10 +260,8 @@ static int gpio_vbus_probe(struct platform_device *pdev) gpio_vbus-phy.otg = devm_kzalloc(pdev-dev, sizeof(struct usb_otg), GFP_KERNEL); - if (!gpio_vbus-phy.otg) { - kfree(gpio_vbus); + if (!gpio_vbus-phy.otg) return -ENOMEM; - } platform_set_drvdata(pdev, gpio_vbus); gpio_vbus-dev = pdev-dev; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] usb: phy: samsung: Fix wrong bit mask for PHYPARAM1_PCS_TXDEEMPH
According to the datasheet, PHYPARAM1_PCS_TXDEEMPH is set as 6 bits [5:0]. Thus, the bit mask should be set as 0x3f, instead of 0x1f. Signed-off-by: Jingoo Han jg1@samsung.com --- These patches have a dependency on the patch ([PATCH] usb: phy: samsung: Remove unnecessary lines of register bit definitions). [1] [1] http://www.spinics.net/lists/linux-usb/msg111437.html drivers/usb/phy/phy-samsung-usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-samsung-usb.h b/drivers/usb/phy/phy-samsung-usb.h index 4eef4971..44e7605e4875 100644 --- a/drivers/usb/phy/phy-samsung-usb.h +++ b/drivers/usb/phy/phy-samsung-usb.h @@ -185,7 +185,7 @@ #define PHYPARAM0_REF_LOSLEVEL (0x9 26) #define EXYNOS5_DRD_PHYPARAM1 (0x20) -#define PHYPARAM1_PCS_TXDEEMPH_MASK(0x1f 0) +#define PHYPARAM1_PCS_TXDEEMPH_MASK(0x3f 0) #define PHYPARAM1_PCS_TXDEEMPH (0x1c) #define EXYNOS5_DRD_PHYTERM(0x24) -- 2.0.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] usb: phy: samsung: Add a _3P5DB suffix for PHYPARAM1_PCS_TXDEEMPH
According to the datasheet, PHYPARAM1_PCS_TXDEEMPH_3P5DB is a correct name. Thus, a _3P5DB suffix for the PHYPARAM1_PCS_TXDEEMPH register bit field definition is added. In addition, PHYPARAM1_PCS_TXDEEMPH_3P5DB(_x) is added in order to keep the same style, as other register bit field definitions are used in this way. Signed-off-by: Jingoo Han jg1@samsung.com --- These patches have a dependency on the patch ([PATCH] usb: phy: samsung: Remove unnecessary lines of register bit definitions). [1] [1] http://www.spinics.net/lists/linux-usb/msg111437.html drivers/usb/phy/phy-samsung-usb.h | 4 ++-- drivers/usb/phy/phy-samsung-usb3.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-samsung-usb.h b/drivers/usb/phy/phy-samsung-usb.h index 44e7605e4875..dc1dadea7ac9 100644 --- a/drivers/usb/phy/phy-samsung-usb.h +++ b/drivers/usb/phy/phy-samsung-usb.h @@ -185,8 +185,8 @@ #define PHYPARAM0_REF_LOSLEVEL (0x9 26) #define EXYNOS5_DRD_PHYPARAM1 (0x20) -#define PHYPARAM1_PCS_TXDEEMPH_MASK(0x3f 0) -#define PHYPARAM1_PCS_TXDEEMPH (0x1c) +#define PHYPARAM1_PCS_TXDEEMPH_3P5DB_MASK (0x3f 0) +#define PHYPARAM1_PCS_TXDEEMPH_3P5DB(_x) ((_x) 0) #define EXYNOS5_DRD_PHYTERM(0x24) diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index cc0819248acf..97151b9065e4 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c @@ -98,8 +98,8 @@ static void samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy) phyparam1 = readl(regs + EXYNOS5_DRD_PHYPARAM1); /* Set Tx De-Emphasis level */ - phyparam1 = ~PHYPARAM1_PCS_TXDEEMPH_MASK; - phyparam1 |= PHYPARAM1_PCS_TXDEEMPH; + phyparam1 = ~PHYPARAM1_PCS_TXDEEMPH_3P5DB_MASK; + phyparam1 |= PHYPARAM1_PCS_TXDEEMPH_3P5DB(0x1c); writel(phyparam1, regs + EXYNOS5_DRD_PHYPARAM1); phybatchg = readl(regs + EXYNOS5_DRD_PHYBATCHG); -- 2.0.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND] usb: ehci/ohci-exynos: Fix PHY getting sequence
On Tuesday, August 05, 2014 7:39 PM, Vivek Gautam wrote: Since we want to keep support for both older usb-phys as well as the newer generic phys, lets first get the generic PHYs and fallback to older USB-PHYs only when we fail to get the former. This should fix the issue with ehci-exynos and ohci-exynos, wherein in the absence of SAMSUNG_USB2PHY config symbol, we end up getting the NOP_USB_XCEIV phy when the same is enabled. And thus the PHYs are not configured properly. Reported-by: Sachin Kamat sachin.ka...@samsung.com Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Right, we would get the generic PHYs first, then get the older usb-phys. Then, the older one will be removed from the kernel. Thank you. Best regards, Jingoo Han --- Based on 'usb-next' branch. Resending it after adding 'Reported-by' tag. drivers/usb/host/ehci-exynos.c | 40 +- drivers/usb/host/ohci-exynos.c | 47 +++- 2 files changed, 42 insertions(+), 45 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index cda0a2f..2eed9a4 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -62,18 +62,6 @@ static int exynos_ehci_get_phy(struct device *dev, int phy_number; int ret = 0; - exynos_ehci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); - if (IS_ERR(exynos_ehci-phy)) { - ret = PTR_ERR(exynos_ehci-phy); - if (ret != -ENXIO ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; - } - dev_dbg(dev, Failed to get usb2 phy\n); - } else { - exynos_ehci-otg = exynos_ehci-phy-otg; - } - for_each_available_child_of_node(dev-of_node, child) { ret = of_property_read_u32(child, reg, phy_number); if (ret) { @@ -90,15 +78,27 @@ static int exynos_ehci_get_phy(struct device *dev, phy = devm_of_phy_get(dev, child, NULL); of_node_put(child); - if (IS_ERR(phy)) { - ret = PTR_ERR(phy); - if (ret != -ENOSYS ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; - } - dev_dbg(dev, Failed to get usb2 phy\n); - } + if (IS_ERR(phy)) + /* Lets fallback to older USB-PHYs */ + goto usb_phy_old; exynos_ehci-phy_g[phy_number] = phy; + /* Make the older PHYs unavailable */ + exynos_ehci-phy = ERR_PTR(-ENXIO); + } + + return 0; + +usb_phy_old: + exynos_ehci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); + if (IS_ERR(exynos_ehci-phy)) { + ret = PTR_ERR(exynos_ehci-phy); + if (ret != -ENXIO ret != -ENODEV) { + dev_err(dev, no usb2 phy configured\n); + return ret; + } + dev_dbg(dev, Failed to get usb2 phy\n); + } else { + exynos_ehci-otg = exynos_ehci-phy-otg; } return ret; diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index a72ab8f..7c48e3f 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -51,27 +51,12 @@ static int exynos_ohci_get_phy(struct device *dev, int phy_number; int ret = 0; - exynos_ohci-phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); - if (IS_ERR(exynos_ohci-phy)) { - ret = PTR_ERR(exynos_ohci-phy); - if (ret != -ENXIO ret != -ENODEV) { - dev_err(dev, no usb2 phy configured\n); - return ret; - } - dev_dbg(dev, Failed to get usb2 phy\n); - } else { - exynos_ohci-otg = exynos_ohci-phy-otg; - } - /* * Getting generic phy: * We are keeping both types of phys as a part of transiting OHCI * to generic phy framework, so as to maintain backward compatibilty - * with old DTB. - * If there are existing devices using DTB files built from them, - * to remove the support for old bindings in this driver, - * we need to make sure that such devices have their DTBs - * updated to ones built from new DTS. + * with old DTB too. + * We fallback to older USB-PHYs when we fail to get generic PHYs. */ for_each_available_child_of_node(dev-of_node, child) { ret = of_property_read_u32(child, reg, phy_number); @@ -89,15 +74,27 @@ static int exynos_ohci_get_phy(struct device *dev, phy = devm_of_phy_get(dev
[PATCH] usb: phy: samsung: Remove unnecessary lines of register bit definitions
Remove unnecessary lines of register bit definitions in order to enhance the readability. In this case, there are lines per register offset definitions. There is no functional change. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-samsung-usb.h | 36 ++-- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/drivers/usb/phy/phy-samsung-usb.h b/drivers/usb/phy/phy-samsung-usb.h index 68771bfd1825..4eef4971 100644 --- a/drivers/usb/phy/phy-samsung-usb.h +++ b/drivers/usb/phy/phy-samsung-usb.h @@ -21,7 +21,6 @@ /* Register definitions */ #define SAMSUNG_PHYPWR (0x00) - #define PHYPWR_NORMAL_MASK (0x19 0) #define PHYPWR_OTG_DISABLE (0x1 4) #define PHYPWR_ANALOG_POWERDOWN(0x1 3) @@ -31,7 +30,6 @@ #define PHYPWR_SLEEP_PHY0 (0x1 5) #define SAMSUNG_PHYCLK (0x04) - #define PHYCLK_MODE_USB11 (0x1 6) #define PHYCLK_EXT_OSC (0x1 5) #define PHYCLK_COMMON_ON_N (0x1 4) @@ -42,7 +40,6 @@ #define PHYCLK_CLKSEL_24M (0x3 0) #define SAMSUNG_RSTCON (0x08) - #define RSTCON_PHYLINK_SWRST (0x1 2) #define RSTCON_HLINK_SWRST (0x1 1) #define RSTCON_SWRST (0x1 0) @@ -50,26 +47,20 @@ /* EXYNOS4X12 */ #define EXYNOS4X12_PHY_HSIC_CTRL0 (0x04) #define EXYNOS4X12_PHY_HSIC_CTRL1 (0x08) - #define PHYPWR_NORMAL_MASK_HSIC1 (0x7 12) #define PHYPWR_NORMAL_MASK_HSIC0 (0x7 9) #define PHYPWR_NORMAL_MASK_PHY1(0x7 6) - #define RSTCON_HOSTPHY_SWRST (0xf 3) /* EXYNOS5 */ #define EXYNOS5_PHY_HOST_CTRL0 (0x00) - #define HOST_CTRL0_PHYSWRSTALL (0x1 31) - #define HOST_CTRL0_REFCLKSEL_MASK (0x3 19) #define HOST_CTRL0_REFCLKSEL_XTAL (0x0 19) #define HOST_CTRL0_REFCLKSEL_EXTL (0x1 19) #define HOST_CTRL0_REFCLKSEL_CLKCORE (0x2 19) - #define HOST_CTRL0_FSEL_MASK (0x7 16) #define HOST_CTRL0_FSEL(_x)((_x) 16) - #define FSEL_CLKSEL_50M(0x7) #define FSEL_CLKSEL_24M(0x5) #define FSEL_CLKSEL_20M(0x4) @@ -77,7 +68,6 @@ #define FSEL_CLKSEL_12M(0x2) #define FSEL_CLKSEL_10M(0x1) #define FSEL_CLKSEL_9600K (0x0) - #define HOST_CTRL0_TESTBURNIN (0x1 11) #define HOST_CTRL0_RETENABLE (0x1 10) #define HOST_CTRL0_COMMONON_N (0x1 9) @@ -98,10 +88,8 @@ #define EXYNOS5_PHY_HSIC_CTRL2 (0x20) #define EXYNOS5_PHY_HSIC_TUNE2 (0x24) - #define HSIC_CTRL_REFCLKSEL_MASK (0x3 23) #define HSIC_CTRL_REFCLKSEL(0x2 23) - #define HSIC_CTRL_REFCLKDIV_MASK (0x7f 16) #define HSIC_CTRL_REFCLKDIV(_x)((_x) 16) #define HSIC_CTRL_REFCLKDIV_12 (0x24 16) @@ -109,7 +97,6 @@ #define HSIC_CTRL_REFCLKDIV_16 (0x1a 16) #define HSIC_CTRL_REFCLKDIV_19_2 (0x15 16) #define HSIC_CTRL_REFCLKDIV_20 (0x14 16) - #define HSIC_CTRL_SIDDQ(0x1 6) #define HSIC_CTRL_FORCESLEEP (0x1 5) #define HSIC_CTRL_FORCESUSPEND (0x1 4) @@ -118,36 +105,29 @@ #define HSIC_CTRL_PHYSWRST (0x1 0) #define EXYNOS5_PHY_HOST_EHCICTRL (0x30) - #define HOST_EHCICTRL_ENAINCRXALIGN(0x1 29) #define HOST_EHCICTRL_ENAINCR4 (0x1 28) #define HOST_EHCICTRL_ENAINCR8 (0x1 27) #define HOST_EHCICTRL_ENAINCR16(0x1 26) #define EXYNOS5_PHY_HOST_OHCICTRL (0x34) - #define HOST_OHCICTRL_SUSPLGCY (0x1 3) #define HOST_OHCICTRL_APPSTARTCLK (0x1 2) #define HOST_OHCICTRL_CNTSEL (0x1 1) #define HOST_OHCICTRL_CLKCKTRST(0x1 0) #define EXYNOS5_PHY_OTG_SYS(0x38) - #define OTG_SYS_PHYLINK_SWRESET(0x1 14) #define OTG_SYS_LINKSWRST_UOTG (0x1 13) #define OTG_SYS_PHY0_SWRST (0x1 12) - #define OTG_SYS_REFCLKSEL_MASK (0x3 9) #define OTG_SYS_REFCLKSEL_XTAL (0x0 9) #define OTG_SYS_REFCLKSEL_EXTL (0x1 9) #define OTG_SYS_REFCLKSEL_CLKCORE (0x2 9) - #define OTG_SYS_IDPULLUP_UOTG (0x1 8) #define OTG_SYS_COMMON_ON (0x1 7) - #define OTG_SYS_FSEL_MASK
Re: [PATCH v2 2/2] usb: dwc2: add dr_mode support for dwc2
On Thursday, July 31, 2014 10:06 AM, Kever Yang wrote: Some devices with A female host port and without use of usb_id pin will need this for the otg controller works as device role during firmware period and works as host role in rich os. Hi Kever Yang, This commit message looks too specific. Please make it more general, as the commit usb: dwc3: set 'mode' based on selected Kconfig choices. Then, maybe, you can add this specific case. According to the dr_mode, the otg controller can work as device role during firmware period, and work as host role in the kernel, without use of usb_id pin. Best regards, Jingoo Han Signed-off-by: Kever Yang kever.y...@rock-chips.com --- Changes in v2: - put spaces around '+' operator - expand the comment for dr_mode - handle dr_mode is USB_DR_MODE_OTG drivers/usb/dwc2/core.c | 18 ++ drivers/usb/dwc2/core.h |5 + drivers/usb/dwc2/platform.c |4 3 files changed, 27 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 27d2c9b..738bec2 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -118,6 +118,7 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg) { u32 greset; int count = 0; + u32 gusbcfg; dev_vdbg(hsotg-dev, %s()\n, __func__); @@ -148,6 +149,23 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg) } } while (greset GRSTCTL_CSFTRST); + if (hsotg-dr_mode == USB_DR_MODE_HOST) { + gusbcfg = readl(hsotg-regs + GUSBCFG); + gusbcfg = ~GUSBCFG_FORCEDEVMODE; + gusbcfg |= GUSBCFG_FORCEHOSTMODE; + writel(gusbcfg, hsotg-regs + GUSBCFG); + } else if (hsotg-dr_mode == USB_DR_MODE_PERIPHERAL) { + gusbcfg = readl(hsotg-regs + GUSBCFG); + gusbcfg = ~GUSBCFG_FORCEHOSTMODE; + gusbcfg |= GUSBCFG_FORCEDEVMODE; + writel(gusbcfg, hsotg-regs + GUSBCFG); + } else if (hsotg-dr_mode == USB_DR_MODE_OTG) { + gusbcfg = readl(hsotg-regs + GUSBCFG); + gusbcfg = ~GUSBCFG_FORCEHOSTMODE; + gusbcfg = ~GUSBCFG_FORCEDEVMODE; + writel(gusbcfg, hsotg-regs + GUSBCFG); + } + /* * NOTE: This long sleep is _very_ important, otherwise the core will * not stay in host mode after a connector ID change! diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 1efd10c..a34681c 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -501,6 +501,10 @@ struct dwc2_hw_params { * a_peripheral and b_device=b_host) this may not match * the core, but allows the software to determine * transitions + * @dr_mode:Requested mode of operation, one of following: + * - USB_DR_MODE_PERIPHERAL + * - USB_DR_MODE_HOST + * - USB_DR_MODE_OTG * @queuing_high_bandwidth: True if multiple packets of a high-bandwidth * transfer are in process of being queued * @srp_success:Stores status of SRP request in the case of a FS PHY @@ -592,6 +596,7 @@ struct dwc2_hsotg { /** Params to actually use */ struct dwc2_core_params *core_params; enum usb_otg_state op_state; + enum usb_dr_modedr_mode; unsigned int queuing_high_bandwidth:1; unsigned int srp_success:1; diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index b14668b..669a03a 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -42,6 +42,8 @@ #include linux/of_device.h #include linux/platform_device.h +#include linux/usb/of.h + #include core.h #include hcd.h @@ -200,6 +202,8 @@ static int dwc2_driver_probe(struct platform_device *dev) dev_dbg(dev-dev, mapped PA %08lx to VA %p\n, (unsigned long)res-start, hsotg-regs); + hsotg-dr_mode = of_usb_get_dr_mode(dev-dev.of_node); + retval = dwc2_hcd_init(hsotg, irq, params); if (retval) return retval; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: phy: msm: Make of_device_id array const
On Wednesday, July 23, 2014 4:38 PM, Kiran Padwal wrote: Make of_device_id array const, because all OF functions handle it as const. Hi Kiran Padwal, The same patch was already submitted and merged to USB tree. Thank you. Best regards, Jingoo Han Signed-off-by: Kiran Padwal kiran.pad...@smartplayin.com --- drivers/usb/phy/phy-msm-usb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 78cc870..e4108ee 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -1429,7 +1429,7 @@ static void msm_otg_debugfs_cleanup(void) debugfs_remove(msm_otg_dbg_root); } -static struct of_device_id msm_otg_dt_match[] = { +static const struct of_device_id msm_otg_dt_match[] = { { .compatible = qcom,usb-otg-ci, .data = (void *) CI_45NM_INTEGRATED_PHY -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/12] usb: dwc2: Add DTS compatible string to dwc2_of_match_table
On Thursday, July 24, 2014 4:11 AM, Dinh Nguyen wrote: On 7/23/14, 1:03 PM, Paul Zimmerman wrote: From: Dinh Nguyen [mailto:dinh.li...@gmail.com] Sent: Wednesday, July 23, 2014 8:12 AM On 07/16/2014 04:27 PM, Paul Zimmerman wrote: From: dingu...@altera.com [mailto:dingu...@altera.com] Sent: Wednesday, July 16, 2014 1:33 PM Puts back samsung,s3c6400-hsotg into the dwc2_of_match_table[]. Why? This compatible binding was originally in the gadget driver. Don't I want to put it back into the platform binding table? Do you mean you accidently deleted it in one of your previous patches? If so, then yes you should put it back. But your commit message should explain that, so other people know why it is being done. Yes, I had to removed s3c_hsotg_of_ids[] in patch 3/12. I think I had to do this to enable that patch to build. Hi Dinh Nguyen, I see what you mean. I agree with Paul Zimmerman's opinion. It looks better to add more detailed commit message, because it allows people to know the reason more easily. :-) Thank you. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Patch v7 1/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver
? For me, it looks duplicated. + goto dis_clks; + } + + return 0; + +dis_clks: + if (qdwc-sleep_clk) + clk_disable_unprepare(qdwc-sleep_clk); + + if (qdwc-iface_clk) + clk_disable_unprepare(qdwc-iface_clk); + + clk_disable_unprepare(qdwc-core_clk); + + if (!IS_ERR(qdwc-gdsc)) { + ret = regulator_disable(qdwc-gdsc); + if (ret) + dev_dbg(qdwc-dev, cannot disable gdsc\n); + } + + return ret; +} + +static int dwc3_qcom_remove(struct platform_device *pdev) +{ + int ret = 0; + + struct dwc3_qcom *qdwc = platform_get_drvdata(pdev); + + if (qdwc-sleep_clk) + clk_disable_unprepare(qdwc-sleep_clk); + + if (qdwc-iface_clk) + clk_disable_unprepare(qdwc-iface_clk); + + clk_disable_unprepare(qdwc-core_clk); + + if (!IS_ERR(qdwc-gdsc)) { + ret = regulator_disable(qdwc-gdsc); + if (ret) + dev_dbg(qdwc-dev, cannot disable gdsc\n); + } + return ret; +} + +static const struct of_device_id of_dwc3_match[] = { + { .compatible = qcom,dwc3 }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, of_dwc3_match); + +static struct platform_driver dwc3_qcom_driver = { + .probe = dwc3_qcom_probe, + .remove = dwc3_qcom_remove, + .driver = { + .name = qcom-dwc3, + .owner = THIS_MODULE, + .of_match_table = of_dwc3_match, + }, +}; + +module_platform_driver(dwc3_qcom_driver); + +MODULE_ALIAS(platform:qcom-dwc3); How about adding the module author as Ivan T. Ivanov and you? MODULE_AUTHOR(Ivan T. Ivanov iiva...@mm-sol.com); MODULE_AUTHOR(Andy Gross agr...@codeaurora.org); Best regards, Jingoo Han +MODULE_LICENSE(GPL v2); +MODULE_DESCRIPTION(DesignWare USB3 QCOM Glue Layer); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 07/12] usb: dwc2: Move gadget interrupts to common interrupt handler
On Thursday, July 17, 2014 8:54 AM, Felipe Balbi wrote: On Wed, Jul 16, 2014 at 09:32:21PM +, Paul Zimmerman wrote: On, Wednesday, July 16, 2014 1:33 PM, dingu...@altera.com wrote: Update dwc2_handle_common_intr() to handle both hcd and gadget interrupts. Signed-off-by: Dinh Nguyen dingu...@altera.com --- drivers/usb/dwc2/core_intr.c | 116 +- drivers/usb/dwc2/gadget.c| 188 -- 2 files changed, 114 insertions(+), 190 deletions(-) I wonder if this is necessary? Why not leave the interrupt handling for host and device as separate routines, and just call the appropriate one depending on which mode the core is in? It seems cleaner that way to me, and avoids having all of the interrupt handling code in a single giant function. ill agree with here. You could even have completely separate functions and request the irq line with IRQF_SHARED. The only extra overhead would be a mode check at the begining of irq handler. I am also in agreement with this opinion. Personally, it looks better to use IRQF_SHARED with completely separate functions. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc3: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/core.c|9 +++-- drivers/usb/dwc3/dwc3-exynos.c |4 +--- drivers/usb/dwc3/dwc3-omap.c |4 +--- drivers/usb/dwc3/dwc3-pci.c|4 +--- drivers/usb/dwc3/gadget.c | 11 ++- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b769c1f..f2050e8 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -186,10 +186,8 @@ static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) dwc-ev_buffs = devm_kzalloc(dwc-dev, sizeof(*dwc-ev_buffs) * num, GFP_KERNEL); - if (!dwc-ev_buffs) { - dev_err(dwc-dev, can't allocate event buffers array\n); + if (!dwc-ev_buffs) return -ENOMEM; - } for (i = 0; i num; i++) { struct dwc3_event_buffer*evt; @@ -639,10 +637,9 @@ static int dwc3_probe(struct platform_device *pdev) void*mem; mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); - if (!mem) { - dev_err(dev, not enough memory\n); + if (!mem) return -ENOMEM; - } + dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1); dwc-mem = mem; dwc-dev = dev; diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index f9fb8ad..3951a65 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -113,10 +113,8 @@ static int dwc3_exynos_probe(struct platform_device *pdev) int ret; exynos = devm_kzalloc(dev, sizeof(*exynos), GFP_KERNEL); - if (!exynos) { - dev_err(dev, not enough memory\n); + if (!exynos) return -ENOMEM; - } /* * Right now device-tree probed devices don't get dma_mask set. diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 961295d..3014070 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -481,10 +481,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) } omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL); - if (!omap) { - dev_err(dev, not enough memory\n); + if (!omap) return -ENOMEM; - } platform_set_drvdata(pdev, omap); diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index a60bab7..436fb08 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -103,10 +103,8 @@ static int dwc3_pci_probe(struct pci_dev *pci, struct device *dev = pci-dev; glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); - if (!glue) { - dev_err(dev, not enough memory\n); + if (!glue) return -ENOMEM; - } glue-dev = dev; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index d9304a8..d5a2718 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -789,13 +789,10 @@ static struct usb_request *dwc3_gadget_ep_alloc_request(struct usb_ep *ep, { struct dwc3_request *req; struct dwc3_ep *dep = to_dwc3_ep(ep); - struct dwc3 *dwc = dep-dwc; req = kzalloc(sizeof(*req), gfp_flags); - if (!req) { - dev_err(dwc-dev, not enough memory\n); + if (!req) return NULL; - } req-epnum = dep-number; req-dep= dep; @@ -1743,11 +1740,8 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 epnum = (i 1) | (!!direction); dep = kzalloc(sizeof(*dep), GFP_KERNEL); - if (!dep) { - dev_err(dwc-dev, can't allocate endpoint %d\n, - epnum); + if (!dep) return -ENOMEM; - } dep-dwc = dwc; dep-number = epnum; @@ -2759,7 +2753,6 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc-setup_buf = kzalloc(DWC3_EP0_BOUNCE_SIZE, GFP_KERNEL); if (!dwc-setup_buf) { - dev_err(dwc-dev, failed to allocate setup buffer\n); ret = -ENOMEM; goto err2; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND V2] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro
Use SIMPLE_DEV_PM_OPS macro and remove DEV_PM_OPS macro, in order to make the code simpler. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-am335x.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 585e50c..b70e055 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -122,16 +122,10 @@ static int am335x_phy_resume(struct device *dev) return 0; } - -static const struct dev_pm_ops am335x_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume) -}; - -#define DEV_PM_OPS (am335x_pm_ops) -#else -#define DEV_PM_OPS NULL #endif +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); + static const struct of_device_id am335x_phy_ids[] = { { .compatible = ti,am335x-usb-phy }, { } @@ -144,7 +138,7 @@ static struct platform_driver am335x_phy_driver = { .driver = { .name = am335x-phy-driver, .owner = THIS_MODULE, - .pm = DEV_PM_OPS, + .pm = am335x_pm_ops, .of_match_table = am335x_phy_ids, }, }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
); + goto undo_powerdown; + } + + dev_info(pdev-dev, configured as %s DRD\n, + dwc3_data-drd_device_conf ? device : host); + + /* ST glue logic init */ + st_dwc3_init(dwc3_data); + + ret = platform_device_add_resources(dwc3_data-dwc3, pdev-resource, + pdev-num_resources); + if (ret) { + dev_err(pdev-dev, couldn't add resources to dwc3 device\n); + goto undo_powerdown; + } + + ret = platform_device_add(dwc3_data-dwc3); + if (ret) { + dev_err(pdev-dev, failed to register dwc3 device\n); + goto undo_powerdown; + } + + platform_set_drvdata(pdev, dwc3_data); + + return 0; + +undo_powerdown: + reset_control_assert(dwc3_data-rstc_pwrdn); +undo_platform_dev_alloc: + platform_device_put(pdev); + + return ret; + +} + +static int st_dwc3_remove(struct platform_device *pdev) +{ + struct st_dwc3 *dwc3_data = platform_get_drvdata(pdev); + + platform_device_unregister(dwc3_data-dwc3); + + return 0; +} + +#ifdef CONFIG_PM_SLEEP +static int st_dwc3_suspend(struct device *dev) +{ + struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); + + reset_control_assert(dwc3_data-rstc_pwrdn); + + pinctrl_pm_select_sleep_state(dev); + + return 0; +} + +static int st_dwc3_resume(struct device *dev) +{ + struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); + + pinctrl_pm_select_default_state(dev); + + reset_control_deassert(dwc3_data-rstc_pwrdn); + + return 0; +} + +#endif /* CONFIG_PM_SLEEP */ + +static const struct dev_pm_ops st_dwc3_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(st_dwc3_suspend, st_dwc3_resume) +}; + +static struct of_device_id st_dwc3_match[] = { Please add 'const' as below. This is because all OF functions handle of_device_id as const. static const struct of_device_id st_dwc3_match[] = { + { .compatible = st,stih407-dwc3 }, + { /* sentinel */ }, +}; + +MODULE_DEVICE_TABLE(of, st_dwc3_match); + +static struct platform_driver st_dwc3_driver = { + .probe = st_dwc3_probe, + .remove = st_dwc3_remove, + .driver = { + .name = usb-st-dwc3, + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(st_dwc3_match), You already use OF dependency as below. So, of_match_ptr() is NOT necessary. +config USB_DWC3_ST + tristate STMicroelectronics Platforms + depends on ARCH_STI OF Please remove of_match_ptr() as below. + .of_match_table = st_dwc3_match, Best regards, Jingoo Han + .pm = st_dwc3_dev_pm_ops, + }, +}; + +module_platform_driver(st_dwc3_driver); + +MODULE_AUTHOR(Giuseppe Cavallaro peppe.cavall...@st.com); +MODULE_DESCRIPTION(DesignWare USB3 STi Glue Layer); +MODULE_LICENSE(GPL v2); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc3: gadget: remove unnecessary 'start_new' variable
Remove 'start_new' variable from dwc3_endpoint_transfer_complete(), since this variable has not been used. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/gadget.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 9d64dd0..d9304a8 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1971,8 +1971,7 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep, } static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc, - struct dwc3_ep *dep, const struct dwc3_event_depevt *event, - int start_new) + struct dwc3_ep *dep, const struct dwc3_event_depevt *event) { unsignedstatus = 0; int clean_busy; @@ -2039,7 +2038,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, return; } - dwc3_endpoint_transfer_complete(dwc, dep, event, 1); + dwc3_endpoint_transfer_complete(dwc, dep, event); break; case DWC3_DEPEVT_XFERINPROGRESS: if (!usb_endpoint_xfer_isoc(dep-endpoint.desc)) { @@ -2048,7 +2047,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, return; } - dwc3_endpoint_transfer_complete(dwc, dep, event, 0); + dwc3_endpoint_transfer_complete(dwc, dep, event); break; case DWC3_DEPEVT_XFERNOTREADY: if (usb_endpoint_xfer_isoc(dep-endpoint.desc)) { -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] USB: ehci-pci: USB host controller support for Intel Quark X1000
On Tuesday, July 01, 2014 11:12 PM, Alan Stern wrote: On Tue, 1 Jul 2014, Chen, Alvin wrote: From: Bryan O'Donoghue bryan.odonog...@intel.com The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000 USB host controller, and the default value is 0x20 dwords. The in/out threshold can be programmed to 0x80 dwords (512 Bytes) to maximize the perfomrance, but only when isochronous/interrupt transactions are not initiated by the USB host controller. This patch is to reconfigure the packet buffer in/out threshold as maximal as possible to maximize the performance, and 0x7F dwords (508 Bytes) should be used because the USB host controller initiates isochronous/interrupt transactions. Signed-off-by: Bryan O'Donoghue bryan.odonog...@intel.com Signed-off-by: Alvin (Weike) Chen alvin.c...@intel.com Acked-by: Alan Stern st...@rowland.harvard.edu Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han There's one error in the style... diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 3e86bf4..429434d 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -35,6 +35,21 @@ static const char hcd_name[] = ehci-pci; #define PCI_DEVICE_ID_INTEL_CE4100_USB 0x2e70 /*-*/ +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC0x0939 +static inline bool is_intel_quark_x1000(struct pci_dev *pdev) +{ + return pdev-vendor == PCI_VENDOR_ID_INTEL + pdev-device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC; +} + +/* + * 0x84 is the offset of in/out threshold register, + * and it is the same offset as the register of 'hostpc'. + */ This comment isn't formatted right. It should be like this: /* * blah blah blah * blah blah blah */ If you want to submit a corrected version, you can. Or Greg may be willing to fix the style when he merges this patch. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: dwc2: fix sparse warning in platform.c
On Saturday, June 28, 2014 3:31 AM, Paul Zimmerman wrote: On Friday, June 27, 2014 11:00 AM, Sergei Shtylyov wrote: On 06/27/2014 07:09 PM, dingu...@altera.com wrote: From: Dinh Nguyen dingu...@altera.com This patch fixes this sparse warning: drivers/usb/dwc2/platform.c:168:25: warning: incorrect type in argument 1 (different address spaces) drivers/usb/dwc2/platform.c:168:25:expected void const *ptr drivers/usb/dwc2/platform.c:168:25:got void [noderef] asn:2*regs drivers/usb/dwc2/platform.c:169:37: warning: incorrect type in argument 1 (different address spaces) drivers/usb/dwc2/platform.c:169:37:expected void const *ptr drivers/usb/dwc2/platform.c:169:37:got void [noderef] asn:2*regs Signed-off-by: Dinh Nguyen dingu...@altera.com --- drivers/usb/dwc2/platform.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index a10e7a3..443c321 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -165,8 +165,8 @@ static int dwc2_driver_probe(struct platform_device *dev) res = platform_get_resource(dev, IORESOURCE_MEM, 0); hsotg-regs = devm_ioremap_resource(dev-dev, res); - if (IS_ERR(hsotg-regs)) - return PTR_ERR(hsotg-regs); + if (!hsotg-regs) + return -ENOMEM; This is wrong -- devm_ioremap_resource() returns error pointer, not NULL. Yup. Sparse gives the same warnings on other drivers as well, like dwc3 and musb. Maybe there is a newer version of sparse which fixes this? Or does the definition of IS_ERR need some work? As far as I know, the following patch was merged last year, in order to silence these sparse warnings. commit e7152b9 err.h: IS_ERR() can accept __user pointers In addition, the Sparse should be upgraded to v0.4.5-rc1 or later. Thank you. Best regards, Jingoo Han -- Paul -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: usb3503: return correct error return on failure
On Monday, June 30, 2014 6:43 AM, Colin King wrote: From: Colin Ian King colin.k...@canonical.com Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] err is not initialized, the error return should be PTR_ERR(clk) Signed-off-by: Colin Ian King colin.k...@canonical.com It looks good! Reviewed-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/misc/usb3503.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index f43c619..c0c898d 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub) clk = devm_clk_get(dev, refclk); if (IS_ERR(clk) PTR_ERR(clk) != -ENOENT) { - dev_err(dev, unable to request refclk (%d)\n, err); + dev_err(dev, unable to request refclk (%ld)\n, + PTR_ERR(clk)); return PTR_ERR(clk); } -- 2.0.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] USB: ehci-pci: USB host controller support for Intel Quark X1000
On Friday, June 27, 2014 8:25 PM, Alvin Chen wrote: From: Bryan O'Donoghue bryan.odonog...@intel.com The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000 USB host controller, and the default value is 0x20 dwords. The in/out threshold can be programmed to 0x80 dwords, but only when isochronous/interrupt transactions are not initiated by the USB host controller. This patch is to reconfigure the packet buffer in/out threshold as maximal as possible, and it is 0x7F dwords since the USB host controller initiates isochronous/interrupt transactions. So, what is the reason to set the value as 0x80? 1. The default value 0x20 makes some problems such as... 2. To maximize the performance, ... 3. Both Please add the reason why 0x80 is necessary, as possible. Then, 0x7F means 508 bytes? 'Intel Quark X1000 USB host controller' can support 0x80 (512bytes), however, in this case, isochronous/interrupt transactions cannot be initiated by 'Intel Quark X1000 USB host controller'. Right? So, 0x79 (508bytes?) should be used, because the isochronous/interrupt transactions can be initiated by 'Intel Quark X1000 USB host controller'. Right? Signed-off-by: Bryan O'Donoghue bryan.odonog...@intel.com Signed-off-by: Alvin (Weike) Chen alvin.c...@intel.com --- changelog v2: *Change the function name from 'usb_is_intel_qrk' to 'usb_is_intel_quark_x1000'. *Move the functions 'usb_is_intel_quark_x1000' and 'usb_set_qrk_bulk_thresh' from 'pci-quirks.c' to 'ehci-pci.c'. *Remove unnecessary kernel message in the function of 'usb_set_qrk_bulk_thresh'. *Remove 'unlikely' in the functions of 'ehci_pci_reinit'. *Add white space after 'if'. *Update the descriptions to make it more clearly. *Add Micros to avoid magic number. drivers/usb/host/ehci-pci.c | 45 +++ 1 file changed, 45 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 3e86bf4..ca29f34 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -35,6 +35,47 @@ static const char hcd_name[] = ehci-pci; #define PCI_DEVICE_ID_INTEL_CE4100_USB 0x2e70 /*-*/ +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC 0x0939 +static inline bool usb_is_intel_quark_x1000(struct pci_dev *pdev) +{ + return pdev-vendor == PCI_VENDOR_ID_INTEL + pdev-device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC; + Please don't add this unnecessary line. +} + +/* Register offset of in/out threshold */ +#define EHCI_INSNREG01 0x84 +/* The maximal threshold is 0x80 Dword */ +#define EHCI_MAX_THRESHOLD 0X80 s/0X80/0x80 0x80 means 512 bytes. So, how about mentioning '0x80 means 512 bytes' in this comment or the commit message? Maybe, how about the following? /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 +/* Lower word is 'in' threshold, and higher word is 'out' threshold*/ +#define EHCI_INSNREG01_THRESH \ + ((EHCI_MAX_THRESHOLD - 1)16 | (EHCI_MAX_THRESHOLD - 1)) Um, how about the following? /* Register offset of in/out threshold */ #define EHCI_INSNREG01 0x84 /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 #define EHCI_THRESHOLD_508BYTES 0x79 #define EHCI_THRESHOLD_OUT_SHIFT16 #define EHCI_THRESHOLD_IN_SHIFT 0 .. /* * In order to support the isochronous/interrupt transactions, * 508 bytes should be used as max threshold values */ */ val = ((EHCI_THRESHOLD_512BYTES - 1) EHCI_THRESHOLD_OUT_SHIFT | (EHCI_THRESHOLD_512BYTES - 1) EHCI_THRESHOLD_IN_SHIFT); writel(val, op_reg_base + EHCI_INSNREG01); +static void usb_set_qrk_bulk_thresh(struct pci_dev *pdev) Please, use usb_set_qrk_bulk_threshold(). The 'threshold' looks better than 'thresh'. +{ + void __iomem *base, *op_reg_base; + u8 cap_length; + u32 val; + u16 cmd; + + if (!pci_resource_start(pdev, 0)) + return; + + if (pci_read_config_word(pdev, PCI_COMMAND, cmd) + || !(cmd PCI_COMMAND_MEMORY)) + return; + + base = pci_ioremap_bar(pdev, 0); + if (base == NULL) + return; + + cap_length = readb(base); + op_reg_base = base + cap_length; + + val = EHCI_INSNREG01_THRESH; + writel(val, op_reg_base + EHCI_INSNREG01); + + iounmap(base); +} /* called after powerup, by probe or system-pm wakeup */ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) @@ -50,6 +91,10 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) if (!retval) ehci_dbg(ehci, MWI active\n); + /* Reset the threshold limit */
Re: [PATCH v2] USB: ehci-pci: USB host controller support for Intel Quark X1000
On Friday, June 27, 2014 1:33 PM, Jingoo Han wrote: On Friday, June 27, 2014 8:25 PM, Alvin Chen wrote: From: Bryan O'Donoghue bryan.odonog...@intel.com The EHCI packet buffer in/out threshold is programmable for Intel Quark X1000 USB host controller, and the default value is 0x20 dwords. The in/out threshold can be programmed to 0x80 dwords, but only when isochronous/interrupt transactions are not initiated by the USB host controller. This patch is to reconfigure the packet buffer in/out threshold as maximal as possible, and it is 0x7F dwords since the USB host controller initiates isochronous/interrupt transactions. So, what is the reason to set the value as 0x80? 1. The default value 0x20 makes some problems such as... 2. To maximize the performance, ... 3. Both Please add the reason why 0x80 is necessary, as possible. Then, 0x7F means 508 bytes? 'Intel Quark X1000 USB host controller' can support 0x80 (512bytes), however, in this case, isochronous/interrupt transactions cannot be initiated by 'Intel Quark X1000 USB host controller'. Right? So, 0x79 (508bytes?) should be used, because the isochronous/interrupt transactions can be initiated by 'Intel Quark X1000 USB host controller'. Right? Signed-off-by: Bryan O'Donoghue bryan.odonog...@intel.com Signed-off-by: Alvin (Weike) Chen alvin.c...@intel.com --- changelog v2: *Change the function name from 'usb_is_intel_qrk' to 'usb_is_intel_quark_x1000'. *Move the functions 'usb_is_intel_quark_x1000' and 'usb_set_qrk_bulk_thresh' from 'pci-quirks.c' to 'ehci-pci.c'. *Remove unnecessary kernel message in the function of 'usb_set_qrk_bulk_thresh'. *Remove 'unlikely' in the functions of 'ehci_pci_reinit'. *Add white space after 'if'. *Update the descriptions to make it more clearly. *Add Micros to avoid magic number. drivers/usb/host/ehci-pci.c | 45 +++ 1 file changed, 45 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 3e86bf4..ca29f34 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -35,6 +35,47 @@ static const char hcd_name[] = ehci-pci; #define PCI_DEVICE_ID_INTEL_CE4100_USB 0x2e70 /*-*/ +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC0x0939 +static inline bool usb_is_intel_quark_x1000(struct pci_dev *pdev) +{ + return pdev-vendor == PCI_VENDOR_ID_INTEL + pdev-device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC; + Please don't add this unnecessary line. +} + +/* Register offset of in/out threshold */ +#define EHCI_INSNREG01 0x84 +/* The maximal threshold is 0x80 Dword */ +#define EHCI_MAX_THRESHOLD 0X80 s/0X80/0x80 0x80 means 512 bytes. So, how about mentioning '0x80 means 512 bytes' in this comment or the commit message? Maybe, how about the following? /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 +/* Lower word is 'in' threshold, and higher word is 'out' threshold*/ +#define EHCI_INSNREG01_THRESH \ + ((EHCI_MAX_THRESHOLD - 1)16 | (EHCI_MAX_THRESHOLD - 1)) Um, how about the following? /* Register offset of in/out threshold */ #define EHCI_INSNREG010x84 /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 #define EHCI_THRESHOLD_508BYTES 0x79 #define EHCI_THRESHOLD_OUT_SHIFT 16 #define EHCI_THRESHOLD_IN_SHIFT 0 .. /* * In order to support the isochronous/interrupt transactions, * 508 bytes should be used as max threshold values */ */ val = ((EHCI_THRESHOLD_512BYTES - 1) EHCI_THRESHOLD_OUT_SHIFT | (EHCI_THRESHOLD_512BYTES - 1) EHCI_THRESHOLD_IN_SHIFT); writel(val, op_reg_base + EHCI_INSNREG01); Sorry, please refer to the following. /* Register offset of in/out threshold */ #define EHCI_INSNREG01 0x84 /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 #define EHCI_THRESHOLD_508BYTES 0x79 #define EHCI_THRESHOLD_OUT_SHIFT16 #define EHCI_THRESHOLD_IN_SHIFT 0 .. /* * In order to support the isochronous/interrupt transactions, * 508 bytes should be used as max threshold values */ */ val = (EHCI_THRESHOLD_508BYTES EHCI_THRESHOLD_OUT_SHIFT | (EHCI_THRESHOLD_508BYTES EHCI_THRESHOLD_IN_SHIFT); writel(val, op_reg_base + EHCI_INSNREG01); +static void usb_set_qrk_bulk_thresh(struct pci_dev *pdev) Please, use usb_set_qrk_bulk_threshold(). The 'threshold' looks better than 'thresh
Re: [PATCH v2 07/12] usb: chipidea: add a generic driver
On Tuesday, June 24, 2014 7:35 PM, Antoine Tenart wrote: Add a generic ChipIdea driver, with optional PHY and clock, to support ChipIdea controllers that doesn't need specific functions. s/doesn't/don't Needed for the Marvell Berlin SoCs SUB controllers. s/SUB/USB Signed-off-by: Antoine Ténart antoine.ten...@free-electrons.com --- drivers/usb/chipidea/Makefile | 1 + drivers/usb/chipidea/ci_hdrc_generic.c | 108 + 2 files changed, 109 insertions(+) create mode 100644 drivers/usb/chipidea/ci_hdrc_generic.c diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile index 2f099c7df7b5..c705f0fe7a00 100644 --- a/drivers/usb/chipidea/Makefile +++ b/drivers/usb/chipidea/Makefile @@ -20,4 +20,5 @@ endif ifneq ($(CONFIG_OF),) obj-$(CONFIG_USB_CHIPIDEA) += usbmisc_imx.o ci_hdrc_imx.o + obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_generic.o endif diff --git a/drivers/usb/chipidea/ci_hdrc_generic.c b/drivers/usb/chipidea/ci_hdrc_generic.c new file mode 100644 index ..27520710a1f7 --- /dev/null +++ b/drivers/usb/chipidea/ci_hdrc_generic.c [...] + +MODULE_DESCRIPTION(Generic ChipIdea HDRC USB binding); +MODULE_AUTHOR(Antoine Ténart antoine.ten...@free-electrons.com); +MODULE_LICENSE(GPL); How about GPL v2? Best regards, Jingoo Han -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] USB: ehci-pci: USB host controller support for Intel Quark X1000
On Wednesday, June 25, 2014 12:52 AM, Alvin Chen wrote: From: Bryan O'Donoghue bryan.odonog...@intel.com This patch is to enable USB host controller for Intel Quark X1000. Add pci quirks to adjust the packet buffer in/out threshold value, and ensure EHCI packet buffer i/o threshold value is reconfigured to half. Please add more detailed description. For example, why is it necessary to reconfigure the threshold value? Signed-off-by: Bryan O'Donoghue bryan.odonog...@intel.com Signed-off-by: Alvin (Weike) Chen alvin.c...@intel.com --- drivers/usb/host/ehci-pci.c |4 drivers/usb/host/pci-quirks.c | 42 + drivers/usb/host/pci-quirks.h |2 ++ 3 files changed, 48 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 3e86bf4..33cfa23 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -50,6 +50,10 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev) if (!retval) ehci_dbg(ehci, MWI active\n); + /* Reset the threshold limit */ + if(unlikely(usb_is_intel_qrk(pdev))) + usb_set_qrk_bulk_thresh(pdev); + return 0; } diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 00661d3..1ea8803 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -823,6 +823,48 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, return -ETIMEDOUT; } +#define PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC 0x0939 +bool usb_is_intel_qrk(struct pci_dev *pdev) +{ + return pdev-vendor == PCI_VENDOR_ID_INTEL + pdev-device == PCI_DEVICE_ID_INTEL_QUARK_X1000_SOC; + +} +EXPORT_SYMBOL_GPL(usb_is_intel_qrk); + +#define EHCI_INSNREG01 0x84 +#define EHCI_INSNREG01_THRESH0x007F007F /* Threshold value */ What does this magic number mean? Would you make it more readable? +void usb_set_qrk_bulk_thresh(struct pci_dev *pdev) +{ + void __iomem *base, *op_reg_base; + u8 cap_length; + u32 val; + + if (!mmio_resource_enabled(pdev, 0)) + return; + + base = pci_ioremap_bar(pdev, 0); + if (base == NULL) + return; + + cap_length = readb(base); + op_reg_base = base + cap_length; + + val = readl(op_reg_base + EHCI_INSNREG01); + dev_printk(KERN_INFO, pdev-dev, INSNREG01 is 0x%08x\n, val); + + val = EHCI_INSNREG01_THRESH; + + writel(val, op_reg_base + EHCI_INSNREG01); + + val = readl(op_reg_base + EHCI_INSNREG01); + dev_printk(KERN_INFO, pdev-dev, INSNREG01 is 0x%08x\n, val); As Alan Stern said, These INFO message are noisy. DEBUG level looks better. Best regards, Jingoo Han + + iounmap(base); + +} +EXPORT_SYMBOL_GPL(usb_set_qrk_bulk_thresh); + /* * Intel's Panther Point chipset has two host controllers (EHCI and xHCI) that * share some number of ports. These ports can be switched between either diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h index c622ddf..617c22b 100644 --- a/drivers/usb/host/pci-quirks.h +++ b/drivers/usb/host/pci-quirks.h @@ -14,6 +14,8 @@ void usb_amd_quirk_pll_enable(void); void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev); void usb_disable_xhci_ports(struct pci_dev *xhci_pdev); void sb800_prefetch(struct device *dev, int on); +bool usb_is_intel_qrk(struct pci_dev *pdev); +void usb_set_qrk_bulk_thresh(struct pci_dev *pdev); #else struct pci_dev; static inline void usb_amd_quirk_pll_disable(void) {} -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] USB: ehci-msm: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/ehci-msm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 982c09b..934b39d 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -190,7 +190,7 @@ static const struct dev_pm_ops ehci_msm_dev_pm_ops = { .resume = ehci_msm_pm_resume, }; -static struct of_device_id msm_ehci_dt_match[] = { +static const struct of_device_id msm_ehci_dt_match[] = { { .compatible = qcom,ehci-host, }, {} }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/4] USB: ehci-spear: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/ehci-spear.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 1d59958..1355ff0 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -150,7 +150,7 @@ static int spear_ehci_hcd_drv_remove(struct platform_device *pdev) return 0; } -static struct of_device_id spear_ehci_id_table[] = { +static const struct of_device_id spear_ehci_id_table[] = { { .compatible = st,spear600-ehci, }, { }, }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] USB: ehci-tegra: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/ehci-tegra.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 6fdcb8a..c303371 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -326,7 +326,7 @@ static const struct tegra_ehci_soc_config tegra20_soc_config = { .has_hostpc = false, }; -static struct of_device_id tegra_ehci_of_match[] = { +static const struct of_device_id tegra_ehci_of_match[] = { { .compatible = nvidia,tegra30-ehci, .data = tegra30_soc_config }, { .compatible = nvidia,tegra20-ehci, .data = tegra20_soc_config }, { }, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] USB: ohci-spear: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/ohci-spear.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 8b29a0c..8d58766 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -162,7 +162,7 @@ static int spear_ohci_hcd_drv_resume(struct platform_device *dev) } #endif -static struct of_device_id spear_ohci_id_table[] = { +static const struct of_device_id spear_ohci_id_table[] = { { .compatible = st,spear600-ohci, }, { }, }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] usb: gadget: gr_udc: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/gr_udc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/gr_udc.c b/drivers/usb/gadget/gr_udc.c index 99a37ed..5d93f2b 100644 --- a/drivers/usb/gadget/gr_udc.c +++ b/drivers/usb/gadget/gr_udc.c @@ -2212,7 +2212,7 @@ out: return retval; } -static struct of_device_id gr_match[] = { +static const struct of_device_id gr_match[] = { {.name = GAISLER_USBDC}, {.name = 01_021}, {}, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] usb: gadget: lpc32xx_udc: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/lpc32xx_udc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index e471580..c77c687 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c @@ -3397,7 +3397,7 @@ static int lpc32xx_udc_resume(struct platform_device *pdev) #endif #ifdef CONFIG_OF -static struct of_device_id lpc32xx_udc_of_match[] = { +static const struct of_device_id lpc32xx_udc_of_match[] = { { .compatible = nxp,lpc3220-udc, }, { }, }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] usb: phy: msm: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-msm-usb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index ced34f3..625c144 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -1427,7 +1427,7 @@ static void msm_otg_debugfs_cleanup(void) debugfs_remove(msm_otg_dbg_root); } -static struct of_device_id msm_otg_dt_match[] = { +static const struct of_device_id msm_otg_dt_match[] = { { .compatible = qcom,usb-otg-ci, .data = (void *) CI_45NM_INTEGRATED_PHY -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] usb: phy: tegra: Make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-tegra-usb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index bbe4f8e..cd36cb4 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -965,7 +965,7 @@ static const struct tegra_phy_soc_config tegra30_soc_config = { .requires_extra_tuning_parameters = true, }; -static struct of_device_id tegra_usb_phy_id_table[] = { +static const struct of_device_id tegra_usb_phy_id_table[] = { { .compatible = nvidia,tegra30-usb-phy, .data = tegra30_soc_config }, { .compatible = nvidia,tegra20-usb-phy, .data = tegra20_soc_config }, { }, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/2] usb: ehci-exynos: Make provision for vdd regulators
On Thursday, June 12, 2014 12:39 AM, Alan Stern wrote: On Fri, 6 Jun 2014, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for EHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Certain peripherals? Don't you mean certain controllers? Does this mean some controllers don't need to use the VDD regulators? @@ -193,7 +196,31 @@ static int exynos_ehci_probe(struct platform_device *pdev) err = exynos_ehci_get_phy(pdev-dev, exynos_ehci); if (err) - goto fail_clk; + goto fail_regulator1; + + exynos_ehci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (!IS_ERR(exynos_ehci-vdd33)) { + err = regulator_enable(exynos_ehci-vdd33); + if (err) { + dev_err(pdev-dev, + Failed to enable 3.3V Vdd supply\n); + goto fail_regulator1; + } + } else { + dev_warn(pdev-dev, Regulator 3.3V Vdd supply not found\n); + } What if this is one of the controllers that don't need to use a VDD regulator? Do you really want to print out a warning in that case? Should you call devm_regulator_get_optional() instead? I agree with Alan's suggestion. This warning message is not proper, when USB controllers that don't need a VDD regulator are used. The devm_regulator_get_optional() looks better. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] usb: gadget: pxa27x_udc: use devm_* helpers
On Wednesday, June 11, 2014 12:12 AM, Sergei Shtylyov wrote: On 06/10/2014 10:54 AM, Robert Jarzmik wrote: On 06/09/2014 11:52 PM, Robert Jarzmik wrote: regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); + udc-regs = devm_request_and_ioremap(pdev-dev, regs); Isn't this function deprecated in favor of devm_ioremap_resource()? I don't know.It's not marked as deprecated. Right, I sent the patch to mark devm_request_and_ioremap() as __deprecated. However, Greg KH wanted to just remove it from the kernel. OK, formally it isn't. However, the uses of devm_request_and_ioremap() are gradually replaced by devm_ioremap_resource(). Currently, two drivers are using the legacy devm_request_and_ioremap() as below. ./drivers/bus/brcmstb_gisb.c ./drivers/gpu/drm/armada/armada_crtc.c I already sent the patches to replace it; however, the maintainers are ignoring these patches. I think that it's the time to remove it. So, I will sent single patch to Greg KH in order to remove all usages of devm_request_and_ioremap() from the kernel. Best regards, Jingoo Han Could you give me a pointer ? Only to the patches replacing the former by the latter, I'm afraid... However, note that the former is implemented as a wrapper of the latter, so it makes little sense to use it instead of a direct call to devm_ioremap_resource(). [...] Cheers. WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] usb: gadget: pxa27x_udc: add devicetree support
On Tuesday, June 10, 2014 4:52 AM, Robert Jarzmik wrote: Add support for device-tree device discovery. If devicetree is not provided, fallback to legacy platform data discovery. Signed-off-by: Robert Jarzmik robert.jarz...@free.fr --- drivers/usb/gadget/pxa27x_udc.c | 105 drivers/usb/gadget/pxa27x_udc.h | 4 ++ 2 files changed, 90 insertions(+), 19 deletions(-) diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index cdf4d67..6236848 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c @@ -24,12 +24,15 @@ #include linux/gpio.h #include linux/slab.h #include linux/prefetch.h -#include linux/byteorder/generic.h -#include linux/platform_data/pxa2xx_udc.h +#include linux/of_device.h + +#include asm/byteorder.h +#include mach/hardware.h I don't think that this 'hardware.h' is necessary. Let me know the reason why this header file is added. #include linux/usb.h #include linux/usb/ch9.h #include linux/usb/gadget.h +#include mach/udc.h How about renaming and moving this 'udc.h' to 'include/linux/usb/' directory, and including '#include linux/usb/pxa-udc.h'? In this case, it enhances build coverage. So, regardless of the machine dependency, this driver file 'pxa27x_udc.c' can be built. Best regards, Jingoo Han #include pxa27x_udc.h @@ -1508,16 +1511,16 @@ static struct usb_ep_ops pxa_ep_ops = { static void dplus_pullup(struct pxa_udc *udc, int on) { if (on) { - if (gpio_is_valid(udc-mach-gpio_pullup)) - gpio_set_value(udc-mach-gpio_pullup, -!udc-mach-gpio_pullup_inverted); - if (udc-mach-udc_command) + if (gpio_is_valid(udc-gpio_pullup)) + gpio_set_value(udc-gpio_pullup, +!udc-gpio_pullup_inverted); + if (udc-mach udc-mach-udc_command) udc-mach-udc_command(PXA2XX_UDC_CMD_CONNECT); } else { - if (gpio_is_valid(udc-mach-gpio_pullup)) - gpio_set_value(udc-mach-gpio_pullup, -udc-mach-gpio_pullup_inverted); - if (udc-mach-udc_command) + if (gpio_is_valid(udc-gpio_pullup)) + gpio_set_value(udc-gpio_pullup, +udc-gpio_pullup_inverted); + if (udc-mach udc-mach-udc_command) udc-mach-udc_command(PXA2XX_UDC_CMD_DISCONNECT); } udc-pullup_on = on; @@ -1609,7 +1612,8 @@ static int pxa_udc_pullup(struct usb_gadget *_gadget, int is_active) { struct pxa_udc *udc = to_gadget_udc(_gadget); - if (!gpio_is_valid(udc-mach-gpio_pullup) !udc-mach-udc_command) + if (!gpio_is_valid(udc-gpio_pullup) + !(udc-mach udc-mach-udc_command)) return -EOPNOTSUPP; dplus_pullup(udc, is_active); @@ -2404,6 +2408,56 @@ static struct pxa_udc memory = { } }; +static struct of_device_id udc_pxa_dt_ids[] = { + { .compatible = mrvl,pxa27x_udc }, + {} +}; +MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids); + +/** + * pxa_udc_probe_dt - device tree specific probe + * @pdev: platform data + * @udc: pxa_udc structure to fill + * + * Fills udc from platform data out of device tree. + * + * Returns 0 if DT found, 1 if DT not found, and 0 on error + */ +bool pxa_udc_probe_dt(struct platform_device *pdev, struct pxa_udc *udc) +{ + struct device_node *np = pdev-dev.of_node; + const struct of_device_id *of_id = + of_match_device(udc_pxa_dt_ids, pdev-dev); + int ret; + u32 gpio_pullup; + + if (!np || !of_id) + return 1; + ret = of_alias_get_id(np, udc); + pdev-id = (ret = 0) ? ret : -1; + + if (!of_property_read_u32(np, udc-pullup-gpio, gpio_pullup)) + udc-gpio_pullup = gpio_pullup; + udc-gpio_pullup_inverted = + of_property_read_bool(np, udc-pullup-gpio-inverted); + return 0; +} + +/** + * pxa_udc_probe_pdata - legacy platform data probe + * @pdev: platform device + * @udc: pxa_udc structure to fill + * + * Simple copy of data from platform_data to udc control structure + */ +static void pxa_udc_probe_pdata(struct platform_device *pdev, +struct pxa_udc *udc) +{ + udc-mach = dev_get_platdata(pdev-dev); + udc-gpio_pullup = udc-mach-gpio_pullup; + udc-gpio_pullup_inverted = udc-mach-gpio_pullup_inverted; +} + /** * pxa_udc_probe - probes the udc device * @_dev: platform device @@ -2415,7 +2469,13 @@ static int pxa_udc_probe(struct platform_device *pdev) { struct resource *regs; struct pxa_udc *udc = memory; - int retval = 0, gpio; + int retval = 0; + + retval = pxa_udc_probe_dt(pdev, udc); + if (retval 0
Re: [PATCH 1/2] usb: ohci-exynos: Use NULL instead of 0
On Friday, June 06, 2014 5:44 PM, Sachin Kamat wrote: The third argument of devm_of_phy_get expects a pointer. Hence use NULL instead of 0. Signed-off-by: Sachin Kamat sachin.ka...@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/ohci-exynos.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 060a6a414750..a72ab8fe8cd3 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -87,7 +87,7 @@ static int exynos_ohci_get_phy(struct device *dev, return -EINVAL; } - phy = devm_of_phy_get(dev, child, 0); + phy = devm_of_phy_get(dev, child, NULL); of_node_put(child); if (IS_ERR(phy)) { ret = PTR_ERR(phy); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] usb: ehci-exynos: Use NULL instead of 0
On Friday, June 06, 2014 5:44 PM, Sachin Kamat wrote: The third argument of devm_of_phy_get expects a pointer. Hence use NULL instead of 0. Fixes the following warning: drivers/usb/host/ehci-exynos.c:91:51: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat sachin.ka...@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- drivers/usb/host/ehci-exynos.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d1c76216350f..cda0a2f5c467 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -88,7 +88,7 @@ static int exynos_ehci_get_phy(struct device *dev, return -EINVAL; } - phy = devm_of_phy_get(dev, child, 0); + phy = devm_of_phy_get(dev, child, NULL); of_node_put(child); if (IS_ERR(phy)) { ret = PTR_ERR(phy); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] usb: dwc2: gadget: fix checkpatch errors
Fix checkpatch errors as belows. ERROR: open brace '{' following function declarations go on the next line ERROR: space required before the open parenthesis '(' Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc2/gadget.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index f3c56a2..df43272 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1022,7 +1022,8 @@ static void s3c_hsotg_disconnect(struct s3c_hsotg *hsotg); * * Set stall for ep0 as response for setup request. */ -static void s3c_hsotg_stall_ep0(struct s3c_hsotg *hsotg) { +static void s3c_hsotg_stall_ep0(struct s3c_hsotg *hsotg) +{ struct s3c_hsotg_ep *ep0 = hsotg-eps[0]; u32 reg; u32 ctrl; @@ -1994,7 +1995,7 @@ static void kill_all_requests(struct s3c_hsotg *hsotg, s3c_hsotg_complete_request(hsotg, ep, req, result); } - if(hsotg-dedicated_fifos) + if (hsotg-dedicated_fifos) if ((readl(hsotg-regs + DTXFSTS(ep-index)) 0x) * 4 3072) s3c_hsotg_txfifo_flush(hsotg, ep-index); } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] usb: dwc2: gadget: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc2/gadget.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index df43272..73df48a 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3391,10 +3391,8 @@ static int s3c_hsotg_probe(struct platform_device *pdev) int i; hsotg = devm_kzalloc(pdev-dev, sizeof(struct s3c_hsotg), GFP_KERNEL); - if (!hsotg) { - dev_err(dev, cannot get memory\n); + if (!hsotg) return -ENOMEM; - } /* * Attempt to find a generic PHY, then look for an old style @@ -3513,7 +3511,6 @@ static int s3c_hsotg_probe(struct platform_device *pdev) eps = kcalloc(hsotg-num_of_eps + 1, sizeof(struct s3c_hsotg_ep), GFP_KERNEL); if (!eps) { - dev_err(dev, cannot get memory\n); ret = -ENOMEM; goto err_supplies; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] usb: dwc2: gadget: remove incorrect file reference
The file and folder movements resulted in the incorrect reference. So for better code maintainability, let's remove it. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc2/gadget.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 73df48a..0ba9c33 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1,6 +1,4 @@ /** - * linux/drivers/usb/gadget/s3c-hsotg.c - * * Copyright (c) 2011 Samsung Electronics Co., Ltd. * http://www.samsung.com * -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/8] usb: gadget: f_uac2: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_uac2.c |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c index bc23040..c024d27 100644 --- a/drivers/usb/gadget/f_uac2.c +++ b/drivers/usb/gadget/f_uac2.c @@ -974,8 +974,6 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) prm-rbuf = kzalloc(prm-max_psize * USB_XFERS, GFP_KERNEL); if (!prm-rbuf) { prm-max_psize = 0; - dev_err(uac2-pdev.dev, - %s:%d Error!\n, __func__, __LINE__); goto err; } @@ -984,8 +982,6 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) prm-rbuf = kzalloc(prm-max_psize * USB_XFERS, GFP_KERNEL); if (!prm-rbuf) { prm-max_psize = 0; - dev_err(uac2-pdev.dev, - %s:%d Error!\n, __func__, __LINE__); goto err; } @@ -1298,10 +1294,8 @@ static int audio_bind_config(struct usb_configuration *cfg) int res; agdev_g = kzalloc(sizeof *agdev_g, GFP_KERNEL); - if (agdev_g == NULL) { - printk(KERN_ERR Unable to allocate audio gadget\n); + if (agdev_g == NULL) return -ENOMEM; - } res = usb_string_ids_tab(cfg-cdev, strings_fn); if (res) -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/8] usb: gadget: fotg210-udc: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/fotg210-udc.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c index 2d03052..e143d69 100644 --- a/drivers/usb/gadget/fotg210-udc.c +++ b/drivers/usb/gadget/fotg210-udc.c @@ -1112,17 +1112,13 @@ static int fotg210_udc_probe(struct platform_device *pdev) /* initialize udc */ fotg210 = kzalloc(sizeof(struct fotg210_udc), GFP_KERNEL); - if (fotg210 == NULL) { - pr_err(kzalloc error\n); + if (fotg210 == NULL) goto err_alloc; - } for (i = 0; i FOTG210_MAX_NUM_EP; i++) { _ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL); - if (_ep[i] == NULL) { - pr_err(_ep kzalloc error\n); + if (_ep[i] == NULL) goto err_alloc; - } fotg210-ep[i] = _ep[i]; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] usb: gadget: fsl_udc_core: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/fsl_udc_core.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index a2f26cd..28e4fc9 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2256,10 +2256,8 @@ static int __init struct_udc_setup(struct fsl_udc *udc, udc-phy_mode = pdata-phy_mode; udc-eps = kzalloc(sizeof(struct fsl_ep) * udc-max_ep, GFP_KERNEL); - if (!udc-eps) { - ERR(malloc fsl_ep failed\n); + if (!udc-eps) return -1; - } /* initialized QHs, take care of alignment */ size = udc-max_ep * sizeof(struct ep_queue_head); @@ -2342,10 +2340,8 @@ static int __init fsl_udc_probe(struct platform_device *pdev) u32 dccparams; udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL); - if (udc_controller == NULL) { - ERR(malloc udc failed\n); + if (udc_controller == NULL) return -ENOMEM; - } pdata = dev_get_platdata(pdev-dev); udc_controller-pdata = pdata; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/8] usb: gadget: fusb300_udc: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/fusb300_udc.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index 6423f18..3deb4e9 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c @@ -1400,17 +1400,13 @@ static int __init fusb300_probe(struct platform_device *pdev) /* initialize udc */ fusb300 = kzalloc(sizeof(struct fusb300), GFP_KERNEL); - if (fusb300 == NULL) { - pr_err(kzalloc error\n); + if (fusb300 == NULL) goto clean_up; - } for (i = 0; i FUSB300_MAX_NUM_EP; i++) { _ep[i] = kzalloc(sizeof(struct fusb300_ep), GFP_KERNEL); - if (_ep[i] == NULL) { - pr_err(_ep kzalloc error\n); + if (_ep[i] == NULL) goto clean_up; - } fusb300-ep[i] = _ep[i]; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/8] usb: gadget: m66592-udc: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/m66592-udc.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index 8cae01d..0d17174 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c @@ -1594,7 +1594,6 @@ static int __init m66592_probe(struct platform_device *pdev) m66592 = kzalloc(sizeof(struct m66592), GFP_KERNEL); if (m66592 == NULL) { ret = -ENOMEM; - pr_err(kzalloc error\n); goto clean_up; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/8] usb: gadget: mv_u3d_core: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/mv_u3d_core.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c index d2ca59e..1624871 100644 --- a/drivers/usb/gadget/mv_u3d_core.c +++ b/drivers/usb/gadget/mv_u3d_core.c @@ -297,10 +297,8 @@ static struct mv_u3d_trb *mv_u3d_build_trb_one(struct mv_u3d_req *req, u3d = req-ep-u3d; trb = kzalloc(sizeof(*trb), GFP_ATOMIC); - if (!trb) { - dev_err(u3d-dev, %s, trb alloc fail\n, __func__); + if (!trb) return NULL; - } /* * Be careful that no _GFP_HIGHMEM is set, @@ -446,17 +444,12 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req) trb_num++; trb = kcalloc(trb_num, sizeof(*trb), GFP_ATOMIC); - if (!trb) { - dev_err(u3d-dev, - %s, trb alloc fail\n, __func__); + if (!trb) return -ENOMEM; - } trb_hw = kcalloc(trb_num, sizeof(*trb_hw), GFP_ATOMIC); if (!trb_hw) { kfree(trb); - dev_err(u3d-dev, - %s, trb_hw alloc fail\n, __func__); return -ENOMEM; } @@ -1811,7 +1804,6 @@ static int mv_u3d_probe(struct platform_device *dev) u3d = kzalloc(sizeof(*u3d), GFP_KERNEL); if (!u3d) { - dev_err(dev-dev, failed to allocate memory for u3d\n); retval = -ENOMEM; goto err_alloc_private; } @@ -1905,7 +1897,6 @@ static int mv_u3d_probe(struct platform_device *dev) size = u3d-max_eps * sizeof(struct mv_u3d_ep) * 2; u3d-eps = kzalloc(size, GFP_KERNEL); if (!u3d-eps) { - dev_err(dev-dev, allocate ep memory failed\n); retval = -ENOMEM; goto err_alloc_eps; } @@ -1913,7 +1904,6 @@ static int mv_u3d_probe(struct platform_device *dev) /* initialize ep0 status request structure */ u3d-status_req = kzalloc(sizeof(struct mv_u3d_req) + 8, GFP_KERNEL); if (!u3d-status_req) { - dev_err(dev-dev, allocate status_req memory failed\n); retval = -ENOMEM; goto err_alloc_status_req; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/8] usb: gadget: r8a66597-udc: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/r8a66597-udc.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index aff0a67..b698a49 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -1904,7 +1904,6 @@ static int __init r8a66597_probe(struct platform_device *pdev) r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL); if (r8a66597 == NULL) { ret = -ENOMEM; - dev_err(pdev-dev, kzalloc error\n); goto clean_up; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 8/8] usb: gadget: tcm_usb_gadget: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/tcm_usb_gadget.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 819875c..6cdb7a5 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -1383,10 +1383,8 @@ static struct se_node_acl *usbg_alloc_fabric_acl(struct se_portal_group *se_tpg) struct usbg_nacl *nacl; nacl = kzalloc(sizeof(struct usbg_nacl), GFP_KERNEL); - if (!nacl) { - printk(KERN_ERR Unable to allocate struct usbg_nacl\n); + if (!nacl) return NULL; - } return nacl-se_node_acl; } @@ -1561,10 +1559,8 @@ static struct se_portal_group *usbg_make_tpg( } tpg = kzalloc(sizeof(struct usbg_tpg), GFP_KERNEL); - if (!tpg) { - printk(KERN_ERR Unable to allocate struct usbg_tpg); + if (!tpg) return ERR_PTR(-ENOMEM); - } mutex_init(tpg-tpg_mutex); atomic_set(tpg-tpg_port_count, 0); tpg-workqueue = alloc_workqueue(tcm_usb_gadget, 0, 1); @@ -1613,10 +1609,8 @@ static struct se_wwn *usbg_make_tport( return ERR_PTR(-EINVAL); tport = kzalloc(sizeof(struct usbg_tport), GFP_KERNEL); - if (!(tport)) { - printk(KERN_ERR Unable to allocate struct usbg_tport); + if (!(tport)) return ERR_PTR(-ENOMEM); - } tport-tport_wwpn = wwpn; snprintf(tport-tport_name, sizeof(tport-tport_name), %s, wnn_name); return tport-tport_wwn; @@ -1727,10 +1721,8 @@ static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name) ret = -ENOMEM; tv_nexus = kzalloc(sizeof(*tv_nexus), GFP_KERNEL); - if (!tv_nexus) { - pr_err(Unable to allocate struct tcm_vhost_nexus\n); + if (!tv_nexus) goto err_unlock; - } tv_nexus-tvn_se_sess = transport_init_session(TARGET_PROT_NORMAL); if (IS_ERR(tv_nexus-tvn_se_sess)) goto err_free; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] usb: ohci-exynos: Use struct device instead of platform_device
On Monday, April 28, 2014 6:25 PM, Vivek Gautam wrote: Change to use struct device instead of struct platform_device for some static functions. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han Cc: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-exynos.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 9cf80cb..05f00e3 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -39,18 +39,18 @@ struct exynos_ohci_hcd { struct usb_otg *otg; }; -static void exynos_ohci_phy_enable(struct platform_device *pdev) +static void exynos_ohci_phy_enable(struct device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci-phy) usb_phy_init(exynos_ohci-phy); } -static void exynos_ohci_phy_disable(struct platform_device *pdev) +static void exynos_ohci_phy_disable(struct device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci-phy) @@ -139,7 +139,7 @@ skip_phy: platform_set_drvdata(pdev, hcd); - exynos_ohci_phy_enable(pdev); + exynos_ohci_phy_enable(pdev-dev); err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) { @@ -150,7 +150,7 @@ skip_phy: return 0; fail_add_hcd: - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(pdev-dev); fail_io: clk_disable_unprepare(exynos_ohci-clk); fail_clk: @@ -168,7 +168,7 @@ static int exynos_ohci_remove(struct platform_device *pdev) if (exynos_ohci-otg) exynos_ohci-otg-set_host(exynos_ohci-otg, hcd-self); - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(pdev-dev); clk_disable_unprepare(exynos_ohci-clk); @@ -190,7 +190,6 @@ static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - struct platform_device *pdev = to_platform_device(dev); bool do_wakeup = device_may_wakeup(dev); int rc = ohci_suspend(hcd, do_wakeup); @@ -200,7 +199,7 @@ static int exynos_ohci_suspend(struct device *dev) if (exynos_ohci-otg) exynos_ohci-otg-set_host(exynos_ohci-otg, hcd-self); - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(dev); clk_disable_unprepare(exynos_ohci-clk); @@ -211,14 +210,13 @@ static int exynos_ohci_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - struct platform_device *pdev= to_platform_device(dev); clk_prepare_enable(exynos_ohci-clk); if (exynos_ohci-otg) exynos_ohci-otg-set_host(exynos_ohci-otg, hcd-self); - exynos_ohci_phy_enable(pdev); + exynos_ohci_phy_enable(dev); ohci_resume(hcd, false); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/4] usb: ehci-exynos: Use struct device instead of platform_device
On Monday, April 28, 2014 6:26 PM, Vivek Gautam wrote: Change to use struct device instead of struct platform_device for some static functions. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han Cc: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-exynos.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 7f425ac..4d763dc 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -50,9 +50,8 @@ struct exynos_ehci_hcd { #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)-priv) -static void exynos_setup_vbus_gpio(struct platform_device *pdev) +static void exynos_setup_vbus_gpio(struct device *dev) { - struct device *dev = pdev-dev; int err; int gpio; @@ -88,7 +87,7 @@ static int exynos_ehci_probe(struct platform_device *pdev) if (err) return err; - exynos_setup_vbus_gpio(pdev); + exynos_setup_vbus_gpio(pdev-dev); hcd = usb_create_hcd(exynos_ehci_hc_driver, pdev-dev, dev_name(pdev-dev)); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: ohci-exynos: Make provision for vdd regulators
On Thursday, April 24, 2014 3:40 PM, Vivek Gautam wrote: On Thu, Apr 24, 2014 at 6:56 AM, Jingoo Han jg1@samsung.com wrote: On Thursday, April 24, 2014 9:33 AM, Jingoo Han wrote: On Thursday, April 24, 2014 9:18 AM, Anton Tikhomirov wrote: On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for OHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ohci-exynos.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci- exynos.c index 68588d8..e2e72a8 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c [snip] @@ -98,6 +101,28 @@ static int exynos_ohci_probe(struct platform_device *pdev) exynos_ohci-otg = phy-otg; } + exynos_ohci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (IS_ERR(exynos_ohci-vdd33)) { + err = PTR_ERR(exynos_ohci-vdd33); + goto fail_regulator1; + } + err = regulator_enable(exynos_ohci-vdd33); + if (err) { + dev_err(pdev-dev, Failed to enable VDD33 supply\n); + goto fail_regulator1; + } + + exynos_ohci-vdd10 = devm_regulator_get(pdev-dev, vdd10); + if (IS_ERR(exynos_ohci-vdd10)) { + err = PTR_ERR(exynos_ohci-vdd10); + goto fail_regulator2; + } + err = regulator_enable(exynos_ohci-vdd10); + if (err) { + dev_err(pdev-dev, Failed to enable VDD10 supply\n); + goto fail_regulator2; + } + Do we need to skip regulator settings together with PHY configuration in case of exynos5440? Oh, right. In the case of exynos5440, regulator settings is not necessary. Vivek, would you fix it in order skip regulator settings in exynos5440? It also applies to ehci-exynos. Sorry, in the case of exynos5440, this patch already skips regulator settings. In the case of exynos5440, there is no need to set PHY setting and regulator setting. Right, in case of exynos5440, we are skipping PHY setting and regulator setting. Actually i had missed taking into account 5440, so just curious. Do we really not need a regulator settings for Exynos5440 ? To be more specific, there is no regulator on ssdk5440 board which is the Exynos5440-based board. Best regards, Jingoo Han How about making regulator setting optional? Then, regulator setting can be done, only when regulator is supported. True, so with Exynos5440 not needing the regulator, we should make the regulator settings optional. [.] Thanks for the suggestion. I will make the required changes, and post the patchset again. OK, I see. Thank you for accepting my suggestion. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] usb: dwc3-exynos: Make provision for vdd regulators
On Wednesday, April 23, 2014 8:06 PM, Vivek Gautam wrote: On Wednesday, April 23, 2014 7:58 PM, Anton Tikhomirov wrote: On Wednesday, April 23, 2014 6:52 PM, Vivek Gautam wrote: On Wednesday, April 23, 2014 6:27 PM, Anton Tikhomirov wrote: On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for DWC3 controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Anton Tikhomirov av.tikhomi...@samsung.com --- Based on 'usb-next' branch of Greg's USB tree. Also cleanly applies on 'next' branch of Balbi's USB tree. drivers/usb/dwc3/dwc3-exynos.c | 51 ++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3- exynos.c index 28c8ad7..c9d9102 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -27,6 +27,7 @@ #include linux/usb/usb_phy_gen_xceiv.h #include linux/of.h #include linux/of_platform.h +#include linux/regulator/consumer.h struct dwc3_exynos { struct platform_device *usb2_phy; @@ -34,6 +35,8 @@ struct dwc3_exynos { struct device *dev; struct clk *clk; + struct regulator*vdd33; + struct regulator*vdd10; }; static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) @@ -144,20 +147,46 @@ static int dwc3_exynos_probe(struct platform_device *pdev) clk_prepare_enable(exynos-clk); + exynos-vdd33 = devm_regulator_get(dev, vdd33); + if (IS_ERR(exynos-vdd33)) { + ret = PTR_ERR(exynos-vdd33); + goto err2; Is regulator property mandatory for dwc3-exynos? If it is not and device tree doesn't provide it, dwc3-exynos driver probe shouldn't fail here. These are the VDD regulators (from PMIC ldo supplies), in absence of which the controller will not be powered up. So doesn't it make sense to stop the probe when these are not supplied by device tree ? Agree. Just curious, is there special reason for this change except making things right? Yea, actually after the patch (which got merged in 3.15 rc1) 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, the USB stops working, and that's because the regulators related to usb are not turned on by default (ldo12 and ldo15 to be specific). So we need to enable those regulators, which ofcourse the driver should be doing, if i am not wrong. Similar is the reason for EHCI, and OHCI exynos patches in this series. Oh, I see. Thank you for your explanation. I shall be sending the dt patch for this soon. OK, I will wait for your patch. Best regards, Jingoo Han -- Best Regards Vivek Gautam Samsung RD Institute, Bangalore India -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: ohci-exynos: Make provision for vdd regulators
On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for OHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ohci-exynos.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 68588d8..e2e72a8 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -18,6 +18,7 @@ #include linux/module.h #include linux/of.h #include linux/platform_device.h +#include linux/regulator/consumer.h #include linux/usb/phy.h #include linux/usb/samsung_usb_phy.h #include linux/usb.h @@ -37,6 +38,8 @@ struct exynos_ohci_hcd { struct clk *clk; struct usb_phy *phy; struct usb_otg *otg; + struct regulator *vdd33; + struct regulator *vdd10; }; static void exynos_ohci_phy_enable(struct platform_device *pdev) @@ -98,6 +101,28 @@ static int exynos_ohci_probe(struct platform_device *pdev) exynos_ohci-otg = phy-otg; } + exynos_ohci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (IS_ERR(exynos_ohci-vdd33)) { + err = PTR_ERR(exynos_ohci-vdd33); + goto fail_regulator1; + } + err = regulator_enable(exynos_ohci-vdd33); + if (err) { + dev_err(pdev-dev, Failed to enable VDD33 supply\n); + goto fail_regulator1; + } + + exynos_ohci-vdd10 = devm_regulator_get(pdev-dev, vdd10); + if (IS_ERR(exynos_ohci-vdd10)) { + err = PTR_ERR(exynos_ohci-vdd10); + goto fail_regulator2; + } + err = regulator_enable(exynos_ohci-vdd10); + if (err) { + dev_err(pdev-dev, Failed to enable VDD10 supply\n); + goto fail_regulator2; + } + skip_phy: exynos_ohci-clk = devm_clk_get(pdev-dev, usbhost); @@ -154,6 +179,10 @@ fail_add_hcd: fail_io: clk_disable_unprepare(exynos_ohci-clk); fail_clk: + regulator_disable(exynos_ohci-vdd10); +fail_regulator2: + regulator_disable(exynos_ohci-vdd33); +fail_regulator1: usb_put_hcd(hcd); return err; } @@ -172,6 +201,9 @@ static int exynos_ohci_remove(struct platform_device *pdev) clk_disable_unprepare(exynos_ohci-clk); + regulator_disable(exynos_ohci-vdd10); + regulator_disable(exynos_ohci-vdd33); + usb_put_hcd(hcd); return 0; @@ -208,6 +240,9 @@ static int exynos_ohci_suspend(struct device *dev) clk_disable_unprepare(exynos_ohci-clk); + regulator_disable(exynos_ohci-vdd10); + regulator_disable(exynos_ohci-vdd33); + spin_unlock_irqrestore(ohci-lock, flags); return 0; @@ -218,6 +253,18 @@ static int exynos_ohci_resume(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct platform_device *pdev= to_platform_device(dev); + int ret; + + ret = regulator_enable(exynos_ohci-vdd33); + if (ret) { + dev_err(dev, Failed to enable VDD33 supply\n); + return ret; + } + ret = regulator_enable(exynos_ohci-vdd10); + if (ret) { + dev_err(dev, Failed to enable VDD10 supply\n); + return ret; + } clk_prepare_enable(exynos_ohci-clk); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] usb: ehci-exynos: Make provision for vdd regulators
On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for EHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ehci-exynos.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d1d8c47..a3ca8cc 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -20,6 +20,7 @@ #include linux/of.h #include linux/of_gpio.h #include linux/platform_device.h +#include linux/regulator/consumer.h #include linux/usb/phy.h #include linux/usb/samsung_usb_phy.h #include linux/usb.h @@ -46,6 +47,8 @@ struct exynos_ehci_hcd { struct clk *clk; struct usb_phy *phy; struct usb_otg *otg; + struct regulator *vdd33; + struct regulator *vdd10; }; #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)-priv) @@ -112,6 +115,28 @@ static int exynos_ehci_probe(struct platform_device *pdev) exynos_ehci-otg = phy-otg; } + exynos_ehci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (IS_ERR(exynos_ehci-vdd33)) { + err = PTR_ERR(exynos_ehci-vdd33); + goto fail_regulator1; + } + err = regulator_enable(exynos_ehci-vdd33); + if (err) { + dev_err(pdev-dev, Failed to enable VDD33 supply\n); + goto fail_regulator1; + } + + exynos_ehci-vdd10 = devm_regulator_get(pdev-dev, vdd10); + if (IS_ERR(exynos_ehci-vdd10)) { + err = PTR_ERR(exynos_ehci-vdd10); + goto fail_regulator2; + } + err = regulator_enable(exynos_ehci-vdd10); + if (err) { + dev_err(pdev-dev, Failed to enable VDD10 supply\n); + goto fail_regulator2; + } + skip_phy: exynos_ehci-clk = devm_clk_get(pdev-dev, usbhost); @@ -178,6 +203,10 @@ fail_add_hcd: fail_io: clk_disable_unprepare(exynos_ehci-clk); fail_clk: + regulator_disable(exynos_ehci-vdd10); +fail_regulator2: + regulator_disable(exynos_ehci-vdd33); +fail_regulator1: usb_put_hcd(hcd); return err; } @@ -197,6 +226,9 @@ static int exynos_ehci_remove(struct platform_device *pdev) clk_disable_unprepare(exynos_ehci-clk); + regulator_disable(exynos_ehci-vdd10); + regulator_disable(exynos_ehci-vdd33); + usb_put_hcd(hcd); return 0; @@ -221,6 +253,9 @@ static int exynos_ehci_suspend(struct device *dev) clk_disable_unprepare(exynos_ehci-clk); + regulator_disable(exynos_ehci-vdd10); + regulator_disable(exynos_ehci-vdd33); + return rc; } @@ -228,6 +263,18 @@ static int exynos_ehci_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); + int ret; + + ret = regulator_enable(exynos_ehci-vdd33); + if (ret) { + dev_err(dev, Failed to enable VDD33 supply\n); + return ret; + } + ret = regulator_enable(exynos_ehci-vdd10); + if (ret) { + dev_err(dev, Failed to enable VDD10 supply\n); + return ret; + } clk_prepare_enable(exynos_ehci-clk); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: ohci-exynos: Make provision for vdd regulators
On Thursday, April 24, 2014 9:18 AM, Anton Tikhomirov wrote: On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for OHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ohci-exynos.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci- exynos.c index 68588d8..e2e72a8 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -18,6 +18,7 @@ #include linux/module.h #include linux/of.h #include linux/platform_device.h +#include linux/regulator/consumer.h #include linux/usb/phy.h #include linux/usb/samsung_usb_phy.h #include linux/usb.h @@ -37,6 +38,8 @@ struct exynos_ohci_hcd { struct clk *clk; struct usb_phy *phy; struct usb_otg *otg; + struct regulator *vdd33; + struct regulator *vdd10; }; static void exynos_ohci_phy_enable(struct platform_device *pdev) @@ -98,6 +101,28 @@ static int exynos_ohci_probe(struct platform_device *pdev) exynos_ohci-otg = phy-otg; } + exynos_ohci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (IS_ERR(exynos_ohci-vdd33)) { + err = PTR_ERR(exynos_ohci-vdd33); + goto fail_regulator1; + } + err = regulator_enable(exynos_ohci-vdd33); + if (err) { + dev_err(pdev-dev, Failed to enable VDD33 supply\n); + goto fail_regulator1; + } + + exynos_ohci-vdd10 = devm_regulator_get(pdev-dev, vdd10); + if (IS_ERR(exynos_ohci-vdd10)) { + err = PTR_ERR(exynos_ohci-vdd10); + goto fail_regulator2; + } + err = regulator_enable(exynos_ohci-vdd10); + if (err) { + dev_err(pdev-dev, Failed to enable VDD10 supply\n); + goto fail_regulator2; + } + Do we need to skip regulator settings together with PHY configuration in case of exynos5440? Oh, right. In the case of exynos5440, regulator settings is not necessary. Vivek, would you fix it in order skip regulator settings in exynos5440? It also applies to ehci-exynos. Best regards, Jingoo Han skip_phy: exynos_ohci-clk = devm_clk_get(pdev-dev, usbhost); @@ -154,6 +179,10 @@ fail_add_hcd: fail_io: clk_disable_unprepare(exynos_ohci-clk); fail_clk: + regulator_disable(exynos_ohci-vdd10); +fail_regulator2: + regulator_disable(exynos_ohci-vdd33); +fail_regulator1: usb_put_hcd(hcd); return err; } @@ -172,6 +201,9 @@ static int exynos_ohci_remove(struct platform_device *pdev) clk_disable_unprepare(exynos_ohci-clk); + regulator_disable(exynos_ohci-vdd10); + regulator_disable(exynos_ohci-vdd33); + usb_put_hcd(hcd); return 0; @@ -208,6 +240,9 @@ static int exynos_ohci_suspend(struct device *dev) clk_disable_unprepare(exynos_ohci-clk); + regulator_disable(exynos_ohci-vdd10); + regulator_disable(exynos_ohci-vdd33); + spin_unlock_irqrestore(ohci-lock, flags); return 0; @@ -218,6 +253,18 @@ static int exynos_ohci_resume(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct platform_device *pdev= to_platform_device(dev); + int ret; + + ret = regulator_enable(exynos_ohci-vdd33); + if (ret) { + dev_err(dev, Failed to enable VDD33 supply\n); + return ret; Not sure, but shall we continue resuming and do everything we can in case of error? At least it will avoid WARN_ON(clk-enable_count == 0) on next system suspend. + } + ret = regulator_enable(exynos_ohci-vdd10); + if (ret) { + dev_err(dev, Failed to enable VDD10 supply\n); + return ret; + } clk_prepare_enable(exynos_ohci-clk); -- Thanks -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: ohci-exynos: Make provision for vdd regulators
On Thursday, April 24, 2014 9:33 AM, Jingoo Han wrote: On Thursday, April 24, 2014 9:18 AM, Anton Tikhomirov wrote: On Monday, April 21, 2014 9:17 PM, Vivek Gautam wrote: Facilitate getting required 3.3V and 1.0V VDD supply for OHCI controller on Exynos. With patches for regulators' nodes merged in 3.15: c8c253f ARM: dts: Add regulator entries to smdk5420 275dcd2 ARM: dts: add max77686 pmic node for smdk5250, certain perripherals will now need to ensure that, they request VDD regulators in their drivers, and enable them so as to make them working. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Jingoo Han jg1@samsung.com --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ohci-exynos.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci- exynos.c index 68588d8..e2e72a8 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -18,6 +18,7 @@ #include linux/module.h #include linux/of.h #include linux/platform_device.h +#include linux/regulator/consumer.h #include linux/usb/phy.h #include linux/usb/samsung_usb_phy.h #include linux/usb.h @@ -37,6 +38,8 @@ struct exynos_ohci_hcd { struct clk *clk; struct usb_phy *phy; struct usb_otg *otg; + struct regulator *vdd33; + struct regulator *vdd10; }; static void exynos_ohci_phy_enable(struct platform_device *pdev) @@ -98,6 +101,28 @@ static int exynos_ohci_probe(struct platform_device *pdev) exynos_ohci-otg = phy-otg; } + exynos_ohci-vdd33 = devm_regulator_get(pdev-dev, vdd33); + if (IS_ERR(exynos_ohci-vdd33)) { + err = PTR_ERR(exynos_ohci-vdd33); + goto fail_regulator1; + } + err = regulator_enable(exynos_ohci-vdd33); + if (err) { + dev_err(pdev-dev, Failed to enable VDD33 supply\n); + goto fail_regulator1; + } + + exynos_ohci-vdd10 = devm_regulator_get(pdev-dev, vdd10); + if (IS_ERR(exynos_ohci-vdd10)) { + err = PTR_ERR(exynos_ohci-vdd10); + goto fail_regulator2; + } + err = regulator_enable(exynos_ohci-vdd10); + if (err) { + dev_err(pdev-dev, Failed to enable VDD10 supply\n); + goto fail_regulator2; + } + Do we need to skip regulator settings together with PHY configuration in case of exynos5440? Oh, right. In the case of exynos5440, regulator settings is not necessary. Vivek, would you fix it in order skip regulator settings in exynos5440? It also applies to ehci-exynos. Sorry, in the case of exynos5440, this patch already skips regulator settings. In the case of exynos5440, there is no need to set PHY setting and regulator setting. How about making regulator setting optional? Then, regulator setting can be done, only when regulator is supported. exynos_ohci_probe() exynos_ohci-vdd33 = devm_regulator_get(pdev-dev, vdd33); if (IS_ERR(exynos_ohci-vdd33)) { dev_err(pdev-dev, Failed to get VDD33 supply\n); } else { err = regulator_enable(exynos_ohci-vdd33); if (err) { dev_err(pdev-dev, Failed to enable VDD33 supply\n); goto fail_regulator1; } } exynos_ohci-vdd10 = devm_regulator_get(pdev-dev, vdd10); if (IS_ERR(exynos_ohci-vdd10)) { dev_err(pdev-dev, Failed to get VDD10 supply\n); } else { err = regulator_enable(exynos_ohci-vdd10); if (err) { dev_err(pdev-dev, Failed to enable VDD10 supply\n); goto fail_regulator2; } } In this case, suspend/resume can be fixed as below. exynos_ohci_suspend() if (exynos_ohci-vdd10) regulator_disable(exynos_ohci-vdd10); if (exynos_ohci-vdd33) regulator_disable(exynos_ohci-vdd33); exynos_ohci_resume() if (exynos_ohci-vdd33) { ret = regulator_enable(exynos_ohci-vdd33); if (ret) { dev_err(dev, Failed to enable VDD33 supply\n); return ret; } } if (exynos_ohci-vdd10) { ret = regulator_enable(exynos_ohci-vdd10); if (ret) { dev_err(dev, Failed to enable VDD10 supply\n); return ret; } } Best regards, Jingoo Han skip_phy: exynos_ohci-clk = devm_clk_get(pdev-dev, usbhost); @@ -154,6 +179,10 @@ fail_add_hcd: fail_io: clk_disable_unprepare(exynos_ohci-clk); fail_clk: + regulator_disable(exynos_ohci-vdd10); +fail_regulator2: + regulator_disable(exynos_ohci-vdd33); +fail_regulator1
Re: [PATCH V4 1/5] phy: Add new Exynos5 USB 3.0 PHY driver
On Wednesday, April 16, 2014 11:49 PM, Vivek Gautam wrote: On Wed, Apr 16, 2014 at 7:14 PM, Tomasz Figa t.f...@samsung.com wrote: On 15.04.2014 08:09, Vivek Gautam wrote: On Thu, Apr 10, 2014 at 5:09 PM, Vivek Gautam wrote: On Wed, Apr 9, 2014 at 7:03 PM, Tomasz Figa t.f...@samsung.com wrote: On 09.04.2014 13:49, Vivek Gautam wrote: So, USB30_SCLK_100M is the SCLK that we are talking in the driver. I don't see any reference to XXTI in the USB 3.0 DRD controller chapter (in both Exynos5250 and 5420) In addition to this there's one more point to be noticed here. On Exynos5420 system, the sclk_usbphy300 (which is the sclk_usbphy30 for USB DRD channel 0), is also the PICO phy clock, i.e. USB 2.0 phy clock. So we should add a similar clk_get() for this clock in the phy-exynos5250-usb2 driver too, to support Exynos5420. Is something clear from the above block diagram ? (although the diagram looks weird - space and tabs problem :-( ) Basically there's the clock USB30_SCLK_100M which is going into the USB 3.0 DRD PHY controller. And this is the only sclk mentioned in the block diagram for USB 3.0 DRD controller in Exynos5420. Same is not there in the block diagram in Exynos5250 UM. From what I can see in the documentation, there are 4 USB 3.0 related clocks generated in CMU: - sclk_usbphy300, - sclk_usbphy301, - sclk_usbdrd300, - sclk_usbdrd301, They are all rated to max. 24 MHz and the recommended operating frequency is 24 MHz, so it looks exactly like USB PHY reference, which is usually a 24 MHz clock. To me, this looks like on Exynos5420 a separate special clock path is used instead of xusbxti as reference of USB 3.0 PHY and so the sclk should be simply passed as the ref clock. Ok, i will clear on this with the hardware engineer also once. May be Jingoo can help me with this. Jingoo, Can you please enquire about the clock path of usbphy30 reference clocks on Exynos5420. As mentioned by Tomasz above, we have sclk_usbphy300 and sclk_usbphy301 as the reference clocks for USB3.0 DRD phy. *Also* sclk_usbphy300 is used for Pico phy (which is the USb 2.0 phy used by ehci/ohci controller on Exynos5420). It will be of great help. Hi Vevek, Tomasz Long time no see. I asked USB S/W engineer and USB H/W engineer. There are two USB3.0 on Exynos5420; thus there are two sclks such as 'sclk_usbphy300 and sclk_usbphy301'. As Tomasz mentioned, 'sclk_usbphy300 and sclk_usbphy301' can be used instead of 'xusbxti' as reference of USB 3.0 PHY. However, on Exynos5420, ONLY 'sclk_usbphy300' can be used for USB2.0 pico phy. (so, '301' CANNOT support USB2.0 pico phy.) Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re:[PATCH v6 2/3] usb: dwc2/s3c-hsotg: move s3c-hsotg into dwc2 directory
On Tuesday, April 15, 2014 6:33 AM, Felipe Balbi wrote: On Mon, Apr 14, 2014 at 02:13:34PM -0700, Paul Zimmerman wrote: From: Dinh Nguyen dingu...@altera.com Moves the s3c-hsotg driver into the dwc2 directory and uses the dwc2 defines in hw.h. Renames s3c-hsotg.c to gadget.c. NOTE: You can build both host and peripheral as a dynamically linked module, but be aware that if you insmod dwc2_gadget, then rmmod it, then insmod dwc2 and dwc2_platform for host mode, this will not work. As the step to rmmod dwc2_gadget.ko will turn off the clock to the USB IP. The dwc2 host driver currently does not look to turn on a clock yet. A patch to fix that will be coming soon. Signed-off-by: Dinh Nguyen dingu...@altera.com [ jh,rb - For gadget part only: ] Tested-by: Jingoo Han jg1@samsung.com Tested-by: Robert Baldyga r.bald...@samsung.com [ pz: Folded Kconfig/Makefile changes, which were originally in a separate patch, into this one, to avoid a build breakage. Modified Kconfig/Makefile changes a bit. Tested host part only. ] Signed-off-by: Paul Zimmerman pa...@synopsys.com --- drivers/usb/dwc2/Kconfig | 61 +++- drivers/usb/dwc2/Makefile | 37 +- drivers/usb/{gadget/s3c-hsotg.c = dwc2/gadget.c} | 415 +++--- drivers/usb/gadget/Kconfig| 6 - drivers/usb/gadget/Makefile | 1 - drivers/usb/gadget/s3c-hsotg.h| 378 6 files changed, 273 insertions(+), 625 deletions(-) rename drivers/usb/{gadget/s3c-hsotg.c = dwc2/gadget.c} (91%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index be947d6..f93807b 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -1,25 +1,58 @@ config USB_DWC2 - tristate DesignWare USB2 DRD Core Support + bool DesignWare USB2 DRD Core Support why this change to bool ? Seems unrelated. Other than that, for gadget: Acked-by: Felipe Balbi ba...@ti.com Happy this is not my headache^W^W^Wmoving forward and merging with dwc2 ;-) I am also happy. :-) This is what I have wanted for a long time. Without everyone's effort, it cannot be possible to merge it. Thank you! Best regards, Jingoo Han -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] usb: ehci-exynos: Return immediately from suspend if ehci_suspend fails
On Thursday, April 10, 2014 3:32 AM, Alan Stern wrote: On Wed, 9 Apr 2014, Vivek Gautam wrote: Patch 'b8efdaf USB: EHCI: add check for wakeup/suspend race' adds a check for possible race between suspend and wakeup interrupt, and thereby it returns -EBUSY as error code if there's a wakeup interrupt. So the platform host controller should not proceed further with its suspend callback, rather should return immediately to avoid powering down the essential things, like phy. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Jingoo Han jg1@samsung.com --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ehci-exynos.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d1d8c47..a4550eb 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -212,6 +212,8 @@ static int exynos_ehci_suspend(struct device *dev) int rc; rc = ehci_suspend(hcd, do_wakeup); + if (rc) + return rc; if (exynos_ehci-otg) exynos_ehci-otg-set_host(exynos_ehci-otg, hcd-self); @@ -221,7 +223,7 @@ static int exynos_ehci_suspend(struct device *dev) clk_disable_unprepare(exynos_ehci-clk); - return rc; + return 0; } static int exynos_ehci_resume(struct device *dev) The first hunk of this patch is correct, but the second hunk isn't needed. A similar remark is true for the ehci-platform patch. Hi Alan, Do you mean the following? 1st hunk + if (rc) + return rc; 2nd hunk - return rc; + return 0; Currently, the 'rc' will be always 'zero'; however, I don't Have any objection, because the code might be modified later. Best regards, Jingoo Han Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RESEND] usb: ohci-exynos: Remove locks for 'ohci' in suspend callback
On Tuesday, April 08, 2014 11:41 PM, Vivek Gautam wrote: Patch : 14982e3 USB: OHCI: Properly handle ohci-exynos suspend has already removed 'ohci_hcd' settings from exynos glue layer as a part of streamlining the ohci controller's suspend. So we don't need the locks for 'ohci_hcd' anymore. Right, this spin_lock/unlock is unnecessary, because it is already used in ohci_suspend(). Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Manjunath Goudar csmanjuvi...@gmail.com Cc: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-exynos.c |6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 68588d8..9cf80cb 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -190,17 +190,13 @@ static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct platform_device *pdev = to_platform_device(dev); bool do_wakeup = device_may_wakeup(dev); - unsigned long flags; int rc = ohci_suspend(hcd, do_wakeup); if (rc) return rc; - spin_lock_irqsave(ohci-lock, flags); - if (exynos_ohci-otg) exynos_ohci-otg-set_host(exynos_ohci-otg, hcd-self); @@ -208,8 +204,6 @@ static int exynos_ohci_suspend(struct device *dev) clk_disable_unprepare(exynos_ohci-clk); - spin_unlock_irqrestore(ohci-lock, flags); - return 0; } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] usb: ehci-exynos: Return immediately from suspend if ehci_suspend fails
On Wednesday, April 09, 2014 1:01 PM, Vivek Gautam wrote: Patch 'b8efdaf USB: EHCI: add check for wakeup/suspend race' adds a check for possible race between suspend and wakeup interrupt, and thereby it returns -EBUSY as error code if there's a wakeup interrupt. So the platform host controller should not proceed further with its suspend callback, rather should return immediately to avoid powering down the essential things, like phy. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Jingoo Han jg1@samsung.com Acked-by: Jingoo Han jg1@samsung.com Best regards, Jingoo Han --- Based on 'usb-next' branch of Greg's usb tree. drivers/usb/host/ehci-exynos.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d1d8c47..a4550eb 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -212,6 +212,8 @@ static int exynos_ehci_suspend(struct device *dev) int rc; rc = ehci_suspend(hcd, do_wakeup); + if (rc) + return rc; if (exynos_ehci-otg) exynos_ehci-otg-set_host(exynos_ehci-otg, hcd-self); @@ -221,7 +223,7 @@ static int exynos_ehci_suspend(struct device *dev) clk_disable_unprepare(exynos_ehci-clk); - return rc; + return 0; } static int exynos_ehci_resume(struct device *dev) -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3 0/4] usb: dwc2/s3c-hsotg: Move the s3c-hsotg driver into dwc2
On Friday, March 07, 2014 6:48 AM, Dinh Nguyen wrote: From: Dinh Nguyen dingu...@altera.com Diffs from V2: - Renamed s3c-hsotg.c to gadget.c - For dynamically linked modules, dwc2_gadget.ko is built for peripheral mode and for host mode, it remains dwc2.ko and dwc2_platform.ko or dwc2_pci.ko. - Split out the patch to have 4 patches instead of 3. Patch 4 contains edits to the Makefile(s) and Kconfig(s) only. - Addressed comments from Felipe Balbi. I don't think I can add the Tested-by: Jingoo Han jg1@samsung.com to this version as I have made changes on how the peripheral mode driver gets built. So Jingoo, if you can please test this version, it would be appreciated. Tested-by: Jingoo Han jg1@samsung.com I tested these patches on Exynos4210 platform. 'gadget.c' aka 's3c-hsotg.c' works properly. Thank you. Best regards, Jingoo Han Thanks, Dinh Nguyen (4): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures usb: dwc2: Edit the Kconfig and Makefile to build dwc2_gadget driver drivers/usb/dwc2/Kconfig | 36 +- drivers/usb/dwc2/Makefile | 27 +- drivers/usb/dwc2/core.h | 182 +++ drivers/usb/{gadget/s3c-hsotg.c = dwc2/gadget.c} | 593 +++-- drivers/usb/dwc2/hw.h | 12 +- drivers/usb/gadget/Kconfig|7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h| 378 - 8 files changed, 439 insertions(+), 797 deletions(-) rename drivers/usb/{gadget/s3c-hsotg.c = dwc2/gadget.c} (85%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Paul Zimmerman pa...@synopsys.com Cc: Felipe Balbi ba...@ti.com Cc: Ben Dooks ben-li...@fluff.org Cc: Matt Porter mpor...@linaro.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Matthijs Kooijman matth...@stdin.nl Cc: Jingoo Han jg1@samsung.com Cc: Sachin Kamat sachin.ka...@linaro.org Cc: Robert Baldyga r.bald...@samsung.com -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V2] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro
Use SIMPLE_DEV_PM_OPS macro and remove DEV_PM_OPS macro, in order to make the code simpler. Signed-off-by: Jingoo Han jg1@samsung.com --- Changes since v1: - Move SIMPLE_DEV_PM_OPS outside the #ifdef CONFIG_PM_SLEEP condition and remove DEV_PM_OPS macro, per Roger Quadros drivers/usb/phy/phy-am335x.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 12fc346..eafeeb6 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -122,16 +122,10 @@ static int am335x_phy_resume(struct device *dev) return 0; } - -static const struct dev_pm_ops am335x_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume) -}; - -#define DEV_PM_OPS (am335x_pm_ops) -#else -#define DEV_PM_OPS NULL #endif +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); + static const struct of_device_id am335x_phy_ids[] = { { .compatible = ti,am335x-usb-phy }, { } @@ -144,7 +138,7 @@ static struct platform_driver am335x_phy_driver = { .driver = { .name = am335x-phy-driver, .owner = THIS_MODULE, - .pm = DEV_PM_OPS, + .pm = am335x_pm_ops, .of_match_table = am335x_phy_ids, }, }; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RESEND PATCHv2 0/3] usb: dwc2/s3c-hsotg: Move the s3c-hsotg driver into dwc2
On Tuesday, March 04, 2014 12:06 PM, Dinh Nguyen wrote: From: Dinh Nguyen dingu...@altera.com Hi, Apologies for sending the wrong 1st patch of this series. --- This is a shortened version of the v1 patch to combine the dwc2/s3c-hsotg into a single dual-role driver. The series will only move the s3c-hsotg driver into the dwc2 folder, use the defines in the dwc2 hw.h, and removes the s3c-hsotg.h defines. This will make the dual-role combining work a bit easier to review in the future. For now, the dwc2 and s3c-hsotg will be separate drivers. Thanks, Dinh Nguyen (3): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures drivers/usb/dwc2/Kconfig | 15 + drivers/usb/dwc2/Makefile| 15 +- drivers/usb/dwc2/core.h | 182 + drivers/usb/dwc2/hw.h| 11 +- drivers/usb/{gadget = dwc2}/s3c-hsotg.c | 593 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 8 files changed, 420 insertions(+), 782 deletions(-) rename drivers/usb/{gadget = dwc2}/s3c-hsotg.c (85%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Paul Zimmerman pa...@synopsys.com Cc: Felipe Balbi ba...@ti.com Cc: Ben Dooks ben-li...@fluff.org Cc: Matt Porter mpor...@linaro.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Matthijs Kooijman matth...@stdin.nl Cc: Jingoo Han jg1@samsung.com Tested-by: Jingoo Han jg1@samsung.com I tested these patches on Exynos4210 platform. 's3c-hsotg.c' works properly. Thank you. Best regards, Jingoo Han Cc: Sachin Kamat sachin.ka...@linaro.org Cc: Robert Baldyga r.bald...@samsung.com -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-am335x.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 12fc346..ebf8373 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -123,9 +123,7 @@ static int am335x_phy_resume(struct device *dev) return 0; } -static const struct dev_pm_ops am335x_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume) -}; +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); #define DEV_PM_OPS (am335x_pm_ops) #else -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro
On Thursday, February 27, 2014 11:41 PM, Roger Quadros wrote: On 02/27/2014 01:47 PM, Jingoo Han wrote: Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/phy/phy-am335x.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 12fc346..ebf8373 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -123,9 +123,7 @@ static int am335x_phy_resume(struct device *dev) return 0; } -static const struct dev_pm_ops am335x_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume) -}; +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); You need to move this outside the #ifdef CONFIG_PM_SLEEP condition and get rid of the DEV_PM_OPS macro below as well. 1. Your suggestion - Removing '#define DEV_PM_OPS NULL' #ifdef CONFIG_PM_SLEEP static int am335x_phy_suspend(struct device *dev) static int am335x_phy_resume(struct device *dev) #endif static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); In this case, code can be simpler. However, a dev_pm_ops structure is created, and it requires additional NULL checking by PM framework, when CONFIG_PM_SLEEP=n CONFIG_PM=y. 2. Current code - Keeping '#define DEV_PM_OPS NULL' #ifdef CONFIG_PM_SLEEP static int am335x_phy_suspend(struct device *dev) static int am335x_phy_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); #define DEV_PM_OPS (am335x_pm_ops) #else #define DEV_PM_OPS NULL #endif In this case, code size is larger. However, a dev_pm_ops structure is NOT created, and it does NOT require additional NULL checking by PM framework, when CONFIG_PM_SLEEP=n CONFIG_PM=y. Personally, I prefer the first one. Additional NULL checking is not crucial. Is there any other opinions? Best regards, Jingoo Han #define DEV_PM_OPS (am335x_pm_ops) #else -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: On 02/13/2014 10:10 PM, dingu...@altera.com wrote: From: Dinh Nguyen dingu...@altera.com Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. Hi. It looks like it doesn't work on Samsung platforms without device-tree support. Hi Robert Baldyga, In order to test this patch, the current mainline kernel requires additional patches to support device-tree. The following patches are necessary. http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179920.html http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179921.html http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179922.html The last one should be modified for your machine. Best regards, Jingoo Han Best regards Robert Baldyga Samsung RD Institute Poland The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is the final location of the driver. When the driver is built as a kernel module, it will be dwc2.ko and dwc2_platform.ko. patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent patch. patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the s3c-hsotg driver will now be a Kconfig option under DWC2. Also replaces the s3c-hsotg.h header file for dwc2/hw.h. patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so that final DRD can use it. patch 4/7 : Add the gadget data structure to a common data structure, dwc2_hsotg, which is the data structure that will encapsulate host and peripheral modes for the final DRD. The bulk for this patch is edits the in s3c-hsotg.c to reference the new data structure. patch 5/7 : Replaces the s3c_hostg_irq handler with the dwc2_handle_common_intr in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg gadget functions for peripheral mode. patch 6/7 : Update the Kconfig and Makefile to enable building of the single DRD. At this stage the the driver is behaving as a dual-role driver. patch 7/7 : Decouple host/peripheral functionality when buildling the driver in host or peripheral mode only. This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform which has v2.93a of dual-role IP. Thanks, Dinh Nguyen (7): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data structure usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build dependency drivers/usb/dwc2/Kconfig | 28 + drivers/usb/dwc2/Makefile| 17 +- drivers/usb/dwc2/core.c |1 + drivers/usb/dwc2/core.h | 225 +++- drivers/usb/dwc2/core_intr.c | 108 +- drivers/usb/dwc2/hcd.c |7 +- drivers/usb/dwc2/hcd.h | 23 +- drivers/usb/dwc2/hw.h| 23 +- drivers/usb/dwc2/platform.c | 50 +- drivers/usb/{gadget = dwc2}/s3c-hsotg.c | 1807 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 13 files changed, 1128 insertions(+), 1547 deletions(-) rename drivers/usb/{gadget = dwc2}/s3c-hsotg.c (57%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Paul Zimmerman pa...@synopsys.com Cc: Felipe Balbi ba...@ti.com Cc: Ben Dooks ben-li...@fluff.org Cc: Matt Porter mpor...@linaro.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Matthijs Kooijman matth...@stdin.nl Cc: Jingoo Han jg1@samsung.com Cc: Sachin Kamat sachin.ka...@linaro.org Cc: Robert Baldyga r.bald...@samsung.com -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Monday, February 17, 2014 10:56 AM, Stephen Warren wrote: On 02/16/2014 05:37 PM, Jingoo Han wrote: On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: On 02/13/2014 10:10 PM, dingu...@altera.com wrote: From: Dinh Nguyen dingu...@altera.com Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. Hi. It looks like it doesn't work on Samsung platforms without device-tree support. Hi Robert Baldyga, In order to test this patch, the current mainline kernel requires additional patches to support device-tree. The following patches are necessary. DT is supposed to be an ABI (old DTs must work with newer SW), so you shouldn't/can't change the code in a way that requires changes to the DT, at least for features that are working and stable and already have sensible stable DT bindings. Right, we know it. We should keep DT bindings because these are Supposed to be an ABI. I didn't mean to change DT bindings that were already defined at ./Documentation/devicetree/bindings/usb/samsung-hsotg.txt and ./Documentation/devicetree/bindings/usb/samsung-usbphy.txt. I just suggest that ARCH-DT support code is necessary for Exynos HSOTG as below. --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -119,6 +119,15 @@ status = disabled; }; + hsotg at 1248 { + compatible = samsung,s3c6400-hsotg; + reg = 0x1248 0x2; + interrupts = 0 71 0; + clocks = clock 305; + clock-names = otg; + status = disabled; + }; --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -114,6 +114,21 @@ interrupts = 2 4; }; + usbphy at 125B { + compatible = samsung,exynos4210-usb2phy; + reg = 0x125B 0x100; + clocks = clock 305; + clock-names = otg; + status = disabled; + ranges; + #address-cells = 1; + #size-cells = 1; + + usbphy-sys { + reg = 0x10020704 0x8; + }; + }; Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
: bf0294fc c00743dc bf0294c0 7fff c0071e84 f0281000 c0007c10 [ 302.515000] 3ec0: c0071c4c bf0295fc bf0294c0 ee1e2000 bf0294c0 00d2 [ 302.515000] 3ee0: ee1e2000 c00a2b7c ee1e2000 [ 302.515000] 3f00: [ 302.515000] 3f20: 00d2 0001959d 000b0028 000b0008 [ 302.515000] 3f40: 0080 c000e664 ee1e2000 c0074afc f0267000 0001959d [ 302.515000] 3f60: f02795f8 f0279455 f027fcc8 062c 0a2c [ 302.515000] 3f80: 002b 002c 0013 000a [ 302.515000] 3fa0: 0001959d c000e4e0 000b0028 0001959d 000b0008 bec63c51 [ 302.515000] 3fc0: 0001959d 0080 bec63c3f 00097c78 0009a694 [ 302.515000] 3fe0: bec63968 bec63958 00046714 b6e2c780 6010 000b0028 [ 302.515000] [c027ecc0] (s3c_hsotg_udc_start) from [c028e920] (udc_bind_to_driver+0x84/0xd0) [ 302.515000] [c028e920] (udc_bind_to_driver) from [c028e9d8] (usb_gadget_probe_driver+0x6c/0xa0) [ 302.515000] [c028e9d8] (usb_gadget_probe_driver) from [c0008854] (do_one_initcall+0xe4/0x140) [ 302.515000] [c0008854] (do_one_initcall) from [c00743dc] (load_module+0x169c/0x1ce4) [ 302.515000] [c00743dc] (load_module) from [c0074afc] (SyS_init_module+0xd8/0xec) [ 302.515000] [c0074afc] (SyS_init_module) from [c000e4e0] (ret_fast_syscall+0x0/0x30) [ 302.515000] Code: e5143070 e3a2 e5845168 e5141008 (e59330dc) [ 302.80] ---[ end trace 88559040f8f26448 ]--- Best regards, Jingoo Han drivers/usb/dwc2/Kconfig | 28 + drivers/usb/dwc2/Makefile| 17 +- drivers/usb/dwc2/core.c |1 + drivers/usb/dwc2/core.h | 225 +++- drivers/usb/dwc2/core_intr.c | 108 +- drivers/usb/dwc2/hcd.c |7 +- drivers/usb/dwc2/hcd.h | 23 +- drivers/usb/dwc2/hw.h| 23 +- drivers/usb/dwc2/platform.c | 50 +- drivers/usb/{gadget = dwc2}/s3c-hsotg.c | 1807 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 13 files changed, 1128 insertions(+), 1547 deletions(-) rename drivers/usb/{gadget = dwc2}/s3c-hsotg.c (57%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Paul Zimmerman pa...@synopsys.com Cc: Felipe Balbi ba...@ti.com Cc: Ben Dooks ben-li...@fluff.org Cc: Matt Porter mpor...@linaro.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Matthijs Kooijman matth...@stdin.nl Cc: Jingoo Han jg1@samsung.com Cc: Sachin Kamat sachin.ka...@linaro.org Cc: Robert Baldyga r.bald...@samsung.com -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: From: Dinh Nguyen dingu...@altera.com Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should like ip driver + glue layer. If not, why needs to put them together, I am a little puzzled here. Yes, 's3c-hsotg' also uses DWC USB2 IP. As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' looks good. Best regards, Jingoo Han Peter The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is the final location of the driver. When the driver is built as a kernel module, it will be dwc2.ko and dwc2_platform.ko. patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent patch. patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the s3c-hsotg driver will now be a Kconfig option under DWC2. Also replaces the s3c-hsotg.h header file for dwc2/hw.h. patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so that final DRD can use it. patch 4/7 : Add the gadget data structure to a common data structure, dwc2_hsotg, which is the data structure that will encapsulate host and peripheral modes for the final DRD. The bulk for this patch is edits the in s3c-hsotg.c to reference the new data structure. patch 5/7 : Replaces the s3c_hostg_irq handler with the dwc2_handle_common_intr in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg gadget functions for peripheral mode. patch 6/7 : Update the Kconfig and Makefile to enable building of the single DRD. At this stage the the driver is behaving as a dual-role driver. patch 7/7 : Decouple host/peripheral functionality when buildling the driver in host or peripheral mode only. This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform which has v2.93a of dual-role IP. Thanks, Dinh Nguyen (7): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data structure usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build dependency drivers/usb/dwc2/Kconfig | 28 + drivers/usb/dwc2/Makefile| 17 +- drivers/usb/dwc2/core.c |1 + drivers/usb/dwc2/core.h | 225 +++- drivers/usb/dwc2/core_intr.c | 108 +- drivers/usb/dwc2/hcd.c |7 +- drivers/usb/dwc2/hcd.h | 23 +- drivers/usb/dwc2/hw.h| 23 +- drivers/usb/dwc2/platform.c | 50 +- drivers/usb/{gadget = dwc2}/s3c-hsotg.c | 1807 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 13 files changed, 1128 insertions(+), 1547 deletions(-) rename drivers/usb/{gadget = dwc2}/s3c-hsotg.c (57%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Paul Zimmerman pa...@synopsys.com Cc: Felipe Balbi ba...@ti.com Cc: Ben Dooks ben-li...@fluff.org Cc: Matt Porter mpor...@linaro.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Matthijs Kooijman matth...@stdin.nl Cc: Jingoo Han jg1@samsung.com Cc: Sachin Kamat sachin.ka...@linaro.org Cc: Robert Baldyga r.bald...@samsung.com -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.
On Wednesday, February 12, 2014 2:34 PM, Stephen Warren wrote: On 02/04/2014 02:45 PM, dingu...@altera.com wrote: From: Dinh Nguyen dingu...@altera.com This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode. Sorry for the slow response. When building ARCH=arm bcm2835_defconfig, I get build errors: drivers/built-in.o: In function `dwc2_gadget_init': drivers/usb/dwc2/s3c-hsotg.c:3335: undefined reference to `usb_add_gadget_udc' drivers/built-in.o: In function `s3c_hsotg_remove': drivers/usb/dwc2/s3c-hsotg.c:3358: undefined reference to `usb_del_gadget_udc' drivers/usb/dwc2/s3c-hsotg.c:3364: undefined reference to `usb_gadget_unregister_driver' These errors happen when CONFIG_USB_GADGET=n. 's3c-hsotg.c' supports only gadget mode. In the case of USB_DWC2_HOST mode, CONFIG_USB_GADGET is NOT enabled. I don't know how to solve it. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: chipidea: use dev_get_platdata()
On Friday, February 07, 2014 11:36 AM, Peter Chen wrote: On Wed, Feb 05, 2014 at 10:30:35AM +0900, Jingoo Han wrote: Use the wrapper function for retrieving the platform data instead of accessing dev-platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/chipidea/core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 33f22bc..2fab79d 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -532,7 +532,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) int ret; enum usb_dr_mode dr_mode; - if (!dev-platform_data) { + if (!dev_get_platdata(dev)) { dev_err(dev, platform data missing\n); return -ENODEV; } Thanks for reviewing/patching code. If dev_get_platdata(dev) gets error, the platform device will not be created, thus, the probe will not be called. The dev_get_platdata is called before platform device is created. @@ -549,7 +549,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) } ci-dev = dev; - ci-platdata = dev-platform_data; + ci-platdata = dev_get_platdata(dev); ci-imx28_write_fix = !!(ci-platdata-flags CI_HDRC_IMX28_WRITE_FIX); The return value of dev_get_platdata is not platform data. In fact, the dev-platform_data has already filled by dev_get_platdata. Sorry, but I cannot understand what you mean. :-( Did you look at dev_get_platdata(dev)? ./include/linux/device.h static inline void *dev_get_platdata(const struct device *dev) { return dev-platform_data; } There is no functional change. This is just a cosmetic change. 'dev_get_platdata(dev)' and 'dev-platform_data' are the same. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.
On Thursday, February 06, 2014 4:21 AM, Paul Zimmerman wrote: On Tuesday, February 04, 2014 10:14 PM, Dinh Nguyen wrote: On Wed, 2014-02-05 at 00:42 +, Paul Zimmerman wrote: From: dingu...@altera.com [mailto:dingu...@altera.com] Sent: Tuesday, February 04, 2014 1:46 PM From: Dinh Nguyen dingu...@altera.com This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode. This commit: - Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines. - Use the dw2_hsotg as the unified data structure for the host/gadget. - Uses the dwc2 IRQ handler for host/gadget. - A single spinlock. Hi Dinh, Putting all of these changes into a single patch makes them unreviewable as far I am concerned. You need to break this into a series of smaller patches. I would suggest something like this: 1 of n: Make the minimum changes to the dwc2 header files needed to support s3c-hsotg as a standalone driver. 2 of n: Make the spelling changes to s3c-hsotg.c needed to use the dwc2 headers, and move it to the dwc2/ directory. Make the Kconfig and Makefile changes needed for the move. Delete s3c-hsotg.h. 3 of n: Move the struct defines etc. from s3c-hsotg.c to the dwc2 header files. .. of n: Make the changes required to combine the functionality of both drivers into one. Preferably this would also be a series of patches instead of one big one. At each step of the series, both drivers should still compile and work. I agree. My original thought was to also split this patch, but I just didn't know how to split it. This is why I designated as an RFC. I was really looking for feedback as this is the correct way to combine this driver. I was also looking for testing purpose to make sure I did not break anything for the s3c platform. The problem is, it's almost impossible to see what the functional changes are because of all the noise of the other changes. Yes, right. I think so, too. Also, please follow the patch style used on the linux lists. 'git format-patch --cover-letter' should do most of this for you automatically. I did use --cover-letter on this patch series. And you should probably trim the Cc list to something more reasonable. I looked through all the commits for the dwc2 driver for the cc list. I also CC a bunch of the Samsung people as I figured that the biggest impact of the work would affect the s3c folks. I would suggest just CCing the Samsung folks to start with, since s3c-hsotg is a driver for their hardware. And the linux-usb and linux-samsung-soc lists. Please keep CCing linux-samsung-soc. Some Samsung folks will test the patches with Samsung hardware. Thank you. Best regards, Jingoo Han -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: chipidea: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev-platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/chipidea/core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 33f22bc..2fab79d 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -532,7 +532,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) int ret; enum usb_dr_mode dr_mode; - if (!dev-platform_data) { + if (!dev_get_platdata(dev)) { dev_err(dev, platform data missing\n); return -ENODEV; } @@ -549,7 +549,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) } ci-dev = dev; - ci-platdata = dev-platform_data; + ci-platdata = dev_get_platdata(dev); ci-imx28_write_fix = !!(ci-platdata-flags CI_HDRC_IMX28_WRITE_FIX); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: gadget: s3c-hsotg: use %pad for dma_addr_t
Use %pad for dma_addr_t to avoid the following build warnings in printks. drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_start_req' drivers/usb/gadget/s3c-hsotg.c:722:3: warning: format '%x' expects argument of type 'unsigned int' but argument 6 has type 'dma_addr_t' [-Wformat] drivers/usb/gadget/s3c-hsotg.c:792:3: warning: format '%x' expects argument of type 'unsigned int' but argument 5 has type 'dma_addr_t' [-Wformat] Signed-off-by: Jingoo Han jg1@samsung.com --- Compile-tested only. drivers/usb/gadget/s3c-hsotg.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 1172eae..9ea7f1b 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -720,8 +720,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, ureq-length, ureq-actual); if (0) dev_dbg(hsotg-dev, - REQ buf %p len %d dma 0x%08x noi=%d zp=%d snok=%d\n, - ureq-buf, length, ureq-dma, + REQ buf %p len %d dma 0x%pad noi=%d zp=%d snok=%d\n, + ureq-buf, length, ureq-dma, ureq-no_interrupt, ureq-zero, ureq-short_not_ok); maxreq = get_ep_limit(hs_ep); @@ -789,8 +789,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, dma_reg = dir_in ? DIEPDMA(index) : DOEPDMA(index); writel(ureq-dma, hsotg-regs + dma_reg); - dev_dbg(hsotg-dev, %s: 0x%08x = 0x%08x\n, - __func__, ureq-dma, dma_reg); + dev_dbg(hsotg-dev, %s: 0x%pad = 0x%08x\n, + __func__, ureq-dma, dma_reg); } ctrl |= DxEPCTL_EPEna; /* ensure ep enabled */ -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 03/12] USB: ehci-octeon: Use devm_ioremap_resource()
On Thursday, December 19, 2013 8:44 AM, Jingoo Han wrote: On 12/10/2013 11:20 PM, Jingoo Han wrote: Use devm_ioremap_resource() to make cleanup paths simpler. Signed-off-by: Jingoo Han jg1@samsung.com This patch doesn't apply cleanly against Linus' branch. However, I was able to successfully test it after manually applying the changes. As Greg said, this patch was based on Greg's USB tree. Anyway, I really appreciate your test. :-) Best regards, Jingoo Han After you rebase the patch, you can add ... Acked-by: David Daney david.da...@cavium.com -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/7] usb: gadget: f_loopback: Fix sparse warning
Make local symbols static in order to fix the following sparse warnings. drivers/usb/gadget/f_loopback.c:123:34: warning: symbol 'ss_loop_source_comp_desc' was not declared. Should it be static? drivers/usb/gadget/f_loopback.c:139:34: warning: symbol 'ss_loop_sink_comp_desc' was not declared. Should it be static? Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_loopback.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c index c35bb40..4557cd0 100644 --- a/drivers/usb/gadget/f_loopback.c +++ b/drivers/usb/gadget/f_loopback.c @@ -120,7 +120,7 @@ static struct usb_endpoint_descriptor ss_loop_source_desc = { .wMaxPacketSize = cpu_to_le16(1024), }; -struct usb_ss_ep_comp_descriptor ss_loop_source_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_loop_source_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, .bMaxBurst =0, @@ -136,7 +136,7 @@ static struct usb_endpoint_descriptor ss_loop_sink_desc = { .wMaxPacketSize = cpu_to_le16(1024), }; -struct usb_ss_ep_comp_descriptor ss_loop_sink_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_loop_sink_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, .bMaxBurst =0, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/7] usb: gadget: f_mass_storage: Fix sparse warning
Use NULL instead of 0 when returning pointer, to fix the following sparse warnings. drivers/usb/gadget/f_mass_storage.c:3114:60: warning: Using plain integer as NULL pointer drivers/usb/gadget/f_mass_storage.c:3114:63: warning: Using plain integer as NULL pointer Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_mass_storage.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index a03ba2c..1dfecdf 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -3111,7 +3111,7 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) fsg-common-can_stall); if (ret) return ret; - fsg_common_set_inquiry_string(fsg-common, 0, 0); + fsg_common_set_inquiry_string(fsg-common, NULL, NULL); ret = fsg_common_run_thread(fsg-common); if (ret) return ret; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/7] usb: gadget: f_serial: Fix sparse warning
Make local symbol static in order to fix the following sparse warning. drivers/usb/gadget/f_serial.c:357:21: warning: symbol 'gser_alloc' was not declared. Should it be static? Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_serial.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_serial.c b/drivers/usb/gadget/f_serial.c index 981113c..9ecbcbf 100644 --- a/drivers/usb/gadget/f_serial.c +++ b/drivers/usb/gadget/f_serial.c @@ -354,7 +354,7 @@ static void gser_unbind(struct usb_configuration *c, struct usb_function *f) usb_free_all_descriptors(f); } -struct usb_function *gser_alloc(struct usb_function_instance *fi) +static struct usb_function *gser_alloc(struct usb_function_instance *fi) { struct f_gser *gser; struct f_serial_opts *opts; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/7] usb: gadget: f_obex: Fix sparse warning
Make local symbol static in order to fix the following sparse warning. drivers/usb/gadget/f_obex.c:502:21: warning: symbol 'obex_alloc' was not declared. Should it be static? Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_obex.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_obex.c b/drivers/usb/gadget/f_obex.c index ad39f1d..aebae18 100644 --- a/drivers/usb/gadget/f_obex.c +++ b/drivers/usb/gadget/f_obex.c @@ -499,7 +499,7 @@ static void obex_unbind(struct usb_configuration *c, struct usb_function *f) usb_free_all_descriptors(f); } -struct usb_function *obex_alloc(struct usb_function_instance *fi) +static struct usb_function *obex_alloc(struct usb_function_instance *fi) { struct f_obex *obex; struct f_serial_opts *opts; -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/7] usb: gadget: f_sourcesink: Fix sparse warning
Make local symbols static in order to fix the following sparse warnings. drivers/usb/gadget/f_sourcesink.c:205:34: warning: symbol 'ss_source_comp_desc' was not declared. Should it be static? drivers/usb/gadget/f_sourcesink.c:222:34: warning: symbol 'ss_sink_comp_desc' was not declared. Should it be static? drivers/usb/gadget/f_sourcesink.c:240:34: warning: symbol 'ss_iso_source_comp_desc' was not declared. Should it be static? drivers/usb/gadget/f_sourcesink.c:258:34: warning: symbol 'ss_iso_sink_comp_desc' was not declared. Should it be static? Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/f_sourcesink.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index 5d4251e..d3cd52d 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c @@ -202,7 +202,7 @@ static struct usb_endpoint_descriptor ss_source_desc = { .wMaxPacketSize = cpu_to_le16(1024), }; -struct usb_ss_ep_comp_descriptor ss_source_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_source_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, @@ -219,7 +219,7 @@ static struct usb_endpoint_descriptor ss_sink_desc = { .wMaxPacketSize = cpu_to_le16(1024), }; -struct usb_ss_ep_comp_descriptor ss_sink_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_sink_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, @@ -237,7 +237,7 @@ static struct usb_endpoint_descriptor ss_iso_source_desc = { .bInterval =4, }; -struct usb_ss_ep_comp_descriptor ss_iso_source_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_iso_source_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, @@ -255,7 +255,7 @@ static struct usb_endpoint_descriptor ss_iso_sink_desc = { .bInterval =4, }; -struct usb_ss_ep_comp_descriptor ss_iso_sink_comp_desc = { +static struct usb_ss_ep_comp_descriptor ss_iso_sink_comp_desc = { .bLength = USB_DT_SS_EP_COMP_SIZE, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] usb: gadget: atmel_usba: Use devm_*() functions
Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/atmel_usba_udc.c | 64 ++- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 2cb52e0..409a055 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1995,14 +1995,12 @@ static int __init usba_udc_probe(struct platform_device *pdev) if (irq 0) return irq; - pclk = clk_get(pdev-dev, pclk); + pclk = devm_clk_get(pdev-dev, pclk); if (IS_ERR(pclk)) return PTR_ERR(pclk); - hclk = clk_get(pdev-dev, hclk); - if (IS_ERR(hclk)) { - ret = PTR_ERR(hclk); - goto err_get_hclk; - } + hclk = devm_clk_get(pdev-dev, hclk); + if (IS_ERR(hclk)) + return PTR_ERR(hclk); spin_lock_init(udc-lock); udc-pdev = pdev; @@ -2011,17 +2009,17 @@ static int __init usba_udc_probe(struct platform_device *pdev) udc-vbus_pin = -ENODEV; ret = -ENOMEM; - udc-regs = ioremap(regs-start, resource_size(regs)); + udc-regs = devm_ioremap(pdev-dev, regs-start, resource_size(regs)); if (!udc-regs) { dev_err(pdev-dev, Unable to map I/O memory, aborting.\n); - goto err_map_regs; + return ret; } dev_info(pdev-dev, MMIO registers at 0x%08lx mapped at %p\n, (unsigned long)regs-start, udc-regs); - udc-fifo = ioremap(fifo-start, resource_size(fifo)); + udc-fifo = devm_ioremap(pdev-dev, fifo-start, resource_size(fifo)); if (!udc-fifo) { dev_err(pdev-dev, Unable to map FIFO, aborting.\n); - goto err_map_fifo; + return ret; } dev_info(pdev-dev, FIFO at 0x%08lx mapped at %p\n, (unsigned long)fifo-start, udc-fifo); @@ -2032,7 +2030,7 @@ static int __init usba_udc_probe(struct platform_device *pdev) ret = clk_prepare_enable(pclk); if (ret) { dev_err(pdev-dev, Unable to enable pclk, aborting.\n); - goto err_clk_enable; + return ret; } toggle_bias(0); usba_writel(udc, CTRL, USBA_DISABLE_MASK); @@ -2043,22 +2041,22 @@ static int __init usba_udc_probe(struct platform_device *pdev) else udc-usba_ep = usba_udc_pdata(pdev, udc); - if (IS_ERR(udc-usba_ep)) { - ret = PTR_ERR(udc-usba_ep); - goto err_alloc_ep; - } + if (IS_ERR(udc-usba_ep)) + return PTR_ERR(udc-usba_ep); - ret = request_irq(irq, usba_udc_irq, 0, atmel_usba_udc, udc); + ret = devm_request_irq(pdev-dev, irq, usba_udc_irq, 0, + atmel_usba_udc, udc); if (ret) { dev_err(pdev-dev, Cannot request irq %d (error %d)\n, irq, ret); - goto err_request_irq; + return ret; } udc-irq = irq; if (gpio_is_valid(udc-vbus_pin)) { if (!devm_gpio_request(pdev-dev, udc-vbus_pin, atmel_usba_udc)) { - ret = request_irq(gpio_to_irq(udc-vbus_pin), + ret = devm_request_irq(pdev-dev, + gpio_to_irq(udc-vbus_pin), usba_vbus_irq, 0, atmel_usba_udc, udc); if (ret) { @@ -2077,31 +2075,13 @@ static int __init usba_udc_probe(struct platform_device *pdev) ret = usb_add_gadget_udc(pdev-dev, udc-gadget); if (ret) - goto err_add_udc; + return ret; usba_init_debugfs(udc); for (i = 1; i udc-num_ep; i++) usba_ep_init_debugfs(udc, udc-usba_ep[i]); return 0; - -err_add_udc: - if (gpio_is_valid(udc-vbus_pin)) - free_irq(gpio_to_irq(udc-vbus_pin), udc); - - free_irq(irq, udc); -err_request_irq: -err_alloc_ep: -err_clk_enable: - iounmap(udc-fifo); -err_map_fifo: - iounmap(udc-regs); -err_map_regs: - clk_put(hclk); -err_get_hclk: - clk_put(pclk); - - return ret; } static int __exit usba_udc_remove(struct platform_device *pdev) @@ -2117,16 +2097,6 @@ static int __exit usba_udc_remove(struct platform_device *pdev) usba_ep_cleanup_debugfs(udc-usba_ep[i]); usba_cleanup_debugfs(udc); - if (gpio_is_valid(udc-vbus_pin)) { - free_irq(gpio_to_irq(udc-vbus_pin), udc); - } - - free_irq(udc-irq, udc); - iounmap(udc-fifo); - iounmap(udc-regs); - clk_put(udc-hclk); - clk_put(udc-pclk); - return 0; } -- 1.7.10.4 -- To unsubscribe from this list: send the line
[PATCH 2/2] usb: gadget: atmel_usba: Fix sparse warning
'usba_gadget_template' is used only in this file. Thus, make 'usba_gadget_template' static, in order to fix the following sparse warning. warning: symbol 'usba_gadget_template' was not declared. Should it be static? Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/gadget/atmel_usba_udc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 409a055..55ae5ef 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1012,7 +1012,7 @@ static void nop_release(struct device *dev) } -struct usb_gadget usba_gadget_template = { +static struct usb_gadget usba_gadget_template = { .ops= usba_udc_ops, .max_speed = USB_SPEED_HIGH, .name = atmel_usba_udc, -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 05/12] USB: ohci-at91: Use devm_*() functions
On Wednesday, December 11, 2013 5:13 PM, Nicolas Ferre wrote: On 11/12/2013 08:31, Jingoo Han : Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han jg1@samsung.com Jingoo, Well, these modifications are already addressed by a series written by Boris. [PATCH v5 0/3] usb: ohci-at91: various improvements OK, I see. Please ignore this patch. Thank you for your comment. :-) Best regards, Jingoo Han Thanks for your patch anyway. Best regards. --- drivers/usb/host/ohci-at91.c | 52 +- 1 file changed, 11 insertions(+), 41 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/7] USB: ehci-fsl: use dev_warn() instead of printk()
Use dev_warn() instead of printk() to provide a better message to userspace. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/host/ehci-fsl.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 854a68f..7cd23b6 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -268,7 +268,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, if (!(spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0) || in_be32(non_ehci + FSL_SOC_USB_PRICTRL))) { - printk(KERN_WARNING fsl-ehci: USB PHY clock invalid\n); + dev_warn(hcd-self.controller, USB PHY clock invalid\n); return -EINVAL; } } -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html