Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3792722ybp; Sun, 6 Oct 2019 20:34:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8nAXcfJhmJVfKAGUrk7xxvzEzQjmywYonCFGn7mYpGPGYVhvh1Hw1Lvfi7EkQM+Ju/B4o X-Received: by 2002:a05:6402:16d5:: with SMTP id r21mr26657228edx.71.1570419262399; Sun, 06 Oct 2019 20:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570419262; cv=none; d=google.com; s=arc-20160816; b=H8HUVdz1CTBhU8vtNIQwHSauqKHxOUkwearJeuqWlnHJ5NYo4RKnIecVSZ0wmUTC1c 9QAvpPKOw2p/gTVadD/SRVYD6Bws7GIHIcaZ3i0cMxg0FtlGtvPn7JigfFoe24eYj3Ek +AFuEeaRzuJG5PW2ttgucO1Q+JD+1ILMUjVFH8dJ1OhrbbPg2v3ImisabLr01u+rsJee k5ElHf0hO+JZYRebG2RE9SdPOFoIiOpq2WteBKC5Al7PpLRunIEZoBJFhbNl027WCs4j enCG+vj9n0qDWiD4ApSyLl34lQiQyJt8sLgX5X0h/5484U8xadQU8lYV+70zNp980ur6 EfOQ== 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=l2IW6NowdeBUIPfd3VNaI3dgAIYTgpRJtcprF0UeLqs=; b=WHiV6QcaqbqtesqPubw5eYb5sAlXtRYWdh+4/tC/mnSj3QwR7/z1giXrSz7OH8KsGZ TuPLvUFj3llAnCCpGqPYD0NLEo+/4U7nO0mk+pyt70qhEpEvAUuCHduN2wCHj+3WpTKd LWClPkWaqY3vYdO0bo1mXFv0oq9cLeAki+ROV0xsSHIdTZkny8+swpeN3L+DsM8wDAwH ek8fcnIjtU5/cbg6O8BByY0U12GijDm344f5v89ych1kebivu0PxJdwY8LbWQ1R8vvOx bTHtofOQYsH0noQwmSAcZFs+EbR5o0QNfIZ4k5dgPdN4m57IMb1qmXN/iKdI7EV+egay ssAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=AukjubrN; 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 s14si8323294edc.83.2019.10.06.20.33.58; Sun, 06 Oct 2019 20:34:22 -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=AukjubrN; 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 S1727311AbfJGDca (ORCPT + 99 others); Sun, 6 Oct 2019 23:32:30 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44127 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727169AbfJGDcH (ORCPT ); Sun, 6 Oct 2019 23:32:07 -0400 Received: by mail-pf1-f194.google.com with SMTP id q21so7705351pfn.11 for ; Sun, 06 Oct 2019 20:32:06 -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=l2IW6NowdeBUIPfd3VNaI3dgAIYTgpRJtcprF0UeLqs=; b=AukjubrN4PDGMujmBkvHkgJfZ+2GlL0+Em3we5DHYt1NKwR5PJeW21D490d/mSjHb/ WlavS8gY35Bu5tottt++wT/UVqxZQHKZ88I/ijmFGikylQxJznYzS/4/cnHa2yWjxH4S r85pSvF9OuxrZu/koI8IPS3ydYYxYFxoDDN+jD8Sl5vdFB6Nkj37zoHjwOd/HLsCucJO XuWDYoOx69SijkEI1t4XJNUF5xo9kNXa7/7z2U+qkTiKueqpcOYocwP5edhzj95An56K hteswR2v8OjuGxYiyRu/wtgLcILNVCsjJeun6mrx5hFvSrKDb0MLgl+om7f+IQRNTzyj CjuQ== 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=l2IW6NowdeBUIPfd3VNaI3dgAIYTgpRJtcprF0UeLqs=; b=emFFokhjVYFagv0UBp9J/4wXFuCJag/n422FeWhA2RYjTFWE2tBQp4wzQR3q+Cg0Uu v0ciXzPkpNbcJyRntTR9PhRqpHDcfjBdyymGVI0X7o72BQdocWAjkH91Os56SK6YZHVJ +0o071vk1ktaF9OBi+gr8qE/Jx7LwLsC7T6zVbUNKHOPF815hPDJLuz/J12JHLD3dTHF PGKwAls8gKiWNf2SMWG5BUzpVqfTPO1c5b417jtuQxO30Ha7MyPldKJ6wmsfFNC7USPt dL0gQT5dhJpaWbBv/IPwkWzlQZc52Os7KSfxRuTyus+iF+vRIKjYhrz5jbTESsY2Biaq 7PKg== X-Gm-Message-State: APjAAAWarlC/xGVpzeQYKWnIBnfunoxFlZsY87JOVETe1ZgojNNa+IQr pYtnJn78pm5EGm4+Gn+tbUklnQ== X-Received: by 2002:aa7:8585:: with SMTP id w5mr30810659pfn.82.1570419125926; Sun, 06 Oct 2019 20:32:05 -0700 (PDT) Received: from debian-brgl.local (96-95-220-76-static.hfc.comcastbusiness.net. [96.95.220.76]) by smtp.gmail.com with ESMTPSA id x10sm16377720pfr.44.2019.10.06.20.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2019 20:32:05 -0700 (PDT) From: Bartosz Golaszewski To: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , Andy Shevchenko , Jacopo Mondi 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 v5 2/7] sh: ecovec24: add additional properties to the backlight device Date: Mon, 7 Oct 2019 05:31:55 +0200 Message-Id: <20191007033200.13443-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191007033200.13443-1-brgl@bgdev.pl> References: <20191007033200.13443-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 Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij --- 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 acaa97459531..aaa8ea62636f 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) @@ -1462,6 +1476,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.23.0