From patchwork Mon Feb 22 21:08:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102719 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1477400lbl; Mon, 22 Feb 2016 13:10:46 -0800 (PST) X-Received: by 10.98.66.157 with SMTP id h29mr41258022pfd.91.1456175446408; Mon, 22 Feb 2016 13:10:46 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id r71si41984235pfa.179.2016.02.22.13.10.45; Mon, 22 Feb 2016 13:10:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2F0B6E2D0; Mon, 22 Feb 2016 21:10:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id B06AA6E2D0 for ; Mon, 22 Feb 2016 21:10:42 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M8iqK-1afcjD0rkq-00CAN6; Mon, 22 Feb 2016 22:10:39 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 1/8] drm: msm: rename hdmi symbols Date: Mon, 22 Feb 2016 22:08:35 +0100 Message-Id: <1456175331-714117-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:ocEvZyQpy+1X5q0NyOoyl+xVWlgmctex42xmtq5aKaahLAGyQr3 ROKx/srbC+VJ7MvGVnKCvIvQK1cFEvaknMXUQR5G9m4fBz50PFEBxfT2KBpS0vlH4ZZQRfk PeyHHsaPgDgj3b3FcOabfF0wlNkTUwAQueCHJh/CviCfn2rapjsyh5aSjGA9L5X9fQVj3a+ KNm5gOTpZcUgIB/e2aBqw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FwnlTO0C3eY=:M8EYugeFqPBqLntw9mTFOV 2YO7Lkeqr4OdCiGjgE/Igms2EQy2TmgeVgXt2Wj3lALGP4KfPLASVFxHAjdaokn9UUE3lLvkW BVM4gMLriR1T68vZf4zu5uIfEZvSHAmzP9rjjH5d3588Z12yFs84tAWm7zmXPeKuSf3muzBzj 9lTMQJtYHU827mx6Js8BG450x99JaDoC6gTYyM6HjIAqcJuW9KGBMxhtwvugGrX36eq1Gy4p6 dBlcCwplfyJ5ADZBoD6VqtVCTyF/vvRvPj/QeB1sNCiY943jprW1IDgddNx54FXdYnO9EtQ1u 02YHVihdqrmtqFOso7wlXjnQ06mXGdGS4y6hAbXDnPZ9OvZuwSHhEbTzH1Cc8noSS5IsoWelE f4+8v/N38KsSP6/K7LjcYAc0To8ojWT9k3bIqSzsm38cb0Wu0OJsm2b/4PtL6ArJzli+45Nyx fVlnr06qbX2Z+NhyVMnWBwcLa3wXFhzdtDX/gM5O8L6hsALGGtxwKzdwN3lqlaLDPEF9sQ3dP JcKnkqR6DFqen2MOukIqpR8iVvYEYd0HeCFoXnZdDxvSa99WyfTWtphRqiQkWrFCnCEJdda5o YnpVELs7loUcWqC1/Df8GSa4NAQmOq5Oqbt8t1kWHE0ubSqq72EIoj5yFLP0ObjbNfeX4khbn iU/zYYlgsWqxd6e7nMsIiPxJpv9S/dce0kU7TwcklZHZgHI5z4o09sIHCswnqWFjeLY0= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Global symbols in the kernel should be prefixed by the name of the subsystem and/or driver to avoid conflicts when all code is built-in. In this case, function names like 'hdmi_register' or 'hdmi_set_mode' are way too generic for an MSM specific DRM driver, so I'm renaming them all to msm_hdmi_* here. I also rename a lot of the 'static' symbols along with the global names for consistency, even though those are relatively harmless; they might only be slightly confusing when they show up in backtraces. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/hdmi/hdmi.c | 98 +++++++++--------- drivers/gpu/drm/msm/hdmi/hdmi.h | 60 +++++------ drivers/gpu/drm/msm/hdmi/hdmi_audio.c | 10 +- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 56 +++++----- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 34 +++--- drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 166 +++++++++++++++--------------- drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 20 ++-- drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 56 +++++----- drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 4 +- drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c | 2 +- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 4 +- drivers/gpu/drm/msm/msm_drv.h | 12 +-- 17 files changed, 266 insertions(+), 266 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 6002988951b4..3bcfb1ded8b3 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -21,7 +21,7 @@ #include "hdmi.h" -void hdmi_set_mode(struct hdmi *hdmi, bool power_on) +void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on) { uint32_t ctrl = 0; unsigned long flags; @@ -46,26 +46,26 @@ void hdmi_set_mode(struct hdmi *hdmi, bool power_on) power_on ? "Enable" : "Disable", ctrl); } -static irqreturn_t hdmi_irq(int irq, void *dev_id) +static irqreturn_t msm_hdmi_irq(int irq, void *dev_id) { struct hdmi *hdmi = dev_id; /* Process HPD: */ - hdmi_connector_irq(hdmi->connector); + msm_hdmi_connector_irq(hdmi->connector); /* Process DDC: */ - hdmi_i2c_irq(hdmi->i2c); + msm_hdmi_i2c_irq(hdmi->i2c); /* Process HDCP: */ if (hdmi->hdcp_ctrl) - hdmi_hdcp_irq(hdmi->hdcp_ctrl); + msm_hdmi_hdcp_irq(hdmi->hdcp_ctrl); /* TODO audio.. */ return IRQ_HANDLED; } -static void hdmi_destroy(struct hdmi *hdmi) +static void msm_hdmi_destroy(struct hdmi *hdmi) { /* * at this point, hpd has been disabled, @@ -75,7 +75,7 @@ static void hdmi_destroy(struct hdmi *hdmi) flush_workqueue(hdmi->workq); destroy_workqueue(hdmi->workq); } - hdmi_hdcp_destroy(hdmi); + msm_hdmi_hdcp_destroy(hdmi); if (hdmi->phy_dev) { put_device(hdmi->phy_dev); @@ -84,12 +84,12 @@ static void hdmi_destroy(struct hdmi *hdmi) } if (hdmi->i2c) - hdmi_i2c_destroy(hdmi->i2c); + msm_hdmi_i2c_destroy(hdmi->i2c); platform_set_drvdata(hdmi->pdev, NULL); } -static int hdmi_get_phy(struct hdmi *hdmi) +static int msm_hdmi_get_phy(struct hdmi *hdmi) { struct platform_device *pdev = hdmi->pdev; struct platform_device *phy_pdev; @@ -121,7 +121,7 @@ static int hdmi_get_phy(struct hdmi *hdmi) * we are to EPROBE_DEFER we want to do it here, rather than later * at modeset_init() time */ -static struct hdmi *hdmi_init(struct platform_device *pdev) +static struct hdmi *msm_hdmi_init(struct platform_device *pdev) { struct hdmi_platform_config *config = pdev->dev.platform_data; struct hdmi *hdmi = NULL; @@ -240,7 +240,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) hdmi->workq = alloc_ordered_workqueue("msm_hdmi", 0); - hdmi->i2c = hdmi_i2c_init(hdmi); + hdmi->i2c = msm_hdmi_i2c_init(hdmi); if (IS_ERR(hdmi->i2c)) { ret = PTR_ERR(hdmi->i2c); dev_err(&pdev->dev, "failed to get i2c: %d\n", ret); @@ -248,13 +248,13 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) goto fail; } - ret = hdmi_get_phy(hdmi); + ret = msm_hdmi_get_phy(hdmi); if (ret) { dev_err(&pdev->dev, "failed to get phy\n"); goto fail; } - hdmi->hdcp_ctrl = hdmi_hdcp_init(hdmi); + hdmi->hdcp_ctrl = msm_hdmi_hdcp_init(hdmi); if (IS_ERR(hdmi->hdcp_ctrl)) { dev_warn(&pdev->dev, "failed to init hdcp: disabled\n"); hdmi->hdcp_ctrl = NULL; @@ -264,7 +264,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) fail: if (hdmi) - hdmi_destroy(hdmi); + msm_hdmi_destroy(hdmi); return ERR_PTR(ret); } @@ -274,10 +274,10 @@ fail: * driver (not hdmi sub-device's probe/bind!) * * Any resource (regulator/clk/etc) which could be missing at boot - * should be handled in hdmi_init() so that failure happens from + * should be handled in msm_hdmi_init() so that failure happens from * hdmi sub-device's probe. */ -int hdmi_modeset_init(struct hdmi *hdmi, +int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder) { struct msm_drm_private *priv = dev->dev_private; @@ -289,7 +289,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, hdmi_audio_infoframe_init(&hdmi->audio.infoframe); - hdmi->bridge = hdmi_bridge_init(hdmi); + hdmi->bridge = msm_hdmi_bridge_init(hdmi); if (IS_ERR(hdmi->bridge)) { ret = PTR_ERR(hdmi->bridge); dev_err(dev->dev, "failed to create HDMI bridge: %d\n", ret); @@ -297,7 +297,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, goto fail; } - hdmi->connector = hdmi_connector_init(hdmi); + hdmi->connector = msm_hdmi_connector_init(hdmi); if (IS_ERR(hdmi->connector)) { ret = PTR_ERR(hdmi->connector); dev_err(dev->dev, "failed to create HDMI connector: %d\n", ret); @@ -313,7 +313,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, } ret = devm_request_irq(&pdev->dev, hdmi->irq, - hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + msm_hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "hdmi_isr", hdmi); if (ret < 0) { dev_err(dev->dev, "failed to request IRQ%u: %d\n", @@ -333,7 +333,7 @@ int hdmi_modeset_init(struct hdmi *hdmi, fail: /* bridge is normally destroyed by drm: */ if (hdmi->bridge) { - hdmi_bridge_destroy(hdmi->bridge); + msm_hdmi_bridge_destroy(hdmi->bridge); hdmi->bridge = NULL; } if (hdmi->connector) { @@ -410,7 +410,7 @@ static const struct { const bool output; const int value; const char *label; -} hdmi_gpio_pdata[] = { +} msm_hdmi_gpio_pdata[] = { { "qcom,hdmi-tx-ddc-clk", true, 1, "HDMI_DDC_CLK" }, { "qcom,hdmi-tx-ddc-data", true, 1, "HDMI_DDC_DATA" }, { "qcom,hdmi-tx-hpd", false, 1, "HDMI_HPD" }, @@ -419,7 +419,7 @@ static const struct { { "qcom,hdmi-tx-mux-lpm", true, 1, "HDMI_MUX_LPM" }, }; -static int get_gpio(struct device_node *of_node, const char *name) +static int msm_hdmi_get_gpio(struct device_node *of_node, const char *name) { int gpio = of_get_named_gpio(of_node, name, 0); if (gpio < 0) { @@ -434,7 +434,7 @@ static int get_gpio(struct device_node *of_node, const char *name) return gpio; } -static int hdmi_bind(struct device *dev, struct device *master, void *data) +static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) { struct drm_device *drm = dev_get_drvdata(master); struct msm_drm_private *priv = drm->dev_private; @@ -454,16 +454,16 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) hdmi_cfg->qfprom_mmio_name = "qfprom_physical"; for (i = 0; i < HDMI_MAX_NUM_GPIO; i++) { - hdmi_cfg->gpios[i].num = get_gpio(of_node, - hdmi_gpio_pdata[i].name); - hdmi_cfg->gpios[i].output = hdmi_gpio_pdata[i].output; - hdmi_cfg->gpios[i].value = hdmi_gpio_pdata[i].value; - hdmi_cfg->gpios[i].label = hdmi_gpio_pdata[i].label; + hdmi_cfg->gpios[i].num = msm_hdmi_get_gpio(of_node, + msm_hdmi_gpio_pdata[i].name); + hdmi_cfg->gpios[i].output = msm_hdmi_gpio_pdata[i].output; + hdmi_cfg->gpios[i].value = msm_hdmi_gpio_pdata[i].value; + hdmi_cfg->gpios[i].label = msm_hdmi_gpio_pdata[i].label; } dev->platform_data = hdmi_cfg; - hdmi = hdmi_init(to_platform_device(dev)); + hdmi = msm_hdmi_init(to_platform_device(dev)); if (IS_ERR(hdmi)) return PTR_ERR(hdmi); priv->hdmi = hdmi; @@ -471,34 +471,34 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) return 0; } -static void hdmi_unbind(struct device *dev, struct device *master, +static void msm_hdmi_unbind(struct device *dev, struct device *master, void *data) { struct drm_device *drm = dev_get_drvdata(master); struct msm_drm_private *priv = drm->dev_private; if (priv->hdmi) { - hdmi_destroy(priv->hdmi); + msm_hdmi_destroy(priv->hdmi); priv->hdmi = NULL; } } -static const struct component_ops hdmi_ops = { - .bind = hdmi_bind, - .unbind = hdmi_unbind, +static const struct component_ops msm_hdmi_ops = { + .bind = msm_hdmi_bind, + .unbind = msm_hdmi_unbind, }; -static int hdmi_dev_probe(struct platform_device *pdev) +static int msm_hdmi_dev_probe(struct platform_device *pdev) { - return component_add(&pdev->dev, &hdmi_ops); + return component_add(&pdev->dev, &msm_hdmi_ops); } -static int hdmi_dev_remove(struct platform_device *pdev) +static int msm_hdmi_dev_remove(struct platform_device *pdev) { - component_del(&pdev->dev, &hdmi_ops); + component_del(&pdev->dev, &msm_hdmi_ops); return 0; } -static const struct of_device_id dt_match[] = { +static const struct of_device_id msm_hdmi_dt_match[] = { { .compatible = "qcom,hdmi-tx-8996", .data = &hdmi_tx_8996_config }, { .compatible = "qcom,hdmi-tx-8994", .data = &hdmi_tx_8994_config }, { .compatible = "qcom,hdmi-tx-8084", .data = &hdmi_tx_8084_config }, @@ -508,23 +508,23 @@ static const struct of_device_id dt_match[] = { {} }; -static struct platform_driver hdmi_driver = { - .probe = hdmi_dev_probe, - .remove = hdmi_dev_remove, +static struct platform_driver msm_hdmi_driver = { + .probe = msm_hdmi_dev_probe, + .remove = msm_hdmi_dev_remove, .driver = { .name = "hdmi_msm", - .of_match_table = dt_match, + .of_match_table = msm_hdmi_dt_match, }, }; -void __init hdmi_register(void) +void __init msm_hdmi_register(void) { - hdmi_phy_driver_register(); - platform_driver_register(&hdmi_driver); + msm_hdmi_phy_driver_register(); + platform_driver_register(&msm_hdmi_driver); } -void __exit hdmi_unregister(void) +void __exit msm_hdmi_unregister(void) { - platform_driver_unregister(&hdmi_driver); - hdmi_phy_driver_unregister(); + platform_driver_unregister(&msm_hdmi_driver); + msm_hdmi_phy_driver_unregister(); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index 88557e59f750..b04a64664673 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -122,7 +122,7 @@ struct hdmi_platform_config { struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO]; }; -void hdmi_set_mode(struct hdmi *hdmi, bool power_on); +void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on); static inline void hdmi_write(struct hdmi *hdmi, u32 reg, u32 data) { @@ -161,10 +161,10 @@ struct hdmi_phy_cfg { int num_clks; }; -extern const struct hdmi_phy_cfg hdmi_phy_8x60_cfg; -extern const struct hdmi_phy_cfg hdmi_phy_8960_cfg; -extern const struct hdmi_phy_cfg hdmi_phy_8x74_cfg; -extern const struct hdmi_phy_cfg hdmi_phy_8996_cfg; +extern const struct hdmi_phy_cfg msm_hdmi_phy_8x60_cfg; +extern const struct hdmi_phy_cfg msm_hdmi_phy_8960_cfg; +extern const struct hdmi_phy_cfg msm_hdmi_phy_8x74_cfg; +extern const struct hdmi_phy_cfg msm_hdmi_phy_8996_cfg; struct hdmi_phy { struct platform_device *pdev; @@ -185,23 +185,23 @@ static inline u32 hdmi_phy_read(struct hdmi_phy *phy, u32 reg) return msm_readl(phy->mmio + reg); } -int hdmi_phy_resource_enable(struct hdmi_phy *phy); -void hdmi_phy_resource_disable(struct hdmi_phy *phy); -void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock); -void hdmi_phy_powerdown(struct hdmi_phy *phy); -void __init hdmi_phy_driver_register(void); -void __exit hdmi_phy_driver_unregister(void); +int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy); +void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy); +void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock); +void msm_hdmi_phy_powerdown(struct hdmi_phy *phy); +void __init msm_hdmi_phy_driver_register(void); +void __exit msm_hdmi_phy_driver_unregister(void); #ifdef CONFIG_COMMON_CLK -int hdmi_pll_8960_init(struct platform_device *pdev); -int hdmi_pll_8996_init(struct platform_device *pdev); +int msm_hdmi_pll_8960_init(struct platform_device *pdev); +int msm_hdmi_pll_8996_init(struct platform_device *pdev); #else -int hdmi_pll_8960_init(struct platform_device *pdev); +static inline int msm_hdmi_pll_8960_init(struct platform_device *pdev); { return -ENODEV; } -int hdmi_pll_8996_init(struct platform_device *pdev) +static inline int msm_hdmi_pll_8996_init(struct platform_device *pdev) { return -ENODEV; } @@ -211,42 +211,42 @@ int hdmi_pll_8996_init(struct platform_device *pdev) * audio: */ -int hdmi_audio_update(struct hdmi *hdmi); -int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, +int msm_hdmi_audio_update(struct hdmi *hdmi); +int msm_hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, uint32_t num_of_channels, uint32_t channel_allocation, uint32_t level_shift, bool down_mix); -void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate); +void msm_hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate); /* * hdmi bridge: */ -struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi); -void hdmi_bridge_destroy(struct drm_bridge *bridge); +struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi); +void msm_hdmi_bridge_destroy(struct drm_bridge *bridge); /* * hdmi connector: */ -void hdmi_connector_irq(struct drm_connector *connector); -struct drm_connector *hdmi_connector_init(struct hdmi *hdmi); +void msm_hdmi_connector_irq(struct drm_connector *connector); +struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi); /* * i2c adapter for ddc: */ -void hdmi_i2c_irq(struct i2c_adapter *i2c); -void hdmi_i2c_destroy(struct i2c_adapter *i2c); -struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi); +void msm_hdmi_i2c_irq(struct i2c_adapter *i2c); +void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c); +struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi); /* * hdcp */ -struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi); -void hdmi_hdcp_destroy(struct hdmi *hdmi); -void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl); -void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl); -void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl); +struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi); +void msm_hdmi_hdcp_destroy(struct hdmi *hdmi); +void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl); +void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl); +void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl); #endif /* __HDMI_CONNECTOR_H__ */ diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_audio.c b/drivers/gpu/drm/msm/hdmi/hdmi_audio.c index df232e20c13e..a54d3bb5baad 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_audio.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_audio.c @@ -89,7 +89,7 @@ static const struct hdmi_msm_audio_arcs *get_arcs(unsigned long int pixclock) return NULL; } -int hdmi_audio_update(struct hdmi *hdmi) +int msm_hdmi_audio_update(struct hdmi *hdmi) { struct hdmi_audio *audio = &hdmi->audio; struct hdmi_audio_infoframe *info = &audio->infoframe; @@ -232,7 +232,7 @@ int hdmi_audio_update(struct hdmi *hdmi) return 0; } -int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, +int msm_hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, uint32_t num_of_channels, uint32_t channel_allocation, uint32_t level_shift, bool down_mix) { @@ -252,10 +252,10 @@ int hdmi_audio_info_setup(struct hdmi *hdmi, bool enabled, audio->infoframe.level_shift_value = level_shift; audio->infoframe.downmix_inhibit = down_mix; - return hdmi_audio_update(hdmi); + return msm_hdmi_audio_update(hdmi); } -void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) +void msm_hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) { struct hdmi_audio *audio; @@ -268,5 +268,5 @@ void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate) return; audio->rate = rate; - hdmi_audio_update(hdmi); + msm_hdmi_audio_update(hdmi); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 310d92d06229..bacbd5d8df0e 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -23,11 +23,11 @@ struct hdmi_bridge { }; #define to_hdmi_bridge(x) container_of(x, struct hdmi_bridge, base) -void hdmi_bridge_destroy(struct drm_bridge *bridge) +void msm_hdmi_bridge_destroy(struct drm_bridge *bridge) { } -static void power_on(struct drm_bridge *bridge) +static void msm_hdmi_power_on(struct drm_bridge *bridge) { struct drm_device *dev = bridge->dev; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); @@ -86,7 +86,7 @@ static void power_off(struct drm_bridge *bridge) } } -static void hdmi_bridge_pre_enable(struct drm_bridge *bridge) +static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; @@ -95,51 +95,51 @@ static void hdmi_bridge_pre_enable(struct drm_bridge *bridge) DBG("power up"); if (!hdmi->power_on) { - hdmi_phy_resource_enable(phy); - power_on(bridge); + msm_hdmi_phy_resource_enable(phy); + msm_hdmi_power_on(bridge); hdmi->power_on = true; - hdmi_audio_update(hdmi); + msm_hdmi_audio_update(hdmi); } - hdmi_phy_powerup(phy, hdmi->pixclock); + msm_hdmi_phy_powerup(phy, hdmi->pixclock); - hdmi_set_mode(hdmi, true); + msm_hdmi_set_mode(hdmi, true); if (hdmi->hdcp_ctrl) - hdmi_hdcp_on(hdmi->hdcp_ctrl); + msm_hdmi_hdcp_on(hdmi->hdcp_ctrl); } -static void hdmi_bridge_enable(struct drm_bridge *bridge) +static void msm_hdmi_bridge_enable(struct drm_bridge *bridge) { } -static void hdmi_bridge_disable(struct drm_bridge *bridge) +static void msm_hdmi_bridge_disable(struct drm_bridge *bridge) { } -static void hdmi_bridge_post_disable(struct drm_bridge *bridge) +static void msm_hdmi_bridge_post_disable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; struct hdmi_phy *phy = hdmi->phy; if (hdmi->hdcp_ctrl) - hdmi_hdcp_off(hdmi->hdcp_ctrl); + msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); DBG("power down"); - hdmi_set_mode(hdmi, false); + msm_hdmi_set_mode(hdmi, false); - hdmi_phy_powerdown(phy); + msm_hdmi_phy_powerdown(phy); if (hdmi->power_on) { power_off(bridge); hdmi->power_on = false; - hdmi_audio_update(hdmi); - hdmi_phy_resource_disable(phy); + msm_hdmi_audio_update(hdmi); + msm_hdmi_phy_resource_disable(phy); } } -static void hdmi_bridge_mode_set(struct drm_bridge *bridge, +static void msm_hdmi_bridge_mode_set(struct drm_bridge *bridge, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { @@ -196,20 +196,20 @@ static void hdmi_bridge_mode_set(struct drm_bridge *bridge, DBG("frame_ctrl=%08x", frame_ctrl); hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); - hdmi_audio_update(hdmi); + msm_hdmi_audio_update(hdmi); } -static const struct drm_bridge_funcs hdmi_bridge_funcs = { - .pre_enable = hdmi_bridge_pre_enable, - .enable = hdmi_bridge_enable, - .disable = hdmi_bridge_disable, - .post_disable = hdmi_bridge_post_disable, - .mode_set = hdmi_bridge_mode_set, +static const struct drm_bridge_funcs msm_hdmi_bridge_funcs = { + .pre_enable = msm_hdmi_bridge_pre_enable, + .enable = msm_hdmi_bridge_enable, + .disable = msm_hdmi_bridge_disable, + .post_disable = msm_hdmi_bridge_post_disable, + .mode_set = msm_hdmi_bridge_mode_set, }; /* initialize bridge */ -struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) +struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) { struct drm_bridge *bridge = NULL; struct hdmi_bridge *hdmi_bridge; @@ -225,7 +225,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge->hdmi = hdmi; bridge = &hdmi_bridge->base; - bridge->funcs = &hdmi_bridge_funcs; + bridge->funcs = &msm_hdmi_bridge_funcs; ret = drm_bridge_attach(hdmi->dev, bridge); if (ret) @@ -235,7 +235,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) fail: if (bridge) - hdmi_bridge_destroy(bridge); + msm_hdmi_bridge_destroy(bridge); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index 3973d4644679..26129bff2dd6 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -28,7 +28,7 @@ struct hdmi_connector { }; #define to_hdmi_connector(x) container_of(x, struct hdmi_connector, base) -static void hdmi_phy_reset(struct hdmi *hdmi) +static void msm_hdmi_phy_reset(struct hdmi *hdmi) { unsigned int val; @@ -179,9 +179,9 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) } } - hdmi_set_mode(hdmi, false); - hdmi_phy_reset(hdmi); - hdmi_set_mode(hdmi, true); + msm_hdmi_set_mode(hdmi, false); + msm_hdmi_phy_reset(hdmi); + msm_hdmi_set_mode(hdmi, true); hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); @@ -218,7 +218,7 @@ static void hdp_disable(struct hdmi_connector *hdmi_connector) /* Disable HPD interrupt */ hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); - hdmi_set_mode(hdmi, false); + msm_hdmi_set_mode(hdmi, false); for (i = 0; i < config->hpd_clk_cnt; i++) clk_disable_unprepare(hdmi->hpd_clks[i]); @@ -240,7 +240,7 @@ static void hdp_disable(struct hdmi_connector *hdmi_connector) } static void -hotplug_work(struct work_struct *work) +msm_hdmi_hotplug_work(struct work_struct *work) { struct hdmi_connector *hdmi_connector = container_of(work, struct hdmi_connector, hpd_work); @@ -248,7 +248,7 @@ hotplug_work(struct work_struct *work) drm_helper_hpd_irq_event(connector->dev); } -void hdmi_connector_irq(struct drm_connector *connector) +void msm_hdmi_connector_irq(struct drm_connector *connector) { struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); struct hdmi *hdmi = hdmi_connector->hdmi; @@ -347,7 +347,7 @@ static void hdmi_connector_destroy(struct drm_connector *connector) kfree(hdmi_connector); } -static int hdmi_connector_get_modes(struct drm_connector *connector) +static int msm_hdmi_connector_get_modes(struct drm_connector *connector) { struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); struct hdmi *hdmi = hdmi_connector->hdmi; @@ -373,7 +373,7 @@ static int hdmi_connector_get_modes(struct drm_connector *connector) return ret; } -static int hdmi_connector_mode_valid(struct drm_connector *connector, +static int msm_hdmi_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); @@ -403,7 +403,7 @@ static int hdmi_connector_mode_valid(struct drm_connector *connector, } static struct drm_encoder * -hdmi_connector_best_encoder(struct drm_connector *connector) +msm_hdmi_connector_best_encoder(struct drm_connector *connector) { struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); return hdmi_connector->hdmi->encoder; @@ -419,14 +419,14 @@ static const struct drm_connector_funcs hdmi_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; -static const struct drm_connector_helper_funcs hdmi_connector_helper_funcs = { - .get_modes = hdmi_connector_get_modes, - .mode_valid = hdmi_connector_mode_valid, - .best_encoder = hdmi_connector_best_encoder, +static const struct drm_connector_helper_funcs msm_hdmi_connector_helper_funcs = { + .get_modes = msm_hdmi_connector_get_modes, + .mode_valid = msm_hdmi_connector_mode_valid, + .best_encoder = msm_hdmi_connector_best_encoder, }; /* initialize connector */ -struct drm_connector *hdmi_connector_init(struct hdmi *hdmi) +struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) { struct drm_connector *connector = NULL; struct hdmi_connector *hdmi_connector; @@ -439,13 +439,13 @@ struct drm_connector *hdmi_connector_init(struct hdmi *hdmi) } hdmi_connector->hdmi = hdmi; - INIT_WORK(&hdmi_connector->hpd_work, hotplug_work); + INIT_WORK(&hdmi_connector->hpd_work, msm_hdmi_hotplug_work); connector = &hdmi_connector->base; drm_connector_init(hdmi->dev, connector, &hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA); - drm_connector_helper_add(connector, &hdmi_connector_helper_funcs); + drm_connector_helper_add(connector, &msm_hdmi_connector_helper_funcs); connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c index 1dc9c34eb0df..0baaaaabd002 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c @@ -84,7 +84,7 @@ struct hdmi_hdcp_ctrl { bool max_dev_exceeded; }; -static int hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset, +static int msm_hdmi_ddc_read(struct hdmi *hdmi, u16 addr, u8 offset, u8 *data, u16 data_len) { int rc; @@ -122,7 +122,7 @@ retry: #define HDCP_DDC_WRITE_MAX_BYTE_NUM 32 -static int hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset, +static int msm_hdmi_ddc_write(struct hdmi *hdmi, u16 addr, u8 offset, u8 *data, u16 data_len) { int rc; @@ -162,7 +162,7 @@ retry: return rc; } -static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, +static int msm_hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, u32 *pdata, u32 count) { struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -202,7 +202,7 @@ static int hdmi_hdcp_scm_wr(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 *preg, return ret; } -void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) +void msm_hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg_val, hdcp_int_status; @@ -247,7 +247,7 @@ void hdmi_hdcp_irq(struct hdmi_hdcp_ctrl *hdcp_ctrl) } } -static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) +static int msm_hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) { int rc; @@ -264,7 +264,7 @@ static int hdmi_hdcp_msleep(struct hdmi_hdcp_ctrl *hdcp_ctrl, u32 ms, u32 ev) return 0; } -static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -287,7 +287,7 @@ static int hdmi_hdcp_read_validate_aksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg_val, failure, nack0; @@ -337,7 +337,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) reg_val |= HDMI_DDC_CTRL_SW_STATUS_RESET; hdmi_write(hdmi, REG_HDMI_DDC_CTRL, reg_val); - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); reg_val &= ~HDMI_DDC_CTRL_SW_STATUS_RESET; @@ -350,7 +350,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) /* If previous msleep is aborted, skip this msleep */ if (!rc) - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); reg_val = hdmi_read(hdmi, REG_HDMI_DDC_CTRL); reg_val &= ~HDMI_DDC_CTRL_SOFT_RESET; @@ -362,7 +362,7 @@ static int reset_hdcp_ddc_failures(struct hdmi_hdcp_ctrl *hdcp_ctrl) return rc; } -static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; u32 hdcp_ddc_status, ddc_hw_status; @@ -394,7 +394,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); @@ -402,7 +402,7 @@ static int hdmi_hdcp_hw_ddc_clean(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static void hdmi_hdcp_reauth_work(struct work_struct *work) +static void msm_hdmi_hdcp_reauth_work(struct work_struct *work) { struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, struct hdmi_hdcp_ctrl, hdcp_reauth_work); @@ -430,7 +430,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work) HDMI_HDCP_RESET_LINK0_DEAUTHENTICATE); /* Wait to be clean on DDC HW engine */ - if (hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) { + if (msm_hdmi_hdcp_hw_ddc_clean(hdcp_ctrl)) { pr_info("%s: reauth work aborted\n", __func__); return; } @@ -461,7 +461,7 @@ static void hdmi_hdcp_reauth_work(struct work_struct *work) queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); } -static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 link0_status; @@ -470,7 +470,7 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) int rc; if (!hdcp_ctrl->aksv_valid) { - rc = hdmi_hdcp_read_validate_aksv(hdcp_ctrl); + rc = msm_hdmi_hdcp_read_validate_aksv(hdcp_ctrl); if (rc) { pr_err("%s: ASKV validation failed\n", __func__); hdcp_ctrl->hdcp_state = HDCP_STATE_NO_AKSV; @@ -538,12 +538,12 @@ static int hdmi_hdcp_auth_prepare(struct hdmi_hdcp_ctrl *hdcp_ctrl) DBG("An not ready after enabling HDCP"); /* Clear any DDC failures from previous tries before enable HDCP*/ - rc = reset_hdcp_ddc_failures(hdcp_ctrl); + rc = msm_reset_hdcp_ddc_failures(hdcp_ctrl); return rc; } -static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static void msm_hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg_val; @@ -561,7 +561,7 @@ static void hdmi_hdcp_auth_fail(struct hdmi_hdcp_ctrl *hdcp_ctrl) queue_work(hdmi->workq, &hdcp_ctrl->hdcp_reauth_work); } -static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static void msm_hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg_val; @@ -596,7 +596,7 @@ static void hdmi_hdcp_auth_done(struct hdmi_hdcp_ctrl *hdcp_ctrl) * Write An and AKSV to sink * Read BKSV from sink and write into HDCP engine */ -static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -621,7 +621,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); @@ -643,7 +643,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); @@ -651,7 +651,7 @@ static int hdmi_hdcp_wait_key_an_ready(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc = 0; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -676,7 +676,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) aksv[4] = link0_aksv_1 & 0xFF; /* Write An to offset 0x18 */ - rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an, + rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x18, (u8 *)link0_an, (u16)sizeof(link0_an)); if (rc) { pr_err("%s:An write failed\n", __func__); @@ -685,7 +685,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) DBG("Link0-An=%08x%08x", link0_an[0], link0_an[1]); /* Write AKSV to offset 0x10 */ - rc = hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5); + rc = msm_hdmi_ddc_write(hdmi, HDCP_PORT_ADDR, 0x10, aksv, 5); if (rc) { pr_err("%s:AKSV write failed\n", __func__); return rc; @@ -695,7 +695,7 @@ static int hdmi_hdcp_send_aksv_an(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc = 0; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -703,7 +703,7 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) u32 reg[2], data[2]; /* Read BKSV at offset 0x00 */ - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5); + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x00, bksv, 5); if (rc) { pr_err("%s:BKSV read failed\n", __func__); return rc; @@ -728,19 +728,19 @@ static int hdmi_hdcp_recv_bksv(struct hdmi_hdcp_ctrl *hdcp_ctrl) data[0] = hdcp_ctrl->bksv_lsb; reg[1] = REG_HDMI_HDCP_RCVPORT_DATA1; data[1] = hdcp_ctrl->bksv_msb; - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); return rc; } -static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc = 0; struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg, data; u8 bcaps; - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); if (rc) { pr_err("%s:BCAPS read failed\n", __func__); return rc; @@ -753,26 +753,26 @@ static int hdmi_hdcp_recv_bcaps(struct hdmi_hdcp_ctrl *hdcp_ctrl) /* Write BCAPS to the hardware */ reg = REG_HDMI_HDCP_RCVPORT_DATA12; data = (u32)bcaps; - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); return rc; } -static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; unsigned long flags; int rc; /* Wait for AKSV key and An ready */ - rc = hdmi_hdcp_wait_key_an_ready(hdcp_ctrl); + rc = msm_hdmi_hdcp_wait_key_an_ready(hdcp_ctrl); if (rc) { pr_err("%s: wait key and an ready failed\n", __func__); return rc; }; /* Read BCAPS and send to HDCP engine */ - rc = hdmi_hdcp_recv_bcaps(hdcp_ctrl); + rc = msm_hdmi_hdcp_recv_bcaps(hdcp_ctrl); if (rc) { pr_err("%s: read bcaps error, abort\n", __func__); return rc; @@ -785,14 +785,14 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) hdmi_write(hdmi, REG_HDMI_HDCP_RCVPORT_DATA4, 0); /* Send AKSV and An to sink */ - rc = hdmi_hdcp_send_aksv_an(hdcp_ctrl); + rc = msm_hdmi_hdcp_send_aksv_an(hdcp_ctrl); if (rc) { pr_err("%s:An/Aksv write failed\n", __func__); return rc; } /* Read BKSV and send to HDCP engine*/ - rc = hdmi_hdcp_recv_bksv(hdcp_ctrl); + rc = msm_hdmi_hdcp_recv_bksv(hdcp_ctrl); if (rc) { pr_err("%s:BKSV Process failed\n", __func__); return rc; @@ -812,7 +812,7 @@ static int hdmi_hdcp_auth_part1_key_exchange(struct hdmi_hdcp_ctrl *hdcp_ctrl) } /* read R0' from sink and pass it to HDCP engine */ -static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; int rc = 0; @@ -822,12 +822,12 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) * HDCP Compliance Test case 1A-01: * Wait here at least 100ms before reading R0' */ - rc = hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 125, AUTH_ABORT_EV); if (rc) return rc; /* Read R0' at offset 0x08 */ - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2); + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x08, buf, 2); if (rc) { pr_err("%s:R0' read failed\n", __func__); return rc; @@ -842,14 +842,14 @@ static int hdmi_hdcp_auth_part1_recv_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) } /* Wait for authenticating result: R0/R0' are matched or not */ -static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 link0_status; int rc; /* wait for hdcp irq, 10 sec should be long enough */ - rc = hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 10000, AUTH_RESULT_RDY_EV); if (!rc) { pr_err("%s: Wait Auth IRQ timeout\n", __func__); return -ETIMEDOUT; @@ -869,7 +869,7 @@ static int hdmi_hdcp_auth_part1_verify_r0(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, +static int msm_hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, u16 *pbstatus) { int rc; @@ -880,7 +880,7 @@ static int hdmi_hdcp_recv_check_bstatus(struct hdmi_hdcp_ctrl *hdcp_ctrl, u8 buf[2]; /* Read BSTATUS at offset 0x41 */ - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2); + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x41, buf, 2); if (rc) { pr_err("%s: BSTATUS read failed\n", __func__); goto error; @@ -936,7 +936,7 @@ error: return rc; } -static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( +static int msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; @@ -953,7 +953,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( timeout_count = 100; do { /* Read BCAPS at offset 0x40 */ - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x40, &bcaps, 1); if (rc) { pr_err("%s: BCAPS read failed\n", __func__); return rc; @@ -968,12 +968,12 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); - rc = hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus); + rc = msm_hdmi_hdcp_recv_check_bstatus(hdcp_ctrl, &bstatus); if (rc) { pr_err("%s: bstatus error\n", __func__); return rc; @@ -982,7 +982,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( /* Write BSTATUS and BCAPS to HDCP registers */ reg = REG_HDMI_HDCP_RCVPORT_DATA12; data = bcaps | (bstatus << 8); - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); if (rc) { pr_err("%s: BSTATUS write failed\n", __func__); return rc; @@ -997,7 +997,7 @@ static int hdmi_hdcp_auth_part2_wait_ksv_fifo_ready( * transfer V' from sink to HDCP engine * reset SHA engine */ -static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; int rc = 0; @@ -1016,7 +1016,7 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) for (i = 0; i < size; i++) { rd = ®_data[i]; - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, rd->off, (u8 *)&data[i], (u16)sizeof(data[i])); if (rc) { pr_err("%s: Read %s failed\n", __func__, rd->name); @@ -1027,13 +1027,13 @@ static int hdmi_hdcp_transfer_v_h(struct hdmi_hdcp_ctrl *hdcp_ctrl) reg[i] = reg_data[i].reg_id; } - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, size); error: return rc; } -static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -1041,7 +1041,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) ksv_bytes = 5 * hdcp_ctrl->dev_count; - rc = hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43, + rc = msm_hdmi_ddc_read(hdmi, HDCP_PORT_ADDR, 0x43, hdcp_ctrl->ksv_list, ksv_bytes); if (rc) pr_err("%s: KSV FIFO read failed\n", __func__); @@ -1049,7 +1049,7 @@ static int hdmi_hdcp_recv_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) return rc; } -static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) { u32 reg[2], data[2]; u32 rc = 0; @@ -1059,12 +1059,12 @@ static int hdmi_hdcp_reset_sha_engine(struct hdmi_hdcp_ctrl *hdcp_ctrl) reg[1] = REG_HDMI_HDCP_SHA_CTRL; data[1] = HDCP_REG_DISABLE; - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, reg, data, 2); return rc; } -static int hdmi_hdcp_auth_part2_recv_ksv_fifo( +static int msm_hdmi_hdcp_auth_part2_recv_ksv_fifo( struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; @@ -1081,7 +1081,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( */ timeout_count = 100; do { - rc = hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl); + rc = msm_hdmi_hdcp_recv_ksv_fifo(hdcp_ctrl); if (!rc) break; @@ -1091,19 +1091,19 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 25, AUTH_ABORT_EV); if (rc) return rc; } while (1); - rc = hdmi_hdcp_transfer_v_h(hdcp_ctrl); + rc = msm_hdmi_hdcp_transfer_v_h(hdcp_ctrl); if (rc) { pr_err("%s: transfer V failed\n", __func__); return rc; } /* reset SHA engine before write ksv fifo */ - rc = hdmi_hdcp_reset_sha_engine(hdcp_ctrl); + rc = msm_hdmi_hdcp_reset_sha_engine(hdcp_ctrl); if (rc) { pr_err("%s: fail to reset sha engine\n", __func__); return rc; @@ -1120,7 +1120,7 @@ static int hdmi_hdcp_auth_part2_recv_ksv_fifo( * If the last byte is written, we need to poll for * HDCP_SHA_COMP_DONE to wait until HW finish */ -static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int i; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -1169,7 +1169,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) reg = REG_HDMI_HDCP_SHA_DATA; data = reg_val; - rc = hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); + rc = msm_hdmi_hdcp_scm_wr(hdcp_ctrl, ®, &data, 1); if (rc) return rc; @@ -1184,7 +1184,7 @@ static int hdmi_hdcp_write_ksv_fifo(struct hdmi_hdcp_ctrl *hdcp_ctrl) } /* write ksv fifo into HDCP engine */ -static int hdmi_hdcp_auth_part2_write_ksv_fifo( +static int msm_hdmi_hdcp_auth_part2_write_ksv_fifo( struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc; @@ -1193,7 +1193,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( hdcp_ctrl->ksv_fifo_w_index = 0; timeout_count = 100; do { - rc = hdmi_hdcp_write_ksv_fifo(hdcp_ctrl); + rc = msm_hdmi_hdcp_write_ksv_fifo(hdcp_ctrl); if (!rc) break; @@ -1206,7 +1206,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); @@ -1214,7 +1214,7 @@ static int hdmi_hdcp_auth_part2_write_ksv_fifo( return 0; } -static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) +static int msm_hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) { int rc = 0; struct hdmi *hdmi = hdcp_ctrl->hdmi; @@ -1232,7 +1232,7 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) return -ETIMEDOUT; } - rc = hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); + rc = msm_hdmi_hdcp_msleep(hdcp_ctrl, 20, AUTH_ABORT_EV); if (rc) return rc; } while (1); @@ -1240,32 +1240,32 @@ static int hdmi_hdcp_auth_part2_check_v_match(struct hdmi_hdcp_ctrl *hdcp_ctrl) return 0; } -static void hdmi_hdcp_auth_work(struct work_struct *work) +static void msm_hdmi_hdcp_auth_work(struct work_struct *work) { struct hdmi_hdcp_ctrl *hdcp_ctrl = container_of(work, struct hdmi_hdcp_ctrl, hdcp_auth_work); int rc; - rc = hdmi_hdcp_auth_prepare(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_prepare(hdcp_ctrl); if (rc) { pr_err("%s: auth prepare failed %d\n", __func__, rc); goto end; } /* HDCP PartI */ - rc = hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part1_key_exchange(hdcp_ctrl); if (rc) { pr_err("%s: key exchange failed %d\n", __func__, rc); goto end; } - rc = hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part1_recv_r0(hdcp_ctrl); if (rc) { pr_err("%s: receive r0 failed %d\n", __func__, rc); goto end; } - rc = hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part1_verify_r0(hdcp_ctrl); if (rc) { pr_err("%s: verify r0 failed %d\n", __func__, rc); goto end; @@ -1275,25 +1275,25 @@ static void hdmi_hdcp_auth_work(struct work_struct *work) goto end; /* HDCP PartII */ - rc = hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part2_wait_ksv_fifo_ready(hdcp_ctrl); if (rc) { pr_err("%s: wait ksv fifo ready failed %d\n", __func__, rc); goto end; } - rc = hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part2_recv_ksv_fifo(hdcp_ctrl); if (rc) { pr_err("%s: recv ksv fifo failed %d\n", __func__, rc); goto end; } - rc = hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part2_write_ksv_fifo(hdcp_ctrl); if (rc) { pr_err("%s: write ksv fifo failed %d\n", __func__, rc); goto end; } - rc = hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl); + rc = msm_hdmi_hdcp_auth_part2_check_v_match(hdcp_ctrl); if (rc) pr_err("%s: check v match failed %d\n", __func__, rc); @@ -1304,13 +1304,13 @@ end: pr_info("%s: hdcp is not supported\n", __func__); } else if (rc) { pr_err("%s: hdcp authentication failed\n", __func__); - hdmi_hdcp_auth_fail(hdcp_ctrl); + msm_hdmi_hdcp_auth_fail(hdcp_ctrl); } else { - hdmi_hdcp_auth_done(hdcp_ctrl); + msm_hdmi_hdcp_auth_done(hdcp_ctrl); } } -void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) +void msm_hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; u32 reg_val; @@ -1335,7 +1335,7 @@ void hdmi_hdcp_on(struct hdmi_hdcp_ctrl *hdcp_ctrl) queue_work(hdmi->workq, &hdcp_ctrl->hdcp_auth_work); } -void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) +void msm_hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) { struct hdmi *hdmi = hdcp_ctrl->hdmi; unsigned long flags; @@ -1399,7 +1399,7 @@ void hdmi_hdcp_off(struct hdmi_hdcp_ctrl *hdcp_ctrl) DBG("HDCP: Off"); } -struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) +struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi) { struct hdmi_hdcp_ctrl *hdcp_ctrl = NULL; @@ -1413,8 +1413,8 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) if (!hdcp_ctrl) return ERR_PTR(-ENOMEM); - INIT_WORK(&hdcp_ctrl->hdcp_auth_work, hdmi_hdcp_auth_work); - INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, hdmi_hdcp_reauth_work); + INIT_WORK(&hdcp_ctrl->hdcp_auth_work, msm_hdmi_hdcp_auth_work); + INIT_WORK(&hdcp_ctrl->hdcp_reauth_work, msm_hdmi_hdcp_reauth_work); init_waitqueue_head(&hdcp_ctrl->auth_event_queue); hdcp_ctrl->hdmi = hdmi; hdcp_ctrl->hdcp_state = HDCP_STATE_INACTIVE; @@ -1428,7 +1428,7 @@ struct hdmi_hdcp_ctrl *hdmi_hdcp_init(struct hdmi *hdmi) return hdcp_ctrl; } -void hdmi_hdcp_destroy(struct hdmi *hdmi) +void msm_hdmi_hdcp_destroy(struct hdmi *hdmi) { if (hdmi && hdmi->hdcp_ctrl) { kfree(hdmi->hdcp_ctrl); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index f4ab7f70fed1..de9007e72f4e 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -97,7 +97,7 @@ static bool sw_done(struct hdmi_i2c_adapter *hdmi_i2c) return hdmi_i2c->sw_done; } -static int hdmi_i2c_xfer(struct i2c_adapter *i2c, +static int msm_hdmi_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs, int num) { struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); @@ -216,17 +216,17 @@ static int hdmi_i2c_xfer(struct i2c_adapter *i2c, return i; } -static u32 hdmi_i2c_func(struct i2c_adapter *adapter) +static u32 msm_hdmi_i2c_func(struct i2c_adapter *adapter) { return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; } -static const struct i2c_algorithm hdmi_i2c_algorithm = { - .master_xfer = hdmi_i2c_xfer, - .functionality = hdmi_i2c_func, +static const struct i2c_algorithm msm_hdmi_i2c_algorithm = { + .master_xfer = msm_hdmi_i2c_xfer, + .functionality = msm_hdmi_i2c_func, }; -void hdmi_i2c_irq(struct i2c_adapter *i2c) +void msm_hdmi_i2c_irq(struct i2c_adapter *i2c) { struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); @@ -234,14 +234,14 @@ void hdmi_i2c_irq(struct i2c_adapter *i2c) wake_up_all(&hdmi_i2c->ddc_event); } -void hdmi_i2c_destroy(struct i2c_adapter *i2c) +void msm_hdmi_i2c_destroy(struct i2c_adapter *i2c) { struct hdmi_i2c_adapter *hdmi_i2c = to_hdmi_i2c_adapter(i2c); i2c_del_adapter(i2c); kfree(hdmi_i2c); } -struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) +struct i2c_adapter *msm_hdmi_i2c_init(struct hdmi *hdmi) { struct drm_device *dev = hdmi->dev; struct hdmi_i2c_adapter *hdmi_i2c; @@ -264,7 +264,7 @@ struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) i2c->class = I2C_CLASS_DDC; snprintf(i2c->name, sizeof(i2c->name), "msm hdmi i2c"); i2c->dev.parent = &hdmi->pdev->dev; - i2c->algo = &hdmi_i2c_algorithm; + i2c->algo = &msm_hdmi_i2c_algorithm; ret = i2c_add_adapter(i2c); if (ret) { @@ -276,6 +276,6 @@ struct i2c_adapter *hdmi_i2c_init(struct hdmi *hdmi) fail: if (i2c) - hdmi_i2c_destroy(i2c); + msm_hdmi_i2c_destroy(i2c); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c index ce981c11c3b5..5530631e2d49 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c @@ -15,7 +15,7 @@ #include "hdmi.h" -static int hdmi_phy_resource_init(struct hdmi_phy *phy) +static int msm_hdmi_phy_resource_init(struct hdmi_phy *phy) { struct hdmi_phy_cfg *cfg = phy->cfg; struct device *dev = &phy->pdev->dev; @@ -62,7 +62,7 @@ static int hdmi_phy_resource_init(struct hdmi_phy *phy) return 0; } -int hdmi_phy_resource_enable(struct hdmi_phy *phy) +int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy) { struct hdmi_phy_cfg *cfg = phy->cfg; struct device *dev = &phy->pdev->dev; @@ -87,7 +87,7 @@ int hdmi_phy_resource_enable(struct hdmi_phy *phy) return ret; } -void hdmi_phy_resource_disable(struct hdmi_phy *phy) +void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy) { struct hdmi_phy_cfg *cfg = phy->cfg; struct device *dev = &phy->pdev->dev; @@ -102,7 +102,7 @@ void hdmi_phy_resource_disable(struct hdmi_phy *phy) pm_runtime_put_sync(dev); } -void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) +void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) { if (!phy || !phy->cfg->powerup) return; @@ -110,7 +110,7 @@ void hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) phy->cfg->powerup(phy, pixclock); } -void hdmi_phy_powerdown(struct hdmi_phy *phy) +void msm_hdmi_phy_powerdown(struct hdmi_phy *phy) { if (!phy || !phy->cfg->powerdown) return; @@ -118,17 +118,17 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy) phy->cfg->powerdown(phy); } -static int hdmi_phy_pll_init(struct platform_device *pdev, +static int msm_hdmi_phy_pll_init(struct platform_device *pdev, enum hdmi_phy_type type) { int ret; switch (type) { case MSM_HDMI_PHY_8960: - ret = hdmi_pll_8960_init(pdev); + ret = msm_hdmi_pll_8960_init(pdev); break; case MSM_HDMI_PHY_8996: - ret = hdmi_pll_8996_init(pdev); + ret = msm_hdmi_pll_8996_init(pdev); break; /* * we don't have PLL support for these, don't report an error for now @@ -143,7 +143,7 @@ static int hdmi_phy_pll_init(struct platform_device *pdev, return ret; } -static int hdmi_phy_probe(struct platform_device *pdev) +static int msm_hdmi_phy_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hdmi_phy *phy; @@ -165,64 +165,64 @@ static int hdmi_phy_probe(struct platform_device *pdev) phy->pdev = pdev; - ret = hdmi_phy_resource_init(phy); + ret = msm_hdmi_phy_resource_init(phy); if (ret) return ret; pm_runtime_enable(&pdev->dev); - ret = hdmi_phy_resource_enable(phy); + ret = msm_hdmi_phy_resource_enable(phy); if (ret) return ret; - ret = hdmi_phy_pll_init(pdev, phy->cfg->type); + ret = msm_hdmi_phy_pll_init(pdev, phy->cfg->type); if (ret) { dev_err(dev, "couldn't init PLL\n"); - hdmi_phy_resource_disable(phy); + msm_hdmi_phy_resource_disable(phy); return ret; } - hdmi_phy_resource_disable(phy); + msm_hdmi_phy_resource_disable(phy); platform_set_drvdata(pdev, phy); return 0; } -static int hdmi_phy_remove(struct platform_device *pdev) +static int msm_hdmi_phy_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); return 0; } -static const struct of_device_id hdmi_phy_dt_match[] = { +static const struct of_device_id msm_hdmi_phy_dt_match[] = { { .compatible = "qcom,hdmi-phy-8x60", - .data = &hdmi_phy_8x60_cfg }, + .data = &msm_hdmi_phy_8x60_cfg }, { .compatible = "qcom,hdmi-phy-8960", - .data = &hdmi_phy_8960_cfg }, + .data = &msm_hdmi_phy_8960_cfg }, { .compatible = "qcom,hdmi-phy-8x74", - .data = &hdmi_phy_8x74_cfg }, + .data = &msm_hdmi_phy_8x74_cfg }, { .compatible = "qcom,hdmi-phy-8996", - .data = &hdmi_phy_8996_cfg }, + .data = &msm_hdmi_phy_8996_cfg }, {} }; -static struct platform_driver hdmi_phy_platform_driver = { - .probe = hdmi_phy_probe, - .remove = hdmi_phy_remove, +static struct platform_driver msm_hdmi_phy_platform_driver = { + .probe = msm_hdmi_phy_probe, + .remove = msm_hdmi_phy_remove, .driver = { .name = "msm_hdmi_phy", - .of_match_table = hdmi_phy_dt_match, + .of_match_table = msm_hdmi_phy_dt_match, }, }; -void __init hdmi_phy_driver_register(void) +void __init msm_hdmi_phy_driver_register(void) { - platform_driver_register(&hdmi_phy_platform_driver); + platform_driver_register(&msm_hdmi_phy_platform_driver); } -void __exit hdmi_phy_driver_unregister(void) +void __exit msm_hdmi_phy_driver_unregister(void) { - platform_driver_unregister(&hdmi_phy_platform_driver); + platform_driver_unregister(&msm_hdmi_phy_platform_driver); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c index 46d449e84d71..e6ee6b745ab7 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c @@ -51,7 +51,7 @@ static const char * const hdmi_phy_8960_clk_names[] = { "slave_iface_clk", }; -const struct hdmi_phy_cfg hdmi_phy_8960_cfg = { +const struct hdmi_phy_cfg msm_hdmi_phy_8960_cfg = { .type = MSM_HDMI_PHY_8960, .powerup = hdmi_phy_8960_powerup, .powerdown = hdmi_phy_8960_powerdown, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c index ed38976e599a..aa94a553794f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c @@ -704,7 +704,7 @@ static struct clk_init_data pll_init = { .num_parents = ARRAY_SIZE(hdmi_pll_parents), }; -int hdmi_pll_8996_init(struct platform_device *pdev) +int msm_hdmi_pll_8996_init(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hdmi_pll_8996 *pll; @@ -757,7 +757,7 @@ static const char * const hdmi_phy_8996_clk_names[] = { "ref_clk", }; -const struct hdmi_phy_cfg hdmi_phy_8996_cfg = { +const struct hdmi_phy_cfg msm_hdmi_phy_8996_cfg = { .type = MSM_HDMI_PHY_8996, .reg_names = hdmi_phy_8996_reg_names, .num_regs = ARRAY_SIZE(hdmi_phy_8996_reg_names), diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c index 38022b3af8c1..a68eea4153fc 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x60.c @@ -131,7 +131,7 @@ static void hdmi_phy_8x60_powerdown(struct hdmi_phy *phy) HDMI_8x60_PHY_REG2_PD_DESER); } -const struct hdmi_phy_cfg hdmi_phy_8x60_cfg = { +const struct hdmi_phy_cfg msm_hdmi_phy_8x60_cfg = { .type = MSM_HDMI_PHY_8x60, .powerup = hdmi_phy_8x60_powerup, .powerdown = hdmi_phy_8x60_powerdown, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c index 145e38eb17e2..c4a61e537851 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8x74.c @@ -45,7 +45,7 @@ static const char * const hdmi_phy_8x74_clk_names[] = { "alt_iface_clk" }; -const struct hdmi_phy_cfg hdmi_phy_8x74_cfg = { +const struct hdmi_phy_cfg msm_hdmi_phy_8x74_cfg = { .type = MSM_HDMI_PHY_8x74, .powerup = hdmi_phy_8x74_powerup, .powerdown = hdmi_phy_8x74_powerdown, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c index 35830a9ab615..92da69aa6187 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c @@ -426,7 +426,7 @@ static struct clk_init_data pll_init = { .num_parents = ARRAY_SIZE(hdmi_pll_parents), }; -int hdmi_pll_8960_init(struct platform_device *pdev) +int msm_hdmi_pll_8960_init(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hdmi_pll_8960 *pll; diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index 54b9d9b79bba..76e1dfb5d25e 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c @@ -326,7 +326,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms, if (priv->hdmi) { /* Construct bridge/connector for HDMI: */ - ret = hdmi_modeset_init(priv->hdmi, dev, encoder); + ret = msm_hdmi_modeset_init(priv->hdmi, dev, encoder); if (ret) { dev_err(dev->dev, "failed to initialize HDMI: %d\n", ret); return ret; diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index 5e4d16b399c7..484b4d15e71d 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c @@ -284,7 +284,7 @@ static int modeset_init_intf(struct mdp5_kms *mdp5_kms, int intf_num) break; } - ret = hdmi_modeset_init(priv->hdmi, dev, encoder); + ret = msm_hdmi_modeset_init(priv->hdmi, dev, encoder); break; case INTF_DSI: { diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 280503e19bfd..d52910e2c26c 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1121,7 +1121,7 @@ static int __init msm_drm_register(void) DBG("init"); msm_dsi_register(); msm_edp_register(); - hdmi_register(); + msm_hdmi_register(); adreno_register(); return platform_driver_register(&msm_platform_driver); } @@ -1130,7 +1130,7 @@ static void __exit msm_drm_unregister(void) { DBG("fini"); platform_driver_unregister(&msm_platform_driver); - hdmi_unregister(); + msm_hdmi_unregister(); adreno_unregister(); msm_edp_unregister(); msm_dsi_unregister(); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 6980aa4510cb..a2755b4a0d86 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -244,22 +244,22 @@ void msm_fbdev_free(struct drm_device *dev); struct hdmi; #ifdef CONFIG_DRM_MSM_HDMI -int hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, +int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder); -void __init hdmi_register(void); -void __exit hdmi_unregister(void); +void __init msm_hdmi_register(void); +void __exit msm_hdmi_unregister(void); #else -static inline int hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, +static inline int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder) { return -EINVAL; } -static inline void __init hdmi_register(void) +static inline void __init msm_hdmi_register(void) { } -static inline void __exit hdmi_unregister(void) +static inline void __exit msm_hdmi_unregister(void) { } #endif From patchwork Mon Feb 22 21:08:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102718 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1477548lbl; Mon, 22 Feb 2016 13:11:08 -0800 (PST) X-Received: by 10.98.7.14 with SMTP id b14mr41745055pfd.40.1456175467802; Mon, 22 Feb 2016 13:11:07 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id y8si41865719pas.240.2016.02.22.13.11.07; Mon, 22 Feb 2016 13:11:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6EE496E2C4; Mon, 22 Feb 2016 21:11:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id B84E26E2C4 for ; Mon, 22 Feb 2016 21:11:03 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0LZwFx-1a6Hu821mP-00lmAj; Mon, 22 Feb 2016 22:10:57 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 2/8] drm: msm: rename module Date: Mon, 22 Feb 2016 22:08:36 +0100 Message-Id: <1456175331-714117-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:G8Re6WFJJQmMZLKl6THIJroaIZ/zOz82P8ip9OMJHkYZGE9QDOf k8QkVmvVU0PS66eEjlRrPxck5C9rDbGe2btaOGf8a762HhZVwbfWvZ8xQE00EgAzDv2x41K 6+BayLZq2jwz1I+unobbuwauF/1l63/8SMv+WVC15JlKvFng/izI9xtym/gCiE5P8SGt2TI SDnBoMFVzmQciPRz6sAXA== X-UI-Out-Filterresults: notjunk:1; V01:K0:fRRwkZooWck=:SyjDAKYviZ0haq7S3Ph97j 4UEt8+qzmpta4lxhD5nUTguO5pdfpk+LJYNrcVtjyXLgeUKt6RmMHEefaWQ92GeuFTR6gFPig HOwKZBZcSIruJ9keueDYg89sFOpmRCzPaUPZnkMkvrbZTX6imfl29GTQEOjUv5cUkGl/usZX9 o71QnB96CFuVX9LNA4OHXFRZ1UILSpzHMx3NbjTPrGnG1Z9YBIWAHTEyL2MCm3t2Z06CUztsi dUyjbQzmZ+zF3/BCAcVRq1jYRCn+mWWMloLgMf1uZTmcDoBbFhwV6kj/oNgVC3WqSH7c7ooqN E1TR3FMU9y3t9/nxs3xfiI9TsRIrVdlwyZO0gthQXl3IuJJW2LGdZGtuRHpRgT7AJ2Te35l8s NL2rTGPc4p8PImvxh4CbDjxaelfy7M6qbE6AzQG8RqPdX3jxAl1C0HqUpC9btnCbd+syWN726 BMqgHzaE20HWpk5YXSkvbof9g4TO8bepIfYj6Gdo/MV3W6pYaU+fzUzTR2Ljq1MThNxiPS6an voJlnONbV1NDWa8D67S5zWcs/+ZwJcNz9oRfgQvPba1l6XjEVYw6mm25E/nUPxIdF4zLDO7zs Fqu+sVH9GUBXd4TPzmb5yDm6vpWAEc1EOtbnG9tMuaddwIolBJ+/RbNatmRvv2CyUmVNkKAe0 azKKg8CG4T0Yp0J7zUYBxPAoYg281Ex8SuLz0g0OlG3vC4gh7EL70SnnbcntlZctoW8U= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" msm.ko is not an appropriate name for a module that drives a specific device on the msm platform. This changes the name to drm_msm.ko to have something that won't conflict with any other module name. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 9386cfeb55b2..24f6fd2b9651 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -1,6 +1,6 @@ ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -msm-y := \ +drm-msm-y := \ adreno/adreno_device.o \ adreno/adreno_gpu.o \ adreno/a3xx_gpu.o \ @@ -34,14 +34,14 @@ msm-y := \ msm_rd.o \ msm_ringbuffer.o -msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \ - mdp/mdp5/mdp5_cmd_encoder.o +drm-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \ + mdp/mdp5/mdp5_cmd_encoder.o -msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o -msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o +drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o +drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o obj-$(CONFIG_DRM_MSM_DSI) += dsi/ obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/ obj-$(CONFIG_DRM_MSM_EDP) += edp/ -obj-$(CONFIG_DRM_MSM) += msm.o +obj-$(CONFIG_DRM_MSM) += drm-msm.o From patchwork Mon Feb 22 21:08:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102717 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1478051lbl; Mon, 22 Feb 2016 13:12:11 -0800 (PST) X-Received: by 10.66.62.226 with SMTP id b2mr41098071pas.94.1456175531202; Mon, 22 Feb 2016 13:12:11 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id vz3si41932837pab.93.2016.02.22.13.12.10; Mon, 22 Feb 2016 13:12:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B4596E258; Mon, 22 Feb 2016 21:12:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E7306E258 for ; Mon, 22 Feb 2016 21:12:06 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MRUgC-1aMqtx0RWy-00SjHo; Mon, 22 Feb 2016 22:12:05 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 3/8] drm: msm: split out fence and iotrace modules Date: Mon, 22 Feb 2016 22:08:37 +0100 Message-Id: <1456175331-714117-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:otQjPFm6MG+jlIFLxIAGpJi2fjVETgX9blVp7OZqzX8B7QK5+wY +kFNaUy4Gw7vswB/sB4+3fHxFpjDdfQ0j3bPNtcREU88t4V6nw81K2Im4jN0afPxB5QmFoA 5j2iWtvgFHKUY6Ctato9ICk0G1hevzMRGmvNo8KUPO7zBu/tL36Wa2hq/lLvGHWSuqkBdq/ UWFitXep2ovVrUkQp5l9g== X-UI-Out-Filterresults: notjunk:1; V01:K0:M3OHlKX6IXA=:9gJYF7bInSXvdmy4fCyeE5 mGBjY9JYin0RI0pGMasoVbiqVQiKr9U9faggvdRF+mKKBtOW6bBZGxGai5Zr1bi9TZckvN7Dd GMBKT0ijzocuhcBREBoIunAX0lbHDhp68VbSbyF4DY8q+q1cVxReWK4JQKydtl6jHUeHrlXpW yRbjIJAPtfWRWlrGT3ch/pseSoS67xexHSVuU6UkhFrZmoGqzzTrPfNbhAj7BXCMriYYUG/ul RB+Y/sucCO1tnKKspx0VS4keOa5quJkaTh8EYHc7LAlFgFeHOtSn5Evg+iRITiUA3I20+pIog le1suMBNcTelEBfWVOfL0hTozKXcPWKALmdHI0+ll2CmdS1J16fP2QU4+17GaXoYRXc2e17Xl A4lHwSq2G/OBWMTaPK3h3nmMuLA9+2DRtclCd1xyUFskPERu2jZyzrsoP34alVhu2M/v8oq2p SZdBrNV7NfaVqXLVMNPU5vGlOwmT/RxKhhDknyzTsKDOwcoEk+bi2AozXqtudseaFrx3azy2i 3/N4xjlwu+eImmzqda/6inJWzl46kH7unbQ9ChBUm+ZXHEDw649e5D2/UQ2YeNUoYOVIlnmQA MHxsaxrKQeiuxCSGW/fK718JHN1azSdTU9g72xFGNifp7MLjC8QhUJOyATC3h8eMx6lubZVtF 0I1SIRtDRoyHhBuqSLpNbVpkj1JKaJso5f36zO6UtTzST6Hn/MkRQrw4dXuqGrIl3rKE= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a preparation for having edp, dsi and hdmi in separate modules. Those three drivers depend on the iotrace code and, and edp depends on gem, which in turn depends on the fence. With this change, those two pieces of the main driver can be loaded first, to resolve circular dependencies. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/Kconfig | 2 +- drivers/gpu/drm/msm/Makefile | 4 +- drivers/gpu/drm/msm/msm_drv.c | 165 -------------------------------------- drivers/gpu/drm/msm/msm_drv.h | 12 +++ drivers/gpu/drm/msm/msm_fence.c | 115 ++++++++++++++++++++++++++ drivers/gpu/drm/msm/msm_iotrace.c | 65 +++++++++++++++ 6 files changed, 196 insertions(+), 167 deletions(-) create mode 100644 drivers/gpu/drm/msm/msm_fence.c create mode 100644 drivers/gpu/drm/msm/msm_iotrace.c diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index b8beb9bccd91..d987c584d817 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig @@ -21,7 +21,7 @@ config DRM_MSM_REGISTER_LOGGING help Compile in support for logging register reads/writes in a format that can be parsed by envytools demsm tool. If enabled, register - logging can be switched on via msm.reglog=y module param. + logging can be switched on via msm_iotrace.reglog=y module param. source "drivers/gpu/drm/msm/dsi/Kconfig" source "drivers/gpu/drm/msm/hdmi/Kconfig" diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 24f6fd2b9651..acc02aef1b42 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -44,4 +44,6 @@ obj-$(CONFIG_DRM_MSM_DSI) += dsi/ obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/ obj-$(CONFIG_DRM_MSM_EDP) += edp/ -obj-$(CONFIG_DRM_MSM) += drm-msm.o +obj-$(CONFIG_DRM_MSM) += drm-msm.o drm_msm_helper.o + +drm_msm_helper-y += msm_iotrace.o msm_fence.o diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index d52910e2c26c..5430ea7d2375 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -46,14 +46,6 @@ int msm_register_mmu(struct drm_device *dev, struct msm_mmu *mmu) return idx; } -#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING -static bool reglog = false; -MODULE_PARM_DESC(reglog, "Enable register read/write logging"); -module_param(reglog, bool, 0600); -#else -#define reglog 0 -#endif - #ifdef CONFIG_DRM_FBDEV_EMULATION static bool fbdev = true; MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer"); @@ -64,56 +56,6 @@ static char *vram = "16m"; MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)"); module_param(vram, charp, 0); -/* - * Util/helpers: - */ - -void __iomem *msm_ioremap(struct platform_device *pdev, const char *name, - const char *dbgname) -{ - struct resource *res; - unsigned long size; - void __iomem *ptr; - - if (name) - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); - else - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - - if (!res) { - dev_err(&pdev->dev, "failed to get memory resource: %s\n", name); - return ERR_PTR(-EINVAL); - } - - size = resource_size(res); - - ptr = devm_ioremap_nocache(&pdev->dev, res->start, size); - if (!ptr) { - dev_err(&pdev->dev, "failed to ioremap: %s\n", name); - return ERR_PTR(-ENOMEM); - } - - if (reglog) - printk(KERN_DEBUG "IO:region %s %p %08lx\n", dbgname, ptr, size); - - return ptr; -} - -void msm_writel(u32 data, void __iomem *addr) -{ - if (reglog) - printk(KERN_DEBUG "IO:W %p %08x\n", addr, data); - writel(data, addr); -} - -u32 msm_readl(const void __iomem *addr) -{ - u32 val = readl(addr); - if (reglog) - printk(KERN_ERR "IO:R %p %08x\n", addr, val); - return val; -} - struct vblank_event { struct list_head node; int crtc_id; @@ -691,113 +633,6 @@ static void msm_debugfs_cleanup(struct drm_minor *minor) #endif /* - * Fences: - */ - -int msm_wait_fence(struct drm_device *dev, uint32_t fence, - ktime_t *timeout , bool interruptible) -{ - struct msm_drm_private *priv = dev->dev_private; - int ret; - - if (!priv->gpu) - return 0; - - if (fence > priv->gpu->submitted_fence) { - DRM_ERROR("waiting on invalid fence: %u (of %u)\n", - fence, priv->gpu->submitted_fence); - return -EINVAL; - } - - if (!timeout) { - /* no-wait: */ - ret = fence_completed(dev, fence) ? 0 : -EBUSY; - } else { - ktime_t now = ktime_get(); - unsigned long remaining_jiffies; - - if (ktime_compare(*timeout, now) < 0) { - remaining_jiffies = 0; - } else { - ktime_t rem = ktime_sub(*timeout, now); - struct timespec ts = ktime_to_timespec(rem); - remaining_jiffies = timespec_to_jiffies(&ts); - } - - if (interruptible) - ret = wait_event_interruptible_timeout(priv->fence_event, - fence_completed(dev, fence), - remaining_jiffies); - else - ret = wait_event_timeout(priv->fence_event, - fence_completed(dev, fence), - remaining_jiffies); - - if (ret == 0) { - DBG("timeout waiting for fence: %u (completed: %u)", - fence, priv->completed_fence); - ret = -ETIMEDOUT; - } else if (ret != -ERESTARTSYS) { - ret = 0; - } - } - - return ret; -} - -int msm_queue_fence_cb(struct drm_device *dev, - struct msm_fence_cb *cb, uint32_t fence) -{ - struct msm_drm_private *priv = dev->dev_private; - int ret = 0; - - mutex_lock(&dev->struct_mutex); - if (!list_empty(&cb->work.entry)) { - ret = -EINVAL; - } else if (fence > priv->completed_fence) { - cb->fence = fence; - list_add_tail(&cb->work.entry, &priv->fence_cbs); - } else { - queue_work(priv->wq, &cb->work); - } - mutex_unlock(&dev->struct_mutex); - - return ret; -} - -/* called from workqueue */ -void msm_update_fence(struct drm_device *dev, uint32_t fence) -{ - struct msm_drm_private *priv = dev->dev_private; - - mutex_lock(&dev->struct_mutex); - priv->completed_fence = max(fence, priv->completed_fence); - - while (!list_empty(&priv->fence_cbs)) { - struct msm_fence_cb *cb; - - cb = list_first_entry(&priv->fence_cbs, - struct msm_fence_cb, work.entry); - - if (cb->fence > priv->completed_fence) - break; - - list_del_init(&cb->work.entry); - queue_work(priv->wq, &cb->work); - } - - mutex_unlock(&dev->struct_mutex); - - wake_up_all(&priv->fence_event); -} - -void __msm_fence_worker(struct work_struct *work) -{ - struct msm_fence_cb *cb = container_of(work, struct msm_fence_cb, work); - cb->func(cb); -} - -/* * DRM ioctls: */ diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index a2755b4a0d86..b8bd88b66c9c 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -330,8 +331,19 @@ static inline void msm_rd_dump_submit(struct msm_gem_submit *submit) {} void __iomem *msm_ioremap(struct platform_device *pdev, const char *name, const char *dbgname); +#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING void msm_writel(u32 data, void __iomem *addr); u32 msm_readl(const void __iomem *addr); +#else +static inline void msm_writel(u32 data, void __iomem *addr) +{ + writel(data, addr); +} +static inline u32 msm_readl(const void __iomem *addr) +{ + return readl(addr); +} +#endif #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c new file mode 100644 index 000000000000..df66e04e01d8 --- /dev/null +++ b/drivers/gpu/drm/msm/msm_fence.c @@ -0,0 +1,115 @@ +#include +#include +#include + +#include + +#include "msm_drv.h" +#include "msm_gpu.h" + +int msm_wait_fence(struct drm_device *dev, uint32_t fence, + ktime_t *timeout , bool interruptible) +{ + struct msm_drm_private *priv = dev->dev_private; + int ret; + + if (!priv->gpu) + return 0; + + if (fence > priv->gpu->submitted_fence) { + DRM_ERROR("waiting on invalid fence: %u (of %u)\n", + fence, priv->gpu->submitted_fence); + return -EINVAL; + } + + if (!timeout) { + /* no-wait: */ + ret = fence_completed(dev, fence) ? 0 : -EBUSY; + } else { + ktime_t now = ktime_get(); + unsigned long remaining_jiffies; + + if (ktime_compare(*timeout, now) < 0) { + remaining_jiffies = 0; + } else { + ktime_t rem = ktime_sub(*timeout, now); + struct timespec ts = ktime_to_timespec(rem); + remaining_jiffies = timespec_to_jiffies(&ts); + } + + if (interruptible) + ret = wait_event_interruptible_timeout(priv->fence_event, + fence_completed(dev, fence), + remaining_jiffies); + else + ret = wait_event_timeout(priv->fence_event, + fence_completed(dev, fence), + remaining_jiffies); + + if (ret == 0) { + DBG("timeout waiting for fence: %u (completed: %u)", + fence, priv->completed_fence); + ret = -ETIMEDOUT; + } else if (ret != -ERESTARTSYS) { + ret = 0; + } + } + + return ret; +} +EXPORT_SYMBOL_GPL(msm_wait_fence); + +int msm_queue_fence_cb(struct drm_device *dev, + struct msm_fence_cb *cb, uint32_t fence) +{ + struct msm_drm_private *priv = dev->dev_private; + int ret = 0; + + mutex_lock(&dev->struct_mutex); + if (!list_empty(&cb->work.entry)) { + ret = -EINVAL; + } else if (fence > priv->completed_fence) { + cb->fence = fence; + list_add_tail(&cb->work.entry, &priv->fence_cbs); + } else { + queue_work(priv->wq, &cb->work); + } + mutex_unlock(&dev->struct_mutex); + + return ret; +} +EXPORT_SYMBOL_GPL(msm_queue_fence_cb); + +/* called from workqueue */ +void msm_update_fence(struct drm_device *dev, uint32_t fence) +{ + struct msm_drm_private *priv = dev->dev_private; + + mutex_lock(&dev->struct_mutex); + priv->completed_fence = max(fence, priv->completed_fence); + + while (!list_empty(&priv->fence_cbs)) { + struct msm_fence_cb *cb; + + cb = list_first_entry(&priv->fence_cbs, + struct msm_fence_cb, work.entry); + + if (cb->fence > priv->completed_fence) + break; + + list_del_init(&cb->work.entry); + queue_work(priv->wq, &cb->work); + } + + mutex_unlock(&dev->struct_mutex); + + wake_up_all(&priv->fence_event); +} +EXPORT_SYMBOL_GPL(msm_update_fence); + +void __msm_fence_worker(struct work_struct *work) +{ + struct msm_fence_cb *cb = container_of(work, struct msm_fence_cb, work); + cb->func(cb); +} +EXPORT_SYMBOL_GPL(__msm_fence_worker); diff --git a/drivers/gpu/drm/msm/msm_iotrace.c b/drivers/gpu/drm/msm/msm_iotrace.c new file mode 100644 index 000000000000..7761470eee26 --- /dev/null +++ b/drivers/gpu/drm/msm/msm_iotrace.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +static bool reglog = false; + +#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING +MODULE_PARM_DESC(reglog, "Enable register read/write logging"); +module_param(reglog, bool, 0600); + +void msm_writel(u32 data, void __iomem *addr) +{ + if (reglog) + printk(KERN_DEBUG "IO:W %p %08x\n", addr, data); + writel(data, addr); +} +EXPORT_SYMBOL_GPL(msm_writel); + +u32 msm_readl(const void __iomem *addr) +{ + u32 val = readl(addr); + if (reglog) + printk(KERN_ERR "IO:R %p %08x\n", addr, val); + return val; +} +EXPORT_SYMBOL_GPL(msm_readl); +#endif + +void __iomem *msm_ioremap(struct platform_device *pdev, const char *name, + const char *dbgname) +{ + struct resource *res; + unsigned long size; + void __iomem *ptr; + + if (name) + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); + else + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + + if (!res) { + dev_err(&pdev->dev, "failed to get memory resource: %s\n", name); + return ERR_PTR(-EINVAL); + } + + size = resource_size(res); + + ptr = devm_ioremap_nocache(&pdev->dev, res->start, size); + if (!ptr) { + dev_err(&pdev->dev, "failed to ioremap: %s\n", name); + return ERR_PTR(-ENOMEM); + } + + if (reglog) + printk(KERN_DEBUG "IO:region %s %p %08lx\n", dbgname, ptr, size); + + return ptr; +} +EXPORT_SYMBOL_GPL(msm_ioremap); + +MODULE_AUTHOR("Rob Clark X-Patchwork-Id: 102716 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1478192lbl; Mon, 22 Feb 2016 13:12:28 -0800 (PST) X-Received: by 10.66.187.36 with SMTP id fp4mr41082118pac.47.1456175548773; Mon, 22 Feb 2016 13:12:28 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id i89si42014369pfj.228.2016.02.22.13.12.28; Mon, 22 Feb 2016 13:12:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B715C6E2C8; Mon, 22 Feb 2016 21:12:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 164116E2C8 for ; Mon, 22 Feb 2016 21:12:24 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M3SWO-1ZhEdH3NdA-00r1Tg; Mon, 22 Feb 2016 22:12:19 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 4/8] drm: msm: split out GEM code into helper module Date: Mon, 22 Feb 2016 22:08:38 +0100 Message-Id: <1456175331-714117-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:ZTSqCGuScgDclmz4WGDhkudJ1A/gP/AXGTbh02Iwlc9me/NIzt/ sVZc729KPRQt4BcdMOtkrl2O25/IJ+1tkqDgISGyeuH5wj8jMgu7aFuAu2OH2owG8In9GdB NEY4BKw3NUu0PNBEfpKsoH9Y5l7jW3qd9rp+hCQDnd3vKQc/i0pqLmgsbZOsOPvwbdHDvPK GpFkkFgLJ6sL+Ypzz7b5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:cWNmP/G7850=:Dv6bRrQxSQe9CQrYCNIMq8 E5TGVhLW+P2FJkfugD9B9yz//y6YI+oCQ2ZM/4X0DimQQWwRw0F1RIkuKWyT1nNtoDIeB7YJn 6ylA2pJwdVTIzGL7cAxnMES6M5f/bLnvtmxMDDG0dO1+i/SaocO+mU9lbbP8FB6hptjEbwIYz SfuO0LCvBE02daCWKHa4/OzSSUUN+59kNmseucRqN96ZdcQamFahL4jY5l2rwGrqSK2EOdSJ1 a+5HaD6ItZRrwFkdInRuafAe9ToF2FA3/zv59q32CPU+6yeRkTdKKLD2JQATnPaCCqpdnk9ko Ewtg2jO/OzR4Nm8NBWBGeyYDux/VnwFkQakTZMxmxmH99VefAVcsm7AwL2rgS2mTLTT60Fd4f szfGa3vTsXifNvam8bciJoVDt1JZyTuVoQfqs5l4JdUb7h03DegjDEycSfJCoL18P41wBnv/q dTv+VBnmwAwjx/iEwiqPDTqU2peAsFBWoLHltDil1oqxJcDCsi9BNfL19Viar2X+LnMm75hTD I7HM0Dpb8MXUPsfnk0X9MnqSnoA6bmXJT7W7SqcFeulN2U8m2r5CoqmslSVeG5fDThtdtLCGk Och705sz0mStgiXWODe5fjq4RXbcPgPGOVcDtW4n7j4YZ7TSsmlWQuhRhZFq4VyWWvX3g8VUu xBP/cb8uFLlRKFIWgUcyDIdo8kXkkwouI87K0rAFr/SH+bh/P2paf2/XDysH0eoK2n9g= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The GEM code is used by dsi, so it can't be part of the main module. This exports all functions that are called by other code, and puts it into the helper module. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/Makefile | 3 +-- drivers/gpu/drm/msm/msm_gem.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index acc02aef1b42..6817e9390153 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -25,7 +25,6 @@ drm-msm-y := \ msm_atomic.o \ msm_drv.o \ msm_fb.o \ - msm_gem.o \ msm_gem_prime.o \ msm_gem_submit.o \ msm_gpu.o \ @@ -46,4 +45,4 @@ obj-$(CONFIG_DRM_MSM_EDP) += edp/ obj-$(CONFIG_DRM_MSM) += drm-msm.o drm_msm_helper.o -drm_msm_helper-y += msm_iotrace.o msm_fence.o +drm_msm_helper-y += msm_iotrace.o msm_fence.o msm_gem.o diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 3cedb8d5c855..1d64febee274 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -143,11 +143,13 @@ struct page **msm_gem_get_pages(struct drm_gem_object *obj) mutex_unlock(&dev->struct_mutex); return p; } +EXPORT_SYMBOL_GPL(msm_gem_get_pages); void msm_gem_put_pages(struct drm_gem_object *obj) { /* when we start tracking the pin count, then do something here */ } +EXPORT_SYMBOL_GPL(msm_gem_put_pages); int msm_gem_mmap_obj(struct drm_gem_object *obj, struct vm_area_struct *vma) @@ -177,6 +179,7 @@ int msm_gem_mmap_obj(struct drm_gem_object *obj, return 0; } +EXPORT_SYMBOL_GPL(msm_gem_mmap_obj); int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma) { @@ -190,6 +193,7 @@ int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma) return msm_gem_mmap_obj(vma->vm_private_data, vma); } +EXPORT_SYMBOL_GPL(msm_gem_mmap); int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { @@ -246,6 +250,7 @@ out: return VM_FAULT_SIGBUS; } } +EXPORT_SYMBOL_GPL(msm_gem_fault); /** get mmap offset */ static uint64_t mmap_offset(struct drm_gem_object *obj) @@ -274,6 +279,7 @@ uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj) mutex_unlock(&obj->dev->struct_mutex); return offset; } +EXPORT_SYMBOL_GPL(msm_gem_mmap_offset); /* should be called under struct_mutex.. although it can be called * from atomic context without struct_mutex to acquire an extra @@ -316,6 +322,7 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id, return ret; } +EXPORT_SYMBOL_GPL(msm_gem_get_iova_locked); /* get iova, taking a reference. Should have a matching put */ int msm_gem_get_iova(struct drm_gem_object *obj, int id, uint32_t *iova) @@ -336,6 +343,7 @@ int msm_gem_get_iova(struct drm_gem_object *obj, int id, uint32_t *iova) mutex_unlock(&obj->dev->struct_mutex); return ret; } +EXPORT_SYMBOL_GPL(msm_gem_get_iova); /* get iova without taking a reference, used in places where you have * already done a 'msm_gem_get_iova()'. @@ -346,6 +354,7 @@ uint32_t msm_gem_iova(struct drm_gem_object *obj, int id) WARN_ON(!msm_obj->domain[id].iova); return msm_obj->domain[id].iova; } +EXPORT_SYMBOL_GPL(msm_gem_iova); void msm_gem_put_iova(struct drm_gem_object *obj, int id) { @@ -356,6 +365,7 @@ void msm_gem_put_iova(struct drm_gem_object *obj, int id) // if another _get_iova_locked() fails we can start unmapping // things that are no longer needed.. } +EXPORT_SYMBOL_GPL(msm_gem_put_iova); int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) @@ -365,6 +375,7 @@ int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, return msm_gem_new_handle(dev, file, args->size, MSM_BO_SCANOUT | MSM_BO_WC, &args->handle); } +EXPORT_SYMBOL_GPL(msm_gem_dumb_create); int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset) @@ -386,6 +397,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, fail: return ret; } +EXPORT_SYMBOL_GPL(msm_gem_dumb_map_offset); void *msm_gem_vaddr_locked(struct drm_gem_object *obj) { @@ -400,6 +412,7 @@ void *msm_gem_vaddr_locked(struct drm_gem_object *obj) } return msm_obj->vaddr; } +EXPORT_SYMBOL_GPL(msm_gem_vaddr_locked); void *msm_gem_vaddr(struct drm_gem_object *obj) { @@ -409,6 +422,7 @@ void *msm_gem_vaddr(struct drm_gem_object *obj) mutex_unlock(&obj->dev->struct_mutex); return ret; } +EXPORT_SYMBOL_GPL(msm_gem_vaddr); /* setup callback for when bo is no longer busy.. * TODO probably want to differentiate read vs write.. @@ -421,6 +435,7 @@ int msm_gem_queue_inactive_cb(struct drm_gem_object *obj, MSM_PREP_READ | MSM_PREP_WRITE); return msm_queue_fence_cb(obj->dev, cb, fence); } +EXPORT_SYMBOL_GPL(msm_gem_queue_inactive_cb); void msm_gem_move_to_active(struct drm_gem_object *obj, struct msm_gpu *gpu, bool write, uint32_t fence) @@ -434,6 +449,7 @@ void msm_gem_move_to_active(struct drm_gem_object *obj, list_del_init(&msm_obj->mm_list); list_add_tail(&msm_obj->mm_list, &gpu->active_list); } +EXPORT_SYMBOL_GPL(msm_gem_move_to_active); void msm_gem_move_to_inactive(struct drm_gem_object *obj) { @@ -449,6 +465,7 @@ void msm_gem_move_to_inactive(struct drm_gem_object *obj) list_del_init(&msm_obj->mm_list); list_add_tail(&msm_obj->mm_list, &priv->inactive_list); } +EXPORT_SYMBOL_GPL(msm_gem_move_to_inactive); int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) { @@ -469,12 +486,14 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) return ret; } +EXPORT_SYMBOL_GPL(msm_gem_cpu_prep); int msm_gem_cpu_fini(struct drm_gem_object *obj) { /* TODO cache maintenance */ return 0; } +EXPORT_SYMBOL_GPL(msm_gem_cpu_fini); #ifdef CONFIG_DEBUG_FS void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) @@ -490,6 +509,7 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) obj->name, obj->refcount.refcount.counter, off, msm_obj->vaddr, obj->size); } +EXPORT_SYMBOL_GPL(msm_gem_describe); void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) { @@ -507,6 +527,7 @@ void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) seq_printf(m, "Total %d objects, %zu bytes\n", count, size); } +EXPORT_SYMBOL_GPL(msm_gem_describe_objects); #endif void msm_gem_free_object(struct drm_gem_object *obj) @@ -554,6 +575,7 @@ void msm_gem_free_object(struct drm_gem_object *obj) kfree(msm_obj); } +EXPORT_SYMBOL_GPL(msm_gem_free_object); /* convenience method to construct a GEM buffer object, and userspace handle */ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, @@ -580,6 +602,7 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, return ret; } +EXPORT_SYMBOL_GPL(msm_gem_new_handle); static int msm_gem_new_impl(struct drm_device *dev, uint32_t size, uint32_t flags, @@ -663,6 +686,7 @@ fail: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(msm_gem_new); struct drm_gem_object *msm_gem_import(struct drm_device *dev, uint32_t size, struct sg_table *sgt) @@ -707,3 +731,8 @@ fail: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(msm_gem_import); + +MODULE_AUTHOR("Rob Clark X-Patchwork-Id: 102715 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1478453lbl; Mon, 22 Feb 2016 13:13:06 -0800 (PST) X-Received: by 10.66.90.136 with SMTP id bw8mr41321356pab.52.1456175586697; Mon, 22 Feb 2016 13:13:06 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id z7si41950185par.88.2016.02.22.13.13.06; Mon, 22 Feb 2016 13:13:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CC9A6E2D2; Mon, 22 Feb 2016 21:13:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id D65C46E2D2 for ; Mon, 22 Feb 2016 21:13:03 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MHpe9-1aWaD01xfx-003beL; Mon, 22 Feb 2016 22:12:59 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 5/8] drm: msm: move DSI into separate module Date: Mon, 22 Feb 2016 22:08:39 +0100 Message-Id: <1456175331-714117-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:mDwr49MhM8QhueLy2lcezDwtzixS7vtL5IRIne/C1+eVADA+slg MVA2NiPONPkK8T6WSii9X2sTsFu5tL3pJ8egGEBjP/1EnDad+ATV1lrEVgSl3nXmryye382 Zkl4YqUTP5fK/ZzBgNj+V3wAE80ZFUgbuqqa9uIZ78LjYN58QmiBhZspY5Qp4C+FKTj8JVl +sQfLKXp+qpGCMe92wAfA== X-UI-Out-Filterresults: notjunk:1; V01:K0:iQyELN12HmA=:qB9XhvfbDMYr9taogLIHny JkUQ8hGRX3i1cfBVOjYPN6Hg867njTdOuzeZicesAgrQnjTqlNhVB2i1AQuo+1P/EtmBWMFLp r6R/9aDP8BD2pAef3OoT3Gqpa4VtCQSWeNbuHpBTpez9G9ZJFlLVUkDwgYHjnxC5xX0tfLbgS z17kebNY5OyThXyMcexfLWGIdImq46taE8Z9TTF2fXLloPPjsCB/oyw6keyk1JbPtaEnCP7Nh 7n5X5jb5xDuzbkK4Xu3wHVydjnXgQto8gNpfskm3n9Q//5QX2oe4SNiq34EASybTjkLKQIBMm su0TzFuEq6u0bxN6HTD+pi/FP1/adOMMpD7QngzGkRXU7UdDA8ll3DGP4e22E/9nQ+KQ0A13w FFjnS9kV8nl51PFnxgB7vp2Tp2MSxBFBSuRBkKWXRQNTTCbeKrYHZ0wZYnhHZluvNlKNRIzDQ 4DImNuDeKccY8LUOLDCocnGAbexXgFyzIUBmAWYVIE1AFL9lHRTRLIvD+WL+NtRJMtEUEiu+o L/SScMSxSN357Rd7Qi+yA2v0kLp3iKJIDTWw0AxI4Kao3Tbeisf66CkpUN7oZO5UO74P8kS6J Qvm/0W5BFIakG1lW1yzBUoS0pgFH4MoLiLDm7ycfg5/r6dNhK8WYwqQhdA70dr7BSGgxxsTZ9 civ+WVBon3qC0WI2uq+JmLrRoSQsANVAiSbnd3RCqJMlDBtffvUrF/B5ZczRqKkxUbUc= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Moving around the Makefile for DSI caused a link error with the main driver referring to a builtin module that has no exported symbols: drivers/gpu/built-in.o: In function `msm_drm_register': :(.init.text+0x654): undefined reference to `msm_dsi_register' This changes the DSI symbol to a 'tristate' so we can build it as a module, and exports the symbols as necessary. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/Makefile | 4 ++-- drivers/gpu/drm/msm/dsi/Kconfig | 7 ++++++- drivers/gpu/drm/msm/dsi/Makefile | 16 +++++++++------- drivers/gpu/drm/msm/dsi/dsi.c | 6 ++++-- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | 2 +- drivers/gpu/drm/msm/msm_drv.h | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 6817e9390153..4b18a2c670b9 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -33,13 +33,13 @@ drm-msm-y := \ msm_rd.o \ msm_ringbuffer.o -drm-msm-$(CONFIG_DRM_MSM_DSI) += mdp/mdp4/mdp4_dsi_encoder.o \ +drm-msm-$(CONFIG_DRM_MSM_DSI_MODULE) += mdp/mdp4/mdp4_dsi_encoder.o \ mdp/mdp5/mdp5_cmd_encoder.o drm-msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o -obj-$(CONFIG_DRM_MSM_DSI) += dsi/ +obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/ obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/ obj-$(CONFIG_DRM_MSM_EDP) += edp/ diff --git a/drivers/gpu/drm/msm/dsi/Kconfig b/drivers/gpu/drm/msm/dsi/Kconfig index 91dcf21bfc03..9cddaf0229f7 100644 --- a/drivers/gpu/drm/msm/dsi/Kconfig +++ b/drivers/gpu/drm/msm/dsi/Kconfig @@ -1,5 +1,5 @@ config DRM_MSM_DSI - bool "Enable DSI support in MSM DRM driver" + tristate "Enable DSI support in MSM DRM driver" depends on DRM_MSM select DRM_PANEL select DRM_MIPI_DSI @@ -8,6 +8,11 @@ config DRM_MSM_DSI Choose this option if you have a need for MIPI DSI connector support. +config DRM_MSM_DSI_MODULE + tristate + default y if DRM_MSM=y && DRM_MSM_DSI=m + default DRM_MSM_DSI + if DRM_MSM_DSI config DRM_MSM_DSI_PLL diff --git a/drivers/gpu/drm/msm/dsi/Makefile b/drivers/gpu/drm/msm/dsi/Makefile index 26c8fb689229..53d1cdc16748 100644 --- a/drivers/gpu/drm/msm/dsi/Makefile +++ b/drivers/gpu/drm/msm/dsi/Makefile @@ -1,13 +1,15 @@ ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -Idrivers/gpu/drm/msm/dsi -obj-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o +obj-$(CONFIG_DRM_MSM_DSI_MODULE) += drm-msm-dsi.o -obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o -obj-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o -obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o +drm-msm-dsi-y := dsi.o dsi_cfg.o dsi_host.o dsi_manager.o phy/dsi_phy.o + +drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += phy/dsi_phy_28nm.o +drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += phy/dsi_phy_20nm.o +drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += phy/dsi_phy_28nm_8960.o ifeq ($(CONFIG_DRM_MSM_DSI_PLL),y) -obj-y += pll/dsi_pll.o -obj-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o -obj-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o +drm-msm-dsi-y += pll/dsi_pll.o +drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += pll/dsi_pll_28nm.o +drm-msm-dsi-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += pll/dsi_pll_28nm_8960.o endif diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 6edcd6f57e70..8523a7cdc419 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -10,7 +10,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ - +#include #include "dsi.h" struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi) @@ -178,6 +178,7 @@ void __init msm_dsi_register(void) msm_dsi_phy_driver_register(); platform_driver_register(&dsi_driver); } +EXPORT_SYMBOL_GPL(msm_dsi_register); void __exit msm_dsi_unregister(void) { @@ -185,6 +186,7 @@ void __exit msm_dsi_unregister(void) msm_dsi_phy_driver_unregister(); platform_driver_unregister(&dsi_driver); } +EXPORT_SYMBOL_GPL(msm_dsi_unregister); int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM]) @@ -262,4 +264,4 @@ fail: return ret; } - +EXPORT_SYMBOL_GPL(msm_dsi_modeset_init); diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h index b2828717be2a..3a9e7879d535 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h @@ -217,7 +217,7 @@ struct drm_encoder *mdp4_lcdc_encoder_init(struct drm_device *dev, struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev, struct device_node *panel_node, struct drm_encoder *encoder); -#ifdef CONFIG_DRM_MSM_DSI +#if IS_ENABLED(CONFIG_DRM_MSM_DSI) struct drm_encoder *mdp4_dsi_encoder_init(struct drm_device *dev); #else static inline struct drm_encoder *mdp4_dsi_encoder_init(struct drm_device *dev) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h index 9a25898239d3..6a1325fd71aa 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h @@ -224,7 +224,7 @@ int mdp5_encoder_set_split_display(struct drm_encoder *encoder, int mdp5_encoder_get_linecount(struct drm_encoder *encoder); u32 mdp5_encoder_get_framecount(struct drm_encoder *encoder); -#ifdef CONFIG_DRM_MSM_DSI +#if IS_ENABLED(CONFIG_DRM_MSM_DSI) struct drm_encoder *mdp5_cmd_encoder_init(struct drm_device *dev, struct mdp5_interface *intf, struct mdp5_ctl *ctl); int mdp5_cmd_encoder_set_split_display(struct drm_encoder *encoder, diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index b8bd88b66c9c..86df81b46eb0 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -294,7 +294,7 @@ enum msm_dsi_encoder_id { MSM_DSI_CMD_ENCODER_ID = 1, MSM_DSI_ENCODER_NUM = 2 }; -#ifdef CONFIG_DRM_MSM_DSI +#if IS_ENABLED(CONFIG_DRM_MSM_DSI) void __init msm_dsi_register(void); void __exit msm_dsi_unregister(void); int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, From patchwork Mon Feb 22 21:08:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102714 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1478617lbl; Mon, 22 Feb 2016 13:13:34 -0800 (PST) X-Received: by 10.66.124.201 with SMTP id mk9mr27974444pab.152.1456175614008; Mon, 22 Feb 2016 13:13:34 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id q28si42027442pfi.178.2016.02.22.13.13.33; Mon, 22 Feb 2016 13:13:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AD796E2D4; Mon, 22 Feb 2016 21:13:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6346A6E2D4 for ; Mon, 22 Feb 2016 21:13:31 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0LjJuR-1ZwyU21OkJ-00dUQt; Mon, 22 Feb 2016 22:13:29 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 6/8] drm: msm: move EDP into separate module Date: Mon, 22 Feb 2016 22:08:40 +0100 Message-Id: <1456175331-714117-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:aWQ5lJy6XwPaZvxHiqc2gk/SFdaFCQ+ZLHoUNu1NqGSB+WSd4i6 XSTtElY8Ahe2D/Ujs6REfp1tTK/vywpCCH0WVobXV3POVNqayE6PnGPGMMa2/yIZP0v5tea 9C7oa6GW2yhcsJlh/RNqX3pMUaJKDkHRJ1YpjEQvWKHyAEXizvKBCeVzU4ijloc7zkSzZkw e7mt+XQcWtffJFnzbw/1A== X-UI-Out-Filterresults: notjunk:1; V01:K0:xw+pyFZvWQ8=:R2YCgjrYlPGqcnOr79qkY8 XLYdqIOr55AhTmH4y8Td7p0jcwEEr8bbecjwuVjJDkt01OWSqF6uijATQ0wtCo1ad4k7wZatf WloKQ919Fp3TjCPuw9LTcEIYxhS1UF0/mMmzwUvOs+u+NK0cD4EcDS6z7+LjcZyjwHdusEv88 rKyP+uEojVQNlKtUiqpQofa9OWnaUd3P/PiDCQi/AgMrfVrfuPGOdtuExB8dkI1Gi6zqRdYrR PMskY9yfByKjiG1CQcjQGSzdbhswgk9MEzmXVLoOeBYHKenkFxZVfrYY/fk62N2e2ZbWyhPJX jbw3lZ4Lz5Twj7zytaP7XI1WbME0AhNoyMytl1HiCG/6dtsiyplGey8Ssnz5ze+wv7XEqA4v3 3BoeOpOXr+FcL/M7INc4HH36FZx7AhwLW5uvIV94CO20E0ukwI6Hfs2aUyq6tFE8WhGUg7ZzI av7AmjWfA8hsbLRHCGNvjjjDtq1bkQw3kv6p0r4JkOSXq00RWvZ7do98E6LXnlM3bbNUF4NQT R3krg0AVnbDlui7TdKcqLBMXBGGhET9xubCW+0G3J3HwInv8GyLuK4di7H9qN5fAUlM0K9ttE 5BEHIulpVFhPDaUdgeAzxAdesBSN4HTSK832Das2ppEir8CIR8fBMtucDgghapZOxJP6Ma7On ovkoglQ3WkWr2WszRiQ7MfsDkGkw/Pp1310FDga1rCXLrqSiiHN8SGpXsXMcWhU3rNf0= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Moving around the Makefile for EDP caused a link error with the main driver referring to a builtin module that has no exported symbols: drivers/gpu/built-in.o: In function `msm_drm_register': :(.init.text+0x654): undefined reference to `msm_edp_register' This changes the EDP symbol to a 'tristate' so we can build it as a module, and exports the symbols as necessary. Fixes: 75a5cfa5739f ("drm/msm/edp: Create separate Makefile/Kconfig") --- drivers/gpu/drm/msm/Makefile | 2 +- drivers/gpu/drm/msm/edp/Kconfig | 7 ++++++- drivers/gpu/drm/msm/edp/Makefile | 4 +++- drivers/gpu/drm/msm/edp/edp.c | 4 ++++ drivers/gpu/drm/msm/msm_drv.h | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 4b18a2c670b9..e67bdaa14635 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -41,7 +41,7 @@ drm-msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o obj-$(CONFIG_DRM_MSM_DSI_MODULE) += dsi/ obj-$(CONFIG_DRM_MSM_HDMI) += hdmi/ -obj-$(CONFIG_DRM_MSM_EDP) += edp/ +obj-$(CONFIG_DRM_MSM_EDP_MODULE) += edp/ obj-$(CONFIG_DRM_MSM) += drm-msm.o drm_msm_helper.o diff --git a/drivers/gpu/drm/msm/edp/Kconfig b/drivers/gpu/drm/msm/edp/Kconfig index 576d8c2fd713..b4cecabebc1d 100644 --- a/drivers/gpu/drm/msm/edp/Kconfig +++ b/drivers/gpu/drm/msm/edp/Kconfig @@ -1,7 +1,12 @@ config DRM_MSM_EDP - bool "Enable EDP support in MSM DRM driver" + tristate "Enable EDP support in MSM DRM driver" depends on DRM_MSM default y help Choose this option if you have a need for Embedded Display Port encoder support. + +config DRM_MSM_EDP_MODULE + tristate + default y if DRM_MSM=y && DRM_MSM_EDP=m + default DRM_MSM_EDP diff --git a/drivers/gpu/drm/msm/edp/Makefile b/drivers/gpu/drm/msm/edp/Makefile index e623d59d1706..37c45037f76f 100644 --- a/drivers/gpu/drm/msm/edp/Makefile +++ b/drivers/gpu/drm/msm/edp/Makefile @@ -1,3 +1,5 @@ ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -obj-y := edp.o edp_aux.o edp_bridge.o edp_connector.o edp_ctrl.o edp_phy.o +obj-$(CONFIG_DRM_MSM_EDP_MODULE) := drm-msm-edp.o + +drm-msm-edp-y := edp.o edp_aux.o edp_bridge.o edp_connector.o edp_ctrl.o edp_phy.o diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c index 0940e84b2821..48645d0d649a 100644 --- a/drivers/gpu/drm/msm/edp/edp.c +++ b/drivers/gpu/drm/msm/edp/edp.c @@ -11,6 +11,7 @@ * GNU General Public License for more details. */ +#include #include #include "edp.h" @@ -136,12 +137,14 @@ void __init msm_edp_register(void) DBG(""); platform_driver_register(&edp_driver); } +EXPORT_SYMBOL_GPL(msm_edp_register); void __exit msm_edp_unregister(void) { DBG(""); platform_driver_unregister(&edp_driver); } +EXPORT_SYMBOL_GPL(msm_edp_unregister); /* Second part of initialization, the drm/kms level modeset_init */ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, @@ -206,3 +209,4 @@ fail: return ret; } +EXPORT_SYMBOL_GPL(msm_edp_modeset_init); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 86df81b46eb0..8786738a6832 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -266,7 +266,7 @@ static inline void __exit msm_hdmi_unregister(void) #endif struct msm_edp; -#ifdef CONFIG_DRM_MSM_EDP +#if IS_ENABLED(CONFIG_DRM_MSM_EDP) void __init msm_edp_register(void); void __exit msm_edp_unregister(void); int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, From patchwork Mon Feb 22 21:08:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102713 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1479183lbl; Mon, 22 Feb 2016 13:14:58 -0800 (PST) X-Received: by 10.98.89.215 with SMTP id k84mr41358627pfj.66.1456175698704; Mon, 22 Feb 2016 13:14:58 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id v68si42023081pfi.16.2016.02.22.13.14.58; Mon, 22 Feb 2016 13:14:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 71D1A6E2D5; Mon, 22 Feb 2016 21:14:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 776986E2D5 for ; Mon, 22 Feb 2016 21:14:55 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0LfSYr-1a9ZMu3HIn-00p3Qr; Mon, 22 Feb 2016 22:14:49 +0100 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 8/8] drm: msm: separate out module driver registration Date: Mon, 22 Feb 2016 22:08:42 +0100 Message-Id: <1456175331-714117-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456175331-714117-1-git-send-email-arnd@arndb.de> References: <1456175331-714117-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:68M7QHQplpRF/ZmNyzjR35foYY3rPDpo0iiqFLNUb3jui//WRTa kFIgeb2ook4Yf9Sk1ndYagKvnNI78FinwssGQtvFYg4jXKOmRrcW3284dCPYWXZyHbEU7J2 ECqu070+MyVNlJeU9CThuYNW61uSwt3PNo/FofxWoE20H0md01ko+0MAlo9HbOyzNS8MpJU 1kkYSkVJ0p5DWM1oKoaKA== X-UI-Out-Filterresults: notjunk:1; V01:K0:bs7I8V0Ra4w=:Qf2Bgdc+tHaePAHaCrVOLp Yf9ZP2G+Q35WPguQYMtNJQJxUvq4N/Po9EXbuqPH176APQnEXONtQ4SgupjMTO6gUbLvId9+r q60frtnhLuJKOG56ha8ng0VnvYcvB8YquXy7glVtG4uN1RTt9aJaZ/3gQVOoX3Y0z7vTW7Ss5 G12kityc/Vp6mYQZeqJ1YIkYDFD90k0nD+DUYcIb96L2I+49gDowVs31HXifPp4dmTNIiJv9y 12DZ72Vhj21qJNLDSn3jySjtJn4oeDy8jbRu/9J/Enqnj3j28kkdXqq51BdjYkaXZ3tXSRdMJ f4mKAJ9TO0mpaaXXf1OIVyu8p/CIyMbjbZ3iKCAv58nFgGpzdwBJ3/svsjWFmgUfMfmzb7jQM wUaHBZhrug5Z01wzY2N4ZYotv7pqGoBTtpgdpyIaeJ+Fq7RMNX3tj/kYb/FA5+dcX0FcF0q/9 j8/Ameug+IrS7ha1NzdtXfBHbl+NeEZ3C20qvKu0k3Q7ZL6SHz7B7nNHZ6cP1ETrfEqeHCKY+ 4ZK99k/HFk+AHlqssdezppCjBbhcMxo+BkMP/0HKkscy22kR+3tcg7kFtN3QMQ5B16UfPAk8d GoPMQAslScBHdVNe6tiP9MHAuvF0espMuF+9gRWuOmwEOkCQ1sjjmHYr8HiAGENM6GH0YCmZm RfoYuZULQltIjQpchA5l3qTz51dzodZ97vMcvYip9HZcEHag0tWu3kj36Cy5RRQn188k= Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The msm driver currently has a single module_init() function but consists of multiple modules that each register a platform driver. This changes the msm_drm_register() function to not call the other functions but instead rely on module load order and/or link order to ensure that the other modules were probed earlier. The patch is not tested but should not change behavior. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/dsi/dsi.c | 17 ++++++++++++----- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 +- drivers/gpu/drm/msm/edp/edp.c | 15 +-------------- drivers/gpu/drm/msm/hdmi/hdmi.c | 16 +++++++++++----- drivers/gpu/drm/msm/hdmi/hdmi.h | 2 +- drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 6 ------ drivers/gpu/drm/msm/msm_drv.h | 28 ---------------------------- 8 files changed, 27 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 8523a7cdc419..db260814dfff 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -172,21 +172,28 @@ static struct platform_driver dsi_driver = { }, }; -void __init msm_dsi_register(void) +static int __init msm_dsi_register(void) { + int ret; + DBG(""); msm_dsi_phy_driver_register(); - platform_driver_register(&dsi_driver); + ret = platform_driver_register(&dsi_driver); + + if (ret) + msm_dsi_phy_driver_unregister(); + + return ret; } -EXPORT_SYMBOL_GPL(msm_dsi_register); +module_init(msm_dsi_register); -void __exit msm_dsi_unregister(void) +static void __exit msm_dsi_unregister(void) { DBG(""); msm_dsi_phy_driver_unregister(); platform_driver_unregister(&dsi_driver); } -EXPORT_SYMBOL_GPL(msm_dsi_unregister); +module_exit(msm_dsi_unregister); int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM]) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 91a95fb04a4a..ab7106c150da 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -393,7 +393,7 @@ void __init msm_dsi_phy_driver_register(void) platform_driver_register(&dsi_phy_platform_driver); } -void __exit msm_dsi_phy_driver_unregister(void) +void msm_dsi_phy_driver_unregister(void) { platform_driver_unregister(&dsi_phy_platform_driver); } diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c index 48645d0d649a..fb952bb4e0e0 100644 --- a/drivers/gpu/drm/msm/edp/edp.c +++ b/drivers/gpu/drm/msm/edp/edp.c @@ -131,20 +131,7 @@ static struct platform_driver edp_driver = { .of_match_table = dt_match, }, }; - -void __init msm_edp_register(void) -{ - DBG(""); - platform_driver_register(&edp_driver); -} -EXPORT_SYMBOL_GPL(msm_edp_register); - -void __exit msm_edp_unregister(void) -{ - DBG(""); - platform_driver_unregister(&edp_driver); -} -EXPORT_SYMBOL_GPL(msm_edp_unregister); +module_platform_driver(edp_driver); /* Second part of initialization, the drm/kms level modeset_init */ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 8e01d942d1c9..20c77d933556 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -518,16 +518,22 @@ static struct platform_driver msm_hdmi_driver = { }, }; -void __init msm_hdmi_register(void) +static int __init msm_hdmi_register(void) { + int ret; + msm_hdmi_phy_driver_register(); - platform_driver_register(&msm_hdmi_driver); + ret = platform_driver_register(&msm_hdmi_driver); + if (ret) + msm_hdmi_phy_driver_unregister(); + + return ret; } -EXPORT_SYMBOL_GPL(msm_hdmi_register); +module_init(msm_hdmi_register); -void __exit msm_hdmi_unregister(void) +static void __exit msm_hdmi_unregister(void) { platform_driver_unregister(&msm_hdmi_driver); msm_hdmi_phy_driver_unregister(); } -EXPORT_SYMBOL_GPL(msm_hdmi_unregister); +module_exit(msm_hdmi_unregister); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index b04a64664673..23702d0057e4 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -190,7 +190,7 @@ void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy); void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock); void msm_hdmi_phy_powerdown(struct hdmi_phy *phy); void __init msm_hdmi_phy_driver_register(void); -void __exit msm_hdmi_phy_driver_unregister(void); +void msm_hdmi_phy_driver_unregister(void); #ifdef CONFIG_COMMON_CLK int msm_hdmi_pll_8960_init(struct platform_device *pdev); diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c index 5530631e2d49..05ca860add6d 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c @@ -222,7 +222,7 @@ void __init msm_hdmi_phy_driver_register(void) platform_driver_register(&msm_hdmi_phy_platform_driver); } -void __exit msm_hdmi_phy_driver_unregister(void) +void msm_hdmi_phy_driver_unregister(void) { platform_driver_unregister(&msm_hdmi_phy_platform_driver); } diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 5430ea7d2375..3d04cd922cf0 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -954,9 +954,6 @@ static struct platform_driver msm_platform_driver = { static int __init msm_drm_register(void) { DBG("init"); - msm_dsi_register(); - msm_edp_register(); - msm_hdmi_register(); adreno_register(); return platform_driver_register(&msm_platform_driver); } @@ -965,10 +962,7 @@ static void __exit msm_drm_unregister(void) { DBG("fini"); platform_driver_unregister(&msm_platform_driver); - msm_hdmi_unregister(); adreno_unregister(); - msm_edp_unregister(); - msm_dsi_unregister(); } module_init(msm_drm_register); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 905c17e373e7..abb15334bfa3 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -247,39 +247,19 @@ struct hdmi; #if IS_ENABLED(CONFIG_DRM_MSM_HDMI) int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder); -void __init msm_hdmi_register(void); -void __exit msm_hdmi_unregister(void); #else static inline int msm_hdmi_modeset_init(struct hdmi *hdmi, struct drm_device *dev, struct drm_encoder *encoder) { return -EINVAL; } - -static inline void __init msm_hdmi_register(void) -{ -} - -static inline void __exit msm_hdmi_unregister(void) -{ -} #endif struct msm_edp; #if IS_ENABLED(CONFIG_DRM_MSM_EDP) -void __init msm_edp_register(void); -void __exit msm_edp_unregister(void); int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, struct drm_encoder *encoder); #else -static inline void __init msm_edp_register(void) -{ -} - -static inline void __exit msm_edp_unregister(void) -{ -} - static inline int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev, struct drm_encoder *encoder) @@ -295,17 +275,9 @@ enum msm_dsi_encoder_id { MSM_DSI_ENCODER_NUM = 2 }; #if IS_ENABLED(CONFIG_DRM_MSM_DSI) -void __init msm_dsi_register(void); -void __exit msm_dsi_unregister(void); int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM]); #else -static inline void __init msm_dsi_register(void) -{ -} -static inline void __exit msm_dsi_unregister(void) -{ -} static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoders[MSM_DSI_ENCODER_NUM])