Lines Matching +full:omap +full:- +full:usb2

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * omap-control-phy.c - The PHY part of control module.
5 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
20 * omap_control_pcie_pcs - set the PCS delay count
40 if (control_phy->type != OMAP_CTRL_TYPE_PCIE) { in omap_control_pcie_pcs()
45 val = readl(control_phy->pcie_pcs); in omap_control_pcie_pcs()
49 writel(val, control_phy->pcie_pcs); in omap_control_pcie_pcs()
54 * omap_control_phy_power - power on/off the phy using control module reg
75 if (control_phy->type == OMAP_CTRL_TYPE_OTGHS) in omap_control_phy_power()
78 val = readl(control_phy->power); in omap_control_phy_power()
80 switch (control_phy->type) { in omap_control_phy_power()
90 rate = clk_get_rate(control_phy->sys_clk); in omap_control_phy_power()
129 __func__, control_phy->type); in omap_control_phy_power()
133 writel(val, control_phy->power); in omap_control_phy_power()
138 * omap_control_usb_host_mode - set AVALID, VBUSVALID and ID pin in grounded
148 val = readl(ctrl_phy->otghs_control); in omap_control_usb_host_mode()
151 writel(val, ctrl_phy->otghs_control); in omap_control_usb_host_mode()
155 * omap_control_usb_device_mode - set AVALID, VBUSVALID and ID pin in high
166 val = readl(ctrl_phy->otghs_control); in omap_control_usb_device_mode()
170 writel(val, ctrl_phy->otghs_control); in omap_control_usb_device_mode()
174 * omap_control_usb_set_sessionend - Enable SESSIONEND and IDIG to high
185 val = readl(ctrl_phy->otghs_control); in omap_control_usb_set_sessionend()
188 writel(val, ctrl_phy->otghs_control); in omap_control_usb_set_sessionend()
192 * omap_control_usb_set_mode - Calls to functions to set USB in one of host mode
214 if (ctrl_phy->type != OMAP_CTRL_TYPE_OTGHS) in omap_control_usb_set_mode()
228 dev_vdbg(dev, "invalid omap control usb mode\n"); in omap_control_usb_set_mode()
242 .compatible = "ti,control-phy-otghs",
246 .compatible = "ti,control-phy-usb2",
250 .compatible = "ti,control-phy-pipe3",
254 .compatible = "ti,control-phy-pcie",
258 .compatible = "ti,control-phy-usb2-dra7",
262 .compatible = "ti,control-phy-usb2-am437",
275 of_id = of_match_device(omap_control_phy_id_table, &pdev->dev); in omap_control_phy_probe()
277 return -EINVAL; in omap_control_phy_probe()
279 control_phy = devm_kzalloc(&pdev->dev, sizeof(*control_phy), in omap_control_phy_probe()
282 return -ENOMEM; in omap_control_phy_probe()
284 control_phy->dev = &pdev->dev; in omap_control_phy_probe()
285 control_phy->type = *(enum omap_control_phy_type *)of_id->data; in omap_control_phy_probe()
287 if (control_phy->type == OMAP_CTRL_TYPE_OTGHS) { in omap_control_phy_probe()
290 control_phy->otghs_control = devm_ioremap_resource( in omap_control_phy_probe()
291 &pdev->dev, res); in omap_control_phy_probe()
292 if (IS_ERR(control_phy->otghs_control)) in omap_control_phy_probe()
293 return PTR_ERR(control_phy->otghs_control); in omap_control_phy_probe()
297 control_phy->power = devm_ioremap_resource(&pdev->dev, res); in omap_control_phy_probe()
298 if (IS_ERR(control_phy->power)) { in omap_control_phy_probe()
299 dev_err(&pdev->dev, "Couldn't get power register\n"); in omap_control_phy_probe()
300 return PTR_ERR(control_phy->power); in omap_control_phy_probe()
304 if (control_phy->type == OMAP_CTRL_TYPE_PIPE3 || in omap_control_phy_probe()
305 control_phy->type == OMAP_CTRL_TYPE_PCIE) { in omap_control_phy_probe()
306 control_phy->sys_clk = devm_clk_get(control_phy->dev, in omap_control_phy_probe()
308 if (IS_ERR(control_phy->sys_clk)) { in omap_control_phy_probe()
310 return -EINVAL; in omap_control_phy_probe()
314 if (control_phy->type == OMAP_CTRL_TYPE_PCIE) { in omap_control_phy_probe()
317 control_phy->pcie_pcs = devm_ioremap_resource(&pdev->dev, res); in omap_control_phy_probe()
318 if (IS_ERR(control_phy->pcie_pcs)) in omap_control_phy_probe()
319 return PTR_ERR(control_phy->pcie_pcs); in omap_control_phy_probe()
322 dev_set_drvdata(control_phy->dev, control_phy); in omap_control_phy_probe()
330 .name = "omap-control-phy",
349 MODULE_DESCRIPTION("OMAP Control Module PHY Driver");