[PATCH v9 0/8] Generic PHY Framework
Added a generic PHY framework that provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. This framework will be of use only to devices that uses external PHY (PHY functionality is not embedded within the controller). The intention of creating this framework is to bring the phy drivers spread all over the Linux kernel to drivers/phy to increase code re-use and to increase code maintainability. Comments to make PHY as bus wasn't done because PHY devices can be part of other bus and making a same device attached to multiple bus leads to bad design. If the PHY driver has to send notification on connect/disconnect, the PHY driver should make use of the extcon framework. Using this susbsystem to use extcon framwork will have to be analysed. Making omap-usb2 and twl4030 to use this framework is provided as a sample. This patch series is developed on linux mainline tree. This framework is already being used by display PHYs http://www.spinics.net/lists/arm-kernel/msg251666.html These patches are hosted in git://gitorious.org/linuxphy/linuxphy.git testing Changes from v8: * Added phy_set_drvdata and phy_get_drvdata in phy.h. * Changed phy_create API not to take void *priv. private data should now be set using phy_set_drvdata now. Changes from v7: * Fixed Documentation * Added to_phy, of_phy_provider_register and devm_of_phy_provider_register * modified runtime_pm usage in phy_init, phy_exit, phy_power_on and phy_power_off. Now phy_power_on will enable the clocks and phy_power_off will disable the clocks. * pm_runtime_no_callbacks() is added so that pm_runtime_get_sync doesn't fail * modified other patches to adhere to the changes in the PHY framework * removed usb: phy: twl4030: twl4030 shouldn't be subsys_initcall as it will be merged separately. * reference counting has been added to protect phy ops when the PHY is shared by multiple consumers. Changes from v6 * corrected few typos in Documentation * Changed PHY Subsystem to *bool* in Kconfig (to avoid compilation errors when PHY Subsystem is kept as module and the dependent modules are built-in) * Added if pm_runtime_enabled check before runtime pm calls. Changes from v5: * removed the new sysfs entries as it dint have any new information other than what is already there in /sys/devices/... * removed a bunch of APIs added to get the PHY and now only phy_get and devm_phy_get are used. * Added new APIs to register/unregister the PHY provider. This is needed for dt boot case. * Enabled pm runtime and incorporated the comments given by Alan Stern in a different patch series by Gautam. * Removed the *phy_bind* API. Now the phy binding information should be passed using the platform data to the controller devices. * Fixed a few typos. Changes from v4: * removed of_phy_get_with_args/devm_of_phy_get_with_args. Now the *phy providers* should use their custom implementation of of_xlate or use of_phy_xlate to get *phy instance* from *phy providers*. * Added of_phy_xlate to be used by *phy providers* if it provides only one PHY. * changed phy_core from having subsys_initcall to module_init. * other minor fixes. Changes from v3: * Changed the return value of PHY APIs to ENOSYS * Added APIs of_phy_get_with_args/devm_of_phy_get_with_args to support getting PHYs if the same IP implements multiple PHYs. * modified phy_bind API so that the binding information can now be _updated_. In effect of this removed the binding information added in board files and added only in usb-musb.c. If a particular board uses a different phy binding, it can update it in board file after usb_musb_init(). * Added Documentation/devicetree/bindings/phy/phy-bindings.txt for dt binding information. Changes from v2: * removed phy_descriptor structure completely so changed the APIs which were taking phy_descriptor as parameters * Added 2 more APIs *of_phy_get_byname* and *devm_of_phy_get_byname* to be used by PHY user drivers which has *phy* and *phy-names* binding in the dt data * Fixed a few typos * Removed phy_list and we now use class_dev_iter_init, class_dev_iter_next and class_dev_iter_exit for traversing through the phy list. (Note we still need phy_bind list and phy_bind_mutex). * Changed the sysfs entry name from *bind* to *phy_bind*. Changes from v1: * Added Documentation for the PHY framework * Added few more APIs mostly w.r.t devres * Modified omap-usb2 and twl4030 to make use of the new framework Did USB enumeration testing in panda and beagle. Kishon Vijay Abraham I (8): drivers: phy: add generic PHY framework usb: phy: omap-usb2: use the new generic PHY framework usb: phy: twl4030: use the new generic PHY framework ARM: OMAP: USB: Add phy binding information ARM: dts: omap: update usb_otg_hs data usb: musb: omap2430: use the new generic PHY framework usb: phy: omap-usb2: remove *set_suspend* callback from omap-usb2 usb: ph
RE: [PATCH v9 0/8] Generic PHY Framework
Hi Kishon, > -Original Message- > From: ABRAHAM, KISHON VIJAY > Sent: Wednesday, June 26, 2013 5:17 PM > To: grant.lik...@linaro.org; t...@atomide.com; Balbi, Felipe; ABRAHAM, > KISHON VIJAY; a...@arndb.de; swar...@nvidia.com; > sylvester.nawro...@gmail.com; linux-ker...@vger.kernel.org; linux- > o...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux- > u...@vger.kernel.org; gre...@linuxfoundation.org; akpm@linux- > foundation.org > Cc: rob.herr...@calxeda.com; r...@landley.net; li...@arm.linux.org.uk; > benoit.cous...@linaro.org; mche...@redhat.com; ces...@cesarb.net; > da...@davemloft.net; Nayak, Rajendra; shawn@linaro.org; Shilimkar, > Santosh; devicetree-disc...@lists.ozlabs.org; linux- > d...@vger.kernel.org; Nori, Sekhar; Krishnamoorthy, Balaji T; Cherian, > George > Subject: [PATCH v9 0/8] Generic PHY Framework > > Added a generic PHY framework that provides a set of APIs for the PHY > drivers > to create/destroy a PHY and APIs for the PHY users to obtain a > reference to > the PHY with or without using phandle. > > This framework will be of use only to devices that uses external PHY > (PHY > functionality is not embedded within the controller). > > The intention of creating this framework is to bring the phy drivers > spread > all over the Linux kernel to drivers/phy to increase code re-use and > to > increase code maintainability. I would like to use this framework for a smart-card controller connected to a smart-card phy. I have some questions and would like to get feedback on the same. I am using “TDA8026" Smartcard PHY from NXP. Here is the link for datasheet and app note for the same. The smart card controller is inside the TI SoC I am working with. Datasheet : www.nxp.com/documents/data_sheet/TDA8026.pdf? Appnote : http://www.nxp.com/documents/application_note/AN10724.pdf The TI SoC details are not public (yet). I can provide details to you offline. Brief about operation: - The controller can work with and without a PHY - When not using PHY, it is limited to talking to a single smart card. There is also a need to put external de-activation logic on card removal for this case. - With a PHY you can use more than one smart card. - Phy has 5 slots : 1 for smart card (credit/debit/other card with chip) and others for SAM – SIM like modules - Once the PHY is initialized, there are some operations that the controller can request of the PHY like: - Card configurations - set voltage - Activation of card - ATR – Answer to reset - Warm reset - ADPU exchange - Deactivation ( Normal/Emergency) - In the mode when smartcard controller talks directly to the card without the need for a PHY, all the above operations will be carried out by the controller itself My current thought process is to make the controller driver provide the user interface and talk to the PHY using the generic PHY framework you proposed. In the case where there is no PHY, my idea is to create a "dummy" PHY which uses the controller functionality itself. What I seem to be missing from the PHY framework is support for event detection and generic read/write API which will enable the controller to talk to the PHY for the operations listed above and also react to events from the PHY. Is there a reason why such functionality has not been included. If it was only a case of lack of use case, then do you think it will be useful to extend the framework to add such functionality? I can help with the development. Thanks, Satish -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html