lkml.org 
[lkml]   [2020]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/16] usb: phy: tegra: Use device-tree notion of reset-GPIO's active-state
On Sat, Dec 28, 2019 at 11:33:52PM +0300, Dmitry Osipenko wrote:
[...]
> static int ulpi_open(struct tegra_usb_phy *phy)
> {
> - int err;
> -
> - err = gpio_direction_output(phy->reset_gpio, 0);
> - if (err) {
> - dev_err(phy->u_phy.dev,
> - "ULPI reset GPIO %d direction not deasserted: %d\n",
> - phy->reset_gpio, err);
> - return err;
> - }
> + gpiod_set_value_cansleep(phy->reset_gpio, 1);
>
> return 0;
> }

The message now removed seems inverted to the meaning of the code. Is
this a bug, or the reset really should be asserted here? I can see that
it is deasserted in phy_power_up, but that goes before or after ulpi_open()?
After the change below, the reset is asserted at probe() time now.

[...]
> - err = devm_gpio_request(&pdev->dev, tegra_phy->reset_gpio,
> - "ulpi_phy_reset_b");
> + gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np,
> + "nvidia,phy-reset-gpio",
> + 0, GPIOD_OUT_HIGH,
> + "ulpi_phy_reset_b");
> + err = PTR_ERR_OR_ZERO(gpiod);
> if (err) {
> - dev_err(&pdev->dev, "Request failed for GPIO %d: %d\n",
> - tegra_phy->reset_gpio, err);
> + dev_err(&pdev->dev,
> + "Request failed for reset GPIO: %d\n", err);
> return err;
> }
> + tegra_phy->reset_gpio = gpiod;

A nice extension to kernel's printf - "%pe" format - has just landed in
Linus' master tree.

Best Regards,
Michał Mirosław

\
 
 \ /
  Last update: 2020-01-03 08:59    [W:0.167 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site