Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3110364ybd; Fri, 28 Jun 2019 03:04:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1P7KrD41bqV0NiRjrny589Bk2b4S8WHF+3Kt0NH0SatPYY9K4nc19Y2+Z5eYNuSLczglw X-Received: by 2002:a17:902:b187:: with SMTP id s7mr10390522plr.309.1561716276291; Fri, 28 Jun 2019 03:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561716276; cv=none; d=google.com; s=arc-20160816; b=0ewDjNDQHE0BaIdbXTgvi76HRTd5k6oLL0MTcgH9WLVSuhVTE+tBPLfrePP9+PtEpa nuwaS5O/2eiSb4vvJAwRs88kJNwMiFswbvtFeSKwIQnhHuRUEBUNd6dFUIppp01CaMSq twFrwK6fuA5f2DhU7iAs0qbNm4Pzghowjr+zQHWeVQUo+i337j6qkbU91sEbjDI6xy7c 2eeHvd9Oyv86v0judeR5WMrfjh1XGTK/l8EKN4Z8RjBVQSlWvm5IJBE1dLv6GnhrjX/v w/72PZEqQcmQpUaWWD8twpIrdU88XmE+jqcsNYEJp/dv1cguW3AkLcu4Bp44xSjRrcH8 C+jg== 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=GGqxgKbISNdi5e/x5HhzKXsLs3cXXjmKFOn4BNngRymmwQQi4+rIfYAZ4dDHNW/zoW eZjF0E0hTFY8ucoI8BkQnAForL44kbkfyf/URL9ofmYJnW+hvPnT71mtmsGFDnOrLWhU GBYNgGb224HjZsaL6x0WjmYO8dU2+nq9m4Iz3DHaxNtmoWiqhNTEto8JFk/ZM0aXZhFI 9k8ZFcaEe9+Ka5G94xsgnARraKBsy6MCF5BQcs+qqyd2x7gxSJx/5zMXTqPulLUB1dBC PFu39KidquHgFL1KeK2HgopM8ph+rK+K6jq65fpzAziCHb9ZRCoCX8Rwro9Fc5ic+iZd AX1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=e4MZgyhk; 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 h185si1789791pge.199.2019.06.28.03.04.19; Fri, 28 Jun 2019 03:04:36 -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=e4MZgyhk; 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 S1726766AbfF1KDT (ORCPT + 99 others); Fri, 28 Jun 2019 06:03:19 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33012 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbfF1KDG (ORCPT ); Fri, 28 Jun 2019 06:03:06 -0400 Received: by mail-wm1-f67.google.com with SMTP id h19so8997153wme.0 for ; Fri, 28 Jun 2019 03:03:05 -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=e4MZgyhkaBCcepB2UsfuVfMG6ppjiDnGbz9M79hYKRlZFD1dfOZfKqq/Z6s3I71WSy 6EWWm6HcpnfPlDylc6RkNICWKI20aotoUFlMqVqwI7XmWNhUr3um5ww6jiMDFo8OsYPU 5tBd7f9XIBXqM1+IIDt8/VvJ36ZmYODC22e48EWw78V3Oe+BvkiEQMBA+21buJ9Ozd6h stDj8jo5MynT4DCP4CIhUwPrIMVVxqfWSJeapQoVc1FODSlcZ/q0XKVmRfFCnxyVVgGJ g0I6ZmlL1WxbdI6TPIYy9H9c7W4+vZYJaNAyIDPV4bRKIzfHHdP9S9u5nVHzVPvxI/l7 Rpig== 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=CFrAnkEH2EQ1Dmhd9+gFoG/ondhHq2kTWUK1KnSPQV7rwk5idbj+F/Ord9F3DLcVIV ChRItr419Ez9w9SaB7WJyHpkKkmkpBCo+BCWkkjrs2mtOWYrhpFfZIgV2w1ntEiyJCLY lpGMQSlMxx+i7Ryag/oxtPgqcXmWZZR6+0xWmFVKbkCrDpXRBW3KvA3JUVha/B5hvPnw cLujOCW6geBxpsTvDkT5S+0q7NWfRZ8NbB9llxNg8q/Q2L4YtLyK4aMhSaJ8QeD3f1h4 S+CeMO15JgIUrne8MqnJpWqaqoBBuq31ev+3VHtmw0XuztKFnGeHMz6zaNN4TTnNK3r0 V7mA== X-Gm-Message-State: APjAAAW6PipGXZ/eu6eo7EOv9oNEHWqOgVGDxFmo7L0kQ4IEM47i9JS0 +yZSF1sRB9enJWuVgyVVePGUTA== X-Received: by 2002:a7b:c206:: with SMTP id x6mr6707413wmi.156.1561716184473; Fri, 28 Jun 2019 03:03:04 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id l124sm1628874wmf.36.2019.06.28.03.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 03:03:03 -0700 (PDT) From: Bartosz Golaszewski To: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij 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 RFT 1/4] sh: ecovec24: add additional properties to the backlight device Date: Fri, 28 Jun 2019 12:02:50 +0200 Message-Id: <20190628100253.8385-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190628100253.8385-1-brgl@bgdev.pl> References: <20190628100253.8385-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