Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4686810pxu; Tue, 13 Oct 2020 04:58:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTnp+9kXpMPetk9yA+7wGBztucxRwt0O40ZmOcCVr8zC7jj6NutSCSNk57eJCMKn3H/D6P X-Received: by 2002:aa7:c259:: with SMTP id y25mr19170010edo.249.1602590315164; Tue, 13 Oct 2020 04:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602590315; cv=none; d=google.com; s=arc-20160816; b=aEABZExw3Wc5dN8x0tVeOHlZ0ePir2tNzhcqZe9hGv8nMaYd0mcMXdggRSXBjR3Y5C XrJFGvQgtjQYT04Rtdfnde/KECWsau3ckshphXh1RoVqwXtRpY9M1B4I3VoAk4ARBFZt qUnNFmLIBHSVmMQ/gL4m/B0iCHUfTSk1tPuvCRSv3yxcdkLxEJC7TR3goDBYSsaqNfj6 KSO29XFwRiixSotUkrIu8BUzIAntimBEu5EBgcK5YPj/Di89upNiQmSv1p52Ys+uI+Pj j5fTGKkCpRnGa/QWHZBkdKNvccm3teS6YNej5pKQM4L+UCr6a0fTOzEhBH/3brFAfV/k YClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from :dkim-signature; bh=l6oP45WcVRM0/1Zade6UO1YMZaUQsobbk+zH4sNyXtA=; b=1HfC7xpwZxjRAUM4HEdlaDPt2Q44ZzxfMRLbwQjcn6JuP0PCx0PxMOlAi5E7PhkPpm 0zKIy4z/dUc4wKROKpAjOZHef9CpL17fGEIE1wUt5cd7/gglntF+m3P94zv3f3F7O9KI yJEl5vltmRzW1KuiYisxdImPGZurWVvU8TtQZFMHx11IhIKE9B7sVR8EsLXYMlwmtr/A ov+OLB4N7nH8eN+oRo8iesFufYp3+/KnXWL8lF2IzJv38tG8I/XVUmghSkNLkgOUuCqp tpQR0yo4rY1FxnR96kDgFv/JzbWOHNbDbweBuIvcE21gtavES1R8hT7EsHIRyapS+xnb PrhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="uO4Xm1s/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o1si14256442edv.320.2020.10.13.04.58.12; Tue, 13 Oct 2020 04:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="uO4Xm1s/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390520AbgJMH4c (ORCPT + 99 others); Tue, 13 Oct 2020 03:56:32 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:57326 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390460AbgJMH4b (ORCPT ); Tue, 13 Oct 2020 03:56:31 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09D7kgmG012100; Tue, 13 Oct 2020 09:56:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=l6oP45WcVRM0/1Zade6UO1YMZaUQsobbk+zH4sNyXtA=; b=uO4Xm1s/pECB4P4nQyB7uda6nWxGqbAlr74HWupWcRelRv9xk9aI2EtTvJ/MMhvdX5CR hKkr3uRQ0zYdhWPgoxQHKdgUd3JtKL/n0ZAbFvB2ILZSKdBPt8xv0IIcTStqfNNeBUbc OaQO77jon/lBKvsfN+djUJcuUsxoExMQUtMsxM4vwuYAgOSTsdn74p9wxMtlFIpcT9H/ PQ8RYJq1YG5eYowp2Lqv7+FZgxdvfNI+tgizrM7ZZBCFKbXa7TOaoZ0PlF4UmxnDUIDj qIxmPp5FKBDN7cSAfCPOGi6aJqvhliv/nHJJqEHf1liUcT0sjJuy2sVcK4kE9obPxWOo KQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3455c88yra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 09:56:19 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 16F4A100034; Tue, 13 Oct 2020 09:56:18 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node1.st.com [10.75.127.4]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 025F42A84BC; Tue, 13 Oct 2020 09:56:18 +0200 (CEST) Received: from localhost (10.75.127.48) by SFHDAG2NODE1.st.com (10.75.127.4) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 13 Oct 2020 09:56:17 +0200 From: Yannick Fertre To: Yannick Fertre , Philippe Cornu , Antonio Borneo , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , , Subject: [PATCH v2] drm/stm: dsi: Use dev_ based logging Date: Tue, 13 Oct 2020 09:56:05 +0200 Message-ID: <20201013075605.5103-1-yannick.fertre@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG2NODE1.st.com (10.75.127.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-13_02:2020-10-13,2020-10-13 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Standardize on the dev_ based logging. Signed-off-by: Yannick Fertre --- Changes in v2: - restore function dsi_color_from_mipi. - reword commit. drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 55 ++++++++++++++------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index 164f79ef6269..a5a87c89aa07 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,12 +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 +354,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; } @@ -364,13 +368,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) 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(dev, "Failed to request regulator: %d\n", ret); return ret; } 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; } @@ -378,27 +382,26 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) 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(dev, "Unable to get pll reference clock: %d\n", ret); goto err_clk_get; } 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; } @@ -407,7 +410,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; } @@ -420,7 +423,7 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) if (IS_ERR(dsi->dsi)) { ret = PTR_ERR(dsi->dsi); if (ret != -EPROBE_DEFER) - DRM_ERROR("Failed to initialize mipi dsi host: %d\n", ret); + dev_err(dev, "Failed to initialize mipi dsi host: %d\n", ret); goto err_dsi_probe; } @@ -449,7 +452,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); @@ -462,18 +465,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; } -- 2.17.1