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: 21306 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 16E6F23908 for ; Fri, 1 Nov 2013 19:46:16 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hu19sf8684976vcb.9 for ; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) 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=6gcE9d7faHZ+6BGs05bCGTZeCXS0SB509qgQUumEQUs=; b=gaS7u3Ultu6agTb1S60PaNBQsDBBZguatj5vAqis3fYMOPcfYzKhU4+WZUK928Jsqh jjWt9pKhQzrz61IEs/fO1az9xALEFXnDA6gwCd2EKsY2N53DuQSCdAyd5vHhG9QAjVn5 a1rX1PB5lMkrxsxyd3+JLTJduki0qFzKiNULnhuKFjHrKkYsqM06jaLGw63yQ21r3VlH hme7S4zfRzjFfYMByaLblgt+05smChFQPAJ3bXgRzwVtKmesp000V5oDWUvil4RYG9ms Rj0EsbpprQc20LnVdcJxPxIgdjSEyZT6DG4rMDmHNdwYprLM8j3oCbm1B8E364FnFa86 bPbA== X-Gm-Message-State: ALoCoQnFI7IOJhXVaRT8Ml/Mfa1JQlIqyPavfPQTfo2/x+SLqxWWufwYhwLat7W7T/Fr7UTl5bpk X-Received: by 10.58.201.36 with SMTP id jx4mr924232vec.35.1383335175681; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.102 with SMTP id hr6ls1529312qeb.13.gmail; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) X-Received: by 10.58.67.9 with SMTP id j9mr3079907vet.3.1383335175569; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id t2si1036045vem.104.2013.11.01.12.46.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Nov 2013 12:46:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 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.42; Received: by mail-vb0-f42.google.com with SMTP id p14so3187369vbm.29 for ; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) X-Received: by 10.52.172.68 with SMTP id ba4mr22580vdc.66.1383335175459; Fri, 01 Nov 2013 12:46:15 -0700 (PDT) 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 u4csp66756vcz; Fri, 1 Nov 2013 12:46:15 -0700 (PDT) X-Received: by 10.50.62.211 with SMTP id a19mr3811186igs.18.1383335174718; Fri, 01 Nov 2013 12:46:14 -0700 (PDT) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by mx.google.com with ESMTPS id nt8si4814191icb.152.2013.11.01.12.46.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Nov 2013 12:46:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.180 is neither permitted nor denied by best guess record for domain of matt.porter@linaro.org) client-ip=209.85.223.180; Received: by mail-ie0-f180.google.com with SMTP id e14so8074838iej.39 for ; Fri, 01 Nov 2013 12:46:14 -0700 (PDT) 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 Cc: Linux USB List , Linux ARM Kernel List , Linux Kernel Mailing List , Devicetree List , Linaro Patches 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-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.42 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 | 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);