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

Commit cedd5f65 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB / PHY driver fixes from Greg KH:
 "Here's a number of USB and PHY driver fixes for 4.0-rc5.

  The largest thing here is a revert of a gadget function driver patch
  that removes 500 lines of code.  Other than that, it's a number of
  reported bugs fixes and new quirk/id entries.

  All have been in linux-next for a while"

* tag 'usb-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
  usb: common: otg-fsm: only signal connect after switching to peripheral
  uas: Add US_FL_NO_ATA_1X for Initio Corporation controllers / devices
  USB: ehci-atmel: rework clk handling
  MAINTAINERS: add entry for USB OTG FSM
  usb: chipidea: otg: add a_alt_hnp_support response for B device
  phy: omap-usb2: Fix missing clk_prepare call when using old dt name
  phy: ti/omap: Fix modalias
  phy: core: Fixup return value of phy_exit when !pm_runtime_enabled
  phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof
  phy: miphy365x: Convert to devm_kcalloc and fix wrong sizeof
  phy: twl4030-usb: Remove redundant assignment for twl->linkstat
  phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]
  phy: Find the right match in devm_phy_destroy()
  phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path
  phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation
  phy: samsung-usb2: Remove NULL terminating entry from phys array
  phy: hix5hd2-sata: Check return value of platform_get_resource
  phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function
  Revert "usb: gadget: zero: Add support for interrupt EP"
  Revert "xhci: Clear the host side toggle manually when endpoint is 'soft reset'"
  ...
parents f8975224 a886bd92
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -10207,6 +10207,13 @@ S: Maintained
F:	Documentation/usb/ohci.txt
F:	Documentation/usb/ohci.txt
F:	drivers/usb/host/ohci*
F:	drivers/usb/host/ohci*


USB OTG FSM (Finite State Machine)
M:	Peter Chen <Peter.Chen@freescale.com>
T:	git git://github.com/hzpeterchen/linux-usb.git
L:	linux-usb@vger.kernel.org
S:	Maintained
F:	drivers/usb/common/usb-otg-fsm.c

USB OVER IP DRIVER
USB OVER IP DRIVER
M:	Valentina Manea <valentina.manea.m@gmail.com>
M:	Valentina Manea <valentina.manea.m@gmail.com>
M:	Shuah Khan <shuah.kh@samsung.com>
M:	Shuah Khan <shuah.kh@samsung.com>
+2 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ static int armada375_usb_phy_init(struct phy *phy)
	struct armada375_cluster_phy *cluster_phy;
	struct armada375_cluster_phy *cluster_phy;
	u32 reg;
	u32 reg;


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


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


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


	phy_provider = devm_of_phy_provider_register(&pdev->dev,
	phy_provider = devm_of_phy_provider_register(&pdev->dev,
						     armada375_usb_phy_xlate);
						     armada375_usb_phy_xlate);
+6 −5
Original line number Original line 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)
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);
	ret = phy_pm_runtime_get_sync(phy);
	if (ret < 0 && ret != -ENOTSUPP)
	if (ret < 0 && ret != -ENOTSUPP)
		return ret;
		return ret;
	ret = 0; /* Override possible ret == -ENOTSUPP */


	mutex_lock(&phy->mutex);
	mutex_lock(&phy->mutex);
	if (phy->init_count == 0 && phy->ops->init) {
	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);
			dev_err(&phy->dev, "phy init failed --> %d\n", ret);
			goto out;
			goto out;
		}
		}
	} else {
		ret = 0; /* Override possible ret == -ENOTSUPP */
	}
	}
	++phy->init_count;
	++phy->init_count;


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


	mutex_lock(&phy->mutex);
	mutex_lock(&phy->mutex);
	if (phy->init_count == 1 && phy->ops->exit) {
	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);
	ret = phy_pm_runtime_get_sync(phy);
	if (ret < 0 && ret != -ENOTSUPP)
	if (ret < 0 && ret != -ENOTSUPP)
		return ret;
		return ret;
	ret = 0; /* Override possible ret == -ENOTSUPP */


	mutex_lock(&phy->mutex);
	mutex_lock(&phy->mutex);
	if (phy->power_count == 0 && phy->ops->power_on) {
	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);
			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
			goto out;
			goto out;
		}
		}
	} else {
		ret = 0; /* Override possible ret == -ENOTSUPP */
	}
	}
	++phy->power_count;
	++phy->power_count;
	mutex_unlock(&phy->mutex);
	mutex_unlock(&phy->mutex);
+4 −20
Original line number Original line Diff line number Diff line
@@ -30,28 +30,13 @@ struct exynos_dp_video_phy {
	const struct exynos_dp_video_phy_drvdata *drvdata;
	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)
static int exynos_dp_video_phy_power_on(struct phy *phy)
{
{
	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);


	/* Disable power isolation on DP-PHY */
	/* Disable power isolation on DP-PHY */
	exynos_dp_video_phy_pwr_isol(state, 0);
	return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,

				  EXYNOS5_PHY_ENABLE, EXYNOS5_PHY_ENABLE);
	return 0;
}
}


static int exynos_dp_video_phy_power_off(struct phy *phy)
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);
	struct exynos_dp_video_phy *state = phy_get_drvdata(phy);


	/* Enable power isolation on DP-PHY */
	/* Enable power isolation on DP-PHY */
	exynos_dp_video_phy_pwr_isol(state, 1);
	return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,

				  EXYNOS5_PHY_ENABLE, 0);
	return 0;
}
}


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


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


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

	if (!IS_ERR(state->regmap)) {
		regmap_read(state->regmap, offset, &val);
		regmap_read(state->regmap, offset, &val);
		if (on)
		if (on)
			val |= reset;
			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))
		else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK))
			val &= ~EXYNOS4_MIPI_PHY_ENABLE;
			val &= ~EXYNOS4_MIPI_PHY_ENABLE;
		regmap_write(state->regmap, offset, val);
		regmap_write(state->regmap, offset, val);
		mutex_unlock(&state->mutex);
	} else {
	} else {
		addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2);
		addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2);


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


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


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


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


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


	for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) {
	for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) {
		struct phy *phy = devm_phy_create(dev, NULL,
		struct phy *phy = devm_phy_create(dev, NULL,
Loading