linux/drivers/phy/ti/phy-dm816x-usb.c

// SPDX-License-Identifier: GPL-2.0-only

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

#include <linux/slab.h>
#include <linux/of.h>
#include <linux/io.h>
#include <linux/usb/phy_companion.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>
#include <linux/phy/phy.h>

#include <linux/mfd/syscon.h>

/*
 * TRM has two sets of USB_CTRL registers.. The correct register bits
 * are in TRM section 24.9.8.2 USB_CTRL Register. The TRM documents the
 * phy as being SR70LX Synopsys USB 2.0 OTG nanoPHY. It also seems at
 * least dm816x rev c ignores writes to USB_CTRL register, but the TI
 * kernel is writing to those so it's possible that later revisions
 * have worknig USB_CTRL register.
 *
 * Also note that At least USB_CTRL register seems to be dm816x specific
 * according to the TRM. It's possible that USBPHY_CTRL is more generic,
 * but that would have to be checked against the SR70LX documentation
 * which does not seem to be publicly available.
 *
 * Finally, the phy on dm814x and am335x is different from dm816x.
 */
#define DM816X_USB_CTRL_PHYCLKSRC
#define DM816X_USB_CTRL_PHYSLEEP1
#define DM816X_USB_CTRL_PHYSLEEP0

#define DM816X_USBPHY_CTRL_TXRISETUNE
#define DM816X_USBPHY_CTRL_TXVREFTUNE
#define DM816X_USBPHY_CTRL_TXPREEMTUNE

struct dm816x_usb_phy {};

static int dm816x_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host)
{}

static int dm816x_usb_phy_set_peripheral(struct usb_otg *otg,
					 struct usb_gadget *gadget)
{}

static int dm816x_usb_phy_init(struct phy *x)
{}

static const struct phy_ops ops =;

static int __maybe_unused dm816x_usb_phy_runtime_suspend(struct device *dev)
{}

static int __maybe_unused dm816x_usb_phy_runtime_resume(struct device *dev)
{}

static UNIVERSAL_DEV_PM_OPS(dm816x_usb_phy_pm_ops,
			    dm816x_usb_phy_runtime_suspend,
			    dm816x_usb_phy_runtime_resume,
			    NULL);

static const struct of_device_id dm816x_usb_phy_id_table[] =;
MODULE_DEVICE_TABLE(of, dm816x_usb_phy_id_table);

static int dm816x_usb_phy_probe(struct platform_device *pdev)
{}

static void dm816x_usb_phy_remove(struct platform_device *pdev)
{}

static struct platform_driver dm816x_usb_phy_driver =;

module_platform_driver();

MODULE_ALIAS();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();