Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2494558imd; Fri, 2 Nov 2018 12:24:35 -0700 (PDT) X-Google-Smtp-Source: AJdET5d51q+x4DsYSC1hW0kNCNr30TS8vNTpUewESYShbNCvgnKcrQ/IcbQsFycLknQXKsPE33Uc X-Received: by 2002:a62:204a:: with SMTP id g71-v6mr12776747pfg.28.1541186675665; Fri, 02 Nov 2018 12:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541186675; cv=none; d=google.com; s=arc-20160816; b=nps889kcaqGztRz1FfYf721aQiTRZPtEJ9fEbz2QYsGxTqmz92Bc9GE2JaM81oAgpa R4SazFALKXfNKpvmDMY3NxKO5ZV/ANhLfkn3R18GE/HAN6vy8hfRQSAS5ZXoyOOg6wVN R3qiXohs4E5jyTj7mTH6pC7eYHNUmqeklNDPBgqHyzofFRQR9IPEi9uniDksQrBUYFke jbSH+AnymIKTy+DxwvTolGtIRU36kj6Z5pCt5Xs/Mo7z8LQbufvwYXIEvRyUHWO/gKU2 ebDMSoAsb8O+CAaQTNyuIxMgzVeNH2fr7psJk4cIQ1TZKxmCFybWepWlCiui3QCnGWoG reFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=cHBxo68xGrNY9nv9pUEcfeQ+i5ym5UlzNXmTpWzAh2U=; b=aN7Xli3no7nwxvSLy+jKWUT1vCWSNO3SQpcFnLuV8uFat6h6sKdKQFZG3c+77UYmiG GOKMe2pUAeAXuiD7MDaOj1dDbAGFmYOZyirRBKJQkI6mOI8vaymmBc4cAI6VllpuAry1 zq9HSuWzH2jxG8bgaYrzsN5k3R8fi+uJf7WJHs63RIcNs1L/OOGIH/h+pZbtoZ/3t65w DaSkZSDccH11wImeKE0dXNKiPnvVOQuyPMU4VtyzPo3xnSb/l33KjzRb01fyyUxwUV0Q mXDKnOekdhCq+JNf1EEcN2bRxSSpUh4YasHGze2PKsn6sYrsp8lsXQ+9gDgzLMllVQ5E t+Pg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 v141-v6si23179346pfc.193.2018.11.02.12.24.20; Fri, 02 Nov 2018 12:24:35 -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; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbeKCEcV (ORCPT + 99 others); Sat, 3 Nov 2018 00:32:21 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:52474 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbeKCEcV (ORCPT ); Sat, 3 Nov 2018 00:32:21 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id wA2JNlpx077280; Fri, 2 Nov 2018 14:23:47 -0500 Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wA2JNlx5045107 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Nov 2018 14:23:47 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 2 Nov 2018 14:23:47 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 2 Nov 2018 14:23:47 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wA2JNfvV000522; Fri, 2 Nov 2018 14:23:45 -0500 From: Faiz Abbas To: , , , CC: , , , , , Subject: [PATCH 1/6] phy: Add max_bitrate attribute & phy_get_max_bitrate() Date: Sat, 3 Nov 2018 00:56:11 +0530 Message-ID: <20181102192616.28291-2-faiz_abbas@ti.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181102192616.28291-1-faiz_abbas@ti.com> References: <20181102192616.28291-1-faiz_abbas@ti.com> MIME-Version: 1.0 Content-Type: text/plain 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 In some subsystems (eg. CAN) the physical layer capabilities are the limiting factor in the datarate of the device. Typically, the physical layer transceiver does not provide a way to discover this limitation at runtime. Thus this information needs to be represented as a phy attribute which is read from the device tree. Therefore, add an optional max_bitrate attribute to the generic phy sybsystem. Also add the complementary API which enables the consumer to get max_bitrate. Signed-off-by: Faiz Abbas --- include/linux/phy/phy.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 03b319f89a34..31574464f09f 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -72,6 +72,7 @@ struct phy_ops { */ struct phy_attrs { u32 bus_width; + u32 max_bitrate; enum phy_mode mode; }; @@ -179,6 +180,10 @@ static inline void phy_set_bus_width(struct phy *phy, int bus_width) { phy->attrs.bus_width = bus_width; } +static inline int phy_get_max_bitrate(struct phy *phy) +{ + return phy->attrs.max_bitrate; +} struct phy *phy_get(struct device *dev, const char *string); struct phy *phy_optional_get(struct device *dev, const char *string); struct phy *devm_phy_get(struct device *dev, const char *string); -- 2.18.0