Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965972AbbKEXix (ORCPT ); Thu, 5 Nov 2015 18:38:53 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36796 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965366AbbKEXiu (ORCPT ); Thu, 5 Nov 2015 18:38:50 -0500 MIME-Version: 1.0 In-Reply-To: <1446634498-11902-1-git-send-email-blogic@openwrt.org> References: <1446634498-11902-1-git-send-email-blogic@openwrt.org> Date: Thu, 5 Nov 2015 23:38:49 +0000 Message-ID: Subject: Re: [PATCH] phy: ralink-usb: add driver for Mediatek/Ralink From: Alexey Klimov To: John Crispin Cc: Kishon Vijay Abraham I , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2604 Lines: 73 Hi John, On Wed, Nov 4, 2015 at 10:54 AM, John Crispin 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 > --- > .../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/