struct mutex phy_mutex;
+ struct phy *usb_phy;
enum phy_mode mode;
unsigned int usb_init_count;
- struct phy *phy;
-
struct clk_fixed_rate pipe_clk_fixed;
struct typec_switch_dev *sw;
.regs = qmp_v3_usb3phy_regs_layout_qcm2290,
};
-static int qmp_usbc_init(struct phy *phy)
+static int qmp_usbc_com_init(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
const struct qmp_phy_cfg *cfg = qmp->cfg;
return ret;
}
-static int qmp_usbc_exit(struct phy *phy)
+static int qmp_usbc_com_exit(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
const struct qmp_phy_cfg *cfg = qmp->cfg;
return 0;
}
-static int qmp_usbc_power_on(struct phy *phy)
+static int qmp_usbc_usb_power_on(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
const struct qmp_phy_cfg *cfg = qmp->cfg;
return ret;
}
-static int qmp_usbc_power_off(struct phy *phy)
+static int qmp_usbc_usb_power_off(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
const struct qmp_phy_cfg *cfg = qmp->cfg;
return 0;
}
-static int qmp_usbc_enable(struct phy *phy)
+static int qmp_usbc_usb_enable(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
int ret;
mutex_lock(&qmp->phy_mutex);
- ret = qmp_usbc_init(phy);
+ ret = qmp_usbc_com_init(phy);
if (ret)
goto out_unlock;
- ret = qmp_usbc_power_on(phy);
+ ret = qmp_usbc_usb_power_on(phy);
if (ret) {
- qmp_usbc_exit(phy);
+ qmp_usbc_com_exit(phy);
goto out_unlock;
}
return ret;
}
-static int qmp_usbc_disable(struct phy *phy)
+static int qmp_usbc_usb_disable(struct phy *phy)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
int ret;
qmp->usb_init_count--;
- ret = qmp_usbc_power_off(phy);
+ ret = qmp_usbc_usb_power_off(phy);
if (ret)
return ret;
- return qmp_usbc_exit(phy);
+ return qmp_usbc_com_exit(phy);
}
-static int qmp_usbc_set_mode(struct phy *phy, enum phy_mode mode, int submode)
+static int qmp_usbc_usb_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{
struct qmp_usbc *qmp = phy_get_drvdata(phy);
return 0;
}
-static const struct phy_ops qmp_usbc_phy_ops = {
- .init = qmp_usbc_enable,
- .exit = qmp_usbc_disable,
- .set_mode = qmp_usbc_set_mode,
+static const struct phy_ops qmp_usbc_usb_phy_ops = {
+ .init = qmp_usbc_usb_enable,
+ .exit = qmp_usbc_usb_disable,
+ .set_mode = qmp_usbc_usb_set_mode,
.owner = THIS_MODULE,
};
dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode);
- if (!qmp->phy->init_count) {
+ if (!qmp->usb_init_count) {
dev_vdbg(dev, "PHY not initialized, bailing out\n");
return 0;
}
dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode);
- if (!qmp->phy->init_count) {
+ if (!qmp->usb_init_count) {
dev_vdbg(dev, "PHY not initialized, bailing out\n");
return 0;
}
qmp->orientation = orientation;
if (qmp->usb_init_count) {
- qmp_usbc_power_off(qmp->phy);
- qmp_usbc_exit(qmp->phy);
+ qmp_usbc_usb_power_off(qmp->usb_phy);
+ qmp_usbc_com_exit(qmp->usb_phy);
- qmp_usbc_init(qmp->phy);
- qmp_usbc_power_on(qmp->phy);
+ qmp_usbc_com_init(qmp->usb_phy);
+ qmp_usbc_usb_power_on(qmp->usb_phy);
}
mutex_unlock(&qmp->phy_mutex);
if (ret)
goto err_node_put;
- qmp->phy = devm_phy_create(dev, np, &qmp_usbc_phy_ops);
- if (IS_ERR(qmp->phy)) {
- ret = PTR_ERR(qmp->phy);
+ qmp->usb_phy = devm_phy_create(dev, np, &qmp_usbc_usb_phy_ops);
+ if (IS_ERR(qmp->usb_phy)) {
+ ret = PTR_ERR(qmp->usb_phy);
dev_err(dev, "failed to create PHY: %d\n", ret);
goto err_node_put;
}
- phy_set_drvdata(qmp->phy, qmp);
+ phy_set_drvdata(qmp->usb_phy, qmp);
of_node_put(np);