Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c526c216 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'for-4.0-rc' of...

Merge tag 'for-4.0-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

Kishon writes:

contains fixes all over drivers/phy and includes the following
*) Using phy_get_drvdata instead of dev_get_drvdata in armada375-usb2.c
*) Fixes w.r.t checking return values in regmap APIs, protecting regmap ops
   with spin lock and directly using regmap_update_bits instead of having a
   separate function to do the same in the various PHYs used in exynos.
*) check return value in platform_get_resource of hix5hd2-sata PHY
*) Removed NULL terminating entry from phys array and fix off-by-one
   valid value checking for args->args[0] in of_xlate of exynos USB PHY.
*) Fixup rockchip_usb_phy_power_on failure path
*) Fix devm_phy_match to find the correct match in phy core and also fix to
   return the correct value from PHY APIs if PM runtime is not enabled.
*) Removed redundant code in twl4030 and xgene
*) Fixed sizeof during memory allocation in miphy PHYs
*) simplify ti_pipe3_dpll_wait_lock implementation, fix missing clk_prepare
   when using old dt name and nit pick in MOUDLE_ALIAS in TI PHYs.
parents 313e1a0a b1ff3231
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static int armada375_usb_phy_init(struct phy *phy)
	struct armada375_cluster_phy *cluster_phy;
	u32 reg;

	cluster_phy = dev_get_drvdata(phy->dev.parent);
	cluster_phy = phy_get_drvdata(phy);
	if (!cluster_phy)
		return -ENODEV;

@@ -131,6 +131,7 @@ static int armada375_usb_phy_probe(struct platform_device *pdev)
	cluster_phy->reg = usb_cluster_base;

	dev_set_drvdata(dev, cluster_phy);
	phy_set_drvdata(phy, cluster_phy);

	phy_provider = devm_of_phy_provider_register(&pdev->dev,
						     armada375_usb_phy_xlate);
+6 −5
Original line number Diff line number Diff line
@@ -52,7 +52,9 @@ static void devm_phy_consume(struct device *dev, void *res)

static int devm_phy_match(struct device *dev, void *res, void *match_data)
{
	return res == match_data;
	struct phy **phy = res;

	return *phy == match_data;
}

/**
@@ -223,6 +225,7 @@ int phy_init(struct phy *phy)
	ret = phy_pm_runtime_get_sync(phy);
	if (ret < 0 && ret != -ENOTSUPP)
		return ret;
	ret = 0; /* Override possible ret == -ENOTSUPP */

	mutex_lock(&phy->mutex);
	if (phy->init_count == 0 && phy->ops->init) {
@@ -231,8 +234,6 @@ int phy_init(struct phy *phy)
			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
			goto out;
		}
	} else {
		ret = 0; /* Override possible ret == -ENOTSUPP */
	}
	++phy->init_count;

@@ -253,6 +254,7 @@ int phy_exit(struct phy *phy)
	ret = phy_pm_runtime_get_sync(phy);
	if (ret < 0 && ret != -ENOTSUPP)
		return ret;
	ret = 0; /* Override possible ret == -ENOTSUPP */

	mutex_lock(&phy->mutex);
	if (phy->init_count == 1 && phy->ops->exit) {
@@ -287,6 +289,7 @@ int phy_power_on(struct phy *phy)
	ret = phy_pm_runtime_get_sync(phy);
	if (ret < 0 && ret != -ENOTSUPP)
		return ret;
	ret = 0; /* Override possible ret == -ENOTSUPP */

	mutex_lock(&phy->mutex);
	if (phy->power_count == 0 && phy->ops->power_on) {
@@ -295,8 +298,6 @@ int phy_power_on(struct phy *phy)
			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
			goto out;
		}
	} else {
		ret = 0; /* Override possible ret == -ENOTSUPP */
	}
	++phy->power_count;
	mutex_unlock(&phy->mutex);
+4 −20
Original line number Diff line number Diff line
@@ -30,28 +30,13 @@ struct exynos_dp_video_phy {
	const struct exynos_dp_video_phy_drvdata *drvdata;
};

static void exynos_dp_video_phy_pwr_isol(struct exynos_dp_video_phy *state,
							unsigned int on)
{
	unsigned int val;

	if (IS_ERR(state->regs))
		return;

	val = on ? 0 : EXYNOS5_PHY_ENABLE;

	regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
			   EXYNOS5_PHY_ENABLE, val);
}

static int exynos_dp_video_phy_power_on(struct phy *phy)
{
	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);

	/* Disable power isolation on DP-PHY */
	exynos_dp_video_phy_pwr_isol(state, 0);

	return 0;
	return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
				  EXYNOS5_PHY_ENABLE, EXYNOS5_PHY_ENABLE);
}

static int exynos_dp_video_phy_power_off(struct phy *phy)
@@ -59,9 +44,8 @@ static int exynos_dp_video_phy_power_off(struct phy *phy)
	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);

	/* Enable power isolation on DP-PHY */
	exynos_dp_video_phy_pwr_isol(state, 1);

	return 0;
	return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
				  EXYNOS5_PHY_ENABLE, 0);
}

static struct phy_ops exynos_dp_video_phy_ops = {
+4 −7
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ struct exynos_mipi_video_phy {
	} phys[EXYNOS_MIPI_PHYS_NUM];
	spinlock_t slock;
	void __iomem *regs;
	struct mutex mutex;
	struct regmap *regmap;
};

@@ -59,8 +58,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state,
	else
		reset = EXYNOS4_MIPI_PHY_SRESETN;

	if (state->regmap) {
		mutex_lock(&state->mutex);
	spin_lock(&state->slock);

	if (!IS_ERR(state->regmap)) {
		regmap_read(state->regmap, offset, &val);
		if (on)
			val |= reset;
@@ -72,11 +72,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state,
		else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK))
			val &= ~EXYNOS4_MIPI_PHY_ENABLE;
		regmap_write(state->regmap, offset, val);
		mutex_unlock(&state->mutex);
	} else {
		addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2);

		spin_lock(&state->slock);
		val = readl(addr);
		if (on)
			val |= reset;
@@ -90,9 +88,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state,
			val &= ~EXYNOS4_MIPI_PHY_ENABLE;

		writel(val, addr);
		spin_unlock(&state->slock);
	}

	spin_unlock(&state->slock);
	return 0;
}

@@ -158,7 +156,6 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev)

	dev_set_drvdata(dev, state);
	spin_lock_init(&state->slock);
	mutex_init(&state->mutex);

	for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) {
		struct phy *phy = devm_phy_create(dev, NULL,
+0 −1
Original line number Diff line number Diff line
@@ -250,7 +250,6 @@ static const struct samsung_usb2_common_phy exynos4210_phys[] = {
		.power_on	= exynos4210_power_on,
		.power_off	= exynos4210_power_off,
	},
	{},
};

const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = {
Loading