STRICTLY AND CONFIDENTIAL:
Dear Friend, My name is Mr.Hassan Ullah Amer, I am the Bill and Exchange manager here in Bank of Africa, Ouagadougou Burkina Faso, West-Africa. I have a business proposal in the tune of $15.5m, (Fifteen Million Five Hundred Thousand Dollars Only) and after the successful transfer, we shall share in ratio of 40% for you and 60% for me. Should you be interested, please contact me so we can commence all arrangements and i will give you more information on how we would handle this project. Please treat this business with utmost confidentiality and send me the Following: 1. Your Full Name: 2. Your Phone Number: 3. Your Age: 4. Your Sex: 5. Your Occupations: 6. Your Country and City: Kind Regards, Mr.Hassan Ullah Amer. -- 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/7] usb: dwc3: adapt dwc3 core to use Generic PHY Framework
On Thursday 12 September 2013 06:49 PM, Roger Quadros wrote: On 09/02/2013 06:43 PM, Kishon Vijay Abraham I wrote: Adapted dwc3 core to use the Generic PHY Framework. So for init, exit, power_on and power_off the following APIs are used phy_init(), phy_exit(), phy_power_on() and phy_power_off(). However using the old USB phy library wont be removed till the PHYs of all other SoC's using dwc3 core is adapted to the Generic PHY Framework. Signed-off-by: Kishon Vijay Abraham I --- Documentation/devicetree/bindings/usb/dwc3.txt |6 ++- drivers/usb/dwc3/Kconfig |1 + drivers/usb/dwc3/core.c| 49 drivers/usb/dwc3/core.h|7 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index e807635..471366d 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -6,11 +6,13 @@ Required properties: - compatible: must be "snps,dwc3" - reg : Address and length of the register set for the device - interrupts: Interrupts used by the dwc3 controller. + +Optional properties: - usb-phy : array of phandle for the PHY device. The first element in the array is expected to be a handle to the USB2/HS PHY and the second element is expected to be a handle to the USB3/SS PHY - -Optional properties: + - phys: from the *Generic PHY* bindings + - phy-names: from the *Generic PHY* bindings - tx-fifo-resize: determines if the FIFO *has* to be reallocated. This is usually a subnode to DWC3 glue to which it is connected. diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index cfc16dd..ad7ce83 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -3,6 +3,7 @@ config USB_DWC3 depends on (USB || USB_GADGET) && GENERIC_HARDIRQS && HAS_DMA depends on EXTCON select USB_PHY + select GENERIC_PHY select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD help Say Y or M here if your system has a Dual Role SuperSpeed diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 428c29e..485d365 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -82,6 +82,12 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) usb_phy_init(dwc->usb2_phy); usb_phy_init(dwc->usb3_phy); + + if (dwc->usb2_generic_phy) + phy_init(dwc->usb2_generic_phy); + if (dwc->usb3_generic_phy) + phy_init(dwc->usb3_generic_phy); + mdelay(100); /* Clear USB3 PHY reset */ @@ -343,6 +349,11 @@ static void dwc3_core_exit(struct dwc3 *dwc) { usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb3_phy); + + if (dwc->usb2_generic_phy) + phy_power_off(dwc->usb2_generic_phy); + if (dwc->usb3_generic_phy) + phy_power_off(dwc->usb3_generic_phy); } #define DWC3_ALIGN_MASK (16 - 1) @@ -427,6 +438,23 @@ static int dwc3_probe(struct platform_device *pdev) dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3); } + if (of_property_read_bool(node, "phys") || pdata->has_phy) { + dwc->usb2_generic_phy = devm_phy_get(dev, "usb2-phy"); + if (IS_ERR(dwc->usb2_generic_phy)) { + dev_err(dev, "no usb2 phy configured yet"); + return PTR_ERR(dwc->usb2_generic_phy); + } + + dwc->usb3_generic_phy = devm_phy_get(dev, "usb3-phy"); + if (IS_ERR(dwc->usb3_generic_phy)) { + dev_err(dev, "no usb3 phy configured yet"); + return PTR_ERR(dwc->usb3_generic_phy); + } + } else { + dwc->usb2_generic_phy = NULL; + dwc->usb3_generic_phy = NULL; + } + /* default to superspeed if no maximum_speed passed */ if (dwc->maximum_speed == USB_SPEED_UNKNOWN) dwc->maximum_speed = USB_SPEED_SUPER; @@ -450,6 +478,11 @@ static int dwc3_probe(struct platform_device *pdev) usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); + if (dwc->usb2_generic_phy) + phy_power_on(dwc->usb2_generic_phy); + if (dwc->usb3_generic_phy) + phy_power_on(dwc->usb3_generic_phy); + spin_lock_init(&dwc->lock); platform_set_drvdata(pdev, dwc); @@ -576,6 +609,11 @@ static int dwc3_remove(struct platform_device *pdev) usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); + if (dwc->usb2_generic_phy) if (IS_ERR()) I assign NULL to usb2_generic_phy and usb3_generic_phy in case the dts entry doesn't have a *phys* property. The IS_ERR of usb2_generic_phy is treated as an error c
Re: [PATCH 3/7] drivers: phy: usb3/pipe3: Adapt pipe3 driver to Generic PHY Framework
On Thursday 12 September 2013 04:49 PM, Roger Quadros wrote: Hi Kishon, On 09/02/2013 06:43 PM, Kishon Vijay Abraham I wrote: Adapted omap-usb3 PHY driver to Generic PHY Framework and moved phy-omap-usb3 driver in drivers/usb/phy to drivers/phy and also renamed the file to phy-omap-pipe3 since this same driver will be used for SATA PHY and PCIE PHY. I would suggest to split the renaming and PHY adaptation into 2 separate patches. Alright. Signed-off-by: Kishon Vijay Abraham I --- Documentation/devicetree/bindings/usb/usb-phy.txt |5 +- drivers/phy/Kconfig| 10 + drivers/phy/Makefile |1 + .../phy/phy-omap-usb3.c => phy/phy-omap-pipe3.c} | 206 +++- how about naming it to phy-ti-pipe3.c as it is used on OMAP as well as non-OMAP e.g. DRA7. hmm.. I thought it would be consistent with other PHY drivers (phy-omap-usb2). Moreover DRA7 is OMAP based platform ;-) Maybe we should reserve that for later? drivers/usb/phy/Kconfig| 11 -- drivers/usb/phy/Makefile |1 - include/linux/phy/omap_pipe3.h | 52 + 7 files changed, 177 insertions(+), 109 deletions(-) rename drivers/{usb/phy/phy-omap-usb3.c => phy/phy-omap-pipe3.c} (57%) create mode 100644 include/linux/phy/omap_pipe3.h diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt index c0245c8..36bdb17 100644 --- a/Documentation/devicetree/bindings/usb/usb-phy.txt +++ b/Documentation/devicetree/bindings/usb/usb-phy.txt @@ -21,10 +21,11 @@ usb2phy@4a0ad080 { #phy-cells = <0>; }; -OMAP USB3 PHY +OMAP PIPE3 PHY Required properties: - - compatible: Should be "ti,omap-usb3" + - compatible: Should be "ti,omap-usb3", "ti,omap-pipe3", "ti,omap-sata" + or "ti,omap-pcie" - reg : Address and length of the register set for the device. - reg-names: The names of the register addresses corresponding to the registers filled in "reg". diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index ac239ac..5c2e7a0 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -27,6 +27,16 @@ config OMAP_USB2 The USB OTG controller communicates with the comparator using this driver. +config OMAP_PIPE3 + tristate "OMAP PIPE3 PHY Driver" + select GENERIC_PHY + select OMAP_CONTROL_USB how about depends on OMAP_CONTROL_USB From whatever I could make out from comments of Greg in my Generic PHY Framework, it's better to do a select of dependent modules instead of depends on. Also, if this is TI/OMAP it might as well depend on ARCH_OMAP. + help + Enable this to support the PIPE3 PHY that is part of SOC. This worth mentioning TI OMAP/DRA SoCs. right. + driver takes care of all the PHY functionality apart from comparator. + This driver interacts with the "OMAP Control PHY Driver" to power + on/off the PHY. + config TWL4030_USB tristate "TWL4030 USB Transceiver Driver" depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 0dd8a98..48bf9f2 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -4,4 +4,5 @@ obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o +obj-$(CONFIG_OMAP_PIPE3) += phy-omap-pipe3.o obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o diff --git a/drivers/usb/phy/phy-omap-usb3.c b/drivers/phy/phy-omap-pipe3.c similarity index 57% rename from drivers/usb/phy/phy-omap-usb3.c rename to drivers/phy/phy-omap-pipe3.c index 4004f82..ee9a901 100644 --- a/drivers/usb/phy/phy-omap-usb3.c +++ b/drivers/phy/phy-omap-pipe3.c @@ -1,5 +1,5 @@ /* - * omap-usb3 - USB PHY, talking to dwc3 controller in OMAP. + * omap-pipe3 - PHY driver for SATA, USB and PCIE in OMAP platforms * * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -52,17 +53,17 @@ /* * This is an Empirical value that works, need to confirm the actual - * value required for the USB3PHY_PLL_CONFIGURATION2.PLL_IDLE status - * to be correctly reflected in the USB3PHY_PLL_STATUS register. + * value required for the PIPE3PHY_PLL_CONFIGURATION2.PLL_IDLE status + * to be correctly reflected in the PIPE3PHY_PLL_STATUS register. */ # define PLL_IDLE_TIME 100; -struct usb_dpll_map { +struct pipe3_dpll_map { unsigned long rate; - struct usb_dpll_params params; + struct pipe3_dpll_params params; }; -static struct usb_dpll_map dpll_map[] = { +static struct pipe3_dpll_map dpll_map[] = { {1200, {1250, 5, 4, 20, 0} },
Re: [PATCH 4/7] Documentation: dt bindings: move ..usb/usb-phy.txt to ..phy/omap-phy.txt
On Thursday 12 September 2013 06:53 PM, Roger Quadros wrote: On 09/02/2013 06:43 PM, Kishon Vijay Abraham I wrote: Since now we have a separate folder for phy, move the PHY dt binding documentation of OMAP to that folder. Signed-off-by: Kishon Vijay Abraham I --- .../devicetree/bindings/{usb/usb-phy.txt => phy/omap-phy.txt}|2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Documentation/devicetree/bindings/{usb/usb-phy.txt => phy/omap-phy.txt} (96%) diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/phy/omap-phy.txt similarity index 96% rename from Documentation/devicetree/bindings/usb/usb-phy.txt rename to Documentation/devicetree/bindings/phy/omap-phy.txt index 36bdb17..2c485ee 100644 --- a/Documentation/devicetree/bindings/usb/usb-phy.txt +++ b/Documentation/devicetree/bindings/phy/omap-phy.txt ti-phy.txt? maybe wait for that later? Thanks Kishon -- 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 7/7] drivers: phy: renamed struct omap_control_usb to struct omap_control_phy
On Thursday 12 September 2013 07:12 PM, Roger Quadros wrote: Hi, On 09/02/2013 06:43 PM, Kishon Vijay Abraham I wrote: renamed struct omap_control_usb to struct omap_control_phy since it can be used to control PHY of USB, SATA and PCIE. Also moved the driver and include files under *phy* and made the corresponding changes in the users of phy-omap-control. Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/Kconfig| 14 +- drivers/phy/Makefile |1 + drivers/{usb => }/phy/phy-omap-control.c | 164 ++-- drivers/phy/phy-omap-pipe3.c |8 +- drivers/phy/phy-omap-usb2.c|8 +- drivers/usb/musb/omap2430.c|2 +- drivers/usb/phy/Makefile |1 - .../omap_control_usb.h => phy/omap_control_phy.h} | 32 ++-- 8 files changed, 120 insertions(+), 110 deletions(-) rename drivers/{usb => }/phy/phy-omap-control.c (55%) rename include/linux/{usb/omap_control_usb.h => phy/omap_control_phy.h} (69%) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 5c2e7a0..fd11294 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -15,12 +15,22 @@ config GENERIC_PHY phy users can obtain reference to the PHY. All the users of this framework should select this config. +config OMAP_CONTROL_PHY + tristate "OMAP CONTROL PHY Driver" + depends on ARCH_OMAP2PLUS || COMPILE_TEST + help + Enable this to add support for the PHY part present in the control + module. This driver has API to power on the USB2 PHY and to write to + the mailbox. The mailbox is present only in omap4 and the register to + power on the USB2 PHY is present in OMAP4 and OMAP5. OMAP5 has + additional registers to power on PIPE3 PHYs. + config OMAP_USB2 tristate "OMAP USB2 PHY Driver" depends on ARCH_OMAP2PLUS select GENERIC_PHY select USB_PHY - select OMAP_CONTROL_USB + select OMAP_CONTROL_PHY help Enable this to support the transceiver that is part of SOC. This driver takes care of all the PHY functionality apart from comparator. @@ -30,7 +40,7 @@ config OMAP_USB2 config OMAP_PIPE3 tristate "OMAP PIPE3 PHY Driver" select GENERIC_PHY - select OMAP_CONTROL_USB + select OMAP_CONTROL_PHY help Enable this to support the PIPE3 PHY that is part of SOC. This driver takes care of all the PHY functionality apart from comparator. diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 48bf9f2..f0127f6 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -3,6 +3,7 @@ # obj-$(CONFIG_GENERIC_PHY) += phy-core.o +obj-$(CONFIG_OMAP_CONTROL_PHY) += phy-omap-control.o obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o obj-$(CONFIG_OMAP_PIPE3) += phy-omap-pipe3.o obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o diff --git a/drivers/usb/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c similarity index 55% rename from drivers/usb/phy/phy-omap-control.c rename to drivers/phy/phy-omap-control.c index 1a7e19a..ece3573 100644 --- a/drivers/usb/phy/phy-omap-control.c +++ b/drivers/phy/phy-omap-control.c @@ -1,5 +1,5 @@ /* - * omap-control-usb.c - The USB part of control module. + * phy-omap-control.c - The USB part of control module. * * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com * This program is free software; you can redistribute it and/or modify @@ -24,36 +24,36 @@ #include #include #include -#include +#include #ifdef CONFIG_OF -static const enum omap_control_usb_type omap4_data = OMAP_CTRL_TYPE_OMAP4; -static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2; -static const enum omap_control_usb_type usb3_data = OMAP_CTRL_TYPE_USB3; -static const enum omap_control_usb_type dra7_data = OMAP_CTRL_TYPE_DRA7; +static const enum omap_control_phy_type omap4_data = OMAP_CTRL_TYPE_OMAP4; +static const enum omap_control_phy_type usb2_data = OMAP_CTRL_TYPE_USB2; +static const enum omap_control_phy_type usb3_data = OMAP_CTRL_TYPE_USB3; +static const enum omap_control_phy_type dra7_data = OMAP_CTRL_TYPE_DRA7; -static const struct of_device_id omap_control_usb_id_table[] = { +static const struct of_device_id omap_control_phy_id_table[] = { { .compatible = "ti,omap4-control-usb", .data = &omap4_data, @@ -286,31 +286,31 @@ static const struct of_device_id omap_control_usb_id_table[] = { }, {}, }; -MODULE_DEVICE_TABLE(of, omap_control_usb_id_table); +MODULE_DEVICE_TABLE(of, omap_control_phy_id_table); #endif -static struct platform_driver omap_control_usb_driver = { - .probe = omap_control_usb_probe, +static struct platform_driver omap_control_phy_driver = { +
[PATCH 1/1] usb: phy: omap-usb3: Fix return value
The function returns a pointer. Hence return NULL instead of 0. Signed-off-by: Sachin Kamat --- drivers/usb/phy/phy-omap-usb3.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-omap-usb3.c b/drivers/usb/phy/phy-omap-usb3.c index fc15694..4e8a040 100644 --- a/drivers/usb/phy/phy-omap-usb3.c +++ b/drivers/usb/phy/phy-omap-usb3.c @@ -79,7 +79,7 @@ static struct usb_dpll_params *omap_usb3_get_dpll_params(unsigned long rate) return &dpll_map[i].params; } - return 0; + return NULL; } static int omap_usb3_suspend(struct usb_phy *x, int suspend) -- 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 2/2] usb: gadget: f_eem: Staticize eem_alloc
'eem_alloc' is local to this file. Make it static. Signed-off-by: Sachin Kamat --- drivers/usb/gadget/f_eem.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index d00392d..d61c11d 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c @@ -624,7 +624,7 @@ static void eem_unbind(struct usb_configuration *c, struct usb_function *f) usb_free_all_descriptors(f); } -struct usb_function *eem_alloc(struct usb_function_instance *fi) +static struct usb_function *eem_alloc(struct usb_function_instance *fi) { struct f_eem*eem; struct f_eem_opts *opts; -- 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/2] usb: gadget: f_ecm: Staticize ecm_alloc
'ecm_alloc' is local to this file. Make it static. Signed-off-by: Sachin Kamat --- drivers/usb/gadget/f_ecm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c index edab45d..8d9e6f7 100644 --- a/drivers/usb/gadget/f_ecm.c +++ b/drivers/usb/gadget/f_ecm.c @@ -995,7 +995,7 @@ static void ecm_unbind(struct usb_configuration *c, struct usb_function *f) usb_ep_free_request(ecm->notify, ecm->notify_req); } -struct usb_function *ecm_alloc(struct usb_function_instance *fi) +static struct usb_function *ecm_alloc(struct usb_function_instance *fi) { struct f_ecm*ecm; struct f_ecm_opts *opts; -- 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 0/2] Enable PPS reporting for USB serial devices (v3)
Hi. This series enable the PPS reporting for USB serial devices. This third submission improve commit messages, and fix some coding guidelines. The last patch of the v2 will be integrated in an more global reworking of the pl2303 driver. Paul Chavent (2): USB : serial : call handle_dcd_change in ftdi driver. USB : serial : invoke dcd_change ldisc's handler. Documentation/pps/pps.txt | 15 +++ drivers/usb/serial/ftdi_sio.c | 10 +- drivers/usb/serial/generic.c | 10 ++ 3 files changed, 34 insertions(+), 1 deletion(-) -- 1.7.12.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/1] usb: xhci: Staticize xhci_del_comp_mod_timer
'xhci_del_comp_mod_timer' is local to this file. Signed-off-by: Sachin Kamat --- drivers/usb/host/xhci-hub.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index fae697e..2b61700 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -524,7 +524,8 @@ static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg) * the compliance mode timer is deleted. A port won't enter * compliance mode if it has previously entered U0. */ -void xhci_del_comp_mod_timer(struct xhci_hcd *xhci, u32 status, u16 wIndex) +static void xhci_del_comp_mod_timer(struct xhci_hcd *xhci, u32 status, + u16 wIndex) { u32 all_ports_seen_u0 = ((1 << xhci->num_usb3_ports)-1); bool port_in_u0 = ((status & PORT_PLS_MASK) == XDEV_U0); -- 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/2] USB : serial : call handle_dcd_change in ftdi driver.
When the device receive a DCD status change, forward the signal to the USB serial system. This way, we can detect, for instance, PPS pulses. Signed-off-by: Paul Chavent --- drivers/usb/serial/ftdi_sio.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c45f9c0..f53298d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1966,8 +1966,16 @@ static int ftdi_process_packet(struct usb_serial_port *port, port->icount.dsr++; if (diff_status & FTDI_RS0_RI) port->icount.rng++; - if (diff_status & FTDI_RS0_RLSD) + if (diff_status & FTDI_RS0_RLSD) { + struct tty_struct *tty; + port->icount.dcd++; + tty = tty_port_tty_get(&port->port); + if (tty) + usb_serial_handle_dcd_change(port, tty, + status & FTDI_RS0_RLSD); + tty_kref_put(tty); + } wake_up_interruptible(&port->port.delta_msr_wait); priv->prev_status = status; -- 1.7.12.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 2/2] USB : serial : invoke dcd_change ldisc's handler.
The DCD pin of the serial port can receive a PPS signal. By calling the port line discipline dcd handle, this patch allow to monitor PPS through USB serial devices. However the performance aren't as good as the uart drivers, so document this point too. Signed-off-by: Paul Chavent --- Documentation/pps/pps.txt| 15 +++ drivers/usb/serial/generic.c | 10 ++ 2 files changed, 25 insertions(+) diff --git a/Documentation/pps/pps.txt b/Documentation/pps/pps.txt index d35dcdd..c03b1be 100644 --- a/Documentation/pps/pps.txt +++ b/Documentation/pps/pps.txt @@ -66,6 +66,21 @@ In LinuxPPS the PPS sources are simply char devices usually mapped into files /dev/pps0, /dev/pps1, etc.. +PPS with USB to serial devices +-- + +It is possible to grab the PPS from an USB to serial device. However, +you should take into account the latencies and jitter introduced by +the USB stack. Users has reported clock instability around +-1ms when +synchronized with PPS through USB. This isn't suited for time server +synchronization. + +If your device doesn't report PPS, you can check that the feature is +supported by its driver. Most of the time, you only need to add a call +to usb_serial_handle_dcd_change after checking the DCD status (see +ch341 and pl2303 examples). + + Coding example -- diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 1f31e6b..3a5dac8 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -570,6 +570,16 @@ void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, dev_dbg(&usb_port->dev, "%s - status %d\n", __func__, status); + if (tty) { + struct tty_ldisc *ld = tty_ldisc_ref(tty); + + if (ld) { + if (ld->ops->dcd_change) + ld->ops->dcd_change(tty, status); + tty_ldisc_deref(ld); + } + } + if (status) wake_up_interruptible(&port->open_wait); else if (tty && !C_CLOCAL(tty)) -- 1.7.12.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