From patchwork Tue Nov 6 14:54:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10670597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A468015E9 for ; Tue, 6 Nov 2018 14:54:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92FF72A4DA for ; Tue, 6 Nov 2018 14:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 874E12A4E0; Tue, 6 Nov 2018 14:54:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E4702A4DA for ; Tue, 6 Nov 2018 14:54:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OGdO8Jl5lZLSTFbBu7AxPxkMqyCoPKDeXsmz67K7EZI=; b=pq/pp/JO1TX7Fl 0uoZVZ3h9f2+uBUIZWZ8zVgPH6wChacIairS6OzeH4IlibkHUSVObJM3OjRxAudAAoWb/RaQoG7Fy RnQ67aO1iIsP0lDGQC46QQybBmQGypGnGOKwtmXO5zbzX2jTjt1lrGM+Nss536/Mm1EQBMVOH1zh2 ivmUOvk/CQv4NIornpF/aUSFHMictnEoo+mH1Z/2Clc2o6V8Z24+uYokbZAzYHwKorbMwFkUpUuQk +g6QZnJcnc8OVNfpcVLqnYinZwdLFr+1nHg/uoIb8DApiVHWx9GOahozKmg4S7bngpHOJWUSmmQUr XUWBr+X6O56s03r/Zsmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kk-0001eL-Fy; Tue, 06 Nov 2018 14:54:50 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kj-0001dq-1o for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Nov 2018 14:54:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8dvR3XeN7o6Zp1AaDAlCi4cxHjseol/iZalzD6++1FU=; b=NHTPyIJy0vKFrjrbUnfTsXvicL oIVuSYhl8gtOv877xNWmiPpS+GTytrTdrPfwPS4LiJpek2rol4PSZ0f3RbKybOmfnlcuZRbaqKbO4 aSbv7TwiKYhUF57bG/s+7EhebKLsykh57cDTQMEDruKUHfB2yR3tjWmL1n62NhLFXKEGFF9IQLrmq hhBvurCFjFkune1JdFR1v0LA+fuR8l5eNj5kQrO2/f83jR+ica+s+yt1Q4OjvmtxmvqciU5K1Khhj l/uqxjasJVs3sYqjnhwlc+PNWqOHiDBvll3eRIZGTbUMAj0VQQCYOhxXHVyqvchmoFHJ3csDCqWDl 1sIPCYEQ==; Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kg-0006J0-BI for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 14:54:47 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 3972120885; Tue, 6 Nov 2018 15:54:36 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.bootlin.com (Postfix) with ESMTPSA id F1DC520789; Tue, 6 Nov 2018 15:54:25 +0100 (CET) From: Maxime Ripard To: Kishon Vijay Abraham I , Boris Brezillon Subject: [PATCH v2 1/9] phy: Add MIPI D-PHY mode Date: Tue, 6 Nov 2018 15:54:13 +0100 Message-Id: <74b2dfd695a5d28f9a07634cea17acec0a6aaa49.1541516029.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_145446_400680_A24B0A93 X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Rafal Ciepiela , Krzysztof Witos , Maxime Ripard , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Chen-Yu Tsai , Laurent Pinchart , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP MIPI D-PHY is a MIPI standard meant mostly for display and cameras in embedded systems. Add a mode for it. Reviewed-by: Laurent Pinchart Signed-off-by: Maxime Ripard Reviewed-by: Sakari Ailus --- include/linux/phy/phy.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 03b319f89a34..d5c2ac7369f2 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -42,6 +42,7 @@ enum phy_mode { PHY_MODE_UFS_HS_A, PHY_MODE_UFS_HS_B, PHY_MODE_PCIE, + PHY_MODE_MIPI_DPHY, }; /** From patchwork Tue Nov 6 14:54:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10670617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C28A615E9 for ; Tue, 6 Nov 2018 14:55:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B089E2A4DC for ; Tue, 6 Nov 2018 14:55:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A49182A4E0; Tue, 6 Nov 2018 14:55:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B9262A4DC for ; Tue, 6 Nov 2018 14:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KmD+KZXSlkmNOJY8dCoiL9iWWUpjYbhke3oDGKDb2Xw=; b=Q1PsFkYDI/gdJn ENazkaFAofUsmsr4AkYszIzICfh7pgQ+4AO7wKyYqxj17XMu/fW+8EladQwVbPw/OMxPdtS5r1Mk1 NKOF5y9Tf4BBdgrR3Bq6ggvhwnEyge/Y3QpRavuXPyEZ1GF9lrPWZPbWAVxycLUn+Pz9weVp2kXLG PIves9p2egjUVlGBe3f1fzwTJim/022L3RK+TGcv3xVgOcFTY5DVtge/vduHUuDdMzm2cRNAcHxhp buBZQjC+0duPz8QLEsq6MCO3ZcW8SFyO1DS891poqA7NSMxw0PkevlKm29LMPc8oy3KxMPBD8Joh2 7KSOaS35hAPOJoLG8L1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2lE-000349-FE; Tue, 06 Nov 2018 14:55:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kk-0001eK-PZ for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Nov 2018 14:54:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=W9eXX51hUo8tIgBWcmlJX+xpEBtWNlVMBjexiPVHZCg=; b=OasUE6f9NDOQApIRs7rF6NfsoZ 5+ajO3dCTlThcelYlAEH27BzkKe2vQlRIxJzatu9FDI7SrSLyDzjUk4YsKCEijO/b4XLKCE/23sGZ +/869Y3+l3RFalP72+x4CqY3jB64IGiK8lmCChvNUWtqAC2vGm+NWu+NBXvYgpBSJKSDL6StnfAN7 SQ+MQqDOj+JE0kLyUfzV9Mpam213VR4iF2eKWFjnLtmk8MuXdqNFqvjfQblHthyxnPaZv2ttLcurU 48SzPKovS9TuDt5Q82CZ9huSriRvVmRb+DMv95Nvu45a1KpvuvFA3JCWAjIVsxc95WkmVPITUwceC xxG0yL/g==; Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kg-0006J1-BJ for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 14:54:49 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id DD27A20789; Tue, 6 Nov 2018 15:54:36 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.bootlin.com (Postfix) with ESMTPSA id 98239206A1; Tue, 6 Nov 2018 15:54:26 +0100 (CET) From: Maxime Ripard To: Kishon Vijay Abraham I , Boris Brezillon Subject: [PATCH v2 2/9] phy: Add configuration interface Date: Tue, 6 Nov 2018 15:54:14 +0100 Message-Id: <4d0506aa0a61d234610b42a268a8326d9ea18466.1541516029.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_145446_425864_74ADB978 X-CRM114-Status: GOOD ( 22.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Rafal Ciepiela , Krzysztof Witos , Maxime Ripard , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Chen-Yu Tsai , Laurent Pinchart , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The phy framework is only allowing to configure the power state of the PHY using the init and power_on hooks, and their power_off and exit counterparts. While it works for most, simple, PHYs supported so far, some more advanced PHYs need some configuration depending on runtime parameters. These PHYs have been supported by a number of means already, often by using ad-hoc drivers in their consumer drivers. That doesn't work too well however, when a consumer device needs to deal with multiple PHYs, or when multiple consumers need to deal with the same PHY (a DSI driver and a CSI driver for example). So we'll add a new interface, through two funtions, phy_validate and phy_configure. The first one will allow to check that a current configuration, for a given mode, is applicable. It will also allow the PHY driver to tune the settings given as parameters as it sees fit. phy_configure will actually apply that configuration in the phy itself. Signed-off-by: Maxime Ripard --- drivers/phy/phy-core.c | 61 ++++++++++++++++++++++++++++++++++++++++++- include/linux/phy/phy.h | 58 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 35fd38c5a4a1..7bd3ed65c708 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -408,6 +408,67 @@ int phy_calibrate(struct phy *phy) EXPORT_SYMBOL_GPL(phy_calibrate); /** + * phy_configure() - Changes the phy parameters + * @phy: the phy returned by phy_get() + * @opts: New configuration to apply + * + * Used to change the PHY parameters. phy_init() must have been called + * on the phy. The configuration will be applied on the current phy + * mode, that can be changed using phy_set_mode(). + * + * Returns: 0 if successful, an negative error code otherwise + */ +int phy_configure(struct phy *phy, union phy_configure_opts *opts) +{ + int ret; + + if (!phy) + return -EINVAL; + + if (!phy->ops->configure) + return -EOPNOTSUPP; + + mutex_lock(&phy->mutex); + ret = phy->ops->configure(phy, opts); + mutex_unlock(&phy->mutex); + + return ret; +} + +/** + * phy_validate() - Checks the phy parameters + * @phy: the phy returned by phy_get() + * @mode: phy_mode the configuration is applicable to. + * @opts: Configuration to check + * + * Used to check that the current set of parameters can be handled by + * the phy. Implementations are free to tune the parameters passed as + * arguments if needed by some implementation detail or + * constraints. It will not change any actual configuration of the + * PHY, so calling it as many times as deemed fit will have no side + * effect. + * + * Returns: 0 if successful, an negative error code otherwise + */ +int phy_validate(struct phy *phy, enum phy_mode mode, + union phy_configure_opts *opts) +{ + int ret; + + if (!phy) + return -EINVAL; + + if (!phy->ops->validate) + return -EOPNOTSUPP; + + mutex_lock(&phy->mutex); + ret = phy->ops->validate(phy, mode, opts); + mutex_unlock(&phy->mutex); + + return ret; +} + +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy * @index: the index of the phy diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index d5c2ac7369f2..89cf8b685546 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -46,6 +46,12 @@ enum phy_mode { }; /** + * union phy_configure_opts - Opaque generic phy configuration + */ +union phy_configure_opts { +}; + +/** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting @@ -62,6 +68,37 @@ struct phy_ops { int (*power_on)(struct phy *phy); int (*power_off)(struct phy *phy); int (*set_mode)(struct phy *phy, enum phy_mode mode); + + /** + * @configure: + * + * Optional. + * + * Used to change the PHY parameters. phy_init() must have + * been called on the phy. + * + * Returns: 0 if successful, an negative error code otherwise + */ + int (*configure)(struct phy *phy, union phy_configure_opts *opts); + + /** + * @validate: + * + * Optional. + * + * Used to check that the current set of parameters can be + * handled by the phy. Implementations are free to tune the + * parameters passed as arguments if needed by some + * implementation detail or constraints. It must not change + * any actual configuration of the PHY, so calling it as many + * times as deemed fit by the consumer must have no side + * effect. + * + * Returns: 0 if the configuration can be applied, an negative + * error code otherwise + */ + int (*validate)(struct phy *phy, enum phy_mode mode, + union phy_configure_opts *opts); int (*reset)(struct phy *phy); int (*calibrate)(struct phy *phy); struct module *owner; @@ -166,6 +203,9 @@ int phy_exit(struct phy *phy); int phy_power_on(struct phy *phy); int phy_power_off(struct phy *phy); int phy_set_mode(struct phy *phy, enum phy_mode mode); +int phy_configure(struct phy *phy, union phy_configure_opts *opts); +int phy_validate(struct phy *phy, enum phy_mode mode, + union phy_configure_opts *opts); static inline enum phy_mode phy_get_mode(struct phy *phy) { return phy->attrs.mode; @@ -305,6 +345,24 @@ static inline int phy_calibrate(struct phy *phy) return -ENOSYS; } +static inline int phy_configure(struct phy *phy, + union phy_configure_opts *opts) +{ + if (!phy) + return 0; + + return -ENOSYS; +} + +static inline int phy_validate(struct phy *phy, enum phy_mode mode, + union phy_configure_opts *opts) +{ + if (!phy) + return 0; + + return -ENOSYS; +} + static inline int phy_get_bus_width(struct phy *phy) { return -ENOSYS; From patchwork Tue Nov 6 14:54:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10670651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA04117D4 for ; Tue, 6 Nov 2018 14:57:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6E7B2A4DB for ; Tue, 6 Nov 2018 14:57:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAE9C2A4E6; Tue, 6 Nov 2018 14:57:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 467A32A4DC for ; Tue, 6 Nov 2018 14:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PKu51JRV4DraMWE+Rb99egueF7tzXLPIKZFldTveBPw=; b=nWzOWp49Bj1pBA 0EjD5AsW5nzwSl/ts/2Sy3Q7bRIpJDY8v1oBxwnuRBdf1tkkDCwuNNw6n66ILm9INwqLBBhmHZHxq zjMNg+KKaDOBIZBJ5YwQ2SYSaLbmx2PsPXOB19zjnXjBgRHDZ700ql9XYiqJLsmqD7yXhCSrHVkPv Lw3WwlNJkOkdSF9usJFXYQq8OtVhMyMTtD8rGaJt0RGhzjXwR3QCsidy+s/7UjgIiw56QZl4fzaxN wVhJhFjt4B5IQvcaMV1Mm+/+QUh79yJu1/UAuDNpd5WVo87foYVnB0AP0Zi7KRV/j1SnXIDw7I9ak xhWHSiUc9i9Q7X19kuQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2na-0005Zo-Kw; Tue, 06 Nov 2018 14:57:46 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2kx-0001tD-GP for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Nov 2018 14:55:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VCnxgXeus2JIUfs7/rjeiQ2mqzzXKJTOmFrejyNVLj4=; b=uV1Y1qXTh7NulXGCuR8lSeiCGM RBHTnMIuu3oUr9JNp+UWxhIPsF36A6mJlSkkQUWqt8R5ILOhz/pnM92GfLVbAk/itqlY7nHhIV6DI OB+ba5dD9mh4uf8cj4lsj5oRYQzS+O01vLx4v1NsTkT7HdqGCUOWJOhSdptc/lKQAHWnujFjEMSeV H9GO3zGgyehrFeqvyaEcLkNM/Yvi8USrIaSlMLE/2s+/JCUmQ55Uqwram0CnyKOENrLxvEVhjAFF3 NtsyTjApPaMOiAQfgO/COKQnEmDzu+dO5cOx85ixZRXavn8Rv0/OMwpHmrtNSEypjfr/ppUAp22my 4DEcz/mw==; Received: from mail.bootlin.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gK2ku-0007Re-4L for linux-arm-kernel@lists.infradead.org; Tue, 06 Nov 2018 14:55:00 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 7453A20892; Tue, 6 Nov 2018 15:54:45 +0100 (CET) Received: from localhost (unknown [185.94.189.188]) by mail.bootlin.com (Postfix) with ESMTPSA id 93EAD2086B; Tue, 6 Nov 2018 15:54:31 +0100 (CET) From: Maxime Ripard To: Kishon Vijay Abraham I , Boris Brezillon Subject: [PATCH v2 3/9] phy: Add MIPI D-PHY configuration options Date: Tue, 6 Nov 2018 15:54:15 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181106_095500_397153_B2A67B5A X-CRM114-Status: GOOD ( 22.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Rafal Ciepiela , Krzysztof Witos , Maxime Ripard , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Chen-Yu Tsai , Laurent Pinchart , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have some infrastructure for it, allow the MIPI D-PHY phy's to be configured through the generic functions through a custom structure added to the generic union. The parameters added here are the ones defined in the MIPI D-PHY spec, plus the number of lanes in use. The current set of parameters should cover all the potential users. Signed-off-by: Maxime Ripard --- include/linux/phy/phy-mipi-dphy.h | 232 +++++++++++++++++++++++++++++++- include/linux/phy/phy.h | 6 +- 2 files changed, 238 insertions(+) create mode 100644 include/linux/phy/phy-mipi-dphy.h diff --git a/include/linux/phy/phy-mipi-dphy.h b/include/linux/phy/phy-mipi-dphy.h new file mode 100644 index 000000000000..0b05932916af --- /dev/null +++ b/include/linux/phy/phy-mipi-dphy.h @@ -0,0 +1,232 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2018 Cadence Design Systems Inc. + */ + +#ifndef __PHY_MIPI_DPHY_H_ +#define __PHY_MIPI_DPHY_H_ + +#include