From patchwork Thu Mar 15 22:42:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 10285881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF7B360386 for ; Thu, 15 Mar 2018 22:42:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFE3226220 for ; Thu, 15 Mar 2018 22:42:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C13B02877E; Thu, 15 Mar 2018 22:42:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C43C26220 for ; Thu, 15 Mar 2018 22:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932764AbeCOWmN (ORCPT ); Thu, 15 Mar 2018 18:42:13 -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-Google-Smtp-Source: AG47ELunN8MTk3YDrSrrt0kHkYNCJOkWszANYtjNzOqMxFiDIBR/jg+e2Qp2UWK9gA2/ieqH0L316A== 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-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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",