From patchwork Thu Aug 20 12:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11728283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F5D8722 for ; Fri, 21 Aug 2020 07:12:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4E37E21744 for ; Fri, 21 Aug 2020 07:12:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="LtgwUm8b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E37E21744 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none 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 3177B6EAAE; Fri, 21 Aug 2020 07:12:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56EC06E941 for ; Thu, 20 Aug 2020 12:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597925583; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvfqokvJjJRDHqpcvn1CFRGBXyq8hxfGePqgX0+Z6F4=; b=LtgwUm8buWv6hWZGys+DG4WS+MDEUISCg4IkvO42mHToB8Om6L8FH1GoNE7FiVHQz5OE64 83BvSojIvNK8F6W7nWrV0e4fCRN/HZFgrQZWfwRf9yWYoIYbWISJLCTeesCeqTrhfrYUSB KCj7cQB361s8B6qI4s6KzFYDvTo9tkc= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 1/2] drm/panel: novatek,nt39016: Reorder calls in probe Date: Thu, 20 Aug 2020 14:12:55 +0200 Message-Id: <20200820121256.32037-2-paul@crapouillou.net> In-Reply-To: <20200820121256.32037-1-paul@crapouillou.net> References: <20200820121256.32037-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 21 Aug 2020 07:11:07 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil , od@zcrc.me, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The drm_panel_of_backlight() function must be called after drm_panel_init(), according to the function's documentation; otherwise the backlight won't be properly initialized. v2: New patch Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index 39f7be679da5..daa583030246 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -285,6 +285,9 @@ static int nt39016_probe(struct spi_device *spi) return PTR_ERR(panel->map); } + drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs, + DRM_MODE_CONNECTOR_DPI); + err = drm_panel_of_backlight(&panel->drm_panel); if (err) { if (err != -EPROBE_DEFER) @@ -292,9 +295,6 @@ static int nt39016_probe(struct spi_device *spi) return err; } - drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs, - DRM_MODE_CONNECTOR_DPI); - drm_panel_add(&panel->drm_panel); return 0; From patchwork Thu Aug 20 12:12:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11728275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8080E722 for ; Fri, 21 Aug 2020 07:11:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 5F60C21744 for ; Fri, 21 Aug 2020 07:11:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="vdG3dLdP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F60C21744 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none 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 449C86EAA5; Fri, 21 Aug 2020 07:11:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 46BC36E93E for ; Thu, 20 Aug 2020 12:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597925584; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H6AaeB90PvxfVY9WrxZtIpss3tNLOtB/nIbF3+2oWDU=; b=vdG3dLdP29l0b+5WTSa+a7bQKELcpbNkcBt5KYifC1zXijOJWMYVWaj4wKDywkLpevPwvV NxiEnhaTd2cE1wSUvOOQeDxiryKXQfFIE+02B5SaCbWeZfbAld2P9VBYGJtd83odbuPqNH JDMRJkliPlN5CVce7xZyVvl9wsRK7m0= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH v2 2/2] drm/panel: novatek, nt39016: Remove 'dev' field in priv struct Date: Thu, 20 Aug 2020 14:12:56 +0200 Message-Id: <20200820121256.32037-3-paul@crapouillou.net> In-Reply-To: <20200820121256.32037-1-paul@crapouillou.net> References: <20200820121256.32037-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 21 Aug 2020 07:11:07 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil , od@zcrc.me, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is already a 'struct device' pointer in the drm_panel structure, that we can access easily from our priv structure, so there's no need for a separate 'dev' field there. v2: Don't initialize drm_panel->dev manually, it is done by drm_panel_init(). Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index daa583030246..f8151fe3ac9a 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -56,7 +56,6 @@ struct nt39016_panel_info { struct nt39016 { struct drm_panel drm_panel; - struct device *dev; struct regmap *map; struct regulator *supply; const struct nt39016_panel_info *panel_info; @@ -124,7 +123,7 @@ static int nt39016_prepare(struct drm_panel *drm_panel) err = regulator_enable(panel->supply); if (err) { - dev_err(panel->dev, "Failed to enable power supply: %d\n", err); + dev_err(drm_panel->dev, "Failed to enable power supply: %d\n", err); return err; } @@ -143,7 +142,7 @@ static int nt39016_prepare(struct drm_panel *drm_panel) err = regmap_multi_reg_write(panel->map, nt39016_panel_regs, ARRAY_SIZE(nt39016_panel_regs)); if (err) { - dev_err(panel->dev, "Failed to init registers: %d\n", err); + dev_err(drm_panel->dev, "Failed to init registers: %d\n", err); goto err_disable_regulator; } @@ -173,7 +172,7 @@ static int nt39016_enable(struct drm_panel *drm_panel) ret = regmap_write(panel->map, NT39016_REG_SYSTEM, NT39016_SYSTEM_RESET_N | NT39016_SYSTEM_STANDBY); if (ret) { - dev_err(panel->dev, "Unable to enable panel: %d\n", ret); + dev_err(drm_panel->dev, "Unable to enable panel: %d\n", ret); return ret; } @@ -193,7 +192,7 @@ static int nt39016_disable(struct drm_panel *drm_panel) err = regmap_write(panel->map, NT39016_REG_SYSTEM, NT39016_SYSTEM_RESET_N); if (err) { - dev_err(panel->dev, "Unable to disable panel: %d\n", err); + dev_err(drm_panel->dev, "Unable to disable panel: %d\n", err); return err; } @@ -252,7 +251,6 @@ static int nt39016_probe(struct spi_device *spi) if (!panel) return -ENOMEM; - panel->dev = dev; spi_set_drvdata(spi, panel); panel->panel_info = of_device_get_match_data(dev);