From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751840AbbBMBvJ (ORCPT ); Thu, 12 Feb 2015 20:51:09 -0500 Received: from mga03.intel.com ([134.134.136.65]:31195 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbbBMBvI (ORCPT ); Thu, 12 Feb 2015 20:51:08 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,568,1418112000"; d="scan'208";a="453987039" Date: Thu, 12 Feb 2015 17:52:42 -0800 From: David Cohen To: Heikki Krogerus Cc: Felipe Balbi , Greg Kroah-Hartman , Baolu Lu , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I Subject: Re: [PATCH 8/8] phy: add driver for TI TUSB1210 ULPI PHY Message-ID: <20150213015242.GD21337@psi-dev26.jf.intel.com> References: <1422025978-178336-1-git-send-email-heikki.krogerus@linux.intel.com> <1422025978-178336-9-git-send-email-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422025978-178336-9-git-send-email-heikki.krogerus@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heikki, Sorry I am starting a new branch on this thread. I need to go back to another topic on this same patch. On Fri, Jan 23, 2015 at 05:12:58PM +0200, Heikki Krogerus wrote: > TUSB1210 ULPI PHY has vendor specific register for eye > diagram tuning. On some platforms the system firmware has > set optimized value to it. In order to not loose the > optimized value, the driver stores it during probe and > restores it every time the PHY is powered back on. > > Signed-off-by: Heikki Krogerus > Cc: Kishon Vijay Abraham I > --- [snip] > + /* Store initial eye diagram optimisation value */ > + ret = ulpi_read(ulpi, TUSB1210_VENDOR_SPECIFIC2); We can't rely on eye diagram optimization value here. It's possible the phy went through reset (e.g. module unloading/loading). We need a more consistent method. Could we use _DSD instead? That would be more compatible with DT too. Br, David > + if (ret < 0) > + return ret; > + > + tusb->eye_diagram_tuning = ret; > + > + tusb->phy = ulpi_phy_create(ulpi, &phy_ops); > + if (IS_ERR(tusb->phy)) > + return PTR_ERR(tusb->phy); > + > + tusb->ulpi = ulpi; > + > + phy_set_drvdata(tusb->phy, tusb); > + ulpi_set_drvdata(ulpi, tusb); > + return 0; > +} > +