Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9289729ybi; Wed, 24 Jul 2019 01:27:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqlxZIozAoI5/Jy15lcyfq6aj0jnC9f2qwAHjKVPD9G6QgjW3Oo82t/gbvHdN3wL0e61+y X-Received: by 2002:aa7:90c9:: with SMTP id k9mr9802148pfk.171.1563956876933; Wed, 24 Jul 2019 01:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563956876; cv=none; d=google.com; s=arc-20160816; b=S3rOfubeHnawDNIyhvmALZvPk72EBFSCF9j8ShxgogYnkQOIzfmHX9zjTA3LLsiU1a AKpwlnUqc1UjA7oTyi9FMMzt0AGKc1euTfjOLRzJCejP48A6UZW3FCkdjuWBiX20kUzv kvkKLnPvjjOOkUAS/f7AQnkROyo+bli93ShW386LFzm0XaELLvGZ/UBj2vEL5+hUBjtD DD1T9XnQdj4LKa4H6nf9Bm2yfUi89bEndgxN3kDd7Lb+RPS5ZgZHsIdPu2fPOgCtYsLE YPG8DZsfkMwgMwT3bUPjFongDjKtpN27ZkVvipTtLpNnsushOaK46wFhmyZMhd5LEof2 iR6A== 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=fKxkD02366JB5IdAqT4wbLtrtWIwI1gSRslxcR13y+o=; b=VOPWysmSHjHn22v7gvz5l4AuOaDSaOcF/6VmdaFcaWzsEQI7VSLkpxPxRWsSkm1TO7 gmKqfn0V1E9eSQs6HEf91u/gU9A27/l+A0sfZS81EUADJdSY6atL223khBTH5IL7nt2M l4hRNne78z18th3ob4jNwCNfsRyANZLjN+FNkz7wRVc/ChWrDg03Wc6NFkZRZjQap2W5 DqLqQbhVOalfr6p3E6zQqoTuJlTWbr8U9nrrTD89P7QxQ1R8LTtlxAAnjK0WHoJIy9nM +xMHi77PBlsao3wwjbNOxZe5O4FI9IdfyNIC++0LvzL8PLuBaYsnVrnAzJerhoiNVWLV xFnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=T4HKhvlg; 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 w11si13198683pgr.321.2019.07.24.01.27.41; Wed, 24 Jul 2019 01:27:56 -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=T4HKhvlg; 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 S1726430AbfGXIZT (ORCPT + 99 others); Wed, 24 Jul 2019 04:25:19 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35315 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbfGXIZQ (ORCPT ); Wed, 24 Jul 2019 04:25:16 -0400 Received: by mail-wr1-f67.google.com with SMTP id y4so45952546wrm.2 for ; Wed, 24 Jul 2019 01:25:14 -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=fKxkD02366JB5IdAqT4wbLtrtWIwI1gSRslxcR13y+o=; b=T4HKhvlgZIWgcdonCwhUhZ3z+OEMFR/VSNhly7EEEAg7ipweH4u94whK9fTSYtNalr A/ZDt1qF8tnciMbF2GaMwoANWwTw7ibVTh+qpbN9eBDzTNuBikvlgWFT3/W8yXiQ65o+ L/Kfld+bCNV5HT2TCqpZdB3NEHBbGHbb7eXfQ34QumXq6miX6zEK0ZL6/RoERC8e7NXf aAgZY1kRFmPwv/Eftv11bIuUf9DzGT0ijX+XdWtnBOLMkYwa0ok6QAqfUmY823CadqWv 34VWd5C7zkUqo3+hjF9c0SbM7Dzuz9p8gjzOV3rlJsApgvJndtsV5/LhA45zTSLsby8S u4VQ== 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=fKxkD02366JB5IdAqT4wbLtrtWIwI1gSRslxcR13y+o=; b=pJ3ZzP7QvtB/s2h7Jpbg6YQDPwPZ3d1SK0q3pjDLHhXPQMDKwXrGePM+6VS8Cw3ciY S4zMO5WvZ30FlGV9SVvl6zTO2b86XlDqd5ZeVaZg3SoR7wvWQFkqsSsU5jQiAGV7Ztfb TyVQol5/3ZA8xF6VGM/ouwOnGzDQkN3AAqNzqm7hc20Zj9fBxyqKrUFtiaAHjE+Q07hj UEOJh+Hjn8a7WAm314oL6+OHyrkSn8fJa+3esm0HAg5N29XaDL1K4ICeAVsKrL/7m5cu UTnFX+imVj2rrVcVZwzIMhU63qvrjXq7opt0NDHFh022FPMx/zt3zZF8sJNqovVl+cAo si2w== X-Gm-Message-State: APjAAAXgFsbSQlT8Ad0znpC05xo9zSid4D40OhtbtXgtUJlkiXBNoHIB eiZAhmBWb1YkpvwXqgdh5Go= X-Received: by 2002:adf:ec0d:: with SMTP id x13mr36709389wrn.240.1563956713776; Wed, 24 Jul 2019 01:25:13 -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 z7sm42393880wrh.67.2019.07.24.01.25.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:13 -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 v3 1/7] sh: ecovec24: add additional properties to the backlight device Date: Wed, 24 Jul 2019 10:25:02 +0200 Message-Id: <20190724082508.27617-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190724082508.27617-1-brgl@bgdev.pl> References: <20190724082508.27617-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 --- 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