From patchwork Mon Nov 25 18:15:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 21748 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2194120299 for ; Mon, 25 Nov 2013 18:16:18 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id j5sf18149457qaq.5 for ; Mon, 25 Nov 2013 10:16:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Xw10lAUuXP9stAclBP8c+57Z1YBk4BPcBq6sC5kzgWQ=; b=dAnmWYPi/AHMVfRRDswfS44tnzB5hV7b8CWJGHj0ykbdBLoNX+8puiOE7Xa9DOJpK2 vxnG3wQzWN1469bzBSjtRlIag+zbf0nb5Q0wd2DOLw+5k2ftRZJR4EwrT0s7uUyK7pJ9 O7k39ZA+wuERYoHRN4x9Dz1Qye39bQmmzb2Mfftr6j0KXS+r8t9rpnyk+WJsVfxSLa6U Yuo8t2GFYAfPBECkOUrQZ5CQt2sAzjQjx3uGwOEXNEia3/Yuqf0ir1gq5okORYSoeaFi zZId6+jfjc+4bOwtjEiiyPPqX47GXoiYOb/BZ1VwZM2HyST++Wy26BRlHtZk26m2Rusy 0N9A== X-Gm-Message-State: ALoCoQlucPamqdrtgfXs6cIGJitpbyHACpW7lpnVTOAgQKwATlO2ZbL6fqGoWBgLivUU39YHUxfZ X-Received: by 10.236.163.67 with SMTP id z43mr13233170yhk.27.1385403377800; Mon, 25 Nov 2013 10:16:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.42 with SMTP id z10ls2238433qef.63.gmail; Mon, 25 Nov 2013 10:16:17 -0800 (PST) X-Received: by 10.220.192.198 with SMTP id dr6mr7189618vcb.19.1385403377682; Mon, 25 Nov 2013 10:16:17 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id f10si18221284vck.20.2013.11.25.10.16.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Nov 2013 10:16:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id p5so2987271vbn.8 for ; Mon, 25 Nov 2013 10:16:17 -0800 (PST) X-Received: by 10.220.86.69 with SMTP id r5mr27495137vcl.9.1385403377553; Mon, 25 Nov 2013 10:16:17 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp152983vcz; Mon, 25 Nov 2013 10:16:17 -0800 (PST) X-Received: by 10.50.61.205 with SMTP id s13mr13957352igr.29.1385403376699; Mon, 25 Nov 2013 10:16:16 -0800 (PST) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) by mx.google.com with ESMTPS id hb7si30113178icc.39.2013.11.25.10.16.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Nov 2013 10:16:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.175 is neither permitted nor denied by best guess record for domain of matt.porter@linaro.org) client-ip=209.85.223.175; Received: by mail-ie0-f175.google.com with SMTP id x13so7668816ief.34 for ; Mon, 25 Nov 2013 10:16:16 -0800 (PST) X-Received: by 10.50.111.74 with SMTP id ig10mr2429903igb.56.1385403376218; Mon, 25 Nov 2013 10:16:16 -0800 (PST) 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 j16sm26901318igf.6.2013.11.25.10.16.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Nov 2013 10:16:15 -0800 (PST) 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 Cc: Tomasz Figa , Kamil Debski , Kyungmin Park , Linux USB List , Linux ARM Kernel List , Linux Kernel Mailing List , Devicetree List , Linaro Patches Subject: [PATCH v3 1/9] phy: add phy_get_bus_width()/phy_set_bus_width() calls Date: Mon, 25 Nov 2013 13:15:59 -0500 Message-Id: <1385403367-18144-2-git-send-email-matt.porter@linaro.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1385403367-18144-1-git-send-email-matt.porter@linaro.org> References: <1385403367-18144-1-git-send-email-matt.porter@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: matt.porter@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 6d72269..6ca6c61 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,14 @@ 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 +209,16 @@ 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);