From patchwork Sat Dec 7 14:03:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11277479 X-Patchwork-Delegate: kieran@bingham.xyz 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 6A5BE6C1 for ; Sat, 7 Dec 2019 14:04:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48C5C24673 for ; Sat, 7 Dec 2019 14:04:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D5+RmOPm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbfLGOEw (ORCPT ); Sat, 7 Dec 2019 09:04:52 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37994 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbfLGOEv (ORCPT ); Sat, 7 Dec 2019 09:04:51 -0500 Received: by mail-lj1-f195.google.com with SMTP id k8so10695767ljh.5; Sat, 07 Dec 2019 06:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tMLaH1DcHQ+vslghT8+TRlkI4S2XQo8E4UTpDmragvw=; b=D5+RmOPm/+yiH3s+zhgEQGpCAmW0YXmO48/99b7aaUbSUOvDCUGN6xw3aJGZok+YIl iOJ+GDzDZKJQC457IWNLRwXQHFFwdVfDRnUxN+Q7eaI6POWbKXfSJ8cw7sb4/mHRBbpi ynYuv49Pik/w7Xr+hnv7Fi0/jsE3DCzwGrHOx8y12KhtuP7nx4tbQpEOjP15CtyBnrUX XF9CEacwHFVlssgCdD8nufa44SMQTmfwEHhskW5VZv72NI/qHuVzIXGwQbkNs2JJwkcG qRlj1jvP7/PKAwsYvBF1P1bdl67vM/vuuvfH12DLL0tbY5NLpnHWbygQMkLMGPC8O8NJ sHbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tMLaH1DcHQ+vslghT8+TRlkI4S2XQo8E4UTpDmragvw=; b=GtD7fhVV/Afe0YJBucjCesD8HIyjA8vj+7Jpzq1+VdandKBr6MeKRy+B8SBMMn6DSZ WsBlkwzyBmh3Juxd5KrfmtOcoghlp5b49SHQ6LDCrdqfzV9l90wBTGvLIQo4UNnjQxAU aOATDjWBmtFG4sWj2DwQz7wvBstcoRzAEUOnMqSmgHUp4dG0dzz5luBKyhrGHr9v+4bs IzN2Jewtl/fp+vyxA7IPIFzDOF99JUNB8sz+3GTg5QdI4t4A6RWHm6iybIhv+PobYVmx wv/F2WuC1R/jyv9OJCBG3ywrgcAzH3n6eaGSJNu8eDUz02f7PcdSc18koB6bu1Ny0G9e NXYQ== X-Gm-Message-State: APjAAAV9DznIzbwatchuQGpPJyMnz9xjvrP2Obln8ZoJbFEVKFkFqxeI lmEcO1GL7ce5THbumaMjl38= X-Google-Smtp-Source: APXvYqy+3wJ62tFG4eYTppjZHiTHnpCgFKPf2bYaW1HgVGCJ9bYH7aEQPcT0zxepBy1VmMfRB5FgmQ== X-Received: by 2002:a05:651c:153:: with SMTP id c19mr11950509ljd.237.1575727489236; Sat, 07 Dec 2019 06:04:49 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id w17sm5644188lfn.22.2019.12.07.06.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 06:04:48 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart , Linus Walleij , Sam Ravnborg Cc: Abhinav Kumar , Andrzej Hajda , Benjamin Gaignard , Boris Brezillon , Daniel Vetter , David Airlie , Jagan Teki , Jitao Shi , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Neil Armstrong , NXP Linux Team , Pengutronix Kernel Team , Purism Kernel Team , Sean Paul , Stefan Agner , Tomi Valkeinen Subject: [PATCH v2 22/25] drm/panel: sitronix-st7701: use drm_panel backlight support Date: Sat, 7 Dec 2019 15:03:50 +0100 Message-Id: <20191207140353.23967-23-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191207140353.23967-1-sam@ravnborg.org> References: <20191207140353.23967-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Reviewed-by: Laurent Pinchart Cc: Jagan Teki Cc: Thierry Reding Cc: Sam Ravnborg --- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index c08a865a2a93..4b4f2558e3b4 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -103,7 +102,6 @@ struct st7701 { struct mipi_dsi_device *dsi; const struct st7701_panel_desc *desc; - struct backlight_device *backlight; struct regulator_bulk_data *supplies; struct gpio_desc *reset; unsigned int sleep_delay; @@ -223,7 +221,6 @@ static int st7701_enable(struct drm_panel *panel) struct st7701 *st7701 = panel_to_st7701(panel); ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); - backlight_enable(st7701->backlight); return 0; } @@ -232,7 +229,6 @@ static int st7701_disable(struct drm_panel *panel) { struct st7701 *st7701 = panel_to_st7701(panel); - backlight_disable(st7701->backlight); ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00); return 0; @@ -366,10 +362,6 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) return PTR_ERR(st7701->reset); } - st7701->backlight = devm_of_find_backlight(&dsi->dev); - if (IS_ERR(st7701->backlight)) - return PTR_ERR(st7701->backlight); - drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs, DRM_MODE_CONNECTOR_DSI); @@ -384,6 +376,10 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) */ st7701->sleep_delay = 120 + desc->panel_sleep_delay; + ret = drm_panel_of_backlight(&st7701->panel); + if (ret) + return ret; + ret = drm_panel_add(&st7701->panel); if (ret < 0) return ret;