From patchwork Mon Dec 2 19:32:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269653 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 44B311593 for ; Mon, 2 Dec 2019 19:33:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 230D320848 for ; Mon, 2 Dec 2019 19:33:58 +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="pt4eRo+r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728226AbfLBTd4 (ORCPT ); Mon, 2 Dec 2019 14:33:56 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42216 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbfLBTdy (ORCPT ); Mon, 2 Dec 2019 14:33:54 -0500 Received: by mail-lf1-f66.google.com with SMTP id y19so756761lfl.9; Mon, 02 Dec 2019 11:33:51 -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=sQFlzyFny1i3dHVwTEws0fP7Z8KCjLT5c7TINBzn22A=; b=pt4eRo+rlUMtO4GzjerqssqjlO0TO1vFSYLwXnfqMSsS6I6x4kY1DKOw6u9G9vdsgW VAXzxTR5zDmXqrnHapjbB2IRlTBgXXfxGeEzL71oJVndvo7oGsIzdM4JNNW+vJ9wI25g Qpon0HiFbTQdsFgeRb9y24Z617Q2A4fAEvuGRRje5A0OM5b/IzFlUNEFnzszoF9xFYKW CFKHrlknb1/H6PzMT5qxX68gQRn6wKxNlsb26QKyV9LEm0W4VdQaXIu/ffS0UbmwteSa ESNzQZVCq6Z1dS+LBlZ71mm/mZiCmeduZsUF8YAG5RFC59oKdaCyFJU+oIb5eWrZqitl CEAw== 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=sQFlzyFny1i3dHVwTEws0fP7Z8KCjLT5c7TINBzn22A=; b=VA1D9gY44+nnra9oW2yqbGHJCAxRnsVubdxM6m7HV8O2BmduGin8akX1ufJl95cgCz VsLqFuDwfW15LNNGvG/F5QmDiAcUfcpBsQJpS1xyskG5wYHDDzR/7GIXByveavRLS1O/ E/P86J+7TMNx/pXEKOpKA7PMIUrwRAXpK7lnfPDIXNDf9MgnK+029+gnIG8/hcPAH/YD PoI8F9ozEc/8kpnxTljcikulwVoTc5EJYOLGEo1w6nUDB9xFI9N7mMYB747+Ffvj+Z4x qOPteBfKo2OSkyQRftotwhR9DoXBLFk9inNQoib89SBksto2wk2XG5OLujWZjctSwqcg Kf5A== X-Gm-Message-State: APjAAAXCVu2KSG8C2/zE/Ao1eeEI5tll3uRgMQHDCBF9uBraK5sVZ7M4 ZiIThklJDRQw9CqdY1mIVGs= X-Google-Smtp-Source: APXvYqw+I2ccfhtX+jZIDSZ8cLTRrK19+BfFlN/G+FBcKPfk4B/UKRsY/a6pLRlAL5tf08+wnj+Qzg== X-Received: by 2002:ac2:4a89:: with SMTP id l9mr397464lfp.121.1575315231117; Mon, 02 Dec 2019 11:33:51 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:50 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Cc: Abhinav Kumar , Andrzej Hajda , Benjamin Gaignard , Boris Brezillon , Daniel Vetter , David Airlie , Jagan Teki , Jitao Shi , Linus Walleij , 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 , Sam Ravnborg Subject: [PATCH v1 25/26] drm/panel: tpo-td028ttec1: use drm_panel backlight support Date: Mon, 2 Dec 2019 20:32:29 +0100 Message-Id: <20191202193230.21310-26-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use the backlight support in drm_panel to simplify the driver Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/panel/panel-tpo-td028ttec1.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c index 37252590b541..cf29405a2dbe 100644 --- a/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c @@ -17,7 +17,6 @@ * H. Nikolaus Schaller */ -#include #include #include #include @@ -83,7 +82,6 @@ struct td028ttec1_panel { struct drm_panel panel; struct spi_device *spi; - struct backlight_device *backlight; }; #define to_td028ttec1_device(p) container_of(p, struct td028ttec1_panel, panel) @@ -243,8 +241,6 @@ static int td028ttec1_enable(struct drm_panel *panel) if (ret) return ret; - backlight_enable(lcd->backlight); - return 0; } @@ -252,8 +248,6 @@ static int td028ttec1_disable(struct drm_panel *panel) { struct td028ttec1_panel *lcd = to_td028ttec1_device(panel); - backlight_disable(lcd->backlight); - jbt_ret_write_0(lcd, JBT_REG_DISPLAY_OFF, NULL); return 0; @@ -334,10 +328,6 @@ static int td028ttec1_probe(struct spi_device *spi) spi_set_drvdata(spi, lcd); lcd->spi = spi; - lcd->backlight = devm_of_find_backlight(&spi->dev); - if (IS_ERR(lcd->backlight)) - return PTR_ERR(lcd->backlight); - spi->mode = SPI_MODE_3; spi->bits_per_word = 9; @@ -350,6 +340,10 @@ static int td028ttec1_probe(struct spi_device *spi) drm_panel_init(&lcd->panel, &lcd->spi->dev, &td028ttec1_funcs, DRM_MODE_CONNECTOR_DPI); + ret = drm_panel_of_backlight(&lcd->panel); + if (ret) + return ret; + return drm_panel_add(&lcd->panel); }