Received: by 10.223.176.46 with SMTP id f43csp970731wra; Wed, 24 Jan 2018 08:37:42 -0800 (PST) X-Google-Smtp-Source: AH8x225Wmyg3b+9ToZzf/thQq4d2gqcCsw6KZsS2RKKt0v6QB2EeAsAEqV7RnJUlry3rTvd0tEYR X-Received: by 10.101.66.193 with SMTP id l1mr11092799pgp.17.1516811862476; Wed, 24 Jan 2018 08:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516811862; cv=none; d=google.com; s=arc-20160816; b=inmYJ7kNZ3bOq37StsD9s/6eBT6DHFJt5bk1Pup/QcvsKKscI/By84WgW9Unn/Hccx OHQEH8fhqw1vR/TTiuwvaF97PqozZF1zQRxBus9BmBfN5mzYNUjpJ85T6xU+AcN7CgEZ 9EAZnwXQkQ3Mwv7l3xJKUHWxPE0N6Y1hUsy+bnFGwI8bnpmBcQ2XTar30/ivn67eGjct fanRtfH7YShBAdt+VvZBbD1Pl8JP1RFL4ByJWnQ8S3LwcMC1t83VYzrqbWmaEQaX+wWQ dj0Lbtzd4jvyiv+oNfb1QsSNuU8dOwnla94WMSBPZnK89suw7tvwgz9X8PudT5JOC6Fx pmSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature :arc-authentication-results; bh=cYWJwcrR5rcHKoa1EyWEavnoK4MXmB5qhchSgKEjtBA=; b=Mg4kV1Ua+JI/Di1YcgSVqDVuE62zcGPVxmPXgMZ7H2yRetRTkpYAkiWj/aUBELgooo XqKuRNffg2VDKiN51NIx+e24pBl8naSFno55FTiiqBmE91qIWWLh4prIr3nh1c/bJrms 7U81Yqb8veEwKJLa2LACpol75r2yzicbhcvwD9j5TBaYkznn6eK6AK2FAvJYFdEQM6Gf 2Q+ZqfNxAXJBMdNAhtr0SN1ZA0iw6xWEZt6jU4XD8QDiWt/rhPaLYwIzYpV+Ok+YghoM oAK79RrrvfUFeYoPbbY/FaUNg3BlWVW9cp3Sno8r+9Our3XE1DjrV+vWVgEw+rxueJdo M3Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VcdzNoki; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si431912pls.500.2018.01.24.08.37.28; Wed, 24 Jan 2018 08:37:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VcdzNoki; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934328AbeAXQgU (ORCPT + 99 others); Wed, 24 Jan 2018 11:36:20 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:46668 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934225AbeAXQgQ (ORCPT ); Wed, 24 Jan 2018 11:36:16 -0500 Received: by mail-pf0-f195.google.com with SMTP id y5so3469455pff.13 for ; Wed, 24 Jan 2018 08:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cYWJwcrR5rcHKoa1EyWEavnoK4MXmB5qhchSgKEjtBA=; b=VcdzNokieycIj8Z7gxQxEBZbeq/9x9jSHtEYl9Qeb7tt/9+xVn/p269rtJt9Pg6Xx+ x/q2fZEdo2XTJ7zip+PXiUgPwnigmknCle7Y+WVDt9x5J4gZBPXsH/kTXqIJFoJvVm+8 eTOxeaIz9Lh+S0SLuyeK737a4SlXir948okEtqNPa25FIAdSYQFoibiyU3d3M7oVMwTP r+V5/c3+sJDJf+Q1YbW/Ky7tCnSDvNSnk6zsBlZ4Oz8j6+KdliQnvOfNeedqpCanYNCf tnBLDZLouN4NEek/qMmgXF8uMcYzWri0MKlvx5j/dfNIYi08VMZX9WKWafqOmBJBvLbp ERPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=cYWJwcrR5rcHKoa1EyWEavnoK4MXmB5qhchSgKEjtBA=; b=jV+KYwT+LSS1XCiT7FfCil9UHYOOXifBR9VRre1aSujmyVEPUW3z9TTuYDSO06F9pX Ppk4AFXThGni20Sa3igqgMF68ZXZHrND8fltPObg1J7dSrlgYvy1xgSKPd/a0QbXQgnZ QrE1sKBWD0GrZGuJWeUTmPGkdQKnvilp6WQudbV8CmVObNpx8YgoemQ823R6C1/cB5fl xo+tI/vkJzwgfaWLulPdXxk41vgDCanNsSGMoT7sJOZ2ol3sk4Q1/z3uIJI+NEzXGHcQ pMRpP8eEuXI5qNpSr31BZAo5P9bfhIMWkTqzZW6X4c+QDKxV29T+hB3exfXnKiF0VbUk TTDQ== X-Gm-Message-State: AKwxytcic4sqo+0zpMHKdEvU6ws0veZlLIJ2is0dO32K4XdkHHrG+WgB Fr1WD4Z+4w3Nh/NRhUp8mDY= X-Received: by 10.98.28.209 with SMTP id c200mr3993688pfc.24.1516811775775; Wed, 24 Jan 2018 08:36:15 -0800 (PST) Received: from raspberrypi ([122.172.61.122]) by smtp.gmail.com with ESMTPSA id j6sm10039162pfg.90.2018.01.24.08.36.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 08:36:14 -0800 (PST) Date: Wed, 24 Jan 2018 16:36:09 +0000 From: Meghana Madhyastha To: Lee Jones , Daniel Thompson , Jingoo Han , Thierry Reding , Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Tomi Valkeinen , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v19 04/10] drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight Message-ID: <11dd1cabd098a730d07ab04c5987b139d14d8b21.1516810725.git.meghana.madhyastha@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove tinydrm_of_find_backlight from tinydrm-helpers.c. We now have a generic of_find_backlight defined in backlight.c. Let the callers of tinydrm_of_find_backlight call of_find_backlight. Also, remove select BACKLIGHT_LCD_SUPPORT and select BACKLIGHT_CLASS_DEVICE from tinydrm/Kconfig as it is a hack that is no longer needed. Reviewed-by: Noralf Tr?nnes Reviewed-by: Sean Paul Signed-off-by: Meghana Madhyastha --- drivers/gpu/drm/tinydrm/Kconfig | 2 -- drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 40 -------------------------- drivers/gpu/drm/tinydrm/mi0283qt.c | 3 +- drivers/gpu/drm/tinydrm/st7735r.c | 3 +- include/drm/tinydrm/tinydrm-helpers.h | 2 -- 5 files changed, 4 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/Kconfig b/drivers/gpu/drm/tinydrm/Kconfig index b0e567d41..13339be84 100644 --- a/drivers/gpu/drm/tinydrm/Kconfig +++ b/drivers/gpu/drm/tinydrm/Kconfig @@ -3,8 +3,6 @@ menuconfig DRM_TINYDRM depends on DRM select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER - select BACKLIGHT_LCD_SUPPORT - select BACKLIGHT_CLASS_DEVICE help Choose this option if you have a tinydrm supported display. If M is selected the module will be called tinydrm. diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index 7326e1758..d1c3ce9ab 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -236,46 +236,6 @@ void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb, } EXPORT_SYMBOL(tinydrm_xrgb8888_to_gray8); -/** - * tinydrm_of_find_backlight - Find backlight device in device-tree - * @dev: Device - * - * This function looks for a DT node pointed to by a property named 'backlight' - * and uses of_find_backlight_by_node() to get the backlight device. - * Additionally if the brightness property is zero, it is set to - * max_brightness. - * - * Returns: - * NULL if there's no backlight property. - * Error pointer -EPROBE_DEFER if the DT node is found, but no backlight device - * is found. - * If the backlight device is found, a pointer to the structure is returned. - */ -struct backlight_device *tinydrm_of_find_backlight(struct device *dev) -{ - struct backlight_device *backlight; - struct device_node *np; - - np = of_parse_phandle(dev->of_node, "backlight", 0); - if (!np) - return NULL; - - backlight = of_find_backlight_by_node(np); - of_node_put(np); - - if (!backlight) - return ERR_PTR(-EPROBE_DEFER); - - if (!backlight->props.brightness) { - backlight->props.brightness = backlight->props.max_brightness; - DRM_DEBUG_KMS("Backlight brightness set to %d\n", - backlight->props.brightness); - } - - return backlight; -} -EXPORT_SYMBOL(tinydrm_of_find_backlight); - #if IS_ENABLED(CONFIG_SPI) /** diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index 79cb5af5a..a8aafce36 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -195,7 +196,7 @@ static int mi0283qt_probe(struct spi_device *spi) if (IS_ERR(mipi->regulator)) return PTR_ERR(mipi->regulator); - mipi->backlight = tinydrm_of_find_backlight(dev); + mipi->backlight = of_find_backlight(dev); if (IS_ERR(mipi->backlight)) return PTR_ERR(mipi->backlight); diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c index 08b4fb18e..2e6b7b8ec 100644 --- a/drivers/gpu/drm/tinydrm/st7735r.c +++ b/drivers/gpu/drm/tinydrm/st7735r.c @@ -5,6 +5,7 @@ * Copyright 2017 David Lechner */ +#include #include #include #include @@ -163,7 +164,7 @@ static int st7735r_probe(struct spi_device *spi) return PTR_ERR(dc); } - mipi->backlight = tinydrm_of_find_backlight(dev); + mipi->backlight = of_find_backlight(dev); if (IS_ERR(mipi->backlight)) return PTR_ERR(mipi->backlight); diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index f54fae03e..0a4ddbc04 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -46,8 +46,6 @@ void tinydrm_xrgb8888_to_rgb565(u16 *dst, void *vaddr, void tinydrm_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb, struct drm_clip_rect *clip); -struct backlight_device *tinydrm_of_find_backlight(struct device *dev); - size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len); bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw); int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, -- 2.11.0