Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7295204ybi; Mon, 22 Jul 2019 10:29:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhScj2WPa+UmoqDGbwd1lmHR7+xMj6d/acXDF6K4YQBP1KXaFzo/davov/KtQFNUYthfGE X-Received: by 2002:a17:90a:2305:: with SMTP id f5mr82083313pje.128.1563816544770; Mon, 22 Jul 2019 10:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816544; cv=none; d=google.com; s=arc-20160816; b=Yn/2pfq170tl166bEMR4MuhefKmSZADalLQLX1Poov4vf2XTglXgYR0RtraQ0iOsr2 a8Fnlhj2Xkim+pA8UDJd0r8oeLFpPuusK6UyFAkRk0vAowmwR+9dOOwahPW1cxrfYtDz TOuHkABO98zKReR1Hn3EFN3EaElcne+rW2LMKb6RuLoqe8myolKF1oI08VKnXZouxHTf KdyltvOIaUYmfWhgKp4HTGiPxjmGFoeHLi5NSIvkSeRkxLZOPFGj7u9H5vqWIRto0UXq nYlA4Ro6GoxpKYbvwfYW/kFgYWDKCbAuBtEaYNUPpQmE5otJkUG7jVH56BjMA2gzJ5pY 8dyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SwsPk5YbJoDix1Y8ZNEpxUoFdLsjdX1Ck3sCZ4BgCIs=; b=Tl6m4xEam3g1ZbbKyevY5tdhjixQjFwVclpjEolb05u6LNKjmjmsDDowq2XkoD1SuS haclFCHgGEoctVS16MKmLl0GXEP+nrZQNRLs8yUo7InqszRPo+Z/KC6D5ZEQ6ioUvWs0 WbbFqEA3Rn7s8DGzMSnHfXdj1Ik/6YSj4kqqm7OsDeETFlYMMeVYi6GG4/ZVzd/GpH+L GHbu5Ii1NnoJC424/GFUpah1smgtb0Q6ft/iwRK1iI0jZc+i2mQXSLYGk46zVDzK3leh +mTS7RDRD6vGs2aNcLsz9dy7lIfYPZMkrUnuO6vc+1i1tac0bjhzCb5Yhuo6/t4ILl1V TwUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="SQZ/+WnV"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si10361184plt.386.2019.07.22.10.28.48; Mon, 22 Jul 2019 10:29:04 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="SQZ/+WnV"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727363AbfGVPDU (ORCPT + 99 others); Mon, 22 Jul 2019 11:03:20 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44378 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbfGVPDS (ORCPT ); Mon, 22 Jul 2019 11:03:18 -0400 Received: by mail-wr1-f66.google.com with SMTP id p17so39753992wrf.11 for ; Mon, 22 Jul 2019 08:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SwsPk5YbJoDix1Y8ZNEpxUoFdLsjdX1Ck3sCZ4BgCIs=; b=SQZ/+WnV5BJPHxDGi96UJLVEkg9z9IkQPzlKz4B+qSLOWsMbbSLrMsWe9Sn8XScF8B OJhLOKjurlAR3QdJ2wlCb5qfXiK0i/JPIot4boGvDrJYR/5Z5gctbxBznikNFlI7o70f /ak2Tk4QxEo13aQPnkA1DGfw5AMMrJBJnGLf0HSW4XXLPe7/y7KxxzuQ2SUOOWQT4l5Z GWwbTxvlZJ9r7Y53RA/TaM6ncxP7oZo3ZLh79Qh7xURvRXfLlyCfIXQFhMjf0L4P3rgD 4TWqbr+Tn8tiYFFMYuptbryiKg30hQZve8Waaac+bvXaUpVc4hX4YJAN9ocuqwuGYsjl iqEA== 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:mime-version:content-transfer-encoding; bh=SwsPk5YbJoDix1Y8ZNEpxUoFdLsjdX1Ck3sCZ4BgCIs=; b=Bp17qEwW1jPfYWPIjHAyFH9V8AR+h+h/hJKns/4Mcpi8xGMTgYEE2nrd2ruwr21oNv QbRnVsXcSp0sRJ9ffnKb2lCtgsNEhEMRfK0t84dsqvkn8FrnOXY3mHh9ExLnASUATPkt s4M2neRo1lZW6i/Yy3AJrYKMZ6VfMwBv1tCUtxPShvSdzsM14IE/gLC4Ryz1AeNlw+A3 KJVQoQIqdA7hS2gMjydkbDOOXXbHmt+NWO5xiwAm2VTt2axN6bAq8c0poBvTAwTE6XmB RcByGfVI0LrNWb+M5ejwa++8PmhCEbyHJHoW0XY5E0riannr0tmRTHKd0b6fjavYauyz 6PHw== X-Gm-Message-State: APjAAAVBqKzxeYmfAw6lmxlRllWomtDvGkfX3/Hl+bDrqiNeiYau83WV ttuF0kZpCHKookENcePLhgQ= X-Received: by 2002:a5d:630c:: with SMTP id i12mr70339435wru.312.1563807796735; Mon, 22 Jul 2019 08:03:16 -0700 (PDT) Received: from localhost.localdomain (amontpellier-652-1-281-69.w109-210.abo.wanadoo.fr. [109.210.96.69]) by smtp.gmail.com with ESMTPSA id v23sm36310460wmj.32.2019.07.22.08.03.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 08:03:16 -0700 (PDT) From: Bartosz Golaszewski To: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , Andy Shevchenko Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 1/7] sh: ecovec24: add additional properties to the backlight device Date: Mon, 22 Jul 2019 17:02:56 +0200 Message-Id: <20190722150302.29526-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722150302.29526-1-brgl@bgdev.pl> References: <20190722150302.29526-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Add a GPIO lookup entry and a device property for GPIO backlight to the board file. Tie them to the platform device which is now registered using platform_device_register_full() because of the properties. These changes are inactive now but will be used once the gpio backlight driver is modified. Signed-off-by: Bartosz Golaszewski --- arch/sh/boards/mach-ecovec24/setup.c | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index f402aa741bf3..6926bb3865b9 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -371,6 +371,19 @@ static struct platform_device lcdc_device = { }, }; +static struct gpiod_lookup_table gpio_backlight_lookup = { + .dev_id = "gpio-backlight.0", + .table = { + GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH), + { } + }, +}; + +static struct property_entry gpio_backlight_props[] = { + PROPERTY_ENTRY_BOOL("default-on"), + { } +}; + static struct gpio_backlight_platform_data gpio_backlight_data = { .fbdev = &lcdc_device.dev, .gpio = GPIO_PTR1, @@ -378,13 +391,15 @@ static struct gpio_backlight_platform_data gpio_backlight_data = { .name = "backlight", }; -static struct platform_device gpio_backlight_device = { +static const struct platform_device_info gpio_backlight_device_info = { .name = "gpio-backlight", - .dev = { - .platform_data = &gpio_backlight_data, - }, + .data = &gpio_backlight_data, + .size_data = sizeof(gpio_backlight_data), + .properties = gpio_backlight_props, }; +static struct platform_device *gpio_backlight_device; + /* CEU0 */ static struct ceu_platform_data ceu0_pdata = { .num_subdevs = 2, @@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = { &usb1_common_device, &usbhs_device, &lcdc_device, - &gpio_backlight_device, &keysc_device, &cn12_power, #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) @@ -1464,6 +1478,12 @@ static int __init arch_setup(void) #endif #endif + gpiod_add_lookup_table(&gpio_backlight_lookup); + gpio_backlight_device = platform_device_register_full( + &gpio_backlight_device_info); + if (IS_ERR(gpio_backlight_device)) + return PTR_ERR(gpio_backlight_device); + return platform_add_devices(ecovec_devices, ARRAY_SIZE(ecovec_devices)); } -- 2.21.0