From patchwork Fri Nov 1 19:45:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 3127421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64DF49F3C4 for ; Fri, 1 Nov 2013 19:47:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FFD9201BF for ; Fri, 1 Nov 2013 19:47:36 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADD8720173 for ; Fri, 1 Nov 2013 19:47:35 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VcKgS-00042k-Ef; Fri, 01 Nov 2013 19:47:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VcKgM-00080E-11; Fri, 01 Nov 2013 19:46:58 +0000 Received: from mail-ie0-f182.google.com ([209.85.223.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VcKg4-0007tJ-As for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2013 19:46:42 +0000 Received: by mail-ie0-f182.google.com with SMTP id as1so8419435iec.13 for ; Fri, 01 Nov 2013 12:46:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6gcE9d7faHZ+6BGs05bCGTZeCXS0SB509qgQUumEQUs=; b=cqdIk0g6OjYRPLbqJZE2yKdPydOfEHLQ1savKii+vIsOvlh0UsFUp/POYgq+pgGhD5 4CCEnqaftx5Uv3s0bzkCxdzYC1/FgfsQknkhgFSxbTvs2J63NLymMxD01vAjfVy145Up aQBOUsGcrHJ5hy5667SCnMyIXgmd6rkPgP1NNBZRWt7Oesvs9KRwVhRHFwY/4ybyii97 91hdZJDpFElk8SkCIN0rkCKSPIkW3/cPHVPZP+cCp9gvkozhuRcLu0/VT4ynsyXPSt5n OvSrHcF6Ige3HNmHcyj4h2JtIHayeXbup9GaDD+sbGeRmPG9d5CUKAOZxn8S0+yihGp+ Zndw== X-Gm-Message-State: ALoCoQnTgsKEWXrWjYOOxBVzLXQNZF6rMT3FVV2WC9UBcxQzkqWBGvPt2rmhanrH7KMl83PhL1Kk X-Received: by 10.42.30.143 with SMTP id v15mr2923097icc.24.1383335174128; Fri, 01 Nov 2013 12:46:14 -0700 (PDT) Received: from beef.ohporter.com (cpe-98-27-254-98.neo.res.rr.com. [98.27.254.98]) by mx.google.com with ESMTPSA id f5sm5616338igc.4.2013.11.01.12.46.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Nov 2013 12:46:13 -0700 (PDT) From: Matt Porter To: Felipe Balbi , Greg Kroah-Hartman , Kishon Vijay Abraham I , Rob Herring , Pawel Moll , Mark Rutland , Kumar Gala , Ian Campbell , Christian Daudt , Paul Zimmerman Subject: [PATCH v2 1/9] phy: add phy_get_bus_width()/phy_set_bus_width() calls Date: Fri, 1 Nov 2013 15:45:50 -0400 Message-Id: <1383335158-19730-2-git-send-email-matt.porter@linaro.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1383335158-19730-1-git-send-email-matt.porter@linaro.org> References: <1383335158-19730-1-git-send-email-matt.porter@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131101_154640_543574_C608E00F X-CRM114-Status: GOOD ( 12.16 ) X-Spam-Score: -2.6 (--) Cc: Devicetree List , Linux USB List , Linux Kernel Mailing List , Linux ARM Kernel List , Linaro Patches X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a pair of APIs that allows the generic PHY subsystem to provide information on the PHY bus width. The PHY provider driver may use phy_set_bus_width() to set the bus width that the PHY supports. The controller driver may then use phy_get_bus_width() to fetch the PHY bus width in order to properly configure the controller. Signed-off-by: Matt Porter --- include/linux/phy/phy.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 6d72269..e858ce1 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -46,6 +46,7 @@ struct phy_ops { * @mutex: mutex to protect phy_ops * @init_count: used to protect when the PHY is used by multiple consumers * @power_count: used to protect when the PHY is used by multiple consumers + * @bus_width: used to specify data width of the PHY bus */ struct phy { struct device dev; @@ -55,6 +56,7 @@ struct phy { struct mutex mutex; int init_count; int power_count; + int bus_width; }; /** @@ -127,6 +129,12 @@ int phy_init(struct phy *phy); int phy_exit(struct phy *phy); int phy_power_on(struct phy *phy); int phy_power_off(struct phy *phy); +static inline int phy_get_bus_width(struct phy *phy) { + return phy->bus_width; +}; +static inline void phy_set_bus_width(struct phy *phy, int bus_width) { + phy->bus_width = bus_width; +}; struct phy *phy_get(struct device *dev, const char *string); struct phy *devm_phy_get(struct device *dev, const char *string); void phy_put(struct phy *phy); @@ -199,6 +207,14 @@ static inline int phy_power_off(struct phy *phy) return -ENOSYS; } +static inline int phy_get_bus_width(struct phy *phy) { + return -ENOSYS; +}; + +static inline void phy_set_bus_width(struct phy *phy, bus_width) { + return; +}; + static inline struct phy *phy_get(struct device *dev, const char *string) { return ERR_PTR(-ENOSYS);