summaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-miphy365x.c
Commit message (Collapse)AuthorAgeFilesLines
* phy: miphy365x: add missing of_node_putJulia Lawall2015-12-031-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | for_each_child_of_node performs an of_node_get on each iteration, so a return from the middle of the loop requires an of_node_put. A simplified version of the semantic patch that finds this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression root,e; local idexpression child; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | * return ...; ) ... } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: Constify struct phy_ops variablesAxel Lin2015-08-031-1/+1
| | | | | | | | | The phy_ops variables are never modified after initialized in these drivers, so make them const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: core: Check requested PHY status in _of_phy_get()Axel Lin2015-05-111-5/+0
| | | | | | | | This is a common checking in various drivers, so move the checking to _of_phy_get(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: miphy365x: fix sparse warningsFelipe Balbi2015-05-111-2/+2
| | | | | | | | | Add missing 'static' modifier so sparse won't complain anymore. Signed-off-by: Felipe Balbi <balbi@ti.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* Merge tag 'for-4.1' of ↵Greg Kroah-Hartman2015-04-101-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next Kishon writes: New Features ============ *) Add driver for USB PHYs on sun9i *) Add driver for USB PHY on dm816x *) Modified exynos5-usbdrd driver to add support for Exynos5433 SoC Fixes ===== *) Fix power_on/power_off failure paths in some drivers *) Make miphy365x use generic PHY type constants *) Fix build errors due to missing export symbols in qcom-ufs driver *) Make all the functions return proper error values Cleanups ======== *) use PTR_ERR_OR_ZERO to simplify code *) use devm_kcalloc instead of devm_kzalloc with multiply *) remove un-necessary ifdef CONFIG_OF
| * phy: miphy365x: Use the generic phy type constants in dt-bindings/phy/phy.hPeter Griffin2015-04-031-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now there are generic phy type constants declared in phy.h, migrate over to using them rather than defining our own. This change has been done as one atomic commit to be bisectable. Note: The values of the defines are the same, so there is no ABI breakage with this patch. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* | phy: miphy365x: Convert to devm_kcalloc and fix wrong sizeofAxel Lin2015-03-131-3/+2
| | | | | | | | | | | | | | | | | | Prefer devm_kcalloc over devm_kzalloc with multiply. In additional, use sizeof(phy) is incorrect, fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* | phy: miphy365x: Avoid calling of_get_child_count() multiple timesAxel Lin2015-03-041-5/+6
|/ | | | | | | | | Currently, of_get_child_count() is called in each iteration of the for loop in miphy365x_xlate(). This patch stores the return value of of_get_child_count() in miphy_dev->nphys and call of_get_child_count() once in miphy365x_probe(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: miphy365x: Pass sysconfig register offsets via syscfg dt property.Peter Griffin2015-01-111-19/+10
| | | | | | | | | | | | | | | | | | | | Based on Arnds review comments here https://lkml.org/lkml/2014/11/13/161, update the miphy365 phy driver to access sysconfig register offsets via syscfg dt property. This is because the reg property should not be mixing address spaces like it does currently for miphy365. This change then also aligns us to how other platforms such as keystone and bcm7445 pass there syscon offsets via DT. This patch breaks DT compatibility, but this platform is considered WIP, and is only used by a few developers who are upstreaming support for it. This change has been done as a single atomic commit to ensure it is bisectable. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* phy: Use PTR_ERR_OR_ZERO to fix warning raised by coccinelleGregory CLEMENT2014-11-261-4/+1
| | | | | | | | | | Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: remove the old lookup methodHeikki Krogerus2014-11-221-1/+1
| | | | | | | | | The users of the old method are now converted to the new one. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> [ kishon@ti.com : made phy-berlin-usb.c and phy-miphy28lp.c to use the updated devm_phy_create API.] Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: remove .owner field for drivers using module_platform_driverPeter Griffin2014-09-241-1/+0
| | | | | | | | | This patch removes the superflous .owner field for drivers which use the module_platform_driver or platform_driver_register api, as this is overriden in __platform_driver_register. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: miphy365x: Fix off-by-one errorLee Jones2014-09-121-0/+1
| | | | | | | | | | | | | | | We index the RX/TX speed select values in the following way: rx_tx_spd[miphy_phy->sata_gen]; However rx_tx_spd[] starts at index zero and the SATA_GENx's start at one. In this patch we pad out the first element in rx_tx_spd[] in an attempt to realign the values. Cc: Alexandre Torgue <alexandre.torgue@st.com> Reported-by: Gabriel Fernandez <gabriel.fernandez@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: miphy365x: Represent each PHY channel as a DT subnodeLee Jones2014-07-221-118/+138
| | | | | | | | | This has the added advantages of being able to enable/disable each of the channels as simply as enabling/disabling the DT node. Suggested-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
* phy: miphy365x: Provide support for the MiPHY356x Generic PHYLee Jones2014-07-221-0/+616
The MiPHY365x is a Generic PHY which can serve various SATA or PCIe devices. It has 2 ports which it can use for either; both SATA, both PCIe or one of each in any configuration. Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
OpenPOWER on IntegriCloud