Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3427537ybi; Fri, 19 Jul 2019 03:07:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzV/QZSH1Pl4eQjvyf3D7tRr84fFHSwNM+hKYeZ2VWH1ffdLTbNZ7gjVvASgPiCqaBgxbTp X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr53800553plb.114.1563530850780; Fri, 19 Jul 2019 03:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563530850; cv=none; d=google.com; s=arc-20160816; b=dBKqtuTjmvXnK7jXu4mgWvBqMrpqxCxQYSz2cWBCwPkDa6GYy3HKLGp0El5QO8FI47 4TwwoK5COAhmIxSr7b7Zguhm8yOl+P2+nEB87sU+72s2uANKdNrESiCt3QVuwG4chn3i I3Q9ZVF8kSmZQUDfAjMcaoWBu47aVd7Tb5l1+t6WKGNXXcT1gsyX7+moBAdcYLQpXo+o Af1Ql0Ud00NoaaWoAAVwGWpU3nyJ9Ka6aFtCrbfIYhQ2cKueUxVSg3u/XroGCaU97GLv RrBNCNLozk07z7KlvPxlFKDn0gX36GK9e8PinjCxMSnXEh4UzoyU5lz+KSava9YEFUnB mWJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=kEvJafuT1mgVbVr5vHN42Lk/YX5x6Xiii0b77v5ee/M=; b=QQuiGYMQhUcjKjT1QT8Ot89jhPAf5WckIyt/RU92WyWZcurdL0AuJPZWfVmIPyg/lm wN1Bc5yNLFv0YaTTLEg0DyyFnPYGPZ/Opoi3CbZpzM5f2D4dPBCkp+P0A3HCxkv2o1s+ BciY/ntTK+PzeIqItMiURI7mG4xYrtxoJsNSxlxHyXE6Q/PiQnnOIPkqS69XFZjQahco 2gqA1e0yLVMxcejqpgdb4VCQD38slRG79e4CplRBIyoRQZHO3pvtIAsdfwcpy91C9166 RtiDmV1FYFgdKVzFUAWmjrBcFs/6g2FGpxW+Bj//00ZSq+CWvnaB7IL/vGgeHdSAOC3F nEkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=h2ZRrvKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si192705pfm.145.2019.07.19.03.07.14; Fri, 19 Jul 2019 03:07:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=h2ZRrvKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbfGSKGB (ORCPT + 99 others); Fri, 19 Jul 2019 06:06:01 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39890 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfGSKGA (ORCPT ); Fri, 19 Jul 2019 06:06:00 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6JA5ubt031335; Fri, 19 Jul 2019 05:05:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1563530756; bh=kEvJafuT1mgVbVr5vHN42Lk/YX5x6Xiii0b77v5ee/M=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=h2ZRrvKub8w1lRclaH1XGeYI9et46t8uhXdTmcqPzYSwd6/I3wcpVc0YY1YNCYDmL NBS5iKvrV9p0iuw/30ExYNkaY/SxlfIiceAeUG1utTmQHJcP3PwYgMfNnrkjfF74C/ YUikXxhCOljROFaSjLWqyolVLMJlZA+w1Kicecbw= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6JA5uou020375 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Jul 2019 05:05:56 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 19 Jul 2019 05:05:56 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 19 Jul 2019 05:05:56 -0500 Received: from [172.24.190.233] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x6JA5sIR062705; Fri, 19 Jul 2019 05:05:54 -0500 Subject: Re: [PATCH] phy: core: document calibrate() method To: Marek Szyprowski , , CC: , Bartlomiej Zolnierkiewicz References: <20190719095245.17401-1-m.szyprowski@samsung.com> From: Kishon Vijay Abraham I Message-ID: <085b8093-d7bc-d960-f0d8-8776818ebab0@ti.com> Date: Fri, 19 Jul 2019 15:34:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190719095245.17401-1-m.szyprowski@samsung.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marek, On 19/07/19 3:22 PM, Marek Szyprowski wrote: > Commit 36914111e682 ("drivers: phy: add calibrate method") added support > for generic phy_calibrate() method, but it didn't explain in detail when > such method is supposed to be called. Add some more documentation directly > to the phy.h to make it clean that it is intended to be called after every > host controller reset. > > Signed-off-by: Marek Szyprowski > --- > include/linux/phy/phy.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h > index 15032f145063..46775e8b0ed9 100644 > --- a/include/linux/phy/phy.h > +++ b/include/linux/phy/phy.h > @@ -101,6 +101,18 @@ struct phy_ops { > int (*validate)(struct phy *phy, enum phy_mode mode, int submode, > union phy_configure_opts *opts); > int (*reset)(struct phy *phy); > + > + /** > + * @calibrate: > + * > + * Optional. > + * > + * Used to calibrate phy, typically by adjusting some parameters > + * in runtime, which are otherwise lost after host controller > + * reset and cannot be set in phy_init() and phy_power_on(). > + * > + * Returns: 0 if successful, an negative error code otherwise > + */ > int (*calibrate)(struct phy *phy); This should be added in drivers/phy/phy-core.c before phy_calibrate()? We could add a separate section in Documentation/phy.txt to document these phy_ops. Thanks Kishon