Received: by 10.213.65.68 with SMTP id h4csp38374imn; Thu, 15 Mar 2018 15:56:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELuBtEZ5cVx0HByYRhrMY3DM08sGYTDX02oK11UKHiijmMcHZPKJuOMHby9kwvptlPYGygNr X-Received: by 10.98.92.194 with SMTP id q185mr8944981pfb.63.1521154600789; Thu, 15 Mar 2018 15:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521154600; cv=none; d=google.com; s=arc-20160816; b=a7LDyCNdWzzv2i7/RgLaBAL/2uTgb+Py5h7CCtQTIQYKhngw1UTHkWAULAfAxLQQbZ E9m8Tro6MuwojYWR2u5PX1U3UOKGQrD31+nefQcEIEiylhwuawyBkqelUc4EwTPw1s3v 1U2Dc5Dp44T6gQ4uHYsMSZPqyIk/NIWMM3GFVKiXkSuIYrUe8gmxPXVJOykMR3ihZoBp J00f2qpv6HlTCaPwarxy2Brfj1awAhBAoeqajcIkqCndCDXKhtNcNnCmV4/OK9iQRSM6 vK4A3Zi3vJaIAaiYlZGZ8ChZYL5HiFLhMIX2KkpZStHZqgqcpuwe/iVOcM1O3THrxpg0 nuJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=oAb4lMCSX4/36ML9XRUUO9y7dSF/HbRf8+ckq5RbYcY=; b=OXYJYlFCZLnisSTsiR4TnB7wEyGf2rcFJYPBdbWOBiunoJh7jXOkNkxim7v9E30yTb SFJG17wZF0y5nKaAIduhxOzPQfwcNtU2+udW/s0lvasGgKrtFQvYVsa7EsCHx/Tu56ON DIDF21fMOnZ7PHEUwKBilt4ezEfuEuctWmzoxuAKZtI1rXBej+95R5o6KjG946R6cy1J /vcWQJ8P0rb2cNZRhrReqRO949hZpjF1/uxeMKKxk2UCX/6MpGhq7jLP7+SjggHeYblI p/LreQLiNRSdt5uT7vjKZQ117HvHB+V6fjwwutOof/ditrjzirZDxEgB/6kgn5FF15n9 bspA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EiWKL9lg; 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=QUARANTINE 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 o15si4140527pgd.23.2018.03.15.15.56.24; Thu, 15 Mar 2018 15:56:40 -0700 (PDT) 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=EiWKL9lg; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932806AbeCOWmO (ORCPT + 99 others); Thu, 15 Mar 2018 18:42:14 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33425 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932706AbeCOWmL (ORCPT ); Thu, 15 Mar 2018 18:42:11 -0400 Received: by mail-pl0-f67.google.com with SMTP id c11-v6so4699032plo.0; Thu, 15 Mar 2018 15:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oAb4lMCSX4/36ML9XRUUO9y7dSF/HbRf8+ckq5RbYcY=; b=EiWKL9lge9RGZQfQTdju2avzOOp08dHkjUP1kXleBoBeLuTsXyPaw35ldGPEjzb2RA DvfUB3VfcIoldbEuDf+wXezScL5/BU0zkHSeZ2i8zXOtqwawYH4HWBH4xiEael01bpIt ZLn5f2GdpzcZ8SYwyeH8sYkIMr2sOGhXCcoPcZlezkn5OOBnkQrc+KxC+09jq3rLbsnB 4XQz/JZGKzwkB5BjB7mi9erRVQKkoctIA1qfEDUSKv8yJDFG0wicfLAPVvU6T27g8rfo s1sy2hXW92onWSLNBxV9xafOxm/8hRfkKDBVKdQdfxWG5m3va9tp0l7ELjwF81PM+AkT hEmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oAb4lMCSX4/36ML9XRUUO9y7dSF/HbRf8+ckq5RbYcY=; b=ZVNCHQ564LwMCws4eC/HYbnxn4pYO+FXMyFDnlEqgLgSvoP7GvkO+qcYKYnRlniZjk xaXbNsLu/8enxmnB0sNd49Ac5Hnu2jYWOTLSIIwtUHPQREjT1NB4Myohfa044OhWA9GE cgjRB2a/hu7M8ylDeIHyyC0UY1mA2BIC3YiyUFSzN+jXhNe996a03/M1HZPcwGqLBhcz 6Pm4Mibm4M1LpuTLOFpvjZUR8mWX0Ey3wWNMWx/kSOLz499yBbJary/jb7p7LHNJsYyQ UtMW7MbfBZPRwpe8kxb2m4WYOsQqE+uEBcAidzSIY1QM8Nfm9nuTF6erQZRgrzEbJaQx 9e7w== X-Gm-Message-State: AElRT7F4bmRITxAyl6KBnwk421COh8FREGjbMYmJFUXVAznC03r/1oU8 i8+kYPiAUP5WYfCNXRkPEG8= X-Received: by 2002:a17:902:1763:: with SMTP id i90-v6mr9603892pli.309.1521153730155; Thu, 15 Mar 2018 15:42:10 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id c62sm4607888pfk.179.2018.03.15.15.42.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 15:42:08 -0700 (PDT) From: Dmitry Torokhov To: Laurent Pinchart , Lee Jones Cc: Daniel Thompson , Jingoo Han , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, Yoshinori Sato , Rich Felker , Linus Walleij Subject: [RFC 3/4] sh: ecovec24: convert backlight to use device properties Date: Thu, 15 Mar 2018 15:42:01 -0700 Message-Id: <20180315224202.96668-4-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180315224202.96668-1-dmitry.torokhov@gmail.com> References: <20180315224202.96668-1-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of backlight legacy platform data, let's switch to using device properties and GPIO lookup tables. Signed-off-by: Dmitry Torokhov --- arch/sh/boards/mach-ecovec24/setup.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 67633d2d42390..ad3d48b3ead19 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -11,11 +11,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -30,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -367,17 +368,21 @@ static struct platform_device lcdc_device = { }, }; -static struct gpio_backlight_platform_data gpio_backlight_data = { - .gpio = GPIO_PTR1, - .def_value = 1, - .name = "backlight", +static struct gpiod_lookup_table gpio_backlight_gpios_table = { + .dev_id = "gpio-backlight.0", + .table = { + GPIO_LOOKUP_IDX("sh7724_pfc", GPIO_PTR1, NULL, 0, GPIO_ACTIVE_HIGH); + { } + }, +}; + +static struct property_entry gpio_backlight_properties[] = { + PROPERTY_ENTRY_BOOL("default-on"), + { } }; static struct platform_device gpio_backlight_device = { .name = "gpio-backlight", - .dev = { - .platform_data = &gpio_backlight_data, - }, }; /* CEU0 */ @@ -1436,6 +1441,8 @@ static int __init arch_setup(void) return error; if (use_backlight) { + device_add_properties(&gpio_backlight_device.dev, + gpio_backlight_properties); error = platform_device_add(&gpio_backlight_device); if (error) pr_warn("%s: failed to register backlight: %d\n", -- 2.16.2.804.g6dcf76e118-goog