From patchwork Fri Jun 28 18:08:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 13716495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 654EFC2BD09 for ; Fri, 28 Jun 2024 18:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TES+PR3oco/zso5TBiV82fiMxzPeRQiTqnjOENaSm6Y=; b=L2CIZfPOeQ4WsqpGOJaxAQ7Il4 aBaCrIDTnif/pdxhDrA4mAwbju7FQroqRLqeYwoL35g7sw1ALJ7Z9SQgqbyl7OE+fjR9y92Ot5B3y gG3biuVXFhnan8tW51292PRr4y5pwUUmEdoH4sPX/kHx9kNUZszBr4MOEUr8LWd7fvGQXaCSNolcw ecjGoKS5JX7McIXUmZCDPcxTmFdZT4Jaetz/k0Ms9sodCxnuP3K3/NxdCdeSBNYT2F+T+ptp3rQAx rWJGmM9g/oFm28xbNbMn8kjRtg5P4wr7RCpQENaNKwnvTme9nlhWVvOLBY6K0n40zJ9fJmqnyd4fK aF/wTfyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNG2u-0000000EahY-2S0U; Fri, 28 Jun 2024 18:10:04 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNG22-0000000EaFe-3kTH for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 18:09:12 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3d561e564d0so525321b6e.1 for ; Fri, 28 Jun 2024 11:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719598150; x=1720202950; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TES+PR3oco/zso5TBiV82fiMxzPeRQiTqnjOENaSm6Y=; b=monSsnvUaFFpQzpQdcZxN+chgxjjUIXvzTlFS5NSDT9jdpIjwXXH46m1lBVMdNv7+S aUhpxf7G2D3OEKMt74tjvnyQ4hZYPrIeAJDC/XOZFnSi9pYX7ci3jkjpVklmR8GxQ9JX SMH+ZSvAOoJ7XQsZAxc38x6+oqXI9OWkVVKTo6CDoq/F8JTm1oj20mWmmtRbkc/lPrNR gLfUc33ncpzjGYJReyYuIBG9M3GdhBZiNZJJIiGKptsSdN0d+wjjYPW84zGiFB0PeVCQ n0Q+ssiIQMUXRGY7S3wmz+3ISxeXB5sxvJF9fyRDoT6ISNSvQrWxBj4fxUFDqiVU3Z82 4Yyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719598150; x=1720202950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TES+PR3oco/zso5TBiV82fiMxzPeRQiTqnjOENaSm6Y=; b=lJ2x92uwrV5RmZJtatepihsKpnW0lgpNC8QHqUQuPOoF2nT1oaYt+rRdq+vXSMxZra QN+IM+aXYcuN/pj2gyMbpqsdONk7cQgRYFutkwfrGeoeq78O5WdfHOT6IpiM3DqeEuUj aYM74O1yfM6Ll3f/xRZxhoKYX07mQbazFXaPn8XyrWUtNfbj2IJOBCPqno23PVBpLr1M YNnqhVx3JH9yCLcPSZ1huqOsoCWeLseEsBVYsUFkDRqInyZJLaFu+EBISYQPFFzeeEHz C2Fcaw/Fn/UPxSJLMNjdpVTMfFdiWPzl7wu7VSsN4/fwNG82885zbN8fuzI9aQD05pzo E4cA== X-Gm-Message-State: AOJu0YxuHtBlSb03LeVRB2R+WAGrALMZW+RgDwhg5xS0i7QceCaijF8Q DVjshLNw0DbUSPYslFUhkHzXUzNsvNfVX7zdpyItF8FBg+u6YECI X-Google-Smtp-Source: AGHT+IFbVQmOnqIXtYzrw7G3AGIcltAq/SwDu0tAxwBmNb/x6ZxkTvrB7B5PQEu7pirK0ugnnATPyg== X-Received: by 2002:a05:6808:16a6:b0:3d2:22c6:59d3 with SMTP id 5614622812f47-3d541c50f73mr19803715b6e.6.1719598149794; Fri, 28 Jun 2024 11:09:09 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:c929:2998:720d:a104]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7080295d1f4sm1982911b3a.91.2024.06.28.11.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 11:09:09 -0700 (PDT) From: Dmitry Torokhov To: Haojian Zhuang , Daniel Mack , Robert Jarzmik , Arnd Bergmann , Linus Walleij , soc@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/10] ARM: spitz: Use software nodes to describe LCD GPIOs Date: Fri, 28 Jun 2024 11:08:47 -0700 Message-ID: <20240628180852.1738922-8-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog In-Reply-To: <20240628180852.1738922-1-dmitry.torokhov@gmail.com> References: <20240628180852.1738922-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240628_110910_952819_C04964AA X-CRM114-Status: GOOD ( 15.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert Spitz to use software nodes for specifying GPIOs for the LCD. Signed-off-by: Dmitry Torokhov --- arch/arm/mach-pxa/spitz.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 278d49ed7a9c..c79510185ce3 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -532,22 +532,24 @@ static struct gpiod_lookup_table spitz_ads7846_gpio_table = { }, }; -static struct gpiod_lookup_table spitz_lcdcon_gpio_table = { - .dev_id = "spi2.1", - .table = { - GPIO_LOOKUP("sharp-scoop.1", 6, "BL_CONT", GPIO_ACTIVE_LOW), - GPIO_LOOKUP("sharp-scoop.1", 7, "BL_ON", GPIO_ACTIVE_HIGH), - { }, - }, +static const struct property_entry spitz_lcdcon_props[] = { + PROPERTY_ENTRY_GPIO("BL_CONT-gpios", + &spitz_scoop_2_gpiochip_node, 6, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_GPIO("BL_ON-gpios", + &spitz_scoop_2_gpiochip_node, 7, GPIO_ACTIVE_HIGH), + { } }; -static struct gpiod_lookup_table akita_lcdcon_gpio_table = { - .dev_id = "spi2.1", - .table = { - GPIO_LOOKUP("i2c-max7310", 3, "BL_ON", GPIO_ACTIVE_HIGH), - GPIO_LOOKUP("i2c-max7310", 4, "BL_CONT", GPIO_ACTIVE_LOW), - { }, - }, +static const struct property_entry akita_lcdcon_props[] = { + PROPERTY_ENTRY_GPIO("BL_ON-gpios", + &akita_max7310_gpiochip_node, 3, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("BL_CONT-gpios", + &akita_max7310_gpiochip_node, 4, GPIO_ACTIVE_LOW), + { } +}; + +static struct software_node spitz_lcdcon_node = { + .name = "spitz-lcdcon", }; static struct corgi_lcd_platform_data spitz_lcdcon_info = { @@ -572,6 +574,7 @@ static struct spi_board_info spitz_spi_devices[] = { .bus_num = 2, .chip_select = 1, .platform_data = &spitz_lcdcon_info, + .swnode = &spitz_lcdcon_node, }, { .modalias = "max1111", .max_speed_hz = 450000, @@ -606,11 +609,6 @@ static void __init spitz_spi_init(void) struct platform_device *pd; int err; - if (machine_is_akita()) - gpiod_add_lookup_table(&akita_lcdcon_gpio_table); - else - gpiod_add_lookup_table(&spitz_lcdcon_gpio_table); - gpiod_add_lookup_table(&spitz_ads7846_gpio_table); pd = platform_device_register_full(&spitz_spi_device_info); @@ -619,6 +617,8 @@ static void __init spitz_spi_init(void) pr_err("pxa2xx-spi: failed to instantiate SPI controller: %d\n", err); + spitz_lcdcon_node.properties = machine_is_akita() ? + akita_lcdcon_props : spitz_lcdcon_props; spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); } #else