Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1263612
| From | Alexey Klimov <klimov.linux@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink |
| Date | 2015-11-06 00:40 +0100 |
| Message-ID | <qrCin-57c-41@gated-at.bofh.it> (permalink) |
| References | <qr3Xl-7Mx-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi John,
On Wed, Nov 4, 2015 at 10:54 AM, John Crispin <blogic@openwrt.org> wrote:
> Add a driver to setup the USB phy on Mediatek/Ralink SoCs.
> The driver is trivial and only sets the power and host/device mode.
>
> Signed-off-by: John Crispin <blogic@openwrt.org>
> ---
> .../devicetree/bindings/phy/ralink-usb-phy.txt | 17 ++
> drivers/phy/Kconfig | 7 +
> drivers/phy/Makefile | 1 +
> drivers/phy/phy-ralink-usb.c | 183 ++++++++++++++++++++
> 4 files changed, 208 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/phy/ralink-usb-phy.txt
> create mode 100644 drivers/phy/phy-ralink-usb.c
[..]
> +static int ralink_usb_phy_exit(struct phy *_phy)
> +{
> + return 0;
> +}
> +
> +static int ralink_usb_phy_power_on(struct phy *_phy)
> +{
> + if (atomic_inc_return(&usb_pwr_ref) == 1) {
> + int host = 1;
> + u32 t;
> +
> + usb_phy_enable(1);
> +
> + if (host) {
Could you please check how it's supposed to work with host var always
initialized with 1?
Do you want to drop if-else check here or ..?
> + rt_sysc_m32(0, RT_SYSCFG1_USB0_HOST_MODE,
> + RT_SYSC_REG_SYSCFG1);
> + if (!IS_ERR(rsthost))
> + reset_control_deassert(rsthost);
> + if (!IS_ERR(rstdev))
> + reset_control_deassert(rstdev);
> + } else {
> + rt_sysc_m32(RT_SYSCFG1_USB0_HOST_MODE, 0,
> + RT_SYSC_REG_SYSCFG1);
> + if (!IS_ERR(rstdev))
> + reset_control_deassert(rstdev);
> + }
> + mdelay(100);
> +
> + t = rt_sysc_r32(RT_SYSC_REG_USB_PHY_CFG);
> + dev_info(&_phy->dev, "remote usb device wakeup %s\n",
> + (t & UDEV_WAKEUP) ? ("enabbled") : ("disabled"));
> + if (t & USB_PHY_UTMI_8B60M)
> + dev_info(&_phy->dev, "UTMI 8bit 60MHz\n");
> + else
> + dev_info(&_phy->dev, "UTMI 16bit 30MHz\n");
> + }
> +
> + return 0;
> +}
--
Best regards,
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] phy: ralink-usb: add driver for Mediatek/Ralink John Crispin <blogic@openwrt.org> - 2015-11-04 12:00 +0100 Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink Alexey Klimov <klimov.linux@gmail.com> - 2015-11-06 00:40 +0100 Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-06 21:50 +0100 Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink Kishon Vijay Abraham I <kishon@ti.com> - 2015-11-13 13:20 +0100
csiph-web