Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3090581ybz; Mon, 27 Apr 2020 09:47:37 -0700 (PDT) X-Google-Smtp-Source: APiQypJOcAaufwK7LfXJIkJBk0EWNvlMLaDXRboGMdKChNpRwGv0NybIGUVsUcrqi3RQW/5VntGd X-Received: by 2002:a17:906:359b:: with SMTP id o27mr20911840ejb.282.1588006057469; Mon, 27 Apr 2020 09:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588006057; cv=none; d=google.com; s=arc-20160816; b=RWFZrmxEzYeswDa8dnGjmGeYrNoI3lw8ZVNOj5Xj90WIYCKqstwwdzcX7JAM61meD6 OHb2oaEWxjJv9lzFt3Yj6FQJC/BEK/GUTRNYeY9GOGC3cXoTeH13/UcoK3tnzzeXqeiZ HeV/07LHRHwoujSFLqa63KUk+r8XC4VcvpyyiCcx+anMM0jHcFbdIUwwbSMxa0grHXDj NXFVaQifHAXALP1XhnvnYyJf/qy/HD/vbcxzii2sjEwpgJ1forW2gpeGTnSNtJXYUY7L Mez6AygdOOUlI0MGJwjQN0hS33aj1Cky4MCIBxLvD/f1dGUuDvXjBpiZ2oa91bgOX7Hn xOnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ayE0jRTAVN/0Luj0eAk3zxLknHQ6BrsheL1CNsM5W4E=; b=NfNZG9z+j2SrYoOd+YKO6indZaTmd99ctfxiLzPhkNcXHLOP/cABe5pOwkwkfZypR0 zMiCewwdyOq/2C6DmkGxnfPmxW6PJ7PZPDwPooYJ4w6vk4bKj+dWP4EXW6nPZS+//Z7r zPmoyLCCsKO3CQH57pLrqsm78suUgiop3mib9sQQzqGi2ZNVWmxn7tqPPWcMhCr67UOz zgSsz5dbi1da3hL6le+MOZIj51+4Koe6wT8RFsKqyWAIZ1knMxHr5BXjVNRkbUHKyTsn PiLABBTDXlf1dqTmkg0wm/F0EC/X/dljKLZCrJdeNX3dn3m78QzKoHxKnU+FIZ/GIUki drfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Xzlbn+/r"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si68535ede.603.2020.04.27.09.47.14; Mon, 27 Apr 2020 09:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Xzlbn+/r"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726244AbgD0QpV (ORCPT + 99 others); Mon, 27 Apr 2020 12:45:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbgD0QpU (ORCPT ); Mon, 27 Apr 2020 12:45:20 -0400 Received: from localhost (unknown [171.76.79.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68DA0206D9; Mon, 27 Apr 2020 16:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588005920; bh=HQGfAja2rJ6tyBFd7iZNONvuPgYmUPhKQCqiJIZ0BlA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xzlbn+/rAZkVD3vyFds6UKBjLoLGjModPNllFHhNZDkEgS39vG+qdWwpWnbsSDskK pznWxE0Uco91kl+/FLdEV9VAI8l+ezAah0yDdb0MMNqvxYyKr2SF4IGQQHBVB/hsVz /LxlGZuwpTCDIfUbUsT8st6PQA2gSg8e7V2mQPMo= Date: Mon, 27 Apr 2020 22:15:14 +0530 From: Vinod Koul To: Robert Marko Cc: agross@kernel.org, bjorn.andersson@linaro.org, kishon@ti.com, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, John Crispin , Luka Perkov Subject: Re: [PATCH v6 1/3] phy: add driver for Qualcomm IPQ40xx USB PHY Message-ID: <20200427164514.GQ56386@vkoul-mobl.Dlink> References: <20200401163542.83278-1-robert.marko@sartura.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401163542.83278-1-robert.marko@sartura.hr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Robert, On 01-04-20, 18:35, Robert Marko wrote: > +static int ipq4019_ss_phy_power_on(struct phy *_phy) > +{ > + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); > + > + ipq4019_ss_phy_power_off(_phy); > + > + reset_control_deassert(phy->por_rst); > + > + return 0; > +} > + > +static struct phy_ops ipq4019_usb_ss_phy_ops = { > + .power_on = ipq4019_ss_phy_power_on, > + .power_off = ipq4019_ss_phy_power_off, > +}; > + > +static int ipq4019_hs_phy_power_off(struct phy *_phy) > +{ > + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); > + > + reset_control_assert(phy->por_rst); > + msleep(10); why not call ipq4019_ss_phy_power_off() here as well? > + > + reset_control_assert(phy->srif_rst); > + msleep(10); > + > + return 0; > +} > + > +static int ipq4019_hs_phy_power_on(struct phy *_phy) > +{ > + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); > + > + ipq4019_hs_phy_power_off(_phy); > + > + reset_control_deassert(phy->srif_rst); > + msleep(10); > + > + reset_control_deassert(phy->por_rst); > + > + return 0; > +} > + > +static struct phy_ops ipq4019_usb_hs_phy_ops = { > + .power_on = ipq4019_hs_phy_power_on, > + .power_off = ipq4019_hs_phy_power_off, > +}; So this is fiddling with resets, what about phy configuration and calibration, who take care of that? > +static int ipq4019_usb_phy_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct resource *res; > + struct phy_provider *phy_provider; > + struct ipq4019_usb_phy *phy; > + const struct of_device_id *match; > + > + match = of_match_device(ipq4019_usb_phy_of_match, &pdev->dev); > + if (!match) > + return -ENODEV; you are using this to get match-data few lines below, why not use of_device_get_match_data() and get the match->data which you are interested in? -- ~Vinod