From patchwork Mon Feb 22 09:22:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 12098173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC79CC433DB for ; Mon, 22 Feb 2021 09:24:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 838D764E44 for ; Mon, 22 Feb 2021 09:24:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 838D764E44 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Zko0OgNdJxaHjGrdSlWNwk8EISzUs3CXo8rbbWc2I8A=; b=xnUd/1dixqvpHPu5Ht+XRPngm U6dv/B7+8Q97UtI52C7KWmShCGKl4SqwJVUE6uewSYa7b6JY75JNqLtZkKYt25TLmHONIKbjdmsYF fr412rNIGV2AabRakR3HipGRtXGRCFq0jKDF8AqmX90Qm818BX0BFT4BSIVTa3/pxKzjLPgif3S/T ySEMr7Op1EvInjBK+TNuIHDm5LfzeajJ8zIiNITfxCSeoUgdJGeSSLMoEA6+kgdCE70R/rRsgd95L 3IVv5Ot2JSckacrl1Mot0z/hf961g5140kEPb1WvvSM4BnNZcmEKYvfxHJgPT5u1I714PClW9CC6t DKoedYevw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE7Qr-0000Jj-KZ; Mon, 22 Feb 2021 09:23:09 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE7Qm-0000I1-F9 for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2021 09:23:05 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11M9KlGt016260; Mon, 22 Feb 2021 10:22:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=selector1; bh=CEx+dJ33M2OiDJi9X3qiBhe30dtWSWB5g83Cp50fZwo=; b=SPezn6Ht4XYEb6ypx4NcpjfSKDUoxH9t7hs3mdMsQ7MmKdt4RSveqAbhYkBBCyoOHRbY vfrMA0SbCiZTs+WUJhv3vmXA4RzvXAMYSGrNDXYwXpRxutrPXka73iN8Ebg/9Jo5CiRJ 8tE5oHCUh3TBGjldR8e0zMkJXCbZO4Tc14l5xL6F46/ezS2bydlp4/8SOSnSGx7/oZD9 PKt15Ns7tEg5lhEvcIoHt1uuKujNlWsp/f1PDbRFwUciVEXCXlXFZzhrc2BoDiD/erEL ZjOxXQO5X7jdc8L1lY4Df0hTF0yPb2KhWjivfinODJo7zEMH8Y63rFErZoxOCs+9D+Ac wQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 36ttn6tneb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Feb 2021 10:22:58 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 32CE010002A; Mon, 22 Feb 2021 10:22:58 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2342B21F0A7; Mon, 22 Feb 2021 10:22:58 +0100 (CET) Received: from SFHDAG2NODE3.st.com (10.75.127.6) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 22 Feb 2021 10:22:57 +0100 Received: from SFHDAG2NODE3.st.com ([fe80::31b3:13bf:2dbe:f64c]) by SFHDAG2NODE3.st.com ([fe80::31b3:13bf:2dbe:f64c%20]) with mapi id 15.00.1473.003; Mon, 22 Feb 2021 10:22:57 +0100 From: Raphael GALLAIS-POU - foss To: Yannick FERTRE , Philippe CORNU , Benjamin Gaignard , Vincent ABRIOU , Sam Ravnborg , "Joe Perches" Subject: [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Thread-Topic: [PATCH 1/2] drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER Thread-Index: AQHXCPxOHztlhOrGKUWaJgLQSaRSdw== Date: Mon, 22 Feb 2021 09:22:57 +0000 Message-ID: <20210222092205.32086-2-raphael.gallais-pou@foss.st.com> References: <20210222092205.32086-1-raphael.gallais-pou@foss.st.com> In-Reply-To: <20210222092205.32086-1-raphael.gallais-pou@foss.st.com> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.46] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-02-22_02:2021-02-18, 2021-02-22 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_042304_729457_C1673864 X-CRM114-Status: GOOD ( 17.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Raphael GALLAIS-POU - foss , David Airlie , Yannick FERTRE - foss , Raphael GALLAIS-POU , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Alexandre TORGUE - foss , Philippe CORNU - foss , Maxime Coquelin , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , Alexandre TORGUE Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yannick Fertre Don't print error when probe deferred error is returned. Signed-off-by: Raphael Gallais-Pou Signed-off-by: Yannick Fertre Tested-by: Yannick Fertre --- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 2e1f2664495d..8399d337589d 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -363,8 +363,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) dsi->vdd_supply = devm_regulator_get(dev, "phy-dsi"); if (IS_ERR(dsi->vdd_supply)) { ret = PTR_ERR(dsi->vdd_supply); - if (ret != -EPROBE_DEFER) - DRM_ERROR("Failed to request regulator: %d\n", ret); + dev_err_probe(dev, ret, "Failed to request regulator\n"); return ret; } @@ -377,9 +376,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) dsi->pllref_clk = devm_clk_get(dev, "ref"); if (IS_ERR(dsi->pllref_clk)) { ret = PTR_ERR(dsi->pllref_clk); - if (ret != -EPROBE_DEFER) - DRM_ERROR("Unable to get pll reference clock: %d\n", - ret); + dev_err_probe(dev, ret, "Unable to get pll reference clock\n"); goto err_clk_get; } @@ -419,7 +416,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) dsi->dsi = dw_mipi_dsi_probe(pdev, &dw_mipi_dsi_stm_plat_data); if (IS_ERR(dsi->dsi)) { ret = PTR_ERR(dsi->dsi); - DRM_ERROR("Failed to initialize mipi dsi host: %d\n", ret); + dev_err_probe(dev, ret, "Failed to initialize mipi dsi host\n"); goto err_dsi_probe; } From patchwork Mon Feb 22 09:23:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 12098175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E8EAC433E9 for ; Mon, 22 Feb 2021 09:24:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2CFA8601FE for ; Mon, 22 Feb 2021 09:24:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CFA8601FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BfMdwc9V8gtNc5LCqSV6uxmdyp13XicWWOSVLHu/JKI=; b=SdQksRO6rOTHwemX88fmc/s23 sHUZrZcNvuleALX5MzQEeXwa/egSgp++XerfIPwzoCnRBvMzAAGQ1mRXAr2RLWJEf8BL6yc/1Fd6q dwgnuPUqEAya5vCF3SJz2C+b1UgErHs/j8C4IuAkRhzusRk88KGk6Ry2kpCMRyJkphXUyXSeX5DSi 1meffEy9ihQQj9/VwRuUWyoYZyqkWB/HIGf6Qgzmdas3VkqMM4aLLGEbpRx5fdYI0HYNRsKliAefz QXXUDMs7tL59iw7DJU9IVL0BQMLOw6/8HTSJczYEmGce47WldDd/T7kiynlq/SR6zZyjlapzUBJv0 O1iZ3WnfQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE7Qw-0000KK-IU; Mon, 22 Feb 2021 09:23:14 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE7Qq-0000J0-FP for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2021 09:23:10 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11M9MAGo023929; Mon, 22 Feb 2021 10:23:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=selector1; bh=S80jikv95dWkyePNxJCMqVCdNCkmEjOC6tUVNbKerlg=; b=o1jGoGrS+AkIdFwIgbSxUCvi1Kjk91pX4+g2uIpIKp9K9aT5y2Na+QhyGOwM9a4bUtDL o7GRg9isTwY3FnNsfqz92EB7QKhMq3aME3YMp4ifJAVjTRtKAZg+8U5caKXQtXNv8O/n lVKL0XdKyzUUtYptk/XmI2dOY+7KslQpkaGRC1Es4F6kPe4cCgLITY95vkL4LoXToics CEhFNgXujgEJOBxNfgvjMfdZ4alaUEhurV+oAKTSc42oRGSbi/dcOSjwoGdHqk/K5Zuz JToWs1su4Nk4E+4TvTZhf8SKa1iKZM/owxdrOv23Autdn1LHCa5ee63lTq7b2kEqGOzp Vw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 36u96ufwtb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Feb 2021 10:23:03 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 33F4910002A; Mon, 22 Feb 2021 10:23:03 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2652121F0A8; Mon, 22 Feb 2021 10:23:03 +0100 (CET) Received: from SFHDAG2NODE3.st.com (10.75.127.6) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 22 Feb 2021 10:23:02 +0100 Received: from SFHDAG2NODE3.st.com ([fe80::31b3:13bf:2dbe:f64c]) by SFHDAG2NODE3.st.com ([fe80::31b3:13bf:2dbe:f64c%20]) with mapi id 15.00.1473.003; Mon, 22 Feb 2021 10:23:02 +0100 From: Raphael GALLAIS-POU - foss To: Yannick FERTRE , Philippe CORNU , Benjamin Gaignard , Vincent ABRIOU , Sam Ravnborg , "Joe Perches" Subject: [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Thread-Topic: [PATCH 2/2] drm/stm: dsi: Use dev_ based logging Thread-Index: AQHXCPxRmuabm72FykCaBQSzcYydLw== Date: Mon, 22 Feb 2021 09:23:02 +0000 Message-ID: <20210222092205.32086-3-raphael.gallais-pou@foss.st.com> References: <20210222092205.32086-1-raphael.gallais-pou@foss.st.com> In-Reply-To: <20210222092205.32086-1-raphael.gallais-pou@foss.st.com> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.46] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-02-22_02:2021-02-18, 2021-02-22 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_042309_012390_18636A9C X-CRM114-Status: GOOD ( 21.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Raphael GALLAIS-POU - foss , David Airlie , Yannick FERTRE - foss , Raphael GALLAIS-POU , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Alexandre TORGUE - foss , Philippe CORNU - foss , Maxime Coquelin , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , Alexandre TORGUE Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yannick Fertre Standardize on the dev_ based logging. Signed-off-by: Raphael Gallais-Pou Signed-off-by: Yannick Fertre Tested-by: Yannick Fertre --- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 49 ++++++++++++++------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 8399d337589d..a7226bb3d0e8 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -76,6 +76,7 @@ enum dsi_color { struct dw_mipi_dsi_stm { void __iomem *base; + struct device *dev; struct clk *pllref_clk; struct dw_mipi_dsi *dsi; u32 hw_version; @@ -110,7 +111,8 @@ static inline void dsi_update_bits(struct dw_mipi_dsi_stm *dsi, u32 reg, dsi_write(dsi, reg, (dsi_read(dsi, reg) & ~mask) | val); } -static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt) +static enum dsi_color dsi_color_from_mipi(struct dw_mipi_dsi_stm *dsi, + enum mipi_dsi_pixel_format fmt) { switch (fmt) { case MIPI_DSI_FMT_RGB888: @@ -122,7 +124,7 @@ static enum dsi_color dsi_color_from_mipi(enum mipi_dsi_pixel_format fmt) case MIPI_DSI_FMT_RGB565: return DSI_RGB565_CONF1; default: - DRM_DEBUG_DRIVER("MIPI color invalid, so we use rgb888\n"); + dev_dbg(dsi->dev, "MIPI color invalid, so we use rgb888\n"); } return DSI_RGB888; } @@ -205,14 +207,14 @@ static int dw_mipi_dsi_phy_init(void *priv_data) ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS, SLEEP_US, TIMEOUT_US); if (ret) - DRM_DEBUG_DRIVER("!TIMEOUT! waiting REGU, let's continue\n"); + dev_dbg(dsi->dev, "!TIMEOUT! waiting REGU, let's continue\n"); /* Enable the DSI PLL & wait for its lock */ dsi_set(dsi, DSI_WRPCR, WRPCR_PLLEN); ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_PLLLS, SLEEP_US, TIMEOUT_US); if (ret) - DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n"); + dev_dbg(dsi->dev, "!TIMEOUT! waiting PLL, let's continue\n"); return 0; } @@ -221,7 +223,7 @@ static void dw_mipi_dsi_phy_power_on(void *priv_data) { struct dw_mipi_dsi_stm *dsi = priv_data; - DRM_DEBUG_DRIVER("\n"); + dev_dbg(dsi->dev, "\n"); /* Enable the DSI wrapper */ dsi_set(dsi, DSI_WCR, WCR_DSIEN); @@ -231,7 +233,7 @@ static void dw_mipi_dsi_phy_power_off(void *priv_data) { struct dw_mipi_dsi_stm *dsi = priv_data; - DRM_DEBUG_DRIVER("\n"); + dev_dbg(dsi->dev, "\n"); /* Disable the DSI wrapper */ dsi_clear(dsi, DSI_WCR, WCR_DSIEN); @@ -267,11 +269,11 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode, if (pll_out_khz > dsi->lane_max_kbps) { pll_out_khz = dsi->lane_max_kbps; - DRM_WARN("Warning max phy mbps is used\n"); + dev_warn(dsi->dev, "Warning max phy mbps is used\n"); } if (pll_out_khz < dsi->lane_min_kbps) { pll_out_khz = dsi->lane_min_kbps; - DRM_WARN("Warning min phy mbps is used\n"); + dev_warn(dsi->dev, "Warning min phy mbps is used\n"); } /* Compute best pll parameters */ @@ -281,7 +283,7 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode, ret = dsi_pll_get_params(dsi, pll_in_khz, pll_out_khz, &idf, &ndiv, &odf); if (ret) - DRM_WARN("Warning dsi_pll_get_params(): bad params\n"); + dev_warn(dsi->dev, "Warning dsi_pll_get_params(): bad params\n"); /* Get the adjusted pll out value */ pll_out_khz = dsi_pll_get_clkout_khz(pll_in_khz, idf, ndiv, odf); @@ -299,13 +301,12 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode, /* Select the color coding */ dsi_update_bits(dsi, DSI_WCFGR, WCFGR_COLMUX, - dsi_color_from_mipi(format) << 1); + dsi_color_from_mipi(dsi, format) << 1); *lane_mbps = pll_out_khz / 1000; - DRM_DEBUG_DRIVER("pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n", - pll_in_khz, pll_out_khz, *lane_mbps); - + dev_dbg(dsi->dev, "pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n", + pll_in_khz, pll_out_khz, *lane_mbps); return 0; } @@ -352,11 +353,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) if (!dsi) return -ENOMEM; + dsi->dev = dev; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dsi->base = devm_ioremap_resource(dev, res); if (IS_ERR(dsi->base)) { ret = PTR_ERR(dsi->base); - DRM_ERROR("Unable to get dsi registers %d\n", ret); + dev_err(dev, "Unable to get dsi registers %d\n", ret); return ret; } @@ -369,7 +372,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) ret = regulator_enable(dsi->vdd_supply); if (ret) { - DRM_ERROR("Failed to enable regulator: %d\n", ret); + dev_err(dev, "Failed to enable regulator: %d\n", ret); return ret; } @@ -382,20 +385,20 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) ret = clk_prepare_enable(dsi->pllref_clk); if (ret) { - DRM_ERROR("Failed to enable pllref_clk: %d\n", ret); + dev_err(dev, "Failed to enable pllref_clk: %d\n", ret); goto err_clk_get; } pclk = devm_clk_get(dev, "pclk"); if (IS_ERR(pclk)) { ret = PTR_ERR(pclk); - DRM_ERROR("Unable to get peripheral clock: %d\n", ret); + dev_err(dev, "Unable to get peripheral clock: %d\n", ret); goto err_dsi_probe; } ret = clk_prepare_enable(pclk); if (ret) { - DRM_ERROR("%s: Failed to enable peripheral clk\n", __func__); + dev_err(dev, "%s: Failed to enable peripheral clk\n", __func__); goto err_dsi_probe; } @@ -404,7 +407,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) { ret = -ENODEV; - DRM_ERROR("bad dsi hardware version\n"); + dev_err(dev, "bad dsi hardware version\n"); goto err_dsi_probe; } @@ -445,7 +448,7 @@ static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev) { struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data; - DRM_DEBUG_DRIVER("\n"); + dev_dbg(dsi->dev, "\n"); clk_disable_unprepare(dsi->pllref_clk); regulator_disable(dsi->vdd_supply); @@ -458,18 +461,18 @@ static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev) struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data; int ret; - DRM_DEBUG_DRIVER("\n"); + dev_dbg(dsi->dev, "\n"); ret = regulator_enable(dsi->vdd_supply); if (ret) { - DRM_ERROR("Failed to enable regulator: %d\n", ret); + dev_err(dev, "Failed to enable regulator: %d\n", ret); return ret; } ret = clk_prepare_enable(dsi->pllref_clk); if (ret) { regulator_disable(dsi->vdd_supply); - DRM_ERROR("Failed to enable pllref_clk: %d\n", ret); + dev_err(dev, "Failed to enable pllref_clk: %d\n", ret); return ret; }